From report at bugs.python.org Tue Mar 1 00:46:58 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2022 05:46:58 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646113618.12.0.944745543083.issue44807@roundup.psfhosted.org> Guido van Rossum added the comment: Oops. So this is an intentional feature -- Protocol replaces __init__ so that you can't (accidentally) instantiate a protocol. And the code to do this has changed a couple of times recently to deal with some edge cases. At least one of the PRs was by Yurii, who created this issue. I didn't read through all that when I closed the issue, so I'm reopening it. Maybe Yurii can devise a solution? (Although apparently their first attempt, https://github.com/python/cpython/pull/27543 was closed without merging.) Yurii and Lukasz should probably figure this out. ---------- resolution: third party -> stage: resolved -> test needed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 00:55:08 2022 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Tue, 01 Mar 2022 05:55:08 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646114108.83.0.267480953908.issue44807@roundup.psfhosted.org> Change by Adrian Garcia Badaracco : ---------- pull_requests: +29750 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/31628 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:00:41 2022 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Tue, 01 Mar 2022 06:00:41 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646114441.81.0.80808056915.issue44807@roundup.psfhosted.org> Adrian Garcia Badaracco added the comment: Agreed. What if we allow protocols that implement `__init__` but still disallow instantiating a protocol that does not? It's a 1 line change, all existing tests pass and it would still catch what I think was the original intention (trying to instantiate a Protocol class with no __init__): https://github.com/python/cpython/pull/31628/files#diff-ddb987fca5f5df0c9a2f5521ed687919d70bb3d64eaeb8021f98833a2a716887 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:06:57 2022 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Tue, 01 Mar 2022 06:06:57 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646114817.22.0.597424263177.issue44807@roundup.psfhosted.org> Adrian Garcia Badaracco added the comment: Guido, it looks like you replied while I was typing my reply out. Yurii can correct me here but I believe PR #27543 was an attempt to disallow defining `__init__` on a Protocol completely. What I proposed above is the opposite behavior, while still fixing the issue of `__init__` getting silently overridden (which is the crux / title of this issue). I'm not sure which approach is right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:11:10 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 01 Mar 2022 06:11:10 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646115070.09.0.935947444593.issue44807@roundup.psfhosted.org> Jelle Zijlstra added the comment: It doesn't make logical sense to instantiate any Protocol, whether it has __init__ or not, because a Protocol is inherently an abstract class. But we can just leave enforcement of that rule to static type checkers, so Adrian's proposed change makes sense to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:22:56 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2022 06:22:56 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646115776.81.0.274291296488.issue44807@roundup.psfhosted.org> Guido van Rossum added the comment: Would it make sense to enforce the no-instantiation rule in __new__ instead of __init__? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 01:52:43 2022 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Tue, 01 Mar 2022 06:52:43 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1646117563.68.0.982527702674.issue44807@roundup.psfhosted.org> Adrian Garcia Badaracco added the comment: I am not sure if that solves anything (other than the fact that __new__ is much less common to implement than __init__), but I may just be slow to pick up the implications of moving the check to __new__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 02:55:34 2022 From: report at bugs.python.org (Stanley) Date: Tue, 01 Mar 2022 07:55:34 +0000 Subject: [issue10149] [doc] Data truncation in expat parser In-Reply-To: <1287539001.05.0.466094845115.issue10149@psf.upfronthosting.co.za> Message-ID: <1646121334.22.0.581510402.issue10149@roundup.psfhosted.org> Change by Stanley : ---------- keywords: +patch nosy: +slateny nosy_count: 6.0 -> 7.0 pull_requests: +29752 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31629 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 02:59:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 07:59:18 +0000 Subject: [issue46886] ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt In-Reply-To: <1646088788.98.0.693772071082.issue46886@roundup.psfhosted.org> Message-ID: <1646121558.16.0.752313162936.issue46886@roundup.psfhosted.org> STINNER Victor added the comment: example: https://buildbot.python.org/all/#/builders/730/builds/4081 Build FAILED. "C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\PCbuild\pcbuild.proj" (Build target) (1) -> "C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\PCbuild\pyexpat.vcxproj" (Build target) (26) -> (Link target) -> LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\PCbuild\pyexpat.vcxproj] 0 Warning(s) 1 Error(s) ---------- title: pyexpat occasionally fails to build on the ARM64 Windows Non-Debug 3.x buildbot -> ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 03:39:51 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 01 Mar 2022 08:39:51 +0000 Subject: [issue46863] Python 3.10 OpenSSL Configuration Issues In-Reply-To: <1645852366.6.0.130545163871.issue46863@roundup.psfhosted.org> Message-ID: <1646123991.62.0.217710033368.issue46863@roundup.psfhosted.org> Christian Heimes added the comment: Could you please provide the outputs of the following commands: python3 -c "import _ssl; print(_ssl.__file__)" ldd $(python3.10 -c "import _ssl; print(_ssl.__file__)") strace -e openat python3.10 -c "from urllib.request import urlopen; urlopen('https://www.python.org')" The outputs look like this on my computer: $ python3 -c "import _ssl; print(_ssl.__file__)" /usr/lib64/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so $ ldd $(python3.10 -c "import _ssl; print(_ssl.__file__)") linux-vdso.so.1 (0x00007ffd1a10e000) libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007ff838e17000) libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007ff838b29000) libc.so.6 => /lib64/libc.so.6 (0x00007ff83891f000) libz.so.1 => /lib64/libz.so.1 (0x00007ff838905000) /lib64/ld-linux-x86-64.so.2 (0x00007ff838f0b000) $ strace -e openat python3.10 -c "from urllib.request import urlopen; urlopen('https://www.python.org')" ... openat(AT_FDCWD, "/etc/pki/tls/openssl.cnf", O_RDONLY) = 3 openat(AT_FDCWD, "/etc/crypto-policies/back-ends/opensslcnf.config", O_RDONLY) = 4 openat(AT_FDCWD, "/etc/crypto-policies/back-ends/openssl.config", O_RDONLY) = 3 openat(AT_FDCWD, "/etc/pki/tls/cert.pem", O_RDONLY) = 3 ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:01:37 2022 From: report at bugs.python.org (Stanley) Date: Tue, 01 Mar 2022 09:01:37 +0000 Subject: [issue25415] [doc] "there is no public constructor" should be reworded in io module documentation In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646125297.14.0.170607052635.issue25415@roundup.psfhosted.org> Change by Stanley : ---------- keywords: +patch nosy: +slateny nosy_count: 5.0 -> 6.0 pull_requests: +29753 pull_request: https://github.com/python/cpython/pull/31631 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:25:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 09:25:57 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646126757.1.0.808726078339.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: I created a PR to no longer skip tests in buildbots: https://github.com/python/buildmaster-config/pull/314 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:28:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 09:28:07 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646126887.55.0.303330729924.issue46633@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29754 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:35:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 09:35:44 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646127344.52.0.382606364317.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: Status with the 2 pending PRs: * GH-31632 * https://github.com/python/buildmaster-config/pull/314 Tests only skipped on ASAN: * _test_multiprocessing Skip on ASAN and MSAN: * test___all__ * test_concurrent_futures * test_crypt * test_decimal.test_maxcontext_exact_arith() * test_idle * test_peg_generator * test_tix * test_tk * test_tools * test_ttk_guionly No longer skipped: * test_capi * test_ctypes * test_faulthandler * test_interpreters ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:38:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 09:38:30 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' Message-ID: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> New submission from STINNER Victor : "./Programs/_freeze_module zipimport" fails with MSAN: --- $ make SHELL="bash -x" (...) + ./Programs/_freeze_module zipimport ./Lib/zipimport.py Python/frozen_modules/zipimport.h ==110524==WARNING: MemorySanitizer: use-of-uninitialized-value ==110523==WARNING: MemorySanitizer: use-of-uninitialized-value ==110526==WARNING: MemorySanitizer: use-of-uninitialized-value ==110525==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9 #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24 #2 0x7fe8acb8555f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #3 0x7fe8acb8560b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b) #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44) Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main' #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205 SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text Exiting make: *** [Makefile:1184: Python/frozen_modules/importlib._bootstrap_external.h] Error 1 make: *** Waiting for unfinished jobs.... #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9 #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24 #2 0x7f64ecd1355f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #3 0x7f64ecd1360b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b) #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44) Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main' #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205 SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text Exiting make: *** [Makefile:1176: Python/frozen_modules/getpath.h] Error 1 #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9 #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24 #2 0x7fb2a178d55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #3 0x7fb2a178d60b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b) #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44) #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9 #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24 #2 0x7f4d471ca55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #3 0x7f4d471ca60b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b) #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44) Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main' Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main' #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205 #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205 SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text Exiting Exiting make: *** [Makefile:1181: Python/frozen_modules/importlib._bootstrap.h] Error 1 make: *** [Makefile:1187: Python/frozen_modules/zipimport.h] Error 1 --- Build Python with clang MSAN: --- ./configure --with-pydebug --with-memory-sanitizer CC=clang LD=clang make --- ---------- components: Build messages: 414249 nosy: vstinner priority: normal severity: normal status: open title: ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:38:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 09:38:41 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646127521.96.0.382475770521.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-46887: ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:57:22 2022 From: report at bugs.python.org (Stanley) Date: Tue, 01 Mar 2022 09:57:22 +0000 Subject: [issue23323] [doc] mention that flags arg to imaplib's append should be a string In-Reply-To: <1422276063.41.0.625016569735.issue23323@psf.upfronthosting.co.za> Message-ID: <1646128642.4.0.593224607891.issue23323@roundup.psfhosted.org> Stanley added the comment: How would this sound as clarification for the flags argument? *flags* is a space-separated string containing IMAP flags tokens. Must start with ``\``. Perhaps optionally also provide the list of system flags as given in https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.2 ---------- nosy: +slateny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 04:58:03 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Mar 2022 09:58:03 +0000 Subject: [issue46791] Allow os.remove to defer to rmdir In-Reply-To: <1645206913.87.0.447648839641.issue46791@roundup.psfhosted.org> Message-ID: <1646128683.02.0.278970079534.issue46791@roundup.psfhosted.org> Eryk Sun added the comment: glibc remove() has an optimization to skip calling rmdir() if the macro condition IS_NO_DIRECTORY_ERROR is true for the unlink() error. For Linux, this condition is `errno != EISDIR`. On other platforms (e.g. BSD systems), the condition is `errno != EPERM`. The implementation is the following, from "sysdeps/posix/remove.c": int remove (const char *file) { /* First try to unlink since this is more frequently the necessary action. */ if (__unlink (file) != 0 /* If it is indeed a directory... */ && (IS_NO_DIRECTORY_ERROR /* ...try to remove it. */ || __rmdir (file) != 0)) /* Cannot remove the object for whatever reason. */ return -1; return 0; } WinAPI DeleteFileW() doesn't support the same distinction. In this case, ERROR_ACCESS_DENIED is set for the following system status codes: STATUS_ACCESS_DENIED (like EACCES) STATUS_CANNOT_DELETE (like EPERM; readonly or image-mapped) STATUS_DELETE_PENDING (like EPERM) STATUS_FILE_IS_A_DIRECTORY (like EISDIR) os.remove() could skip skip calling RemoveDirectoryW() for a sharing violation, i.e. ERROR_SHARING_VIOLATION. If DeleteFileW() fails with a sharing violation, the path is not a directory and, even if it were, an attempt to delete it would fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 05:06:34 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 10:06:34 +0000 Subject: [issue46871] Lambda can't be pickled with "spawn" and only "fork" In-Reply-To: <1645930683.9.0.146416539661.issue46871@roundup.psfhosted.org> Message-ID: <1646129194.59.0.2595068949.issue46871@roundup.psfhosted.org> Ronald Oussoren added the comment: This is not a bug in CPython, at best this can be a feature request to make it possible to pickle lambda's (which IMHO is unlikely to happen). The "fork" and "spawn" start methods result in different behaviour in how data is copied into the new worker proces and there's nothing we can do about this. Note that the same difference in behaviour can be observed on Windows, which does not support the "fork" method at all. ---------- resolution: -> not a bug stage: -> resolved status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 05:09:16 2022 From: report at bugs.python.org (Stanley) Date: Tue, 01 Mar 2022 10:09:16 +0000 Subject: [issue18534] [doc] State clearly that open() 'file' param is "name" attr of the result In-Reply-To: <1374556018.34.0.468152457131.issue18534@psf.upfronthosting.co.za> Message-ID: <1646129356.05.0.407141760512.issue18534@roundup.psfhosted.org> Stanley added the comment: Would it be fine to modify FileIO.name like this: "... given in the constructor. Depending on the type of *name* that was passed into the constructor, this may not necessarily e a string." ---------- nosy: +slateny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 05:27:29 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 01 Mar 2022 10:27:29 +0000 Subject: [issue46871] Lambda can't be pickled with "spawn" and only "fork" In-Reply-To: <1646056489.93.0.565903867503.issue46871@roundup.psfhosted.org> Message-ID: <20220301102522.GJ26135@ando.pearwood.info> Steven D'Aprano added the comment: > The "spawn" method requires pickling the data and callable passed to > the child proces, and that's not supported for lambda's. Ah, today I learned something. Kyle, looks like you were right about it being due to the lambdas. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 05:47:18 2022 From: report at bugs.python.org (Niyas Sait) Date: Tue, 01 Mar 2022 10:47:18 +0000 Subject: [issue46886] ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt In-Reply-To: <1646088788.98.0.693772071082.issue46886@roundup.psfhosted.org> Message-ID: <1646131638.24.0.36188205594.issue46886@roundup.psfhosted.org> Niyas Sait added the comment: I cannot reproduce this on local builds on the same machine and the failures are also intermittent on CI. I am going to upgrade OS to Windows 11 and install Visual studio 2022. Hope that would resolve the issue. I will update and keep an eye on the build to see if it would make any difference. ---------- nosy: +nsait-linaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 06:16:39 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 01 Mar 2022 11:16:39 +0000 Subject: [issue46871] Lambda can't be pickled with "spawn" and only "fork" In-Reply-To: <1645930683.9.0.146416539661.issue46871@roundup.psfhosted.org> Message-ID: <1646133399.46.0.436009946043.issue46871@roundup.psfhosted.org> Steven D'Aprano added the comment: Oops, replying by email reopens the ticket. Back to pending you go! ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 06:39:08 2022 From: report at bugs.python.org (Ronny Rentner) Date: Tue, 01 Mar 2022 11:39:08 +0000 Subject: [issue46888] SharedMemory.close() destroys memory Message-ID: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> New submission from Ronny Rentner : According to https://docs.python.org/3/library/multiprocessing.shared_memory.html#multiprocessing.shared_memory.SharedMemory.close if I call close() on a shared memory, it shall not be destroyed. Unfortunately this is only true for Linux but not for Windows. I've tested this in a Windows VM on VirtualBox like this: ``` Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing.shared_memory >>> creator = multiprocessing.shared_memory.SharedMemory(create=True, name='mymemory', size=10000) >>> creator.buf[0] = 1 >>> creator.buf[0] 1 >>> # According to close() is supposed to not destroy 'mymemory' but it does destroy it. >>> creator.close() >>> >>> user = multiprocessing.shared_memory.SharedMemory(name='mymemory') Traceback (most recent call last): File "", line 1, in File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\multiprocessing\shared_memory.py", line 161, in __init__ h_map = _winapi.OpenFileMapping( FileNotFoundError: [WinError 2] The system cannot find the file specified: 'mymemory' >>> # Shared memory was destroyed by close() ``` ---------- components: Windows messages: 414258 nosy: paul.moore, ronny-rentner, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: SharedMemory.close() destroys memory type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 07:17:47 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Mar 2022 12:17:47 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <892e6eee-3205-2791-aec0-770177a82f6c@python.org> Steve Dower added the comment: Yes, named memory mappings only exist on Windows until the last reference is closed, so this is a difference due to the underlying OS. The implementation of unlink() recognises this (the entire body is under a _USE_POSIX check), but the docs do not reflect it. The only workaround I can think of would be to create a real file, then open it with mmap and give it a tagname, then pass that tagname as the name argument of the shared memory object when creating it. It's a bit of a pain, but I don't think there's any option on our side given the way the API has been designed. It's not possible for N SharedMemory instances to independently agree which one will ignore the close() call and do it in unlink() instead, and in any case that still wouldn't "unlink" the name until all other references had also been closed. Can you tell us a bit more about what you're trying to achieve? Perhaps knowing how this is actually being relied upon will inspire some ideas for how to make it work better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:03:37 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Mar 2022 13:03:37 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <1646139817.77.0.425716411412.issue46888@roundup.psfhosted.org> Eryk Sun added the comment: > Yes, named memory mappings only exist on Windows until the last > reference is closed, so this is a difference due to the underlying OS. That's true for the Windows API, so it's true for all practical purposes. In the underlying NT API, creating a permanent kernel object is possible by setting OBJ_PERMANENT in the initial object attributes [1], or subsequently via the undocumented system call NtMakePermanentObject(handle). Creating a permanent object requires SeCreatePermanentPrivilege, which normally is granted to just the SYSTEM account. An administrator can grant this privilege to any user, group, or well-known group, but creating permanent objects should generally be limited to drivers and system services. An object can be reverted back to a temporary object via NtMakeTemporaryObject(handle). A named section object (i.e. file mapping) can also be created as a global name, i.e. r"Global\{object name}", which is accessible to all sessions. This requires SeCreateGlobalPrivilege, which by default is granted to system service accounts and administrators. This is separate from whether the section is temporary or permanent, but a permanent section object is more likely to be needed in the global namespace. --- [1] https://docs.microsoft.com/en-us/windows/win32/api/ntdef/nf-ntdef-initializeobjectattributes [2] https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwmaketemporaryobject ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:05:03 2022 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 01 Mar 2022 13:05:03 +0000 Subject: [issue6778] False positives given through bisect module (binary search) In-Reply-To: <1251147558.19.0.488929549089.issue6778@psf.upfronthosting.co.za> Message-ID: <1646139903.54.0.831168078351.issue6778@roundup.psfhosted.org> Change by Mark Dickinson : ---------- components: -Distutils, Documentation, Extension Modules, Installation, Parser, email nosy: -barry, docs at python, dstufft, eric.araujo, lys.nikolaou, pablogsal type: security -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:05:31 2022 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 01 Mar 2022 13:05:31 +0000 Subject: [issue6778] False positives given through bisect module (binary search) In-Reply-To: <1251147558.19.0.488929549089.issue6778@psf.upfronthosting.co.za> Message-ID: <1646139931.04.0.228379472555.issue6778@roundup.psfhosted.org> Change by Mark Dickinson : ---------- components: +Extension Modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 08:53:21 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 01 Mar 2022 13:53:21 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646142801.57.0.895766554485.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 7820a5897e7762df23bff1cbe749652130654a08 by Brandt Bucher in branch 'main': bpo-46841: Use inline caching for `COMPARE_OP` (GH-31622) https://github.com/python/cpython/commit/7820a5897e7762df23bff1cbe749652130654a08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:00:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:00:40 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646143240.98.0.95473437752.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: """ No longer skipped: * test_capi * test_ctypes * test_faulthandler * test_interpreters """ I built Python manually with: ./configure --with-pydebug CC=clang LD=clang --with-address-sanitizer These tests no longer with ASAN_OPTIONS used on our CI: ASAN_OPTIONS='detect_leaks=0:allocator_may_return_null=1:handle_segv=0' ./python -m test (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:21:15 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 01 Mar 2022 14:21:15 +0000 Subject: [issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong In-Reply-To: <1641729344.86.0.271892670725.issue46311@roundup.psfhosted.org> Message-ID: <1646144475.08.0.837748803089.issue46311@roundup.psfhosted.org> Mark Shannon added the comment: New changeset c60e6b6ad7aaf9c72035ff9fb1575e2710aeb4b4 by Mark Dickinson in branch 'main': bpo-46311: Clean up PyLong_FromLong and PyLong_FromLongLong (GH-30496) https://github.com/python/cpython/commit/c60e6b6ad7aaf9c72035ff9fb1575e2710aeb4b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:32:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:32:04 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' In-Reply-To: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> Message-ID: <1646145124.28.0.903504475568.issue46887@roundup.psfhosted.org> STINNER Victor added the comment: It looks like a bug in clang MSAN: https://github.com/llvm/llvm-project/issues/54131 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:35:56 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 01 Mar 2022 14:35:56 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1646145356.08.0.0141798718326.issue46541@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 0cc63641859b2f60ea65bb7c0b6d1cfcec1e2f1a by Dong-hee Na in branch 'main': bpo-46541: Remove usage of _Py_IDENTIFIER from multibytecodec (GH-31475) https://github.com/python/cpython/commit/0cc63641859b2f60ea65bb7c0b6d1cfcec1e2f1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:44:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:44:17 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646145857.54.0.137293905323.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9204bb72a2da5885facc747e63d2bd2d654606fe by Victor Stinner in branch 'main': bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632) https://github.com/python/cpython/commit/9204bb72a2da5885facc747e63d2bd2d654606fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:49:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:49:16 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' In-Reply-To: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> Message-ID: <1646146156.1.0.547709204735.issue46887@roundup.psfhosted.org> STINNER Victor added the comment: Hum, later "import ssl" in setup.py also fails. Simplified code: --- import _ssl print(_ssl.txt2obj('1.3.6.1.5.5.7.3.1', name=False)) # server OID --- Error: --- $ ./python x.py Uninitialized bytes in MemcmpInterceptorCommon at offset 0 inside [0x701000000032, 8) ==135651==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x49467c in memcmp (/home/vstinner/python/main/python+0x49467c) #1 0x7f5546825adc in OBJ_bsearch_ex_ (/lib64/libcrypto.so.1.1+0x14eadc) #2 0x7f5546826ff1 in OBJ_obj2nid (/lib64/libcrypto.so.1.1+0x14fff1) #3 0x7f554675b434 (/lib64/libcrypto.so.1.1+0x84434) #4 0x7f554675b6af in d2i_ASN1_OBJECT (/lib64/libcrypto.so.1.1+0x846af) #5 0x7f5546827702 in OBJ_txt2obj (/lib64/libcrypto.so.1.1+0x150702) #6 0x7f5546a78c31 in _ssl_txt2obj_impl /home/vstinner/python/main/Modules/_ssl.c:5276:11 #7 0x7f5546a78c31 in _ssl_txt2obj /home/vstinner/python/main/Modules/clinic/_ssl.c.h:1216:20 (...) Uninitialized value was created by a heap allocation #0 0x466642 in __interceptor_malloc (/home/vstinner/python/main/python+0x466642) #1 0x7f55468276b3 in OBJ_txt2obj (/lib64/libcrypto.so.1.1+0x1506b3) SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/vstinner/python/main/python+0x49467c) in memcmp Exiting --- The Python code calls OBJ_txt2obj("1.3.6.1.5.5.7.3.1", 0) in C: the OpenSSL function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:52:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:52:47 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' In-Reply-To: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> Message-ID: <1646146367.99.0.892566648864.issue46887@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29755 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:53:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:53:32 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' In-Reply-To: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> Message-ID: <1646146412.33.0.977230160833.issue46887@roundup.psfhosted.org> STINNER Victor added the comment: > It looks like a bug in clang MSAN: > https://github.com/llvm/llvm-project/issues/54131 I wrote GH-31633 to work around the false alarm on stat() and fstat(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:53:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 14:53:57 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' In-Reply-To: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> Message-ID: <1646146437.37.0.531430161304.issue46887@roundup.psfhosted.org> STINNER Victor added the comment: > The Python code calls OBJ_txt2obj("1.3.6.1.5.5.7.3.1", 0) in C: the OpenSSL function. This error is unrelated to Python, but comes from OpenSSL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:54:11 2022 From: report at bugs.python.org (Kyle Smith) Date: Tue, 01 Mar 2022 14:54:11 +0000 Subject: [issue46871] Lambda can't be pickled with "spawn" and only "fork" In-Reply-To: <1645930683.9.0.146416539661.issue46871@roundup.psfhosted.org> Message-ID: <1646146451.34.0.648626585695.issue46871@roundup.psfhosted.org> Kyle Smith added the comment: I think that's fair, thanks for the conversation at least. I understand python mp a little bit more now... ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 09:54:14 2022 From: report at bugs.python.org (Kyle Smith) Date: Tue, 01 Mar 2022 14:54:14 +0000 Subject: [issue46871] Lambda can't be pickled with "spawn" and only "fork" In-Reply-To: <1645930683.9.0.146416539661.issue46871@roundup.psfhosted.org> Message-ID: <1646146454.57.0.368844696339.issue46871@roundup.psfhosted.org> Change by Kyle Smith : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:01:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 15:01:07 +0000 Subject: [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i' In-Reply-To: <1646127510.42.0.802803841072.issue46887@roundup.psfhosted.org> Message-ID: <1646146867.59.0.222648930096.issue46887@roundup.psfhosted.org> STINNER Victor added the comment: > The Python code calls OBJ_txt2obj("1.3.6.1.5.5.7.3.1", 0) in C: the OpenSSL function. I reported this issue to OpenSSL: https://github.com/openssl/openssl/issues/17784 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:04:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 15:04:34 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646147074.77.0.09469954656.issue46633@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29756 pull_request: https://github.com/python/cpython/pull/31634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:18:14 2022 From: report at bugs.python.org (lyinch) Date: Tue, 01 Mar 2022 15:18:14 +0000 Subject: [issue46889] enable sqlite math functions on macos Message-ID: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> New submission from lyinch : Similar to these PRs: https://github.com/python/cpython/pull/24053/files and https://github.com/python/cpython/pull/25892/files which enable the built-in sqlite3 math functions for Windows, I want to have support for them on macos. As per the sqlite3 documentation: https://sqlite.org/releaselog/3_35_0.html this requires compilation with -DSQLITE_ENABLE_MATH_FUNCTIONS . On master, the flag is missing for macos : https://github.com/python/cpython/blob/main/Mac/BuildScript/build-installer.py#L364 ---------- components: Library (Lib), macOS messages: 414272 nosy: lyinch, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: enable sqlite math functions on macos type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:19:26 2022 From: report at bugs.python.org (lyinch) Date: Tue, 01 Mar 2022 15:19:26 +0000 Subject: [issue46889] enable sqlite math functions on macos In-Reply-To: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> Message-ID: <1646147966.89.0.267823100258.issue46889@roundup.psfhosted.org> Change by lyinch : ---------- keywords: +patch pull_requests: +29757 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31635 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:33:20 2022 From: report at bugs.python.org (Vidhya) Date: Tue, 01 Mar 2022 15:33:20 +0000 Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode header In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za> Message-ID: <1646148800.39.0.916496104814.issue17505@roundup.psfhosted.org> Vidhya added the comment: The latest versions 3.9, 3.10 and 3.11 are updated in the issue. So I thought like it still applies. @irit: Any suggestions on what needs to be done for current revisions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:38:47 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 01 Mar 2022 15:38:47 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1646149127.82.0.131697143885.issue46541@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset e91b0a7139d4a4cbd2351ccb5cd021a100cf42d2 by Kumar Aditya in branch 'main': bpo-46541: remove usage of _Py_IDENTIFIER from _ssl module (GH-31599) https://github.com/python/cpython/commit/e91b0a7139d4a4cbd2351ccb5cd021a100cf42d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:47:18 2022 From: report at bugs.python.org (Joris Geysens) Date: Tue, 01 Mar 2022 15:47:18 +0000 Subject: [issue46856] datetime.max conversion In-Reply-To: <1645805401.57.0.267496020204.issue46856@roundup.psfhosted.org> Message-ID: <1646149638.41.0.0208498931237.issue46856@roundup.psfhosted.org> Joris Geysens added the comment: I looked at this a bit more in detail. What happens it the following, starting in the datetime fromtimestamp fragment : converter = _time.gmtime if utc else _time.localtime y, m, d, hh, mm, ss, weekday, jday, dst = converter(t) That will call the system gmtime_r(), which indeed returns Sat Jan 1 00:00:00 10000 I have not looked at the cpp implementation for that method and I am not sure if this is something that can be improved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 10:49:12 2022 From: report at bugs.python.org (Vidhya) Date: Tue, 01 Mar 2022 15:49:12 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1646149752.3.0.947192071814.issue28516@roundup.psfhosted.org> Vidhya added the comment: @Jelle: Thanks. The PR is submitted at https://github.com/python/cpython/pull/31636 ---------- keywords: +patch message_count: 9.0 -> 10.0 pull_requests: +29758 pull_request: https://github.com/python/cpython/pull/31636 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:00:51 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 01 Mar 2022 16:00:51 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646150451.17.0.488377937834.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 3b0f1c5a710eff289dc44bec972dbaea353cc54f by Mark Shannon in branch 'main': bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618) https://github.com/python/cpython/commit/3b0f1c5a710eff289dc44bec972dbaea353cc54f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:25:46 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 16:25:46 +0000 Subject: [issue46890] vent does not create "python" link in python 3.11 Message-ID: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> New submission from Ronald Oussoren : In python3.10 and earlier "python3 -m venv something" creates "something/bin/python" as a symlink to the interpreter itself. In python3.11 (a5) the same command no longer creates "something/bin/python", but only the ".../python3" symlink. With this change the "python" command no longer refers to the interpreter in an activated virtualenv, but to a different binary on $PATH (if any). I tested using the Python 3.11a5 installer for macOS on python.org. ---------- components: Library (Lib) keywords: 3.11regression messages: 414278 nosy: ronaldoussoren priority: normal severity: normal status: open title: vent does not create "python" link in python 3.11 type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 11:41:30 2022 From: report at bugs.python.org (Zachary Ware) Date: Tue, 01 Mar 2022 16:41:30 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646152890.69.0.0690986631648.issue46890@roundup.psfhosted.org> Change by Zachary Ware : ---------- title: vent does not create "python" link in python 3.11 -> venv does not create "python" link in python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:02:23 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 01 Mar 2022 17:02:23 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646154143.86.0.419007095657.issue46836@roundup.psfhosted.org> Brandt Bucher added the comment: Victor, can we please revert these changes? They broke Greenlet, a required dependency for three of our performance benchmarks: https://github.com/python-greenlet/greenlet/issues/288#issuecomment-1055632607 I've already spent considerable effort contributing workarounds for other 3.11 breakages in Greenlet and coaxing them to put out a compatible release: https://github.com/python-greenlet/greenlet/pull/280 These changes, however, just seem like needless breakage that are now also impacting our performance work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:03:48 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 01 Mar 2022 17:03:48 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646154228.97.0.120216925665.issue46836@roundup.psfhosted.org> Brandt Bucher added the comment: I'm also very uncomfortable with the lack of review on these PRs. The most recent one (https://github.com/python/cpython/pull/31583) was open for less than 30 minutes before merging, from 6:57 to 7:22 am in my local time zone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:21:48 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 17:21:48 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646155308.19.0.236069996557.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: This is be related to how the virtual environment is populated. In 3.10 the "python3.10" name in the environment is a symlink to sys.executable. In 3.10 "Python" (not the capital) is a symlink to the binary in Python.app and "python3.11" is a symlink to "Python". Given that the filesystem is case preserving there is no "python" name. The behaviour in 3.11 is clearly a bug: the virtual environment is no longer using the launcher binary in "{sys.prefix]/bin" but directly uses the "real" binary (in a framework build), and because of that scripts cannot use system APIs that expect to run in an application bundle. Listing "env/bin" in Python 3.10: -rw-rw-r-- 1 ronald staff 9033 Mar 1 18:11 Activate.ps1 -rw-rw-r-- 1 ronald staff 2018 Mar 1 18:11 activate -rw-rw-r-- 1 ronald staff 944 Mar 1 18:11 activate.csh -rw-rw-r-- 1 ronald staff 2086 Mar 1 18:11 activate.fish -rwxr-xr-x 1 ronald staff 269 Mar 1 18:11 pip -rwxr-xr-x 1 ronald staff 269 Mar 1 18:11 pip3 -rwxr-xr-x 1 ronald staff 269 Mar 1 18:11 pip3.10 lrwxr-xr-x 1 ronald staff 10 Mar 1 18:11 python -> python3.10 lrwxr-xr-x 1 ronald staff 10 Mar 1 18:11 python3 -> python3.10 lrwxr-xr-x 1 ronald staff 65 Mar 1 18:11 python3.10 -> /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 In python3.11: total 72 -rw-rw-r-- 1 ronald staff 9033 Mar 1 17:23 Activate.ps1 lrwxr-xr-x 1 ronald staff 93 Mar 1 17:23 Python -> /Library/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python -rw-rw-r-- 1 ronald staff 2018 Mar 1 17:23 activate -rw-rw-r-- 1 ronald staff 944 Mar 1 17:23 activate.csh -rw-rw-r-- 1 ronald staff 2086 Mar 1 17:23 activate.fish -rwxr-xr-x 1 ronald staff 265 Mar 1 17:23 pip -rwxr-xr-x 1 ronald staff 265 Mar 1 17:23 pip3 -rwxr-xr-x 1 ronald staff 265 Mar 1 17:23 pip3.11 lrwxr-xr-x 1 ronald staff 6 Mar 1 17:23 python3 -> Python lrwxr-xr-x 1 ronald staff 6 Mar 1 17:23 python3.11 -> Python ---------- components: +macOS nosy: +ned.deily priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:24:36 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 17:24:36 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646155476.86.0.723773125821.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: The root cause likely is the calculation of sys._base_executable. In 3.10 this is {sys.prefix}/bin/python3.10, while in 3.11 this is {sys.prefix}/Resources/Python.app/Contents/MacOS/Python. The venv library uses the incorrect value and therefore creates an incorrect virtual environment. ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:25:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 17:25:31 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646155531.4.0.213967832903.issue46836@roundup.psfhosted.org> STINNER Victor added the comment: I plan to update Cython, greenlet and gevent for this change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:31:17 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 01 Mar 2022 17:31:17 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1646155877.2.0.586808571647.issue46712@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +29759 pull_request: https://github.com/python/cpython/pull/31637 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:33:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Mar 2022 17:33:49 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646156029.31.0.915542739515.issue6634@roundup.psfhosted.org> Irit Katriel added the comment: Vidhya, I think the sentence you are suggesting to add would overlap with one which is already there ("Since exit() ultimately ?only? raises an exception, it will only exit the process when called from the main thread, and the exception is not intercepted.") It seems to me that what could be improved is the first paragraph, which starts with: "Exit from Python.". Maybe instead it could say something like "Raise a SystemExit exception, which has the effect of ..." and then say what it is (i.e., that it exits python if you are in the main thread, unless the exception is caught... ). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 12:37:58 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 01 Mar 2022 17:37:58 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646156278.78.0.386067803623.issue46890@roundup.psfhosted.org> Eric Snow added the comment: This may be related to the getpath.py work Steve did. ---------- nosy: +eric.snow, steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 13:03:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Mar 2022 18:03:51 +0000 Subject: [issue20970] [doc] contradictory documentation for prog option of argparse In-Reply-To: <1395160969.17.0.758674872934.issue20970@psf.upfronthosting.co.za> Message-ID: <1646157831.72.0.671346125786.issue20970@roundup.psfhosted.org> Irit Katriel added the comment: @lilbludot - is this your GitHub account? https://github.com/lilbludot (I am asking in order to credit you as coauthor on the GitHub version of your patch). ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 13:22:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Mar 2022 18:22:22 +0000 Subject: [issue15002] urllib2 does not download 4 MB file completely using ftp In-Reply-To: <1338840881.84.0.164546182047.issue15002@psf.upfronthosting.co.za> Message-ID: <1646158942.83.0.325888124513.issue15002@roundup.psfhosted.org> Irit Katriel added the comment: 2.7 backport is no longer relevant. ---------- nosy: +iritkatriel status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 13:40:58 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Mar 2022 18:40:58 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646160058.69.0.94859639217.issue46890@roundup.psfhosted.org> Steve Dower added the comment: The _base_executable change might be, though it should still be preferring the environment variables here, but I don't think I touched anything that would affect which symlinks are created by venv. ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 14:10:26 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 01 Mar 2022 19:10:26 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646161826.66.0.795302394061.issue25415@roundup.psfhosted.org> Terry J. Reedy added the comment: "IOBase" is a public name and IOBase has an __init__ method. It definitely has a public constructor. However, like other abstract base classes, it is not meant to be directly instantiated by users other than writers of other classes. Ditto for the 3 other io ABCs. Because this is generic to all ABCs, it need not be repeated for each. The proposed replacement is the opposite of the truth. Rather than accepting no arguments, IOBase, like the ABCs in numbers and collections.abc, has a generic signature and accepts any arguments (which I believe are ignored). >>> io.IOBase.__init__.__text_signature__ '($self, /, *args, **kwargs)' >>> io.IOBase(3, a=5) A class, such as `object`, accepting no arguments other that self raises. (At one time, object had the generic signature above.) >>> object(3) Traceback (most recent call last): File "", line 1, in object(3) TypeError: object() takes no arguments I think that the fix should be to delete the original incorrect statement and not replace it with another incorrect statement. Most abstract base classes are in collections.abc and numbers. They are not specifically labelled 'abstract base class' in their docstrings because they are in modules consisting more or less entirely of ABCs. Since io is mostly a module of concrete classes, I think it appropriate to specifically label them, as they are now. Once so labeled, nothing need be added that is true of all ABCs. ---------- title: [doc] "there is no public constructor" should be reworded in io module documentation -> [io doc] Reword "there is no public constructor" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:03:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Mar 2022 20:03:14 +0000 Subject: [issue10515] csv sniffer does not recognize quotes at the end of line In-Reply-To: <1290534942.45.0.466757650174.issue10515@psf.upfronthosting.co.za> Message-ID: <1646164994.67.0.715519250661.issue10515@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> csv.Sniffer.sniff() regex error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:20:15 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Mar 2022 20:20:15 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646166015.05.0.694290622392.issue46890@roundup.psfhosted.org> Ned Deily added the comment: As Ronald notes, the issue isn't in venv, it's that the value of sys._base_executable has changed between 3.10 and 3.11 for macOS builds. $ /usr/local/bin/python3.10 Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys._base_executable '/usr/local/bin/python3.10' >>> ^D nad at vana:~$ /usr/local/bin/python3.11 Python 3.11.0a5 (v3.11.0a5:c4e4b91557, Feb 3 2022, 14:54:01) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys._base_executable '/Library/Frameworks/Python.framework/Versions/3.11.0a5_11/Resources/Python.app/Contents/MacOS/Python' >>> The 3.11 value is incorrect for the reasons Ronald noted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:31:33 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 20:31:33 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646166693.15.0.688832843075.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: The change to _base_executable is the real problem. Venv creates the correct directory structure if I add a sitecustomize.py to the python path that sets _base_executable to the correct value. # sitecustomize import sys sys._base_executable = sys.executable # EOF Is sys._base_executable updated after running getpath.py? On first glance getpath.py does update config['base_executable'] and _PyConfig_FromDict reads that value back, but that's based on a quick scan through the code. I haven't tried debugging this yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:33:37 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 01 Mar 2022 20:33:37 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646166817.66.0.978587229026.issue46836@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:55:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 20:55:16 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646168116.57.0.96210111011.issue46836@roundup.psfhosted.org> STINNER Victor added the comment: Draft PR for greenlet: https://github.com/python-greenlet/greenlet/pull/294 I made these changes close to the Python 3.11 alpha 6 release to be able to test "#if PY_VERSION_HEX < 0x30B00A6" to have code compatible with Python 3.11 alpha 5 and older. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 15:56:40 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Mar 2022 20:56:40 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1646168200.69.0.558877066926.issue42982@roundup.psfhosted.org> Ned Deily added the comment: New changeset 7dbb2f8eaf07c105f4d2bb0fe61763463e68372d by Miss Islington (bot) in branch '3.10': bpo-42982: update pbkdf2 example & add another link (GH-30966) (#30968) https://github.com/python/cpython/commit/7dbb2f8eaf07c105f4d2bb0fe61763463e68372d ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:25:06 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 21:25:06 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ Message-ID: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> New submission from Ronald Oussoren : The following crashes the interpreter in Python 3.11, and works fine in older versions: # --- script.py import types class MyModule (types.ModuleType): __slots__ = ( "_MyModule__a", "_MyModule__b", ) def __init__(self, name): super().__init__(name) m = MyModule("name") # -- end of file The key in this is the ``__slots__`` definition: The script does not crash without ``__slots__``, or with a slots tuple with 1 item. This is a reproducer based on code in PyObjC. ---------- components: Interpreter Core keywords: 3.11regression messages: 414294 nosy: ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: Crash in ModuleType subclass with __slots__ type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:30:22 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 01 Mar 2022 21:30:22 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1646170222.28.0.352191250263.issue46712@roundup.psfhosted.org> Eric Snow added the comment: New changeset 21099fc064c61d59c936a2f6a0db3e07cd5c8de5 by Eric Snow in branch 'main': bpo-46712: Let generate_global_objects.py Run on Earlier Python Versions (gh-31637) https://github.com/python/cpython/commit/21099fc064c61d59c936a2f6a0db3e07cd5c8de5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:31:49 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 21:31:49 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646170309.99.0.990679802719.issue46891@roundup.psfhosted.org> Ronald Oussoren added the comment: This is with python 3.11 alpha 5 using the installer for macOS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:38:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 21:38:53 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646170733.86.0.043958412446.issue46836@roundup.psfhosted.org> STINNER Victor added the comment: Draft PR for Cython: https://github.com/cython/cython/pull/4671 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:54:30 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Mar 2022 21:54:30 +0000 Subject: [issue46876] Walrus operator not in help In-Reply-To: <1646006484.73.0.147239709954.issue46876@roundup.psfhosted.org> Message-ID: <1646171670.37.0.466179630323.issue46876@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: -> needs patch versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:55:34 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Mar 2022 21:55:34 +0000 Subject: [issue46870] Improper Input Validation in urlparse In-Reply-To: <1645924323.46.0.342217272005.issue46870@roundup.psfhosted.org> Message-ID: <1646171734.54.0.526023237811.issue46870@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 16:59:30 2022 From: report at bugs.python.org (Vidhya) Date: Tue, 01 Mar 2022 21:59:30 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646171970.73.0.526762369335.issue6634@roundup.psfhosted.org> Vidhya added the comment: Thanks for your comments :). The PR for the same is: https://github.com/python/cpython/pull/31639 ---------- message_count: 21.0 -> 22.0 pull_requests: +29760 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31639 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:10:13 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Mar 2022 22:10:13 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1646172613.0.0.881273332079.issue46566@roundup.psfhosted.org> Steve Dower added the comment: I'm working on this now. ---------- assignee: -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:13:32 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 22:13:32 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646172812.39.0.680129099449.issue46891@roundup.psfhosted.org> Ronald Oussoren added the comment: The crash itself happens during garbage collection: % python3.11 -Xdev t.py (master)pyobjc-8 Fatal Python error: Segmentation fault Current thread 0x0000000104ce0580 (most recent call first): Garbage-collecting And when using a debug build and -Xdev: ../Modules/gcmodule.c:2187: visit_validate: Assertion failed: PyObject_GC_Track() object is not valid Enable tracemalloc to get the memory block allocation traceback object address : 0x101a5f690 object refcount : 1 object type : 0x15503f230 object type name: MyModule object repr : Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed Python runtime state: initialized Current thread 0x00000001019c0580 (most recent call first): File "/Users/ronald/Projects/Forks/cpython/build/t.py", line 12 in zsh: abort ./python.exe -Xdev t.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:13:38 2022 From: report at bugs.python.org (Matt Page) Date: Tue, 01 Mar 2022 22:13:38 +0000 Subject: [issue46892] Async Call-Stack Reconstruction Message-ID: <1646172818.87.0.620414144341.issue46892@roundup.psfhosted.org> New submission from Matt Page : Profiling tools that use the call-stack (i.e. all of them) paint an incomplete picture of what?s really going on in async-heavy codebases. They can only show the stack of the currently executing task; they miss the chain of awaitables that are transitively waiting on the current task. To remedy this, we have added support in Cinder to expose the async call-stack. This consists of the call stack for the currently executing task, followed by the chain of awaitables that are transitively reachable from the currently executing task. See below for a clarifying example. ``` async def f1(): return await f2() async def f2(): return await asyncio.ensure_future(f3()) async def f3(): return await f4() async def f4(): await asyncio.sleep(10) return 42 ``` When retrieved from f4, the two different stacks (top-of-stack last) are: sync - [f3, f4] async - [f1, f2, f3, f4] We?d like to merge our implementation into CPython so that other heavy users of asyncio can benefit. This will consist of a few parts: 1. A new limited C-API to set and retrieve the ?awaiter? of an awaitable object. 2. Additions to PyAsyncMethods to store function pointers for setting and retrieving the awaiter on instances. 3. An API in managed code to retrieve the async call stack as a list of fully qualified names (i.e. :.). ---------- components: Interpreter Core, asyncio messages: 414301 nosy: asvetlov, dino.viehland, itamaro, mpage, yselivanov priority: normal severity: normal status: open title: Async Call-Stack Reconstruction type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:14:02 2022 From: report at bugs.python.org (Itamar Ostricher) Date: Tue, 01 Mar 2022 22:14:02 +0000 Subject: [issue46893] Allow extensions to set the vectorcall field on instances of PyFunctionObject Message-ID: <1646172842.87.0.805036575414.issue46893@roundup.psfhosted.org> New submission from Itamar Ostricher : CPython extensions providing optimized execution of Python bytecode (like [Cinder JIT](https://docs.google.com/document/d/1l8I-FDE1xrIShm9eSNJqsGmY_VanMDX5-aK_gujhYBI/edit#heading=h.ujldakarfxhh) and [Pyjion](https://github.com/tonybaloney/Pyjion)) can benefit from being able to modify the vectorcall field on instances of PyFunctionObject to allow calling the optimized path (e.g. JIT-compiled) directly. We propose adding an API to allow extensions to override this field: ``` void PyFunction_SetVectorcall(PyFunctionObject *func, vectorcallfunc vectorcall); ``` ---------- components: Interpreter Core messages: 414302 nosy: carljm, dino.viehland, itamaro priority: normal severity: normal status: open title: Allow extensions to set the vectorcall field on instances of PyFunctionObject type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:16:00 2022 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Tue, 01 Mar 2022 22:16:00 +0000 Subject: [issue46894] make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR Message-ID: <1646172960.85.0.550744633196.issue46894@roundup.psfhosted.org> New submission from ????? ???????? : With most recent 3.10 (v3.10.2-169-g98e2ee60) I call ./configure --prefix=/ && make && make DESTDIR=/home/d/A install It fails with: running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers Python build finished successfully! The necessary bits to build these optional modules were not found: _gdbm _tkinter nis readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time running build_scripts copying and adjusting /git/cpython/Tools/scripts/pydoc3 -> build/scripts-3.10 copying and adjusting /git/cpython/Tools/scripts/idle3 -> build/scripts-3.10 copying and adjusting /git/cpython/Tools/scripts/2to3 -> build/scripts-3.10 changing mode of build/scripts-3.10/pydoc3 from 644 to 755 changing mode of build/scripts-3.10/idle3 from 644 to 755 changing mode of build/scripts-3.10/2to3 from 644 to 755 renaming build/scripts-3.10/pydoc3 to build/scripts-3.10/pydoc3.10 renaming build/scripts-3.10/idle3 to build/scripts-3.10/idle3.10 renaming build/scripts-3.10/2to3 to build/scripts-3.10/2to3-3.10 running install_lib creating /lib/python3.10/lib-dynload error: could not create '/lib/python3.10/lib-dynload': Permission denied make: *** [Makefile:1761: sharedinstall] Error 1 ---------- components: Build messages: 414303 nosy: dilyan.palauzov priority: normal severity: normal status: open title: make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:16:51 2022 From: report at bugs.python.org (Matt Page) Date: Tue, 01 Mar 2022 22:16:51 +0000 Subject: [issue46895] Type-Modified Callbacks Message-ID: <1646173011.06.0.919834153407.issue46895@roundup.psfhosted.org> New submission from Matt Page : CPython extensions providing optimized execution of Python bytecode (e.g. the Cinder JIT), or even CPython itself (e.g. the faster-cpython project) may wish to cache access to lookups in the class hierarchy (e.g. when resolving the target of a method call). Extensions that perform these optimizations need to know when to invalidate the cached values. CPython already has a mechanism to invalidate its internal state (e.g. the global method cache) when a type is modified: _PyType_Modified. We propose adding an API to allow extensions to set a callback that will be invoked by _PyType_Modified whenever a type, or any ancestor of the type in the class hierarchy, changes. Proposed API: ``` // A callback to be invoked with the modified type and optionally the name of // the attribute that was modified. typedef void(*PyType_ModifiedCallback)(PyTypeObject* type, PyObject* attr); // Set or get the callback. The callback may be cleared by supplying a NULL callback. void PyType_SetModifiedCallback(PyType_ModifiedCallback callback); PyType_ModifiedCallback PyType_GetModifiedCallback(); ``` ---------- components: C API, Interpreter Core messages: 414305 nosy: carljm, dino.viehland, itamaro, mpage priority: normal severity: normal status: open title: Type-Modified Callbacks type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:16:50 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 01 Mar 2022 22:16:50 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646173010.63.0.459435371858.issue46891@roundup.psfhosted.org> Ronald Oussoren added the comment: The debug build seems to indicate that slot memory is not initiated properly, a stack trace (note the argument to visit_validate at frame #7): * frame #0: 0x000000019b60d9b8 libsystem_kernel.dylib`__pthread_kill + 8 frame #1: 0x000000019b640eb0 libsystem_pthread.dylib`pthread_kill + 288 frame #2: 0x000000019b57e314 libsystem_c.dylib`abort + 164 frame #3: 0x000000010030c4f4 python.exe`fatal_error_exit(status=-1) at pylifecycle.c:2624:9 frame #4: 0x000000010030c3cc python.exe`fatal_error(fd=2, header=1, prefix="_PyObject_AssertFailed", msg="_PyObject_AssertFailed", status=-1) at pylifecycle.c:2805:5 frame #5: 0x000000010030be20 python.exe`_Py_FatalErrorFunc(func="_PyObject_AssertFailed", msg="_PyObject_AssertFailed") at pylifecycle.c:2821:5 frame #6: 0x0000000100169fe0 python.exe`_PyObject_AssertFailed(obj=0x0000000100d63690, expr=0x0000000000000000, msg="PyObject_GC_Track() object is not valid", file="../Modules/gcmodule.c", line=2187, function="visit_validate") at object.c:2293:5 frame #7: 0x0000000100351184 python.exe`visit_validate(op=0xcdcdcdcdcdcdcdcd, parent_raw=0x0000000100d63690) at gcmodule.c:2186:9 frame #8: 0x000000010019845c python.exe`traverse_slots(type=0x0000000101813230, self=0x0000000100d63690, visit=(python.exe`visit_validate at gcmodule.c:2183), arg=0x0000000100d63690) at typeobject.c:1207:27 frame #9: 0x0000000100197fe8 python.exe`subtype_traverse(self=0x0000000100d63690, visit=(python.exe`visit_validate at gcmodule.c:2183), arg=0x0000000100d63690) at typeobject.c:1228:23 frame #10: 0x0000000100350fdc python.exe`PyObject_GC_Track(op_raw=0x0000000100d63690) at gcmodule.c:2212:11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:17:56 2022 From: report at bugs.python.org (Matt Page) Date: Tue, 01 Mar 2022 22:17:56 +0000 Subject: [issue46895] Allow extensions to set a callback to be invoked when a type is modified In-Reply-To: <1646173011.06.0.919834153407.issue46895@roundup.psfhosted.org> Message-ID: <1646173076.4.0.582089582241.issue46895@roundup.psfhosted.org> Change by Matt Page : ---------- title: Type-Modified Callbacks -> Allow extensions to set a callback to be invoked when a type is modified _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:18:13 2022 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Tue, 01 Mar 2022 22:18:13 +0000 Subject: [issue46894] make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR In-Reply-To: <1646172960.85.0.550744633196.issue46894@roundup.psfhosted.org> Message-ID: <1646173093.2.0.233856489678.issue46894@roundup.psfhosted.org> ????? ???????? added the comment: Once I create /lib/python3.10/lib-dynload/, the next error is: changing mode of /lib/python3.10/lib-dynload/__pycache__ to 755 running install_scripts copying build/scripts-3.10/pydoc3.10 -> /bin error: could not delete '/bin/pydoc3.10': Permission denied make: *** [Makefile:1761: sharedinstall] Error 1 '/bin/pydoc3.10 is not under DESTDIR ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:19:05 2022 From: report at bugs.python.org (Carl Meyer) Date: Tue, 01 Mar 2022 22:19:05 +0000 Subject: [issue46896] add support for watching writes to selecting dictionaries Message-ID: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> New submission from Carl Meyer : CPython extensions providing optimized execution of Python bytecode (e.g. the Cinder JIT), or even CPython itself (e.g. the faster-cpython project) may wish to inline-cache access to frequently-read and rarely-changed namespaces, e.g. module globals. Rather than requiring a dict version guard on every cached read, the best-performing way to do this is is to mark the dictionary as ?watched? and set a callback on writes to watched dictionaries. This optimizes the cached-read fast-path at a small cost to the (relatively infrequent and usually less perf sensitive) write path. We have an implementation of this in Cinder ( https://docs.google.com/document/d/1l8I-FDE1xrIShm9eSNJqsGmY_VanMDX5-aK_gujhYBI/edit#heading=h.n2fcxgq6ypwl ), used already by the Cinder JIT and its specializing interpreter. We would like to make the Cinder JIT available as a third-party extension to CPython ( https://docs.google.com/document/d/1l8I-FDE1xrIShm9eSNJqsGmY_VanMDX5-aK_gujhYBI/ ), and so we are interested in adding dict watchers to core CPython. The intention in this issue is not to add any specific optimization or cache (yet); just the ability to mark a dictionary as ?watched? and set a write callback. The callback will be global, not per-dictionary (no extra function pointer stored in every dict). CPython will track only one global callback; it is a well-behaved client?s responsibility to check if a callback is already set when setting a new one, and daisy-chain to the previous callback if so. Given that multiple clients may mark dictionaries as watched, a dict watcher callback may receive events for dictionaries that were marked as watched by other clients, and should handle this gracefully. There is no provision in the API for ?un-watching? a watched dictionary; such an API could not be used safely in the face of potentially multiple dict-watching clients. The Cinder implementation marks dictionaries as watched using the least bit of the dictionary version (so version increments by 2); this also avoids any additional memory usage for marking a dict as watched. Initial proposed API, comments welcome: // Mark given dictionary as "watched" (global callback will be called if it is modified) void PyDict_Watch(PyObject* dict); // Check if given dictionary is already watched int PyDict_IsWatched(PyObject* dict); typedef enum { PYDICT_EVENT_CLEARED, PYDICT_EVENT_DEALLOCED, PYDICT_EVENT_MODIFIED } PyDict_WatchEvent; // Callback to be invoked when a watched dict is cleared, dealloced, or modified. // In clear/dealloc case, key and new_value will be NULL. Otherwise, new_value will be the // new value for key, NULL if key is being deleted. typedef void(*PyDict_WatchCallback)(PyDict_WatchEvent event, PyObject* dict, PyObject* key, PyObject* new_value); // Set new global watch callback; supply NULL to clear callback void PyDict_SetWatchCallback(PyDict_WatchCallback callback); // Get existing global watch callback PyDict_WatchCallback PyDict_GetWatchCallback(); The callback will be called immediately before the modification to the dict takes effect, thus the callback will also have access to the prior state of the dict. ---------- components: C API messages: 414307 nosy: carljm, dino.viehland, itamaro priority: normal severity: normal status: open title: add support for watching writes to selecting dictionaries versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:19:44 2022 From: report at bugs.python.org (Matt Page) Date: Tue, 01 Mar 2022 22:19:44 +0000 Subject: [issue46897] Add API to allow extensions to set callback function on creation, modification, and destruction of PyFunctionObject Message-ID: <1646173184.63.0.558173732938.issue46897@roundup.psfhosted.org> New submission from Matt Page : CPython extensions providing optimized execution of Python bytecode (e.g. the Cinder JIT) may need to hook into the lifecycle of function objects to determine what to optimize, invalidate previously-optimized functions, or free resources allocated for functions that no longer exist. For example, when inlining a function, the Cinder JIT will use the bytecode of the inlined function that was known at compile-time. If the bytecode for the inlined function changes at runtime (i.e. if __code__ was reassigned) the JIT needs to invalidate any code into which the function was inlined. We propose adding an API to allow extensions to set callbacks that will be invoked whenever functions are created, modified, or destroyed. Proposed API: ``` typedef enum { PYFUNC_LCEVT_CREATED, PYFUNC_LCEVT_MODIFIED, PYFUNC_LCEVT_DESTROYED } PyFunction_LifecycleEvent; typedef enum { PYFUNC_ATTR_CODE, PYFUNC_ATTR_GLOBALS, PYFUNC_ATTR_DEFAULTS, PYFUNC_ATTR_KWDEFAULTS, PYFUNC_ATTR_CLOSURE, PYFUNC_ATTR_NOT_APPLICABLE, } PyFunction_AttrId; // A callback to be called in response to events in a function's lifecycle. // // The callback is invoked after a function is created and before the function // is modified or destroyed. // // On modification the third argument indicates which attribute was modified // and the fourth argument is the new value. // Otherwise the third argument is PYFUNC_ATTR_NOT_APPLICABLE and the fourth // argument is NULL. typedef void(*PyFunction_LifecycleCallback)( PyFunction_LifecycleEvent event, PyFunctionObject* func, PyFunction_AttrId attr, PyObject* new_value); void PyFunction_SetLifecycleCallback(PyFunction_LifecycleCallback callback); PyFunction_LifecycleCallback PyFunction_GetLifecycleCallback(); ``` ---------- components: C API messages: 414308 nosy: carljm, dino.viehland, itamaro, mpage priority: normal severity: normal status: open title: Add API to allow extensions to set callback function on creation, modification, and destruction of PyFunctionObject type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:20:59 2022 From: report at bugs.python.org (Matt Page) Date: Tue, 01 Mar 2022 22:20:59 +0000 Subject: [issue46898] Add API to allow extensions to set callback function on creation and destruction of PyCodeObject Message-ID: <1646173258.53.0.415525425157.issue46898@roundup.psfhosted.org> New submission from Matt Page : CPython extensions providing optimized execution of Python bytecode (e.g. the Cinder JIT) may need to hook into the lifecycle of code objects to determine what to optimize or to free resources allocated for code objects that no longer exist. We propose adding an API to allow extensions to set callbacks that will be invoked whenever code objects are created or destroyed. Proposed API: ``` typedef enum { PYCODE_LCEVT_CREATED, PYCODE_LCEVT_DESTROYED } PyCode_LifecycleEvent; // A callback to be called when a code object is created or about to be destroyed. typedef void(*PyCode_LifecycleCallback)( PyCode_LifecycleEvent event, PyCodeObject* code); void PyCode_SetLifecycleCallback(PyCode_LifecycleCallback callback); PyCode_LifecycleCallback PyCode_GetLifecycleCallback(); ``` ---------- components: C API messages: 414309 nosy: carljm, dino.viehland, itamaro, mpage priority: normal severity: normal status: open title: Add API to allow extensions to set callback function on creation and destruction of PyCodeObject type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:21:58 2022 From: report at bugs.python.org (Matt Page) Date: Tue, 01 Mar 2022 22:21:58 +0000 Subject: [issue46895] Allow extensions to set a callback to be invoked when a type is modified In-Reply-To: <1646173011.06.0.919834153407.issue46895@roundup.psfhosted.org> Message-ID: <1646173318.99.0.178933541457.issue46895@roundup.psfhosted.org> Change by Matt Page : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:25:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 22:25:14 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646173514.01.0.845046049132.issue46836@roundup.psfhosted.org> STINNER Victor added the comment: Draft PR for gevent: https://github.com/gevent/gevent/pull/1872 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:26:06 2022 From: report at bugs.python.org (Carl Meyer) Date: Tue, 01 Mar 2022 22:26:06 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646173566.85.0.649001482371.issue46896@roundup.psfhosted.org> Change by Carl Meyer : ---------- title: add support for watching writes to selecting dictionaries -> add support for watching writes to selected dictionaries _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:29:40 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 01 Mar 2022 22:29:40 +0000 Subject: [issue46876] Walrus operator not in help In-Reply-To: <1646006484.73.0.147239709954.issue46876@roundup.psfhosted.org> Message-ID: <1646173780.25.0.0959239866744.issue46876@roundup.psfhosted.org> Alex Waygood added the comment: Thanks for the report! I think this is a duplicate of Issue37082. ---------- nosy: +AlexWaygood resolution: -> duplicate stage: needs patch -> resolved status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:29:57 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 01 Mar 2022 22:29:57 +0000 Subject: [issue45373] ./configure --enable-optimizations should enable LTO In-Reply-To: <1633426345.9.0.0201314807782.issue45373@roundup.psfhosted.org> Message-ID: <1646173797.86.0.678633367023.issue45373@roundup.psfhosted.org> Gregory P. Smith added the comment: FWIW I agree that we should try adding LTO to --enable-optimizations now. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:30:25 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 01 Mar 2022 22:30:25 +0000 Subject: [issue46876] Walrus operator not in help In-Reply-To: <1646006484.73.0.147239709954.issue46876@roundup.psfhosted.org> Message-ID: <1646173825.66.0.037062401219.issue46876@roundup.psfhosted.org> Change by Alex Waygood : ---------- status: pending -> open superseder: -> Assignment expression symbol (walrus) not in built-in help() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:30:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 01 Mar 2022 22:30:45 +0000 Subject: [issue46876] Walrus operator not in help In-Reply-To: <1646006484.73.0.147239709954.issue46876@roundup.psfhosted.org> Message-ID: <1646173845.03.0.310506752476.issue46876@roundup.psfhosted.org> Change by Alex Waygood : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:34:08 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Mar 2022 22:34:08 +0000 Subject: [issue45373] ./configure --enable-optimizations should enable LTO In-Reply-To: <1633426345.9.0.0201314807782.issue45373@roundup.psfhosted.org> Message-ID: <1646174048.15.0.630349213387.issue45373@roundup.psfhosted.org> Ned Deily added the comment: Sorry, this slipped off my radar and I haven't gone back and checked older versions of macOS. But it certainly is true that at least with the current versions of the Apple Developer Tools (either the Command Line Tools or Xcode) for macOS 11 (Big Sur) and macOS 12 (Monterey), things just work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:51:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 22:51:26 +0000 Subject: [issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1646175086.28.0.154984761899.issue40421@roundup.psfhosted.org> STINNER Victor added the comment: I searched for "\<_f" regex in Cython (0.29.x) branch. I found the following code getting or setting PyFrameObject fields. == Set f_back == __Pyx_Coroutine_SendEx() at Utility/Coroutine.c:721: f->f_back = PyThreadState_GetFrame(tstate); __Pyx_Coroutine_ResetFrameBackpointer() at Utility/Coroutine.c:775: Py_CLEAR(f->f_back); == Set f_lineno == __Pyx_PyFrame_SetLineNumber() at Utility/ModuleSetupCode.c:543: #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) __Pyx_PyFrame_SetLineNumber() is called by 3 functions: * __Pyx_AddTraceback() * __Pyx_call_line_trace_func() * __Pyx_TraceSetupAndCall() __Pyx_AddTraceback() pseudo-code: static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { py_frame = PyFrame_New(..., py_code, ...); __Pyx_PyFrame_SetLineNumber(py_frame, py_line); ... } == f_localsplus == If the CYTHON_FAST_PYCALL macro is defined, sizeof(PyFrameObject) is used to get the f_localsplus member. __Pyx_PyFrame_GetLocalsplus() at Utility/ObjectHandling.c:1996: --- // Initialised by module init code. static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets() \ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)), \ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame) \ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) --- == Get f_trace == __Pyx_TraceLine() at Utility/Profile.c:238: if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && $frame_cname->f_trace) == Set f_frame == __Pyx_TraceSetupAndCall() at Utility/Profile.c:299: (*frame)->f_tstate = tstate; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:52:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Mar 2022 22:52:00 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1646175120.46.0.200893420509.issue46836@roundup.psfhosted.org> STINNER Victor added the comment: > Draft PR for Cython: https://github.com/cython/cython/pull/4671 Notes on how Cython access PyFrameObject fields: https://bugs.python.org/issue40421#msg414314 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 17:56:10 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Mar 2022 22:56:10 +0000 Subject: [issue45373] ./configure --enable-optimizations should enable LTO In-Reply-To: <1633426345.9.0.0201314807782.issue45373@roundup.psfhosted.org> Message-ID: <1646175370.46.0.479730607159.issue45373@roundup.psfhosted.org> Inada Naoki added the comment: Can we use --lto=thin when availabe? And can we not use --lto when building profiling python? ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 18:09:32 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Mar 2022 23:09:32 +0000 Subject: [issue46845] dict: Use smaller entry for Unicode-key only dict. In-Reply-To: <1645688455.61.0.00785191075466.issue46845@roundup.psfhosted.org> Message-ID: <1646176172.13.0.057196653262.issue46845@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 9833bb91e4d5c2606421d9ec2085f5c2dfb6f72c by Inada Naoki in branch 'main': bpo-46845: Reduce dict size when all keys are Unicode (GH-31564) https://github.com/python/cpython/commit/9833bb91e4d5c2606421d9ec2085f5c2dfb6f72c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 18:10:28 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Mar 2022 23:10:28 +0000 Subject: [issue46845] dict: Use smaller entry for Unicode-key only dict. In-Reply-To: <1645688455.61.0.00785191075466.issue46845@roundup.psfhosted.org> Message-ID: <1646176228.75.0.271522199209.issue46845@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 Mar 1 18:26:40 2022 From: report at bugs.python.org (Max Katsev) Date: Tue, 01 Mar 2022 23:26:40 +0000 Subject: [issue15373] copy.copy() does not properly copy os.environment In-Reply-To: <1342454937.95.0.386630033182.issue15373@psf.upfronthosting.co.za> Message-ID: <1646177200.52.0.365293824195.issue15373@roundup.psfhosted.org> Max Katsev added the comment: Note that deepcopy doesn't work either, even though it looks like it does at the first glance (which is arguably worse since it's harder to notice): Python 3.8.6 (default, Jun 4 2021, 05:16:01) >>> import copy, os, subprocess >>> env_copy = copy.deepcopy(os.environ) >>> env_copy["TEST"] = "oh no" >>> os.environ["TEST"] Traceback (most recent call last): File "", line 1, in File "/usr/local/fbcode/platform009/lib/python3.8/os.py", line 675, in __getitem__ raise KeyError(key) from None KeyError: 'TEST' >>> subprocess.run("echo $TEST", shell=True, capture_output=True).stdout.decode() 'oh no\n' ---------- nosy: +mkatsev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:42:01 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 02 Mar 2022 00:42:01 +0000 Subject: [issue15373] copy.copy() does not properly copy os.environment In-Reply-To: <1342454937.95.0.386630033182.issue15373@psf.upfronthosting.co.za> Message-ID: <1646181721.65.0.048491420649.issue15373@roundup.psfhosted.org> Eryk Sun added the comment: In bpo-28824, I suggested preserving the case of environment variables in Windows by using a case-insensitive subclass of str in the encodekey() function. This is self-contained by the use of the encodekey() and decodekey() functions in the mapping methods such as __iter__(). The reason for this is mostly about aesthetics, but also about faithfully displaying the actual environment variable names. Opinions vary, but to me "WindowsSdkVerBinPath" is both easier on my eyes and easier to read than "WINDOWSSDKVERBINPATH". The eyesore factor gets amplified when it's a wall of all upper-cased names 'screaming' at me. A copy via dict(os.environ) would use regular str keys and lose the case-insensitive, case-preserving property. It would be more useful if os.environ.copy() were implemented to return a copy that keeps the case-insensitive property for keys but disables updating the process environment. This could be implemented by making putenv and unsetenv parameters in the constructor. If self.putenv or self.unsetenv is None, then __setitem__() or __delitem__() woud have no effect on the process environment. The copy() method would return a new _Environ instance for self._data.copy(), one which of course disables updating the process environment. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 19:48:44 2022 From: report at bugs.python.org (Yilei Yang) Date: Wed, 02 Mar 2022 00:48:44 +0000 Subject: [issue46899] use of uninitialized value with msan from subprocess_fork_exec Message-ID: <1646182124.68.0.0216044317389.issue46899@roundup.psfhosted.org> New submission from Yilei Yang : The uid & gid variable from https://github.com/python/cpython/blob/9833bb91e4d5c2606421d9ec2085f5c2dfb6f72c/Modules/_posixsubprocess.c#L737-L738 can be passed to the `do_fork_exec` call below uninitialized and cause msan to report use-of-uninitialized-value errors. Those variables are guarded by call_setgid/call_setuid so they aren't really used uninitialized in practice. It would just be great if we can make it msan clean. Ideally, the long list of do_fork_exec arguments could also be rewritten in a struct. ---------- components: Library (Lib) messages: 414320 nosy: gregory.p.smith, yilei priority: normal severity: normal status: open title: use of uninitialized value with msan from subprocess_fork_exec type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 20:37:40 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 02 Mar 2022 01:37:40 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646185060.08.0.128003106981.issue46896@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 20:51:54 2022 From: report at bugs.python.org (Adam) Date: Wed, 02 Mar 2022 01:51:54 +0000 Subject: [issue46863] Python 3.10 OpenSSL Configuration Issues In-Reply-To: <1645852366.6.0.130545163871.issue46863@roundup.psfhosted.org> Message-ID: <1646185914.54.0.722113744957.issue46863@roundup.psfhosted.org> Adam added the comment: Many thanks Christian, see the attached for the output of the commands on Python 3.9.10 and 3.10.2, along with a diff removing version numbers and memory addresses. I've run the commands on the Ubuntu distribution, we can also run the same for the Centos VM, if helpful. There are a few differences in the outputs but nothing that appears obviously the cause. ---------- Added file: https://bugs.python.org/file50654/python_details.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 21:10:45 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Mar 2022 02:10:45 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646187045.18.0.202011161652.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29761 pull_request: https://github.com/python/cpython/pull/31640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 22:06:53 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Mar 2022 03:06:53 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646190413.3.0.354535448468.issue46891@roundup.psfhosted.org> Dennis Sweeney added the comment: Bisected to here: c3f52b4d707a78eb342372a2be00f3eb846a05b9 is the first bad commit commit c3f52b4d707a78eb342372a2be00f3eb846a05b9 Author: Mark Shannon Date: Wed Jun 23 10:00:43 2021 +0100 bpo-44486: Make sure that modules always have a dictionary. (GH-26847) * Make sure that modules always have a dictionary. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 22:08:10 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Mar 2022 03:08:10 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646190490.22.0.317840863517.issue46891@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 22:49:24 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 02 Mar 2022 03:49:24 +0000 Subject: [issue6143] IDLE - clear and restart the shell window In-Reply-To: <1243631391.82.0.146122427664.issue6143@psf.upfronthosting.co.za> Message-ID: <1646192964.04.0.126636075461.issue6143@roundup.psfhosted.org> Terry J. Reedy added the comment: https://stackoverflow.com/questions/71290382/how-do-i-adjust-python-idle-shell-settings-so-that-the-next-line-of-code-i-type is from someone who, for whatever reason, likes having blank space in the shell below the input prompt. It is not clear whether deleting lines to make that happen would be satisfactory, or if all lines must be accessible. ---------- versions: +Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 22:51:18 2022 From: report at bugs.python.org (Ronny Rentner) Date: Wed, 02 Mar 2022 03:51:18 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <1646193078.84.0.201404900666.issue46888@roundup.psfhosted.org> Ronny Rentner added the comment: Thanks for your quick response. My bigger scope is real time audio and video processing where I use multiple processes that need to be synchronized. I use shared memory for that. As a small spin off, I've hacked together a dict that is using shared memory as a storage. It works like this: It uses one shared memory space for streaming updates. This is efficient because only changes are transferred. Once the streaming shared memory buffer is full or if any single update to the dict is larger than the streaming buffer, it creates a full dump of the whole dict in a new shared memory that is just as big as needed. Any user of the dict would then consume the full dump. On Linux that works great. Any user of the dict can create a full dump in a new shared memory and all other users of the same dict can consume it. On Windows, the issue is if the creator process of the full dump goes away, the shared memory goes away. This is in contrast to the Python docs, unfortunately. I don't fully understand the underlying implementations, but I've been looking at https://docs.microsoft.com/en-us/dotnet/standard/io/memory-mapped-files and I understand there are 2 main modes. The persistent mode sounds just like Python shared memory also works on Linux (where I can have these /dev/shm/* files even after the Python process ends) but I think on Windows, Python is not using the persistent mode and thus the shared memory goes away, in contrast to how it works on Linux. PS: You can find the code for this shared dict here https://github.com/ronny-rentner/UltraDict - Please note, it's an eary lack and not well tested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 23:46:20 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Mar 2022 04:46:20 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1646196380.17.0.3459296251.issue43853@roundup.psfhosted.org> miss-islington added the comment: New changeset 3ea2a8f425d26e81d914c54d477e9d56eb27ac98 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030) (GH-31586) https://github.com/python/cpython/commit/3ea2a8f425d26e81d914c54d477e9d56eb27ac98 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 23:46:33 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Mar 2022 04:46:33 +0000 Subject: [issue46848] Use optimized string search function in mmap.find() In-Reply-To: <1645706630.43.0.574969248824.issue46848@roundup.psfhosted.org> Message-ID: <1646196393.8.0.66594884743.issue46848@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset 6ddb09f35b922a3bbb59e408a3ca7636a6938468 by Dennis Sweeney in branch 'main': bpo-46848: Use stringlib/fastsearch in mmap (GH-31625) https://github.com/python/cpython/commit/6ddb09f35b922a3bbb59e408a3ca7636a6938468 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 1 23:49:27 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Mar 2022 04:49:27 +0000 Subject: [issue46848] Use optimized string search function in mmap.find() In-Reply-To: <1645706630.43.0.574969248824.issue46848@roundup.psfhosted.org> Message-ID: <1646196567.44.0.31555653094.issue46848@roundup.psfhosted.org> Dennis Sweeney added the comment: Thanks for the report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 00:30:27 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 02 Mar 2022 05:30:27 +0000 Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org> Message-ID: <1646199027.97.0.390644467207.issue46195@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 20a1c8ee4bcb1c421b7cca1f3f5d6ad7ce30a9c9 by Nikita Sobolev in branch 'main': bpo-46195: Do not add `Optional` in `get_type_hints` (GH-30304) https://github.com/python/cpython/commit/20a1c8ee4bcb1c421b7cca1f3f5d6ad7ce30a9c9 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 00:31:58 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 02 Mar 2022 05:31:58 +0000 Subject: [issue46195] Annotated and Optional get_type_hints buggy interaction In-Reply-To: <1640803127.78.0.466747350347.issue46195@roundup.psfhosted.org> Message-ID: <1646199118.55.0.462558707949.issue46195@roundup.psfhosted.org> Jelle Zijlstra added the comment: This is now fixed in 3.11, but we'll leave 3.10 and 3.9 alone. Thanks for your bug report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 01:41:01 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Mar 2022 06:41:01 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1646203261.38.0.239819768252.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 01:53:40 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 02 Mar 2022 06:53:40 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646204020.67.0.558187371294.issue46896@roundup.psfhosted.org> Gregory P. Smith added the comment: At first quick glance, this makes sense and the API looks reasonable. Question: what happens on interpreter shutdown? Shutdown obviously finalized and clears out most all dicts. I guess the C callback simply gets called for each of these? That makes sense. Just wondering if there are any ramifications of that. The callback is in C so it shouldn't have issues with this. A pyperformance suite run on an interpreter modified to support this but having no callbacks registered would be useful. (basically judging if there is measurable overhead added by the watched bit check - I doubt it'll be noticeable in most code) ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 02:33:09 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 02 Mar 2022 07:33:09 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <1646206389.14.0.430757356543.issue46888@roundup.psfhosted.org> Eryk Sun added the comment: > The persistent mode sounds just like Python shared memory also works > on Linux (where I can have these /dev/shm/* files even after the > Python process ends) but I think on Windows, Python is not using > the persistent mode and thus the shared memory goes away, in contrast > to how it works on Linux. Unix has the notion that everything is a file as a central organizing concept. As such, Linux opts to implement POSIX shm_open() [1] with a tmpfs [2] filesystem that's mounted on /dev/shm. tmpfs filesystems exist in virtual memory. They're not persistent in the sense of being created on a physical disk that provides persistent storage. Windows has the notion that everything is an object as a central organizing concept. Internally, the system has a "\" root object directory, which contains other object directories and object symbolic links (unrelated to filesystem symlinks). Each object directory, including the root directory, contains named kernel objects. Named device objects are normally created in r"\Device", such as r"\Device\HarddiskVolume2", and global symbolic links to devices are created in r"\GLOBAL??", such as r"\GLOBAL??\C:" -> r"\Device\HarddiskVolume2" for the "C:" drive. The root registry key object is r"\REGISTRY", which contains dynamic key objects such as r"\REGISTRY\MACHINE" (referenced via the pseudohandle HKEY_LOCAL_MACHINE) and "\REGISTRY\USER" (referenced via the pseudohandle HKEY_USERS), which in turn contain other keys such as "\REGISTRY\MACHINE\SOFTWARE" on which registry hives are mounted. For naming global kernel objects and session 0 objects, the Windows API internally uses the directory r"\BaseNamedObjects". For interactive Windows sessions, it uses r"\Sessions\\BaseNamedObjects" and, for app containers, subdirectories of r"\Sessions\\AppContainerNamedObjects". To explicitly name an object in the global directory, use the path r"Global\". The "Global" prefix is implemented as an object symbolic link to r"\BaseNamedObjects". Of course, that's an internal implementation detail; the API just refers to the r"Global\\" prefix. Naming a kernel object in r"\BaseNamedObjects" is nearly equivalent to creating a file in a tmpfs filesystem in Linux, with one major difference. Objects are reference counted, with a handle reference count and a pointer reference count. Opening a handle increments both counters, but kernel code can use just a pointer reference instead of opening a handle. By default, objects are temporary. As such, when their pointer reference count is decremented to 0, they get unlinked from the object namespace, if they're named objects, and deallocated. It's possible to create a permanent object in the object namespace, either initially via the OBJ_PERMANENT attribute [3], or later on via NtMakePermanentObject(handle). However, making an object permanent is considered a super privilege in Windows, so privileged in fact that the Windows API doesn't support this capability, at least not as far as I know. By default, SeCreatePermanentPrivilege is only granted to the SYSTEM account. Also, creating a named section object (i.e. file mapping object) in a session-restricted directory such as r"\BaseNamedObjects" requires SeCreateGlobalPrivilege, which is only granted by default to administrators and system service accounts. Unix and Linux are less concerned about creating 'permanent' files and global shared memory in virtual filesystems such as tmpfs. The lifetime while the system is running is left up to the creator, which has to manually remove the file, such as via shm_unlink() [4]. Stale files could accumulate in "/dev/shm" when processes crash, which is why a separate resource tracker is required, implementing what the Windows kernel provides by default. --- [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html [2] https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt [3] https://docs.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes [4] https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_unlink.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:10:08 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 02 Mar 2022 09:10:08 +0000 Subject: [issue28824] os.environ should preserve the case of the OS keys ? In-Reply-To: <1480359346.4.0.287394822331.issue28824@psf.upfronthosting.co.za> Message-ID: <1646212208.9.0.96751987502.issue28824@roundup.psfhosted.org> Eryk Sun added the comment: Putting words into action, here's an example of what a privileged process (e.g. running as SYSTEM) can do if a script or application is written to call the undocumented NT API function NtMakePermanentObject(). A use case would be a script running as a system service that needs a shared-memory section object to persist after the service is stopped or terminated, e.g. such that the section is still accessible if the service is resumed. Anyway, this is just an example of what's possible, from a technical perspective. By default, named kernel objects are temporary: >>> import os, _winapi, ctypes >>> from multiprocessing.shared_memory import SharedMemory >>> name = f'spam_{os.getpid()}' >>> m = SharedMemory(name, True, 8192) >>> m.close() >>> try: SharedMemory(name) ... except OSError as e: print(e) ... [WinError 2] The system cannot find the file specified: 'spam_6592' Global permanent example: Enable privileges for the current thread: >>> import win32api; from win32security import * >>> ImpersonateSelf(SecurityImpersonation) >>> da = TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES >>> ht = OpenThreadToken(win32api.GetCurrentThread(), da, False) >>> ps = [[0, SE_PRIVILEGE_ENABLED], [0, SE_PRIVILEGE_ENABLED]] >>> ps[0][0] = LookupPrivilegeValue(None, 'SeCreatePermanentPrivilege') >>> ps[1][0] = LookupPrivilegeValue(None, 'SeCreateGlobalPrivilege') >>> AdjustTokenPrivileges(ht, False, ps) ((16, 0),) Create a global section object, and make it permanent: >>> name = rf'Global\spam_{os.getpid()}' >>> m = SharedMemory(name, True, 8192) >>> from win32con import DELETE >>> h = _winapi.OpenFileMapping(DELETE, False, name) >>> ntdll = ctypes.WinDLL('ntdll') >>> ntdll.NtMakePermanentObject(h) 0 >>> _winapi.CloseHandle(h) A permanent object persists after the last handle is closed: >>> m.close() >>> m = SharedMemory(name) # This works now. Make the section object temporary again: >>> h = _winapi.OpenFileMapping(DELETE, False, name) >>> ntdll.NtMakeTemporaryObject(h) 0 >>> _winapi.CloseHandle(h) >>> m.close() >>> try: SharedMemory(name) ... except OSError as e: print(e) ... [WinError 2] The system cannot find the file specified: 'Global\\spam_6592' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:19:50 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 02 Mar 2022 09:19:50 +0000 Subject: [issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs) In-Reply-To: <1645227388.68.0.727345462152.issue46794@roundup.psfhosted.org> Message-ID: <1646212790.36.0.708749637634.issue46794@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset eb6c840a2414dc057ffcfbb5ad68d6253c8dd57c by Miss Islington (bot) in branch '3.8': bpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487) (GH-31520) https://github.com/python/cpython/commit/eb6c840a2414dc057ffcfbb5ad68d6253c8dd57c ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:20:33 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 02 Mar 2022 09:20:33 +0000 Subject: [issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs) In-Reply-To: <1645227388.68.0.727345462152.issue46794@roundup.psfhosted.org> Message-ID: <1646212833.03.0.798530087649.issue46794@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 04:43:54 2022 From: report at bugs.python.org (Stanley) Date: Wed, 02 Mar 2022 09:43:54 +0000 Subject: [issue26545] [doc] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1646214234.75.0.357609115063.issue26545@roundup.psfhosted.org> Stanley added the comment: I'm not too sure about documenting the recursive limit here. There's a few other recursive functions in the os library (such as makedirs()) and if we note the recursive limit for os.walk then all of them should be noted too, but that doesn't seem quite right to me. ---------- nosy: +slateny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:34:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2022 10:34:06 +0000 Subject: [issue46848] Use optimized string search function in mmap.find() In-Reply-To: <1645706630.43.0.574969248824.issue46848@roundup.psfhosted.org> Message-ID: <1646217246.35.0.0948514116267.issue46848@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 3.0 -> 4.0 pull_requests: +29762 pull_request: https://github.com/python/cpython/pull/31642 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 05:55:02 2022 From: report at bugs.python.org (Ronny Rentner) Date: Wed, 02 Mar 2022 10:55:02 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <1646218502.5.0.33141084719.issue46888@roundup.psfhosted.org> Ronny Rentner added the comment: Many thanks for your explanation. It makes sense now. One thing I've learned is that I need to get rid of the resource trackers for shared memory, so I've applied the monkey patch fix mentioned in https://bugs.python.org/issue38119 The issue is that you need shared memory in a multi processing environment, but the resource tracker can hardly know about other processes using the shared memory unless you tell it explicitly. It looks like the resource tracker is guessing that all users of a shared memory are somehow forked from the same main process but I'm using spawn and not fork because my software should run on Windows as well. Regarding /dev/shm on Linux: As far as I know there's an option 'RemoveIPC' to the systemd daemon that will delete shared memory on logout of the user which is turned on by default. I also remember seeing cronjobs for cleaning up /dev/shm on Debian, but not sure if that is the current approach anymore. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:19:30 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 02 Mar 2022 11:19:30 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646166693.15.0.688832843075.issue46890@roundup.psfhosted.org> Message-ID: <837ec5cb-bd70-e016-f65a-59e01ad4cd08@python.org> Steve Dower added the comment: > Is sys._base_executable updated after running getpath.py? It shouldn't be, but site.py might do it. More likely it's in how getpath.py is handling the environment variable overrides. It should be pretty easy to track down and change - the old "logic" was certainly not. If there's a way to add a test for this case as well, that would be handy. Way too little documentation here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:19:53 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 02 Mar 2022 11:19:53 +0000 Subject: [issue28824] os.environ should preserve the case of the OS keys ? In-Reply-To: <1480359346.4.0.287394822331.issue28824@psf.upfronthosting.co.za> Message-ID: <1646219993.54.0.674734397018.issue28824@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg414332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:20:41 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 02 Mar 2022 11:20:41 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <837ec5cb-bd70-e016-f65a-59e01ad4cd08@python.org> Message-ID: <038b4ffe-c972-525e-d844-f57041a5caf1@python.org> Steve Dower added the comment: > If there's a way to add a test for this case as well, that would be > handy. Way too little documentation here. There's definitely a way to add a test now, because test_getpath uses completely fake initial conditions to verify that getpath.py does its thing. So it's just a matter of understanding exactly what conditions lead to this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:25:22 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 02 Mar 2022 11:25:22 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <1646220322.56.0.267140400377.issue46888@roundup.psfhosted.org> Steve Dower added the comment: Eryk's post is useful background information, but not helpful for this particular case ;) >From Windows's POV, there is no "creating" process of the shared memory. If it's going away, it's because none of the other processes are not keeping it open - simple refcounting. That may be knowledge you can use to work around it. Alternatively, the workaround I suggested in my first post could also help. If the multiprocessing SharedMemory object is critical, you need the extra steps, but if all the processes can receive a filesystem path instead of however they're getting the reference today, you can use a real file with mmap to achieve exactly the same thing. (All that's missing is that SharedMemory won't take an open file object or a path, which is reasonable, but not helpful right here.) Switching this to a documentation bug: we should clarify that unlink() has no effect on Windows and shared memory blocks go away when the last SharedMemory object is close()d. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 06:33:21 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 02 Mar 2022 11:33:21 +0000 Subject: [issue46888] SharedMemory.close() destroys memory In-Reply-To: <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org> Message-ID: <1646220801.63.0.416649453804.issue46888@roundup.psfhosted.org> Eryk Sun added the comment: Putting words into action, here's an example of what a privileged process (e.g. running as SYSTEM) can do if a script or application is written to call the undocumented NT API function NtMakePermanentObject(). A use case would be a script running as a system service that needs a shared-memory section object to persist after the service is stopped or terminated, e.g. such that the section is still accessible if the service is resumed. Anyway, this is just an example of what's possible, from a technical perspective. Also, note that I granted SeCreatePermanentPrivilege to my current user for this example, so it's certainly not required to use the SYSTEM account. An administrator can grant this privilege to any account. By default, named kernel objects are temporary: >>> import os, _winapi, ctypes >>> from multiprocessing.shared_memory import SharedMemory >>> name = f'spam_{os.getpid()}' >>> m = SharedMemory(name, True, 8192) >>> m.close() >>> try: SharedMemory(name) ... except OSError as e: print(e) ... [WinError 2] The system cannot find the file specified: 'spam_6592' Global permanent example: Enable privileges for the current thread: >>> import win32api; from win32security import * >>> ImpersonateSelf(SecurityImpersonation) >>> da = TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES >>> ht = OpenThreadToken(win32api.GetCurrentThread(), da, False) >>> ps = [[0, SE_PRIVILEGE_ENABLED], [0, SE_PRIVILEGE_ENABLED]] >>> ps[0][0] = LookupPrivilegeValue(None, 'SeCreatePermanentPrivilege') >>> ps[1][0] = LookupPrivilegeValue(None, 'SeCreateGlobalPrivilege') >>> AdjustTokenPrivileges(ht, False, ps) ((16, 0),) Create a global section object, and make it permanent: >>> name = rf'Global\spam_{os.getpid()}' >>> m = SharedMemory(name, True, 8192) >>> from win32con import DELETE >>> h = _winapi.OpenFileMapping(DELETE, False, name) >>> ntdll = ctypes.WinDLL('ntdll') >>> ntdll.NtMakePermanentObject(h) 0 >>> _winapi.CloseHandle(h) A permanent object persists after the last handle is closed: >>> m.close() >>> m = SharedMemory(name) # This works now. Make the section object temporary again: >>> h = _winapi.OpenFileMapping(DELETE, False, name) >>> ntdll.NtMakeTemporaryObject(h) 0 >>> _winapi.CloseHandle(h) >>> m.close() >>> try: SharedMemory(name) ... except OSError as e: print(e) ... [WinError 2] The system cannot find the file specified: 'Global\\spam_6592' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:19:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 02 Mar 2022 12:19:07 +0000 Subject: [issue46863] Python 3.10 OpenSSL Configuration Issues In-Reply-To: <1645852366.6.0.130545163871.issue46863@roundup.psfhosted.org> Message-ID: <1646223547.98.0.481606060532.issue46863@roundup.psfhosted.org> Christian Heimes added the comment: pyenv uses default value for ./configure --with-ssl-default-suites. You have to use --with-ssl-default-suites=openssl so your build uses the system's crypto policy correctly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 07:59:15 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Mar 2022 12:59:15 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646225955.46.0.212551211567.issue46890@roundup.psfhosted.org> Ned Deily added the comment: To reiterate, the example I gave had nothing to do with using a venv. The value of sys._base_executable is now always wrong whether or not using a venv. The consequences are more obvious when using a venv. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:15:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2022 13:15:30 +0000 Subject: [issue46848] Use optimized string search function in mmap.find() In-Reply-To: <1645706630.43.0.574969248824.issue46848@roundup.psfhosted.org> Message-ID: <1646226930.87.0.936342124368.issue46848@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b6b711a1aa233001c1874af1d920e459b6bf962c by Victor Stinner in branch 'main': bpo-46848: Move _PyBytes_Find() to internal C API (GH-31642) https://github.com/python/cpython/commit/b6b711a1aa233001c1874af1d920e459b6bf962c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:18:41 2022 From: report at bugs.python.org (neonene) Date: Wed, 02 Mar 2022 13:18:41 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646227121.16.0.694831664405.issue46841@roundup.psfhosted.org> neonene added the comment: UNPACK_SEQUENCE's slowdown is already filed? https://speed.python.org/timeline/#/?exe=12&ben=unpack_sequence&env=4&revs=50&equid=off&quarts=on&extr=on I hit the gap at 424ecab on Windows. ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:31:16 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 13:31:16 +0000 Subject: [issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1646227876.06.0.140407373559.issue40421@roundup.psfhosted.org> Mark Shannon added the comment: I've outlined the requirements for a frame stack API at https://github.com/faster-cpython/ideas/issues/309. The problem with adding an API for PyFrameObject (beyond simple getters) is that it makes assumptions about the frame stack that aren't valid. A stack of frames is not just a linked list of frames. It never was, and it certainly isn't now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:38:56 2022 From: report at bugs.python.org (Pocas) Date: Wed, 02 Mar 2022 13:38:56 +0000 Subject: [issue46870] Improper Input Validation in urlparse In-Reply-To: <1645924323.46.0.342217272005.issue46870@roundup.psfhosted.org> Message-ID: <1646228336.22.0.436520108173.issue46870@roundup.psfhosted.org> Pocas added the comment: Nice Check. So what do you think about this issue? I want to hear your opinions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:41:54 2022 From: report at bugs.python.org (Peter Roelants) Date: Wed, 02 Mar 2022 13:41:54 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1646228514.41.0.352838522055.issue44446@roundup.psfhosted.org> Peter Roelants added the comment: If I understand correctly this should be fixed? In which 3.10.* version should this be fixed? The reason why I'm asking is that I ran into this issue when using Dask (2022.02.0) with multithreading on Python 3.10.2: Exception in thread Profile: Traceback (most recent call last): File "./lib/python3.10/site-packages/distributed/profile.py", line 115, in process d = state["children"][ident] KeyError: '_all_objs;./lib/python3.10/site-packages/bokeh/embed/bundle.py;357' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./lib/python3.10/threading.py", line 1009, in _bootstrap_inner self.run() File "./lib/python3.10/threading.py", line 946, in run self._target(*self._args, **self._kwargs) File "./lib/python3.10/site-packages/distributed/profile.py", line 274, in _watch process(frame, None, recent, omit=omit) File "./lib/python3.10/site-packages/distributed/profile.py", line 119, in process "description": info_frame(frame), File "./lib/python3.10/site-packages/distributed/profile.py", line 72, in info_frame line = linecache.getline(co.co_filename, frame.f_lineno, frame.f_globals).lstrip() File "./lib/python3.10/linecache.py", line 31, in getline if 1 <= lineno <= len(lines): TypeError: '<=' not supported between instances of 'int' and 'NoneType' ---------- nosy: +peter.roelants versions: +Python 3.10 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:49:51 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:49:51 +0000 Subject: [issue46756] Incorrect authorization check in urllib.request In-Reply-To: <1644918487.72.0.244898503691.issue46756@roundup.psfhosted.org> Message-ID: <1646228991.01.0.660065685206.issue46756@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is marked as a release blocker so I am holding the alpha release on this. Is there anything we can do to unblock this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:49:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:49:53 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646228993.7.0.680013602024.issue46890@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is marked as a release blocker so I am holding the alpha release on this. Is there anything we can do to unblock this issue? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:49:55 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:49:55 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646228995.33.0.0235939933107.issue46841@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is marked as a release blocker so I am holding the alpha release on this. Is there anything we can do to unblock this issue? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:50:17 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:50:17 +0000 Subject: [issue46756] Incorrect authorization check in urllib.request In-Reply-To: <1644918487.72.0.244898503691.issue46756@roundup.psfhosted.org> Message-ID: <1646229017.5.0.146614126977.issue46756@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is something left here, it seems that most PRs are landed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:50:42 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:50:42 +0000 Subject: [issue46756] Incorrect authorization check in urllib.request In-Reply-To: <1644918487.72.0.244898503691.issue46756@roundup.psfhosted.org> Message-ID: <1646229042.3.0.754236357449.issue46756@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1c9701a3de0566c085e03dddc14a8508aaae349e by Miss Islington (bot) in branch '3.8': bpo-46756: Fix authorization check in urllib.request (GH-31353) (GH-31572) https://github.com/python/cpython/commit/1c9701a3de0566c085e03dddc14a8508aaae349e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:54:11 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:54:11 +0000 Subject: [issue46756] Incorrect authorization check in urllib.request In-Reply-To: <1644918487.72.0.244898503691.issue46756@roundup.psfhosted.org> Message-ID: <1646229251.56.0.361140335627.issue46756@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm closing this, please reopen if something is missing. ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 08:56:47 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 13:56:47 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1646229407.23.0.295255268684.issue44446@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This was fixed in 3.10.0 if I am not mistaken. Could you provide a reproducer, please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:03:30 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 02 Mar 2022 14:03:30 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646229810.25.0.200283550108.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: Again without diving deep I've constructed a test case that is probably relevant. I've pasted the diff below because I'm not yet convinced that it is correct (in particular the value for "argv0". This would also require a second test case that does something similar for a venv when using a framework build (the test_venv_macos case seems to be for a regular install and not a framework install) With this tests case I get a test failure that matches my observations: test test_getpath failed -- Traceback (most recent call last): File "/Users/ronald/Projects/Forks/cpython/Lib/test/test_getpath.py", line 444, in test_framework_python self.assertEqual(expected, actual) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: {'exe[273 chars]/9.8/bin/python9.8', 'base_prefix': '/Library/[381 chars]ad']} != {'exe[273 chars]/9.8/Resources/Python.app/Contents/MacOS/Pytho[410 chars]ad']} {'base_exec_prefix': '/Library/Frameworks/Python.framework/Versions/9.8', - 'base_executable': '/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8', ? ^^^ ^ - ^ + 'base_executable': '/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python', ? ^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ 'base_prefix': '/Library/Frameworks/Python.framework/Versions/9.8', 'exec_prefix': '/Library/Frameworks/Python.framework/Versions/9.8', 'executable': '/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8', 'module_search_paths': ['/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip', '/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8', '/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload'], 'module_search_paths_set': 1, 'prefix': '/Library/Frameworks/Python.framework/Versions/9.8'} test_getpath failed (1 failure) The inline diff (and as mentioned before, I'm not sure if the value for "argv0" is correct): % git diff ../Lib/test/test_getpath.py (main)cpython diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py index 3fb1b28003..69b469f179 100644 --- a/Lib/test/test_getpath.py +++ b/Lib/test/test_getpath.py @@ -414,6 +414,36 @@ def test_custom_platlibdir_posix(self): actual = getpath(ns, expected) self.assertEqual(expected, actual) + def test_framework_python(self): + """ Test framework layout on macOS """ + ns = MockPosixNamespace( + os_name="darwin", + argv0="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python", + PREFIX="/Library/Frameworks/Python.framework/Versions/9.8", + ENV___PYVENV_LAUNCHER__="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8", + real_executable="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python", + ) + ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python") + ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8") + ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload") + expected = dict( + executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8", + prefix="/Library/Frameworks/Python.framework/Versions/9.8", + exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8", + base_executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8", + base_prefix="/Library/Frameworks/Python.framework/Versions/9.8", + base_exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8", + module_search_paths_set=1, + module_search_paths=[ + "/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip", + "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8", + "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload", + ], + ) + actual = getpath(ns, expected) + self.assertEqual(expected, actual) + + I may work on a PR later this week, but can't promise anything. My energy level is fairly low at the moment (for various reasons). BTW. The code in getpath.py, and tests, also don't seem to handle different values for PYTHONFRAMEWORK, I sometimes use that to have a debug framework install next to a regular install. I'll file a separate bug for that when I get around to testing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:09:40 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 02 Mar 2022 14:09:40 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646230180.13.0.216064194224.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: > This is marked as a release blocker so I am holding the alpha release on this. Is there anything we can do to unblock this issue? I marked the issue as a release blocker because it must not end up in a beta release, its probably not worth it to hold up an alpha release for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:13:30 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 02 Mar 2022 14:13:30 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646230410.13.0.300047204448.issue46891@roundup.psfhosted.org> Ronald Oussoren added the comment: @Pablo: this is a possible release blocker, hard crash for code that works in earlier releases. That said, I have a workaround on my end and IMHO a fix could wait for the next alpha. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:15:32 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 14:15:32 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646230532.97.0.814110246686.issue46891@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Marking this as release blocker. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:17:50 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 14:17:50 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646230670.36.0.199886296415.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: Is there some way to mark something as not blocking an alpha release, but blocking a beta release? Everything is working at the moment, but not so efficiently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:18:23 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 14:18:23 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646230703.2.0.228168366005.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: We should be done with this by early next week, if you can wait. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:31:49 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 14:31:49 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646231509.68.0.377450423258.issue46891@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:32:21 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 14:32:21 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646231541.2.0.88187643945.issue46891@roundup.psfhosted.org> Mark Shannon added the comment: Dennis, thanks for bisecting this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:33:46 2022 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 02 Mar 2022 14:33:46 +0000 Subject: [issue46267] gzip.compress incorrectly ignores level parameter In-Reply-To: <1641381244.64.0.268434919386.issue46267@roundup.psfhosted.org> Message-ID: <1646231626.5.0.353926715931.issue46267@roundup.psfhosted.org> Ruben Vorderman added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:40:17 2022 From: report at bugs.python.org (William Dreese) Date: Wed, 02 Mar 2022 14:40:17 +0000 Subject: [issue46900] marshal.dumps represents the same list object differently Message-ID: <1646232017.23.0.623860901093.issue46900@roundup.psfhosted.org> New submission from William Dreese : Hello, I've been working with the marshal package and came across this issue (I think) - Python 3.9.10 Interpreter (Same output in 3.11.0a5+ (heads/master:b6b711a1aa) on darwin) >>> import marshal >>> var_example = [(1,2,3),(4,5,6)] >>> var_marshaled = marshal.dumps(var_example) >>> raw_marshaled = marshal.dumps([(1,2,3),(4,5,6)]) >>> def pp(to_print): >>> [print(byt) for byt in to_print] >>> pp(var_marshaled) 219 2 0 0 0 41 3 233 1 0 0 0 233 2 0 0 0 233 3 0 0 0 169 3 233 4 0 0 0 233 5 0 0 0 233 6 0 0 0 91 2 0 0 0 41 3 233 1 0 0 0 233 2 0 0 0 233 3 0 0 0 169 3 233 4 0 0 0 233 5 0 0 0 233 6 0 0 0 >>> pp(raw_marshaled) 219 2 0 0 0 169 3 233 1 0 0 0 233 2 0 0 0 233 3 0 0 0 169 3 233 4 0 0 0 233 5 0 0 0 233 6 0 0 0 91 2 0 0 0 169 3 233 1 0 0 0 233 2 0 0 0 233 3 0 0 0 169 3 233 4 0 0 0 233 5 0 0 0 233 6 0 0 0 The difference above lies in the byte representation of the tuple type (41 in the variable version and 169 in the raw version). Is this intended behavior? ---------- components: C API messages: 414362 nosy: Dreeseaw priority: normal severity: normal status: open title: marshal.dumps represents the same list object differently type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 09:46:16 2022 From: report at bugs.python.org (William Dreese) Date: Wed, 02 Mar 2022 14:46:16 +0000 Subject: [issue46900] marshal.dumps represents the same list object differently In-Reply-To: <1646232017.23.0.623860901093.issue46900@roundup.psfhosted.org> Message-ID: <1646232376.08.0.719247993287.issue46900@roundup.psfhosted.org> William Dreese added the comment: I've made a very bad copy & paste error with the terminal output below, I apologize. The corrected output is >>> pp(var_marshaled) 91 2 0 0 0 41 3 233 1 0 0 0 233 2 0 0 0 233 3 0 0 0 41 3 233 4 0 0 0 233 5 0 0 0 233 6 0 0 0 >>> pp(raw_marshaled) 91 2 0 0 0 169 3 233 1 0 0 0 233 2 0 0 0 233 3 0 0 0 169 3 233 4 0 0 0 233 5 0 0 0 233 6 0 0 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:02:24 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 15:02:24 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646233344.27.0.0922224460778.issue46841@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:02:39 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 15:02:39 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646233359.45.0.0630981457377.issue46890@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, marking is at "deferred blocker" ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:02:20 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 15:02:20 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646233340.43.0.765629981168.issue46841@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is there some way to mark something as not blocking an alpha release, but blocking a beta release? "Deferred blocker" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:06:15 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 15:06:15 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646233575.42.0.482829736112.issue46891@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +29763 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:47:07 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Mar 2022 15:47:07 +0000 Subject: [issue46900] marshal.dumps represents the same list object differently In-Reply-To: <1646232017.23.0.623860901093.issue46900@roundup.psfhosted.org> Message-ID: <1646236027.12.0.089110790582.issue46900@roundup.psfhosted.org> Raymond Hettinger added the comment: The difference is the FLAG_REF which is set to 128 (0x80). >>> import marshal >>> var_example = [(1,2,3),(4,5,6)] >>> vm = marshal.dumps(var_example) >>> rm = marshal.dumps([(1,2,3),(4,5,6)]) >>> [v ^ r for v, r in zip(vm, rm)] [128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Whether a flag for possible reuse is generated depends on the reference count of a object. When passing in the list as variable, the reference count is higher than passing it as a literal. That flag tells marshal whether to generate an index entry. Whether that occurs re ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:49:34 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 02 Mar 2022 15:49:34 +0000 Subject: [issue46900] marshal.dumps represents the same list object differently In-Reply-To: <1646232017.23.0.623860901093.issue46900@roundup.psfhosted.org> Message-ID: <1646236174.37.0.609857657191.issue46900@roundup.psfhosted.org> Eric V. Smith added the comment: >From https://github.com/python/cpython/blob/main/Python/marshal.c: 41 is: #define TYPE_SMALL_TUPLE ')' The difference between 41 and 169 is 128: #define FLAG_REF '\x80' /* with a type, add obj to index */ So the difference is the FLAG_REF bit being set. I'm not sure if that helps you or not. In any event, this doesn't look like a bug. You might want to ask on python-list or Stack Overflow for more help. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:53:41 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 02 Mar 2022 15:53:41 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646236421.06.0.488242977496.issue46891@roundup.psfhosted.org> Ronald Oussoren added the comment: I don't feel qualified to review the PR, but can confirm that this PR fixes this issue as well as the crash in PyObjC that I extracted my reproducer from. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:54:09 2022 From: report at bugs.python.org (William Dreese) Date: Wed, 02 Mar 2022 15:54:09 +0000 Subject: [issue46900] marshal.dumps represents the same list object differently In-Reply-To: <1646232017.23.0.623860901093.issue46900@roundup.psfhosted.org> Message-ID: <1646236449.03.0.136745550475.issue46900@roundup.psfhosted.org> William Dreese added the comment: You two are both correct, this is not a bug and is the intended functionality. > The difference between 41 and 169 is 128: This realization helps a ton. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 10:55:38 2022 From: report at bugs.python.org (William Dreese) Date: Wed, 02 Mar 2022 15:55:38 +0000 Subject: [issue46900] marshal.dumps represents the same list object differently In-Reply-To: <1646232017.23.0.623860901093.issue46900@roundup.psfhosted.org> Message-ID: <1646236538.72.0.182740086883.issue46900@roundup.psfhosted.org> Change by William Dreese : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:05:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2022 16:05:28 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646237128.57.0.826756822462.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 93264452d952d9ba604bacf2947c2df5dd477931 by Victor Stinner in branch '3.10': [3.10] bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632) (GH-31634) https://github.com/python/cpython/commit/93264452d952d9ba604bacf2947c2df5dd477931 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:10:54 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 16:10:54 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646237454.34.0.0975323279795.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: Good to know, although "deferred blocker" is somewhat vague about when it is deferred until. OOI, does it become a "blocker" again once you've done the alpha release, or what stops it being deferred past the beta or even the final release? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:16:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2022 16:16:12 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646237772.24.0.653063438902.issue46633@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29764 pull_request: https://github.com/python/cpython/pull/31644 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:18:32 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 02 Mar 2022 16:18:32 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646237912.63.0.106432674773.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: It's not an UNPACK_SEQUENCE slowdown, it's a silly benchmark ;) https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_unpack_sequence/run_benchmark.py#L6 What I *think* is happening is that the inline cache takes the size of the function (in code units) from about 4800 to about 5200, crossing our threshold for quickening (currently set to 5000). When we quicken in-place, there will be no need for a threshold and this issue will disappear. We should probably up the threshold for now, just to keep the charts looking good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:28:49 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 02 Mar 2022 16:28:49 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646229810.25.0.200283550108.issue46890@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: > I've pasted the diff below because I'm not yet convinced that it is correct (in particular the value for "argv0".) argv0 is literally what C sees in argv[0], which in the framework case I believe is calculated by a launcher? The getpath.py change is probably adding an OS check for this line: https://github.com/python/cpython/blob/main/Modules/getpath.py#L304 if ENV_PYTHONEXECUTABLE or ENV___PYVENV_LAUNCHER__: # If set, these variables imply that we should be using them as # sys.executable and when searching for venvs. However, we should # use the argv0 path for prefix calculation if os_name != 'darwin': base_executable = executable if not real_executable: real_executable = executable executable = ENV_PYTHONEXECUTABLE or ENV___PYVENV_LAUNCHER__ executable_dir = dirname(executable) I think the comment "we should use the argv0 path for prefix calculation" isn't correct (anymore?) either, since updating executable_dir is going to do the opposite of that. But I guess there were tests proving otherwise. It won't affect this case, since both argv0 and ENV___PYVENV_LAUNCHER__ appear to be under the same prefix (at least in Ronald's example). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:32:10 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Mar 2022 16:32:10 +0000 Subject: [issue46889] enable sqlite math functions on macos In-Reply-To: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> Message-ID: <1646238730.72.0.252347819721.issue46889@roundup.psfhosted.org> Erlend E. Aasland added the comment: This is not needed. Quoting https://sqlite.org/compile.html#enable_math_functions: This option is automatically added to the Makefile by the configure script on unix platforms, unless the --disable-math option is used. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:32:30 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Mar 2022 16:32:30 +0000 Subject: [issue46889] enable sqlite math functions on macos In-Reply-To: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> Message-ID: <1646238750.85.0.619376520841.issue46889@roundup.psfhosted.org> Erlend E. Aasland added the comment: Suggesting to close as "not a bug". ---------- resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:34:56 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Mar 2022 16:34:56 +0000 Subject: [issue46889] enable sqlite math functions on macos In-Reply-To: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> Message-ID: <1646238896.43.0.113458758052.issue46889@roundup.psfhosted.org> Erlend E. Aasland added the comment: Duplicate of bpo-42686. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:41:02 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Mar 2022 16:41:02 +0000 Subject: [issue46889] enable sqlite math functions on macos In-Reply-To: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> Message-ID: <1646239262.69.0.306921089358.issue46889@roundup.psfhosted.org> Erlend E. Aasland added the comment: FTR, here's 3.10 and 3.11 on my Mac, using the official Python.org installers: $ python3.10 Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> cx = sqlite3.connect(":memory:") >>> cx.execute("select sin('1')").fetchone() (0.8414709848078965,) $ python3.11 Python 3.11.0a5 (v3.11.0a5:c4e4b91557, Feb 3 2022, 14:54:01) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> cx = sqlite3.connect(":memory:") >>> cx.execute("select sin('1')").fetchone() (0.8414709848078965,) ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:51:17 2022 From: report at bugs.python.org (Ethan Furman) Date: Wed, 02 Mar 2022 16:51:17 +0000 Subject: [issue46885] Ensure PEP 663 changes are reverted from 3.11 In-Reply-To: <1646074412.45.0.770188341113.issue46885@roundup.psfhosted.org> Message-ID: <1646239877.66.0.888523968874.issue46885@roundup.psfhosted.org> Change by Ethan Furman : ---------- priority: release blocker -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 11:53:38 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Mar 2022 16:53:38 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646240018.66.0.577120403334.issue46841@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > OOI, does it become a "blocker" again once you've done the alpha release, or what stops it being deferred past the beta or even the final release? Check out the devguide: https://devguide.python.org/triaging/#priority > The issue will not hold up the next release, n. It will be promoted to a release blocker for the following release, n+1. But in any case, I normally promote them to release blockers by hand and all of them become full blockers in the beta. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:12:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2022 17:12:54 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646241174.73.0.541348580576.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 359bc392ba2b8f2acca223426c8210bb74f724c6 by Victor Stinner in branch '3.9': [3.10] bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632) (GH-31634) (GH-31644) https://github.com/python/cpython/commit/359bc392ba2b8f2acca223426c8210bb74f724c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:13:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Mar 2022 17:13:40 +0000 Subject: [issue46633] AddressSanitizer: Skip tests directly in Python, not with external config In-Reply-To: <1643969351.1.0.716031320154.issue46633@roundup.psfhosted.org> Message-ID: <1646241220.64.0.0660724976874.issue46633@roundup.psfhosted.org> STINNER Victor added the comment: > https://github.com/python/buildmaster-config/pull/314 I merged this PR as well. The new buildbot configuration will be deployed soon. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:20:18 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Mar 2022 17:20:18 +0000 Subject: [issue46889] enable sqlite math functions on macos In-Reply-To: <1646147894.62.0.324206137602.issue46889@roundup.psfhosted.org> Message-ID: <1646241618.6.0.687686791073.issue46889@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the suggested PR. And thanks for noticing, Erlend! I should have checked with you first! To reiterate what I noted on the PR, this (reduntant) change would only have affected the Pythons provided by the python.org macOS installers; this behavior doesn't necessarily apply to all macOS Pythons. In particular, it appears that the Apple-provided system libsqlite3 does not have this option enabled so if you are building Python on macOS you'd need to supply another version of libsqlite3, like from a third-party distributor (say MacPorts or Homebrew) or build it yourself. ---------- resolution: not a bug -> works for me stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 12:45:33 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Mar 2022 17:45:33 +0000 Subject: [issue46901] Deprecate and eventually remove macOS-only PYTHONEXECUTABLE environ variable Message-ID: <1646243133.81.0.36417980117.issue46901@roundup.psfhosted.org> New submission from Ned Deily : The PYTHONEXECUTABLE is a holdover from old Python 2 days; AFAIK, it was specifically to support the Build Applet tool which could be used to build macOS app bundles in Python 2. The only place in current Py3 releases where it is used is in the standard library is in the launch of IDLE.app, a usage that should be able to be eliminated. Otherwise, there shouldn't be any need for it by third-parties. For 3.11, we could eliminate its use by IDLE.app and add a deprecation warning to the docs; not sure about an execution time warning? https://docs.python.org/3/using/cmdline.html#envvar-PYTHONEXECUTABLE ---------- assignee: docs at python components: Documentation, macOS messages: 414382 nosy: docs at python, ned.deily, ronaldoussoren, steve.dower priority: normal severity: normal stage: needs patch status: open title: Deprecate and eventually remove macOS-only PYTHONEXECUTABLE environ variable versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 14:03:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Mar 2022 19:03:46 +0000 Subject: [issue45492] stdlib inspect documentation on code.co_names is incorrect In-Reply-To: <1634381128.63.0.689395571563.issue45492@roundup.psfhosted.org> Message-ID: <1646247826.78.0.357028655713.issue45492@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 3257d49d236e5f3453fe9d2fd8338bcdfe9756b7 by slateny in branch 'main': bpo-45492: Corrected documentation for co_names in inspect library doc (GH-31456) https://github.com/python/cpython/commit/3257d49d236e5f3453fe9d2fd8338bcdfe9756b7 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 14:26:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Mar 2022 19:26:41 +0000 Subject: [issue45492] stdlib inspect documentation on code.co_names is incorrect In-Reply-To: <1634381128.63.0.689395571563.issue45492@roundup.psfhosted.org> Message-ID: <1646249201.49.0.277148708259.issue45492@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29765 pull_request: https://github.com/python/cpython/pull/31645 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 14:37:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Mar 2022 19:37:29 +0000 Subject: [issue45492] stdlib inspect documentation on code.co_names is incorrect In-Reply-To: <1634381128.63.0.689395571563.issue45492@roundup.psfhosted.org> Message-ID: <1646249849.33.0.681245105781.issue45492@roundup.psfhosted.org> Irit Katriel added the comment: New changeset eb65e46b9b28103767c115ccf71a97a9f4237d4c by Irit Katriel in branch '3.10': [3.10] bpo-45492: Corrected documentation for co_names in inspect library doc (GH-31456). (GH-31645) https://github.com/python/cpython/commit/eb65e46b9b28103767c115ccf71a97a9f4237d4c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 14:37:56 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Mar 2022 19:37:56 +0000 Subject: [issue45492] stdlib inspect documentation on code.co_names is incorrect In-Reply-To: <1634381128.63.0.689395571563.issue45492@roundup.psfhosted.org> Message-ID: <1646249876.2.0.871148231322.issue45492@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 15:38:04 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 02 Mar 2022 20:38:04 +0000 Subject: [issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode In-Reply-To: <1645506714.72.0.112858305238.issue46823@roundup.psfhosted.org> Message-ID: <1646253484.13.0.579768968163.issue46823@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- title: Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode -> Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 15:42:20 2022 From: report at bugs.python.org (Jean Abou Samra) Date: Wed, 02 Mar 2022 20:42:20 +0000 Subject: [issue46902] Typo hint message for from-imports? Message-ID: <1646253740.47.0.0857433223872.issue46902@roundup.psfhosted.org> New submission from Jean Abou Samra : See for example: >>> from pygments.regexopt import regexopt Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'regexopt' from 'pygments.regexopt' (/home/jean/repos/pygments/pygments/regexopt.py) >>> from pygments.regexopt import regex_opt >>> regexopt Traceback (most recent call last): File "", line 1, in NameError: name 'regexopt' is not defined. Did you mean: 'regex_opt'? In Python 3.10, there is a nice helpful error message suggesting how to correct the typo for NameError and AttributeError. Would it be possible to have the same for ImportError with 'from import'? ---------- components: Interpreter Core messages: 414385 nosy: Jean_Abou_Samra priority: normal severity: normal status: open title: Typo hint message for from-imports? type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 16:30:36 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 02 Mar 2022 21:30:36 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) Message-ID: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> New submission from Ronald Oussoren : The script below fails with an assertion error with python 3.11a5+ (current trunk) when build with --with-pydebug: # BEGIN OF FILE class String(str): __slots__ = () name = String("hello") class Bag: pass o = Bag() setattr(o, name, 42) # END OF FILE Error output: % /tmp/py311/bin/python3 -Xdev str.py (master)pyobjc-8 Assertion failed: (PyUnicode_CheckExact(name)), function _PyObject_StoreInstanceAttribute, file dictobject.c, line 5426. Fatal Python error: Aborted Current thread 0x0000000100a98580 (most recent call first): File "/Users/ronald/Projects/pyobjc-8/pyobjc-core/str.py", line 10 in zsh: abort /tmp/py311/bin/python3 -Xdev str.py ---------- components: Interpreter Core messages: 414386 nosy: ronaldoussoren priority: normal severity: normal status: open title: Crash when setting attribute with string subclass as the name (--with-pydebug) type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 16:33:41 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 02 Mar 2022 21:33:41 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646256821.31.0.585920121228.issue46903@roundup.psfhosted.org> Ronald Oussoren added the comment: A hard crash seems wrong to me, and I'm not convinced yet that checking that the type of the attribute name is exactly string is correct. Found while debugging a crash in PyObjC's testsuite, PyObjC uses a subclass of str to represent Objective-C strings. Using such instances works fine in practice, but causes a crash in a --with-pydebug build due to this assertion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 16:54:55 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 02 Mar 2022 21:54:55 +0000 Subject: [issue46902] Typo hint message for from-imports? In-Reply-To: <1646253740.47.0.0857433223872.issue46902@roundup.psfhosted.org> Message-ID: <1646258095.13.0.7680706042.issue46902@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +pablogsal versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 17:23:49 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Mar 2022 22:23:49 +0000 Subject: [issue46894] make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR In-Reply-To: <1646172960.85.0.550744633196.issue46894@roundup.psfhosted.org> Message-ID: <1646259829.62.0.809270236653.issue46894@roundup.psfhosted.org> Ned Deily added the comment: Why are you using --prefix=/ ? Or better yet, please explain you are trying to accomplish. A normal case would be --prefix=/some/path other than / and not use DESTDIR. You won't be able to install into / on a current macOS system anyway. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 17:24:17 2022 From: report at bugs.python.org (Brett Cannon) Date: Wed, 02 Mar 2022 22:24:17 +0000 Subject: [issue46860] `--with-suffix` not respected on case-insensitive file systems In-Reply-To: <1645834682.9.0.270645499588.issue46860@roundup.psfhosted.org> Message-ID: <1646259857.86.0.30209413326.issue46860@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 50ec3453c50c490eca7e990103c79671bd08ab2e by Brett Cannon in branch 'main': bpo-46860: Respect `--with-suffix` on case-insensitive file systems (GH-31593) https://github.com/python/cpython/commit/50ec3453c50c490eca7e990103c79671bd08ab2e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 17:31:33 2022 From: report at bugs.python.org (Brett Cannon) Date: Wed, 02 Mar 2022 22:31:33 +0000 Subject: [issue46860] `--with-suffix` not respected on case-insensitive file systems In-Reply-To: <1645834682.9.0.270645499588.issue46860@roundup.psfhosted.org> Message-ID: <1646260293.09.0.347349092586.issue46860@roundup.psfhosted.org> Change by Brett Cannon : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 18:39:52 2022 From: report at bugs.python.org (Constantine Evans) Date: Wed, 02 Mar 2022 23:39:52 +0000 Subject: [issue46904] Python Decimal supports '#' format, C Decimal does not. Message-ID: <1646264392.01.0.522229307506.issue46904@roundup.psfhosted.org> New submission from Constantine Evans : Decimal as implemented in _pydecimal supports the '#' alternate form in format strings, though this does not appear to be documented: as with floats, it causes a decimal point to be included regardless of value. Decimal as implemented in cdecimal, as it uses libmpdec, does not. This is a rather minor discrepancy; I hadn't actually intended to have # in my format string at all, but it had ended up there and was causing errors for half of the users of my library. # also could be useful for decimals, as it can be for floats. Like #45739, it's unclear to me whether this is a discrepancy that should be corrected by implementing # for cdecimal, removing # support for _pydecimal, or just documenting the inconsistency. ---------- components: Library (Lib) messages: 414390 nosy: const priority: normal severity: normal status: open title: Python Decimal supports '#' format, C Decimal does not. type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 18:40:07 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Mar 2022 23:40:07 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646264407.6.0.696072513545.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: > What I *think* is happening is that the inline cache takes the size of the function (in code units) from about 4800 to about 5200, crossing our threshold for quickening (currently set to 5000). Yep, nailed it: >>> len(list(dis.get_instructions(do_unpacking))) 4827 >>> len(list(dis.get_instructions(do_unpacking, show_caches=True))) 5251 >>> do_unpacking(1_000, range(10)) 0.06478393300494645 >>> do_unpacking.__code__._co_quickened is None True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 18:45:33 2022 From: report at bugs.python.org (Constantine Evans) Date: Wed, 02 Mar 2022 23:45:33 +0000 Subject: [issue26208] decimal C module's exceptions don't match the Python version In-Reply-To: <1453830419.58.0.782557332566.issue26208@psf.upfronthosting.co.za> Message-ID: <1646264733.8.0.984918755977.issue26208@roundup.psfhosted.org> Constantine Evans added the comment: Some other non-matching exceptions are unfriendly, but do not come from libmpdec and could be made to match without, I think, causing problems. For example: >>> format(_decimal.Decimal(1), "invalid") ... ValueError: invalid format string >>> format(_pydecimal.Decimal(1), "invalid") ... ValueError: Invalid format specifier: invalid Would it make sense to make a patch to make these match? ---------- nosy: +const _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 19:02:34 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 03 Mar 2022 00:02:34 +0000 Subject: [issue46904] Python Decimal supports '#' format, C Decimal does not. In-Reply-To: <1646264392.01.0.522229307506.issue46904@roundup.psfhosted.org> Message-ID: <1646265754.58.0.826686554633.issue46904@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 19:02:59 2022 From: report at bugs.python.org (Julian) Date: Thu, 03 Mar 2022 00:02:59 +0000 Subject: [issue46905] winsound.PlaySound should accept pathlib.Path instances Message-ID: <1646265779.67.0.979185331042.issue46905@roundup.psfhosted.org> New submission from Julian : The library function winsound.PlaySound takes a sound parameter. One of the valid arguments is a path to a WAV filename. Since Python 3.4, paths can be cleanly represented with PathLib.Path instances. However, if you pass a Path instance to PlaySound, it responds with: TypeError: 'sound' must be str or None, not 'WindowsPath' This can be quickly fixed in the caller by passing str(the_path_instance) instead, but it would be cleaner if PlaySound accepted Python's preferred method of representing paths. ---------- components: Library (Lib) messages: 414393 nosy: Julian-O priority: normal severity: normal status: open title: winsound.PlaySound should accept pathlib.Path instances type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 19:03:06 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 03 Mar 2022 00:03:06 +0000 Subject: [issue46904] Python Decimal supports '#' format, C Decimal does not. In-Reply-To: <1646264392.01.0.522229307506.issue46904@roundup.psfhosted.org> Message-ID: <1646265786.02.0.669067030142.issue46904@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 19:51:21 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 00:51:21 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1646268681.05.0.629593405405.issue46864@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:09:36 2022 From: report at bugs.python.org (Andre Roberge) Date: Thu, 03 Mar 2022 01:09:36 +0000 Subject: [issue46902] Typo hint message for from-imports? In-Reply-To: <1646253740.47.0.0857433223872.issue46902@roundup.psfhosted.org> Message-ID: <1646269776.41.0.478451639454.issue46902@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:15:10 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 01:15:10 +0000 Subject: [issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs In-Reply-To: <1644013165.99.0.0164231326825.issue46643@roundup.psfhosted.org> Message-ID: <1646270110.46.0.537163439891.issue46643@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 75d2d945b4e28ca34506b2d4902367b61a8dff82 by Gregory Beauregard in branch 'main': bpo-46643: Fix stringized P.args/P.kwargs with get_type_hints (GH-31238) https://github.com/python/cpython/commit/75d2d945b4e28ca34506b2d4902367b61a8dff82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:15:15 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 01:15:15 +0000 Subject: [issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs In-Reply-To: <1644013165.99.0.0164231326825.issue46643@roundup.psfhosted.org> Message-ID: <1646270115.75.0.0670180496821.issue46643@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +29766 pull_request: https://github.com/python/cpython/pull/31646 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:21:44 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 01:21:44 +0000 Subject: [issue21910] [doc] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1646270504.82.0.835926613549.issue21910@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset a8c87a239ee1414d6dd0b062fe9ec3e5b0c50cb8 by slateny in branch 'main': bpo-21910: Clarify docs for codecs writelines method (GH-31245) https://github.com/python/cpython/commit/a8c87a239ee1414d6dd0b062fe9ec3e5b0c50cb8 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:21:56 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 01:21:56 +0000 Subject: [issue21910] [doc] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1646270516.82.0.366077123222.issue21910@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29768 pull_request: https://github.com/python/cpython/pull/31648 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:22:04 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 01:22:04 +0000 Subject: [issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs In-Reply-To: <1644013165.99.0.0164231326825.issue46643@roundup.psfhosted.org> Message-ID: <1646270524.05.0.204415528689.issue46643@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:21:52 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 01:21:52 +0000 Subject: [issue21910] [doc] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1646270512.07.0.078563601347.issue21910@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 13.0 -> 14.0 pull_requests: +29767 pull_request: https://github.com/python/cpython/pull/31647 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:22:45 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 01:22:45 +0000 Subject: [issue21910] [doc] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1646270565.83.0.518857821913.issue21910@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:43:04 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 01:43:04 +0000 Subject: [issue21910] [doc] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1646271784.03.0.607982642064.issue21910@roundup.psfhosted.org> miss-islington added the comment: New changeset 60b561c246da2073672a016340457e4534dfdf5b by Miss Islington (bot) in branch '3.10': bpo-21910: Clarify docs for codecs writelines method (GH-31245) https://github.com/python/cpython/commit/60b561c246da2073672a016340457e4534dfdf5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:45:50 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 01:45:50 +0000 Subject: [issue21910] [doc] File protocol should document if writelines must handle generators sensibly In-Reply-To: <1404380309.75.0.473808735546.issue21910@psf.upfronthosting.co.za> Message-ID: <1646271950.84.0.23121007521.issue21910@roundup.psfhosted.org> miss-islington added the comment: New changeset cf8aff6319794807aa578215710e6caa4479516f by Miss Islington (bot) in branch '3.9': bpo-21910: Clarify docs for codecs writelines method (GH-31245) https://github.com/python/cpython/commit/cf8aff6319794807aa578215710e6caa4479516f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 20:54:35 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Mar 2022 01:54:35 +0000 Subject: [issue46902] Typo hint message for from-imports? In-Reply-To: <1646253740.47.0.0857433223872.issue46902@roundup.psfhosted.org> Message-ID: <1646272475.72.0.886489214572.issue46902@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I evaluated this, but is considerably more complex than the regular import, because one triggers an attribute error where we have the full module but in the second case we don't have the full module ready, so it requires considerable modifications. I will investigate again if there is a way that doesn't require lots of changes, but is likely that we unfortunately need to reject this improvement :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 21:26:59 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 02:26:59 +0000 Subject: [issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs In-Reply-To: <1644013165.99.0.0164231326825.issue46643@roundup.psfhosted.org> Message-ID: <1646274419.64.0.683374807844.issue46643@roundup.psfhosted.org> miss-islington added the comment: New changeset 257f5be7f7fad37d0db6c145e534e5b7289d8804 by Miss Islington (bot) in branch '3.10': bpo-46643: Fix stringized P.args/P.kwargs with get_type_hints (GH-31238) https://github.com/python/cpython/commit/257f5be7f7fad37d0db6c145e534e5b7289d8804 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 21:35:36 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 03 Mar 2022 02:35:36 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646274936.75.0.493752065597.issue46903@roundup.psfhosted.org> Dennis Sweeney added the comment: a8b9350964f43cb648c98c179c8037fbf3ff8a7d is the first bad commit commit a8b9350964f43cb648c98c179c8037fbf3ff8a7d Author: Mark Shannon Date: Wed Oct 13 14:19:34 2021 +0100 bpo-45340: Don't create object dictionaries unless actually needed (GH-28802) * Never change types' cached keys. It could invalidate inline attribute objects. * Lazily create object dictionaries. * Update specialization of LOAD/STORE_ATTR. * Don't update shared keys version for deletion of value. * Update gdb support to handle instance values. * Rename SPLIT_KEYS opcodes to INSTANCE_VALUE. ---------- nosy: +Dennis Sweeney, Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 22:09:32 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 03 Mar 2022 03:09:32 +0000 Subject: [issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. Message-ID: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> New submission from Inada Naoki : Original issue. https://github.com/msgpack/msgpack-python/issues/497 _PyFloat_(Pack|Unpack)(4|8) is very nice API for serializers like msgpack. Converting double and float into char[] is not trivial and these APIs do it in very efficient way. And these APIs don't reveal CPython internal strucutre. It just convert double and float into char[]. So please keep these APIs public for libraries like msgpack. ---------- components: C API messages: 414401 nosy: methane, vstinner priority: normal severity: normal status: open title: Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 22:22:13 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 03 Mar 2022 03:22:13 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646277733.86.0.635349233225.issue46903@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 22:41:15 2022 From: report at bugs.python.org (Adam) Date: Thu, 03 Mar 2022 03:41:15 +0000 Subject: [issue46863] Python 3.10 OpenSSL Configuration Issues In-Reply-To: <1645852366.6.0.130545163871.issue46863@roundup.psfhosted.org> Message-ID: <1646278875.74.0.41710447138.issue46863@roundup.psfhosted.org> Adam added the comment: Many thanks Christian, that resolved the issue! I really appreciate your efforts here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 22:55:39 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 03 Mar 2022 03:55:39 +0000 Subject: [issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646279739.27.0.645199683524.issue46906@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +29769 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31649 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 2 23:06:40 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 03 Mar 2022 04:06:40 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1646280400.51.0.408144526675.issue40116@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 4f74052b455a54ac736f38973693aeea2ec14116 by Inada Naoki in branch 'main': bpo-40116: dict: Add regression test for iteration order. (GH-31550) https://github.com/python/cpython/commit/4f74052b455a54ac736f38973693aeea2ec14116 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:00:04 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 05:00:04 +0000 Subject: [issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs In-Reply-To: <1644013165.99.0.0164231326825.issue46643@roundup.psfhosted.org> Message-ID: <1646283604.21.0.960141659006.issue46643@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +29770 pull_request: https://github.com/python/cpython/pull/31651 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:27:28 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 05:27:28 +0000 Subject: [issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs In-Reply-To: <1644013165.99.0.0164231326825.issue46643@roundup.psfhosted.org> Message-ID: <1646285248.39.0.00514111346918.issue46643@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 59e1ce95f1e6ea8a556212b8b10cbc122f1a1711 by Jelle Zijlstra in branch 'main': bpo-46643: fix NEWS entry (GH-31651) https://github.com/python/cpython/commit/59e1ce95f1e6ea8a556212b8b10cbc122f1a1711 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:33:06 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 05:33:06 +0000 Subject: [issue46831] Outdated comment for __build_class__ in compile.c In-Reply-To: <1645587117.9.0.320928426769.issue46831@roundup.psfhosted.org> Message-ID: <1646285586.72.0.784745343747.issue46831@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 81d968b7c30d5b41f3f28b297b7ee5345d569509 by Shantanu in branch 'main': bpo-46831: Update __build_class__ comment (#31522) https://github.com/python/cpython/commit/81d968b7c30d5b41f3f28b297b7ee5345d569509 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:33:07 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 05:33:07 +0000 Subject: [issue46831] Outdated comment for __build_class__ in compile.c In-Reply-To: <1645587117.9.0.320928426769.issue46831@roundup.psfhosted.org> Message-ID: <1646285587.27.0.470560932256.issue46831@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +29771 pull_request: https://github.com/python/cpython/pull/31652 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:33:11 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 05:33:11 +0000 Subject: [issue46831] Outdated comment for __build_class__ in compile.c In-Reply-To: <1645587117.9.0.320928426769.issue46831@roundup.psfhosted.org> Message-ID: <1646285591.43.0.716409927167.issue46831@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29772 pull_request: https://github.com/python/cpython/pull/31653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:33:38 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Mar 2022 05:33:38 +0000 Subject: [issue46831] Outdated comment for __build_class__ in compile.c In-Reply-To: <1645587117.9.0.320928426769.issue46831@roundup.psfhosted.org> Message-ID: <1646285618.7.0.148117568581.issue46831@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 00:52:06 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 03 Mar 2022 05:52:06 +0000 Subject: [issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode In-Reply-To: <1645506714.72.0.112858305238.issue46823@roundup.psfhosted.org> Message-ID: <1646286726.78.0.376309396936.issue46823@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 01:00:08 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 06:00:08 +0000 Subject: [issue46831] Outdated comment for __build_class__ in compile.c In-Reply-To: <1645587117.9.0.320928426769.issue46831@roundup.psfhosted.org> Message-ID: <1646287208.56.0.533897961598.issue46831@roundup.psfhosted.org> miss-islington added the comment: New changeset 1d428bb8c93120d449212e2a815988f28e33b868 by Miss Islington (bot) in branch '3.9': bpo-46831: Update __build_class__ comment (GH-31522) https://github.com/python/cpython/commit/1d428bb8c93120d449212e2a815988f28e33b868 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 01:03:09 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 06:03:09 +0000 Subject: [issue46831] Outdated comment for __build_class__ in compile.c In-Reply-To: <1645587117.9.0.320928426769.issue46831@roundup.psfhosted.org> Message-ID: <1646287389.79.0.755011640905.issue46831@roundup.psfhosted.org> miss-islington added the comment: New changeset fa8c5ed9c80507670c756aa83ea872b8a92bcd1c by Miss Islington (bot) in branch '3.10': bpo-46831: Update __build_class__ comment (GH-31522) https://github.com/python/cpython/commit/fa8c5ed9c80507670c756aa83ea872b8a92bcd1c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 01:52:43 2022 From: report at bugs.python.org (Eryk Sun) Date: Thu, 03 Mar 2022 06:52:43 +0000 Subject: [issue46905] winsound.PlaySound should accept pathlib.Path instances In-Reply-To: <1646265779.67.0.979185331042.issue46905@roundup.psfhosted.org> Message-ID: <1646290363.52.0.566155038701.issue46905@roundup.psfhosted.org> Eryk Sun added the comment: PlaySound() is implemented by the C function winsound_PlaySound_impl() in "PC/winsound.c". To support pathlike objects, it could use `soundname = PyOS_FSPath(sound)`, and require soundname to be a Unicode string via PyUnicode_Check(soundname). Or it could more generically support any buffer or pathlike object via PyUnicode_FSDecoder(sound, &soundname). This call decodes byte strings using the filesystem encoding, which is UTF-8 unless legacy ANSI mode is enabled. ---------- nosy: +eryksun stage: -> needs patch versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 01:53:50 2022 From: report at bugs.python.org (Eryk Sun) Date: Thu, 03 Mar 2022 06:53:50 +0000 Subject: [issue46905] winsound.PlaySound should accept pathlib.Path instances In-Reply-To: <1646265779.67.0.979185331042.issue46905@roundup.psfhosted.org> Message-ID: <1646290430.26.0.454190863353.issue46905@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +Windows keywords: +easy (C) nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 02:47:17 2022 From: report at bugs.python.org (Niyas Sait) Date: Thu, 03 Mar 2022 07:47:17 +0000 Subject: [issue46886] ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt In-Reply-To: <1646088788.98.0.693772071082.issue46886@roundup.psfhosted.org> Message-ID: <1646293637.38.0.580714064943.issue46886@roundup.psfhosted.org> Niyas Sait added the comment: After the OS and toolchain update, I don't see the failures anymore. https://buildbot.python.org/all/#/workers/45 I guess we can close the ticket and can reopen if it happens again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:19:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 08:19:26 +0000 Subject: [issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646295566.05.0.120468371398.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: I disagree. A function should be either fully public: tested, documented. Or fully internal. In the past, many functions were in both, in the gray area. If these functions are useful, please make them *public* and document them. I'm +1 to make these functions public. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:25:54 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 03 Mar 2022 08:25:54 +0000 Subject: [issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646295954.91.0.381832973234.issue46906@roundup.psfhosted.org> Inada Naoki added the comment: OK. By quick grepping, I found only msgpack and bitstruct use these API. It is not enough number to make them public. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:26:02 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 03 Mar 2022 08:26:02 +0000 Subject: [issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646295962.3.0.593366932759.issue46906@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:27:32 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 03 Mar 2022 08:27:32 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.0. Message-ID: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> New submission from Mariusz Felisiak : SQLite 3.37.0 was released on 2022-02-22: https://sqlite.org/releaselog/3_38_0.html ---------- components: Windows, macOS messages: 414412 nosy: erlendaasland, felixxm, ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Update Windows and MacOS installer to SQLite 3.38.0. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:32:12 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Mar 2022 08:32:12 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.0. In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1646296332.69.0.195683622018.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: +1 for SQLite 3.38.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:36:28 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 03 Mar 2022 08:36:28 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.0. In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1646296588.87.0.924066735831.issue46907@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- keywords: +patch pull_requests: +29773 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31655 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:42:34 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 03 Mar 2022 08:42:34 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.0. In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1646296954.89.0.942171208448.issue46907@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- pull_requests: +29774 pull_request: https://github.com/python/cpython/pull/31656 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 03:49:14 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Mar 2022 08:49:14 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.0. In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1646297354.72.0.436611931922.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: Steve, would you mind updating the cpython sources repo? (No hurry; let's see if a patch release surfaces first.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 04:51:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Mar 2022 09:51:27 +0000 Subject: [issue45373] ./configure --enable-optimizations should enable LTO In-Reply-To: <1633426345.9.0.0201314807782.issue45373@roundup.psfhosted.org> Message-ID: <1646301087.15.0.390778287798.issue45373@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:05:28 2022 From: report at bugs.python.org (Tzu-ping Chung) Date: Thu, 03 Mar 2022 10:05:28 +0000 Subject: [issue43455] pathlib mistakenly assumes os.getcwd() is a resolved path in Windows In-Reply-To: <1615331156.25.0.626111621937.issue43455@roundup.psfhosted.org> Message-ID: <1646301928.66.0.348699981175.issue43455@roundup.psfhosted.org> Tzu-ping Chung added the comment: I believe this has been fixed in https://github.com/python/cpython/pull/25264 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:10:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 10:10:38 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646302238.98.0.978025521993.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue, I would like to make these functions public :-) I searched for the 6 functions moved to the internal C API and I found 6 projets using it in the top 5000 PyPI projects (at 2022-01-26): * msgpack * ddtrace * bitstruct * pickle5 * line_profiler * zodbpickle The 6 functions are used: * _PyFloat_Pack2() * _PyFloat_Pack4() * _PyFloat_Pack8() * _PyFloat_Unpack2() * _PyFloat_Unpack4() * _PyFloat_Unpack8() ---------- resolution: rejected -> status: closed -> open title: Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal. -> Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:12:29 2022 From: report at bugs.python.org (Luca Lesinigo) Date: Thu, 03 Mar 2022 10:12:29 +0000 Subject: [issue16535] json encoder unable to handle decimal In-Reply-To: <1353624338.46.0.574343718645.issue16535@psf.upfronthosting.co.za> Message-ID: <1646302349.64.0.926255876153.issue16535@roundup.psfhosted.org> Change by Luca Lesinigo : ---------- nosy: +luca.lesinigo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:20:54 2022 From: report at bugs.python.org (=?utf-8?q?Francisco_Arenas_Af=C3=A1n_de_Rivera?=) Date: Thu, 03 Mar 2022 10:20:54 +0000 Subject: [issue46908] Debugger jumps to a wrong instruction in for loop Message-ID: <1646302854.95.0.25406380974.issue46908@roundup.psfhosted.org> New submission from Francisco Arenas Af?n de Rivera : I found that the debugger doesn't follow the normal program order when executing a foor loop with more than 3 instructions inside and one loop. code example: a = 0 b = 0 c = 0 for i in range(1): a += 1 b += 1 # Set breakpoint here c += 1 # Also crash with breakpoint here jumps to the line b += 1 after the end of the loop and crashes with error: Process finished with exit code -1073741819 (0xC0000005) ---------- messages: 414417 nosy: franarenasafan priority: normal severity: normal status: open title: Debugger jumps to a wrong instruction in for loop versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:38:55 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 10:38:55 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646303935.6.0.571816812719.issue46891@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 751c9ed801ad1189272ca10f0749bfc9d49b5038 by Mark Shannon in branch 'main': bpo-46891: Fix creating a new instance of a module subclass with slots (GH-31643) https://github.com/python/cpython/commit/751c9ed801ad1189272ca10f0749bfc9d49b5038 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:46:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 10:46:57 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646304417.49.0.23383030075.issue46906@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29775 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:48:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 10:48:28 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646304508.3.0.618361341766.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: The pack/unpack functions have been moved to the internal C API by this change: commit 0a883a76cda8205023c52211968bcf87bd47fd6e Author: Victor Stinner Date: Thu Oct 14 23:41:06 2021 +0200 bpo-35134: Add Include/cpython/floatobject.h (GH-28957) Split Include/floatobject.h into sub-files: add Include/cpython/floatobject.h and Include/internal/pycore_floatobject.h. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:48:59 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 10:48:59 +0000 Subject: [issue46891] Crash in ModuleType subclass with __slots__ In-Reply-To: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> Message-ID: <1646304539.96.0.225401167723.issue46891@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 Mar 3 05:48:32 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 10:48:32 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None In-Reply-To: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> Message-ID: <1646304512.98.0.0178468896516.issue46389@roundup.psfhosted.org> Mark Shannon added the comment: Ned, is this fixed for you now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:52:03 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 10:52:03 +0000 Subject: [issue46832] unicodeobject.c doesn't compile when defined EXPERIMENTAL_ISOLATED_SUBINTERPRETERS, variable "interned" not found In-Reply-To: <1645596729.1.0.194216196654.issue46832@roundup.psfhosted.org> Message-ID: <1646304723.85.0.572628244957.issue46832@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +eric.snow, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 05:53:11 2022 From: report at bugs.python.org (Russel Webber) Date: Thu, 03 Mar 2022 10:53:11 +0000 Subject: [issue46909] Update getpath.py to look for os.pyc in __pycache__ folders Message-ID: <1646304791.08.0.433238177633.issue46909@roundup.psfhosted.org> New submission from Russel Webber : The STDLIB_LANDMARKS in Modules/getpath,py refers to os.pyc in an old location: STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}/os.py', f'{STDLIB_SUBDIR}/os.pyc'] Since https://www.python.org/dev/peps/pep-3147 the .pyc files are in __pycache__ folders. The STDLIB_LANDMARKS should be updated. ---------- assignee: docs at python components: Documentation, Extension Modules, Interpreter Core messages: 414421 nosy: RusselWebber, docs at python, ned.deily, steve.dower priority: normal severity: normal status: open title: Update getpath.py to look for os.pyc in __pycache__ folders type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:02:02 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 11:02:02 +0000 Subject: [issue45062] test_asyncio: test_huge_content_recvinto() failed on PPC64LE RHEL8 Refleaks 3.9 In-Reply-To: <1630417417.52.0.890945752162.issue45062@roundup.psfhosted.org> Message-ID: <1646305322.14.0.339035282257.issue45062@roundup.psfhosted.org> Kumar Aditya added the comment: @vstinner This issue has not been happening on the CI recently so can this be marked as pending or even close it and reopen when it does fail? ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:14:26 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 11:14:26 +0000 Subject: [issue39758] StreamWriter.wait_closed() can hang indefinitely. In-Reply-To: <1582713366.75.0.743984348325.issue39758@roundup.psfhosted.org> Message-ID: <1646306066.55.0.302154821703.issue39758@roundup.psfhosted.org> Kumar Aditya added the comment: On main branch with rewritten SSL implementation GH-31275 bpo-44011, this raises TimeoutError: -------------------------------------------------------------------------------- opened close started Traceback (most recent call last): File "/workspaces/cpython/main.py", line 18, in asyncio.run(main()) ^^^^^^^^^^^^^^^^^^^ File "/workspaces/cpython/Lib/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/cpython/Lib/asyncio/base_events.py", line 645, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/workspaces/cpython/main.py", line 14, in main await writer.wait_closed() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/cpython/Lib/asyncio/streams.py", line 344, in wait_closed await self._protocol._get_close_waiter(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TimeoutError: SSL shutdown timed out -------------------------------------------------------------------------------- This issue has been fixed, it can be closed @asvetlov. ---------- nosy: +kumaraditya303 type: performance -> behavior versions: -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:22:08 2022 From: report at bugs.python.org (Jonathan Fine) Date: Thu, 03 Mar 2022 11:22:08 +0000 Subject: [issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop Message-ID: <1646306528.93.0.506258424716.issue46910@roundup.psfhosted.org> New submission from Jonathan Fine : This arises from a request for help made by Nguy?n Ng?c Ti?n to the visually impaired programmers lists, see https://www.freelists.org/post/program-l/python,48. Please keep this in mind. Nguy?n asked for help with the syntax error created by === count = 0 while count < 1: count = count + 1 print(count) break else: print("no break") === When I saved this to a file and ran it I got: === $ python3.8 funny_break_error.py File "funny_break_error.py", line 6 else: ^ IndentationError: unexpected indent === However, remove the last two lines and you get the more helpful error === $ python3.8 funny_break_error.py File "funny_break_error.py", line 5 break ^ SyntaxError: 'break' outside loop === Python3.6 and 3.7 also behave as above. Note. I've heard that blind Python programmers prefer a single space to denote indent. I think this is because they hear the leading spaces via a screen reader, rather than see the indent with their eyes. ---------- components: Parser files: funny_break_error.py messages: 414424 nosy: jfine2358, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Expect IndentationError, get SyntaxError: 'break' outside loop type: behavior versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file50655/funny_break_error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:22:48 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 11:22:48 +0000 Subject: [issue36709] Asyncio SSL keep-alive connections raise errors after loop close. In-Reply-To: <1556095707.61.0.53219784779.issue36709@roundup.psfhosted.org> Message-ID: <1646306568.14.0.34339577759.issue36709@roundup.psfhosted.org> Kumar Aditya added the comment: The original issue is fixed on main branch with bpo-44011 GH-31275, It now only raises warnings but no exceptions: ----------------------------------------------------------- (env) @kumaraditya303 ? /workspaces/cpython (latin1 ?) $ python main.py /workspaces/cpython/main.py:12: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /workspaces/cpython/env/lib/python3.11/site-packages/certifi/core.py:36: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice. _CACERT_CTX = get_path("certifi", "cacert.pem") sys:1: ResourceWarning: unclosed ResourceWarning: Enable tracemalloc to get the object allocation traceback /workspaces/cpython/Lib/asyncio/sslproto.py:116: ResourceWarning: unclosed transport _warnings.warn( /workspaces/cpython/Lib/asyncio/selector_events.py:710: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=7> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback ----------------------------------------------------------- @asvetlvo This can be closed now. ---------- nosy: +kumaraditya303 type: -> behavior versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:23:08 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 03 Mar 2022 11:23:08 +0000 Subject: [issue46909] Update getpath.py to look for os.pyc in __pycache__ folders In-Reply-To: <1646304791.08.0.433238177633.issue46909@roundup.psfhosted.org> Message-ID: <1646306588.03.0.0248590863003.issue46909@roundup.psfhosted.org> Steve Dower added the comment: It's looking for a precompiled bundled stdlib, rather than one that's been generated from adjacent source files. This is deliberate (also quite an advanced scenario, but it does get used). ---------- components: -Documentation resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:24:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 11:24:01 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646306641.76.0.195619401051.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: I prepared a pythoncapi_compat PR to provide these functions to Python 3.10 and older: https://github.com/pythoncapi/pythoncapi_compat/pull/26 Note: bpo-11734 (commit 7c4e409d075fdb923807513353b18a75a4520eba) added _PyFloat_Pack2() and _PyFloat_Unpack2() to Python 3.6.0b1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:24:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 11:24:11 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1646306651.17.0.850477955973.issue46906@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +lemburg, mark.dickinson, rhettinger, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:25:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 11:25:34 +0000 Subject: [issue46886] ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt In-Reply-To: <1646088788.98.0.693772071082.issue46886@roundup.psfhosted.org> Message-ID: <1646306734.78.0.148218712854.issue46886@roundup.psfhosted.org> STINNER Victor added the comment: > I guess we can close the ticket and can reopen if it happens again. Ok, let's do that! ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:26:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 11:26:57 +0000 Subject: [issue46832] unicodeobject.c doesn't compile when defined EXPERIMENTAL_ISOLATED_SUBINTERPRETERS, variable "interned" not found In-Reply-To: <1645596729.1.0.194216196654.issue46832@roundup.psfhosted.org> Message-ID: <1646306817.12.0.183605631787.issue46832@roundup.psfhosted.org> STINNER Victor added the comment: This build flag is experimental and unsupported. If you care, you should target Python 3.11 which is currently under development. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:27:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 11:27:33 +0000 Subject: [issue45062] test_asyncio: test_huge_content_recvinto() failed on PPC64LE RHEL8 Refleaks 3.9 In-Reply-To: <1630417417.52.0.890945752162.issue45062@roundup.psfhosted.org> Message-ID: <1646306853.08.0.412949517377.issue45062@roundup.psfhosted.org> STINNER Victor added the comment: I didn't see this failure recently, I just close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:29:31 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 11:29:31 +0000 Subject: [issue46832] unicodeobject.c doesn't compile when defined EXPERIMENTAL_ISOLATED_SUBINTERPRETERS, variable "interned" not found In-Reply-To: <1645596729.1.0.194216196654.issue46832@roundup.psfhosted.org> Message-ID: <1646306971.89.0.233883698435.issue46832@roundup.psfhosted.org> Kumar Aditya added the comment: @vstinner it is broken on main branch also. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:31:26 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 11:31:26 +0000 Subject: [issue37368] test_asyncio: test_create_server_ssl_match_failed() failed on s390x SLES 3.x and logged an unraisable exception In-Reply-To: <1561151330.27.0.514257001535.issue37368@roundup.psfhosted.org> Message-ID: <1646307086.64.0.441948223084.issue37368@roundup.psfhosted.org> Kumar Aditya added the comment: This is outdated as the last failure was almost a year ago. This should be closed or at least marked pending @vstinner. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 06:57:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 11:57:05 +0000 Subject: [issue37368] test_asyncio: test_create_server_ssl_match_failed() failed on s390x SLES 3.x and logged an unraisable exception In-Reply-To: <1561151330.27.0.514257001535.issue37368@roundup.psfhosted.org> Message-ID: <1646308625.94.0.00589676511411.issue37368@roundup.psfhosted.org> STINNER Victor added the comment: I failed to reproduce the issue with: "./python -m test test_asyncio -m test_create_server_ssl_match_failed -F -j50 --fail-env-changed" It ran 1000 iterations in 5 minutes with a load average of 50 (my laptop has 4 CPU cores: 8 threads). ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:00:30 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 03 Mar 2022 12:00:30 +0000 Subject: [issue45065] test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__ In-Reply-To: <1630423615.96.0.978514058482.issue45065@roundup.psfhosted.org> Message-ID: <1646308830.83.0.975620072976.issue45065@roundup.psfhosted.org> Kumar Aditya added the comment: asyncio ssl implementation has been rewritten with bpo-44011: This is outdated now and should be closed @vstinner. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:05:08 2022 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Thu, 03 Mar 2022 12:05:08 +0000 Subject: [issue46894] make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR In-Reply-To: <1646172960.85.0.550744633196.issue46894@roundup.psfhosted.org> Message-ID: <1646309108.16.0.45505035899.issue46894@roundup.psfhosted.org> ????? ???????? added the comment: I want to compile and install python for a chrooted environment. --prefix are the path within the chrooted-environment. DESTDIR is the location of the root of the chrooted-environment. When I glue DESTDIR with --prefix= (thus use no DESTDIR) this happens: /lib/python3.10/_sysconfigdata__linux_x86_64-linux-gnu.py contains the value of --prefix. When python is executed within the chrooted environment, this value is just wrong. `strings python` also prints the value of --prefix. Within the chrooted environment, that value is not correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:09:24 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 12:09:24 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646309364.98.0.457861866197.issue46903@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +29776 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31658 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:09:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 12:09:41 +0000 Subject: [issue45065] test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__ In-Reply-To: <1630423615.96.0.978514058482.issue45065@roundup.psfhosted.org> Message-ID: <1646309381.37.0.343091620876.issue45065@roundup.psfhosted.org> STINNER Victor added the comment: I didn't see this issue recently, I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 07:16:00 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 12:16:00 +0000 Subject: [issue46675] Allow more than 16 items in split-keys dicts and "virtual" object dicts. In-Reply-To: <1644234724.61.0.0969544850657.issue46675@roundup.psfhosted.org> Message-ID: <1646309760.26.0.945050108025.issue46675@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 Mar 3 08:20:48 2022 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 03 Mar 2022 13:20:48 +0000 Subject: [issue46623] test_zlib: test_pair() and test_speech128() fail with s390x hardware accelerator In-Reply-To: <1643877280.17.0.469977325894.issue46623@roundup.psfhosted.org> Message-ID: <1646313648.7.0.4913522356.issue46623@roundup.psfhosted.org> Petr Viktorin added the comment: The current fix skips all of the tests, rather than just the parts that fail. ---------- nosy: +petr.viktorin resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:36:59 2022 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 03 Mar 2022 13:36:59 +0000 Subject: [issue46911] Early tracing has lineno=None for modules Message-ID: <1646314619.94.0.770147890842.issue46911@roundup.psfhosted.org> New submission from Ned Batchelder : Coverage.py has a trick to measure the early execution of stdlib modules. It has an "encodings.py" file that sets a trace function, then gets out of the way to let the real encodings.py execute. In 3.11.0a5, that early trace function gets None values for the line numbers when modules were first executed. To reproduce, create two files, encodings.py and prog.py: --- 8< ------------------------------------------ # encodings.py import sys class FullCoverageTracer: def __init__(self): self.traces = [] def fullcoverage_trace(self, *args): frame, event, arg = args if frame.f_lineno is None: self.traces.append((frame.f_code.co_name, frame.f_code.co_filename)) return self.fullcoverage_trace sys.settrace(FullCoverageTracer().fullcoverage_trace) parentdir = max(filter(__file__.startswith, sys.path), key=len) sys.path.remove(parentdir) del sys.modules['encodings'] import encodings ------------------------------------------------- --- 8< ------------------------------------------ # prog.py import sys print(sys.version) trace = sys.gettrace() print("None traces:", trace.__self__.traces) print("Hello") ------------------------------------------------- Then run: % PYTHONPATH=$(pwd) python3.10 prog.py 3.10.2 (main, Jan 15 2022, 05:51:59) [Clang 12.0.0 (clang-1200.0.32.29)] None traces: [] Hello % PYTHONPATH=$(pwd) python3.11 prog.py 3.11.0a5 (main, Feb 3 2022, 19:11:58) [Clang 12.0.0 (clang-1200.0.32.29)] None traces: [('', '/usr/local/pyenv/pyenv/versions/3.11.0a5/lib/python3.11/encodings/__init__.py'), ('', ''), ('', '/usr/local/pyenv/pyenv/versions/3.11.0a5/lib/python3.11/encodings/aliases.py'), ('', '/usr/local/pyenv/pyenv/versions/3.11.0a5/lib/python3.11/encodings/utf_8.py'), ('', ''), ('', ''), ('', ''), ('', ''), ('', ''), ('', ''), ('', ''), ('', ''), ('', ''), ('', ''), ('', '/System/Volumes/Data/root/src/bugs/fullcov/prog.py')] Hello ---------- components: Interpreter Core keywords: 3.11regression messages: 414438 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Early tracing has lineno=None for modules versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:37:19 2022 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 03 Mar 2022 13:37:19 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None In-Reply-To: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> Message-ID: <1646314639.6.0.40287333943.issue46389@roundup.psfhosted.org> Ned Batchelder added the comment: Yes, this is fixed, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:54:44 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 03 Mar 2022 13:54:44 +0000 Subject: [issue46874] [sqlite3] optimise user-defined functions In-Reply-To: <1645969210.54.0.240452719118.issue46874@roundup.psfhosted.org> Message-ID: <1646315684.24.0.519868920703.issue46874@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 88567a997005c9388137cd18c5d7f4483423dac3 by Erlend Egeberg Aasland in branch 'main': bpo-46874: Speed up sqlite3 user-defined aggregate 'step' method (GH-31604) https://github.com/python/cpython/commit/88567a997005c9388137cd18c5d7f4483423dac3 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 08:56:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Mar 2022 13:56:27 +0000 Subject: [issue46874] [sqlite3] optimise user-defined functions In-Reply-To: <1645969210.54.0.240452719118.issue46874@roundup.psfhosted.org> Message-ID: <1646315787.95.0.701883363444.issue46874@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:10:01 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 14:10:01 +0000 Subject: [issue46845] dict: Use smaller entry for Unicode-key only dict. In-Reply-To: <1645688455.61.0.00785191075466.issue46845@roundup.psfhosted.org> Message-ID: <1646316601.05.0.808721502584.issue46845@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +29777 pull_request: https://github.com/python/cpython/pull/31659 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:12:07 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 14:12:07 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None In-Reply-To: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> Message-ID: <1646316727.71.0.105432564819.issue46389@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:17:34 2022 From: report at bugs.python.org (Ajaya Sutar) Date: Thu, 03 Mar 2022 14:17:34 +0000 Subject: [issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2 In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org> Message-ID: <1646317054.8.0.419952280928.issue46061@roundup.psfhosted.org> Ajaya Sutar added the comment: I was running one python script. At the time of python exit while calling Py_XDECREF(weakRefObject), it is calling giving exception in python 3.10.2. While debugging found In python 3.8.12, it is working fine with _PyRuntime. void PyObject_GC_Del(void *op) { PyGC_Head *g = AS_GC(op); if (_PyObject_GC_IS_TRACKED(op)) { gc_list_remove(g); } struct _gc_runtime_state *state = &_PyRuntime.gc; if (state->generations[0].count > 0) { state->generations[0].count--; } PyObject_FREE(g); } But in Python 3.10.2 it is not working with get_gc_state() giving exception. It seems it is memory issues. void PyObject_GC_Del(void *op) { PyGC_Head *g = AS_GC(op); if (_PyObject_GC_IS_TRACKED(op)) { gc_list_remove(g); } GCState *gcstate = get_gc_state(); if (gcstate->generations[0].count > 0) { gcstate->generations[0].count--; } PyObject_Free(g); } Could you please check this issue. Is there any fix or any workaround for it. Because so many python script are failing at the exit of python interpreter. Thanks in advance ---------- status: pending -> open title: Journal execution gives fatal error in Python 3.10.1 -> GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:23:43 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 03 Mar 2022 14:23:43 +0000 Subject: [issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2 In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org> Message-ID: <1646317423.08.0.430616364133.issue46061@roundup.psfhosted.org> Eric V. Smith added the comment: > I was running one python script Again: you need to show us the script that's causing this problem. I (and millions of others) run scripts all the time which do not fail in the way you describe. Unless you show us a script that causes the problem, we cannot help you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:23:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 03 Mar 2022 14:23:55 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646317435.4.0.871182835257.issue6634@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 10117f1d8cb49ce95493555c06050faf636ccee7 by vidhya in branch 'main': bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639) https://github.com/python/cpython/commit/10117f1d8cb49ce95493555c06050faf636ccee7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:24:05 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 14:24:05 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646317445.47.0.728527025007.issue6634@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29779 pull_request: https://github.com/python/cpython/pull/31661 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:23:59 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 14:23:59 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646317439.23.0.404981858576.issue6634@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +29778 pull_request: https://github.com/python/cpython/pull/31660 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:48:34 2022 From: report at bugs.python.org (Alexei Komarov) Date: Thu, 03 Mar 2022 14:48:34 +0000 Subject: [issue46912] Full gc collection blocked from collecting after some amount of objects in oldest gen Message-ID: <1646318914.17.0.951983551273.issue46912@roundup.psfhosted.org> New submission from Alexei Komarov : Hi! Maybe it is just my misunderstanding of the mechanism, so please excuse me if it is so. Looking at the GC module code, I think that once there are X objects in the oldest gen, a full collection blocked due to the condition https://github.com/python/cpython/blob/3.10/Modules/gcmodule.c#L1465-L1467 being always True. So, if youngest gen is collected each 700 objects, the middle gen will have maximum 7000 objects. Full collection will be triggered each ~70K objects. X/4 = 70000 ===> X=280000. If oldest gen has >280K objects in it, the condition for full collection (long_lived_pending < gcstate->long_lived_total / 4) is always true since to my understanding, long_lived_pending is 70K at most, and got zeroed each full collection (https://github.com/python/cpython/blob/3.10/Modules/gcmodule.c#L1253). ---------- components: Extension Modules messages: 414444 nosy: al3x3i.k priority: normal severity: normal status: open title: Full gc collection blocked from collecting after some amount of objects in oldest gen type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 09:49:44 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 14:49:44 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646318984.8.0.810489257562.issue6634@roundup.psfhosted.org> miss-islington added the comment: New changeset 9d9dc59d07d51d73e5af7dd506d0da63aa336995 by Miss Islington (bot) in branch '3.10': bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639) https://github.com/python/cpython/commit/9d9dc59d07d51d73e5af7dd506d0da63aa336995 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:15:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 15:15:22 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1646320522.06.0.249250438366.issue44800@roundup.psfhosted.org> STINNER Victor added the comment: Oh. I didn't know this issue. I recently made changes around PyFrameObject: * Move PyFrameObject to the internal C API (see bpo-46836 for the rationale) * Rename CFrame to _PyCFrame * Rename InterpreterFrame to _PyInterpreterFrame I prepared PRs for Cython, greenlet and gevent to use the internal C API pycore_frame.h to get the PyFrameObject structure: https://bugs.python.org/issue46836#msg414283 For the short term, these projects should use the internal C API. But I sent a call to add getter and setter functions: https://mail.python.org/archives/list/capi-sig at python.org/thread/RCT4SB5LY5UPRRRALEOHWEQHIXFNTHYF/ If possible, it would be great to have a public C API so these projects don't use the internal C API at all, that's being discussed at: * https://github.com/faster-cpython/ideas/issues/309 * https://bugs.python.org/issue40421 In terms of backward compatibility, since PyFrameObject is now part of the internal C API, we can break things. In practice... it's better to not break 3rd party code too often. See for example Brandt Bucher who is directly impacted by these changes: https://bugs.python.org/issue46836#msg414279 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:16:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 03 Mar 2022 15:16:34 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646320594.82.0.0978417919335.issue6634@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 09819863a3fb7092ca5cbdfcb722882ebbac806b by Miss Islington (bot) in branch '3.9': bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639) (GH-31661) https://github.com/python/cpython/commit/09819863a3fb7092ca5cbdfcb722882ebbac806b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:17:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 03 Mar 2022 15:17:31 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1646320651.06.0.401197060619.issue6634@roundup.psfhosted.org> Irit Katriel added the comment: Thank you @vidhya. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:18:42 2022 From: report at bugs.python.org (Vidhya) Date: Thu, 03 Mar 2022 15:18:42 +0000 Subject: [issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1646320651.06.0.401197060619.issue6634@roundup.psfhosted.org> Message-ID: Vidhya added the comment: Thanks Irit for your help. On Thu., Mar. 3, 2022, 10:17 a.m. Irit Katriel, wrote: > > Irit Katriel added the comment: > > Thank you @vidhya. > > ---------- > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:19:25 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Mar 2022 15:19:25 +0000 Subject: [issue46908] Debugger jumps to a wrong instruction in for loop In-Reply-To: <1646302854.95.0.25406380974.issue46908@roundup.psfhosted.org> Message-ID: <1646320765.42.0.670139560893.issue46908@roundup.psfhosted.org> Mark Shannon added the comment: Which debugger? Which version of Python? Please provide all the steps required to reproduce, otherwise there is little we can do. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:27:54 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Mar 2022 15:27:54 +0000 Subject: [issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop In-Reply-To: <1646306528.93.0.506258424716.issue46910@roundup.psfhosted.org> Message-ID: <1646321274.9.0.361584154759.issue46910@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately, we cannot do much here. The reason is that the parser allows break and continue outside loops as they count as statements. As these are associated with control flow, is the compiler the one that will show the Syntax warning once it tries to make sense of the abstract syntax tree that the parser generates. The error you are getting happens because for the parser, the unindented else *is* a syntax error so it fails much sooner and prevents the compiler to complain about the break. This means that in the presence of two syntax errors, one being a parser error and the other a compiler error, the parser will always be first, no matter if the other one appears before in the code. Given this, I am afraid we need to close this issue as "won't fix" :( Bing said that, if someone devises some easy way to do this without major changes everywhere, I am happy to reopen it ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:49:28 2022 From: report at bugs.python.org (Ajaya Sutar) Date: Thu, 03 Mar 2022 15:49:28 +0000 Subject: [issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2 In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org> Message-ID: <1646322568.88.0.940532662722.issue46061@roundup.psfhosted.org> Ajaya Sutar added the comment: Actually we can not share code due to certain term and conditions. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 10:52:29 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 03 Mar 2022 15:52:29 +0000 Subject: [issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2 In-Reply-To: <1639387341.54.0.200759283155.issue46061@roundup.psfhosted.org> Message-ID: <1646322749.7.0.210820247003.issue46061@roundup.psfhosted.org> Eric V. Smith added the comment: I understand. Then I'm going to close this issue, since there's nothing we can do. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:02:43 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 03 Mar 2022 16:02:43 +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: <1646323363.32.0.756159664459.issue43312@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- nosy: +hroncok nosy_count: 8.0 -> 9.0 pull_requests: +29780 pull_request: https://github.com/python/cpython/pull/31034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:06:17 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 03 Mar 2022 16:06:17 +0000 Subject: [issue1666807] Incorrect file path reported by inspect.getabsfile() Message-ID: <1646323577.9.0.387173252349.issue1666807@roundup.psfhosted.org> Guido van Rossum added the comment: So this bug is referenced when pydevd encounters some problem with 3.11a5+: https://github.com/fabioz/PyDev.Debugger/issues/213 Since the link to this bug is apparently baked into the error messages printed by pydevd, I am adding this comment to this old, closed bug. I can't seem to reproduce it. I modernized the reproducer script: ### import inspect,sys print('Version info:',sys.version_info) print() f1 = inspect.getabsfile(inspect) f2 = inspect.getabsfile(inspect.iscode) print('File for `inspect` :',f1) print('File for `inspect.iscode`:',f2) print('Do these match?',f1==f2) if f1==f2: print('OK') else: print('BUG - this is a bug in this version of Python') ###EOF And the output is: Version info: sys.version_info(major=3, minor=11, micro=0, releaselevel='alpha', serial=5) File for `inspect` : c:\users\gvanrossum\appdata\local\programs\python\python311\lib\inspect.py File for `inspect.iscode`: c:\users\gvanrossum\appdata\local\programs\python\python311\lib\inspect.py Do these match? True OK I tried it with the most recent Python built from source and get the same result: Version info: sys.version_info(major=3, minor=11, micro=0, releaselevel='alpha', serial=5) File for `inspect` : c:\users\gvanrossum\cpython\lib\inspect.py File for `inspect.iscode`: c:\users\gvanrossum\cpython\lib\inspect.py Do these match? True OK So I wonder if the problem that's currently plagueing pydevd in 3.11 alpha releases is slightly different? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:19:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 16:19:36 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing Message-ID: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> New submission from STINNER Victor : I recently changed how tests are skipped in ASAN, MSAN and UBSAN CIs (buildbot workers and GitHub Action jobs): * bpo-46633 * https://github.com/python/buildmaster-config/commit/0fd1e3e49e4b688d5767501484cccea5fa35d3fc 3 tests are now failing on "AMD64 Arch Linux Usan 3.x": * test_ctypes * test_faulthandler * test_hashlib First failed build: https://buildbot.python.org/all/#/builders/719/builds/632 ---------- components: Tests messages: 414455 nosy: pablogsal, vstinner priority: normal severity: normal status: open title: UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:20:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 16:20:36 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646324436.55.0.146677749703.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: test_ctypes: test_shorts() of ctypes.test.test_bitfields.C_Test is failing with: --- test_shorts (ctypes.test.test_bitfields.C_Test) ... /home/vstinner/python/main/Modules/_ctypes/cfield.c:554:5: runtime error: shift exponent 18446744073709551614 is too large for 16-bit type 'short' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/vstinner/python/main/Modules/_ctypes/cfield.c:554:5 in --- It's a test on the "h" format code: ---- #define LOW_BIT(x) ((x) & 0xFFFF) #define NUM_BITS(x) ((x) >> 16) #define GET_BITFIELD(v, size) \ if (NUM_BITS(size)) { \ v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \ v >>= (sizeof(v)*8 - NUM_BITS(size)); \ static PyObject * h_get(void *ptr, Py_ssize_t size) { short val; memcpy(&val, ptr, sizeof(val)); GET_BITFIELD(val, size); // <==== HERE return PyLong_FromLong((long)val); } static struct fielddesc formattable[] = { ... { 'h', h_set, h_get, NULL, h_set_sw, h_get_sw}, ... }; ---- ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:21:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 16:21:12 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646324472.12.0.847210988211.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: test_hashlib: test_gil() fails with: --- test_gil (test.test_hashlib.HashLibTestCase) ... /home/vstinner/python/main/Modules/_sha3/kcp/KeccakP-1600-opt64.c:467:9: runtime error: load of misaligned address 0x000002daafd7 for type 'UINT64' (aka 'unsigned long'), which requires 8 byte alignment 0x000002daafd7: note: pointer points here 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/vstinner/python/main/Modules/_sha3/kcp/KeccakP-1600-opt64.c:467:9 in --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:22:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 16:22:11 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646324531.19.0.0763947539114.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: test_faulthandler: test_sigfpe() fails with: ====================================================================== FAIL: test_sigfpe (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_faulthandler.py", line 228, in test_sigfpe self.check_fatal_error(""" ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/test_faulthandler.py", line 129, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/test_faulthandler.py", line 122, in check_error self.assertRegex(output, regex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Regex didn't match: '(?m)^Fatal Python error: Floating point exception\n\nCurrent thread 0x[0-9a-f]+ \\(most recent call first\\):\n File "", line 3 in ' not found in 'Modules/faulthandler.c:1112:11: runtime error: division by zero\nSUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/faulthandler.c:1112:11 in ' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 11:59:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 16:59:31 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646326771.88.0.816151735388.issue46913@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29781 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31662 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:41:57 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 03 Mar 2022 18:41:57 +0000 Subject: [issue46877] [doc] unittest.doModuleCleanups() does not exist In-Reply-To: <1646030503.89.0.975314565573.issue46877@roundup.psfhosted.org> Message-ID: <1646332917.41.0.383683844931.issue46877@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset cc400585fab02994255f21ae8183d5f147236815 by Kumar Aditya in branch 'main': bpo-46877: export unittest.doModuleCleanups in unittest package (#31613) https://github.com/python/cpython/commit/cc400585fab02994255f21ae8183d5f147236815 ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:43:29 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 03 Mar 2022 18:43:29 +0000 Subject: [issue46877] [doc] unittest.doModuleCleanups() does not exist In-Reply-To: <1646030503.89.0.975314565573.issue46877@roundup.psfhosted.org> Message-ID: <1646333009.18.0.728595286418.issue46877@roundup.psfhosted.org> Change by Guido van Rossum : ---------- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:55:52 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 18:55:52 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646333752.14.0.86097026765.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29782 pull_request: https://github.com/python/cpython/pull/31663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 13:57:56 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 18:57:56 +0000 Subject: [issue46908] Debugger jumps to a wrong instruction in for loop In-Reply-To: <1646302854.95.0.25406380974.issue46908@roundup.psfhosted.org> Message-ID: <1646333876.43.0.54578317987.issue46908@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 14:03:33 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 03 Mar 2022 19:03:33 +0000 Subject: [issue46908] Debugger jumps to a wrong instruction in for loop In-Reply-To: <1646302854.95.0.25406380974.issue46908@roundup.psfhosted.org> Message-ID: <1646334213.61.0.770758098262.issue46908@roundup.psfhosted.org> Vedran ?a?i? added the comment: pdb on Py3.10.2 works fine with that code. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 14:29:25 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 19:29:25 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646335765.09.0.498202369934.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 127797f572cc7374192e415c44ea2e95b009d5ab by Brandt Bucher in branch 'main': bpo-46841: Improve the failure stats for COMPARE_OP (GH-31663) https://github.com/python/cpython/commit/127797f572cc7374192e415c44ea2e95b009d5ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 14:45:45 2022 From: report at bugs.python.org (Carl Meyer) Date: Thu, 03 Mar 2022 19:45:45 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646336745.03.0.367087591733.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: Thanks gps! Working on a PR and will collect pyperformance data as well. We haven't observed any issues in Cinder with the callback just being called at shutdown, too, but if there are problems with that it should be possible to just have CPython clear the callback at shutdown time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:07:12 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:07:12 +0000 Subject: [issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode In-Reply-To: <1645506714.72.0.112858305238.issue46823@roundup.psfhosted.org> Message-ID: <1646338032.23.0.554181382126.issue46823@roundup.psfhosted.org> Brandt Bucher added the comment: Reopening since this needed to be removed for https://github.com/python/cpython/pull/31640. ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:07:57 2022 From: report at bugs.python.org (Philip Bloom) Date: Thu, 03 Mar 2022 20:07:57 +0000 Subject: [issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work Message-ID: <1646338077.17.0.950796200691.issue46914@roundup.psfhosted.org> New submission from Philip Bloom : Hello, don't file these often so apologies for any mistakes, trying to be good python citizen here. Checked this on the python-list first, and others reported it as reproducible. The issue is: On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work. It won't throw any error but the ASL/Console.App does not see any messages from it. On OSX Big Sur (11.x) this works just fine with the exact same code. I think I've cut this into a small example proof that can be run to demonstrate the issue. If this is run and any of the substrings are searched for in Console.App when it is checking events, only the QQQ message from SysLog will show up. Gonna work around it likely on our end, but hope this helps it get fixed for a future version. --- import logging from logging.handlers import SysLogHandler root_logger = logging.getLogger() root_logger.setLevel(logging.DEBUG) basic_datefmt = '%m/%d/%Y %I:%M:%S %p' syslog_format = logging.Formatter(fmt='SetupCDNGUI: %(message)s', datefmt=basic_datefmt) sys_handler = SysLogHandler(address='/var/run/syslog') #sys_handler.encodePriority(SysLogHandler.LOG_USER, SysLogHandler.LOG_ALERT) # Tried with the above, but didn't make a difference. Neither did not defining the address and letting it go to local host. sys_handler.setFormatter(syslog_format) root_logger.addHandler(sys_handler) # None of these will show up. logging.critical("CCC This is a test critical") logging.error("EEE This is a test error") logging.info("III Still a test") # Comparatively this sends a message received just fine import syslog syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER) syslog.syslog(syslog.LOG_NOTICE, 'QQQ test log') ---------- components: macOS messages: 414464 nosy: ned.deily, pbloom, ronaldoussoren priority: normal severity: normal status: open title: On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:09:25 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 03 Mar 2022 20:09:25 +0000 Subject: [issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work In-Reply-To: <1646338077.17.0.950796200691.issue46914@roundup.psfhosted.org> Message-ID: <1646338165.66.0.379837089407.issue46914@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:10:16 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:10:16 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646338216.6.0.491546399896.issue46896@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:13:56 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Mar 2022 20:13:56 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646338436.37.0.983788070854.issue46896@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:14:46 2022 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 03 Mar 2022 20:14:46 +0000 Subject: [issue46756] Incorrect authorization check in urllib.request In-Reply-To: <1644918487.72.0.244898503691.issue46756@roundup.psfhosted.org> Message-ID: <1646338486.41.0.894493127949.issue46756@roundup.psfhosted.org> Senthil Kumaran added the comment: Pablo, we are good. The PRs were merged in open branches a while ago, and this was tracking security releases backports. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:15:00 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:15:00 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646338500.37.0.546832709309.issue46896@roundup.psfhosted.org> Brandt Bucher added the comment: > CPython will track only one global callback; it is a well-behaved client?s responsibility to check if a callback is already set when setting a new one, and daisy-chain to the previous callback if so. Hm, this is a bit scary. Could we (or others) end up with unguarded stale caches if some buggy extension forgets to chain the calls correctly? Core CPython seems most at risk of this, since we would most likely be registered first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:17:12 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:17:12 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646338632.15.0.806088261784.issue46896@roundup.psfhosted.org> Brandt Bucher added the comment: Also, when you say "only one global callback": does that mean per-interpreter, or per-process? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:20:16 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:20:16 +0000 Subject: [issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1646338816.23.0.261581330065.issue40421@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:20:47 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:20:47 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1646338847.54.0.111434186005.issue44800@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:31:55 2022 From: report at bugs.python.org (Carl Meyer) Date: Thu, 03 Mar 2022 20:31:55 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646339515.72.0.710710981558.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: > Could we (or others) end up with unguarded stale caches if some buggy extension forgets to chain the calls correctly? Yes. I can really go either way on this. I initially opted for simplicity in the core support at the cost of asking a bit more of clients, on the theory that a) there are lots of ways for a buggy C extension to cause crashes with bad use of the C API, and b) I don't expect there to be very many extensions using this API. But it's also true that the consequences of a mistake here could be hard to debug (and easily blamed to the wrong place), and there might turn out to be more clients for dict-watching than I expect! If the consensus is to prefer CPython tracking an array of callbacks instead, we can try that. > when you say "only one global callback": does that mean per-interpreter, or per-process? Good question! The currently proposed API suggests per-process, but it's not a question I've given a lot of thought to yet; open to suggestions. It seems like in general the preference is to avoid global state and instead tie things to an interpreter instance? I'll need to do a bit of research to understand exactly how that would affect the implementation. Doesn't seem like it should be a problem, though it might make the lookup at write time to see if we have a callback a bit slower. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:42:26 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 20:42:26 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646340146.69.0.676750790042.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29783 pull_request: https://github.com/python/cpython/pull/31664 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:43:53 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 03 Mar 2022 20:43:53 +0000 Subject: [issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work In-Reply-To: <1646338077.17.0.950796200691.issue46914@roundup.psfhosted.org> Message-ID: <1646340233.64.0.531616545545.issue46914@roundup.psfhosted.org> Ronald Oussoren added the comment: This is probably not a bug in python, but a change in system behaviour. In particular, I've used the lsof command to check the open files for the syslogd proces on a macOS 10.13 and 12.2 system. On the former syslogd has /var/run/syslog open, on the latter it doesn't. The feature to listen on this socket has been removed entirely, the 12.2 system no longer lists a "-bsd_in" option for syslogd in the manual page whereas it is both available and enabled by default on 10.13. It might be possible to change the SyslogHandler to optionally use the syslog module to log, but I'm not sure it is worth doing this and that would definitely be a new feature. ---------- resolution: -> third party type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:44:21 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Mar 2022 20:44:21 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646340261.97.0.668581079838.issue46896@roundup.psfhosted.org> Gregory P. Smith added the comment: Per interpreter seems best. If someone using this feature writes a buggy implementation of a callback that doesn't chain reliably, that is a bug in their code and all of the fallout from that is "just" a bug to be fixed in said code. Think of it like a C signal handler, the OS doesn't chain for you - it is the signal handler installer's responsibility to chain to the previous one. Not an unusual pattern for callback hooks in C. We already have such global C callback hooks in SetProfile and SetTrace. https://docs.python.org/3/c-api/init.html#profiling-and-tracing Those don't even provide for chaining. We could do the same here and not let a hook be set more than once instead of providing a Get API to allow for manual chaining. That seems less useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:45:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 20:45:08 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646340308.03.0.160119316316.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4173d677a1d7c72bb32d292fbff1b4cf073d615c by Victor Stinner in branch 'main': bpo-46913: Fix test_faulthandler.test_sigfpe() on UBSAN (GH-31662) https://github.com/python/cpython/commit/4173d677a1d7c72bb32d292fbff1b4cf073d615c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:45:13 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 20:45:13 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646340313.7.0.0207596862547.issue46913@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +29784 pull_request: https://github.com/python/cpython/pull/31665 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:45:20 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Mar 2022 20:45:20 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646340320.41.0.511673885555.issue46913@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29785 pull_request: https://github.com/python/cpython/pull/31666 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 15:58:30 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 03 Mar 2022 20:58:30 +0000 Subject: [issue46894] make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR In-Reply-To: <1646172960.85.0.550744633196.issue46894@roundup.psfhosted.org> Message-ID: <1646341110.13.0.00352376581371.issue46894@roundup.psfhosted.org> Ned Deily added the comment: My apologies: I'm not sure where I got the idea you were building on macOS! In any case, this problem has come up a few times in the past, no doubt for a similar reason, most recently in open issue Issue31114. I'm closing this issue as a duplicate of that. But be aware that Distutils is now deprecated in general and in the upcoming 3.11 feature release, there are major changes to getpath and also to begin the process of eliminating the use of Distutils when building Python itself, so it is unlikely that any bug fixes for this minor wart will be forthcoming for current releases. But a very simple workaround should be to use --prefix=/usr/local or some other path within your chroot environment rather than trying to install in / of the chroot. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:15:25 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 03 Mar 2022 21:15:25 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= Message-ID: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> New submission from Christian Heimes : Extension modules with bare "#define Py_LIMITED_API" without version fail to build with error: moduleobject.h:82:3: error: unknown type name ?PyModuleDef_Slot? The issue was introduced in PR GH-31528 and bpo-45459. The type PyModuleDef_Slot is only defined when Py_LIMITED_API is set to Python 3.5.0 or higher. ---------- assignee: christian.heimes components: Build, Interpreter Core keywords: 3.11regression messages: 414473 nosy: christian.heimes, pablogsal, vstinner priority: release blocker severity: normal status: open title: Build with Py_LIMITED_API fails unknown type name ?PyModuleDef_Slot? type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:15:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 03 Mar 2022 21:15:50 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1646342150.3.0.851686257187.issue46915@roundup.psfhosted.org> Christian Heimes added the comment: The problem was first reported to PyCA cryptography project in bug https://github.com/pyca/cryptography/issues/6929 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:19:35 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 03 Mar 2022 21:19:35 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1646342375.51.0.795418966946.issue46915@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +29786 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:25:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 21:25:12 +0000 Subject: [issue45459] Limited API support for Py_buffer In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org> Message-ID: <1646342712.27.0.6421754295.issue45459@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29787 pull_request: https://github.com/python/cpython/pull/31668 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:28:36 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 03 Mar 2022 21:28:36 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1646342916.44.0.50383158247.issue46915@roundup.psfhosted.org> Christian Heimes added the comment: With fix: $ /tmp/python311/bin/pip3 install --no-binary :all: cryptography Collecting cryptography Using cached cryptography-36.0.1.tar.gz (572 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: cffi>=1.12 in /tmp/python311/lib/python3.11/site-packages (from cryptography) (1.15.0) Requirement already satisfied: pycparser in /tmp/python311/lib/python3.11/site-packages (from cffi>=1.12->cryptography) (2.21) Building wheels for collected packages: cryptography Building wheel for cryptography (PEP 517) ... done Created wheel for cryptography: filename=cryptography-36.0.1-cp311-cp311-linux_x86_64.whl size=2628351 sha256=fb3cc21f8eaa546cd2c0123ea01a98bf92a9824fcdca36cfcf765b2c044bd186 Stored in directory: /home/heimes/.cache/pip/wheels/6c/77/a9/3c4762d4e65bef5f742a304c507f9723ca3563a38d108618ad Successfully built cryptography Installing collected packages: cryptography Successfully installed cryptography-36.0.1 Without fix: gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/python311/include/python3.11 -c build/temp.linux-x86_64-3.11/_openssl.c -o build/temp.linux-x86_64-3.11/build/temp.linux-x86_64-3.11/_openssl.o -Wconversion -Wno-error=sign-conversion In file included from /tmp/python311/include/python3.11/Python.h:66, from build/temp.linux-x86_64-3.11/_openssl.c:57: /tmp/python311/include/python3.11/moduleobject.h:82:3: error: unknown type name ?PyModuleDef_Slot? 82 | PyModuleDef_Slot *m_slots; | ^~~~~~~~~~~~~~~~ ---------- keywords: -patch stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:29:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 21:29:52 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1646342992.48.0.627020889857.issue46915@roundup.psfhosted.org> STINNER Victor added the comment: I proposed a fix: https://github.com/python/cpython/pull/31668 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 16:31:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 21:31:16 +0000 Subject: [issue45459] Limited API support for Py_buffer In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org> Message-ID: <1646343076.46.0.468214260184.issue45459@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29788 pull_request: https://github.com/python/cpython/pull/31669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:05:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:05:14 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646345114.44.0.95467384446.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: Reproducer of test_ctypes undefined behavior: --- from ctypes import * class BITS(Structure): _fields_ = [("A", c_int, 1), ("B", c_int, 2), ("C", c_int, 3), ("D", c_int, 4), ("E", c_int, 5), ("F", c_int, 6), ("G", c_int, 7), ("H", c_int, 8), ("I", c_int, 9), ("M", c_short, 1), ("N", c_short, 2), ("O", c_short, 3), ("P", c_short, 4), ("Q", c_short, 5), ("R", c_short, 6), ("S", c_short, 7)] b = BITS() a = getattr(b, "M") --- > GET_BITFIELD(val, size); // <==== HERE I expanded the macro: --- if (NUM_BITS(size)) { size_t s = sizeof(val)*8; Py_ssize_t low = LOW_BIT(size); Py_ssize_t nbits = NUM_BITS(size); // val=0, size=65553 = (1 << 16) + 17 // s=16, low=17, nbits=1 // s - low - nbits = (size_t)-2 val <<= (s - low - nbits); val >>= (s - nbits); } --- The problem is that (s - low - nbits) is negative (-2), but becomes a very large number since it's unsigned (s is unsigned: "sizeof(v)*8" in the macro). C code: --- #include int main() { short s = 0x7fff; size_t z = (size_t)-2; s <<= z; printf("s = %hi\n", s); return 0; } --- GCC and clang disagree :-D --- $ gcc x.c -o x -O3 -Wall -Wextra -Wconversion && ./x s = 0 $ clang x.c -o x -O3 -Wall -Wextra -Wconversion && ./x s = -5784 --- Moreover, runtime the binary built by clang produces a different result at each run... --- $ ./x s = -4824 $ ./x s = 4120 $ ./x s = -22344 $ ./x s = -26744 $ ./x s = -18184 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:07:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:07:05 +0000 Subject: [issue45459] Limited API support for Py_buffer In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org> Message-ID: <1646345225.85.0.99382318853.issue45459@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0b63215bb152c06404cecbd5303b1a50969a9f9f by Victor Stinner in branch 'main': bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668) https://github.com/python/cpython/commit/0b63215bb152c06404cecbd5303b1a50969a9f9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:07:29 2022 From: report at bugs.python.org (William Woodruff) Date: Thu, 03 Mar 2022 22:07:29 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1646345249.67.0.766408592436.issue14156@roundup.psfhosted.org> William Woodruff added the comment: Nosying myself; this affects 3.9 and 3.10 as well. ---------- nosy: +yossarian versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:07:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:07:46 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1646345266.06.0.967400096886.issue46915@roundup.psfhosted.org> STINNER Victor added the comment: Fixed by https://github.com/python/cpython/commit/0b63215bb152c06404cecbd5303b1a50969a9f9f ---------- priority: release blocker -> resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:08:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:08:16 +0000 Subject: [issue45459] Limited API support for Py_buffer In-Reply-To: <1634118913.79.0.141868262007.issue45459@roundup.psfhosted.org> Message-ID: <1646345296.42.0.500076436181.issue45459@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 32f0c8271706550096c454eb512450b85fbfc320 by Victor Stinner in branch 'main': bpo-45459: Use type names in the internal C API (GH-31669) https://github.com/python/cpython/commit/32f0c8271706550096c454eb512450b85fbfc320 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:13:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:13:39 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1646345619.82.0.122681788808.issue46355@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29789 pull_request: https://github.com/python/cpython/pull/31670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:14:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:14:23 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1646345663.72.0.665529197889.issue45711@roundup.psfhosted.org> STINNER Victor added the comment: lxml does crash on the current Cython 0.29.x development branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:17:38 2022 From: report at bugs.python.org (Vincent FUNG) Date: Thu, 03 Mar 2022 22:17:38 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() Message-ID: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> New submission from Vincent FUNG : This problem occurs when the directory starts with 't', but works with os.makedirs(e) or macOS. >>> e = Path(r'F:\ceven\test2') >>> e.mkdir() Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python310\lib\pathlib.py", line 1173, in mkdir self._accessor.mkdir(self, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'F:\\ceven\\test2' >>> os.makedirs(e) ---------- components: Windows messages: 414483 nosy: paul.moore, steve.dower, tim.golden, vincent.fung, zach.ware priority: normal severity: normal status: open title: There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:33:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 03 Mar 2022 22:33:53 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646346833.73.0.674091645404.issue25415@roundup.psfhosted.org> Irit Katriel added the comment: > I think that the fix should be to delete the original incorrect statement and not replace it with another incorrect statement. I agree with this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:36:37 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 22:36:37 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646346997.81.0.508730866012.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29791 pull_request: https://github.com/python/cpython/pull/31671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:39:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:39:43 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 Message-ID: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> New submission from STINNER Victor : See "[Python-Dev] Should we require IEEE 754 floating-point for CPython?" thread: https://mail.python.org/archives/list/python-dev at python.org/thread/J5FSP6J4EITPY5C2UJI7HSL2GQCTCUWN/ I propose to require IEEE 754 floating-point to build Python 3.11. I propose the following build: * Mention the new build requirement in What's New in Python 3.11. * Modify configure script to make it fail if the IEEE 754 support is missing. * Remove code handling missing NAN and infinity: float("nan"), float("inf"), math.nan and math.inf are always available. * Remove @requires_IEEE_754 decorator of test.support and tests. * Remove "unknown_format" code path of pack/unpack functions like _PyFloat_Pack8() (see bpo-46906 which proposes to make these functions public). The _PY_SHORT_FLOAT_REPR==0 code path is kept. For now, platforms with float larger than 64-bit but without HAVE_PY_SET_53BIT_PRECISION are still supported (but don't get "short float repr"). See GH-31592 for details. I prepared this requirement with these two changes: commit 1b2611eb0283055835e5df632a7a735db8c894b8 Author: Victor Stinner Date: Fri Feb 25 01:32:57 2022 +0100 bpo-46656: Remove Py_NO_NAN macro (GH-31160) Building Python now requires support for floating point Not-a-Number (NaN): remove the Py_NO_NAN macro. commit 5ab745fc51e159ead28b523414e52f0bcc1ef353 Author: Victor Stinner Date: Sat Feb 26 00:53:27 2022 +0100 bpo-46852: Remove the float.__set_format__() method (GH-31585) Remove the undocumented private float.__set_format__() method, previously known as float.__set_format__() in Python 3.7. Its docstring said: "You probably don't want to use this function. It exists mainly to be used in Python's test suite." By the way, building Python 3.11 now requires a C11 compiler. ---------- components: Build messages: 414485 nosy: vstinner priority: normal severity: normal status: open title: Require IEEE 754 floating point to build Python 3.11 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:40:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:40:19 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646347219.93.0.923532399528.issue46917@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:45:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:45:33 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646347533.64.0.722356308283.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: > https://github.com/python/buildmaster-config/commit/0fd1e3e49e4b688d5767501484cccea5fa35d3fc Previously, 4 tests were skipped on the UBSAN buildbot * test_faulthandler * test_hashlib * test_concurrent_futures * test_ctypes It's not a regression, it's just that I made the buildbot stricter. I'm planning to attempt to fix the 3 failing tests, or at least skip them in Python, rather than skipping them in the buildbot configuration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:56:03 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 22:56:03 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646348163.37.0.208930990212.issue46913@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29792 pull_request: https://github.com/python/cpython/pull/31672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 17:58:43 2022 From: report at bugs.python.org (Vincent FUNG) Date: Thu, 03 Mar 2022 22:58:43 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() In-Reply-To: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> Message-ID: <1646348323.79.0.985992964457.issue46916@roundup.psfhosted.org> Vincent FUNG added the comment: This problem occurs when the directory starts with 't', but works with os.makedirs(e) or macOS. >>> e = Path(r'F:\ceven\test2') >>> e.mkdir() Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python310\lib\pathlib.py", line 1173, in mkdir self._accessor.mkdir(self, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'F:\\ceven\\test2' >>> os.makedirs(e) Another question about \t: If a directory is passed as a parameter it will not be possible to use the parameter as a raw string. os.makedirs gives the same error whether it's r'%s' or repr(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:10:32 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 03 Mar 2022 23:10:32 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1646349032.53.0.600336232763.issue46915@roundup.psfhosted.org> Christian Heimes added the comment: Please add a blurb entry. ---------- assignee: christian.heimes -> vstinner priority: -> normal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:16:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:16:00 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646349360.58.0.57715537101.issue46913@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29793 pull_request: https://github.com/python/cpython/pull/31673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:20:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:20:39 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646349639.75.0.836485056843.issue46913@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29794 pull_request: https://github.com/python/cpython/pull/31674 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:25:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:25:36 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646349936.41.0.665687095979.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 65b92ccdec2ee4a99e54aaf7ae2d9bbc2ebfe549 by Victor Stinner in branch 'main': bpo-46913: Fix test_faulthandler.test_read_null() on UBSan (GH31672) https://github.com/python/cpython/commit/65b92ccdec2ee4a99e54aaf7ae2d9bbc2ebfe549 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:31:12 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Mar 2022 23:31:12 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646350272.28.0.401339961651.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 05a8bc1c944709e7468f157bd1b6032f368e43bf by Brandt Bucher in branch 'main': bpo-46841: Use inline caching for attribute accesses (GH-31640) https://github.com/python/cpython/commit/05a8bc1c944709e7468f157bd1b6032f368e43bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:36:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:36:53 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646350613.04.0.991691858881.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-46887: ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:38:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:38:23 +0000 Subject: [issue46857] Python leaks one reference at exit on Windows In-Reply-To: <1645808231.81.0.426207041717.issue46857@roundup.psfhosted.org> Message-ID: <1646350703.53.0.824650945326.issue46857@roundup.psfhosted.org> STINNER Victor added the comment: The initial issue "Python leaks one reference at exit on Windows" is now fixed. If someone wants to investigate the remaining leak of 1 memory block or the negative ref count of PYTHONDUMPREFS=1, please open a separated issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:39:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:39:31 +0000 Subject: [issue46852] Remove the float.__set_format__() method In-Reply-To: <1645747677.37.0.919337626983.issue46852@roundup.psfhosted.org> Message-ID: <1646350771.43.0.124928417287.issue46852@roundup.psfhosted.org> STINNER Victor added the comment: I created a follow-up issue: bpo-46917 "Require IEEE 754 floating point to build Python 3.11". I close this one: float.__set_format__() has been removed. ---------- resolution: -> fixed status: open -> closed title: Remove the float.__setformat__() method -> Remove the float.__set_format__() method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:41:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:41:43 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646350903.42.0.545520946911.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6d0d7d2b8c1e04fd51c6cb29cc09a41b60b97b7b by Victor Stinner in branch 'main': bpo-46913: test_hashlib skips _sha3 tests on UBSan (GH-31673) https://github.com/python/cpython/commit/6d0d7d2b8c1e04fd51c6cb29cc09a41b60b97b7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:42:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:42:01 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646350921.01.0.0769516115257.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ad1b04451d3aca2c6fa6dbe2891676a4e0baac49 by Victor Stinner in branch 'main': bpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674) https://github.com/python/cpython/commit/ad1b04451d3aca2c6fa6dbe2891676a4e0baac49 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:47:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:47:00 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1646351220.96.0.525886081411.issue46355@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ec4a580f7cada002441ae5611b909d56e3b5b613 by Victor Stinner in branch 'main': bpo-46355: Update pythoncapi_compat project URL (GH-31670) https://github.com/python/cpython/commit/ec4a580f7cada002441ae5611b909d56e3b5b613 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:47:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:47:00 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646351220.86.0.781674774896.issue46913@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29795 pull_request: https://github.com/python/cpython/pull/31675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 18:54:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Mar 2022 23:54:34 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646351674.42.0.441377215603.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: I pushed changes just to turn back the buildbot back to green, but undefined behaviors in test_ctypes.test_shorts() and _sha3 (tested by test_hashlib) must be fixed. Previously, test_ctypes, test_hashlib and test_faulthandler were fully skipped on UBSan. Now only 1 test_ctypes test and a few test_hashlib tests are skipped on the UBSan buildbot (test_faulthandler now pass on UBSan). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:08:05 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 04 Mar 2022 00:08:05 +0000 Subject: [issue42337] Skip building web installers on Windows In-Reply-To: <1605221761.11.0.317239545027.issue42337@roundup.psfhosted.org> Message-ID: <1646352485.66.0.925969384357.issue42337@roundup.psfhosted.org> Steve Dower added the comment: Forget exactly when I did this, but I did it. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:12:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Mar 2022 00:12:16 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646352736.58.0.918000280431.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7b5b429adab4fe0fe81858fe3831f06adc2e2141 by Victor Stinner in branch '3.10': [3.10] bpo-46913: Fix test_ctypes, test_hashlib, test_faulthandler on UBSan (GH-31675) https://github.com/python/cpython/commit/7b5b429adab4fe0fe81858fe3831f06adc2e2141 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:15:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Mar 2022 00:15:43 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646352943.61.0.23610383072.issue46913@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29796 pull_request: https://github.com/python/cpython/pull/31676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:25:50 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 04 Mar 2022 00:25:50 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1646353550.92.0.0259580111963.issue46744@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +29797 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31677 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:29:42 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 04 Mar 2022 00:29:42 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1646353782.26.0.66031542505.issue46744@roundup.psfhosted.org> Steve Dower added the comment: Posted half a PR for this, which is worth taking in itself, but doesn't completely address the whole change. It will install to the correct ProgramFiles folder on ARM64 now, but still with the suffix. If we are to take the rest of the change (use "-amd64" for AMD64 builds on ARM64 OS), it has to be ready for beta 1. There's still time, but absent a major issue from *not* doing it, we want to avoid changing on-disk layout during beta/RC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:32:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Mar 2022 00:32:04 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646353924.13.0.988576077718.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6a14330318c9c7aedf3e9841c3dfea337064d8e6 by Victor Stinner in branch '3.9': bpo-46913: Fix test_ctypes, test_hashlib, test_faulthandler on UBSan (GH-31675) (GH-31676) https://github.com/python/cpython/commit/6a14330318c9c7aedf3e9841c3dfea337064d8e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 19:51:02 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 04 Mar 2022 00:51:02 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1646355062.84.0.655797313332.issue46744@roundup.psfhosted.org> Steve Dower added the comment: New changeset 8f31bf46980956c735dd18f9914f3e7144e87c77 by Steve Dower in branch 'main': bpo-46744: Move Windows ARM64 installation directory to correct ProgramFiles (GH-31677) https://github.com/python/cpython/commit/8f31bf46980956c735dd18f9914f3e7144e87c77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 21:00:15 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 04 Mar 2022 02:00:15 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() In-Reply-To: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> Message-ID: <1646359215.74.0.271191080097.issue46916@roundup.psfhosted.org> Eryk Sun added the comment: > FileNotFoundError: [WinError 3] The system cannot find > the path specified: 'F:\\ceven\\test2' The Windows error code, ERROR_PATH_NOT_FOUND (3), indicates that the parent path, r"F:\ceven", does not exist. Try e.mkdir(parents=True) [1]. [1] https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 21:30:52 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 04 Mar 2022 02:30:52 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() In-Reply-To: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> Message-ID: <1646361052.68.0.443397087971.issue46916@roundup.psfhosted.org> Eryk Sun added the comment: > e = Path(r'F:\ceven\test2') Using forward slashes in the string literal is preferred, e.g. Path('F:/ceven/test2'). This avoids the problem of backslash escapes in string literals. The Path constructor parses the path and stores it internally as component parts. When the path object is needed as a string, os.fspath() returns the path using the platform's preferred path separator. A WindowsPath or PureWindowsPath uses backslash as the path separator. For example: >>> os.fspath(pathlib.PureWindowsPath('F:/ceven/test2')) 'F:\\ceven\\test2' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 3 22:10:28 2022 From: report at bugs.python.org (Philip Bloom) Date: Fri, 04 Mar 2022 03:10:28 +0000 Subject: [issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work In-Reply-To: <1646338077.17.0.950796200691.issue46914@roundup.psfhosted.org> Message-ID: <1646363428.53.0.333717844355.issue46914@roundup.psfhosted.org> Philip Bloom added the comment: I could certainly understand that. It's a weird apple choice. If so, then it probably good to adjust https://docs.python.org/3/library/logging.handlers.html#sysloghandler since it still talks about it being expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 01:38:19 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 04 Mar 2022 06:38:19 +0000 Subject: [issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work In-Reply-To: <1646338077.17.0.950796200691.issue46914@roundup.psfhosted.org> Message-ID: <1646375899.09.0.594536433038.issue46914@roundup.psfhosted.org> Vinay Sajip added the comment: > If so, then it probably good to adjust ... since it still talks about it being expected. Do you mean just adding a note to the effect that SysLogHandler won't work on macOS 12.2 because of changes to the syslog daemon on that platform? IIRC using the syslog module was not an option at the time SysLogHandler was added, I think because of both thread-safety and lack-of-functionality issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 02:49:44 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 04 Mar 2022 07:49:44 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646380184.84.0.384240979238.issue46913@roundup.psfhosted.org> Christian Heimes added the comment: I don't agree with GH-31673. Did you try defining NO_MISALIGNED_ACCESSES instead? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 03:27:09 2022 From: report at bugs.python.org (=?utf-8?b?SHJ2b2plIE5pa8WhacSH?=) Date: Fri, 04 Mar 2022 08:27:09 +0000 Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode header In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za> Message-ID: <1646382429.95.0.524811453247.issue17505@roundup.psfhosted.org> Hrvoje Nik?i? added the comment: > Any suggestions on what needs to be done for current revisions? Hi! I'm the person who submitted this issue back in 2013. Let's take a look at how things are in Python 3.10: Python 3.10.2 (main, Jan 13 2022, 19:06:22) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email >>> msg = email.message_from_string('Subject: =?gb2312?b?1eLKx9bQzsSy4srUo6E=?=\n\nfoo\n') >>> msg['Subject'] '=?gb2312?b?1eLKx9bQzsSy4srUo6E=?=' So the headers are still not decoded by default. The `unicode()` invocation in the original description was just an attempt to get a Unicode string out of a byte string (assuming it was correctly decoded from MIME, which it wasn't). Since Python 3 strings are Unicode already, I'd expect to just get the decoded subject - but that still doesn't happen. The correct way to make it happen is to specify `policy=email.policy.default`: >>> msg = email.message_from_string('Subject: =?gb2312?b?1eLKx9bQzsSy4srUo6E=?=\n\nfoo\n', policy=email.policy.default) >>> msg['Subject'] '???????' The docs should point out that you really _want_ to specify the "default" policy (strangely named, since it's not in fact the default). The current docs only say that `message_from_string()` is "equivalent to Parser().parsestr(s)." and that `policy` is interpreted "as with the Parser class constructor". The docs of the Parser constructor don't document `policy` at all, except for the version when it was added. So, if you want to work for this, my suggestion would be to improve the docs in the following ways: * in message_from_string() docs, explain that `policy=email.policy.default` is what you want to send to get the headers decoded. * in Parser docs, explain what _class and policy arguments do in the constructor, which policies are possible, etc. (These things seem to be explained in the BytesFeedParser, so you might want to just link to that, or include a shortened version.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 03:42:03 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 04 Mar 2022 08:42:03 +0000 Subject: [issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers In-Reply-To: <1485909545.04.0.650924943503.issue29406@psf.upfronthosting.co.za> Message-ID: <1646383323.28.0.187229428797.issue29406@roundup.psfhosted.org> Kumar Aditya added the comment: Since bpo-issue44011 is fixed, this can be closed now @asvetlov. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 03:58:41 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 04 Mar 2022 08:58:41 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1646384321.78.0.684296021371.issue45413@roundup.psfhosted.org> Petr Viktorin added the comment: Steve, could you take a look at the PR discussion and chime in about how this should be done? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 04:31:55 2022 From: report at bugs.python.org (zjmxq) Date: Fri, 04 Mar 2022 09:31:55 +0000 Subject: [issue46918] The vulnerability is included in /lib/python3.9/ensurepip after python 3.9.2 is installed. Message-ID: <1646386315.18.0.392218219699.issue46918@roundup.psfhosted.org> New submission from zjmxq : Vulnerability CVE-2021-29921,CVE-2020-14422, CVE-2021-3572, CVE-2021-33503 Vulnerability Found in python 3.9.2 /lib/python3.9/ensurepip ---------- components: Library (Lib) messages: 414511 nosy: zjmxq priority: normal severity: normal status: open title: The vulnerability is included in /lib/python3.9/ensurepip after python 3.9.2 is installed. type: security versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 04:34:32 2022 From: report at bugs.python.org (zjmxq) Date: Fri, 04 Mar 2022 09:34:32 +0000 Subject: [issue46919] After Python 3.9.2 is installed, the CVE-2019-12900 and CVE-2016-3189 vulnerabilities exist in Python39/DLLs/_bz2.pyd. Message-ID: <1646386472.07.0.567385422064.issue46919@roundup.psfhosted.org> Change by zjmxq : ---------- components: Library (Lib) nosy: zjmxq priority: normal severity: normal status: open title: After Python 3.9.2 is installed, the CVE-2019-12900 and CVE-2016-3189 vulnerabilities exist in Python39/DLLs/_bz2.pyd. type: security versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 04:40:03 2022 From: report at bugs.python.org (Roundup Robot) Date: Fri, 04 Mar 2022 09:40:03 +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: <1646386803.42.0.0944592639945.issue43923@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 7.0 -> 8.0 pull_requests: +29798 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31679 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 04:40:03 2022 From: report at bugs.python.org (Roundup Robot) Date: Fri, 04 Mar 2022 09:40:03 +0000 Subject: [issue40185] Refactor typing.NamedTuple In-Reply-To: <1586034525.17.0.360408189871.issue40185@roundup.psfhosted.org> Message-ID: <1646386803.56.0.894804673946.issue40185@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +29799 pull_request: https://github.com/python/cpython/pull/31679 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 04:42:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Mar 2022 09:42:54 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646386974.75.0.315574022084.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: > I don't agree with GH-31673. Did you try defining NO_MISALIGNED_ACCESSES instead? Did you read the commit message? The change is not about skipping the test, but fixing the CI. Previously, test_hashlib was not run at all on the UBSan buildbot, now most test_hashlib tests are run. The intent is to make sure that we don't add *new* undefined behavior. As I wrote in the commit, the UD must be fixed in _sha3. No, I didn't try NO_MISALIGNED_ACCESSES, I don't know this macro. If you have an idea on how _sha3 can be fixed on the UBSan buildbot, please go head! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 04:43:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Mar 2022 09:43:52 +0000 Subject: [issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers In-Reply-To: <1485909545.04.0.650924943503.issue29406@psf.upfronthosting.co.za> Message-ID: <1646387032.44.0.932652502245.issue29406@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 05:00:41 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 04 Mar 2022 10:00:41 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.0. In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1646388041.25.0.572494200023.issue46907@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 05:04:52 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 04 Mar 2022 10:04:52 +0000 Subject: [issue46918] The vulnerability is included in /lib/python3.9/ensurepip after python 3.9.2 is installed. In-Reply-To: <1646386315.18.0.392218219699.issue46918@roundup.psfhosted.org> Message-ID: <1646388292.09.0.0049061076781.issue46918@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: https://nvd.nist.gov/vuln/detail/CVE-2020-14422 Lib/ipaddress.py in Python through 3.8.3 improperly computes hash values in the IPv4Interface and IPv6Interface classes, which might allow a remote attacker to cause a denial of service if an application is affected by the performance of a dictionary containing IPv4Interface or IPv6Interface objects, and this attacker can cause many dictionary entries to be created. This is fixed in: v3.5.10, v3.5.10rc1; v3.6.12; v3.7.9; v3.8.4, v3.8.4rc1, v3.8.5, v3.8.6, v3.8.6rc1; v3.9.0, v3.9.0b4, v3.9.0b5, v3.9.0rc1, v3.9.0rc2. This CVE is listed as fixed in 3.9.0RC2 though you have added 3.9.2 and also mentioned ensurepip which doesn't seem to be relevant. Can you please add more detail over how we can reproduce the vulnerability in latest master or latest stable 3.9 release and how this is related to ensurepip. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 05:20:15 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 04 Mar 2022 10:20:15 +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: <1646389215.93.0.48026138467.issue43923@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +Jelle Zijlstra, gvanrossum, kj, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 05:35:29 2022 From: report at bugs.python.org (pmp-p) Date: Fri, 04 Mar 2022 10:35:29 +0000 Subject: [issue31370] Remove support for threads-less builds In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za> Message-ID: <1646390129.27.0.507467863423.issue31370@roundup.psfhosted.org> Change by pmp-p : ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 05:56:33 2022 From: report at bugs.python.org (Vincent FUNG) Date: Fri, 04 Mar 2022 10:56:33 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() In-Reply-To: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> Message-ID: <1646391393.35.0.143408891369.issue46916@roundup.psfhosted.org> Vincent FUNG added the comment: Oh. Got it. I thought pathlib would solve this problem completely now, without having to replace the slashes. Thank you for your patient answer. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 06:32:15 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 11:32:15 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646393535.12.0.0164958270563.issue46903@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 03c2a36b2bd2d4469160d1607619ee144175d753 by Mark Shannon in branch 'main': bpo-46903: Handle str-subclasses in virtual instance dictionaries. (GH-31658) https://github.com/python/cpython/commit/03c2a36b2bd2d4469160d1607619ee144175d753 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 06:41:51 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 11:41:51 +0000 Subject: [issue46911] Early tracing has lineno=None for modules In-Reply-To: <1646314619.94.0.770147890842.issue46911@roundup.psfhosted.org> Message-ID: <1646394111.96.0.0115707734127.issue46911@roundup.psfhosted.org> Mark Shannon added the comment: This is a bit of a tricky one. The problem is that the line number for an instruction is used for two purposes. 1. To calculate the line number in frame.f_lineno for tracebacks and events 2. By dis to determine which lines are present and where they start. If we set the lineno for the initial RESUME instruction in a module, we break dis and coverage for modules that do not have code on line 1. If we add an explicit line-start table, we would be able to fix this, as the RESUME would have a line number for case 1, but wouldn't start a line, thus not breaking dis. An explicit line-start table has other advantages, so we probably will implement it, but maybe not until 3.12. Ned, Would it make sense in coverage.py to ignore "call" events when doing coverage, and only use "line" events? All the traces in your example are from "call" events. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 06:43:00 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 04 Mar 2022 11:43:00 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() In-Reply-To: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> Message-ID: <1646394180.48.0.681079376974.issue46916@roundup.psfhosted.org> Eryk Sun added the comment: > I thought pathlib would solve this problem completely now, > without having to replace the slashes. pathlib has nothing to do with how the Python language compiles string literals. A string *literal* is Python source code that gets compiled and instantiated as a string object. There is no technical problem with using r'F:\ceven\test2'. Using a raw string literal disables backslash escapes. But many developers find it inconvenient to have to use raw strings or to have to escape backslashes by doubling them. Plus raw string literals can't represent a path that ends with a backslash, such as C:\. The Windows API supports forward slash as a path separator in many cases, but not always, and also not always for paths passed on the command line. So it's preferable to always normalize paths. pathlib takes care of this for you. You can initialize conveniently with forward slashes, but get a Windows path string that uses backslashes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 06:45:18 2022 From: report at bugs.python.org (Jonathan Fine) Date: Fri, 04 Mar 2022 11:45:18 +0000 Subject: [issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop In-Reply-To: <1646306528.93.0.506258424716.issue46910@roundup.psfhosted.org> Message-ID: <1646394318.28.0.583958425503.issue46910@roundup.psfhosted.org> Jonathan Fine added the comment: Many thanks Pablo for the clear explanation. I'd prefer that the issue remain open, as there's an important user experience issue here. I suspect there are other similar examples of how the compiler error messages could be improved. Here's a change that doesn't seem to be too hard, that could fix the problem at hand. The IndentationError occurred at a known location in the input string. So as part of error reporting truncate the input string and try to compile that. In other words, make a good faith attempt to find an earlier error. I've attached a funny_break_error_fix.py which is a first draft implementation of this idea. Here's the output: === $ python3 funny_break_error_fix.py funny_break_error.py unexpected indent (funny_break_error.py, line 6) Traceback (most recent call last): File "funny_break_error_fix.py", line 3, in compile_fix compile(source, filename, 'exec') File "funny_break_error.py", line 6 else: ^ IndentationError: unexpected indent During handling of the above exception, another exception occurred: Traceback (most recent call last): File "funny_break_error_fix.py", line 18, in compile_fix(src.read(), filename, 'exec') File "funny_break_error_fix.py", line 9, in compile_fix compile(new_source, filename, 'exec') File "funny_break_error.py", line 5 break ^ SyntaxError: 'break' outside loop === And in this case we've got hold of the first error (at the cost of compiling part of the source file twice). Many thanks again for the clear explanation, which I found most helpful when formulating the above fix. ---------- Added file: https://bugs.python.org/file50656/funny_break_error_fix.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 06:49:12 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 04 Mar 2022 11:49:12 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1646394552.12.0.715538856215.issue19217@roundup.psfhosted.org> Change by Alex Waygood : ---------- keywords: -easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 07:13:16 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 04 Mar 2022 12:13:16 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 Message-ID: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> New submission from Oleg Iarygin : `git grep "#if 0"` gives the following occurences of dead code (analyzed with `git blame`, removed by a linked pull request): - added on 27 Apr 2020 by 2b74c83: Parser/pegen.h:9, Parser/pegen.h:15. Since these constants aren't mentioned anywhere else, I think it's some initial experiment now abandoned. - added on 23 Apr 2020 by c5fc156: Parser/pegen.c:40. `token_name` is mentioned nowhere in the CPython codebase too. - added on 20 Nov 2014 by d600951: Python/pylifecycle.c:1843 with the following note: > XXX This is disabled because it caused too many problems. If a __del__ or weakref callback triggers here, Python code has a hard time running, because even the sys module has been cleared out (sys.stdout is gone, sys.excepthook is gone, etc). One symptom is a sequence of information-free messages coming from threads (if a __del__ or callback is invoked, other threads can execute too, and any exception they encounter triggers a comedy of errors as subsystem after subsystem fails to find what it *expects* to find in sys to help report the exception and consequent unexpected failures). I've also seen segfaults then, after adding print statements to the Python code getting called. So the call is faulty for seven years with no progress. - added on 26 Oct 2013 by 8444ebb: Modules/sre_lib.h336. The Secret Labs' Regular Expression Engine was vendored nine years ago so `not used in this release` is permanent and can be removed. - added on 25 Aug 2012 by 2543756: Modules/_ctypes/libffi_osx/x86/x86-ffi64.c:155 - added on 21 Mar 2012 by 1919b7e: Modules/_decimal/libmpdec/sixstep.c:120, Modules/_decimal/libmpdec/sixstep.c:157, Modules/_decimal/libmpdec/fourstep.c:189, Modules/_decimal/libmpdec/fourstep.c:220 - added on 28 Sep 2011 by d63a3b8: Python/formatter_unicode.c:140. `DEBUG_PRINT_FORMAT_SPEC` is used nowhere, plus putting a debugger breakpoint onto an interesting `InternalFormatSpec` is more convenient. - added on 5 Mar 2008 by 7864476: Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c:40 - added on 27 Aug 2007 by e226b55: Objects/unicodeobject.c:13660, Objects/unicodeobject.c:14253. `_decimal2ascii` is mentioned nowhere else in the CPython codebase. - added on 11 Aug 2006 by 0e3f591: Python/compile.c:7873. Neither `dump_instr` nor `dump_basicblock` are used. - added on 7 Dec 2005 by 8c8836b: Modules/_elementtree.c:39. In addition, `ALLOC()` and `RELEASE()` are removed as unconditional no-ops. - added on 4 Aug 2002 by 00f1e3f: Parser/tokenizer.c:285. "/* Disable support for UTF-16 BOMs until a decision is made whether this needs to be supported */" - I have every reason to believe that the decision was Never Ever. - added on 23 Mar 2002 by c24ea08: Python/ceval.c:7065-L7070. The "/* future keyword */" is quite overdue already. - added on 23 Jun 2001 by 01dfdb3: Modules/getaddrinfo.c:41, Modules/getnameinfo.c:37 - added on 14 Jul 1998 by 43ff868: Modules/_tkinter.c:3443 ---------- components: Extension Modules, Interpreter Core, Unicode, macOS messages: 414519 nosy: arhadthedev, ezio.melotti, ned.deily, ronaldoussoren, vstinner priority: normal severity: normal status: open title: Remove code made dead long ago with #if 0 type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 07:13:43 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 04 Mar 2022 12:13:43 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646396023.62.0.332719674587.issue46920@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +29800 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 07:19:47 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 04 Mar 2022 12:19:47 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646396387.31.0.809645071748.issue46920@roundup.psfhosted.org> Oleg Iarygin added the comment: Also forgot to add that git grep "#if 1" gives the following: - added on 20 Nov 2014 by d600951: cpython/Python/pylifecycle.c:2427. "/* Disable this if you have trouble debugging bootstrap stuff */" - after seven years, no trouble was found so this always-true guard has no use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 07:28:24 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Mar 2022 12:28:24 +0000 Subject: [issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop In-Reply-To: <1646306528.93.0.506258424716.issue46910@roundup.psfhosted.org> Message-ID: <1646396904.96.0.740448885803.issue46910@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately that's not how the parser works. I insist, for the compiler to raise the propper error the parser needs to succeed first. That would require us to modify the input string in arbitrary ways (many times we don't know exactly what went wrong) and recompile an arbitrary number of times. I'm very sorry, but I will leave this issue closed as "won't fix" as the complexity of this solution is too much for the given benefit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 07:30:19 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 12:30:19 +0000 Subject: [issue46781] Tracing: c_return doesn't report the result In-Reply-To: <1645121302.3.0.866413840913.issue46781@roundup.psfhosted.org> Message-ID: <1646397019.91.0.522352277446.issue46781@roundup.psfhosted.org> Mark Shannon added the comment: This is an API change. I agree that the API is not what it should be, but we can't change it without breaking an unknown amount of 3rd party code that uses it. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 07:41:45 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 12:41:45 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646397705.24.0.268473337071.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 586b24d3be1aec5d2568b070a249b4d75e608782 by Brandt Bucher in branch 'main': bpo-46841: Fix error message hacks in `GET_AWAITABLE` (GH-31664) https://github.com/python/cpython/commit/586b24d3be1aec5d2568b070a249b4d75e608782 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 08:21:07 2022 From: report at bugs.python.org (Vincent FUNG) Date: Fri, 04 Mar 2022 13:21:07 +0000 Subject: [issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir() In-Reply-To: <1646345858.65.0.182436271854.issue46916@roundup.psfhosted.org> Message-ID: <1646400067.71.0.398124348896.issue46916@roundup.psfhosted.org> Vincent FUNG added the comment: Thank you very much for your patient answer, I am still a developer who has just started, and it seems that I need to learn more about it. I used repr().replace to replace with forward slashes, and also restricted paths ending in a slash to Improve reliability. Thanks anagin. ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 08:31:33 2022 From: report at bugs.python.org (mattip) Date: Fri, 04 Mar 2022 13:31:33 +0000 Subject: [issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs) In-Reply-To: <1645227388.68.0.727345462152.issue46794@roundup.psfhosted.org> Message-ID: <1646400693.69.0.183609133492.issue46794@roundup.psfhosted.org> mattip added the comment: On PyPy, the test `test_issue3151` in `test_xml_etree.py` is failing with libexpat 2.4.6. I think the problem is connected to instantiation of the `XMLParser()` with `parser = expat.ParserCreate(encoding, "}")` where `"}"` is not a valid URI character. In any case, due to libexpat issue 577, https://github.com/libexpat/libexpat/pull/577 they will be releasing a new version 2.4.7 soon. ---------- nosy: +mattip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 08:49:52 2022 From: report at bugs.python.org (Alex Zunegin) Date: Fri, 04 Mar 2022 13:49:52 +0000 Subject: [issue5043] get_msvcr() returns None rather than [] In-Reply-To: <1232819450.01.0.0863165056727.issue5043@psf.upfronthosting.co.za> Message-ID: <1646401792.42.0.560430383.issue5043@roundup.psfhosted.org> Alex Zunegin added the comment: This messes up building Cython extensions on MSYS2 and MINGW. Still here as of setuptools 60. There is no line ``` return [] <<<<<<<<----- ``` at the end. Adding it helps. ---------- nosy: +gesserat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:14:16 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 04 Mar 2022 14:14:16 +0000 Subject: [issue46918] The vulnerability is included in /lib/python3.9/ensurepip after python 3.9.2 is installed. In-Reply-To: <1646386315.18.0.392218219699.issue46918@roundup.psfhosted.org> Message-ID: <1646403256.89.0.274403421599.issue46918@roundup.psfhosted.org> Ned Deily added the comment: To emphasize, Python 3.9.2 is obsolete and no longer supported; at the moment, the current release of Python 3.9 is 3.9.10. The most current bugfix release (3.9.x) obsoletes all previous releases of that Python version (3.9); during a version's support lifecycle, we only provide fixes for the most recent bugfix release (3.9.10). (Downstream third-party distributors of Python may have different support policies.) https://www.python.org/downloads/ ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:29:27 2022 From: report at bugs.python.org (Roundup Robot) Date: Fri, 04 Mar 2022 14:29:27 +0000 Subject: [issue31613] Localize tkinter.simpledialog.Default buttons as with file dialogs. In-Reply-To: <1506532491.44.0.154975027568.issue31613@psf.upfronthosting.co.za> Message-ID: <1646404167.66.0.802968492028.issue31613@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +29801 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:30:18 2022 From: report at bugs.python.org (=?utf-8?q?Sampo_Hippel=C3=A4inen?=) Date: Fri, 04 Mar 2022 14:30:18 +0000 Subject: [issue31613] Localize tkinter.simpledialog.Default buttons as with file dialogs. In-Reply-To: <1506532491.44.0.154975027568.issue31613@psf.upfronthosting.co.za> Message-ID: <1646404218.68.0.780743490303.issue31613@roundup.psfhosted.org> Sampo Hippel?inen added the comment: >Tk does not provide localized [Ok] and [Cancel] buttons. This is not true. You can call ::msgcat::mc to localize core strings such as "OK" and "Cancel". The full tk.call becomes tk.call("namespace", "eval", "::tk", "::msgcat::mc", s) to translate a string s, such as "OK". I have made a custom modified version of simpledialog.py that makes use of this and indeed localizes the OK/Cancel buttons as they would be localized for tk messageboxes (which use Tcl/Tk Core localization). I submitted this now as a GitHub PR. ---------- nosy: +sampo.hippelainen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:32:51 2022 From: report at bugs.python.org (R. David Murray) Date: Fri, 04 Mar 2022 14:32:51 +0000 Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode header In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za> Message-ID: <1646404371.6.0.702851550858.issue17505@roundup.psfhosted.org> R. David Murray added the comment: The policy is named 'default' because it was intended to become the default two feature releases after the new email code became non-provisional (first: deprecate not specifying an explicit policy, next release make default the default policy and make the deprecation only cover compat32). However, for various reasons that switchover did not happen (one big factor being my reduced time spent doing python development). It can happen any time someone steps forward to guide it through the release process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:39:02 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 14:39:02 +0000 Subject: [issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong In-Reply-To: <1641729344.86.0.271892670725.issue46311@roundup.psfhosted.org> Message-ID: <1646404742.2.0.520961432016.issue46311@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:41:06 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 14:41:06 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646404866.74.0.320368888168.issue46896@roundup.psfhosted.org> Mark Shannon added the comment: Why so coarse? Getting a notification for every change of a global in module, is likely to make use the use of global variables extremely expensive. ``` var = 0 CONST = 1 def foo(...): ... ``` I may well want to be notified if `foo` or `CONST` gets modified, but performance could suffer badly if we make a callback every time `var` is changed. -------------- What happens if a watched dictionary is modified in a callback? -------------- How do you plan to implement this? Steal a bit from `ma_version_tag` or replace `ma_version_tag`? If you replace `ma_version_tag` this could actually speed things up a tad. You'd probably need a PEP to replace PEP 509, but I think this may need a PEP anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 09:46:49 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Mar 2022 14:46:49 +0000 Subject: [issue46430] intern strings in deepfrozen modules In-Reply-To: <1642590983.92.0.896257318647.issue46430@roundup.psfhosted.org> Message-ID: <1646405209.72.0.263072693787.issue46430@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +29803 pull_request: https://github.com/python/cpython/pull/31683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 10:06:35 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Mar 2022 15:06:35 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1646406395.34.0.591776997135.issue46541@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +29804 pull_request: https://github.com/python/cpython/pull/31683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 10:06:51 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Mar 2022 15:06:51 +0000 Subject: [issue46430] intern strings in deepfrozen modules In-Reply-To: <1642590983.92.0.896257318647.issue46430@roundup.psfhosted.org> Message-ID: <1646406411.12.0.442802688456.issue46430@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -29803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 10:49:34 2022 From: report at bugs.python.org (Larry Hastings) Date: Fri, 04 Mar 2022 15:49:34 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646408974.22.0.178212933967.issue39298@roundup.psfhosted.org> Change by Larry Hastings : ---------- pull_requests: +29805 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31686 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 10:59:39 2022 From: report at bugs.python.org (Larry Hastings) Date: Fri, 04 Mar 2022 15:59:39 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646409579.35.0.668540216954.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: Okay, so. Here's a PR that adds BLAKE3 support to hashlib. The code was straightforward; I just took the BLAKE2 module and modified it to only have one algorithm. I also copied over the whole C directory tree from BLAKE3, which is totally okay fine by their license. I didn't have to modify it a bit. The tricky part was building it. Building extension modules is done inside setup.py using distutils (or the modern replacement), and in order to get those sexy SIMD implementations I had to compile assembly-language files, or C files with extra flags. What I did works great on my Linux box, and I have my fingers crossed that it'll work on other POSIX platforms. I wrote a loooong comment in setup.py explaining what I did and why. Steve: I didn't do anything for Windows support. Do you have time to take a pass at it? Or if you know another core dev who does Windows build stuff, please nosy them. Whoever does the work. I suggest you read https://github.com/BLAKE3-team/BLAKE3/blob/master/c/README.md for a little guidance on how to build BLAKE3 on Windows with SIMD support. Also, I see you now build Python for Windows on ARM! Does this mean Python can use BLAKE3's NEON support? Maybe it's time to find out! Get hyped! Jack and I corresponded last year (or maybe 2020?) about what the API should look like. The idea is, Jack also maintains a BLAKE3 Python extension on pypi, written in Rust. Our goal was to make the two types behave identically, so that it could be like the old stringio / cstringio situation. You can use the built-in one for convenience, but also you can install the Rust version from PyPI for even more performance. Jack, it wouldn't hurt my feelings overly much if you checked my PR to make sure I got the interface right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:12:02 2022 From: report at bugs.python.org (Larry Hastings) Date: Fri, 04 Mar 2022 16:12:02 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646410322.3.0.787950561203.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: Also, for what it's worth: I just ran my checksum benchmarker using a freshly built python a la my PR. Here are my results when hashing 462183782 bytes (dicey-dungeons-linux64.zip): hash algorithm time bytes/sec size hash --------- ---------- ---------- ---- --------------------------------- blake3 0.18976406 2435570699 64 0c72d0a07ba767b75b0c99fed38fda... sha1 0.21692419 2130623562 40 9fb83614394cd3b39e42b1d9f84a3c... sha256 0.26399648 1750719480 64 2320129f2545ff8606d3db1d706d86... sha224 0.28097475 1644929957 56 133b5da8d8b387f2bcfd69b0c73ed8... md4 0.34185237 1351998195 32 dea7585ea9fa4520687bab1dc671858e blake2b 0.53724666 860282275 128 e3653f33858a83b386c2fe865280a1... md5 0.58128106 795112407 32 299440e1968cf8f8abc288bac8c0a4fa sha512_224 0.64589952 715566066 56 413d48b782f114870ef80815540678... sha384 0.64645893 714946859 96 b1c1cd96cef79c15f2171b8aa81304... sha512 0.65424513 706438241 128 e7d0cec3fe8b73d1534a7bdb484176... sha512_256 0.68371638 675987586 64 3f58faba70cea4d6ea8a8371e71bbb... md5-sha1 0.80361958 575127576 72 299440e1968cf8f8abc288bac8c0a4... shake_128 0.84424524 547452041 64 c62a813897b81f67822fc07115deae... blake2s 0.85661793 539544839 64 cb8bd19c6ca446bbf7a8abbec61dc5... sha3_224 0.95759645 482649850 56 6f96d117c7fcbcd802b222854db644... shake_256 1.0152032 455262322 64 2d9f9dafe0ddf792c6407910946845... sha3_256 1.015744 455019929 64 cc5d55fe0ac31f6e335da1bc6abaf3... sha3_384 1.3235858 349190644 96 13206910ff231fe51a38fe637ded30... sm3 1.4478934 319211203 64 021cd913540d95b13a03342b54f80d... ripemd160 1.4737549 313609670 40 1a956000b88267ec8fc23327d22548... sha3_512 1.9131832 241578418 128 e84b9f499b013956f6f36c93234ca3... "time" is wall time in seconds. So, yes, BLAKE3 was the fastest hash algorithm available on my machine--2.4GB/sec! (I'm a little surprised by that result actually. My CPU is pretty modern, so I assume it has the SHA1 extensions. And I further assume we're using OpenSSL, and OpenSSL will use those extensions when available. If BLAKE3 is *still* faster that OpenSSL, well! hats off to the BLAKE3 team. And that just goes to show you how useful SIMD extensions are!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:35:26 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 04 Mar 2022 16:35:26 +0000 Subject: [issue46919] After Python 3.9.2 is installed, the CVE-2019-12900 and CVE-2016-3189 vulnerabilities exist in Python39/DLLs/_bz2.pyd. Message-ID: <1646411726.6.0.180197006966.issue46919@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> BZip 1.0.6 Critical Vulnerability _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:39:26 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Mar 2022 16:39:26 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1646411966.55.0.820504091064.issue46541@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset d168c728f7114959e8fc147538ea1d24f2f5af79 by Dong-hee Na in branch 'main': bpo-46541: Remove usage of _Py_IDENTIFIER from lzma module (GH-31683) https://github.com/python/cpython/commit/d168c728f7114959e8fc147538ea1d24f2f5af79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:42:43 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 04 Mar 2022 16:42:43 +0000 Subject: [issue46921] Vectorcall support for super() Message-ID: <1646412162.98.0.58372523798.issue46921@roundup.psfhosted.org> New submission from Ken Jin : This is related to bpo-46564. The changes are less ambitious but should produce a nice speedup. ---------- messages: 414535 nosy: kj priority: normal severity: normal status: open title: Vectorcall support for super() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:43:29 2022 From: report at bugs.python.org (progval) Date: Fri, 04 Mar 2022 16:43:29 +0000 Subject: [issue46922] tarfile.TarFile.next() crashes on empty tar files Message-ID: <1646412209.92.0.374671819607.issue46922@roundup.psfhosted.org> New submission from progval : Hi, I found two related bugs when calling tarfile.TarFile.next() on an empty tar file, both when trying to seek when it should not: import io import tarfile # Create a tarball with no member: fd = io.BytesIO() with tarfile.open(fileobj=fd, mode="w") as tf: pass # read in stream mode: fd.seek(0) with tarfile.open(fileobj=fd, mode="r|") as tf: print(tf.next()) # tarfile.StreamError: seeking backwards is not allowed # read in normal mode: fd.seek(0) with tarfile.open(fileobj=fd, mode="r") as tf: print(tf.next()) # ValueError: negative seek value -1 ---------- components: Library (Lib) messages: 414536 nosy: progval priority: normal severity: normal status: open title: tarfile.TarFile.next() crashes on empty tar files versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:44:18 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 04 Mar 2022 16:44:18 +0000 Subject: [issue46921] Vectorcall support for super() In-Reply-To: <1646412162.98.0.58372523798.issue46921@roundup.psfhosted.org> Message-ID: <1646412258.95.0.0233378462752.issue46921@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +29806 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:46:05 2022 From: report at bugs.python.org (sping) Date: Fri, 04 Mar 2022 16:46:05 +0000 Subject: [issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs) In-Reply-To: <1645227388.68.0.727345462152.issue46794@roundup.psfhosted.org> Message-ID: <1646412365.86.0.266974438482.issue46794@roundup.psfhosted.org> sping added the comment: Hi mattip, at the core the problem is not the use of non-URI character "}" for a namespace separator but the use of non-URI character "}" in a namespace URI. test_issue3151 is mistaken (meaning that non-URI characters in URIs are malformed XML) and the test has been removed in CPython pull request https://github.com/python/cpython/pull/31453/files . Expat pull request https://github.com/libexpat/libexpat/pull/577 is related but it's about URI characters not about non-URI ones, so it does not change anything about test_issue3151 in PyPy. Does that make sense? Best, Sebastian ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:48:45 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 04 Mar 2022 16:48:45 +0000 Subject: [issue44549] Update Windows installer to use BZip 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646412525.79.0.775715620615.issue44549@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> steve.dower priority: normal -> critical title: BZip 1.0.6 Critical Vulnerability -> Update Windows installer to use BZip 1.0.8 versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:50:17 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 04 Mar 2022 16:50:17 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646412617.9.0.875925032446.issue44549@roundup.psfhosted.org> Change by Ned Deily : ---------- title: Update Windows installer to use BZip 1.0.8 -> Update Windows installer to use bzip2 1.0.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:54:19 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 16:54:19 +0000 Subject: [issue46923] Implement stack overflow protection for supported platforms Message-ID: <1646412859.37.0.291420290315.issue46923@roundup.psfhosted.org> New submission from Mark Shannon : https://github.com/python/steering-council/issues/102 (definitely not PEP 651 ;)) We should implement efficient stack checks on those platforms that allow us to introspect stack extents. Windows and posix systems allow us to do this. C allows addresses of stack variables to be taken. This means that C stacks cannot be moved. In theory they might be discontinuous, although I suspect that they are always contiguous. My plan is to maintain a per-thread "safe region" of 32or 64k. We can check if the current stack pointer (or near enough) is in that region cheaply. If we are not in that region, we can ask the O/S for a stack limit to determine a new "safe region". If we cannot find a safe region, then we raise a MemoryError. Personally I'd prefer a new exception `StackOverflow` to `MemoryError` but, thanks to stackoverflow.com, it is now impossible for new programmers to do a web search to determine what a "stack overflow" is. So, I guess MemoryError will have to do. ---------- assignee: Mark.Shannon messages: 414538 nosy: Mark.Shannon, gregory.p.smith priority: normal severity: normal status: open title: Implement stack overflow protection for supported platforms _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:56:53 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 04 Mar 2022 16:56:53 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None In-Reply-To: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> Message-ID: <1646413013.74.0.0924858995044.issue46389@roundup.psfhosted.org> Change by Mark Shannon : ---------- stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 11:56:56 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 04 Mar 2022 16:56:56 +0000 Subject: [issue46923] Implement stack overflow protection for supported platforms In-Reply-To: <1646412859.37.0.291420290315.issue46923@roundup.psfhosted.org> Message-ID: <1646413016.69.0.802993826199.issue46923@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:02:22 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Mar 2022 17:02:22 +0000 Subject: [issue46923] Implement stack overflow protection for supported platforms In-Reply-To: <1646412859.37.0.291420290315.issue46923@roundup.psfhosted.org> Message-ID: <1646413342.67.0.332937747842.issue46923@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:36:04 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Mar 2022 17:36:04 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646415364.2.0.730059647509.issue25415@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset cedd2473a9bebe07f3ced4f341cf58a2fef07b03 by slateny in branch 'main': bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631) https://github.com/python/cpython/commit/cedd2473a9bebe07f3ced4f341cf58a2fef07b03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:36:19 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 17:36:19 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646415379.49.0.531529102108.issue25415@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +29807 pull_request: https://github.com/python/cpython/pull/31688 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:36:24 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 17:36:24 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646415384.77.0.929609771819.issue25415@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29808 pull_request: https://github.com/python/cpython/pull/31689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:39:37 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 04 Mar 2022 17:39:37 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646415577.09.0.545588788762.issue46896@roundup.psfhosted.org> Brandt Bucher added the comment: > Why so coarse? > Getting a notification for every change of a global in module, is likely to make use the use of global variables extremely expensive. Perhaps a compromise is possible here: one global group/chain of callbacks registered for all dictionaries in an interpreter seems reasonable (to keep overhead low), but we could reduce the number of times it?s actually called by, say, tagging specific values of specific dictionaries to be watched. For example, we could just tag the low bit of any pointer in a dictionary?s values that we want to be notified of changes to. Something like that seems like it could really keep the cost of watching down without sacrificing power. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 12:54:39 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 04 Mar 2022 17:54:39 +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: <1646416479.54.0.704736730198.issue43923@roundup.psfhosted.org> Guido van Rossum added the comment: Couldn't there be a subtler solution than rolling back GH-19371? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:04:58 2022 From: report at bugs.python.org (Vidhya) Date: Fri, 04 Mar 2022 18:04:58 +0000 Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode header In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za> Message-ID: <1646417098.62.0.426983966679.issue17505@roundup.psfhosted.org> Vidhya added the comment: @hniksic: Thanks for your suggestions. I will look into BytesFeedParser documents. @david.murray: I can help you for the switch over to the default in the default policy and update the deprecation as well. It will be good if someone can guide me on this. Being a beginner, I am not sure if we are allowed to change the python code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:05:20 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 04 Mar 2022 18:05:20 +0000 Subject: [issue46922] tarfile.TarFile.next() crashes on empty tar files In-Reply-To: <1646412209.92.0.374671819607.issue46922@roundup.psfhosted.org> Message-ID: <1646417120.36.0.808962130486.issue46922@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:16:27 2022 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 04 Mar 2022 18:16:27 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646417787.58.0.561666407281.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: Thanks Larry! Was any of the experimental C extension code under https://github.com/oconnor663/blake3-py/tree/master/c_impl useful to you? I was wondering if it could be possible to copy blake3module.c from there verbatim. The setup.py build there also has working Windows and NEON support. I've patched the blake3-py test suite (which both the production Rust-based extension and that experimental C-based extension currently pass) to invoke the new hashlib implementation from your branch. You can find the full test output, and the procedure I used to run the tests, in this Gist https://gist.github.com/oconnor663/533048580b1c0f4a01d1d55f57f92792. Here are some differences: - My derive_key_context parameter requires a string and refuses to accept bytes. This is consistent with our Rust and C APIs (though the C API does include a _raw version specifically for bindings, which we're using here). For a long discussion of why we prefer to do things this way, see https://github.com/BLAKE3-team/BLAKE3/issues/13. The short version is that any use case that requires arbitrary bytes for the context string is almost certainly violating the documented security requirement that the context string must be hardcoded. - I've included an `AUTO` constant that provides a special value (-1) for the `max_threads` argument, and I explicitly don't support `max_threads=0`. - I enforce that the `data` arguments are positional-only and that the other keyword arguments are keyword-only. I think this is consistent with the rest of hashlib. - I include a `.reset()` method. This isn't particularly useful in the default case, where you might as well create a new hasher. But when `max_threads` is greater than 1 in the Rust implementation, the hasher owns a thread pool, and `.reset()` is currently the only way to reuse that pool. (A BLAKE3 hasher is also ~2 KB, somewhat larger than other hashers, so callers who are pinching pennies with their allocator traffic might prefer to reuse the object.) - Unrelated to tests: I haven't made any attempt to zero memory in my `dealloc` function. But if that's what other hashlib functions do, then I'm certainly in favor of doing it here too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:16:41 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 04 Mar 2022 18:16:41 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1646417801.98.0.668761805513.issue45274@roundup.psfhosted.org> Change by G?ry : ---------- nosy: +maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:20:38 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 04 Mar 2022 18:20:38 +0000 Subject: [issue29971] threading.Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1646418038.88.0.633876662794.issue29971@roundup.psfhosted.org> Change by G?ry : ---------- nosy: +maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:29:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 04 Mar 2022 18:29:26 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646418566.67.0.735047691816.issue39298@roundup.psfhosted.org> Christian Heimes added the comment: GH-31686 is a massive patch set. I'm feeling uncomfortable adding such much new code for a new hashing algorithm. Did you ask the Steering Council for approval? The platform detection and compiler flag logic must be added to configure.ac instead of setup.py. Erlend and I are in the process of making setup.py optional. I plan to remove it entirely along with distutils in 3.12. ---------- assignee: christian.heimes -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:34:18 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 18:34:18 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646418858.83.0.066527301321.issue25415@roundup.psfhosted.org> miss-islington added the comment: New changeset 01df048831eb631dfee41175f08d09b9ad1a9538 by Miss Islington (bot) in branch '3.9': bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631) https://github.com/python/cpython/commit/01df048831eb631dfee41175f08d09b9ad1a9538 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:34:18 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 18:34:18 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646418858.83.0.066527301321.issue25415@roundup.psfhosted.org> miss-islington added the comment: New changeset 01df048831eb631dfee41175f08d09b9ad1a9538 by Miss Islington (bot) in branch '3.9': bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631) https://github.com/python/cpython/commit/01df048831eb631dfee41175f08d09b9ad1a9538 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:34:18 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 18:34:18 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646418858.99.0.485109585866.issue25415@roundup.psfhosted.org> miss-islington added the comment: New changeset bdce1880365990403efdbeb60c4928c996370b0c by Miss Islington (bot) in branch '3.10': bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631) https://github.com/python/cpython/commit/bdce1880365990403efdbeb60c4928c996370b0c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 13:38:01 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Mar 2022 18:38:01 +0000 Subject: [issue25415] [io doc] Reword "there is no public constructor" In-Reply-To: <1444931934.97.0.280840323098.issue25415@psf.upfronthosting.co.za> Message-ID: <1646419081.23.0.983163615724.issue25415@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 Mar 4 13:51:43 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 04 Mar 2022 18:51:43 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646419903.13.0.640664697189.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset c4d2d57eefb1224a12e2e95e4508658dfbf6a7c9 by Brandt Bucher in branch 'main': bpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671) https://github.com/python/cpython/commit/c4d2d57eefb1224a12e2e95e4508658dfbf6a7c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 14:17:30 2022 From: report at bugs.python.org (AmericanEnglish) Date: Fri, 04 Mar 2022 19:17:30 +0000 Subject: [issue46924] make install hangs when installing zoneinfo/_zoneinfo.py Message-ID: <1646421450.64.0.938148435376.issue46924@roundup.psfhosted.org> New submission from AmericanEnglish : I am currently trying to compile Python 3.10.2 from source. Everything seems to compile fine when doing a configure then a make. When I do make install though the install process hangs when compiling zoneinfo/_zoneinfo.py . Currently there are 6 python processes running when I view top. I have left this for several hours and the status is unchanged. Here is the configure command I used: export CXX=icpx export CC=icx # icx uses LLVM, so this is required for ctypes...? export CFLAGS="-no-integrated-as" # icx uses a clang frontend so these should be used as suggested by: # https://devguide.python.org/setup/ export CFLAGS="$CFLAGS -Wno-unused-value -Wno-empty-body -Qunused-arguments" cd $BUILD ../../302/configure \ --prefix $PREFIX \ --enable-profiling \ --enable-optimizations \ --with-ensurepip=install > configureOutput.txt everything runs fine. When I CTRL+C to kill the make install it drops an error: KeyboardInterrupt File "/installation/lib/python3.10/multiprocessing/synchronize.py", line 95, in __enter__ return self._semlock.__enter__() File "/installation/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/installation/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/installation/lib/python3.10/multiprocessing/queues.py", line 102, in get with self._rlock: File "/installation/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/installation/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap [interrupted] make: [libinstall] Error 1 (ignored) Any advice would be greatly appreciated. I have tried Googling the problem and searching StackOverflow and found no solutions that work. I will say that this happens with AND without optimizations enabled. ---------- components: Installation messages: 414548 nosy: AmericanEnglish priority: normal severity: normal status: open title: make install hangs when installing zoneinfo/_zoneinfo.py type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:08:47 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Mar 2022 20:08:47 +0000 Subject: [issue45828] [sqlite3] use unraisable exceptions in callbacks In-Reply-To: <1637142139.17.0.325447635638.issue45828@roundup.psfhosted.org> Message-ID: <1646424527.68.0.635198559417.issue45828@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:11:49 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 04 Mar 2022 20:11:49 +0000 Subject: [issue38738] Fix formatting of True and False In-Reply-To: <1573155740.52.0.761967176426.issue38738@roundup.psfhosted.org> Message-ID: <1646424709.32.0.500060255493.issue38738@roundup.psfhosted.org> Change by G?ry : ---------- nosy: +maggyero nosy_count: 4.0 -> 5.0 pull_requests: +29809 pull_request: https://github.com/python/cpython/pull/31678 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:13:21 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 20:13:21 +0000 Subject: [issue38738] Fix formatting of True and False In-Reply-To: <1573155740.52.0.761967176426.issue38738@roundup.psfhosted.org> Message-ID: <1646424801.22.0.155288128628.issue38738@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +29810 pull_request: https://github.com/python/cpython/pull/31690 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:13:24 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 04 Mar 2022 20:13:24 +0000 Subject: [issue38738] Fix formatting of True and False In-Reply-To: <1573155740.52.0.761967176426.issue38738@roundup.psfhosted.org> Message-ID: <1646424804.43.0.890511243776.issue38738@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 46a116c1c9f6b60a3d35ab9a419f8eee5de2542e by G?ry Ogam in branch 'main': bpo-38738: Fix formatting of True and False in the threading documentation (GH-31678) https://github.com/python/cpython/commit/46a116c1c9f6b60a3d35ab9a419f8eee5de2542e ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 15:38:07 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Mar 2022 20:38:07 +0000 Subject: [issue38738] Fix formatting of True and False In-Reply-To: <1573155740.52.0.761967176426.issue38738@roundup.psfhosted.org> Message-ID: <1646426287.62.0.640717775336.issue38738@roundup.psfhosted.org> miss-islington added the comment: New changeset fa69ec89393549a18944b3b92943709dac56a36a by Miss Islington (bot) in branch '3.10': bpo-38738: Fix formatting of True and False in the threading documentation (GH-31678) https://github.com/python/cpython/commit/fa69ec89393549a18944b3b92943709dac56a36a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 16:24:30 2022 From: report at bugs.python.org (Carl Meyer) Date: Fri, 04 Mar 2022 21:24:30 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646429070.83.0.193279505332.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: Thanks for the feedback! > Why so coarse? Simplicity of implementation is a strong advantage, all else equal :) And the coarse version is a) at least somewhat proven as useful and usable already by Cinder / Cinder JIT, and b) clearly doable without introducing memory or noticeable CPU overhead to unwatched dicts. Do you have thoughts about how you'd do a more granular version without overhead? > Getting a notification for every change of a global in module, is likely to make use the use of global variables extremely expensive. It's possible. We haven't ever observed this as an issue in practice, but we may have just not observed enough workloads with heavy writes to globals. I'd like to verify this problem with a real representative benchmark before making design decisions based on it, though. Calling a callback that is uninterested in a particular key doesn't need to be super-expensive if the callback is reasonably written, and this expense would occur only on the write path, for cases where the `global` keyword is used to rebind a global. I don't think it's common for idiomatic Python code to write to globals in perf-sensitive paths. Let's see how this shows up in pyperformance, if we try running it with all module globals dicts watched. > For example, we could just tag the low bit of any pointer in a dictionary?s values that we want to be notified of changes to Would you want to tag the value, or the key? If value, does that mean if the value is changed it would revert to unwatched unless you explicitly watched the new value? I'm a bit concerned about the performance overhead this would create for use of dicts outside the write path, e.g. the need to mask off the watch bit of returned value pointers on lookup. > What happens if a watched dictionary is modified in a callback? It may be best to document that this isn't supported; it shouldn't be necessary or advisable for the intended uses of dict watching. That said, I think it should work fine if the callback can handle re-entrancy and doesn't create infinite recursion. Otherwise, I think it's a case of "you broke it, you get to keep all the pieces." > How do you plan to implement this? Steal a bit from `ma_version_tag` We currently steal the low bit from the version tag in Cinder; my plan was to keep that approach. > You'd probably need a PEP to replace PEP 509, but I think this may need a PEP anyway. I'd prefer to avoid coupling this to removal of the version tag. Then we get into issues of backward compatibility that this proposal otherwise avoids. I don't think the current proposal is of a scope or level of user impact that should require a PEP, but I'm happy to write one if needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 16:59:33 2022 From: report at bugs.python.org (Philip Bloom) Date: Fri, 04 Mar 2022 21:59:33 +0000 Subject: [issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work In-Reply-To: <1646338077.17.0.950796200691.issue46914@roundup.psfhosted.org> Message-ID: <1646431173.4.0.890522967056.issue46914@roundup.psfhosted.org> Philip Bloom added the comment: > Do you mean just adding a note to the effect that SysLogHandler won't work on macOS 12.2 because of changes to the syslog daemon on that platform? Yes or removing the specific guidance about OSX handling on it, mostly just to reduce folks coming to ask as they transition to it. That way it comes off that you need to provide a Syslog consumer to use the handler/not to expect one to exist on the platform. Hope I'm phrasing that understandably. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 17:31:03 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 04 Mar 2022 22:31:03 +0000 Subject: [issue46923] Implement stack overflow protection for supported platforms In-Reply-To: <1646412859.37.0.291420290315.issue46923@roundup.psfhosted.org> Message-ID: <1646433063.26.0.447816908259.issue46923@roundup.psfhosted.org> Steven D'Aprano added the comment: > Personally I'd prefer a new exception `StackOverflow` to `MemoryError` +1 on a new exception (presumably a subclass of MemoryError). How about using OverflowedStack instead? The situation is not quite as bad as you suggest. Googling for "stack overflow" alone (with a space and no other qualifications): * on Bing, scroll halfway down the first page of results to find the "People also ask..." How do you get a stack overflow? How to prevent a stack overflow error? * also on Bing at the bottom of the first page of results is a question on stackoverflow.com asking what causes memory stack overflows; * on DuckDuckGo, the first page of search results fails to suggest anything useful; * on Google itself, on the first page is the People Also Ask What causes stack overflows? * as well as a link to Wikipedia's page on stack overflows. I expect that going forward, "python stack overflow exception" will be sufficient to hit the Python docs somewhere on the first page. Besides, presumably this OverflowedStack exception is likely to be rare, so I expect that few people will need to google it. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 17:56:36 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 04 Mar 2022 22:56:36 +0000 Subject: [issue46860] `--with-suffix` not respected on case-insensitive file systems In-Reply-To: <1645834682.9.0.270645499588.issue46860@roundup.psfhosted.org> Message-ID: <1646434596.45.0.337676354372.issue46860@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 Mar 4 18:25:53 2022 From: report at bugs.python.org (Malthe Borch) Date: Fri, 04 Mar 2022 23:25:53 +0000 Subject: [issue46925] Replace key if not identical to old key in dict Message-ID: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> New submission from Malthe Borch : When a key that is equal to an existing key (but not the same object identity) is used to set a new value, the key itself is not replaced. This manifests perhaps most clearly in `weakref.WeakKeyDictionary` where keys can mysteriously disappear. Consider two equal keys, k1 and k2: d = WeakKeyDictionary() d[k1] = 1 d[k2] = 2 del k1 We would expect the dictionary to have a single entry k2 => 2. But in fact it is empty now. ---------- components: Library (Lib) messages: 414554 nosy: malthe priority: normal pull_requests: 29811 severity: normal status: open title: Replace key if not identical to old key in dict type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:01:39 2022 From: report at bugs.python.org (Charlie Yan) Date: Sat, 05 Mar 2022 00:01:39 +0000 Subject: [issue46926] runpy.run_path didn't set __package__ as describe in doc Message-ID: <1646438499.21.0.962171023528.issue46926@roundup.psfhosted.org> New submission from Charlie Yan : As described in the doc: https://docs.python.org/3.8/library/runpy.html#runpy.run_path > If the supplied path directly references a script file (whether as source or as precompiled byte code), then __file__ will be set to the supplied path, and __spec__, __cached__, __loader__ and __package__ will all be set to None. But: ``` $ cat a.py print(f'{__name__ = }') print(f'{__package__ = }') $ cat b.py import runpy runpy.run_path('a.py') $ python3 b.py __name__ = '' __package__ = '' ``` `__package__` is not set to None as in the doc. ---------- messages: 414555 nosy: yanhao.charles priority: normal severity: normal status: open title: runpy.run_path didn't set __package__ as describe in doc versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 19:03:26 2022 From: report at bugs.python.org (Charlie Yan) Date: Sat, 05 Mar 2022 00:03:26 +0000 Subject: [issue46926] runpy.run_path didn't set __package__ to None as describe in doc In-Reply-To: <1646438499.21.0.962171023528.issue46926@roundup.psfhosted.org> Message-ID: <1646438606.77.0.129071202578.issue46926@roundup.psfhosted.org> Change by Charlie Yan : ---------- title: runpy.run_path didn't set __package__ as describe in doc -> runpy.run_path didn't set __package__ to None as describe in doc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 20:24:29 2022 From: report at bugs.python.org (Jacob Walls) Date: Sat, 05 Mar 2022 01:24:29 +0000 Subject: [issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value In-Reply-To: <1645270291.57.0.995603390679.issue46798@roundup.psfhosted.org> Message-ID: <1646443469.76.0.509574612253.issue46798@roundup.psfhosted.org> Jacob Walls added the comment: I agree not a bug. To ignore the document default you can set `specified_attributes` on the parser as documented: https://docs.python.org/3/library/pyexpat.html#xml.parsers.expat.xmlparser.specified_attributes Also, this was explicitly worked on recently in bpo-42151, so hard to imagine reversing course so soon. I suggest the issue be re-closed. ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 20:40:45 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 01:40:45 +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: <1646444445.07.0.878683859462.issue43923@roundup.psfhosted.org> Jelle Zijlstra added the comment: Was this ever documented to work? We have now disallowed this behavior in 3.9 and 3.10 with few complaints, so it doesn't seem that important to restore it. Also, static type checkers generally disallow generic NamedTuples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 21:18:42 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 05 Mar 2022 02:18:42 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1646446722.5.0.943106170169.issue24132@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +29812 pull_request: https://github.com/python/cpython/pull/31691 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 21:18:42 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 05 Mar 2022 02:18:42 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1646446722.7.0.221651038749.issue44136@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +29813 pull_request: https://github.com/python/cpython/pull/31691 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 21:55:26 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 05 Mar 2022 02:55:26 +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: <1646448926.76.0.571980453882.issue43923@roundup.psfhosted.org> Guido van Rossum added the comment: Mypy seems to allow this: from typing import NamedTuple, TypeVar, Generic, List, Tuple T = TypeVar("T") class New(NamedTuple, Generic[T]): x: List[T] y: Tuple[T, T] It's true that pyright doesn't, but maybe that's because it doesn't work in 3.9-3.10? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 21:57:54 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 02:57:54 +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: <1646449074.19.0.628790778178.issue43923@roundup.psfhosted.org> Jelle Zijlstra added the comment: It doesn't really. If you do `x = New([1], (2, 3))` you get: main.py:11: error: List item 0 has incompatible type "int"; expected "T" main.py:11: error: Argument 2 to "New" has incompatible type "Tuple[int, int]"; expected "Tuple[T, T]" https://mypy-play.net/?mypy=latest&python=3.10&gist=a13c7a33c55a3aeee95324d46cd03ffd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 22:31:28 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 03:31:28 +0000 Subject: [issue46925] Replace key if not identical to old key in dict In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646451088.0.0.483876427779.issue46925@roundup.psfhosted.org> Jelle Zijlstra added the comment: As @methane also said on the PR, this is a backward compatibility break and we can't just change the behavior. I'd be opposed to a change here: the proposed behavior isn't clearly better than the existing behavior (sometimes you want one behavior, sometimes another), and it will be difficult to find and adjust code that relies on the existing behavior. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 22:45:06 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 03:45:06 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1646451906.03.0.606332774317.issue45100@roundup.psfhosted.org> Jelle Zijlstra added the comment: We could make my proposed overload registry more reusable by putting it in a different module, probably functools. (Another candidate is inspect, but inspect.py imports functools.py, so that would make it difficult to use the registry for functools.singledispatch.) We could then bill it as a "variant registry", with an API like this: def register_variant(key: str, variant: Callable) -> None: ... def get_variants(key: str) -> list[Callable]: ... def get_key_for_callable(callable: Callable) -> str | None: ... @overload could then call register_variant() to register each overload, and code that wants a list of overloads (pydoc, inspect.signature, runtime type checkers) could call get_variants(). get_key_for_callable() essentially does f"{callable.__qualname__}.{callable.__name__}", but returns None for objects it can't handle. It will also support at least classmethods and staticmethods. I will prepare a PR implementing this idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 4 22:53:04 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Mar 2022 03:53:04 +0000 Subject: [issue46925] Replace key if not identical to old key in dict In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646452384.31.0.895169462852.issue46925@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur with Jelle and Methane that we can't do this without breaking code. Also if you don't care about dict order, the work around is easy. Just remove the old key: d.pop(k); d[k] = v ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 00:12:39 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 05 Mar 2022 05:12:39 +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: <1646457159.83.0.843776977734.issue43923@roundup.psfhosted.org> Guido van Rossum added the comment: So if it doesn't work in mypy why bother making it work at runtime? Is there an actual use case that broke? (There might be, but probably esoteric if nobody's run into it until now.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 01:54:16 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 05 Mar 2022 06:54:16 +0000 Subject: [issue36098] asyncio: ssl client-server with "slow" read In-Reply-To: <1550967725.88.0.520289067216.issue36098@roundup.psfhosted.org> Message-ID: <1646463256.27.0.51792633579.issue36098@roundup.psfhosted.org> Kumar Aditya added the comment: This has been fixed with bpo-44011 on main branch. Output on main branch: -------------------------------------------------------------------------- /workspaces/cpython/main.py:42: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() received 8192, total 8192 received 8192, total 16384 received 8192, total 24576 received 8192, total 32768 received 8192, total 40960 received 8192, total 49152 received 8192, total 57344 received 8192, total 65536 received 8192, total 73728 received 8192, total 81920 received 8192, total 90112 received 8192, total 98304 received 8192, total 106496 received 8192, total 114688 received 8192, total 122880 received 8192, total 131072 received 8192, total 139264 received 8192, total 147456 received 8192, total 155648 received 8192, total 163840 received 8192, total 172032 received 8192, total 180224 received 8192, total 188416 received 8192, total 196608 received 8192, total 204800 received 8192, total 212992 received 8192, total 221184 received 8192, total 229376 received 8192, total 237568 received 8192, total 245760 received 8192, total 253952 received 8192, total 262144 received 8192, total 270336 received 8192, total 278528 received 8192, total 286720 received 8192, total 294912 received 8192, total 303104 received 8192, total 311296 received 8192, total 319488 received 8192, total 327680 received 8192, total 335872 received 8192, total 344064 received 8192, total 352256 received 8192, total 360448 received 8192, total 368640 received 8192, total 376832 received 8192, total 385024 received 8192, total 393216 received 8192, total 401408 received 8192, total 409600 received 0, total 409600 ------------------------------------------------------------------------ This can be closed now @asvetlov. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 01:57:40 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 05 Mar 2022 06:57:40 +0000 Subject: [issue30556] asyncio.wait very slow with FIRST_COMPLETED In-Reply-To: <1496425633.34.0.560515372039.issue30556@psf.upfronthosting.co.za> Message-ID: <1646463460.37.0.493784532856.issue30556@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 02:01:12 2022 From: report at bugs.python.org (Larry Hastings) Date: Sat, 05 Mar 2022 07:01:12 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646463672.85.0.997884940707.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: Jack O'Connor: > Was any of the experimental C extension code [...] useful to you? > I was wondering if it could be possible to copy blake3module.c from > there verbatim. I concede I didn't even look at it. The glue code to mate the library with the CPython runtime wasn't the hard part. And, Python has its own way of working (Argument Clinic etc). I did what seemed easiest, which was to start with CPython's BLAKE2 support and hack it up. Given that I had it working in maybe half a day, this seems reasonable. I should take a peek at your experimental build though, just to confirm I got the interfaces right. > The setup.py build there also has working Windows and NEON support. The CPython build process doesn't use setup.py to build extensions on Windows. I haven't looked recently, but back in the day they were built like any other DLL, using its own "project file". This will require someone to use the MSVS GUI to create a new project, add files, etc etc. I assume they can just use the .asm files for the SIMD extensions so hopefully this will be straightforward. As for NEON support, the technique I used theoretically should Just Work. I look forward to hearing back from someone building on ARM. (I have a cross-compiler setup for building for MiSTer, which is an ARM platform with NEON support. But the cross-compiler is a royal PITA to use... it's a Docker image, and requires a bunch of manual configuration, and I haven't touched any of that in more than a year.) You seem to have done at least a partial code review of my PR, given your comments to follow. I appreciate it! I tried to add you as a "reviewer" but GitHub wouldn't permit it--I assume this is some sort of permissions problem. Still, it'd be nice if you were able to do future code reviews using the GitHub review tool; are you permitted to use that for my PR? > - My derive_key_context parameter requires a string and refuses to > accept bytes. This is consistent with our Rust and C APIs (though the C > API does include a _raw version specifically for bindings, which we're > using here). I was considering going the other way with it actually, requiring bytes. Note that Python has first-class support for hard-coded bytes strings: b = blake3.blake3(derive_key_context=b"My Funny Valentine (1984)") The C interface takes "char *", not a "wchar_t *", and this seemed like the most direct and relatable way to reflect that. But I'm not militant about this, and I'm willing to change the interface to require an actual string (as in Unicode). I note that your C API already dictates that Unicode be encoded as UTF-8, so we can do that, and if the encoding fails the user can deal with it. > - I've included an `AUTO` constant that provides a special value (-1) > for the `max_threads` argument, and I explicitly don't support > `max_threads=0`. I can do that too; again, I prefer the 0 there, but I'm not militant about it. However, it would make sense to me if you had that constant somewhere in the BLAKE3 C .h files, which AFAICT you currently don't. > - I enforce that the `data` arguments are positional-only and that the > other keyword arguments are keyword-only. I think this is consistent > with the rest of hashlib. I suspect hashlib is mostly like that, due to being chock full of legacy code. But I don't see why that's necessary. I think permitting "data" to be a named argument is fine. So unless you have a strong conviction about it--which I bet you don't--I'll leave it as positional-or-keyword. There are rare circumstances where positional-only arguments are useful; this isn't one of them. > - I include a `.reset()` method. I don't mind adding that. > - Unrelated to tests: I haven't made any attempt to zero memory in my > `dealloc` function. But if that's what other hashlib functions do, > then I'm certainly in favor of doing it here too. I inherited that from the BLAKE2 code I carved up to make the BLAKE3 version. And yeah, it made sense to me, so I kept it. Christian Heimes: > GH-31686 is a massive patch set. I'm feeling uncomfortable adding > such much new code for a new hashing algorithm. Did you ask the > Steering Council for approval? I didn't. Like most hashing algorithms, BLAKE3 doesn't allocate memory and doesn't perform any I/O. All it does is meditate on the data you pass in, and write to various pre-allocated fixed-size buffers. As large codebases go this seems pretty harmless, almost inert. The Modules/_blake3/impl directory is about 32kloc. I note that the Modules/_blake2/impl directory you checked in in 2016 is about 21kloc, and you didn't require Steering Council (or BDFL) approval for that. As (former) Steering Council member Barry Warsaw says: JFDI! > The platform detection and compiler flag logic must be added to > configure.ac instead of setup.py. Erlend and I are in the process > of making setup.py optional. I plan to remove it entirely along > with distutils in 3.12. "must"? What empowers you to make such an edict? Currently extensions are built with setup.py, full stop. There are configuration settings in setup.py for extension modules--which my patch extends to support "blake3"--but none of the actual building work is done inside configure. My patch works within the current build system, and I see nothing inappropriate about how I solved the problem. Furthermore, I don't know anything about modifying configure.ac files, and I'm not going to learn it just to get this patch merged. If you feel strongly about it I encourage you to submit changes to my PR. Or, wait until the 3.12 development cycle, when you say you plan to rewrite it all anyway. But it's not necessary to move the platform detection and compiler flag logic into configure before merging my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:23:30 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 08:23:30 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1646468610.72.0.529742646411.issue45100@roundup.psfhosted.org> Alex Waygood added the comment: The latest plan sounds good to me. I have some Thoughts on the proposed API, but it will be easier to express those as part of a PR review. Looking forward to seeing the PR! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:26:53 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 08:26:53 +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: <1646468813.31.0.407686154258.issue43923@roundup.psfhosted.org> Alex Waygood added the comment: I actually have quite a few use cases for this feature. It's true that type checkers don't (yet) support it, but that doesn't mean that it should be disallowed at runtime. In fact, allowing it at runtime will surely give type checkers room to experiment with implementing this feature if it is requested by enough users. As it is, they are blocked from doing so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:28:20 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 08:28:20 +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: <1646468900.4.0.147514366117.issue43923@roundup.psfhosted.org> Alex Waygood added the comment: > Is there an actual use case that broke? No, because this was never usable in the first place. But there are those who wish it were usable :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:51:54 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 05 Mar 2022 08:51:54 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646470314.06.0.673697117157.issue39298@roundup.psfhosted.org> Christian Heimes added the comment: I didn't consult the steering council in 2016, because I lost the keys to the time machine. The very first SC election was in 2019. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 03:54:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 05 Mar 2022 08:54:07 +0000 Subject: [issue11352] Update cgi module doc In-Reply-To: <1298895261.86.0.965235067518.issue11352@psf.upfronthosting.co.za> Message-ID: <1646470447.46.0.995203910926.issue11352@roundup.psfhosted.org> Change by Irit Katriel : ---------- priority: high -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:06:46 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 09:06:46 +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: <1646471206.79.0.178662539753.issue43923@roundup.psfhosted.org> Serhiy Storchaka added the comment: Please don't revert all changes. It will not make it working right in any case. See issue44863 for more correct approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:07:17 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 09:07:17 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1646471237.41.0.531599817632.issue44863@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:23:59 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 05 Mar 2022 09:23:59 +0000 Subject: [issue46921] Vectorcall support for super() In-Reply-To: <1646412162.98.0.58372523798.issue46921@roundup.psfhosted.org> Message-ID: <1646472239.12.0.20736664471.issue46921@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:24:58 2022 From: report at bugs.python.org (Larry Hastings) Date: Sat, 05 Mar 2022 09:24:58 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1646472298.33.0.798500982141.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: Right, and I did say "(or BDFL)". Apparently you didn't bother to consult with the BDFL in advance, or at least not in the usual public venues--I haven't found a record of such a conversation on the bpo issue, nor in python-dev. BTW you simultaneously proposed adding SHA3/SHAKE. The total kloc for all this work was over 26k; you didn't mention any discomfort with the size of these patches at the time in public correspondance. In fact, quite the opposite. On 2016/05/28 you said: > I also don't get your obsession with lines of code. The gzip and expat > are far bigger than the KeccakCodePackage. https://mail.python.org/archives/list/python-dev at python.org/message/3YHVN2I74UQC36AVY5BGRJJUE4PMU6GX/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:28:11 2022 From: report at bugs.python.org (Jarek Potiuk) Date: Sat, 05 Mar 2022 09:28:11 +0000 Subject: [issue46925] Replace key if not identical to old key in dict In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646472491.41.0.725935894023.issue46925@roundup.psfhosted.org> Jarek Potiuk added the comment: How about if we make PR instead to the documentation about this behaviour? I think this behaviour is a little surprising (you need to know the internals of how WeakKeyDict keys are constructed and checked) and while I understand you do not want breaking change, maybe this should be explained to the users and example given how to apply the workaround? Just following the "least surprise" principle. ---------- nosy: +potiuk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:56:27 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 09:56:27 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1646474187.64.0.701731560715.issue44863@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 04:57:32 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 09:57:32 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1646474252.44.0.936683757534.issue44863@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +Jelle Zijlstra, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 05:18:42 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 10:18:42 +0000 Subject: [issue46927] Improve error message for subscripting non-generic types Message-ID: <1646475522.66.0.0981831027946.issue46927@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently, if you try to subscript a non-generic type you will get an error: >>> int[str] Traceback (most recent call last): File "", line 1, in TypeError: 'type' object is not subscriptable Yes, 'type' objects are usually not subscriptable, but list[str] works, and it is not clear from the error message for what type it is failed. The following PR changes an error message: >>> int[str] Traceback (most recent call last): File "", line 1, in TypeError: type 'int' is not subscriptable ---------- components: Interpreter Core messages: 414573 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Improve error message for subscripting non-generic types type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 05:23:14 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 10:23:14 +0000 Subject: [issue46927] Improve error message for subscripting non-generic types In-Reply-To: <1646475522.66.0.0981831027946.issue46927@roundup.psfhosted.org> Message-ID: <1646475794.69.0.426197268009.issue46927@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 05:25:20 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 10:25:20 +0000 Subject: [issue46927] Improve error message for subscripting non-generic types In-Reply-To: <1646475522.66.0.0981831027946.issue46927@roundup.psfhosted.org> Message-ID: <1646475920.09.0.720969394997.issue46927@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +29814 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31694 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 05:30:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 10:30:45 +0000 Subject: [issue46927] Improve error message for subscripting non-generic types In-Reply-To: <1646475522.66.0.0981831027946.issue46927@roundup.psfhosted.org> Message-ID: <1646476245.73.0.601023370687.issue46927@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 05:41:07 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 05 Mar 2022 10:41:07 +0000 Subject: [issue46928] type.__qualname__ ignores module name in tp_name for static types Message-ID: <1646476867.36.0.734336530708.issue46928@roundup.psfhosted.org> New submission from Ronald Oussoren : In a static type when the "tp_name" is set to a fully qualified name (such as "my.package.TypeName") the "__qualname__" returns the unqualified name ("TypeName") instead of the fully qualified name. The type's ``__name__`` and ``__module__`` have the expected value. This is IMHO a bug in the implementation of type_qualname in Objects/typeobject.c. Note that setting ``__qualname__`` in the types's ``__dict__`` doesn't work, that value is ignored. ---------- components: Interpreter Core messages: 414574 nosy: ronaldoussoren priority: normal severity: normal stage: test needed status: open title: type.__qualname__ ignores module name in tp_name for static types type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 06:54:58 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 05 Mar 2022 11:54:58 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646481298.57.0.44009344697.issue46917@roundup.psfhosted.org> Mark Dickinson added the comment: > * Mention the new build requirement in What's New in Python 3.11. > * Modify configure script to make it fail if the IEEE 754 support is missing. > * Remove code handling missing NAN and infinity: float("nan"), float("inf"), math.nan and math.inf are always available. That sounds fine. > * Remove @requires_IEEE_754 decorator of test.support and tests. I'd suggest leaving those decorators. Some of the tests are used by Python implementations other than CPython, and we're not requiring IEEE 754 on all Python implementations. > * Remove "unknown_format" code path of pack/unpack functions like _PyFloat_Pack8() (see bpo-46906 which proposes to make these functions public). Sounds fine. > platforms with float larger than 64-bit I'm assuming you mean Python "float" / C "double" here. There seems to be a persistent misunderstanding here, and I'd really like to be sure that everyone understands what the current code is doing before changing anything. There are *no* platforms that Python cares about where the C double is larger than 64-bits, and as far as I'm aware there never have been. What there *is* is a set of platforms where the C double is IEEE 754 binary64 format, but where arithmetic operations between doubles may be performed in extended precision (usually 64-bit precision), so those arithmetic operations don't conform strictly to IEEE 754 semantics. Most flavours of Linux on x86 match that description. Then there's a (possibly empty, but we don't know that for sure) subset of *that* set of platforms where we don't know how to temporarily enforce 53-bit precision during numeric parsing / formatting operations. It's that second subset where dtoa.c can't be used, and where we need the fallback of the "legacy" float repr. I'd be more than happy to deprecate and eventually remove support for the legacy float repr, but I think it's too big a change to make for 3.11: we'd need to deprecate the support for 3.11 and eventually remove it in 3.13. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 07:28:49 2022 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 05 Mar 2022 12:28:49 +0000 Subject: [issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value In-Reply-To: <1645270291.57.0.995603390679.issue46798@roundup.psfhosted.org> Message-ID: <1646483329.31.0.572343553041.issue46798@roundup.psfhosted.org> Change by Stefan Behnel : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 08:59:50 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 13:59:50 +0000 Subject: [issue46927] Improve error message for subscripting non-generic types In-Reply-To: <1646475522.66.0.0981831027946.issue46927@roundup.psfhosted.org> Message-ID: <1646488790.77.0.283920983912.issue46927@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ab9301a28fa431d7a32163126fc96de3b2ce6107 by Serhiy Storchaka in branch 'main': bpo-46927: Include the type's name in the error message for subscripting non-generic types (GH-31694) https://github.com/python/cpython/commit/ab9301a28fa431d7a32163126fc96de3b2ce6107 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 09:07:56 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 14:07:56 +0000 Subject: [issue46927] Improve error message for subscripting non-generic types In-Reply-To: <1646475522.66.0.0981831027946.issue46927@roundup.psfhosted.org> Message-ID: <1646489276.74.0.277266565649.issue46927@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 09:22:56 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 05 Mar 2022 14:22:56 +0000 Subject: [issue46921] Vectorcall support for super() In-Reply-To: <1646412162.98.0.58372523798.issue46921@roundup.psfhosted.org> Message-ID: <1646490176.12.0.554145429579.issue46921@roundup.psfhosted.org> Dong-hee Na added the comment: Mean +- std dev: [base] 254 ns +- 6 ns -> [vectorcall] 225 ns +- 1 ns: 1.13x faster ---------- Added file: https://bugs.python.org/file50657/bench_super.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 09:33:30 2022 From: report at bugs.python.org (ZhengYu, Xu) Date: Sat, 05 Mar 2022 14:33:30 +0000 Subject: [issue46929] __rrshift__ for same class obj will raise TypeError Message-ID: <1646490810.86.0.339104113044.issue46929@roundup.psfhosted.org> New submission from ZhengYu, Xu : ``` class C: def __rrshift__(self, v): return 1 C() >> C() # raise TypeError: unsupported operand types(s) for >>: 'C' and 'C' ``` ---------- messages: 414578 nosy: zen-xu priority: normal severity: normal status: open title: __rrshift__ for same class obj will raise TypeError type: behavior versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 09:35:27 2022 From: report at bugs.python.org (ZhengYu, Xu) Date: Sat, 05 Mar 2022 14:35:27 +0000 Subject: [issue46929] __rrshift__ for same class obj will raise TypeError In-Reply-To: <1646490810.86.0.339104113044.issue46929@roundup.psfhosted.org> Message-ID: <1646490927.78.0.116751120804.issue46929@roundup.psfhosted.org> ZhengYu, Xu added the comment: But with different classed will be right ``` class C: def __rrshift__(self, v): return 1 class D: def __rrshift__(self, v): return 2 C() >> D() # 2 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 09:59:39 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 05 Mar 2022 14:59:39 +0000 Subject: [issue46929] __rrshift__ for same class obj will raise TypeError In-Reply-To: <1646490810.86.0.339104113044.issue46929@roundup.psfhosted.org> Message-ID: <1646492379.9.0.438963284109.issue46929@roundup.psfhosted.org> Mark Dickinson added the comment: This is the intended behaviour. See the docs here: https://docs.python.org/3/reference/datamodel.html#object.__ror__ > These functions are only called if the left operand does not support the corresponding operation and the operands are of different types. There's a further explanation in a footnote: > For operands of the same type, it is assumed that if the non-reflected method ? such as __add__() ? fails then the overall operation is not supported, which is why the reflected method is not called. ---------- nosy: +mark.dickinson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 10:18:47 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 15:18:47 +0000 Subject: [issue46925] Document dict behavior when setting equal but not identical key In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646493527.49.0.0230543386617.issue46925@roundup.psfhosted.org> Jelle Zijlstra added the comment: Agree, I couldn't find a place where this behavior is documented. The second paragraph in https://docs.python.org/3.10/library/stdtypes.html#mapping-types-dict comes close. Reopening as a documentation issue. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python resolution: rejected -> stage: resolved -> needs patch status: closed -> open title: Replace key if not identical to old key in dict -> Document dict behavior when setting equal but not identical key versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 10:26:50 2022 From: report at bugs.python.org (Jacob Walls) Date: Sat, 05 Mar 2022 15:26:50 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646494010.42.0.0801548795484.issue43292@roundup.psfhosted.org> Change by Jacob Walls : ---------- keywords: +patch nosy: +jacobtylerwalls nosy_count: 4.0 -> 5.0 pull_requests: +29815 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 10:26:50 2022 From: report at bugs.python.org (Jacob Walls) Date: Sat, 05 Mar 2022 15:26:50 +0000 Subject: [issue25707] Add the close method for ElementTree.iterparse() object In-Reply-To: <1448287045.22.0.0931965485798.issue25707@psf.upfronthosting.co.za> Message-ID: <1646494010.5.0.781428100889.issue25707@roundup.psfhosted.org> Change by Jacob Walls : ---------- keywords: +patch nosy: +jacobtylerwalls nosy_count: 4.0 -> 5.0 pull_requests: +29816 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 10:33:42 2022 From: report at bugs.python.org (Fabian Zills) Date: Sat, 05 Mar 2022 15:33:42 +0000 Subject: [issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__ Message-ID: <1646494422.15.0.024229074835.issue46930@roundup.psfhosted.org> New submission from Fabian Zills : When iterating over __dict__ inside a classmethod, accessing __annotations causses RuntimeError: dictionary changed size during iteration. This only seems to affect Python 3.10.x on a Ubuntu system. The following can be used to reproduce this issue: class ExampleCls: @classmethod def iter_cls(cls): for name, val in cls.__dict__.items(): print(cls.__annotations__) This can be fixed for this Example by calling _ = cls.__annotations__ before iterating over the __dict__ ---------- messages: 414582 nosy: PythonF priority: normal severity: normal status: open title: Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__ type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 10:52:43 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 15:52:43 +0000 Subject: [issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__ In-Reply-To: <1646494422.15.0.024229074835.issue46930@roundup.psfhosted.org> Message-ID: <1646495563.41.0.269019710859.issue46930@roundup.psfhosted.org> Jelle Zijlstra added the comment: Can reproduce this: >>> ExampleCls.__dict__ mappingproxy({'__module__': '__main__', 'iter_cls': )>, '__dict__': , '__weakref__': , '__doc__': None}) >>> ExampleCls.iter_cls() {} Traceback (most recent call last): File "", line 1, in File "", line 4, in iter_cls RuntimeError: dictionary changed size during iteration >>> ExampleCls.__dict__ mappingproxy({'__module__': '__main__', 'iter_cls': )>, '__dict__': , '__weakref__': , '__doc__': None, '__annotations__': {}}) The descriptor for type.__annotations__ writes a new attribute into the class's dict if it doesn't exist yet. This was done in bpo-43901 / GH-25263. I don't see a way to fix this bug while preserving the behavior bpo-43901 was aiming for. ---------- nosy: +Jelle Zijlstra, larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:04:00 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 16:04:00 +0000 Subject: [issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__ In-Reply-To: <1646494422.15.0.024229074835.issue46930@roundup.psfhosted.org> Message-ID: <1646496240.88.0.0085966821702.issue46930@roundup.psfhosted.org> Change by Alex Waygood : ---------- type: crash -> behavior versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:08:04 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 05 Mar 2022 16:08:04 +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: <1646496484.45.0.643103450513.issue43923@roundup.psfhosted.org> Guido van Rossum added the comment: Can you be more specific about your use cases? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:21:28 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 05 Mar 2022 16:21:28 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646497288.75.0.793142630811.issue46920@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:49:09 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 16:49:09 +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: <1646498949.13.0.466630506897.issue43923@roundup.psfhosted.org> Alex Waygood added the comment: Consider the typeshed stub for `concurrent.futures.DoneAndNotDoneFutures`. At runtime this is a `collections.namedtuple`, but in the stub, we need it to be generic to allow precise type inference. But we can't have a generic NamedTuple, so the stub is currently this: ``` class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]): @property def done(self) -> set[Future[_T]]: ... @property def not_done(self) -> set[Future[_T]]: ... def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ... def __len__(self) -> int: ... @overload def __getitem__(self, __i: SupportsIndex) -> set[Future[_T]]: ... @overload def __getitem__(self, __s: slice) -> DoneAndNotDoneFutures[_T]: ... ``` Until two days ago, this stub actually had a bug: `done` and `not_done` were both given as writeable attributes, whereas they are read-only properties at runtime. With generic NamedTuples, we could write the stub for the class far more simply (and more accurately) like this: ``` class DoneAndNotDoneFutures(NamedTuple, Generic[_T]): done: set[Future[_T]] not_done: set[Future[_T]] ``` And in code that actually needs to run at runtime, I frequently find it frustrating that I have to use dataclasses instead of NamedTuples if I want a simple class that just happens to be generic. dataclasses are great, but for small, lightweight classes, I prefer to use NamedTuples where possible. I often find that I don't need to use the full range of features dataclasses provide; and NamedTuples are often more performant than dataclasses, especially in cases where there's a lot of tuple unpacking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:49:54 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Mar 2022 16:49:54 +0000 Subject: [issue46925] Document dict behavior when setting equal but not identical key In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646498994.88.0.185640276118.issue46925@roundup.psfhosted.org> Raymond Hettinger added the comment: The weakref docs in particular should point out the OP's example and highlight the workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:51:41 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 16:51:41 +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: <1646499101.76.0.337660060341.issue43923@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:55:35 2022 From: report at bugs.python.org (Stanley) Date: Sat, 05 Mar 2022 16:55:35 +0000 Subject: [issue9305] Don't use east/west of UTC in date/time documentation In-Reply-To: <1279556505.28.0.814004588201.issue9305@psf.upfronthosting.co.za> Message-ID: <1646499335.13.0.285972375632.issue9305@roundup.psfhosted.org> Change by Stanley : ---------- nosy: +slateny nosy_count: 14.0 -> 15.0 pull_requests: +29817 pull_request: https://github.com/python/cpython/pull/31697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 11:57:31 2022 From: report at bugs.python.org (mattip) Date: Sat, 05 Mar 2022 16:57:31 +0000 Subject: [issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs) In-Reply-To: <1645227388.68.0.727345462152.issue46794@roundup.psfhosted.org> Message-ID: <1646499451.48.0.199148848268.issue46794@roundup.psfhosted.org> mattip added the comment: > [T]he test has been removed in CPython pull request https://github.com/python/cpython/pull/31453/files Thanks, I missed that. Makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:05:27 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Mar 2022 17:05:27 +0000 Subject: [issue46928] type.__qualname__ ignores module name in tp_name for static types In-Reply-To: <1646476867.36.0.734336530708.issue46928@roundup.psfhosted.org> Message-ID: <1646499927.21.0.472565059407.issue46928@roundup.psfhosted.org> Serhiy Storchaka added the comment: What do you expect? The full qualified name of the object is __module__ + '.' + __qualname__. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:33:51 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 05 Mar 2022 17:33:51 +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: <1646501631.54.0.92074992024.issue43923@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, that's a sensible use case. I do doubt your intuition of preferring named tuples over dataclasses a bit. This seems to encourage premature optimization. I'd say for simple cases use plain tuples (most performant), for complex cases use dataclasses (named?fields and many other features that you may eventually want). Compare concurent.futures.wait()'s return type (a named tuple) to asyncio.tasks.wait()'s return type (a plain tuple). I don't think that naming the fields of the return tuple (awkwardly :-) makes the c.f.wait() API easier to understand than the asyncio.wait() API. Maybe named tuples, like typed dicts, are "in-between" solutions on the spectrum of data types (tuple - named tuple - dataclass; dict - typed dict - dataclass), and we should encourage people to use the neighboring solutions instead. I'd rather spend efforts making dataclasses faster than adding features to named tuples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:37:33 2022 From: report at bugs.python.org (Vertu Joe) Date: Sat, 05 Mar 2022 17:37:33 +0000 Subject: [issue46931] zipfile library will raise uncaught oserror when reading length incorrect zip file Message-ID: <1646501853.93.0.304321203932.issue46931@roundup.psfhosted.org> New submission from Vertu Joe : I intentionally made some corrupted zip archive files for testing. If some contents were removed from the archive instead of changing the bits. when trying to read such files, the zipfile will raise an uncaught OSError, instead of a badzipfile error as expected. os is windows 10 x64 not sure if this also happens on the UNIX system or it's intended to be happen. code: import zipfile with zipfile.ZipFile(r'damaged.zip') as dmg: dmg.testzip() result: OSError [Errno 22] Invalid argument File "test.py", line 20, in file = dmg.testzip() ---------- components: Library (Lib) files: damaged.zip messages: 414590 nosy: ultimalium priority: normal severity: normal status: open title: zipfile library will raise uncaught oserror when reading length incorrect zip file type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50658/damaged.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 12:53:23 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 05 Mar 2022 17:53:23 +0000 Subject: [issue46414] Add typing.reveal_type In-Reply-To: <1642431742.97.0.220350932108.issue46414@roundup.psfhosted.org> Message-ID: <1646502803.4.0.706165718948.issue46414@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 13:03:18 2022 From: report at bugs.python.org (sping) Date: Sat, 05 Mar 2022 18:03:18 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix Message-ID: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> New submission from sping : Hi! I believe the fix documented at https://github.com/libexpat/libexpat/blob/27d5b8ba1771f916d9cfea2aac6bdac72071dc66/expat/Changes#L7-L11 is important to users of CPython. Please update bundled libexpat to 2.4.7. Thank you! Best, Sebastian ---------- components: XML messages: 414591 nosy: sping priority: normal severity: normal status: open title: Please update bundled libexpat to 2.4.7 with an important fix 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 Sat Mar 5 13:04:48 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 05 Mar 2022 18:04:48 +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: <1646503488.98.0.950004848605.issue43923@roundup.psfhosted.org> Alex Waygood added the comment: I sense we'll have to agree to disagree on the usefulness of NamedTuples in the age of dataclasses :) For me, I find the simplicity of the underlying idea behind namedtuples ? "tuples with some properties bolted on" ? very attractive. Yes, standard tuples are more performant, but it's great to have a tool in the arsenal that's essentially the same as a tuple (and is backwards-compatible with a tuple, for APIs that require a tuple), but can also, like dataclasses, be self-documenting. (You're right that DoneAndNotDoneFutures isn't a great example of this.) But I agree that this shouldn't be a priority if it's hard to accomplish; and there'll certainly be no complaints from me if energy is invested into making dataclasses faster. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 13:28:25 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 05 Mar 2022 18:28:25 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1646504905.09.0.208822684409.issue45847@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +29818 pull_request: https://github.com/python/cpython/pull/31698 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 13:41:34 2022 From: report at bugs.python.org (Thomas Grainger) Date: Sat, 05 Mar 2022 18:41:34 +0000 Subject: [issue43923] Can't create generic NamedTuple as of py3.9 In-Reply-To: <1646503488.98.0.950004848605.issue43923@roundup.psfhosted.org> Message-ID: Thomas Grainger added the comment: The main advantage for my usecase is support for heterogeneous unpacking On Sat, Mar 5, 2022, 6:04 PM Alex Waygood wrote: > > Alex Waygood added the comment: > > I sense we'll have to agree to disagree on the usefulness of NamedTuples > in the age of dataclasses :) > > For me, I find the simplicity of the underlying idea behind namedtuples ? > "tuples with some properties bolted on" ? very attractive. Yes, standard > tuples are more performant, but it's great to have a tool in the arsenal > that's essentially the same as a tuple (and is backwards-compatible with a > tuple, for APIs that require a tuple), but can also, like dataclasses, be > self-documenting. (You're right that DoneAndNotDoneFutures isn't a great > example of this.) > > But I agree that this shouldn't be a priority if it's hard to accomplish; > and there'll certainly be no complaints from me if energy is invested into > making dataclasses faster. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 14:56:22 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 05 Mar 2022 19:56:22 +0000 Subject: [issue46928] type.__qualname__ ignores module name in tp_name for static types In-Reply-To: <1646476867.36.0.734336530708.issue46928@roundup.psfhosted.org> Message-ID: <1646510182.92.0.257563913435.issue46928@roundup.psfhosted.org> Ronald Oussoren added the comment: You're right. I was sure that __qualname__ included the module name, but PEP 3155 is clear about actual semantics. Sorry about the noise. ---------- resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 15:33:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 05 Mar 2022 20:33:38 +0000 Subject: [issue45582] Rewrite getpath.c in Python In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org> Message-ID: <1646512418.05.0.094351701542.issue45582@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29819 pull_request: https://github.com/python/cpython/pull/31699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 15:50:25 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 05 Mar 2022 20:50:25 +0000 Subject: [issue46933] Make pwd module optional for wasm32-emscripten and wasi Message-ID: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> New submission from Christian Heimes : WebAssembly platforms like wasm32-emscripten and wasm32-wasi don't have a typical user and group database. WASI platform does not provide necessary API functions at all. Emscripten provides dummy stubs. On Emscripten the pwd module compiles, but is non-functional: Python 3.11.0a4+ (heads/main-dirty:b1a3446, Jan 25 2022, 10:19:07) [Clang 14.0.0 (https://github.com/llvm/llvm-project f142c45f1e494f8dbdcc1bcf1412 on emscripten Type "help", "copyright", "credits" or "license" for more information. >>> import pwd, os >>> os.getuid() 0 >>> pwd.getpwall() [] >>> pwd.getpwuid(os.getuid()) Traceback (most recent call last): File "", line 1, in KeyError: 'getpwuid(): uid not found: 0' I propose to make the pwd optional and catch import error in few places where the pwd module is used to look up user home directory. ---------- assignee: christian.heimes components: Library (Lib) messages: 414595 nosy: christian.heimes priority: normal severity: normal status: open title: Make pwd module optional for wasm32-emscripten and wasi type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 15:58:28 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 05 Mar 2022 20:58:28 +0000 Subject: [issue46933] Make pwd module optional for wasm32-emscripten and wasi In-Reply-To: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> Message-ID: <1646513908.81.0.136200023395.issue46933@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +29820 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31700 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 15:59:40 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 05 Mar 2022 20:59:40 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646513980.72.0.12177018202.issue46920@roundup.psfhosted.org> Oleg Iarygin added the comment: I reverted my changes in Modules/_ctypes/libffi_osx/x86/x86-ffi64.c and Modules/_decimal/libmpdec/*step.c to not disturb third-party vendored libraries. As a result, macOS component is no longer affected along with the corresponding experts in a nosy list. ---------- components: -macOS nosy: -ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 17:19:15 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sat, 05 Mar 2022 22:19:15 +0000 Subject: [issue46934] A started multiprocessing.Process instance cannot be serialised Message-ID: <1646518755.67.0.655660314231.issue46934@roundup.psfhosted.org> New submission from G?ry : The Python program: ``` import multiprocessing import time class Application: def __init__(self): self._event = multiprocessing.Event() self._processes = [ multiprocessing.Process(target=self._worker) for _ in range(multiprocessing.cpu_count())] def _worker(self): while not self._event.is_set(): print(multiprocessing.current_process().name) time.sleep(1) def start(self): for process in self._processes: print('starting') process.start() def stop(self): self._event.set() for process in self._processes: process.join() if __name__ == '__main__': application = Application() application.start() time.sleep(3) application.stop() ``` Its output: ```none starting starting Traceback (most recent call last): File "/Users/maggyero/Desktop/application.py", line 31, in application.start() File "/Users/maggyero/Desktop/application.py", line 21, in start process.start() File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle 'weakref' object Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/spawn.py", line 126, in _main self = reduction.pickle.load(from_parent) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/synchronize.py", line 110, in __setstate__ self._semlock = _multiprocessing.SemLock._rebuild(*state) FileNotFoundError: [Errno 2] No such file or directory ``` In the function `Application.__init__`, each call `multiprocessing.Process(target=self._worker)` initializes a `multiprocessing.Process` instance with the instance method `self._worker` as its `target` argument. `self._worker` is bound to `self` which has the instance attribute `self._processes`. In the function `Application.start`, each call `process.start()` serialises the `target` argument and therefore `self._processes`. `self._processes` is a list of `multiprocessing.Process` instances, initially not started yet. The first call `process.start()` starts the first `multiprocessing.Process` instance in that list without issue, but the second call `process.start()` fails. So a started `multiprocessing.Process` instance cannot be serialised. The root of the problem is that the `start` method of a `multiprocessing.Process` instance sets its `_popen` instance attribute to a `multiprocessing.popen_*.Popen` instance. The initialization of that instance performs these two steps (among others): 1. For a `multiprocessing.popen_spawn_posix.Popen` instance, a `multiprocessing.popen_spawn_win32.Popen` instance, or a `multiprocessing.popen_forkserver.Popen` instance but not a `multiprocessing.popen_fork.Popen` instance (i.e. for the start method `'spawn'` or the start method `'forkserver'` but not the start method `'fork'`), it [serialises](https://github.com/python/cpython/blob/v3.10.2/Lib/multiprocessing/popen_spawn_posix.py#L47) the `multiprocessing.Process` instance for writing it to the end of the pipe used by the parent process to communicate with the child process so that the child process can execute the `run` method of the `multiprocessing.Process` instance. 2. It [sets](https://github.com/python/cpython/blob/v3.10.2/Lib/multiprocessing/popen_spawn_posix.py#L68) its `finalizer` instance attribute to a `multiprocessing.util.Finalize` instance which itself sets its `_weakref` instance attribute to a `weakref.ref` instance for closing at interpreter exit the ends of the pipes used by the parent process to communicate with the child process. In other words, it makes the `multiprocessing.Process` instance hold a weak reference. Thus if a `multiprocessing.Process` instance holds a reference to a started `multiprocessing.Process` instance then it holds a weak reference (point 2), so starting it will fail since it will serialise (point 1) the weak reference and weak references are not serialisable: ``` import multiprocessing if __name__ == '__main__': multiprocessing.set_start_method('spawn') # or 'forkserver' but not 'fork' process_a = multiprocessing.Process() process_b = multiprocessing.Process() process_b.foo = process_a process_a.start() # creates process_a._popen.finalizer._weakref process_b.start() # TypeError: cannot pickle 'weakref' object ``` A minimal Python program showing the serialisation issue: ``` import pickle import weakref pickle.dumps(weakref.ref(int)) # TypeError: cannot pickle 'weakref' object ``` ---------- components: Library (Lib) messages: 414597 nosy: maggyero priority: normal severity: normal status: open title: A started multiprocessing.Process instance cannot be serialised type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 17:20:26 2022 From: report at bugs.python.org (Jameel Al-Aziz) Date: Sat, 05 Mar 2022 22:20:26 +0000 Subject: [issue38364] inspect.iscoroutinefunction / isgeneratorfunction / isasyncgenfunction can't handle partialmethod objects In-Reply-To: <1570109324.07.0.792957059658.issue38364@roundup.psfhosted.org> Message-ID: <1646518826.36.0.754834805912.issue38364@roundup.psfhosted.org> Jameel Al-Aziz added the comment: I've recently ran into this via unittest.mock.patch.object. Mocking an asynchronous partial method returns MagicMock and not AsyncMagicMock, causing some pretty hard to debug failures. ---------- nosy: +me3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 17:26:32 2022 From: report at bugs.python.org (Max Bachmann) Date: Sat, 05 Mar 2022 22:26:32 +0000 Subject: [issue46935] import of submodule polutes global namespace Message-ID: <1646519192.38.0.0729050305481.issue46935@roundup.psfhosted.org> New submission from Max Bachmann : In my environment I installed the following two libraries: ``` pip install rapidfuzz pip install python-Levenshtein ``` Those two libraries have the following structures: rapidfuzz |-distance |- __init__.py (from . import Levenshtein) |- Levenshtein.*.so |-__init__.py (from rapidfuzz import distance) Levenshtein |-__init__.py When importing Levenshtein first everything behaves as expected: ``` >>> import Levenshtein >>> Levenshtein. Levenshtein.apply_edit( Levenshtein.jaro_winkler( Levenshtein.ratio( Levenshtein.distance( Levenshtein.matching_blocks( Levenshtein.seqratio( Levenshtein.editops( Levenshtein.median( Levenshtein.setmedian( Levenshtein.hamming( Levenshtein.median_improve( Levenshtein.setratio( Levenshtein.inverse( Levenshtein.opcodes( Levenshtein.subtract_edit( Levenshtein.jaro( Levenshtein.quickmedian( >>> import rapidfuzz >>> Levenshtein. Levenshtein.apply_edit( Levenshtein.jaro_winkler( Levenshtein.ratio( Levenshtein.distance( Levenshtein.matching_blocks( Levenshtein.seqratio( Levenshtein.editops( Levenshtein.median( Levenshtein.setmedian( Levenshtein.hamming( Levenshtein.median_improve( Levenshtein.setratio( Levenshtein.inverse( Levenshtein.opcodes( Levenshtein.subtract_edit( Levenshtein.jaro( Levenshtein.quickmedian( ``` However when importing rapidfuzz first it import `rapidfuzz.distance.Levenshtein` when running `import Levenshtein` ``` >>> import rapidfuzz >>> Levenshtein Traceback (most recent call last): File "", line 1, in NameError: name 'Levenshtein' is not defined >>> import Levenshtein >>> Levenshtein. Levenshtein.array( Levenshtein.normalized_distance( Levenshtein.similarity( Levenshtein.distance( Levenshtein.normalized_similarity( Levenshtein.editops( Levenshtein.opcodes( ``` My expectation was that in both cases `import Levenshtein` should import the `Levenshtein` module. I could reproduce this behavior on all Python versions I had available (Python3.8 - Python3.10) on Ubuntu and Fedora. ---------- components: Interpreter Core messages: 414599 nosy: maxbachmann priority: normal severity: normal status: open title: import of submodule polutes global namespace type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 17:48:08 2022 From: report at bugs.python.org (Jameel A.) Date: Sat, 05 Mar 2022 22:48:08 +0000 Subject: [issue38364] inspect.iscoroutinefunction / isgeneratorfunction / isasyncgenfunction can't handle partialmethod objects In-Reply-To: <1570109324.07.0.792957059658.issue38364@roundup.psfhosted.org> Message-ID: <1646520488.15.0.731031113862.issue38364@roundup.psfhosted.org> Change by Jameel A. : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 18:10:53 2022 From: report at bugs.python.org (Max Bachmann) Date: Sat, 05 Mar 2022 23:10:53 +0000 Subject: [issue46935] import of submodule polutes global namespace In-Reply-To: <1646519192.38.0.0729050305481.issue46935@roundup.psfhosted.org> Message-ID: <1646521853.49.0.782047766895.issue46935@roundup.psfhosted.org> Max Bachmann added the comment: It appears this only occurs when a C Extension is involved. When the so is imported first it is preferred over the .py file that the user would like to import. I could not find any documentation on this behavior, so I assume that this is not the intended. My current workaround is the usage of a unique name for the C Extension and the importing everything from a Python file with the corresponding name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 18:17:52 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sat, 05 Mar 2022 23:17:52 +0000 Subject: [issue46934] A started multiprocessing.Process instance cannot be serialised In-Reply-To: <1646518755.67.0.655660314231.issue46934@roundup.psfhosted.org> Message-ID: <1646522272.09.0.959968676985.issue46934@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +29821 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 18:19:58 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sat, 05 Mar 2022 23:19:58 +0000 Subject: [issue46934] Started multiprocessing.Process instances are unserialisable In-Reply-To: <1646518755.67.0.655660314231.issue46934@roundup.psfhosted.org> Message-ID: <1646522398.66.0.652087708856.issue46934@roundup.psfhosted.org> Change by G?ry : ---------- title: A started multiprocessing.Process instance cannot be serialised -> Started multiprocessing.Process instances are unserialisable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 18:46:14 2022 From: report at bugs.python.org (Yudi Levi) Date: Sat, 05 Mar 2022 23:46:14 +0000 Subject: [issue40172] ZipInfo corrupts file names in some old zip archives In-Reply-To: <1585925740.74.0.493426565247.issue40172@roundup.psfhosted.org> Message-ID: <1646523974.2.0.823656541054.issue40172@roundup.psfhosted.org> Yudi Levi added the comment: The main issue is that when extracting older zip files, files are actually written to disk with corrupted (altered) names. Unfortunately it's been a while since I saw this issue and I can't tell if it was fixed or if I simply can't reproduce it. I do see that encoding/decoding in ZipInfo is still inconsistent, sometimes uses ascii codepage and sometimes uses cp437 codepage which seems wrong to me. Not sure how we should handle it but I think that switching the default ascii encoding to cp437 to be consistent with the old implementation (and with the filename decoding) seems like the right way to go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 18:50:12 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 05 Mar 2022 23:50:12 +0000 Subject: [issue46911] Early tracing has lineno=None for modules In-Reply-To: <1646314619.94.0.770147890842.issue46911@roundup.psfhosted.org> Message-ID: <1646524212.51.0.119111624394.issue46911@roundup.psfhosted.org> Ned Batchelder added the comment: Maybe I'm missing something during normal execution, but I'm only seeing this effect now during this super-early encodings.py trick. I don't mind just special-casing the Nones in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 21:21:56 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 06 Mar 2022 02:21:56 +0000 Subject: [issue46935] import of submodule polutes global namespace In-Reply-To: <1646519192.38.0.0729050305481.issue46935@roundup.psfhosted.org> Message-ID: <1646533316.08.0.757790499385.issue46935@roundup.psfhosted.org> Dennis Sweeney added the comment: This might be something that rapidfuzz can fix, rather than CPython. In whatever import process rapidfuzz uses, it populates sys.modules with a module named `Levenshtein` in addition to 'rapidfuzz.distance.Levenshtein'. You might be able to request that they change something there. Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> m1 = set(sys.modules.keys()) >>> import numpy >>> m2 = set(sys.modules.keys()) >>> import rapidfuzz >>> m3 = set(sys.modules.keys()) >>> m2 - m1 {'posixpath', 'numpy.random._pcg64', 'numpy.fft._pocketfft_internal', 'numpy.core._dtype', 'cython_runtime', 'numpy.random._sfc64', 'urllib', 'numpy.core.einsumfunc', 'sre_parse', 'numpy.polynomial.laguerre', 'numpy.fft._pocketfft', 'numpy.lib._iotools', 'numpy.core._exceptions', 'numpy.random._pickle', 'numpy.lib.twodim_base', 'numpy.polynomial._polybase', 'numpy.lib._datasource', 'copyreg', 'numpy.random._philox', '_ctypes', 'numpy.core._ufunc_config', 'platform', 'numpy.lib.histograms', 'numpy.lib.mixins', 'numpy.core._asarray', 'numpy.polynomial.legendre', 'numpy.polynomial.polyutils', 'subprocess', 'fnmatch', 'numpy.ctypeslib', 'ast', 'sre_compile', 'json.scanner', 'numpy.core.arrayprint', 'textwrap', 'numpy.core.multiarray', 'datetime', 'inspect', 'numpy.core.function_base', 'hmac', 'numpy.lib.utils', '_json', 'signal', 'numpy.core.machar', 'numpy.ma.core', 'pathlib', 'numbers', 'numpy.core._methods', 'numpy.lib.type_check', 'numpy.core.defchararray', 'numpy.core.getlimits', 'numpy.lib.ufunclike', 'numpy.version', 'select', '_sre', 'numpy.core._dtype_ctypes', 'numpy.lib.arrayterator', 'random', '_blake2', 'numpy.fft', 'token', 'numpy.core._string_helpers', 'numpy', '_hashlib', 'opcode', 'tokenize', 'numpy.random._bounded_integers', 'numpy.random.mtrand', 'ctypes._endian', '_weakrefset', 'numpy.ma', 'numpy.lib.nanfunctions', '_random', 'numpy.lib.function_base', '_sha512', 'bisect', 'numpy.core.records', 'numpy._globals', '_compat_pickle', 'urllib.parse', 'numpy.random.bit_generator', 'numpy.linalg._umath_linalg', 'numpy.core._add_newdocs_scalars', 'numpy.polynomial.hermite', 'base64', 'numpy.linalg.linalg', 'numpy.core._multiarray_tests', '_cython_0_29_24', 'hashlib', '_struct', 'numpy.lib.arraypad', 'numpy.core', 'msvcrt', 'numpy.ma.extras', 'numpy.lib.index_tricks', '_locale', 'numpy.lib.shape_base', 'numpy.compat._inspect', 'numpy.polynomial.hermite_e', 'pickle', 'numpy._distributor_init', 'numpy.lib._version', '_datetime', 'secrets', 'numpy.lib.polynomial', 'numpy.core.numerictypes', '_ast', 'numpy.lib.scimath', '_winapi', 'numpy.matrixlib.defmatrix', '_socket', 'numpy.core.shape_base', 'numpy.lib.format', 'dis', 'numpy.core._multiarray_umath', 'weakref', 'numpy.compat.py3k', 'json', 'numpy.core.umath', 'numpy.core.numeric', 'numpy.core.memmap', 'sre_constants', 'numpy.compat', 'numpy.core._add_newdocs', 'numpy.polynomial.chebyshev', 'math', 'numpy.random._common', 'numpy.linalg', 'numpy.random', 're', 'threading', 'numpy._pytesttester', '_bisect', 'collections.abc', 'socket', 'numpy.lib.stride_tricks', 'linecache', 'numpy.lib', 'numpy.fft.helper', 'numpy.core.fromnumeric', 'json.encoder', 'numpy.linalg.lapack_lite', 'selectors', 'numpy.polynomial', 'numpy.core._internal', 'numpy.__config__', 'numpy.polynomial.polynomial', 'numpy._version', 'errno', 'struct', 'ctypes', 'numpy.random._mt19937', 'binascii', 'numpy.lib.npyio', 'numpy.random._generator', 'numpy.lib.arraysetops', 'numpy.matrixlib', '_opcode', 'json.decoder', 'numpy.core._type_aliases', 'enum', 'numpy.core.overrides', '_pickle'} >>> m3 - m2 {'rapidfuzz.process', 'rapidfuzz.cpp_process', 'rapidfuzz.string_metric', 'rapidfuzz.distance.Levenshtein', 'rapidfuzz.cpp_utils', 'rapidfuzz.cpp_process_cdist', 'cpp_utils', 'cpp_process_cdist', 'rapidfuzz', 'Jaro', '_heapq', 'rapidfuzz.distance.JaroWinkler', 'cpp_fuzz', 'rapidfuzz.distance.Hamming', '_cython_3_0_0a10', 'rapidfuzz.utils', 'cpp_process', 'Hamming', 'rapidfuzz.distance', 'rapidfuzz.distance.Jaro', 'JaroWinkler', '_initialize', 'rapidfuzz.cpp_fuzz', 'cpp_string_metric', 'rapidfuzz.distance._initialize', 'rapidfuzz.distance.Indel', 'rapidfuzz.fuzz', 'Levenshtein', 'heapq', 'Indel', 'array', 'rapidfuzz.cpp_string_metric'} >>> sys.modules['rapidfuzz.distance.Levenshtein'] is sys.modules['Levenshtein'] True A temporary workaround could be to delete `sys.modules['Levenshtein']`: >>> import rapidfuzz >>> del sys.modules['Levenshtein'] >>> import Levenshtein >>> Levenshtein.__file__ # not the rapidfuzz one 'C:\\Users\\sween\\AppData\\Roaming\\Python\\Python310\\site-packages\\Levenshtein\\__init__.py' ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 21:36:38 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 06 Mar 2022 02:36:38 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1646534198.23.0.523300527146.issue37609@roundup.psfhosted.org> Barney Gale added the comment: I'd like to pick this up, as it would allow us to remove a duplicate implementation in pathlib with its own shortcomings. If using native functionality if difficult to get right, could I put @eryksun's splitdrive.py implementation up for review? ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 21:39:25 2022 From: report at bugs.python.org (Inada Naoki) Date: Sun, 06 Mar 2022 02:39:25 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1646534365.44.0.902915211342.issue46864@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 21:39:32 2022 From: report at bugs.python.org (Inada Naoki) Date: Sun, 06 Mar 2022 02:39:32 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1646534372.9.0.914955434629.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 2d8b764210c8de10893665aaeec8277b687975cd by Inada Naoki in branch 'main': bpo-46864: Deprecate PyBytesObject.ob_shash. (GH-31598) https://github.com/python/cpython/commit/2d8b764210c8de10893665aaeec8277b687975cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 5 22:51:12 2022 From: report at bugs.python.org (Jon Parise) Date: Sun, 06 Mar 2022 03:51:12 +0000 Subject: [issue40512] [subinterpreters] Meta issue: per-interpreter GIL In-Reply-To: <1588683075.13.0.0239787407564.issue40512@roundup.psfhosted.org> Message-ID: <1646538672.92.0.104367679651.issue40512@roundup.psfhosted.org> Change by Jon Parise : ---------- nosy: +jon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 01:21:59 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 06 Mar 2022 06:21:59 +0000 Subject: [issue46921] Vectorcall support for super() In-Reply-To: <1646412162.98.0.58372523798.issue46921@roundup.psfhosted.org> Message-ID: <1646547719.76.0.945076263158.issue46921@roundup.psfhosted.org> Ken Jin added the comment: New changeset 602024e6e12c69d836aa191d63db75862aec2493 by Ken Jin in branch 'main': bpo-46921: Vectorcall support for `super()` (GH-31687) https://github.com/python/cpython/commit/602024e6e12c69d836aa191d63db75862aec2493 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:09:23 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 06 Mar 2022 07:09:23 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1646550563.99.0.0741188523368.issue37609@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +29822 pull_request: https://github.com/python/cpython/pull/31702 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 02:18:37 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 06 Mar 2022 07:18:37 +0000 Subject: [issue46921] Vectorcall support for super() In-Reply-To: <1646412162.98.0.58372523798.issue46921@roundup.psfhosted.org> Message-ID: <1646551117.71.0.778369149733.issue46921@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 03:19:15 2022 From: report at bugs.python.org (Malthe Borch) Date: Sun, 06 Mar 2022 08:19:15 +0000 Subject: [issue46925] Document dict behavior when setting equal but not identical key In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646554755.41.0.705110752941.issue46925@roundup.psfhosted.org> Malthe Borch added the comment: Java's HashMap has also the (current) Python behavior. An existing same key is not replaced. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 03:39:25 2022 From: report at bugs.python.org (Luca) Date: Sun, 06 Mar 2022 08:39:25 +0000 Subject: [issue46936] Fix grammar_grapher with the new forced directive Message-ID: <1646555965.39.0.197872234422.issue46936@roundup.psfhosted.org> New submission from Luca : The grammar_grapher.py utility has not been updated after the introduction of the new "forced" directive ('&&') in the grammar (see https://github.com/python/cpython/pull/24292) and fails to visualize the current Python grammar. ---------- components: Parser messages: 414608 nosy: lucach, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Fix grammar_grapher with the new forced directive _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 03:40:14 2022 From: report at bugs.python.org (Luca) Date: Sun, 06 Mar 2022 08:40:14 +0000 Subject: [issue46936] Fix grammar_grapher with the new forced directive In-Reply-To: <1646555965.39.0.197872234422.issue46936@roundup.psfhosted.org> Message-ID: <1646556014.47.0.761831345638.issue46936@roundup.psfhosted.org> Change by Luca : ---------- keywords: +patch pull_requests: +29823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 03:50:50 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 06 Mar 2022 08:50:50 +0000 Subject: [issue46937] convert remaining functions to AC in _weakref Message-ID: <1646556650.89.0.985996387629.issue46937@roundup.psfhosted.org> New submission from Kumar Aditya : Convert remaining functions to AC in _weakref so that they use the FASTCALL calling convection. ---------- messages: 414609 nosy: kumaraditya303 priority: normal severity: normal status: open title: convert remaining functions to AC in _weakref versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 03:51:12 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 06 Mar 2022 08:51:12 +0000 Subject: [issue46937] convert remaining functions to AC in _weakref In-Reply-To: <1646556650.89.0.985996387629.issue46937@roundup.psfhosted.org> Message-ID: <1646556672.54.0.294834640957.issue46937@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +29825 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 04:04:19 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 06 Mar 2022 09:04:19 +0000 Subject: [issue46937] convert remaining functions to AC in _weakref In-Reply-To: <1646556650.89.0.985996387629.issue46937@roundup.psfhosted.org> Message-ID: <1646557459.51.0.664881523631.issue46937@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 04:38:05 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 06 Mar 2022 09:38:05 +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: <1646559485.6.0.425666402178.issue43447@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 04:44:58 2022 From: report at bugs.python.org (Patric Gustavsson) Date: Sun, 06 Mar 2022 09:44:58 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1646559898.91.0.546850402697.issue46461@roundup.psfhosted.org> Patric Gustavsson added the comment: any update on this? can i do something more to help? BR Patric ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:15:49 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 06 Mar 2022 10:15:49 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1646561749.71.0.940416572026.issue46461@roundup.psfhosted.org> Eric V. Smith added the comment: I don?t have Ubuntu to test on. Plus the steps to reproduce are too much for the average volunteer to work through. I don?t think we?ll be able to help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 05:22:14 2022 From: report at bugs.python.org (Jacob Nilsson) Date: Sun, 06 Mar 2022 10:22:14 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1646562134.45.0.741993036357.issue46461@roundup.psfhosted.org> Jacob Nilsson added the comment: >From Kodi GH issues, they suspect is related to the work on subinterpreters https://github.com/xbmc/xbmc/issues/19961#issuecomment-1008151611: "The bulk of this issue is due to how python and it's modules handle sub interpreters. There are several open python bpos and have been many prs to cpython to handle sub interpreters better, but it's still very much a work in progress. All C modules are/were being updated to what they call multi phase init, which essentially moves away from static init of members. Sub interpreters can modify these static members which can cause other sub interpreter states to crash horribly. For the user with the SSL crash running python 3.9, if you go to 3.10, the SSL module was converted to multiphase init, and shouldn't crash in the same manner for that particular module. However not all modules are converted still, so there are still failure points on other modules. This is a cpython issue, and there's not much we can do but wait for it to be resolved in cpython" ---------- nosy: +ajoino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:02:32 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 06 Mar 2022 11:02:32 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1646564552.91.0.946024476064.issue37609@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg390391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:34:34 2022 From: report at bugs.python.org (Bar Harel) Date: Sun, 06 Mar 2022 11:34:34 +0000 Subject: [issue46938] dataclass __post_init__ recursion Message-ID: <1646566474.17.0.0323337902851.issue46938@roundup.psfhosted.org> New submission from Bar Harel : Not sure if a continuance of https://bugs.python.org/issue44365 or not, but the suggestion to call super().__init__() in __post__init__ will cause infinite recursion if the superclass also contains __post__init__: >>> @d ... class A: ... test: int ... def __post_init__(self): ... pass >>> @d ... class B(A): ... test2: int ... def __post_init__(self): ... super().__init__(test=1) >>> B(test2=1, test=3) <-- infinite recursion. This is caused by line 564 (https://github.com/python/cpython/blob/4716f70c8543d12d18c64677af650d479b99edac/Lib/dataclasses.py#L564) checking for post init on current class, and calling it on self (child class). Not sure if the bug is in the documentation/suggestion, or if it's a bug in the implementation, in which case we need to call the current class's __post_init__. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 414613 nosy: bar.harel, docs at python priority: normal severity: normal status: open title: dataclass __post_init__ recursion type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:49:47 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 06 Mar 2022 11:49:47 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1646567387.7.0.121188764805.issue14156@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset eafec26ae5327bb23b6dace2650b074c3327dfa0 by MojoVampire in branch 'main': bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165) https://github.com/python/cpython/commit/eafec26ae5327bb23b6dace2650b074c3327dfa0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:50:05 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Mar 2022 11:50:05 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1646567405.49.0.53720977954.issue14156@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 17.0 -> 18.0 pull_requests: +29826 pull_request: https://github.com/python/cpython/pull/31706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 06:57:13 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 06 Mar 2022 11:57:13 +0000 Subject: [issue46938] dataclass __post_init__ recursion In-Reply-To: <1646566474.17.0.0323337902851.issue46938@roundup.psfhosted.org> Message-ID: <1646567833.34.0.791246113395.issue46938@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:12:12 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Mar 2022 12:12:12 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1646568732.59.0.49616892537.issue14156@roundup.psfhosted.org> miss-islington added the comment: New changeset ee18df425209cfa4f394b57220177c168fc3a1da by Miss Islington (bot) in branch '3.10': bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165) https://github.com/python/cpython/commit/ee18df425209cfa4f394b57220177c168fc3a1da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:17:17 2022 From: report at bugs.python.org (Mark Shannon) Date: Sun, 06 Mar 2022 12:17:17 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646569037.26.0.0667846314193.issue46903@roundup.psfhosted.org> Mark Shannon added the comment: Ronald, does PR 31658 fix your issue? ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 07:20:08 2022 From: report at bugs.python.org (Max Bachmann) Date: Sun, 06 Mar 2022 12:20:08 +0000 Subject: [issue46935] import of submodule polutes global namespace In-Reply-To: <1646519192.38.0.0729050305481.issue46935@roundup.psfhosted.org> Message-ID: <1646569208.0.0.15315349719.issue46935@roundup.psfhosted.org> Max Bachmann added the comment: Thanks Dennis. This helped me track down the issue in rapidfuzz. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 08:01:10 2022 From: report at bugs.python.org (Adhika Setya Pramudita) Date: Sun, 06 Mar 2022 13:01:10 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1646571670.76.0.912882321478.issue43253@roundup.psfhosted.org> Change by Adhika Setya Pramudita : ---------- nosy: +adhika.setyap _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 08:49:31 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 06 Mar 2022 13:49:31 +0000 Subject: [issue46939] Specialize calls for Python classes Message-ID: <1646574571.32.0.472167982786.issue46939@roundup.psfhosted.org> New submission from Ken Jin : Please see https://github.com/faster-cpython/ideas/issues/267. I hope I'm not stepping on anyone's toes here (sorry if I cause any duplicate work)! ---------- messages: 414618 nosy: Mark.Shannon, kj priority: normal severity: normal status: open title: Specialize calls for Python classes versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 08:51:28 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 06 Mar 2022 13:51:28 +0000 Subject: [issue46939] Specialize calls for Python classes In-Reply-To: <1646574571.32.0.472167982786.issue46939@roundup.psfhosted.org> Message-ID: <1646574688.43.0.419961169157.issue46939@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +29827 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 10:52:29 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 06 Mar 2022 15:52:29 +0000 Subject: [issue46846] functools.partial objects should set __signature__ and _annotations__ In-Reply-To: <1645695561.69.0.398852174273.issue46846@roundup.psfhosted.org> Message-ID: <1646581949.96.0.758318340184.issue46846@roundup.psfhosted.org> Change by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 12:10:39 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 06 Mar 2022 17:10:39 +0000 Subject: [issue46938] dataclass __post_init__ recursion In-Reply-To: <1646566474.17.0.0323337902851.issue46938@roundup.psfhosted.org> Message-ID: <1646586639.52.0.0994550728978.issue46938@roundup.psfhosted.org> Eric V. Smith added the comment: I think this is a bug in the code. I'll have a PR ready shortly. But since it's a non-trivial change, I'm going to target it for 3.11 only. ---------- assignee: docs at python -> eric.smith versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 12:37:09 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 06 Mar 2022 17:37:09 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1646588229.09.0.668728770594.issue43253@roundup.psfhosted.org> Andrew Svetlov added the comment: Please consider passing 'sock' argument as the ownership transfer. You should not perform any action on 'sock' object directly anymore. This is true for all asyncio API. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 13:46:12 2022 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 06 Mar 2022 18:46:12 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646592372.45.0.503627563825.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29828 pull_request: https://github.com/python/cpython/pull/31709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 13:47:25 2022 From: report at bugs.python.org (Steve Dower) Date: Sun, 06 Mar 2022 18:47:25 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1646592445.29.0.0658193753878.issue37609@roundup.psfhosted.org> Steve Dower added the comment: If you can build this on top of nt._path_splitroot then it could save a decent amount of work, though at the same time I think it's worthwhile having a pure Python implementation which is cross-platform. Haven't looked at the PR yet (or Eryk's implementation recently), but at the very least it would be nice to have tests that verify consistency with nt._path_splitroot. That way at least we'll discover if the native version changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 14:49:35 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 06 Mar 2022 19:49:35 +0000 Subject: [issue45582] Rewrite getpath.c in Python In-Reply-To: <1634945215.33.0.141600213082.issue45582@roundup.psfhosted.org> Message-ID: <1646596175.41.0.0662270428701.issue45582@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 55a5e17d19fecb6a7af85a1a9d44304e5fcb19c7 by Christian Heimes in branch 'main': bpo-45582: Don't fail if ENV_PATH is None in getpath.py (GH-31699) https://github.com/python/cpython/commit/55a5e17d19fecb6a7af85a1a9d44304e5fcb19c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:07:58 2022 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 06 Mar 2022 20:07:58 +0000 Subject: [issue46939] Specialize calls for Python classes In-Reply-To: <1646574571.32.0.472167982786.issue46939@roundup.psfhosted.org> Message-ID: <1646597278.06.0.245148815221.issue46939@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:14:41 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Mar 2022 20:14:41 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls Message-ID: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Consider this code: class A: __slots__ = [ "_color", ] color = None @property def color(self): return self._color A().color Executing this shows: Traceback (most recent call last): File "/Users/pgalindo3/lel.py", line 21, in A().color File "/Users/pgalindo3/lel.py", line 18, in color return self._color AttributeError: 'A' object has no attribute '_color'. Did you mean: '_color'? This is because the nested getattr call of "@property" overrides the metadata information in the exception object and it tries to produce an error message for the attribute "color" instead of "_color". ---------- assignee: pablogsal messages: 414623 nosy: pablogsal priority: normal severity: normal status: open title: Suggestion messages don't properly work in nested getattr calls versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:16:37 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Mar 2022 20:16:37 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls In-Reply-To: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> Message-ID: <1646597797.58.0.957545382905.issue46940@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +29829 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31710 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:19:52 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 06 Mar 2022 20:19:52 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646597992.41.0.0880657055948.issue46903@roundup.psfhosted.org> Ronald Oussoren added the comment: Your PR fixed the issue for me. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 15:32:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 06 Mar 2022 20:32:17 +0000 Subject: [issue34810] Maximum and minimum value of C types integers from Python In-Reply-To: <1537972326.01.0.545547206417.issue34810@psf.upfronthosting.co.za> Message-ID: <1646598737.38.0.664422441907.issue34810@roundup.psfhosted.org> Irit Katriel added the comment: Closing because there was no reply to questions asking to clarify the use case. Please reopen if you would like to continue the discussion. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 16:44:59 2022 From: report at bugs.python.org (Bar Harel) Date: Sun, 06 Mar 2022 21:44:59 +0000 Subject: [issue46938] dataclass __post_init__ recursion In-Reply-To: <1646566474.17.0.0323337902851.issue46938@roundup.psfhosted.org> Message-ID: <1646603099.9.0.104001145916.issue46938@roundup.psfhosted.org> Bar Harel added the comment: @Eric, I can easily fix it if you wish :-) Just wondered if it's intended or not, as it looked like a bug but the documentation was somewhat endorsing it and I got confused. Either case, a simple fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 16:51:20 2022 From: report at bugs.python.org (Bar Harel) Date: Sun, 06 Mar 2022 21:51:20 +0000 Subject: [issue46938] dataclass __post_init__ recursion In-Reply-To: <1646566474.17.0.0323337902851.issue46938@roundup.psfhosted.org> Message-ID: <1646603480.93.0.244021382873.issue46938@roundup.psfhosted.org> Bar Harel added the comment: Actually I'm not sure if the fix is so simple. What happens if B does not inherit from dataclass, but still inherits from A? Do we want to use the new __post_init__? I would assume we do, meaning we don't necessarily want to attach the __post_init__ to the dataclass, but to subclasses. If so, the suggestion to call __init__() from __post_init__() might be the problematic part, and is what conceptually breaks the inheritance linearization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 17:23:49 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sun, 06 Mar 2022 22:23:49 +0000 Subject: [issue23882] unittest discovery doesn't detect namespace packages when given no parameters In-Reply-To: <1428406596.02.0.0629964312505.issue23882@psf.upfronthosting.co.za> Message-ID: <1646605429.36.0.593441676052.issue23882@roundup.psfhosted.org> Change by G?ry : ---------- nosy: +maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 17:26:25 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 06 Mar 2022 22:26:25 +0000 Subject: [issue46938] dataclass __post_init__ recursion In-Reply-To: <1646566474.17.0.0323337902851.issue46938@roundup.psfhosted.org> Message-ID: <1646605585.68.0.540386539615.issue46938@roundup.psfhosted.org> Eric V. Smith added the comment: Yeah, I've come to the conclusion that it's not so simple, either. I'm also thinking that advising to call the base __init__ is a mistake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 17:39:47 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 06 Mar 2022 22:39:47 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1646606387.48.0.211848058873.issue46769@roundup.psfhosted.org> Change by Alex Waygood : ---------- keywords: +patch pull_requests: +29830 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31712 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 17:48:55 2022 From: report at bugs.python.org (Roundup Robot) Date: Sun, 06 Mar 2022 22:48:55 +0000 Subject: [issue30693] tarfile add uses random order In-Reply-To: <1497751410.94.0.779622739852.issue30693@psf.upfronthosting.co.za> Message-ID: <1646606935.4.0.439793883021.issue30693@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 8.0 -> 9.0 pull_requests: +29831 pull_request: https://github.com/python/cpython/pull/31713 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 19:01:13 2022 From: report at bugs.python.org (conio) Date: Mon, 07 Mar 2022 00:01:13 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1646611273.61.0.561959744764.issue46744@roundup.psfhosted.org> conio added the comment: Thank you very much, Steve. I took a look but didn't get to making the patch. I'm happy to see it was just removing the calculation of the PF(ARM) folder. For the second issue, even though I prefer it the way I said (unqualified = native), since (i) the default is using the value of `sys.winver` at the end of the path, and it's "VER" for amd64 Python and "VER-32" for x86 Python regardless of the OS (i.e. even on 32-bit Windows); (ii) this has been the situation long enough to be a compatibility concern as you said, and (iii) if someone really wants the names to be the other way around they may choose whatever they like during the install, and it's only the defaults that are that way I think you are right in keeping it out for now. I wouldn't insist on it. If there comes a time when more arguments in favor of this change come up or the circumstances change (e.g. the compatibility issue becomes less of a concern) I'm sure you'd revisit this. I did notice one small issue when I tried to build Python for ARM64 following your message from 2022-02-15. The help message for `Tools/msi/build.bat` says to use the `-ARM64` flag to build installers for ARM64 but it didn't work for me. I took me a few attempts at clean and rebuild before I finally looked at the script itself and saw that it actually expects `-arm64` in lowercase. If you could change either the help string or the flag itself so they'd math it would be great. Uppercase is nice because it is consistent with `PCbuild/build.bat` and lowercase is nice because if there's come CI that uses this flag it wouldn't have to be modified too. Obviously you if there are such consideration better than me so I leave the decision to you. If there's no problem or difficulty in changing the arguments for `Tools/msi/build.bat` it might be nice if building for ARM64 would be "-ARM64" and building for x86 would be "-Win32" to match the platform names for `PCbuild/build.bat`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 19:10:20 2022 From: report at bugs.python.org (Marc Mueller) Date: Mon, 07 Mar 2022 00:10:20 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1646611820.39.0.748680619113.issue44863@roundup.psfhosted.org> Change by Marc Mueller : ---------- nosy: +cdce8p _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 19:42:57 2022 From: report at bugs.python.org (=?utf-8?b?0KDQvtC80LDQvSDQodC70LDQsdC40YbQutC40Lk=?=) Date: Mon, 07 Mar 2022 00:42:57 +0000 Subject: [issue46941] Bug or plug not removed (The operator "is") Message-ID: <1646613777.85.0.744767351545.issue46941@roundup.psfhosted.org> New submission from ????? ????????? : I understand it's a stub that hasn't been removed, so it's a message from the C language that Python runs on in principle. ---------- components: Interpreter Core files: ???????????_2022-03-07_023751.png messages: 414630 nosy: semina054 priority: normal severity: normal status: open title: Bug or plug not removed (The operator "is") type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50659/???????????_2022-03-07_023751.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 19:48:26 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 07 Mar 2022 00:48:26 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1646614106.29.0.524963346135.issue44863@roundup.psfhosted.org> Raymond Hettinger added the comment: Related issue: https://bugs.python.org/issue43923 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 20:02:45 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 07 Mar 2022 01:02:45 +0000 Subject: [issue46941] Bug or plug not removed (The operator "is") In-Reply-To: <1646613777.85.0.744767351545.issue46941@roundup.psfhosted.org> Message-ID: <1646614965.23.0.275475207295.issue46941@roundup.psfhosted.org> Jelle Zijlstra added the comment: I don't understand what you are referring to. What do you think is wrong? ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 20:08:02 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 07 Mar 2022 01:08:02 +0000 Subject: [issue46941] Bug or plug not removed (The operator "is") In-Reply-To: <1646613777.85.0.744767351545.issue46941@roundup.psfhosted.org> Message-ID: <1646615282.19.0.144813123777.issue46941@roundup.psfhosted.org> Dennis Sweeney added the comment: In the future, please copy and paste the relevant code and errors as text. Images of code are harder for screen-readers for the visually impaired, harder to copy-and-paste to verify, and are more likely to be perceived as spam. Your code is essentially this: >>> i = 0 >>> i is 0 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? True This warning isn't a "stub", it was intentionally added in GH-9642. The warning exists because comparing numbers with `is` is generally unsafe (numbers should be compared using `==` instead), and can lead to unpredictable results, especially if using a different Python implementation (e.g. PyPy or RustPython or Jython rather than CPython). ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 20:21:16 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 07 Mar 2022 01:21:16 +0000 Subject: [issue46941] Bug or plug not removed (The operator "is") In-Reply-To: <1646613777.85.0.744767351545.issue46941@roundup.psfhosted.org> Message-ID: <1646616076.24.0.315648922131.issue46941@roundup.psfhosted.org> Raymond Hettinger added the comment: The code in the screenshot looks correct. >>> i = 0 >>> i is int False >>> type(i) is int True The code above does not get warning because "int" is a variable. This kind of comparison is always allowed and will work reliably. >>> i is 0 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? True The above code generates a warning because 0 is a numeric literal and there may be more than one instance of that literal. While this kind of comparison is allowed, it is unreliable because numeric literals are not guaranteed to be singletons: >>> x = 600 >>> (x + x) is 1200 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? False The reliable and correct way to test numeric values with an equality: >>> x + x == 1200 True ---------- nosy: +rhettinger -Dennis Sweeney, Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 20:45:11 2022 From: report at bugs.python.org (Owen T. Heisler) Date: Mon, 07 Mar 2022 01:45:11 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1646617511.9.0.302081115167.issue14156@roundup.psfhosted.org> Change by Owen T. Heisler : ---------- nosy: -owenh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 21:16:38 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 07 Mar 2022 02:16:38 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1646619398.22.0.0117594791469.issue45100@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +29832 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31716 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 21:32:18 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Mar 2022 02:32:18 +0000 Subject: [issue46941] Bug or plug not removed (The operator "is") In-Reply-To: <1646613777.85.0.744767351545.issue46941@roundup.psfhosted.org> Message-ID: <1646620338.09.0.733819782371.issue46941@roundup.psfhosted.org> Eric V. Smith added the comment: As others have noted, the behavior is intentional, so I'm closing this. ---------- nosy: +Dennis Sweeney, Jelle Zijlstra, eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 22:57:48 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 07 Mar 2022 03:57:48 +0000 Subject: [issue23882] unittest discovery doesn't detect namespace packages when given no parameters In-Reply-To: <1428406596.02.0.0629964312505.issue23882@psf.upfronthosting.co.za> Message-ID: <1646625468.58.0.77167551422.issue23882@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 6 23:28:25 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 07 Mar 2022 04:28:25 +0000 Subject: [issue46925] Document dict behavior when setting equal but not identical key In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646627305.54.0.0048881629237.issue46925@roundup.psfhosted.org> Inada Naoki added the comment: I don't know much about Java, but Java's WeakHashMap is same to Python's WeakKeyDictionary. https://docs.oracle.com/javase/9/docs/api/java/util/WeakHashMap.html """ This class is intended primarily for use with key objects whose equals methods test for object identity using the == operator. Once such a key is discarded it can never be recreated, so it is impossible to do a lookup of that key in a WeakHashMap at some later time and be surprised that its entry has been removed. This class will work perfectly well with key objects whose equals methods are not based upon object identity, such as String instances. With such recreatable key objects, however, the automatic removal of WeakHashMap entries whose keys have been discarded may prove to be confusing. """ ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 00:40:00 2022 From: report at bugs.python.org (Joongi Kim) Date: Mon, 07 Mar 2022 05:40:00 +0000 Subject: [issue46843] PersistentTaskGroup API In-Reply-To: <1645680865.21.0.230450894933.issue46843@roundup.psfhosted.org> Message-ID: <1646631600.92.0.835167303273.issue46843@roundup.psfhosted.org> Joongi Kim added the comment: I have released the new version of aiotools with rewritten TaskGroup and PersistentTaskGroup. https://aiotools.readthedocs.io/en/latest/aiotools.taskgroup.html aiotools.TaskGroup has small additions to asyncio.TaskGroup: a naming API and `current_taskgroup` context variable. aiotools.PersistentTaskGroup is what I've described here, highlighting both async-with usage and long-lived object usage and `all_ptaskgroups()` classmethod for the monitoring purpose except the two-phase graceful shutdown (future TODO). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:33:35 2022 From: report at bugs.python.org (Ofey Chan) Date: Mon, 07 Mar 2022 06:33:35 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1646634815.53.0.266926065792.issue46761@roundup.psfhosted.org> Ofey Chan added the comment: I updated NEWS and all checks have passed! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:42:58 2022 From: report at bugs.python.org (Larry Hastings) Date: Mon, 07 Mar 2022 06:42:58 +0000 Subject: [issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__ In-Reply-To: <1646494422.15.0.024229074835.issue46930@roundup.psfhosted.org> Message-ID: <1646635378.24.0.306442678995.issue46930@roundup.psfhosted.org> Larry Hastings added the comment: When accessing __annotations__ *in a class without annotations*, and *for the first time*. And your workaround seems reasonable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 01:50:00 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 07 Mar 2022 06:50:00 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646635800.35.0.64896883511.issue46903@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The PR introduced some deprecation warnings in tests. ./python -Wall -m test test_unicode 0:00:00 load avg: 1.54 Run tests sequentially 0:00:00 load avg: 1.54 [1/1] test_unicode /home/karthikeyan/stuff/python/cpython/Lib/test/test_unicode.py:3058: DeprecationWarning: Please use assertEqual instead. self.assertEquals(o.name, 1) /home/karthikeyan/stuff/python/cpython/Lib/test/test_unicode.py:3060: DeprecationWarning: Please use assertEqual instead. self.assertEquals(list(o.__dict__), [name]) /home/karthikeyan/stuff/python/cpython/Lib/test/test_unicode.py:3067: DeprecationWarning: Please use assertEqual instead. self.assertEquals(o.name2, 3) /home/karthikeyan/stuff/python/cpython/Lib/test/test_unicode.py:3069: DeprecationWarning: Please use assertEqual instead. self.assertEquals(list(o.__dict__), [name, name2]) == Tests result: SUCCESS == 1 test OK. Total duration: 952 ms Tests result: SUCCESS ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 02:06:38 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 07 Mar 2022 07:06:38 +0000 Subject: [issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug) In-Reply-To: <1646256636.59.0.442198647439.issue46903@roundup.psfhosted.org> Message-ID: <1646636798.7.0.270522871353.issue46903@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +29833 pull_request: https://github.com/python/cpython/pull/31718 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 02:42:39 2022 From: report at bugs.python.org (Alexei Komarov) Date: Mon, 07 Mar 2022 07:42:39 +0000 Subject: [issue46912] Full gc collection blocked from collecting after some amount of objects in oldest gen In-Reply-To: <1646318914.17.0.951983551273.issue46912@roundup.psfhosted.org> Message-ID: <1646638959.82.0.792810155904.issue46912@roundup.psfhosted.org> Change by Alexei Komarov : ---------- nosy: +pablogsal, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 02:54:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 07 Mar 2022 07:54:07 +0000 Subject: [issue46912] Full gc collection blocked from collecting after some amount of objects in oldest gen In-Reply-To: <1646318914.17.0.951983551273.issue46912@roundup.psfhosted.org> Message-ID: <1646639647.46.0.67856565257.issue46912@roundup.psfhosted.org> Irit Katriel added the comment: See if you can write a script that makes this happen. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 03:49:26 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Mar 2022 08:49:26 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1646642966.81.0.637908000596.issue45847@roundup.psfhosted.org> Erlend E. Aasland added the comment: Regarding _tkinter (Tcl/Tk): Based on discussion on Discourse (https://discuss.python.org/t/simplifying-tcl-tk-detection/14066), my current plan is to just use pkg-config, and drop the rest of the autodetect hackery. GH-31698 sort'a works given that pkg-config provides us with correct info. Sadly it doesn't for Ubuntu: ``` $ grep lib /usr/lib/x86_64-linux-gnu/pkgconfig/tcl8.6.pc libdir=/usr/lib/x86_64-linux-gnu Requires.private: zlib >= 1.2.3 Libs: -L${libdir} -ltcl8.6 -ltclstub8.6 $ ls -ld /usr/lib/x86_64-linux-gnu/{tcl,tk}* drwxr-xr-x 2 root root 4096 Mar 6 23:59 /usr/lib/x86_64-linux-gnu/tcl8.6 lrwxrwxrwx 1 root root 19 Feb 23 2019 /usr/lib/x86_64-linux-gnu/tclConfig.sh -> tcl8.6/tclConfig.sh lrwxrwxrwx 1 root root 21 Feb 23 2019 /usr/lib/x86_64-linux-gnu/tclooConfig.sh -> tcl8.6/tclooConfig.sh drwxr-xr-x 2 root root 4096 Mar 6 23:59 /usr/lib/x86_64-linux-gnu/tk8.6 lrwxrwxrwx 1 root root 17 Feb 23 2019 /usr/lib/x86_64-linux-gnu/tkConfig.sh -> tk8.6/tkConfig.sh ``` As you can see, the linker is given the wrong search path, so `AC_LINK_IFELSE` fails: ``` $ grep -A4 "gcc.*tcl" config.log configure:12380: gcc -o conftest -I/usr/include/tcl8.6 -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6 conftest.c -lpthread -ldl >&5 /usr/bin/ld: /tmp/ccMuHSnh.o: in function `main': conftest.c:(.text+0xb): undefined reference to `Tcl_Init' /usr/bin/ld: conftest.c:(.text+0x16): undefined reference to `Tk_Init' collect2: error: ld returned 1 exit status ``` I haven't checked Debian yet, but they may have the same problem. Plan B: 1. try to push a fix upstream 2. add temporarily hack for Ubuntu/Debian in autoconf 3. remove hack in a year or two Plan C 1. try to push a fix upstream 2. leave the current hackery as it is and wait another year or two ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 03:50:35 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 07 Mar 2022 08:50:35 +0000 Subject: [issue46942] Convert Object/classobject.c to Argument Clinic Message-ID: <1646643035.51.0.36036313662.issue46942@roundup.psfhosted.org> New submission from Oleg Iarygin : - Convert method.__reduce__, method.__new__, and instancemethod.__new__ to AC. It looks like nothing else can be converted in classobject.c. This is my first time working with AC so I could make some mistakes. - Fix found mismatches in method.__new__ where docstring and implementation diverged: - on how to name arguments (function vs func, instance vs self) - `fuct` is a semi-abbreviation and `self` is a special argument of instance methods. No compatibility is harmed because these arguments were forced to be positional-only anyway with `if (!_PyArg_NoKeywords("method", kw)) return NULL;`. - on whether args are positional (the implementation called _PyArg_NoKeywords) or not (the documentation and Lib/idlelib/idle_test/test_calltip.py:80) - align with other assertions in `test_builtins()` that have reference docstrings with both `/` marker and a proper description. Minor refactoring: - Since PyMethod_Type and PyInstanceMethod_Type are modified anyway, transform their initialization to C99-style. - Change a disabler for PyInstanceMethod_Type.tp_hash from comments to `#if 0`. ---------- components: Interpreter Core messages: 414643 nosy: arhadthedev priority: normal severity: normal status: open title: Convert Object/classobject.c to Argument Clinic type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 03:50:48 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 07 Mar 2022 08:50:48 +0000 Subject: [issue46942] Convert Object/classobject.c to Argument Clinic In-Reply-To: <1646643035.51.0.36036313662.issue46942@roundup.psfhosted.org> Message-ID: <1646643048.0.0.0253552306076.issue46942@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +29834 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31711 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:02:31 2022 From: report at bugs.python.org (Alexei Komarov) Date: Mon, 07 Mar 2022 09:02:31 +0000 Subject: [issue46912] Full gc collection blocked from collecting after some amount of objects in oldest gen In-Reply-To: <1646318914.17.0.951983551273.issue46912@roundup.psfhosted.org> Message-ID: <1646643751.91.0.786407373828.issue46912@roundup.psfhosted.org> Alexei Komarov added the comment: Oh, I see it now. I've been missing the fact that long_lived_pending is accumulated each 1st gen collection until full collection. Thanks! ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:10:04 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Mar 2022 09:10:04 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1646644204.97.0.730754770648.issue45847@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, tested GH-31698 on Debian 10.3, and it works swell there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:32:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 07 Mar 2022 09:32:00 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1646645520.06.0.238254501887.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: > The Python library will not compile with a C++2020 compiler because the code uses the reserved ?module? keyword What is the error message? How can the error be reproduced? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:32:25 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 09:32:25 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646645545.09.0.196174635931.issue43292@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +29835 pull_request: https://github.com/python/cpython/pull/31720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:32:25 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2022 09:32:25 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646645545.26.0.986014840672.issue43292@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 496c428de3318c9c5770937491b71dc3d3f18a6a by Jacob Walls in branch 'main': bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696) https://github.com/python/cpython/commit/496c428de3318c9c5770937491b71dc3d3f18a6a ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:32:30 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 09:32:30 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646645550.51.0.144233146071.issue43292@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29836 pull_request: https://github.com/python/cpython/pull/31721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:42:20 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Mar 2022 09:42:20 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1646646140.56.0.668353055621.issue45847@roundup.psfhosted.org> Erlend E. Aasland added the comment: > GH-31698 sort'a works given that pkg-config provides us with correct info. Sadly it doesn't for Ubuntu [...] Hm, looking more closely at Ubuntu (20.4), I see that the pkg-config files is actually correct. I'll have to debug this further; perhaps there is an easy way out :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:52:55 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Mar 2022 09:52:55 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1646646775.67.0.416162659085.issue45847@roundup.psfhosted.org> Erlend E. Aasland added the comment: FTR: $ strings /lib/x86_64-linux-gnu/libtcl8.6.so | grep -E "\" Tcl_Init $ strings /lib/x86_64-linux-gnu/libtk8.6.so | grep -E "\" Tk_Init ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:57:54 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 07 Mar 2022 09:57:54 +0000 Subject: [issue46937] convert remaining functions to AC in _weakref In-Reply-To: <1646556650.89.0.985996387629.issue46937@roundup.psfhosted.org> Message-ID: <1646647074.29.0.635452066184.issue46937@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 5c06dba21b9767127f042b8a168703f06338c3f4 by Kumar Aditya in branch 'main': bpo-46937: convert remaining functions to AC in _weakref (GH-31705) https://github.com/python/cpython/commit/5c06dba21b9767127f042b8a168703f06338c3f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 04:58:04 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 07 Mar 2022 09:58:04 +0000 Subject: [issue46937] convert remaining functions to AC in _weakref In-Reply-To: <1646556650.89.0.985996387629.issue46937@roundup.psfhosted.org> Message-ID: <1646647084.01.0.883073064249.issue46937@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:02:51 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 07 Mar 2022 10:02:51 +0000 Subject: [issue46341] duplicate paragraphs - asyncio Coroutines and Tasks file Message-ID: <1646647371.36.0.738966863435.issue46341@roundup.psfhosted.org> New submission from Kumar Aditya : This has been fixed in GH-31388. This can be closed now. ---------- nosy: +AlexWaygood, kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:03:01 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 07 Mar 2022 10:03:01 +0000 Subject: [issue46341] duplicate paragraphs - asyncio Coroutines and Tasks file In-Reply-To: <1646647371.36.0.738966863435.issue46341@roundup.psfhosted.org> Message-ID: <1646647381.6.0.450232959261.issue46341@roundup.psfhosted.org> Change by Kumar Aditya : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:13:25 2022 From: report at bugs.python.org (Jarek Potiuk) Date: Mon, 07 Mar 2022 10:13:25 +0000 Subject: [issue46925] Document dict behavior when setting equal but not identical key In-Reply-To: <1646436353.66.0.753916572572.issue46925@roundup.psfhosted.org> Message-ID: <1646648005.53.0.92047848439.issue46925@roundup.psfhosted.org> Jarek Potiuk added the comment: Yeah. Sounds like adding docs is indeed needed :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:30:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2022 10:30:22 +0000 Subject: [issue46341] duplicate paragraphs - asyncio Coroutines and Tasks file In-Reply-To: <1646647371.36.0.738966863435.issue46341@roundup.psfhosted.org> Message-ID: <1646649022.86.0.230218967916.issue46341@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Fix incorrect use of directives in asyncio documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:32:06 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 10:32:06 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646649126.58.0.859677066805.issue43292@roundup.psfhosted.org> miss-islington added the comment: New changeset 8acbb93c0763fa53b5959fe05d86ba275c9e8a5b by Miss Islington (bot) in branch '3.10': bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696) https://github.com/python/cpython/commit/8acbb93c0763fa53b5959fe05d86ba275c9e8a5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:50:38 2022 From: report at bugs.python.org (Keith) Date: Mon, 07 Mar 2022 10:50:38 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1646645520.06.0.238254501887.issue39355@roundup.psfhosted.org> Message-ID: Keith added the comment: Compile with a compiler supporting the C++20 core feature (Modules) https://en.cppreference.com/w/cpp/compiler_support In visual studio, use C/C++ > Language > CPP Language Standard > C++20 or higher On Mon, Mar 7, 2022 at 5:32 PM STINNER Victor wrote: > > STINNER Victor added the comment: > > > The Python library will not compile with a C++2020 compiler because the > code uses the reserved ?module? keyword > > What is the error message? How can the error be reproduced? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 05:51:38 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 07 Mar 2022 10:51:38 +0000 Subject: [issue45317] Document the removal the usage of the C stack in Python to Python calls In-Reply-To: <1632915633.23.0.578655230735.issue45317@roundup.psfhosted.org> Message-ID: <1646650298.29.0.045660288633.issue45317@roundup.psfhosted.org> Mark Shannon added the comment: I don't think this needs to block the alpha release ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:11:07 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Mar 2022 11:11:07 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1646651467.06.0.952925899322.issue45847@roundup.psfhosted.org> Erlend E. Aasland added the comment: Solved: Ubuntu is fine, we just need to treat LIBS and LDFLAGS with care in configure.ac. GH-31698 is updated with a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:30:04 2022 From: report at bugs.python.org (SpaceOne) Date: Mon, 07 Mar 2022 11:30:04 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance Message-ID: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> New submission from SpaceOne : imaplib raises an Exception with a bytes instance once (in login()) - all other places str instances are raised. Adjust the behavior of login() similar to authenticate() where self.error is called with a str instance. Especially for Python3 with strict bytes mode (-bb) this is helpful and prevents: Traceback (most recent call last): in "" self.login(email, password) File "/usr/lib/python3.7/imaplib.py", line 598, in login raise self.error(dat[-1]) imaplib.error: During handling of the above exception, another exception occurred: Traceback (most recent call last): in "" str(exc) BytesWarning: str() on a bytes instance ---------- components: Library (Lib) messages: 414657 nosy: spaceone priority: normal severity: normal status: open title: fix[imaplib]: call Exception with string instance 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 Mar 7 06:30:29 2022 From: report at bugs.python.org (SpaceOne) Date: Mon, 07 Mar 2022 11:30:29 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1646652629.65.0.1421670657.issue46943@roundup.psfhosted.org> Change by SpaceOne : ---------- keywords: +patch pull_requests: +29837 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:49:10 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2022 11:49:10 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646653750.35.0.519507859063.issue43292@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 852d9b77abefcad2bb8d203e3ab9f2ca49ab305f by Miss Islington (bot) in branch '3.9': [3.9] bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696) (GH-31720) https://github.com/python/cpython/commit/852d9b77abefcad2bb8d203e3ab9f2ca49ab305f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:50:57 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Mar 2022 11:50:57 +0000 Subject: [issue43292] xml.ElementTree iterparse filehandle left open In-Reply-To: <1613967089.4.0.392869817438.issue43292@roundup.psfhosted.org> Message-ID: <1646653857.04.0.999773925014.issue43292@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed superseder: Add the close method for ElementTree.iterparse() object -> versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:52:51 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 07 Mar 2022 11:52:51 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646653971.39.0.0980074493079.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: I have a patch that seems to do the right thing. It required adding WITH_NEXT_FRAMEWORK to the globals when evaluating getpath.py to detect this scenario. There probably should be more tests, in particular a test for a virtual environment using a framework install as I had to adjust my patch after manually testing a virtual environment. I'm not entirely happy with the patch yet, the change to getpath.py is basically the minimal change I could get away with without grokking the entire file. There's no PR yet as I've broken my fork of cpython, fixing that is next up on the list. BTW. Is there a way to find the values that get put into the globals dict for getpath.py without using a debugger (either a real one or the printf variant)? ---------- Added file: https://bugs.python.org/file50660/issue-46890.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 06:56:37 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 07 Mar 2022 11:56:37 +0000 Subject: [issue46944] Use FASTCALL calling convention in generator.throw Message-ID: <1646654196.99.0.903506705512.issue46944@roundup.psfhosted.org> New submission from Kumar Aditya : Use FASTCALL calling convention in generator.throw to avoid creating a temporary tuple to pass arguments to the function. ---------- components: Interpreter Core messages: 414660 nosy: Mark.Shannon, kumaraditya303 priority: normal pull_requests: 29839 severity: normal status: open title: Use FASTCALL calling convention in generator.throw versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:13:28 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 07 Mar 2022 12:13:28 +0000 Subject: [issue46374] Assertion failed in ceval.c In-Reply-To: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> Message-ID: <1646655208.63.0.312588168353.issue46374@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:23:15 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 12:23:15 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls In-Reply-To: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> Message-ID: <1646655795.34.0.880193805979.issue46940@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3b3be05a164da43f201e35b6dafbc840993a4d18 by Pablo Galindo Salgado in branch 'main': bpo-46940: Don't override existing AttributeError suggestion information (GH-31710) https://github.com/python/cpython/commit/3b3be05a164da43f201e35b6dafbc840993a4d18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:25:49 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 12:25:49 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls In-Reply-To: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> Message-ID: <1646655949.3.0.659201190598.issue46940@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29840 pull_request: https://github.com/python/cpython/pull/31724 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:36:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 07 Mar 2022 12:36:50 +0000 Subject: [issue46933] Make pwd module optional for wasm32-emscripten and wasi In-Reply-To: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> Message-ID: <1646656610.99.0.706405552924.issue46933@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ca9689f8dac01d27e041e1dbbdae146746d48ab3 by Christian Heimes in branch 'main': bpo-46933: Make pwd module optional (GH-31700) https://github.com/python/cpython/commit/ca9689f8dac01d27e041e1dbbdae146746d48ab3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:37:51 2022 From: report at bugs.python.org (Jonathan Fine) Date: Mon, 07 Mar 2022 12:37:51 +0000 Subject: [issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop In-Reply-To: <1646306528.93.0.506258424716.issue46910@roundup.psfhosted.org> Message-ID: <1646656671.65.0.509660422925.issue46910@roundup.psfhosted.org> Jonathan Fine added the comment: My main concern is that the door not be closed on improving the user experience relating to this behaviour of the compiler. This issue was raised as a bug for the compiler (which is C-coded). I'd be very happy for this issue to be closed as 'not a bug' for the compiler, provided the door is left open for Python-coded improvements for the user experience. I suggest that the issue title be changed to: The two-pass compile(bad_src, ...) sometimes does not report first error in bad_src These two changes to the details of closure would be sufficient to meet my concern. I hope they can be accepted. By the way, I see these improvements being done as a third-party pure-Python module outside Python's Standard Library, at least until they've reached a wide measure of community acceptance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 07:40:22 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 07 Mar 2022 12:40:22 +0000 Subject: [issue46933] Make pwd module optional for wasm32-emscripten and wasi In-Reply-To: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> Message-ID: <1646656822.92.0.0990635971274.issue46933@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 Mar 7 07:48:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 12:48:52 +0000 Subject: [issue46910] Compiler errors that happen before syntax errors are not reported first In-Reply-To: <1646306528.93.0.506258424716.issue46910@roundup.psfhosted.org> Message-ID: <1646657332.27.0.412890304538.issue46910@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > My main concern is that the door not be closed on improving the user experience relating to this behaviour of the compiler. Is not closed, if someone has a good idea they can reopen this issue (the issue is not deleted). > By the way, I see these improvements being done as a third-party pure-Python module outside Python's Standard Library, at least until they've reached a wide measure of community acceptance. You can reach to Andr? Roberge, the author of "friendly" and "friendly-traceback" (https://github.com/friendly-traceback/friendly-traceback) which is a fantastic 3rd party package in these lines. ---------- resolution: wont fix -> not a bug title: Expect IndentationError, get SyntaxError: 'break' outside loop -> Compiler errors that happen before syntax errors are not reported first _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:17:13 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 07 Mar 2022 13:17:13 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646659033.13.0.974701414557.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: I'm now in the fun position where the code works, but the test test_getpath.py fails. The test case below tries to test a venv in a framework build, but somehow fails to calculate prefix and exec_prefix correctly. The calculation does work when using a framework build with my patch... def test_venv_framework_macos(self): """Test a venv layout on macOS using a framework build """ venv_path = "/tmp/workdir/venv" ns = MockPosixNamespace( os_name="darwin", argv0="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python", WITH_NEXT_FRAMEWORK=1, PREFIX="/Library/Frameworks/Python.framework/Versions/9.8", EXEC_PREFIX="/Library/Frameworks/Python.framework/Versions/9.8", ENV___PYVENV_LAUNCHER__=f"{venv_path}/bin/python", real_executable="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python", library="/Library/Frameworks/Python.framework/Versions/9.8/Python", ) ns.add_known_dir(venv_path) ns.add_known_xfile(f"{venv_path}/bin/python") ns.add_known_dir(f"{venv_path}/lib/python9.8") ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python") ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8") ns.add_known_dir("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload") ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/os.py") ns.add_known_file(f"{venv_path}/pyvenv.cfg", [ "home = /Library/Frameworks/Python.framework/Versions/9.8/bin" ]) expected = dict( executable=f"{venv_path}/bin/python", prefix=venv_path, exec_prefix=venv_path, base_executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8", base_prefix="/Library/Frameworks/Python.framework/Versions/9.8", base_exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8", module_search_paths_set=1, module_search_paths=[ "/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip", "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8", "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload", ], ) actual = getpath(ns, expected) self.assertEqual(expected, actual) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:18:40 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 13:18:40 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls In-Reply-To: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> Message-ID: <1646659120.31.0.181297013073.issue46940@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3594ebca2cacf5d9b5212d2c487fd017cd00e283 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46940: Don't override existing AttributeError suggestion information (GH-31710) (GH-31724) https://github.com/python/cpython/commit/3594ebca2cacf5d9b5212d2c487fd017cd00e283 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:18:43 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 07 Mar 2022 13:18:43 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646659123.64.0.0439766462505.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: This is also dodgy: test_framework_macos (test.test_getpath.MockGetPathTests) ... Read link from /Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python Check if /Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Modules/Setup.local is a file Check if /Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip is a file Check if /Library/Frameworks/Python.framework/Versions/lib/python98.zip is a file Check if /Library/Frameworks/Python.framework/lib/python98.zip is a file Check if /Library/Frameworks/lib/python98.zip is a file Check if /Library/lib/python98.zip is a file Check if /Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/os.py is a file Check if /Library/Frameworks/Python.framework/Versions/9.8/bin/lib/python9.8/lib-dynload is a dir Check if /Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload is a dir Note how the code checks for the standard library outside of the framework itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:18:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 13:18:53 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls In-Reply-To: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> Message-ID: <1646659133.92.0.525037305241.issue46940@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 Mar 7 08:19:26 2022 From: report at bugs.python.org (Vivian D) Date: Mon, 07 Mar 2022 13:19:26 +0000 Subject: [issue46945] Quantifier and Expanded Regex Expression Gives Different Results Message-ID: <1646659166.96.0.869118025108.issue46945@roundup.psfhosted.org> New submission from Vivian D : Here are the steps that I went through to test my regular expressions in my command prompt (a file attachment shows this as well). I am using Windows 11, version 21H2: >>> import re >>> regex = r"(((\w)+\w*\3){2}|(\w)+(?=\w*\4)\w*(?!\4)(\w)\w*\5)\w*" >>> testString = "Alabama and Mississippi are next to each other" >>> re.findall(regex,testString,re.IGNORECASE) [('Mississipp', 'ipp', 'p', '', '')] >>> testString = "alabama and Mississippi are next to each other" >>> re.findall(regex,testString,re.IGNORECASE) [('Mississipp', 'ipp', 'p', '', '')] >>> regex = r"((\w)+\w*\2(\w)+\w*\3|(\w)+(?=\w*\4)\w*(?!\4)(\w)\w*\5)\w*" >>> re.findall(regex,testString,re.IGNORECASE) [('alabama', 'a', 'a', '', ''), ('Mississipp', 's', 'p', '', '')] >>> testString = "Alabama and Mississippi are next to each other" >>> re.findall(regex,testString,re.IGNORECASE) [('Alabama', 'A', 'a', '', ''), ('Mississipp', 's', 'p', '', '')] I created a regular expression to match any words with two sets of the same vowel, including words with four of the same vowel, ignoring case. My first regular expression ?(((\w)+\w*\3){2}|(\w)+(?=\w*\4)\w*(?!\4)(\w)\w*\5)\w*" was able to match ?Mississippi? but unable to match ?Alabama? as it should have. To make sure that this error wasn?t somehow caused by a case sensitivity issue, I retested the regex with ?alabama? instead of ?Alabama?, but still I got no match on ?alabama?. Then I tried replacing the quantifier {2} with just expression that was supposed to be repeated. This gave me the regex: "((\w)+\w*\2(\w)+\w*\3|(\w)+(?=\w*\4)\w*(?!\4)(\w)\w*\5)\w*". For some reason, this was able to match on both ?alabama? and ?Alabama? now, as shown above, and continued to match on Mississippi like expected. However, this result seems to contradict my understand of regular expressions because all I did to get these different results was copy the expression that was supposed to be executed twice by the quantifier. ---------- components: Library (Lib) files: ComandPrompt.pdf messages: 414668 nosy: vmd3.14 priority: normal severity: normal status: open title: Quantifier and Expanded Regex Expression Gives Different Results type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50661/ComandPrompt.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 08:50:49 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 07 Mar 2022 13:50:49 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646661049.96.0.0563241999017.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: I've attached a new patch file with some more tweaks, including the additional test case from msg414665. I've pretty sure that the changes to getpath.py are slightly worse in the new version, but aren't fully correct in the initial version as well (see my previous message about searching outside of the framework). I may return to this later when I have time to try to really understand what's going on and compare the logic with the previous C code (especially for framework builds). But for now I'm giving up. ---------- Added file: https://bugs.python.org/file50662/issue-46890-v2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 09:12:29 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 07 Mar 2022 14:12:29 +0000 Subject: [issue46946] Port core types to Argument Clinic Message-ID: <1646662349.93.0.569341400639.issue46946@roundup.psfhosted.org> New submission from Oleg Iarygin : This is done to: - update docstrings to current standards enforced by AC - get proper naming for arguments of impl-functions (for example, self instead of obj and instance) - strip boilerplate reducing current 16k lines of code to something little more manageable - get a proper excuse to collapse overbloated PyTypeObject initializers by throwing out zeroes with designated initialization thanks to C99&11 being promoted. For example, EncodingMapType in unicodeobject.c reduced from 43 lines to 8, five times less. ---------- components: Interpreter Core messages: 414670 nosy: arhadthedev priority: normal severity: normal status: open title: Port core types to Argument Clinic type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 09:13:12 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 07 Mar 2022 14:13:12 +0000 Subject: [issue46946] Port core types to Argument Clinic In-Reply-To: <1646662349.93.0.569341400639.issue46946@roundup.psfhosted.org> Message-ID: <1646662392.49.0.158359316633.issue46946@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +29841 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 09:24:47 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 07 Mar 2022 14:24:47 +0000 Subject: [issue46945] Quantifier and Expanded Regex Expression Gives Different Results In-Reply-To: <1646659166.96.0.869118025108.issue46945@roundup.psfhosted.org> Message-ID: <1646663087.12.0.657881013734.issue46945@roundup.psfhosted.org> Vedran ?a?i? added the comment: Confirmed. On Python 3.10.2, >>> re.findall(r"(((\w)+\w*\3){2}|(\w)+(?=\w*\4)\w*(?!\4)(\w)\w*\5)\w*",'alabama') [] yet https://regex101.com/r/uT8gag/1 (with "Python" selected) says it should match. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 09:53:57 2022 From: report at bugs.python.org (Luca) Date: Mon, 07 Mar 2022 14:53:57 +0000 Subject: [issue46936] Fix grammar_grapher with the new forced directive In-Reply-To: <1646555965.39.0.197872234422.issue46936@roundup.psfhosted.org> Message-ID: <1646664837.92.0.38460191516.issue46936@roundup.psfhosted.org> Change by Luca : ---------- pull_requests: +29842 pull_request: https://github.com/python/cpython/pull/31719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 09:54:23 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 14:54:23 +0000 Subject: [issue46936] Fix grammar_grapher with the new forced directive In-Reply-To: <1646555965.39.0.197872234422.issue46936@roundup.psfhosted.org> Message-ID: <1646664863.03.0.067591714114.issue46936@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 Mar 7 10:20:26 2022 From: report at bugs.python.org (Joe Cool) Date: Mon, 07 Mar 2022 15:20:26 +0000 Subject: [issue46947] unicodedata.name gives ValueError for control characters Message-ID: <1646666426.33.0.722967640681.issue46947@roundup.psfhosted.org> New submission from Joe Cool : unicodedata.name gives ValueError for control characters, for example: >>> unicodedata.name('\x00') Traceback (most recent call last): File "", line 1, in ValueError: no such name >>> unicodedata.name('\t') Traceback (most recent call last): File "", line 1, in ValueError: no such name Where unicodedata.lookup clearly knows the names for these characters: >>> unicodedata.lookup('NULL') '\x00' >>> unicodedata.lookup('TAB') '\t' ---------- components: Library (Lib) messages: 414672 nosy: snoopyjc priority: normal severity: normal status: open title: unicodedata.name gives ValueError for control characters type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:33:18 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 16:33:18 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer Message-ID: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> New submission from Steve Dower : CVE-2022-26488 is an escalation of privilege vulnerability in the Windows installer for the following releases of CPython: * 3.11.0a6 and earlier * 3.10.2 and earlier * 3.9.10 and earlier * 3.8.12 and earlier * All end-of-life releases of 3.5, 3.6 and 3.7 The vulnerability exists when installed for all users, and when the "Add Python to PATH" option has been selected. A local user without administrative permissions can trigger a repair operation that adds incorrect additional paths to the system PATH variable, and then use search path hijacking to achieve escalation of privilege. Per-user installs (the default) are also affected, but cannot be used for escalation of privilege. Besides updating, this vulnerability may be mitigated by modifying an existing install to disable the "Add Python to PATH" or "Add Python to environment variables" option. Manually adding the install directory to PATH is not affected. Thanks to the Lockheed Martin Red Team for detecting and reporting the issue to the Python Security Response Team. ---------- assignee: steve.dower components: Windows messages: 414673 nosy: lukasz.langa, ned.deily, pablogsal, paul.moore, steve.dower, tim.golden, zach.ware priority: release blocker severity: normal stage: needs patch status: open title: [CVE-2022-26488] Escalation of privilege via Windows Installer type: security 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 Mar 7 11:36:27 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 16:36:27 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646670987.39.0.555549933121.issue46948@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +29843 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31726 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:38:53 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 16:38:53 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646671133.54.0.128646701974.issue46948@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29844 pull_request: https://github.com/python/cpython/pull/31727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:40:53 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 16:40:53 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646671253.76.0.505454781022.issue46948@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29845 pull_request: https://github.com/python/cpython/pull/31728 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:42:33 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 16:42:33 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646671353.86.0.24489722146.issue46948@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29846 pull_request: https://github.com/python/cpython/pull/31729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:43:40 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 16:43:40 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646671420.62.0.0615704315863.issue46948@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29847 pull_request: https://github.com/python/cpython/pull/31730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 11:52:16 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 07 Mar 2022 16:52:16 +0000 Subject: [issue46949] Print an indication if traceback exceeds sys.tracebacklimit Message-ID: <1646671936.93.0.679667824145.issue46949@roundup.psfhosted.org> New submission from Jelle Zijlstra : If the number of frames in a traceback exceeds sys.tracebacklimit (which defaults to 1000), any remaining frames are silently dropped. See https://docs.python.org/3.10/library/sys.html#sys.tracebacklimit. This is confusing to users. We should print some indication like "N additional stack frames not shown". Here are some specific ideas: - tracebacklimit <= 0 is documented as dropping the whole traceback. In that case, we don't need too print any message. - It may be expensive to compute a complete count. Perhaps we can count frames up to 2 * tracebacklimit, and just say "Many additional stack frames not shown". - The C implementation is in tb_print_internal() in traceback.c, and the Python one in _extract_from_extended_frame_gen in traceback.py. ---------- components: Interpreter Core messages: 414674 nosy: Jelle Zijlstra, gvanrossum, iritkatriel priority: normal severity: normal status: open title: Print an indication if traceback exceeds sys.tracebacklimit type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:00:43 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 07 Mar 2022 17:00:43 +0000 Subject: [issue46949] Print an indication if traceback exceeds sys.tracebacklimit In-Reply-To: <1646671936.93.0.679667824145.issue46949@roundup.psfhosted.org> Message-ID: <1646672443.14.0.355095953231.issue46949@roundup.psfhosted.org> Guido van Rossum added the comment: There is general confusion as to which part of the traceback is truncated. If I have main() -> f() -> g() -> error(), and the limit is 2, does it print main() -> f(), or does it print g() -> error()? (I'm not even sure which would be more useful.) FWIW the reason I suggested printing "many" is a worry that somehow a bug could cause counting the length of the list to take forever (e.g. if it ends in a cycle). It would seem more robust to limit the count. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:02:09 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:02:09 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646672529.65.0.559449136453.issue46890@roundup.psfhosted.org> Steve Dower added the comment: > I have a patch that seems to do the right thing. It required adding WITH_NEXT_FRAMEWORK to the globals when evaluating getpath.py to detect this scenario. I haven't had a chance to go through all your changes, and I'm only very vaguely familiar with this space anyway, but isn't WITH_NEXT_FRAMEWORK a compile-time option? I'm sure that's how it was used in the old getpath. > Is there a way to find the values that get put into the globals dict for getpath.py without using a debugger warn(str(globals())) or some variant at the top of getpath.py should do it. There's also an "#if 0" section in getpath.c that will print it out (unless I deleted it before merging). There's nothing permanently built in to do this, as I suspect the security concerns (information leakage) would come up more often than the debugging concerns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:05:33 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 07 Mar 2022 17:05:33 +0000 Subject: [issue46949] Print an indication if traceback exceeds sys.tracebacklimit In-Reply-To: <1646671936.93.0.679667824145.issue46949@roundup.psfhosted.org> Message-ID: <1646672733.16.0.448459715427.issue46949@roundup.psfhosted.org> Jelle Zijlstra added the comment: It skips the least recent frames: >>> def error(): 1 / 0 ... >>> def g(): error() ... >>> def f(): g() ... >>> sys.tracebacklimit = 2 >>> f() Traceback (most recent call last): File "", line 1, in g File "", line 1, in error ZeroDivisionError: division by zero >>> sys.tracebacklimit = 5 >>> f() Traceback (most recent call last): File "", line 1, in File "", line 1, in f File "", line 1, in g File "", line 1, in error ZeroDivisionError: division by zero (tried on current main) I think that's the right behavior because it tells you the function that actually throws the error, which is much harder to figure out from scratch than where the call started. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:05:48 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 07 Mar 2022 17:05:48 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646672748.39.0.768786312661.issue46948@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The 3.11.0a6 release is ongoing. I assume is ok to not block this release on this issue, given that an alpha is inherently unsafe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:12:50 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:12:50 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646673170.32.0.746963888541.issue46948@roundup.psfhosted.org> Steve Dower added the comment: Yeah, this is fine to still be in alpha 6. Very unlikely that anyone is making it a system-wide default anyway, and certainly not in secure/production systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:16:59 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Mar 2022 17:16:59 +0000 Subject: [issue46949] Print an indication if traceback exceeds sys.tracebacklimit In-Reply-To: <1646671936.93.0.679667824145.issue46949@roundup.psfhosted.org> Message-ID: <1646673419.12.0.692714836733.issue46949@roundup.psfhosted.org> Eric V. Smith added the comment: If you go with the second idea, I'd say something like f"More than {2 * tracebacklimit} additional stack frames not shown". It seems handy to know the magnitude of the problem. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:23:31 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:23:31 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646673811.04.0.999232553551.issue46948@roundup.psfhosted.org> Steve Dower added the comment: New changeset 136842c91b5783e205e217c4855baa9dadd4ad41 by Steve Dower in branch '3.10': bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31727) https://github.com/python/cpython/commit/136842c91b5783e205e217c4855baa9dadd4ad41 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:23:31 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:23:31 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646673811.18.0.183745550194.issue46948@roundup.psfhosted.org> Steve Dower added the comment: New changeset 77446d2aa56e9e3262d9d2247342bbbb0ff5e907 by Steve Dower in branch 'main': bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31726) https://github.com/python/cpython/commit/77446d2aa56e9e3262d9d2247342bbbb0ff5e907 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:23:35 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:23:35 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646673815.34.0.970432909992.issue46948@roundup.psfhosted.org> Steve Dower added the comment: New changeset 101a1bee1953b82339115c5e648e1717359c78eb by Steve Dower in branch '3.9': bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31728) https://github.com/python/cpython/commit/101a1bee1953b82339115c5e648e1717359c78eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:27:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 07 Mar 2022 17:27:47 +0000 Subject: [issue46949] Print an indication if traceback exceeds sys.tracebacklimit In-Reply-To: <1646671936.93.0.679667824145.issue46949@roundup.psfhosted.org> Message-ID: <1646674067.2.0.291094159017.issue46949@roundup.psfhosted.org> Irit Katriel added the comment: Re what the limit means, it?s a bit messier than that, see issue38197. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:37:37 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2022 17:37:37 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646674657.28.0.170750545043.issue46948@roundup.psfhosted.org> Ned Deily added the comment: New changeset 97476271275a4bd1340230677b7301d7b78b3317 by Steve Dower in branch '3.7': bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31730) https://github.com/python/cpython/commit/97476271275a4bd1340230677b7301d7b78b3317 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:46:00 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:46:00 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646675160.98.0.835004324639.issue44549@roundup.psfhosted.org> Steve Dower added the comment: cpython-source-deps was updated middle of last year, but apparently we never merged the main repo change to use it. I'll do it now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:48:55 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:48:55 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646675335.36.0.852862632598.issue44549@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29848 pull_request: https://github.com/python/cpython/pull/31731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 12:58:15 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 17:58:15 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646675895.59.0.845172905591.issue44549@roundup.psfhosted.org> Steve Dower added the comment: Adding RMs - this should get merged before we do any security releases for issue46948 ---------- nosy: +lukasz.langa, pablogsal versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:03:08 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 07 Mar 2022 18:03:08 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1646676188.03.0.658914360987.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset b465b606049f6f7dd0711cb031fdaa251818741a by Niklas Rosenstein in branch 'main': bpo-41370: Evaluate strings as forward refs in PEP 585 generics (GH-30900) https://github.com/python/cpython/commit/b465b606049f6f7dd0711cb031fdaa251818741a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:13:20 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 18:13:20 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1646676800.19.0.66406933956.issue46744@roundup.psfhosted.org> Steve Dower added the comment: Good call on the batch file. It should be easy enough to make those options case-insensitive, and to support both forms of x86 flag. I'll leave this issue open for that if someone wants to have a go, otherwise I'll get to them at some point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:15:20 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2022 18:15:20 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646676920.49.0.485651282846.issue44549@roundup.psfhosted.org> Change by Ned Deily : ---------- priority: critical -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:23:38 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 18:23:38 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646677418.05.0.549543566065.issue44549@roundup.psfhosted.org> Steve Dower added the comment: New changeset 105b9ac00174d7bcc653f9e9dc5052215e197c77 by Steve Dower in branch 'main': bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900 (GH-31731) https://github.com/python/cpython/commit/105b9ac00174d7bcc653f9e9dc5052215e197c77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:28:51 2022 From: report at bugs.python.org (Darrel O'Pry) Date: Mon, 07 Mar 2022 18:28:51 +0000 Subject: [issue46950] Windows 11 venv Message-ID: <1646677731.73.0.904643383001.issue46950@roundup.psfhosted.org> New submission from Darrel O'Pry : I created a virtual env on windows 11. When I run pip install -r "..." I get the error ``` C:\Users\dopry\src\Client\some.domain.com\django> pip install -r .\requirements_to_freeze.txt Traceback (most recent call last): File "C:\Users\dopry\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\dopry\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\dopry\src\Client\some.domain.com\django\venv310\Scripts\pip.exe\__main__.py", line 4, in ModuleNotFoundError: No module named 'pip' ``` When I run get command to verify that the venv is activated I get ``` (venv310) PS C:\Users\dopry\src\Client\some.domain.com\django> Get-Command python CommandType Name Version Source ----------- ---- ------- ------ Application python.exe 3.10.21... C:\Users\dopry\src\Client\some.domain.com\django\venv310\Scripts\python.exe ``` When I update the `venv310\pyenv.cfg` and set `include-system-site-packages = true` to true, it was defaulted to false, it seems that I can pip install my requirements successfully. When I try to start my app though, the requirements are not found. ---------- components: Windows messages: 414691 nosy: darrel.opry, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows 11 venv type: crash versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:33:49 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 18:33:49 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646678029.37.0.764680823364.issue44549@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29849 pull_request: https://github.com/python/cpython/pull/31732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:40:54 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2022 18:40:54 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646678454.46.0.280409239716.issue46932@roundup.psfhosted.org> Ned Deily added the comment: We haven't released 2.4.6 yet for maintenance/security branches so we probably should update to 2.4.7 first. ---------- nosy: +corona10, lukasz.langa, ned.deily, pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 13:54:52 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Mar 2022 18:54:52 +0000 Subject: [issue46945] Quantifier and Expanded Regex Expression Gives Different Results In-Reply-To: <1646659166.96.0.869118025108.issue46945@roundup.psfhosted.org> Message-ID: <1646679292.18.0.72174997219.issue46945@roundup.psfhosted.org> Change by Eric V. Smith : ---------- components: +Regular Expressions -Library (Lib) nosy: +ezio.melotti, mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:15:32 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 19:15:32 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646680532.31.0.777117816808.issue44549@roundup.psfhosted.org> Steve Dower added the comment: New changeset 58d576a43cb1800dd68f06a429d7d41f746a8c01 by Steve Dower in branch '3.10': bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900 (GH-31732) https://github.com/python/cpython/commit/58d576a43cb1800dd68f06a429d7d41f746a8c01 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:19:20 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 19:19:20 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646680760.35.0.827444170413.issue44549@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29850 pull_request: https://github.com/python/cpython/pull/31733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:19:40 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 19:19:40 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646680780.62.0.40903759742.issue44549@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29852 pull_request: https://github.com/python/cpython/pull/31735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:19:25 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 19:19:25 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646680765.91.0.42579072649.issue44549@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29851 pull_request: https://github.com/python/cpython/pull/31734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:24:56 2022 From: report at bugs.python.org (Martin Panter) Date: Mon, 07 Mar 2022 19:24:56 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646681096.17.0.930305118804.issue46913@roundup.psfhosted.org> Martin Panter added the comment: The ctypes overflow is probably the same as described in Issue 28169 and Issue 15119 ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:34:57 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2022 19:34:57 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646681697.29.0.105017187976.issue44549@roundup.psfhosted.org> Ned Deily added the comment: New changeset 4a3c610cd635f14747cf02c77908e80620aae6ea by Steve Dower in branch '3.7': bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900 (GH-31732) (GH-31735) https://github.com/python/cpython/commit/4a3c610cd635f14747cf02c77908e80620aae6ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 14:45:09 2022 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 07 Mar 2022 19:45:09 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646682309.48.0.12699851819.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset f193631387bfee99a812e39b05d5b7e6384b57f5 by Brandt Bucher in branch 'main': bpo-46841: Use inline caching for calls (GH-31709) https://github.com/python/cpython/commit/f193631387bfee99a812e39b05d5b7e6384b57f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 15:10:56 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 20:10:56 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646683856.76.0.353585731757.issue46932@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 15:11:29 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 20:11:29 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646683889.5.0.825915216739.issue44549@roundup.psfhosted.org> Steve Dower added the comment: New changeset e1639f361ee0dfbf08bb8538839d3d557c1a995c by Steve Dower in branch '3.9': bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900 (GH-31732) https://github.com/python/cpython/commit/e1639f361ee0dfbf08bb8538839d3d557c1a995c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 15:12:43 2022 From: report at bugs.python.org (Joe Cool) Date: Mon, 07 Mar 2022 20:12:43 +0000 Subject: [issue46947] unicodedata.name gives ValueError for control characters In-Reply-To: <1646666426.33.0.722967640681.issue46947@roundup.psfhosted.org> Message-ID: <1646683963.47.0.767071268784.issue46947@roundup.psfhosted.org> Joe Cool added the comment: Note: This is an issue for all chars in the ordinal range 0 thru 31. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 15:21:28 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 20:21:28 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646684488.26.0.252673971204.issue46932@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +29853 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:38:46 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Mar 2022 21:38:46 +0000 Subject: [issue46933] Make pwd module optional for wasm32-emscripten and wasi In-Reply-To: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> Message-ID: <1646689126.67.0.940692148592.issue46933@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland nosy_count: 1.0 -> 2.0 pull_requests: +29854 pull_request: https://github.com/python/cpython/pull/31737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:39:57 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 07 Mar 2022 21:39:57 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1646689197.55.0.8791430941.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: WITH_NEXT_FRAMEWORK is a compile time option, I've added it to globals in values like PREFIX are added. That way the python code can behave differently for framework builds (which appears to be needed). There are two big problems with my patches: - Calculation of sys.prefix doesn't work in test_venv_framework_macos, but somehow works with a real installation. I haven't managed to track down the difference yet. - Calculation for test_framework_macos appears to be ok on first glance, but adding "/Library/lib/python9.8.zip" as a known file shows that the code to look for the stdlib is misbehaving. The latter appears to be a wider problem, if I add a test case based on test_normal_posix with PREFIX=/opt/python9.8 the getpath code looks for /opt/lib/python98.zip and uses that when found. Test case for this (test passed when ``ns.add_known_file("/opt/lib/python98.zip")`` is commented out: def test_normal_posix_in_opt(self): """Test a 'standard' install layout on *nix This uses '/opt/python9.8' as PREFIX """ ns = MockPosixNamespace( PREFIX="/opt/python9.8", argv0="python", ENV_PATH="/usr/bin:/opt/python9.8/bin", ) ns.add_known_xfile("/opt/python9.8/bin/python") ns.add_known_file("/opt/python9.8/lib/python9.8/os.py") ns.add_known_dir("/opt/python9.8/lib/python9.8/lib-dynload") # This shouldn't matter: ns.add_known_file("/opt/lib/python98.zip") expected = dict( executable="/opt/python9.8/bin/python", base_executable="/opt/python9.8/bin/python", prefix="/opt/python9.8", exec_prefix="/opt/python9.8", module_search_paths_set=1, module_search_paths=[ "/opt/python9.8/lib/python98.zip", "/opt/python9.8/lib/python9.8", "/opt/python9.8/lib/python9.8/lib-dynload", ], ) actual = getpath(ns, expected) self.assertEqual(expected, actual) This could be problematic, adding a suitably named file outside of $PREFIX breaks the python installation. I haven't checked this with an unchanged getpath.py yet, but I shouldn't have made any changes that affect a non-framework install. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:46:23 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 21:46:23 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646689583.21.0.678087459746.issue46932@roundup.psfhosted.org> Steve Dower added the comment: New changeset 176835c3d5c70f4c1b152cc2062b549144e37094 by Steve Dower in branch 'main': bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736) https://github.com/python/cpython/commit/176835c3d5c70f4c1b152cc2062b549144e37094 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:46:28 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 21:46:28 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646689588.89.0.220258239019.issue46932@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +29855 pull_request: https://github.com/python/cpython/pull/31738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:46:33 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 21:46:33 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646689593.04.0.0230529094431.issue46932@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29856 pull_request: https://github.com/python/cpython/pull/31739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:46:37 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 21:46:37 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646689597.89.0.238121591845.issue46932@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29857 pull_request: https://github.com/python/cpython/pull/31740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 16:46:42 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 21:46:42 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646689602.79.0.136041631085.issue46932@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29858 pull_request: https://github.com/python/cpython/pull/31741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:01:28 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Mar 2022 22:01:28 +0000 Subject: [issue46890] venv does not create "python" link in python 3.11 In-Reply-To: <1646689197.55.0.8791430941.issue46890@roundup.psfhosted.org> Message-ID: <7527fc63-1c40-b043-025c-420bfd846fd4@python.org> Steve Dower added the comment: > This could be problematic, adding a suitably named file outside of $PREFIX breaks the python installation. Might be worth changing it then. I double/triple checked whether searching up for the zip file was the old behaviour, and it sure seemed to be (it wasn't on Windows). Will only be a little tweak to change, since both codepaths are already there. My assumption was that any higher-level directories in that tree would be at least as restricted as where Python is installed, so anyone who could hijack it there could also have modified it closer to the actual file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:17:37 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 22:17:37 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646691457.82.0.49585638911.issue46932@roundup.psfhosted.org> miss-islington added the comment: New changeset 1e52e782f9742242923dec43c2bf8c1455a531e7 by Miss Islington (bot) in branch '3.10': bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736) https://github.com/python/cpython/commit/1e52e782f9742242923dec43c2bf8c1455a531e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:18:32 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Mar 2022 22:18:32 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646691512.22.0.221886694225.issue46932@roundup.psfhosted.org> miss-islington added the comment: New changeset f46a04469114047ff7a4078619450c590ae3f287 by Miss Islington (bot) in branch '3.9': bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736) https://github.com/python/cpython/commit/f46a04469114047ff7a4078619450c590ae3f287 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:18:58 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 07 Mar 2022 22:18:58 +0000 Subject: [issue46933] Make pwd module optional for wasm32-emscripten and wasi In-Reply-To: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> Message-ID: <1646691538.09.0.323767969677.issue46933@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 47cca0492b3c379823d4bdb600be56a633e5bb88 by Erlend Egeberg Aasland in branch 'main': bpo-46933: Fix make distclean regression (GH-31737) https://github.com/python/cpython/commit/47cca0492b3c379823d4bdb600be56a633e5bb88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:41:40 2022 From: report at bugs.python.org (Steven Silvester) Date: Mon, 07 Mar 2022 22:41:40 +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: <1646692900.34.0.14753672376.issue43923@roundup.psfhosted.org> Steven Silvester added the comment: The use case that prompted https://github.com/python/cpython/pull/31679 is that we are adding typings to `PyMongo`. We are late to using typings, because we only recently dropped Python 2.7 support. We have an existing options class that subclasses `NamedTuple`. We would like to make that class `Generic`, but are currently blocked. Our current workaround is to create a separate stub file that uses `class CodecOptions(Tuple, Generic[T])` and explicitly re-declares the `NamedTuple` API. Switching to `dataclass` would be disruptive, since we still support Python 3.6 and only rely on the standard library. We would also require a major version update since it would be an API change. ---------- nosy: +Steven Silvester _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 17:55:05 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 07 Mar 2022 22:55:05 +0000 Subject: [issue45806] Cannot Recover From StackOverflow in 3.9 Tests In-Reply-To: <1636954828.71.0.201093900258.issue45806@roundup.psfhosted.org> Message-ID: <1646693705.84.0.953079023696.issue45806@roundup.psfhosted.org> Dennis Sweeney added the comment: Should this be backported to make the 3.8 Buildbots happy? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 18:11:55 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Mar 2022 23:11:55 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646694715.05.0.420836929395.issue46932@roundup.psfhosted.org> Ned Deily added the comment: New changeset f656bc1cdbdfaaa07f66ed97e011b258b97e2788 by Miss Islington (bot) in branch '3.7': bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736) (GH-31741) https://github.com/python/cpython/commit/f656bc1cdbdfaaa07f66ed97e011b258b97e2788 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 18:15:43 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 07 Mar 2022 23:15:43 +0000 Subject: [issue46947] unicodedata.name gives ValueError for control characters In-Reply-To: <1646666426.33.0.722967640681.issue46947@roundup.psfhosted.org> Message-ID: <1646694943.2.0.0378351351022.issue46947@roundup.psfhosted.org> Steven D'Aprano added the comment: The behaviour is technically correct, but confusing and unfortunate, and I don't think we can fix it. Unicode does not define names for the ASCII control characters. But it does define aliases for them, based on the C0 control char standard. unicodedata.lookup() looks for aliases as well as names (since version 3.3). https://www.unicode.org/Public/UNIDATA/UnicodeData.txt https://www.unicode.org/Public/UNIDATA/NameAliases.txt It is unfortunate that we have only a single function for looking up a unicode code point by name, alias, alias-abbreviation, and named-sequence. That keeps the API simple, but in corner cases like this it leads to confusion. The obvious "fix" is to make name() return the alias if there is no official name to return, but that is a change in behaviour. I have code that assumes that C0 and C1 control characters have no name, and relies on name() raising an exception for them. Even if we changed the behaviour to return the alias, which alias should be returned, the full alias or the abbreviation? This doesn't fix the problem that name() and lookup() aren't inverses of each other: lookup('NUL') -> '\0 # using the abbreviated alias name('\0') -> 'NULL' # returns the full alias (or vice versa) It gets worse with named sequences: >>> c = lookup('LATIN CAPITAL LETTER A WITH MACRON AND GRAVE') >>> name(c) Traceback (most recent call last): File "", line 1, in TypeError: name() argument 1 must be a unicode character, not str >>> len(c) 2 So we cannot possibly make name() and lookup() inverses of each other. What we really should have had is separate functions for name and alias lookups, or better still, to expose the raw unicode tables as mappings and let people create their own higher-level interfaces. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 19:26:39 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 08 Mar 2022 00:26:39 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646699199.4.0.665964623919.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29859 pull_request: https://github.com/python/cpython/pull/31742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 19:37:42 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 08 Mar 2022 00:37:42 +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: <1646699862.89.0.661318357028.issue43923@roundup.psfhosted.org> Guido van Rossum added the comment: Playing tricks where compile-time and run-time see slightly different types is probably more productive than trying to revert a PR that was in Python 3.9 and 3.10. :-) I'm not opposed to supporting generic NamedTuple, but I expect the fix will never hit 3.9 and 3.10, and it needs to be a "fix forward" PR. Would you mind closing the "revert" PR unmerged? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 20:21:08 2022 From: report at bugs.python.org (Joe Cool) Date: Tue, 08 Mar 2022 01:21:08 +0000 Subject: [issue46947] unicodedata.name gives ValueError for control characters In-Reply-To: <1646666426.33.0.722967640681.issue46947@roundup.psfhosted.org> Message-ID: <1646702468.95.0.968450075095.issue46947@roundup.psfhosted.org> Joe Cool added the comment: My recommendation would be to add a keyword parameter, defaulting to False, to name(), something like give_full_alias, or maybe errors=?give_full_alias? like the IO functions. In the meantime, as the author of perllib, I had to make my own dict to return to the user the same thing perl does, which is the full alias for these. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 20:56:17 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 08 Mar 2022 01:56:17 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646704577.42.0.748801825496.issue46948@roundup.psfhosted.org> Gregory P. Smith added the comment: Is there anything on our end we can do to prevent this kind of issue in the future? Am I wrong to see this as just fixing our package to avoid a design flaw in Windows OS level package management? Certainly other packages in the world must run into similar problems. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:49:54 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 03:49:54 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646711394.86.0.73350298069.issue45680@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29860 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:49:59 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 03:49:59 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646711399.59.0.60643906352.issue45680@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29861 pull_request: https://github.com/python/cpython/pull/31744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:50:16 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 03:50:16 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646711416.14.0.0172041361861.issue45680@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 50731297a9b6d57eec3b3f89522785b23f7b3e71 by Alex Waygood in branch 'main': bpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects (GH-29479) https://github.com/python/cpython/commit/50731297a9b6d57eec3b3f89522785b23f7b3e71 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:50:51 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 03:50:51 +0000 Subject: [issue46170] Improving the error message when subclassing NewType In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org> Message-ID: <1646711451.34.0.2786403347.issue46170@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset f391f9bf28f0bba7939d9f9e5a7a6396d2b0df62 by James Hilton-Balfe in branch 'main': bpo-46170: Improve the error message when subclassing NewType (GH-30268) https://github.com/python/cpython/commit/f391f9bf28f0bba7939d9f9e5a7a6396d2b0df62 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:51:06 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 03:51:06 +0000 Subject: [issue46170] Improving the error message when subclassing NewType In-Reply-To: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org> Message-ID: <1646711466.54.0.535422112666.issue46170@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 22:59:23 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 03:59:23 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646711963.11.0.579373999544.issue45680@roundup.psfhosted.org> Jelle Zijlstra added the comment: And now I think we're really done! Thanks for all your work here @AlexWaygood. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:03:36 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 04:03:36 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> New submission from Jelle Zijlstra : New changeset 7a793a388b017be635ea41ef75b0fd8bcf75a309 by Matthew Rahtz in branch 'main': bpo-43224: Implement PEP 646 changes to typing.py (GH-31021) https://github.com/python/cpython/commit/7a793a388b017be635ea41ef75b0fd8bcf75a309 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:04:10 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 04:04:10 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1646712250.33.0.047282348852.issue46494@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 8debeed3075bf4d7e568e65da16bec63cf276f4f by Meer Suri in branch 'main': bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260) https://github.com/python/cpython/commit/8debeed3075bf4d7e568e65da16bec63cf276f4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:04:25 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 04:04:25 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1646712265.85.0.195707733809.issue46494@roundup.psfhosted.org> Jelle Zijlstra 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 Mar 7 23:05:01 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 04:05:01 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1646712301.41.0.128918854132.issue46494@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +29862 pull_request: https://github.com/python/cpython/pull/31746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:05:07 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 04:05:07 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1646712307.7.0.783673052321.issue46494@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29863 pull_request: https://github.com/python/cpython/pull/31747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:13:34 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 04:13:34 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646712814.63.0.301292564013.issue45680@roundup.psfhosted.org> miss-islington added the comment: New changeset 06108c08ddbb4efda804eb74dd33928348102e6f by Miss Islington (bot) in branch '3.10': bpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects (GH-29479) https://github.com/python/cpython/commit/06108c08ddbb4efda804eb74dd33928348102e6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:16:00 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 04:16:00 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646712960.88.0.622553546389.issue45680@roundup.psfhosted.org> miss-islington added the comment: New changeset e83f084084296a9b16b83b324a715045d3614c92 by Miss Islington (bot) in branch '3.9': bpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects (GH-29479) https://github.com/python/cpython/commit/e83f084084296a9b16b83b324a715045d3614c92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:18:52 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 08 Mar 2022 04:18:52 +0000 Subject: [issue46878] [sqlite3] remove "non-standard" from docstrings In-Reply-To: <1646045428.22.0.0724822171916.issue46878@roundup.psfhosted.org> Message-ID: <1646713132.09.0.768277589524.issue46878@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 4d95fa1ac5d31ff450fb2f31b55ce1eb99d6efcb by Erlend Egeberg Aasland in branch 'main': bpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612) https://github.com/python/cpython/commit/4d95fa1ac5d31ff450fb2f31b55ce1eb99d6efcb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:25:50 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 04:25:50 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1646713550.69.0.889683071485.issue46494@roundup.psfhosted.org> miss-islington added the comment: New changeset e053f0e9f41791095a924e2aceaaa025a058ed57 by Miss Islington (bot) in branch '3.10': bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260) https://github.com/python/cpython/commit/e053f0e9f41791095a924e2aceaaa025a058ed57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:29:40 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 04:29:40 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1646713780.49.0.0700269822733.issue46494@roundup.psfhosted.org> miss-islington added the comment: New changeset 0c718e02f60f98275c62e8a2a152f086650e88ea by Miss Islington (bot) in branch '3.9': bpo-46494: Mention the typing_extensions pkg in typing docs (GH-31260) https://github.com/python/cpython/commit/0c718e02f60f98275c62e8a2a152f086650e88ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 7 23:40:33 2022 From: report at bugs.python.org (Henry Finucane) Date: Tue, 08 Mar 2022 04:40:33 +0000 Subject: [issue46951] Zipapp contents are in filesystem-dependent order Message-ID: <1646714432.99.0.924297180253.issue46951@roundup.psfhosted.org> New submission from Henry Finucane : Which makes builds non-reproducible. There was some mention of fixing this in https://bugs.python.org/issue30693, but it never got done. ---------- components: Library (Lib) messages: 414723 nosy: h.finucane priority: normal pull_requests: 29864 severity: normal status: open title: Zipapp contents are in filesystem-dependent order type: enhancement 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 Mar 8 00:17:04 2022 From: report at bugs.python.org (Matt Wozniski) Date: Tue, 08 Mar 2022 05:17:04 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1646716624.49.0.10850417967.issue39829@roundup.psfhosted.org> Matt Wozniski added the comment: Pardon me for necroing an old issue, but someone pointed out the surprising behavior of `__len__` being called twice by `list(iterable)`, and it caught my curiosity. https://github.com/python/cpython/commit/372d705d958964289d762953d0a61622755f5386 made it so that `list.__init__(iterable)` calls `iterable.__len__()` before calling `list.extend()`, to preallocate exactly the right amount of space, rather than allowing `list.extend()` to grow the array. That's because `list.extend()` can over-allocate. What if instead, we made it so that `list.extend(iterable)` doesn't over-allocate when called on an empty list? In the two places where `list_extend` calls `list_resize` to grow the array, we'd check if `self->ob_item == NULL` and if so call `list_preallocate_exact` instead, and we'd remove the call to `list_preallocate_exact` from `list___init___impl`. It seems like that ought to achieve the same goal as making `__init__` call preallocate exactly, without requiring the extra call to `__len__`. ---------- nosy: +godlygeek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:30:02 2022 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 08 Mar 2022 05:30:02 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1646717402.09.0.481223177902.issue2771@roundup.psfhosted.org> Change by Ezio Melotti : ---------- dependencies: +Add math.tau, Python source code build fails with old mercurial superseder: -> Test issue _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:48:52 2022 From: report at bugs.python.org (=?utf-8?b?66+47IKs7J28?=) Date: Tue, 08 Mar 2022 05:48:52 +0000 Subject: [issue46952] pip progress bar display bug Message-ID: <1646718532.53.0.0764586744515.issue46952@roundup.psfhosted.org> New submission from ??? : Pip progress bar isn't connect each other and overlap with other components. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 414725 nosy: misileminecord priority: normal severity: normal status: open title: pip progress bar display bug versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:48:58 2022 From: report at bugs.python.org (=?utf-8?b?66+47IKs7J28?=) Date: Tue, 08 Mar 2022 05:48:58 +0000 Subject: [issue46952] pip progress bar display bug In-Reply-To: <1646718532.53.0.0764586744515.issue46952@roundup.psfhosted.org> Message-ID: <1646718538.17.0.739766517633.issue46952@roundup.psfhosted.org> Change by ??? : ---------- components: -2to3 (2.x to 3.x conversion tool) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:50:15 2022 From: report at bugs.python.org (=?utf-8?b?66+47IKs7J28?=) Date: Tue, 08 Mar 2022 05:50:15 +0000 Subject: [issue46952] pip progress bar display bug In-Reply-To: <1646718532.53.0.0764586744515.issue46952@roundup.psfhosted.org> Message-ID: <1646718615.91.0.867597363653.issue46952@roundup.psfhosted.org> Change by ??? : Added file: https://bugs.python.org/file50663/screen.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:53:13 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 08 Mar 2022 05:53:13 +0000 Subject: [issue46952] pip progress bar display bug In-Reply-To: <1646718532.53.0.0764586744515.issue46952@roundup.psfhosted.org> Message-ID: <1646718793.31.0.806461080786.issue46952@roundup.psfhosted.org> Dennis Sweeney added the comment: pip is maintained externally at https://github.com/pypa/pip , so that is likely a better place to open an issue about pip. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 00:59:57 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 08 Mar 2022 05:59:57 +0000 Subject: [issue46952] pip progress bar display bug In-Reply-To: <1646718532.53.0.0764586744515.issue46952@roundup.psfhosted.org> Message-ID: <1646719197.39.0.0400050783777.issue46952@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:02:46 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 08 Mar 2022 06:02:46 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1646719366.89.0.653740760945.issue39829@roundup.psfhosted.org> Dennis Sweeney added the comment: Related to Matt's idea is https://bugs.python.org/issue43574 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:36:11 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 08 Mar 2022 06:36:11 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1646721371.73.0.361010199442.issue39829@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 01:36:25 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 08 Mar 2022 06:36:25 +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: <1646721385.06.0.508764775376.issue43574@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 02:27:36 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 08 Mar 2022 07:27:36 +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: <1646724456.26.0.0445524485483.issue43574@roundup.psfhosted.org> Inada Naoki added the comment: Relating issue: https://twitter.com/nedbat/status/1489233208713437190 Current overallocation strategy is rough. We need to make it more smooth. ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 02:52:36 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 08 Mar 2022 07:52:36 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin Message-ID: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> New submission from Kumar Aditya : Use FASTCALL for __import__ builtin. Benchmark: -------------------------------------------------------------------------- import pyperf runner = pyperf.Runner() runner.timeit(name="bench __import__", stmt="__import__('asyncio')" ------------------------------------------------------------------------ Result: Mean +- std dev: [base] 191 ns +- 16 ns -> [patch] 112 ns +- 11 ns: 1.71x faster ---------- components: Interpreter Core messages: 414729 nosy: Dennis Sweeney, Mark.Shannon, kumaraditya303 priority: normal pull_requests: 29865 severity: normal status: open title: use FASTCALL for __import__ builtin type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 02:55:01 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 08 Mar 2022 07:55:01 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1646726101.51.0.588010756116.issue45680@roundup.psfhosted.org> Alex Waygood added the comment: Thanks so much to Ken, ?ukasz, Jelle, Guido, and everybody else who helped review these PRs! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 03:26:43 2022 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 08 Mar 2022 08:26:43 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1646728003.41.0.548682733284.issue40059@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 591f6754b56cb7f6c31fce8c22528bdf0a99556c by Taneli Hukkinen in branch 'main': bpo-40059: Add tomllib (PEP-680) (GH-31498) https://github.com/python/cpython/commit/591f6754b56cb7f6c31fce8c22528bdf0a99556c ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 03:30:26 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 08 Mar 2022 08:30:26 +0000 Subject: [issue46878] [sqlite3] remove "non-standard" from docstrings In-Reply-To: <1646045428.22.0.0724822171916.issue46878@roundup.psfhosted.org> Message-ID: <1646728226.6.0.100119814801.issue46878@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +29866 pull_request: https://github.com/python/cpython/pull/31753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 03:31:53 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 08 Mar 2022 08:31:53 +0000 Subject: [issue46878] [sqlite3] remove "non-standard" from docstrings In-Reply-To: <1646045428.22.0.0724822171916.issue46878@roundup.psfhosted.org> Message-ID: <1646728313.25.0.738312482134.issue46878@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +29867 pull_request: https://github.com/python/cpython/pull/31754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:03:46 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 08 Mar 2022 09:03:46 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646730226.98.0.93031645251.issue46932@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c3ec5bc1b7a14b04621920f111aee01c31f6f1c1 by Miss Islington (bot) in branch '3.8': bpo-46932: Update bundled libexpat to 2.4.7 (GH-31736) (GH-31740) https://github.com/python/cpython/commit/c3ec5bc1b7a14b04621920f111aee01c31f6f1c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:04:35 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 08 Mar 2022 09:04:35 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646730275.88.0.817477057307.issue46948@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset cff1b78c1dfb2a62b1e16fabc5f43bc3634d9de7 by Steve Dower in branch '3.8': bpo-46948: Fix CVE-2022-26488 by ensuring the Windows Installer correctly uses the install path during repair (GH-31729) https://github.com/python/cpython/commit/cff1b78c1dfb2a62b1e16fabc5f43bc3634d9de7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:05:05 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 08 Mar 2022 09:05:05 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646730305.04.0.683194454007.issue44549@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6649519e67841b1aa12672f1d9b5cb24494f6196 by Steve Dower in branch '3.8': bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900 (GH-31732) (GH-31734) https://github.com/python/cpython/commit/6649519e67841b1aa12672f1d9b5cb24494f6196 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:11:31 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2022 09:11:31 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1646730691.61.0.400925745639.issue46953@roundup.psfhosted.org> Serhiy Storchaka added the comment: __import__() usually is not called directly, and in common case (when it is not overridden) the overhead of the call is avoided completely in the import statement. And in non-trivial case, it would only save 80 microseconds if you import 1000 modules. I don't think there are many programs which import more than 1000 modules. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:21:03 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2022 09:21:03 +0000 Subject: [issue46947] unicodedata.name gives ValueError for control characters In-Reply-To: <1646666426.33.0.722967640681.issue46947@roundup.psfhosted.org> Message-ID: <1646731263.79.0.963335231871.issue46947@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a duplicate of issue18234. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unicodedata module should provide access to codepoint aliases _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:35:01 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 09:35:01 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1646732101.89.0.505481408792.issue44439@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29869 pull_request: https://github.com/python/cpython/pull/31756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:35:02 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2022 09:35:02 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1646732102.09.0.0912021303159.issue44439@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 36dd7396fcd26d8bf9919d536d05d7000becbe5b by Ma Lin in branch 'main': bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468) https://github.com/python/cpython/commit/36dd7396fcd26d8bf9919d536d05d7000becbe5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:34:57 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 09:34:57 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1646732097.14.0.139138950201.issue44439@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29868 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:35:51 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 08 Mar 2022 09:35:51 +0000 Subject: [issue46784] Duplicated symbols when linking embedded Python with libexpat In-Reply-To: <1645140945.97.0.0561003008604.issue46784@roundup.psfhosted.org> Message-ID: <1646732151.75.0.508946460381.issue46784@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ccbc31ecf3a08ef626be9bbb099f0ce801142fc8 by Miss Islington (bot) in branch '3.8': bpo-46784: Add newly exported expat symbols to the namespace. (GH-31397) (GH-31419) https://github.com/python/cpython/commit/ccbc31ecf3a08ef626be9bbb099f0ce801142fc8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:51:03 2022 From: report at bugs.python.org (David M.) Date: Tue, 08 Mar 2022 09:51:03 +0000 Subject: [issue46954] Awaiting multiple times on same task increases memory usage unboundedly Message-ID: <1646733063.02.0.0306040798156.issue46954@roundup.psfhosted.org> New submission from David M. : Awaiting multiple times on a single task that failed with an exception results in an unbounded increase in memory usage. Enough repeated "await"s of the task can result in an OOM. The same pattern on a task that didn't raise an exception behaves as expected. The attached short script ends up using more than 1GB of memory in less than a minute. ---------- components: asyncio files: multi_await_exception.py messages: 414739 nosy: asvetlov, davidmanzanares, yselivanov priority: normal severity: normal status: open title: Awaiting multiple times on same task increases memory usage unboundedly versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50664/multi_await_exception.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:57:40 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 08 Mar 2022 09:57:40 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1646733460.51.0.670130422192.issue46953@roundup.psfhosted.org> Kumar Aditya added the comment: The PR uses argument clinic and not hand written parsing code, which in turn is faster. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 04:59:29 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 09:59:29 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646733569.33.0.877823760212.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29870 pull_request: https://github.com/python/cpython/pull/31757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:01:14 2022 From: report at bugs.python.org (Stefan Zabka) Date: Tue, 08 Mar 2022 10:01:14 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. Message-ID: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> New submission from Stefan Zabka : The asyncio documentation claims that there is a class [asyncio.Server](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.Server). However when looking in the sources I can only find [asyncio.base_events.Server](https://github.com/python/cpython/blob/be095f6c32188bba02079d086ac8639ea37cec3c/Lib/asyncio/base_events.py#L274-L384) which does not get exposed via `__all__` and can not be imported as asyncio.Server. I had to name the type as I wanted to use this class as a type annotation for mypy. ---------- components: asyncio messages: 414741 nosy: asvetlov, vringar, yselivanov priority: normal severity: normal status: open title: The documentation mentions asyncio.Server. It does not exist. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:03:56 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 10:03:56 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1646733836.88.0.571814171489.issue44439@roundup.psfhosted.org> miss-islington added the comment: New changeset 21c5b3f73fb11fb0d3239971f72e8f0574a07245 by Miss Islington (bot) in branch '3.10': bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468) https://github.com/python/cpython/commit/21c5b3f73fb11fb0d3239971f72e8f0574a07245 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:05:04 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 10:05:04 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1646733903.97.0.303354634206.issue44439@roundup.psfhosted.org> miss-islington added the comment: New changeset 0663ca17f5535178c083c6734fa52e40bd2db2de by Miss Islington (bot) in branch '3.9': bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468) https://github.com/python/cpython/commit/0663ca17f5535178c083c6734fa52e40bd2db2de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:08:35 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 08 Mar 2022 10:08:35 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1646734115.79.0.567238500731.issue46953@roundup.psfhosted.org> Kumar Aditya added the comment: Occurrence of __import__ calls in stdlib: grep __import__ Lib/*/*.py | wc -l 28 It is common to import directly via __import__ outside the stdlib too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:09:03 2022 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgVmFza8Oz?=) Date: Tue, 08 Mar 2022 10:09:03 +0000 Subject: [issue46956] TextIOWrapper.seek silently wraps around on very large offsets Message-ID: <1646734143.44.0.894485976083.issue46956@roundup.psfhosted.org> New submission from L?szl? Vask? : `f.seek()` method may silently wrap around at offsets greater than `1 << 64` (on AMD64) but return the original seek offset: $ strace -e lseek python3 [...] bunch of strace output >>> f = open("/tmp/whatever", "w") [...] bunh of strace output >>> f.seek((1 << 64) + 1234) lseek(3, 1234, SEEK_SET) = 1234 18446744073709552850 >>> _ == (1 << 64) + 1234 True When the MSB is set to `1` (e.g. it represents a negative `long` number) it will indeed overflow and raise on error: >>> f.seek((1<<64) - 1) lseek(3, -1, SEEK_SET) = -1 EINVAL (Invalid argument) Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument This causes a confusing behavior that using erroneously big seek offsets may or may not return an error depending on the MSB value. The expected behavior would be that both the above calls fail in accordance with the Zen of Python: > Errors should never pass silently. > Unless explicitly silenced. The issue is only present for text mode files, binary files raise an error, as expected: ValueError: cannot fit 'int' into an offset-sized integer After some digging I found that the issue comes from `TextIOWrapper`, particularly from `textiowrapper_parse_cookie(cookie_type *cookie, PyObject *cookieObj)` calling `PyNumber_Long` silently truncating the incoming size to 64 bits. The issue can be reproduced on Python 2.7 when using `io.open` in text mode. ---------- components: IO messages: 414745 nosy: vlaci priority: normal severity: normal status: open title: TextIOWrapper.seek silently wraps around on very large offsets type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:35:04 2022 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 08 Mar 2022 10:35:04 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1646735704.39.0.292728075097.issue40059@roundup.psfhosted.org> Petr Viktorin added the comment: The PR is merged and buildbots are green. Thank you to everyone who helped! Now would be a good time to bikeshed wording in the documentation. >From the PR: > Would it be good to mention in the docs why load() takes only binary files? The encoding requirement probably isn't obvious for first-time users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:35:54 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 10:35:54 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1646735754.26.0.743174739232.issue23325@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29871 pull_request: https://github.com/python/cpython/pull/31759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:39:45 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 10:39:45 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1646735985.93.0.297669978744.issue23325@roundup.psfhosted.org> Christian Heimes added the comment: My PR 31759 removes the assumption of small int singletons and replaces C comparison with PyObject_RichCompareBool() Py_EQ calls. I still prefer Serhiy's solution, but it may cause backwards incompatible breakage. My fix can be backported to 3.9 and 3.10 without breakage. It resolves my failing tests on Emscripten, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 05:52:26 2022 From: report at bugs.python.org (Zsolt Cserna) Date: Tue, 08 Mar 2022 10:52:26 +0000 Subject: [issue46956] TextIOWrapper.seek silently wraps around on very large offsets In-Reply-To: <1646734143.44.0.894485976083.issue46956@roundup.psfhosted.org> Message-ID: <1646736746.13.0.690676482445.issue46956@roundup.psfhosted.org> Change by Zsolt Cserna : ---------- nosy: +csernazs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 06:18:21 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 11:18:21 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646738301.23.0.224246071483.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 5081e78efde901556398615eb477c63c836686e5 by Christian Heimes in branch 'main': bpo-40280: Block more non-working syscalls in Emscripten (GH-31757) https://github.com/python/cpython/commit/5081e78efde901556398615eb477c63c836686e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:06:35 2022 From: report at bugs.python.org (Stefan Zabka) Date: Tue, 08 Mar 2022 12:06:35 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646741195.98.0.101901746429.issue46955@roundup.psfhosted.org> Change by Stefan Zabka : ---------- keywords: +patch pull_requests: +29872 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:29:48 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2022 12:29:48 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1646742588.16.0.907767376129.issue23325@roundup.psfhosted.org> Serhiy Storchaka added the comment: Agree. There were too many changes in this code, and making SIG_DFL and SIG_IGN functions exposes some issues with sharing objects between interpreters. It is easier to keep them integers for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:45:10 2022 From: report at bugs.python.org (Govinda Totla) Date: Tue, 08 Mar 2022 12:45:10 +0000 Subject: [issue46957] Logger with a custom class breaks on copy Message-ID: <1646743510.47.0.936024668329.issue46957@roundup.psfhosted.org> New submission from Govinda Totla : The logging module allows you set a custom Logger class as the default logger. However, this breaks when we try to copy the logger which was created before setting the logger class ``` import copy import logging # Some module we don't control oldLogger = logging.getLogger("abc") # Some module where we want to change over to custom logging class MyLogger(logging.Logger): pass # Override the manager, root, etc., so everything uses our class logging.setLoggerClass(MyLogger) logging.root = root = MyLogger("", logging.WARNING) logging.Logger.manager = logging.Manager(root) newLogger = logging.getLogger("def") # Later on this happens, which internally calls __reduce__ copy.deepcopy(oldLogger) ``` ---------- components: Library (Lib) messages: 414750 nosy: govinda18 priority: normal severity: normal status: open title: Logger with a custom class breaks on copy type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 07:46:36 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Mar 2022 12:46:36 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1646743596.4.0.18778335529.issue46953@roundup.psfhosted.org> Serhiy Storchaka added the comment: The recommended way is to use importlib.import_module(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:29:59 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2022 13:29:59 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1646746199.32.0.399693566852.issue46948@roundup.psfhosted.org> Steve Dower added the comment: > Is there anything on our end we can do to prevent this kind of issue in the future? Probably not, I think it's just a lesson learned about the capabilities of the MSI format and its integration with Windows (well, we could hurry up moving everyone to the Windows Store, which doesn't have this issue, but that seems unlikely ;) ) Similar issues have been reported to the Windows Installer team (e.g. CVE-2021-41379, CVE-2021-26415) that could have been fixed by disabling the unelevated repair function, but weren't. So I think it just has to become a known thing for people building MSIs that a "repair" can be run by non-elevated users, and install-time variables may not be preserved for the repair. (In our case, that means actually searching for the existing install rather than trusting the variable our bundle normally provides to the MSI.) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:30:36 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2022 13:30:36 +0000 Subject: [issue44549] Update Windows installer to use bzip2 1.0.8 In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1646746236.85.0.128691010265.issue44549@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:30:31 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Mar 2022 13:30:31 +0000 Subject: [issue46932] Please update bundled libexpat to 2.4.7 with an important fix In-Reply-To: <1646503398.23.0.962856817439.issue46932@roundup.psfhosted.org> Message-ID: <1646746231.32.0.305389553894.issue46932@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 Tue Mar 8 08:31:52 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 08 Mar 2022 13:31:52 +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: <1646746312.59.0.156138630948.issue37179@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:32:40 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 08 Mar 2022 13:32:40 +0000 Subject: [issue36098] asyncio: ssl client-server with "slow" read In-Reply-To: <1550967725.88.0.520289067216.issue36098@roundup.psfhosted.org> Message-ID: <1646746360.76.0.063238972605.issue36098@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks for checking ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 08:59:16 2022 From: report at bugs.python.org (Daniel) Date: Tue, 08 Mar 2022 13:59:16 +0000 Subject: [issue46958] json dump/dumps prints each array element on a new line (bad for readability) Message-ID: <1646747956.14.0.613524848103.issue46958@roundup.psfhosted.org> Change by Daniel : ---------- components: Library (Lib) nosy: Entirity priority: normal severity: normal status: open title: json dump/dumps prints each array element on a new line (bad for readability) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:02:35 2022 From: report at bugs.python.org (Steven Silvester) Date: Tue, 08 Mar 2022 14:02:35 +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: <1646748155.95.0.220887996179.issue43923@roundup.psfhosted.org> Steven Silvester added the comment: I agree we're stuck with the typing stub workaround for our use case. We can re-submit a "fix forward" PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:04:22 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 08 Mar 2022 14:04:22 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1646748262.51.0.84608401131.issue46953@roundup.psfhosted.org> Mark Shannon added the comment: Serhiy, what is the advantage of __import__ being slower? Not counting the argument clinic generated code, the PR doesn't add any code and improves the docstring. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:20:52 2022 From: report at bugs.python.org (Daniel) Date: Tue, 08 Mar 2022 14:20:52 +0000 Subject: [issue46958] json dump/dumps prints each array element on a new line (bad for readability) Message-ID: <1646749252.83.0.0124065774662.issue46958@roundup.psfhosted.org> Change by Daniel : ---------- keywords: +patch pull_requests: +29873 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:41:05 2022 From: report at bugs.python.org (Charlie Yan) Date: Tue, 08 Mar 2022 14:41:05 +0000 Subject: [issue46926] runpy.run_path didn't set __package__ to None as describe in doc In-Reply-To: <1646438499.21.0.962171023528.issue46926@roundup.psfhosted.org> Message-ID: <1646750465.1.0.00325256153416.issue46926@roundup.psfhosted.org> Change by Charlie Yan : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:44:21 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 08 Mar 2022 14:44:21 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646750661.98.0.414319212475.issue46955@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 09:58:43 2022 From: report at bugs.python.org (Barry Davis) Date: Tue, 08 Mar 2022 14:58:43 +0000 Subject: [issue46959] ctypes.util.find_library can delete /dev/null Message-ID: <1646751523.29.0.484402205721.issue46959@roundup.psfhosted.org> New submission from Barry Davis : This bug exists again: https://bugs.python.org/issue1521375 In ctypes/util we defend against gcc removing /dev/null by using a temp file, but similar code for ld still uses /dev/null, resulting in it removing /dev/null if it has permission, i.e. if running as root. Reproduction steps in the original bug still work I think. I found this when running pyinstaller. I slimmed the test case down to: import ctypes.util libname = ctypes.util.find_library("ApplicationServices") Here's my patch (indentation is wrong to just show the actual change needed): --- Python-3.10.2/Lib/ctypes/util.py 2022-03-08 14:34:52.188808751 +0000 +++ Python-3.10.2/Lib/ctypes/util.py 2022-03-08 14:40:23.604615242 +0000 @@ -305,9 +305,11 @@ if libpath: for d in libpath.split(':'): cmd.extend(['-L', d]) - cmd.extend(['-o', os.devnull, '-l%s' % name]) - result = None + temp = tempfile.NamedTemporaryFile() try: + cmd.extend(['-o', temp.name, '-l%s' % name]) + result = None + try: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) @@ -320,8 +322,15 @@ if not _is_elf(file): continue return os.fsdecode(file) - except Exception: + except Exception: pass # result will be None + finally: + try: + temp.close() + except FileNotFoundError: + # Raised if the file was already removed, which is the normal + # behaviour if linking fails + pass return result def find_library(name): ---------- components: Library (Lib) messages: 414756 nosy: barry.c.davis priority: normal severity: normal status: open title: ctypes.util.find_library can delete /dev/null type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:20:22 2022 From: report at bugs.python.org (Vidhya) Date: Tue, 08 Mar 2022 15:20:22 +0000 Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode header In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za> Message-ID: <1646752822.29.0.667960164441.issue17505@roundup.psfhosted.org> Change by Vidhya : ---------- keywords: +patch pull_requests: +29874 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:23:43 2022 From: report at bugs.python.org (Vidhya) Date: Tue, 08 Mar 2022 15:23:43 +0000 Subject: [issue17505] [doc] email.header.Header.__unicode__ does not decode header In-Reply-To: <1363852013.63.0.253070231302.issue17505@psf.upfronthosting.co.za> Message-ID: <1646753023.13.0.418907682178.issue17505@roundup.psfhosted.org> Vidhya added the comment: The PR for the email parser doc update is: https://github.com/python/cpython/pull/31765 Can someone review it pls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:30:25 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 15:30:25 +0000 Subject: [issue46878] [sqlite3] remove "non-standard" from docstrings In-Reply-To: <1646045428.22.0.0724822171916.issue46878@roundup.psfhosted.org> Message-ID: <1646753425.62.0.242041156353.issue46878@roundup.psfhosted.org> miss-islington added the comment: New changeset f3d3b2d5c5599272660f4bbd5103aa8abc7c48c4 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612) (GH-31753) https://github.com/python/cpython/commit/f3d3b2d5c5599272660f4bbd5103aa8abc7c48c4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:31:12 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 15:31:12 +0000 Subject: [issue46878] [sqlite3] remove "non-standard" from docstrings In-Reply-To: <1646045428.22.0.0724822171916.issue46878@roundup.psfhosted.org> Message-ID: <1646753472.53.0.556289069895.issue46878@roundup.psfhosted.org> miss-islington added the comment: New changeset 653ca6c62b0c3272310f7fa5ce9c6939e3c41d91 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612) (GH-31754) https://github.com/python/cpython/commit/653ca6c62b0c3272310f7fa5ce9c6939e3c41d91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:32:56 2022 From: report at bugs.python.org (Thomas Guettler) Date: Tue, 08 Mar 2022 15:32:56 +0000 Subject: [issue46960] Docs: Link from settrace to frame Message-ID: <1646753576.46.0.958795428095.issue46960@roundup.psfhosted.org> New submission from Thomas Guettler : https://docs.python.org/3.10/library/sys.html#sys.settrace > Trace functions should have three arguments: frame, event, and arg. frame is the current stack frame. It would be super cool, if "current stack frame" could be a hyperlink to the docs about "frame". ---------- messages: 414761 nosy: guettli priority: normal severity: normal status: open title: Docs: Link from settrace to frame _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:48:45 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 08 Mar 2022 15:48:45 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails Message-ID: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> New submission from Steven D'Aprano : I'm reluctant to call this a bug, as small int interning/caching is an implementation detail and there are no hard guarantees made. But on the other hand, it seems that the intention is that small ints such as 0, 1 and 2 should be cached. Here are some examples where they are not. Intentional or a bug? >>> x = 1 >>> y = pow(2, 31, 2**31-1) >>> y == x True >>> y is x False >>> x = 2 >>> y = pow(2, 31, 2**31-2) >>> y == x True >>> y is x False It also affects values which are presumably constant-folded at compile time: >>> x = 1 >>> y = 2**31 % (2**31 - 1) >>> z = 2**31 % (2**31 - 1) >>> x == y == z True >>> x is y False >>> y is z False >>> x is z False But if you run the code in exec, the value is interned: >>> code = """ ... x = 1 ... y = 2**31 % (2**31-1) ... """ >>> dis(code) 2 0 LOAD_CONST 0 (1) 2 STORE_NAME 0 (x) 3 4 LOAD_CONST 0 (1) 6 STORE_NAME 1 (y) 8 LOAD_CONST 1 (None) 10 RETURN_VALUE >>> exec(code) >>> x is y True Also affects zero: >>> x = 0 >>> y = 2**29 % (2**29) >>> x is y True >>> y = 2**30 % (2**30) >>> x is y False First noted here: https://discuss.python.org/t/cached-integer-id-on-high-calculations/14128/1 >>> sys.version '3.10.0 (default, Oct 28 2021, 20:43:43) [GCC 8.3.1 20190223 (Red Hat 8.3.1-2)]' ---------- components: Interpreter Core messages: 414762 nosy: steven.daprano priority: normal severity: normal status: open title: Caching/interning of small ints sometimes fails type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 10:53:51 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 08 Mar 2022 15:53:51 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646754831.23.0.204170893007.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 5498a61c7c25db6f9e76032aa9c5153d79e09889 by Brandt Bucher in branch 'main': bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742) https://github.com/python/cpython/commit/5498a61c7c25db6f9e76032aa9c5153d79e09889 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 12:01:19 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 08 Mar 2022 17:01:19 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails In-Reply-To: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> Message-ID: <1646758879.96.0.263236399364.issue46961@roundup.psfhosted.org> Alex Waygood added the comment: I think this might be a duplicate of Issue46361? ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:21:06 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 08 Mar 2022 18:21:06 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails In-Reply-To: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> Message-ID: <1646763666.6.0.96459847791.issue46961@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:22:42 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 18:22:42 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1646763762.01.0.348330256886.issue23325@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +29876 pull_request: https://github.com/python/cpython/pull/31768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:22:48 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 18:22:48 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1646763768.6.0.979288231127.issue23325@roundup.psfhosted.org> miss-islington added the comment: New changeset c8a47e76a391c8818bf10a282cdcd3bb5c23ebf6 by Christian Heimes in branch 'main': bpo-23325: Fix SIG_IGN and SIG_DFL int comparison in signal module (GH-31759) https://github.com/python/cpython/commit/c8a47e76a391c8818bf10a282cdcd3bb5c23ebf6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:24:11 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 08 Mar 2022 18:24:11 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails In-Reply-To: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> Message-ID: <1646763851.97.0.565385590431.issue46961@roundup.psfhosted.org> Brandt Bucher added the comment: Related, except this seems to be happening in long_pow. I?ll take a look at it today. ---------- assignee: -> brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:53:31 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 18:53:31 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1646765611.91.0.620860435162.issue23325@roundup.psfhosted.org> miss-islington added the comment: New changeset 95b001fe6766f491f4356f8bcf23d6895bab2342 by Miss Islington (bot) in branch '3.10': bpo-23325: Fix SIG_IGN and SIG_DFL int comparison in signal module (GH-31759) https://github.com/python/cpython/commit/95b001fe6766f491f4356f8bcf23d6895bab2342 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 13:59:44 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Tue, 08 Mar 2022 18:59:44 +0000 Subject: [issue46962] Fix docstrings that do not honor --without-doc-strings Message-ID: <1646765984.56.0.127425634873.issue46962@roundup.psfhosted.org> New submission from Oleg Iarygin : To support `--without-doc-strings`, all docstrings must be wrapped into `PyDoc_STRVAR` or `PyDoc_STR` (PEP 7). However, there are 18 occurrences in code and 10 in C API documentation that do not follow this rule. The documentation is important too because it should not teach people the wrong things. To find the occurrences I searched for `(?:^\s*.tp_doc = "|" \/\* tp_doc \*\/$)` and`^(?:static\s+)?const\s+char\s+[^=]+=\s*"`. ---------- assignee: docs at python components: Documentation, Extension Modules, Interpreter Core messages: 414768 nosy: arhadthedev, docs at python priority: normal severity: normal status: open title: Fix docstrings that do not honor --without-doc-strings type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:01:28 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Tue, 08 Mar 2022 19:01:28 +0000 Subject: [issue46962] Fix docstrings that do not honor --without-doc-strings In-Reply-To: <1646765984.56.0.127425634873.issue46962@roundup.psfhosted.org> Message-ID: <1646766088.48.0.709303485887.issue46962@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +29877 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:25:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 19:25:50 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646767550.33.0.712557625045.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29878 pull_request: https://github.com/python/cpython/pull/31770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:32:14 2022 From: report at bugs.python.org (=?utf-8?b?R2VybcOhbiBNw6luZGV6IEJyYXZv?=) Date: Tue, 08 Mar 2022 19:32:14 +0000 Subject: [issue46963] Deep Lazy Imports - Interpreter-level deferred module loading Message-ID: <1646767934.68.0.126950906489.issue46963@roundup.psfhosted.org> New submission from Germ?n M?ndez Bravo : As the size of a Python project increases, the number of modules and the complexity of its dependencies increases too, producing two problems in large codebases: increased risk of import cycles and slow start times due to the number of modules that tend to need getting loaded. We propose implementing a robust and transparent lazy loader in CPython, based on an existing implementation we have in Cinder that proved to be extremely valuable to thousands of developers across Meta, and battle-tested in Instagram Server in production (https://docs.google.com/document/d/1l8I-FDE1xrIShm9eSNJqsGmY_VanMDX5-aK_gujhYBI/edit#heading=h.pu7ja6wu0ib). Our internal implementation is based on introducing deferred objects and converting top-level imported names to these deferred objects that are evaluated on first use. Enabling this across multiple types of workloads in Meta consistently shown improvements in startup times (up to 70%) and memory footprint (up to 40%), while virtually eliminating occurrences of import cycles. Converting imported names to deferred objects is a semantic change, and the benefits are usually meaningful only at very large scale, so we propose not changing the default behavior, and making it possible for users to opt-in to this lazy loading mechanism via -x flags or environment variables. This change would require related documentation changes that would cover the gotchas and edge cases, such as: some packages rely and import-time side-effects for correct operation; nested modules can?t be accessed unless imported explicitly; deferred loading may also defer exceptions from import time and first-access time which could be confusing. The import-time side effects gotcha can be mitigated using eager-import lists and directives, though it could be desirable to use this as a forcing function to discourage package maintainers from relying on these side-effects. ---------- components: Interpreter Core messages: 414770 nosy: Kronuz, carljm, dino.viehland, itamaro priority: normal severity: normal status: open title: Deep Lazy Imports - Interpreter-level deferred module loading type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:38:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 08 Mar 2022 19:38:48 +0000 Subject: [issue29251] [doc] Class __dict__ is only a mapping proxy In-Reply-To: <1484222660.7.0.65822313324.issue29251@psf.upfronthosting.co.za> Message-ID: <1646768328.8.0.81899502162.issue29251@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Stanley, I agree that this is no longer needed. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:27:56 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 19:27:56 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646767676.63.0.210063449212.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: I have fixed a signal-related issue in GH-31768 / bpo-23325 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 14:55:53 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 08 Mar 2022 19:55:53 +0000 Subject: [issue46964] The global config should not be stored on each interpreter Message-ID: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> New submission from Eric Snow : tl;dr let's move PyInterpreterState.config to _PyRuntimeState.config. Historically the runtime has been initialized using Py_Initialize(). PEP 587 added Py_InitializeFromConfig(), which takes a PyConfig and allows all sorts of customization of the runtime. This is valuable for embedders (and benefits core development too). During runtime initialization the given config is copied and stored internally on the main interpreter. Once initialization completes, the config is no longer modified. The config values are then used in a variety of places during execution. If a new interpreter is created then the config from the current (or main) interpreter are copied into it. Note the following: * the config is never modified * there is no public API for getting the config or changing it * there is no API for creating an interpreter with a different config * the fact that the config is stored on the interpreter is an internal detail and not documented (nor discussed in PEP 587) Consequently, PyConfig really is the global runtime config. Yet we are storing a copy of it on each interpreter. Doing so unnecessarily adds extra complexity (and, when multiple interpreters are used, extra CPU usage and extra memory usage). So I propose that we move the config to _PyRuntimeState. The change isn't big nor all that complex. Note that actually there is one field that can differ between interpreters: PyConfig._isolated_interpreter (set in _Py_NewInterpreter()). We can move that one field to a new per-interpreter config struct. ---------- assignee: eric.snow components: C API, Interpreter Core messages: 414772 nosy: eric.snow, vstinner priority: normal severity: normal stage: needs patch status: open title: The global config should not be stored on each interpreter versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 15:16:08 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 08 Mar 2022 20:16:08 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1646770568.19.0.0231565995861.issue46964@roundup.psfhosted.org> Change by Eric Snow : ---------- keywords: +patch pull_requests: +29879 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31771 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 15:27:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 08 Mar 2022 20:27:50 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1646771270.68.0.172815494991.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: @gtitze - are you still planning to work on this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:03:55 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 08 Mar 2022 21:03:55 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1646773435.65.0.148487041207.issue14911@roundup.psfhosted.org> Guido van Rossum added the comment: This still hasn't been fixed. I suspect that a new patch should be produced and uploaded as a PR. It looks pretty simple. ---------- keywords: +easy nosy: +gvanrossum 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 Mar 8 16:07:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 08 Mar 2022 21:07:42 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646773662.32.0.659444109056.issue46955@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset da80d6b2f3beff519cb1457d5e055168c89f7224 by Stefan Zabka in branch 'main': bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760) https://github.com/python/cpython/commit/da80d6b2f3beff519cb1457d5e055168c89f7224 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:07:48 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 21:07:48 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646773668.23.0.431231994651.issue46955@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +29880 pull_request: https://github.com/python/cpython/pull/31773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:09:28 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 21:09:28 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646773768.4.0.130270389367.issue46955@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29881 pull_request: https://github.com/python/cpython/pull/31774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:33:17 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 21:33:17 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646775197.22.0.25707433593.issue46955@roundup.psfhosted.org> miss-islington added the comment: New changeset 20e88f78a39ff56235c1d42ba4b947f5fa8e67b7 by Miss Islington (bot) in branch '3.9': bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760) https://github.com/python/cpython/commit/20e88f78a39ff56235c1d42ba4b947f5fa8e67b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:36:53 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 21:36:53 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646775413.9.0.694531563105.issue46955@roundup.psfhosted.org> miss-islington added the comment: New changeset 8de434b332ed92ba2db90de6ed0969aee23735c2 by Miss Islington (bot) in branch '3.10': bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760) https://github.com/python/cpython/commit/8de434b332ed92ba2db90de6ed0969aee23735c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:43:59 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 21:43:59 +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: <1646775839.84.0.14580065896.issue24959@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +29882 pull_request: https://github.com/python/cpython/pull/31775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:44:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 08 Mar 2022 21:44:03 +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: <1646775843.73.0.755721690861.issue24959@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 88b7d86a73da9388aa65c96401c2984c8c16f8db by Irit Katriel in branch 'main': bpo-24959: fix unittest.assertRaises bug where traceback entries are dropped from chained exceptions (GH-23688) https://github.com/python/cpython/commit/88b7d86a73da9388aa65c96401c2984c8c16f8db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:46:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 08 Mar 2022 21:46:14 +0000 Subject: [issue46955] The documentation mentions asyncio.Server. It does not exist. In-Reply-To: <1646733674.64.0.0195337794151.issue46955@roundup.psfhosted.org> Message-ID: <1646775974.62.0.593905589098.issue46955@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 16:56:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 08 Mar 2022 21:56:33 +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: <1646776593.26.0.594962051341.issue24959@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29883 pull_request: https://github.com/python/cpython/pull/31776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 17:09:32 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Mar 2022 22:09:32 +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: <1646777372.46.0.778269801038.issue24959@roundup.psfhosted.org> miss-islington added the comment: New changeset 26fa25a9a73f0e31bf0f0d94103fa4de38c0a3cc by Miss Islington (bot) in branch '3.10': bpo-24959: fix unittest.assertRaises bug where traceback entries are dropped from chained exceptions (GH-23688) https://github.com/python/cpython/commit/26fa25a9a73f0e31bf0f0d94103fa4de38c0a3cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 17:15:29 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 08 Mar 2022 22:15:29 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646777729.86.0.421413009583.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 95ba723c54ab52487bc9f986b651536cfae15b29 by Christian Heimes in branch 'main': bpo-40280: Skip dysfunctional pipe tests on Emscripten (GH-31770) https://github.com/python/cpython/commit/95ba723c54ab52487bc9f986b651536cfae15b29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 18:01:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 08 Mar 2022 23:01:05 +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: <1646780465.1.0.946118296431.issue24959@roundup.psfhosted.org> Irit Katriel added the comment: New changeset f3ea249569bbce8417c55d421521bb672c202552 by Irit Katriel in branch '3.9': bpo-24959: fix unittest.assertRaises bug where traceback entries are dropped from chained exceptions (GH-23688) (GH-31776) https://github.com/python/cpython/commit/f3ea249569bbce8417c55d421521bb672c202552 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 18:03:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 08 Mar 2022 23:03:00 +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: <1646780580.95.0.823863910552.issue24959@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 19:37:24 2022 From: report at bugs.python.org (Dino Viehland) Date: Wed, 09 Mar 2022 00:37:24 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag Message-ID: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> New submission from Dino Viehland : The idea here is to add a new flag to the vectorcall nargs that indicates the call is being awaited: _Py_AWAITED_CALL_MARKER. This flag will allow the callee to know that it's being eagerly evaluated. When the call is eagerly evaluated the callee can potentially avoid various amounts of overhead. For a coroutine the function can avoid creating the coroutine object and instead returns a singleton instance of a wait handle indicating eager execution has occurred: https://github.com/facebookincubator/cinder/blob/cinder/3.8/Python/ceval.c#L6617 This gives a small win by reducing the overhead of allocating the co-routine object. For something like gather much more significant wins can be achieved. If all of the inputs have already been computed the creation of tasks and scheduling of them to the event loop can be elided. An example implementation of this is available in Cinder: https://github.com/facebookincubator/cinder/blob/cinder/3.8/Modules/_asynciomodule.c#L7103 Again the gather implementation uses the singleton wait handle object to return the value indicating the computation completed synchronously. We've used this elsewhere in Cinder as well - for example if we have an "AsyncLazyValue" which lazily performs a one-time computation of a value and caches it. Therefore the common case becomes that the value is already available, and the await can be performed without allocating any intermediate values. ---------- assignee: dino.viehland messages: 414782 nosy: Mark.Shannon, carljm, dino.viehland, gvanrossum, itamaro priority: normal severity: normal stage: needs patch status: open title: Enable informing callee it's awaited via vector call flag type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:28:03 2022 From: report at bugs.python.org (JP Sugarbroad) Date: Wed, 09 Mar 2022 02:28:03 +0000 Subject: [issue46966] c_void_p array is a footgun on I32LP64 systems Message-ID: <1646792883.64.0.681602765886.issue46966@roundup.psfhosted.org> New submission from JP Sugarbroad : The following code will likely crash on I32LP64 systems: dim = lib.get_array_size(opaque) ptrs = (c_void_p * dim)() lib.get_array_values(opaque, ptrs) for ptr in ptrs: print(lib.get_object_value(ptr)) What happens is that `ptr` is not a `c_void_p` -- it's just a bare number. And when it's passed to another function it goes in as a (32-bit) `c_int`, resulting in a truncation. I'm not sure what can be done here (maybe a truncation warning?) but it's definitely a difficult bug to notice when reviewing code. ---------- components: ctypes messages: 414783 nosy: taralx priority: normal severity: normal status: open title: c_void_p array is a footgun on I32LP64 systems 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 Tue Mar 8 21:46:44 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 09 Mar 2022 02:46:44 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646794004.6.0.566635679834.issue45138@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset d1777515f9f53b452a4231d68196a7c0e5deb879 by Erlend Egeberg Aasland in branch 'main': bpo-45138: Expand traced SQL statements in `sqlite3` trace callback (GH-28240) https://github.com/python/cpython/commit/d1777515f9f53b452a4231d68196a7c0e5deb879 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 21:47:08 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 09 Mar 2022 02:47:08 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646794028.23.0.130430827079.issue45138@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks for the contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 23:16:10 2022 From: report at bugs.python.org (Julius Park) Date: Wed, 09 Mar 2022 04:16:10 +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: <1646799370.24.0.895518768693.issue43923@roundup.psfhosted.org> Change by Julius Park : ---------- nosy: +juliusgeo nosy_count: 14.0 -> 15.0 pull_requests: +29884 pull_request: https://github.com/python/cpython/pull/31779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 23:16:10 2022 From: report at bugs.python.org (Julius Park) Date: Wed, 09 Mar 2022 04:16:10 +0000 Subject: [issue40185] Refactor typing.NamedTuple In-Reply-To: <1586034525.17.0.360408189871.issue40185@roundup.psfhosted.org> Message-ID: <1646799370.59.0.860986585418.issue40185@roundup.psfhosted.org> Change by Julius Park : ---------- nosy: +juliusgeo nosy_count: 5.0 -> 6.0 pull_requests: +29885 pull_request: https://github.com/python/cpython/pull/31779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 23:19:35 2022 From: report at bugs.python.org (admin) Date: Wed, 09 Mar 2022 04:19:35 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1646799575.98.0.543704859493.issue2771@roundup.psfhosted.org> Change by admin : ---------- github: None -> 1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 8 23:54:25 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Mar 2022 04:54:25 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646801665.87.0.863784675533.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29886 pull_request: https://github.com/python/cpython/pull/31780 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 02:11:41 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 09 Mar 2022 07:11:41 +0000 Subject: [issue46957] Logger with a custom class breaks on copy In-Reply-To: <1646743510.47.0.936024668329.issue46957@roundup.psfhosted.org> Message-ID: <1646809901.07.0.071395732239.issue46957@roundup.psfhosted.org> Eric V. Smith added the comment: In what way does it break? You haven't shown an error. Why are you deepcopying the logger? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:40:32 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Mar 2022 08:40:32 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646815232.21.0.0959242663642.issue45138@roundup.psfhosted.org> Erlend E. Aasland added the comment: Reopening bco. broken buildbots. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 03:46:05 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 08:46:05 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1646815565.98.0.273970298075.issue46953@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is the advantage of not touching a stable code? It was never a performance critical part of the code. This is why it avoided multiple previous optimizations. It is still use PyArg_ParseTupleAndKeywords(). Of course now, when optimization is provided by Argument Clinic and its code is stable enough, we can do this. But performance was never a concern here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 04:32:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2022 09:32:38 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1646818358.35.0.264610349533.issue46964@roundup.psfhosted.org> STINNER Victor added the comment: > Doing so unnecessarily adds extra complexity (and, when multiple interpreters are used, extra CPU usage and extra memory usage). Right, PyConfig allocates memory per interpeter. But IMO it's an acceptable trade-off. I don't see the benefits of sharing the config between all interpreters. Have per-interpreter config allows to create an interpreter with a different config: * different sys.path * isolated vs non-isolated * dev mode * etc. While there is currently no easy way to use a custom config, recent changes make it easier to implement, like the function to modify a PyConfig from a Python dict: _PyInterpreterState_SetConfig(). > there is no public API for getting the config or changing it Barry Warsaw proposed to add a function to get the config, but I didn't add it. There are private functions for that: * _testinternalcapi.get_config() * _testinternalcapi.set_config() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 04:35:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Mar 2022 09:35:59 +0000 Subject: [issue31370] Remove support for threads-less builds In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za> Message-ID: <1646818559.0.0.149169541338.issue31370@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 05:14:42 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 09 Mar 2022 10:14:42 +0000 Subject: [issue46966] c_void_p array is a footgun on I32LP64 systems In-Reply-To: <1646792883.64.0.681602765886.issue46966@roundup.psfhosted.org> Message-ID: <1646820882.25.0.344151763736.issue46966@roundup.psfhosted.org> Eryk Sun added the comment: > I'm not sure what can be done here (maybe a truncation warning?) For a function pointer, the default argument conversion for Python integers is the platform int type. Ideally, Python integer arguments would be converted to a type that matches the platform word size, as is the default behavior for integer arguments in C. But the behavior can't be changed at this point. Ideally, it would behave the same in LP64 (Unix) and LLP64 (Windows) systems, but OverflowError is raised in LLP64 because ctypes first converts to a long int. OverflowError could be manually raised if `(unsigned long)value > UINT_MAX`, but I think it's also too late to make that change. Scripts have worked around the current behavior for about two decades. Raising a warning is really the best that could be done, if anything is done at all. The best solution is to not use bare function pointers without setting the prototype. If a function pointer is created as an attribute of a CDLL instance, the common way to define the prototype is by setting the function's `argtypes` and `restype` attributes. Another ctypes concept to be aware of is that subclasses of simple types do not get converted by default when accessed as C fields, array subscripts, or function results. For example: class my_void_p(ctypes.c_void_p): pass >>> a = (my_void_p * 1)() >>> isinstance(a[0], my_void_p) True ---------- nosy: +eryksun versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 05:16:07 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 10:16: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: <1646820967.07.0.929397199062.issue43923@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +29887 pull_request: https://github.com/python/cpython/pull/31781 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 05:21:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 10:21:44 +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: <1646821304.42.0.325544648567.issue43923@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 31781 is a simple PR which enables multiple inheritance with NamedTuple. As a side effect, it adds support of generic NamedTuple. I am not sure that all details work as expected. It is easy to limit multiple inheritance only for Generic if needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 05:35:58 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 09 Mar 2022 10:35:58 +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: <1646822158.07.0.66168835034.issue43923@roundup.psfhosted.org> Alex Waygood added the comment: +1 for the more minimal changeset proposed in PR 31781. I've never felt a need for NamedTuple multiple inheritance other than with Generic, so wouldn't be opposed to restricting it only to Generic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 06:14:46 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Mar 2022 11:14:46 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646824486.18.0.958860008413.issue45138@roundup.psfhosted.org> Erlend E. Aasland added the comment: Ah, one of my very first contributions, bpo-40318, comes back to haunt me: In bpo-40318, we migrated from the old SQLite trace API (sqlite3_trace) to SQLite trace v2 API (sqlite3_trace_v2). GH-19581, which introduced this change, introduced a bug: the old trace API _implicitly_ expanded bound parameters; the new trace API does not. However, there was no tests for this behaviour, so the regression was unnoticed[^1]. So, this bpo is actually a bug fix; not a feature. It should be backported to 3.10, which contains the regression. I'm preparing a fix for GH-28240, and I'll prepare a 3.10 backport including both GH-2840 and its upcoming fix. [^1]: There has been no bug reports regarding this change in behaviour, so it seems to have gone under most people's radar. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:00:16 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 09 Mar 2022 12:00:16 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections In-Reply-To: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> Message-ID: <1646827216.97.0.119950903948.issue39951@roundup.psfhosted.org> Kumar Aditya added the comment: @asvetlov This has been fixed on main branch with bpo-44011. This can be closed now. ---------- nosy: +kumaraditya303 versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:02:00 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 09 Mar 2022 12:02:00 +0000 Subject: [issue33886] SSL on aiomysql hangs on reconnection In-Reply-To: <1529257290.59.0.56676864532.issue33886@psf.upfronthosting.co.za> Message-ID: <1646827320.91.0.278896806146.issue33886@roundup.psfhosted.org> Kumar Aditya added the comment: The main branch has rewritten ssl implementation with bpo-44011. This is outdated now and does not has a reproducer. This can be closed @asvetlov. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:06:45 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 09 Mar 2022 12:06:45 +0000 Subject: [issue30740] SSLError when cancelling an SSL connection In-Reply-To: <1498226925.91.0.0585632472873.issue30740@psf.upfronthosting.co.za> Message-ID: <1646827605.15.0.555023613173.issue30740@roundup.psfhosted.org> Kumar Aditya added the comment: This is fixed on main branch with bpo-44011 and does not raises exception. This can be closed now @asvetlov. ---------- nosy: +asvetlov, kumaraditya303 versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:12:08 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Mar 2022 12:12:08 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646827928.35.0.877298855439.issue45138@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +29888 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:12:34 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 09 Mar 2022 12:12:34 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1646827954.66.0.883976504485.issue37658@roundup.psfhosted.org> Kumar Aditya added the comment: @asvetlov Anything left to do here or can this be closed ? ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:20:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 09 Mar 2022 12:20:13 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections In-Reply-To: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> Message-ID: <1646828413.39.0.0341908191855.issue39951@roundup.psfhosted.org> Christian Heimes added the comment: The bug should be fixed in 3.9 and 3.10 maintenance branches, too. ---------- assignee: christian.heimes -> stage: -> backport needed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:29:39 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 12:29:39 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() In-Reply-To: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> Message-ID: <1646828979.12.0.99644971148.issue46245@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 02fbaf4887deaf0207a5805d3736e0124a694c14 by Serhiy Storchaka in branch 'main': bpo-46245: Add optional parameter dir_fd in shutil.rmtree() (GH-30365) https://github.com/python/cpython/commit/02fbaf4887deaf0207a5805d3736e0124a694c14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:30:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 12:30:32 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() In-Reply-To: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> Message-ID: <1646829032.78.0.586758461283.issue46245@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:52:02 2022 From: report at bugs.python.org (Dominic Davis-Foster) Date: Wed, 09 Mar 2022 12:52:02 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1646830322.84.0.185391914911.issue40059@roundup.psfhosted.org> Dominic Davis-Foster added the comment: When building Python from source (as of the latest GitHub commit) the tomllib directory doesn't actually get copied over to the install prefix. It looks like an entry's needed in Makefile.pre.in under LIBSUBDIRS, along the lines of https://github.com/python/cpython/pull/13563 and https://github.com/python/cpython/pull/30311 ---------- nosy: +dom1310df _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 07:53:38 2022 From: report at bugs.python.org (Dominic Davis-Foster) Date: Wed, 09 Mar 2022 12:53:38 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1646830418.92.0.75333879278.issue40059@roundup.psfhosted.org> Change by Dominic Davis-Foster : ---------- nosy: +domdfcoding nosy_count: 18.0 -> 19.0 pull_requests: +29889 pull_request: https://github.com/python/cpython/pull/31784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 08:38:15 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Mar 2022 13:38:15 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1646833095.31.0.423042089386.issue40059@roundup.psfhosted.org> miss-islington added the comment: New changeset 23dcea5de736b367c0244042aaca10971538b2b4 by Dominic Davis-Foster in branch 'main': bpo-40059: Fix installation of tomllib (GH-31784) https://github.com/python/cpython/commit/23dcea5de736b367c0244042aaca10971538b2b4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:20:54 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 14:20:54 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1646835654.41.0.504762724776.issue25927@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +29890 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:28:05 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Mar 2022 14:28:05 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1646836085.69.0.479924370471.issue25927@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are two ways of supporting an open file descriptor to a directory: 1. Accept a file descriptor as the dir argument. 2. Add a new parameter dir_fd; dir will then be a path relative to dir_fd. The original proposition is option 2. PR 31785 implements option 1. I am going to play with the code, implement option 2, and see what is simpler and what is more convenient. Any thoughts or suggestions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:31:47 2022 From: report at bugs.python.org (Carl Meyer) Date: Wed, 09 Mar 2022 14:31:47 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646836307.87.0.30104402232.issue46896@roundup.psfhosted.org> Change by Carl Meyer : ---------- keywords: +patch pull_requests: +29891 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31787 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 09:38:29 2022 From: report at bugs.python.org (Carl Meyer) Date: Wed, 09 Mar 2022 14:38:29 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646836709.74.0.01239004019.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: Draft PR is up for consideration. Perf data in https://gist.github.com/carljm/987a7032ed851a5fe145524128bdb67a Overall it seems like the base implementation is perf neutral -- maybe a slight impact on the pickle benchmarks? With all module global dicts (uselessly) watched, there are a few more benchmarks with small regressions, but also some with small improvements (just noise I guess?) -- overall still pretty close to neutral. Comments welcome! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:30:42 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 09 Mar 2022 16:30:42 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646843442.0.0.669700941231.issue46896@roundup.psfhosted.org> Dennis Sweeney added the comment: A curiosity: have you considered watching dict keys rather than whole dicts? That way, changing global values would not have to de-optimize, only adding new global keys would. Indexing into dict values array wouldn't be as efficient as embedding direct jump targets in JIT-generated machine code, but as long as we're not doing that, maybe watching the keys is a happy medium? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 11:47:23 2022 From: report at bugs.python.org (JP Sugarbroad) Date: Wed, 09 Mar 2022 16:47:23 +0000 Subject: [issue46966] c_void_p array is a footgun on I32LP64 systems In-Reply-To: <1646792883.64.0.681602765886.issue46966@roundup.psfhosted.org> Message-ID: <1646844443.17.0.495170223879.issue46966@roundup.psfhosted.org> JP Sugarbroad added the comment: That matches our expectation. A subclass works - perhaps `c_void_p` could be deprecated in favor of a built-in subclass for generic opaque pointers as well? Glad you agree that a warning would be useful here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:11:45 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Mar 2022 17:11:45 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> Message-ID: <1646845905.9.0.249117257116.issue46965@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:12:37 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Mar 2022 17:12:37 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646845957.16.0.412816898317.issue45138@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +29892 pull_request: https://github.com/python/cpython/pull/31788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:25:01 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Mar 2022 17:25:01 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646846701.46.0.989575595337.issue46896@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:40:07 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Mar 2022 17:40:07 +0000 Subject: [issue45138] [sqlite3] expand bound values in traced statements when possible In-Reply-To: <1631109915.01.0.788685972139.issue45138@roundup.psfhosted.org> Message-ID: <1646847607.24.0.384120794382.issue45138@roundup.psfhosted.org> miss-islington added the comment: New changeset e801e88744f34508aa338f9f7f3f3baee012f813 by Erlend Egeberg Aasland in branch 'main': bpo-45138: Revert GH-28240: Expand traced SQL statements (GH-31788) https://github.com/python/cpython/commit/e801e88744f34508aa338f9f7f3f3baee012f813 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:49:02 2022 From: report at bugs.python.org (Henry Schreiner) Date: Wed, 09 Mar 2022 17:49:02 +0000 Subject: [issue46967] Type union for except Message-ID: <1646848142.9.0.223249735581.issue46967@roundup.psfhosted.org> New submission from Henry Schreiner : In 3.10 via PEP 604, there was an attempt to use the new union of types where runtime types were previously expected to be a tuple. `isinstance(x, (A, B))` can be written `isinstance(x, A | B)`. Unfortunately, there still is a case were a tuple of types is required: `except (A, B) as err:` cannot be written `except A | B as err:`. I think this should be allowed; it is consistent with isinstance and pattern matching's use of |, and nicely avoids confusion with `except A, B:` which is disallowed for Python 2 reasons; `except A | B`: would be valid. ---------- components: Interpreter Core messages: 414807 nosy: Henry Schreiner priority: normal severity: normal status: open title: Type union for except type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:49:55 2022 From: report at bugs.python.org (Vladimir Matveev) Date: Wed, 09 Mar 2022 17:49:55 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> Message-ID: <1646848195.98.0.386938411924.issue46965@roundup.psfhosted.org> Change by Vladimir Matveev : ---------- nosy: +v2m _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 12:57:21 2022 From: report at bugs.python.org (Carl Meyer) Date: Wed, 09 Mar 2022 17:57:21 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646848641.84.0.0837989959219.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: Hi Dennis, thanks for the questions! > A curiosity: have you considered watching dict keys rather than whole dicts? There's a bit of discussion of this above. A core requirement is to avoid any memory overhead and minimize CPU overhead on unwatched dicts. Additional memory overhead seems like a nonstarter, given the sheer number of dict objects that can exist in a large Python system. The CPU overhead for unwatched dicts in the current PR consists of a single added `testb` and `jne` (for checking if the dict is watched), in the write path only; I think that's effectively the minimum possible. It's not clear to me how to implement per-key watching under this constraint. One option Brandt mentioned above is to steal the low bit of a `PyObject` pointer; in theory we could do this on `me_key` to implement per-key watching with no memory overhead. But then we are adding bit-masking overhead on every dict read and write. I think we really want the implementation here to be zero-overhead in the dict read path. Open to suggestions if I've missed a good option here! > That way, changing global values would not have to de-optimize, only adding new global keys would. > Indexing into dict values array wouldn't be as efficient as embedding direct jump targets in JIT-generated machine code, but as long as we're not doing that, maybe watching the keys is a happy medium? But we are doing that, in the Cinder JIT. Dict watching here is intentionally exposed for use by extensions, including hopefully in future the Cinder JIT as an installable extension. We burn exact pointer values for module globals into generated JIT code and deopt if they change (we are close to landing a change to code-patch instead of deopting.) This is quite a bit more efficient in the hot path than having to go through a layer of indirection. I don't want to assume too much about how dict watching will be used in future, or go for an implementation that limits its future usefulness. The current PR is quite flexible and can be used to implement a variety of caching strategies. The main downside of dict-level watching is that a lot of notifications will be fired if code does a lot of globals-rebinding in modules where globals are watched, but this doesn't appear to be a problem in practice, either in our workloads or in pyperformance. It seems likely that a workable strategy if this ever was observed to be a problem would be to notice at runtime that globals are being re-bound frequently in a particular module and just stop watching that module's globals. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:07:02 2022 From: report at bugs.python.org (Oleksandr Pavlyk) Date: Wed, 09 Mar 2022 19:07:02 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA Message-ID: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> New submission from Oleksandr Pavlyk : The following snippet illustrates request by an extension to use AMX registers: ``` // no increase sigaltstack size fix will not wark till we fix python void enable_amx_no_fix() { unsigned long bitmask; long rc; rc = syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_PERM, XFEATURE_XTILEDATA); if (rc) { printf("The kernel rejects the AMX use.\n"); printf("errno %d\n",errno); } else { printf("The kernel allows to use AMX.\n"); } rc = syscall(SYS_arch_prctl, ARCH_GET_XCOMP_PERM, &bitmask); if (rc) { printf("rc error\n"); } else { if (( bitmask & XFEATURE_MASK_XTILEDATA) == 0){ printf("verify AMX permission faild bitmask %ld\n",bitmask); } } } ``` This request fails on the account of too small a size for sigaltstack used by CPython allocated in Modules/faulthandler.c The stack size used is 2*SIGSTKSZ, and does not take hardware capabilities into account. Linux kernel 5.14 adds support to query minimum size of sigaltstack dynamically via getauxval(AT_MINSIGSTKSZ). AMX support is added in Linux kernel 5.16 CPython should make use of this when built against more recent Linux kernels. ---------- components: Extension Modules messages: 414809 nosy: oleksandr-pavlyk priority: normal severity: normal status: open title: Insufficient sigaltstack size used by CPython prevents extensions from using new ISA 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 Wed Mar 9 14:13:00 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 09 Mar 2022 19:13:00 +0000 Subject: [issue46967] Type union for except In-Reply-To: <1646848142.9.0.223249735581.issue46967@roundup.psfhosted.org> Message-ID: <1646853180.19.0.231094943419.issue46967@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, Jelle Zijlstra, gvanrossum, iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:29:32 2022 From: report at bugs.python.org (Oleksandr Pavlyk) Date: Wed, 09 Mar 2022 19:29:32 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1646854172.9.0.00393128776492.issue46968@roundup.psfhosted.org> Change by Oleksandr Pavlyk : ---------- keywords: +patch pull_requests: +29893 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:41:34 2022 From: report at bugs.python.org (Carl Meyer) Date: Wed, 09 Mar 2022 19:41:34 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646854894.68.0.924740569285.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: > have you considered watching dict keys rather than whole dicts? Just realized that I misunderstood this suggestion; you don't mean per-key watching necessarily, you just mean _not_ notifying on dict values changes. Now I understand better how that connects to the second part of your comment! But yeah, I don't want this limitation on dict watching use cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 14:50:28 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 09 Mar 2022 19:50:28 +0000 Subject: [issue46967] Type union for except In-Reply-To: <1646848142.9.0.223249735581.issue46967@roundup.psfhosted.org> Message-ID: <1646855428.78.0.726284616885.issue46967@roundup.psfhosted.org> Jelle Zijlstra added the comment: This would be nice but I'm not sure it's worth the hassle in terms of documentation, tooling support, etc. There is an existing issue (that I can't find right now) that makes the `except` machinery use `__instancecheck__`, instead of looking only at real base classes like it does now. That change would automatically also make `|` work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:08:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 09 Mar 2022 20:08:30 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1646856510.08.0.187447078271.issue46943@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:24:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 09 Mar 2022 20:24:30 +0000 Subject: [issue46954] Awaiting multiple times on same task increases memory usage unboundedly In-Reply-To: <1646733063.02.0.0306040798156.issue46954@roundup.psfhosted.org> Message-ID: <1646857470.29.0.824570425362.issue46954@roundup.psfhosted.org> Irit Katriel added the comment: This is a duplicate of bpo-45924. The traceback accumulates another frame every time the exception is raised. To see that, change main in your script to async def main(): task = asyncio.create_task(task_that_raise()) while True: try: await task except Exception as e: print("<<<<<<<<<<<<<<<<<<<<<<<<<<<") traceback.print_exception(e) print(">>>>>>>>>>>>>>>>>>>>>>>>>>>") and notice that in the output, X grows every time in the line like [Previous line repeated X more times] ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Incorrect traceback when future's exception is raised multiple times versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:24:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 09 Mar 2022 20:24:53 +0000 Subject: [issue45924] Incorrect traceback when future's exception is raised multiple times In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org> Message-ID: <1646857493.37.0.48954363533.issue45924@roundup.psfhosted.org> Irit Katriel added the comment: Closed issue46954 as a duplicate of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 15:35:36 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 09 Mar 2022 20:35:36 +0000 Subject: [issue46967] Type union for except In-Reply-To: <1646848142.9.0.223249735581.issue46967@roundup.psfhosted.org> Message-ID: <1646858136.42.0.702937329167.issue46967@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:04:14 2022 From: report at bugs.python.org (Dutcho) Date: Wed, 09 Mar 2022 21:04:14 +0000 Subject: [issue46969] `pip install wrapt` fails on ast.py in Python 3.11.0a6 Message-ID: <1646859853.98.0.761259079796.issue46969@roundup.psfhosted.org> New submission from Dutcho : ... or perhaps this is caused by *wrapt 1.13.3*? ''' (venv) >pip install wrapt Collecting wrapt Using cached wrapt-1.13.3.tar.gz (48 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error ? python setup.py egg_info did not run successfully. ? exit code: 1 ??> [92 lines of output] Traceback (most recent call last): File "...\venv\Lib\site-packages\setuptools\config.py", line 35, in __getattr__ return next( ^^^^^ File "...\venv\Lib\site-packages\setuptools\config.py", line 36, in ast.literal_eval(statement.value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\ast.py", line 108, in literal_eval return _convert(node_or_string) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\ast.py", line 107, in _convert return _convert_signed_num(node) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\ast.py", line 81, in _convert_signed_num return _convert_num(node) ^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\ast.py", line 72, in _convert_num _raise_malformed_node(node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\ast.py", line 69, in _raise_malformed_node raise ValueError(msg + f': {node!r}') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: malformed node or string on line 2: ''' ---------- messages: 414814 nosy: Dutcho priority: normal severity: normal status: open title: `pip install wrapt` fails on ast.py in Python 3.11.0a6 type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:20:50 2022 From: report at bugs.python.org (Julius Park) Date: Wed, 09 Mar 2022 21:20: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: <1646860850.34.0.928456062672.issue43923@roundup.psfhosted.org> Julius Park added the comment: What about Protocol? It is possible to create a dataclass that is a protocol, so it would be nicer from a symmetry perspective to allow it on both dataclasses and NamedTuples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:27:06 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 09 Mar 2022 21:27:06 +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: <1646861226.72.0.793578888881.issue43923@roundup.psfhosted.org> Jelle Zijlstra added the comment: A NamedTuple that is also a Protocol doesn't make sense to me, since a NamedTuple is a concrete (nominal) type and a Protocol cannot inherit from a concrete type. If you want something like that to happen, it's better to open an issue on https://github.com/python/typing first, so this issue can stay focused on support for Generic + NamedTuple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 16:53:10 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 09 Mar 2022 21:53:10 +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: <1646862790.9.0.483895281814.issue43923@roundup.psfhosted.org> Alex Waygood added the comment: I agree with Jelle ? a valid protocol cannot inherit from a concrete type, and the whole point of NamedTuple is that it creates a tuple subclass (and tuple is obviously a concrete type). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 17:43:09 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Mar 2022 22:43:09 +0000 Subject: [issue46967] Type union for except In-Reply-To: <1646848142.9.0.223249735581.issue46967@roundup.psfhosted.org> Message-ID: <1646865789.82.0.932410335014.issue46967@roundup.psfhosted.org> Guido van Rossum added the comment: I don't think that `except A|B` looks better than `except (A, B)`, so I am against this proposal. Exception matching is its own special thing (e.g. it doesn't honor virtual subclasses) and we shouldn't hyper-generalize. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 18:02:09 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Mar 2022 23:02:09 +0000 Subject: [issue46881] Statically allocate and initialize the latin1 characters. In-Reply-To: <1646053348.55.0.937753092888.issue46881@roundup.psfhosted.org> Message-ID: <1646866929.88.0.525300639984.issue46881@roundup.psfhosted.org> miss-islington added the comment: New changeset 8714b6fa27271035dd6dd3514e283f92d669321d by Kumar Aditya in branch 'main': bpo-46881: Statically allocate and initialize the latin1 characters. (GH-31616) https://github.com/python/cpython/commit/8714b6fa27271035dd6dd3514e283f92d669321d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 18:31:25 2022 From: report at bugs.python.org (Itai Steinherz) Date: Wed, 09 Mar 2022 23:31:25 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1646868685.56.0.645413648672.issue46785@roundup.psfhosted.org> Itai Steinherz added the comment: I'd like to work on this, however I'm not sure how this could be unit-tested. Any ideas? ---------- nosy: +itaisteinherz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 18:54:09 2022 From: report at bugs.python.org (Barney Gale) Date: Wed, 09 Mar 2022 23:54:09 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1646870049.3.0.307249746382.issue24132@roundup.psfhosted.org> Barney Gale added the comment: If/when GH-31691 lands, I think this bug can be resolved: the original repro case will no longer raise AttributeError, and subclasses will be able to customize behaviour without needing to define further "flavour" or "accessor" subclasses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 19:14:28 2022 From: report at bugs.python.org (Guido Imperiale) Date: Thu, 10 Mar 2022 00:14:28 +0000 Subject: [issue46970] dataclass(slots=True) incompatible with __init_subclass__ Message-ID: <1646871268.44.0.752243680587.issue46970@roundup.psfhosted.org> New submission from Guido Imperiale : Related to #46382 A class decorated with dataclass(slots=True) can't pass any parameters to the __init_subclass__ method of its parent class. from dataclasses import dataclass class A: __slots__ = () def __init_subclass__(cls, msg): print(msg) @dataclass(slots=True) class B(A, msg="Hello world!"): pass File "lib/python3.10/dataclasses.py", line 1145, in _add_slots cls = type(cls)(cls.__name__, cls.__bases__, cls_dict) TypeError: A.__init_subclass__() missing 1 required positional argument: 'msg' ---------- components: Library (Lib) messages: 414822 nosy: crusaderky priority: normal severity: normal status: open title: dataclass(slots=True) incompatible with __init_subclass__ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 19:14:48 2022 From: report at bugs.python.org (Guido Imperiale) Date: Thu, 10 Mar 2022 00:14:48 +0000 Subject: [issue46970] dataclass(slots=True) incompatible with __init_subclass__ In-Reply-To: <1646871268.44.0.752243680587.issue46970@roundup.psfhosted.org> Message-ID: <1646871288.91.0.489301293128.issue46970@roundup.psfhosted.org> Change by Guido Imperiale : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 19:15:08 2022 From: report at bugs.python.org (Guido Imperiale) Date: Thu, 10 Mar 2022 00:15:08 +0000 Subject: [issue46970] dataclass(slots=True) incompatible with __init_subclass__ In-Reply-To: <1646871268.44.0.752243680587.issue46970@roundup.psfhosted.org> Message-ID: <1646871308.75.0.541996315551.issue46970@roundup.psfhosted.org> Change by Guido Imperiale : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 19:28:03 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 10 Mar 2022 00:28:03 +0000 Subject: [issue46970] dataclass(slots=True) incompatible with __init_subclass__ In-Reply-To: <1646871268.44.0.752243680587.issue46970@roundup.psfhosted.org> Message-ID: <1646872083.78.0.353058246931.issue46970@roundup.psfhosted.org> Eric V. Smith added the comment: This appears to be due to dataclasses needing to create a new class in order to set __slots__. I'll look at it, but I doubt there's anything that can be done. attrs has the same issue: File "xxxxx/.local/lib/python3.8/site-packages/attr/_make.py", line 889, in _create_slots_class cls = type(self._cls)(self._cls.__name__, self._cls.__bases__, cd) TypeError: __init_subclass__() missing 1 required positional argument: 'msg' ---------- assignee: -> eric.smith type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 20:49:02 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 10 Mar 2022 01:49:02 +0000 Subject: [issue30740] SSLError when cancelling an SSL connection In-Reply-To: <1498226925.91.0.0585632472873.issue30740@psf.upfronthosting.co.za> Message-ID: <1646876942.46.0.552605281373.issue30740@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 20:49:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 10 Mar 2022 01:49:33 +0000 Subject: [issue33886] SSL on aiomysql hangs on reconnection In-Reply-To: <1529257290.59.0.56676864532.issue33886@psf.upfronthosting.co.za> Message-ID: <1646876973.08.0.255451795911.issue33886@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 21:05:52 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 10 Mar 2022 02:05:52 +0000 Subject: [issue45033] Calls to PyErr_PrintEx in destructors cause calling async functions to incorrectly return None In-Reply-To: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org> Message-ID: <1646877952.85.0.684465838297.issue45033@roundup.psfhosted.org> Andrew Svetlov added the comment: 'catch (boost::python::error_already_set e)' is equal to `except BaseException as e:` In Python, blind catching base exception is dangerous, the code should re-raise it usually. The same is true for boost::python usage. > how would it tell the difference between a "real" exception raised from within whatever function is currently returning and the "fake" StopIteration exception that is in the error global while an async function returns? There is no "fake" exception. async function is a kind of Python generator object that uses StopIteration exception for finishing. The same is true for a regular Python iterator; nothing asyncio specific. I suggest writing a functional equivalent for `except Exception as e: print(e)` instead of catching BaseException error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 21:07:51 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 10 Mar 2022 02:07:51 +0000 Subject: [issue36709] Asyncio SSL keep-alive connections raise errors after loop close. In-Reply-To: <1556095707.61.0.53219784779.issue36709@roundup.psfhosted.org> Message-ID: <1646878071.55.0.193388995478.issue36709@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 9 23:58:11 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 10 Mar 2022 04:58:11 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1646888291.48.0.970508358077.issue45319@roundup.psfhosted.org> Larry Hastings added the comment: This isn't a CPython bug. It's a change in CPython behavior that wrapt needs to accommodate. In particular, it isn't 'causing a regression for C subclasses of heap types when the parent class has an "__annotations__" descriptor', nor do child classes have any difficulty inheriting the descriptor of their parent classes. That's unsurprising; after all, if I had broken child classes inheriting the descriptors of their parent classes, a lot more would have broken than just wrapt. The problem is in WraptObjectProxy_setattro(). (Which--just to drive my point home--*is* getting called when you set __annotations__ on one of wrapt's various proxy objects.) WraptObjectProxy_setattro() proxies setattr calls for wrapped objects to the original object--if "o" is a wrapt proxy object wrapping "fn", and you run "o.__annotations__ = x", it should actually execute "fn.__annotations__ = x" under the covers. Except WraptObjectProxy_setattro() executes *this* code first, starting at line 1531 in my copy of _wrapped.c: if (PyObject_HasAttr((PyObject *)Py_TYPE(self), name)) return PyObject_GenericSetAttr((PyObject *)self, name, value); If the *type* has the attribute, then it doesn't proxy the setattr to the wrapped object. Instead it does a "generic setattr" on the object itself. PyObject_HasAttr works by attempting a getattr on the type. If that getattr call succeeds, PyObject_HasAttr returns true. The type here is FunctionWrapper (WraptFunctionWrapper_Type). Since we're now looking it up on this type object, we use the type of the type object, which is "type", to access the attribute. And getting the "__annotations__" attribute from an object of type "type" means calling type_get_annotations(), a new descriptor which ensures that the annotations dict always exists, which means the HasAttr call succeeds and returns true. In short, this change to the semantics of the "__annotations__" attribute means wrapt no longer proxies the setattr to the underlying wrapped object when setting the "__annotations__" attribute on *any* of its objects. In my opinion, wrapt needs to accommodate this new behavior. In my testing I changed the above code to this: if (!annotations_str) { annotations_str = PyUnicode_InternFromString("__annotations__"); } if (PyObject_RichCompareBool(name, annotations_str, Py_NE) && PyObject_HasAttr((PyObject *)Py_TYPE(self), name)) return PyObject_GenericSetAttr((PyObject *)self, name, value); I also declared static PyObject *annotations_str = NULL; at the top of the function. With that change in place, the tests now passed. My hunch is, this approach is more or less what wrapt should do. It *might* be undersophisticated; it's possible that there are classes out there playing their own weird descriptor tricks with the "__annotations__" attribute. Perhaps the fix needs to be on a case-by-case basis, based on the type of the wrapped object. Anyway this is obviously up to Graham, which is for the best anyway--he has far more experience than I do with this sort of object proxying wizardry. ---------- resolution: -> third party stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 00:12:06 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 10 Mar 2022 05:12:06 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1646889126.05.0.990293836568.issue45319@roundup.psfhosted.org> Larry Hastings added the comment: (It's also possible your workaround where wrapt explicitly defines an "__annotations__" getset on every child of ObjectProxy is the right fix. I don't know; I don't know the fine points of attribute access, like when does it access getsets on the type, vs getsets on base types, vs setattro, etc.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 00:30:54 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Thu, 10 Mar 2022 05:30:54 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1646890254.17.0.100730727385.issue45319@roundup.psfhosted.org> Graham Dumpleton added the comment: I don't know about the comment "he has far more experience than I do with this sort of object proxying wizardry". I read what you said and my brain melted. I am getting too old for this and trying to understand how anything works anymore takes me ages. :-) Anyway, will try and digest what you said a half dozen more times when my brain is working again and see if I can make sense of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 01:14:14 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 10 Mar 2022 06:14:14 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1646892854.7.0.0177831236023.issue45319@roundup.psfhosted.org> Larry Hastings added the comment: Graham: I'm happy to help. I can write a more elaborate explanation of what's happening, or answer questions, whatever you like. I'm a fan of wrapt so I'd certainly like to see this issue resolved. And, seeing as you're the author and maintainer of wrapt, I assure you you've got more battle-won experience with object proxying than most developers--myself included. You're *absolutely* the right person to ameliorate this issue! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 01:26:24 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 10 Mar 2022 06:26:24 +0000 Subject: [issue46881] Statically allocate and initialize the latin1 characters. In-Reply-To: <1646053348.55.0.937753092888.issue46881@roundup.psfhosted.org> Message-ID: <1646893584.65.0.261468004797.issue46881@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 01:32:44 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 10 Mar 2022 06:32:44 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1646893964.88.0.648598593249.issue46968@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 03:17:42 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 08:17:42 +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: <1646900262.03.0.469523926882.issue43923@roundup.psfhosted.org> Serhiy Storchaka added the comment: What about mix-ins or abstract base classes? class VecMixin: def length(self): return math.hypot(*self) class Vec2D(NamedTuple, VecMixin): x: float y: float class Vec3D(NamedTuple, VecMixin): x: float y: float z: float Currently you need to use the following trick to get a similar result: class Vec2D(NamedTuple): x: float y: float class Vec2D(Vec2D, VecMixin): pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 03:23:16 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Thu, 10 Mar 2022 08:23:16 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1646900596.95.0.830029179116.issue45319@roundup.psfhosted.org> Graham Dumpleton added the comment: Let me try and summarise what I do understand about this. The existing wrapt code as written and its tests, work fine for Python 2.7 and 3.6-3.11. No special case handling is done in tests related to checking annotations that I can remember. The only reason this issue came up is because Christian tried to convert wrapt C code to only use the limited API and stable ABI, and as a result the existing test suite then started to fail for newer versions of Python (3.10+) on tests related to annotations, because the way the limited API and stable ABI for Python 3.10+ didn't behave the same as it did in older versions. So if wrapt doesn't change to use the limited API and stable ABI then wrapt doesn't need to make any changes as it all seems to work fine when using the older APIs. For the time being therefore at least it seems wrapt doesn't need to make any changes, since switching to the limited API and stable ABI is not a confirmed direction yet, and can't be done anyway until at least Python 2.7 support is dropped, and perhaps some Python 3.X version support as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 03:37:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 08:37:26 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646901446.53.0.215159858809.issue46917@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29894 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 03:40:26 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 10 Mar 2022 08:40:26 +0000 Subject: [issue45319] Possible regression in __annotations__ descr for heap type subclasses In-Reply-To: <1632916299.97.0.729247269758.issue45319@roundup.psfhosted.org> Message-ID: <1646901626.48.0.392405427636.issue45319@roundup.psfhosted.org> Larry Hastings added the comment: I only did my experiments with the _wrappers.c Christian gave me. If that's not the shipping version of wrapt, and wrapt doesn't exhibit this behavior in 3.10, then that's good. I agree you can wait to address this behavior until it affects code you actually plan to ship. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:04:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Mar 2022 09:04:38 +0000 Subject: [issue44035] Regenerating the configure script fails even if dependencies are satisfied In-Reply-To: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org> Message-ID: <1646903078.31.0.477109750293.issue44035@roundup.psfhosted.org> Christian Heimes added the comment: PS: You have to use the "269" tag to get the correct container image. The "latest" image was outdated and I removed it. docker run -v (pwd):/src quay.io/tiran/cpython_autoconf:269 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:11:29 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 10 Mar 2022 09:11:29 +0000 Subject: [issue45033] Calls to PyErr_PrintEx in destructors cause calling async functions to incorrectly return None In-Reply-To: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org> Message-ID: <1646903489.97.0.086787907939.issue45033@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:15:02 2022 From: report at bugs.python.org (Sorin Sbarnea) Date: Thu, 10 Mar 2022 09:15:02 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS In-Reply-To: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> Message-ID: <1646903702.35.0.284049751281.issue35164@roundup.psfhosted.org> Sorin Sbarnea added the comment: I am able to reproduce this bug with Python 3.10 on MacOS 12.2 too, and I happen to have some extra insights about what happens, see https://github.com/tox-dev/tox/issues/2375 Basically the culprit is a reverse-dns query (PTR) that takes 30s to return, causing that very long delay. It appears that mDNSResponder is able to cache the result for some time but not very long, so it will happen again. In my particular case that PTR query is an .ip6.arpa one and there is no ipv4 query made at all. I was not able to identify any similar delay while calling `scutil --get HostName` or `hostname`, but `socket.getfqdn()` does reproduce it reliably. Interestingly, it seems that the delay is at least sometimes 15s, maybe the delay of 30s I observed on tox was caused by two calls. Anyway, I am more than interested in finding a solution for this issue. Such a delays can be a real dealbreaker even for cli tools. ---------- versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:22:49 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Mar 2022 09:22:49 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646904169.5.0.507904755782.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29895 pull_request: https://github.com/python/cpython/pull/31791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:27:18 2022 From: report at bugs.python.org (Sorin Sbarnea) Date: Thu, 10 Mar 2022 09:27:18 +0000 Subject: [issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS In-Reply-To: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za> Message-ID: <1646904438.35.0.691761932313.issue35164@roundup.psfhosted.org> Sorin Sbarnea added the comment: Maybe I should mention that my networking is configured only with values received from the DHCP server, which includes 2 DNS servers, one ipv4 an done ipv6, both of them being the local router and *1* search domain, which is a real domain (not local). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:40:49 2022 From: report at bugs.python.org (Hu Di) Date: Thu, 10 Mar 2022 09:40:49 +0000 Subject: [issue46971] python takes long time when return big data Message-ID: <1646905249.02.0.757462069479.issue46971@roundup.psfhosted.org> Change by Hu Di <476658825 at qq.com>: ---------- components: Interpreter Core nosy: HumberMe priority: normal severity: normal status: open title: python takes long time when return big data type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:43:06 2022 From: report at bugs.python.org (Hu Di) Date: Thu, 10 Mar 2022 09:43:06 +0000 Subject: [issue46971] python takes long time when return big data Message-ID: <1646905386.12.0.964981264374.issue46971@roundup.psfhosted.org> New submission from Hu Di <476658825 at qq.com>: it takes a long time when python return big data. generally, when a function return something, it only take less than 1e-5 second, but when the result is big, like np.random.rand(2048,3,224,224), the time cost will increase to 0.1-0.2 second ---------- Added file: https://bugs.python.org/file50665/python_performance_issue.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 04:44:46 2022 From: report at bugs.python.org (Thomas Fischbacher) Date: Thu, 10 Mar 2022 09:44:46 +0000 Subject: [issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. Message-ID: <1646905486.67.0.783441302019.issue46972@roundup.psfhosted.org> New submission from Thomas Fischbacher : The Python reference says: (1) https://docs.python.org/3/library/exceptions.html#concrete-exceptions exception AssertionError Raised when an assert statement fails. (2) https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement "assert ..." is equivalent to "if __debug__: ..." >From this, one can infer the guarantee "the -O flag will suppress AssertionError exceptions from being raised". However, there is code in the Python standard library that does a direct "raise AssertionError" (strictly speaking, in violation of (1)), and it is just reasonable to assume that other code following the design of that would then also want to do a direct "raise AssertionError". This happens e.g. in many methods defined in: unittest/mock.py The most appropriate fix here may be to change the documentation to not say: === exception AssertionError Raised when an assert statement fails. === but instead: === exception AssertionError An assert[{add reference to `assert` definition}] statement fails, or a unit testing related assert{...}() callable detects an assertion violation. === ---------- messages: 414837 nosy: tfish2 priority: normal severity: normal status: open title: Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 05:42:05 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 10 Mar 2022 10:42:05 +0000 Subject: [issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. In-Reply-To: <1646905486.67.0.783441302019.issue46972@roundup.psfhosted.org> Message-ID: <1646908925.14.0.445309231194.issue46972@roundup.psfhosted.org> Eric V. Smith added the comment: The documentation doesn't say that assert statements are the only place AssertionError is raised, so I don't think it's incorrect. > From this, one can infer the guarantee "the -O flag will suppress AssertionError exceptions from being raised". I don't think that follows from what the documentation says. It's only talking about assert statements. This is equivalent to StopIteration: it is commonly raised by exhausting iterators, but it can be raised elsewhere. Or KeyError: the docs say "Raised when a mapping (dictionary) key is not found in the set of existing keys", but I've raised them in my own code. > An assert[{add reference to `assert` definition}] statement fails, or a unit testing related assert{...}() callable detects an assertion violation. I think that's also misleading, and not an improvement. Why focus just on testing? It can certainly be raised elsewhere. If anything, I think maybe add a note at the top of the list of Concrete Exceptions saying these are common ways these exceptions are raised, but they can be raised elsewhere. But I'm -0 on such a change. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 05:52:50 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Mar 2022 10:52:50 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646909570.58.0.520161091299.issue46896@roundup.psfhosted.org> Mark Shannon added the comment: There are three kinds of changes that we might want to watch (that I can think of right now): 1. Any change. Rather coarse and potentially expensive. Used by Cinder. 2. A new key being added (or a change to the keys version as a proxy). Useful for detect shadowing of builtins by module globals, would save the keys version check for the module dict in `LOAD_GLOBAL_BUILTINS` and a version check in some `LOAD_METHOD` specializations. 3. The value corresponding to a particular key. With this we could effectively convert both `LOAD_GLOBAL` specializations into a constant, given an effective way to de-optimize. One way to support the three cases above would be to replace the dict version with a pointer to a data structure describing what it watched. If the pointer is `NULL`, then nothing is being watched. The data structure would need 2 bits to cover cases 1 and 2, and 1 bit (or byte) for each key in the dict keys (or case 1 could be implemented by setting all the bits for case 3). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:05:28 2022 From: report at bugs.python.org (Jeremiah Pascual) Date: Thu, 10 Mar 2022 11:05:28 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1646910328.98.0.110857431192.issue39829@roundup.psfhosted.org> Jeremiah Pascual added the comment: Matt's idea leads to some speedups when implemented correctly (pardon me but I have no idea how to use pyperf): list({}): Mean +- std dev: [orig] 109 ns +- 1 ns -> [modif] 103 ns +- 1 ns: 1.06x faster list({1: 2}): Mean +- std dev: [orig] 125 ns +- 1 ns -> [modif] 118 ns +- 1 ns: 1.05x faster list({(1, 2, 3): 4}): Mean +- std dev: [orig] 125 ns +- 1 ns -> [modif] 118 ns +- 1 ns: 1.05x faster list((3, 3, 4)): Mean +- std dev: [orig] 89.2 ns +- 4.5 ns -> [modif] 82.9 ns +- 4.6 ns: 1.08x faster list(()): Mean +- std dev: [orig] 70.1 ns +- 0.8 ns -> [modif] 65.5 ns +- 0.8 ns: 1.07x faster list({0, 1, 2, ...}): Mean +- std dev: [orig] 74.7 us +- 3.6 us -> [modif] 67.6 us +- 1.6 us: 1.11x faster list({9, 3}): Mean +- std dev: [orig] 131 ns +- 2 ns -> [modif] 126 ns +- 4 ns: 1.04x faster list(set()): Mean +- std dev: [orig] 115 ns +- 6 ns -> [modif] 110 ns +- 2 ns: 1.05x faster list([]): Mean +- std dev: [orig] 73.2 ns +- 5.5 ns -> [modif] 67.8 ns +- 3.4 ns: 1.08x faster list([1, 2, 1, 1]): Mean +- std dev: [orig] 93.5 ns +- 9.8 ns -> [modif] 87.9 ns +- 8.6 ns: 1.06x faster list([1, 2, 1, 2, 1, 2]): Mean +- std dev: [orig] 93.0 ns +- 3.1 ns -> [modif] 87.0 ns +- 2.7 ns: 1.07x faster Benchmark hidden because not significant (3): list({0: 0, 1: ...}), list((4, 5, 1, ...)), list([4, 1, 3, ...]) Geometric mean: 1.05x faster Changes compared here: https://github.com/python/cpython/compare/main...thatbirdguythatuknownot:patch-17 ---------- nosy: +Crowthebird _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:12:00 2022 From: report at bugs.python.org (Thomas Fischbacher) Date: Thu, 10 Mar 2022 11:12:00 +0000 Subject: [issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. In-Reply-To: <1646905486.67.0.783441302019.issue46972@roundup.psfhosted.org> Message-ID: <1646910720.96.0.58065311972.issue46972@roundup.psfhosted.org> Thomas Fischbacher added the comment: The documentation of exceptions in the reference is one of the places that makes the life of users substantially harder than it ought to be, since the documentation appears to not have been written with the intent to give guarantees that users can expect correctly written code to follow. I would argue that "The reference documentation for X states that it gets raised under condition Y" generally should be understood as "this is a guarantee that also includes the guarantee that it is not raised under other conditions in correctly written code". Other languages often appear to be somewhat stricter w.r.t. interpreting the reference documentation as binding for correct code - and for Python, having this certainly would help a lot when writing code that can give binding guarantees. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 06:28:55 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Mar 2022 11:28:55 +0000 Subject: [issue46971] python takes long time when return big data In-Reply-To: <1646905386.12.0.964981264374.issue46971@roundup.psfhosted.org> Message-ID: <1646911735.85.0.366326237726.issue46971@roundup.psfhosted.org> Mark Dickinson added the comment: This is expected. Your timing measures the time for garbage collection of the large arrays in addition to the time for the result to be returned. In the line `result = myfunc()`, the name `result` gets rebound to the value of `myfunc()`. That means that `result` is unbound from whatever it was previously bound to, and the old value then gets garbage collected. You can test this by adding a "del result" line as the last line inside the "for" loop block. ---------- nosy: +mark.dickinson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 07:34:00 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 10 Mar 2022 12:34:00 +0000 Subject: [issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. In-Reply-To: <1646905486.67.0.783441302019.issue46972@roundup.psfhosted.org> Message-ID: <1646915640.01.0.370701246328.issue46972@roundup.psfhosted.org> Eric V. Smith added the comment: > I would argue that "The reference documentation for X states that it gets raised under condition Y" generally should be understood as "this is a guarantee that also includes the guarantee that it is not raised under other conditions in correctly written code". That's definitely not the case in Python, though. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 07:40:35 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 12:40:35 +0000 Subject: [issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. In-Reply-To: <1646905486.67.0.783441302019.issue46972@roundup.psfhosted.org> Message-ID: <1646916035.76.0.221831650543.issue46972@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Eric. The existing documentation looks pretty clear to me. Any exception can be raised explicitly, no need to repeat this. And unittest.TestCase methods do not raise AssertionError. They raise TestCase.failureException, which by default is set to AssertionError. It is specified in the corresponding module documentation. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 07:42:31 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 12:42:31 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646916151.4.0.620237336346.issue40280@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: -serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 07:44:04 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Mar 2022 12:44:04 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1646916244.42.0.682388721702.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset de554d6e02228b840eb6bffaf7d406c0ef368d5f by Christian Heimes in branch 'main': bpo-40280: Skip more tests/features that don't apply to Emscripten (GH-31791) https://github.com/python/cpython/commit/de554d6e02228b840eb6bffaf7d406c0ef368d5f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 08:29:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Mar 2022 13:29:14 +0000 Subject: [issue46973] Provide make target to regenerate autoconf files with container Message-ID: <1646918954.08.0.6866798038.issue46973@roundup.psfhosted.org> New submission from Christian Heimes : CPython stores auto-generated autoconf files (configure, aclocal.m4, pyconfig.h.in) in git. The files must be regenerated with very specific versions of autotools 2.69 + runtimestate patch, autoarchive, and pkg-config's m4 macros. I provide a container image based on Alpine 3.13 for automation and CI. Let's add a build target to make it easier for contributors to regenerate the files and utilize the container images. The command needs a container runtime (podman, docker), though. ---------- assignee: christian.heimes components: Build messages: 414846 nosy: brett.cannon, christian.heimes, gregory.p.smith priority: normal severity: normal status: open title: Provide make target to regenerate autoconf files with container type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 08:32:17 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Mar 2022 13:32:17 +0000 Subject: [issue46973] Provide make target to regenerate autoconf files with container In-Reply-To: <1646918954.08.0.6866798038.issue46973@roundup.psfhosted.org> Message-ID: <1646919137.79.0.625310335185.issue46973@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +29896 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 08:37:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 13:37:47 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646919467.75.0.843318790001.issue46917@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9b51fd5d137b662c940f072297b30815f37f105b by Victor Stinner in branch 'main': bpo-46917: Require IEEE 754 to build Python (GH-31790) https://github.com/python/cpython/commit/9b51fd5d137b662c940f072297b30815f37f105b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 08:47:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 13:47:45 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646920065.62.0.417302952475.issue46917@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29897 pull_request: https://github.com/python/cpython/pull/31793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:07:15 2022 From: report at bugs.python.org (PiTeR) Date: Thu, 10 Mar 2022 14:07:15 +0000 Subject: [issue46974] set function for lists on numbers, sometimes sorts elements from smallest to largest, and sometimes not Message-ID: <1646921235.45.0.756615135593.issue46974@roundup.psfhosted.org> New submission from PiTeR : set function for lists on numbers, sometimes sorts elements from smallest to largest, and sometimes not to find this bug, sometimes you need to display the result several times example code: def tupla(): import random ilosc = random.randint(0,49) n=0 lista=[] i=0 while True: n = random.randint(1,100) lista.append(n) i=i+1 if i==ilosc-1: break lista = set(lista) list(lista) print(lista) ---------- components: Windows files: bug_1.PNG messages: 414848 nosy: paul.moore, pio.paluchowski, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: set function for lists on numbers, sometimes sorts elements from smallest to largest, and sometimes not type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50666/bug_1.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:15:33 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 10 Mar 2022 14:15:33 +0000 Subject: [issue46974] set function for lists on numbers, sometimes sorts elements from smallest to largest, and sometimes not In-Reply-To: <1646921235.45.0.756615135593.issue46974@roundup.psfhosted.org> Message-ID: <1646921733.13.0.376647774863.issue46974@roundup.psfhosted.org> Eric V. Smith added the comment: This is expected behavior. A set has no defined order. If you convert a set to a list, and you want some specific order, you'll need to sort it yourself. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:42:42 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 14:42:42 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1646923362.51.0.523112716803.issue46581@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 32bf3597922ac3f613989582afa2bff43bea8a2f by Matt Bogosian in branch 'main': bpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061) https://github.com/python/cpython/commit/32bf3597922ac3f613989582afa2bff43bea8a2f ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:51:52 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 14:51:52 +0000 Subject: [issue45767] Fix types for dev_t processing in posix module In-Reply-To: <1636477989.19.0.839413468229.issue45767@roundup.psfhosted.org> Message-ID: <1646923912.03.0.414796951211.issue45767@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +29898 pull_request: https://github.com/python/cpython/pull/31794 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 09:54:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 14:54:37 +0000 Subject: [issue45767] Fix types for dev_t processing in posix module In-Reply-To: <1636477989.19.0.839413468229.issue45767@roundup.psfhosted.org> Message-ID: <1646924077.76.0.171606479486.issue45767@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 31794 supports NODEV and checks for integer overflows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 10:30:07 2022 From: report at bugs.python.org (=?utf-8?q?P=C3=A1draig_Brady?=) Date: Thu, 10 Mar 2022 15:30:07 +0000 Subject: [issue35677] Do not automount in stat() by default In-Reply-To: <1546852678.92.0.232634094535.issue35677@roundup.psfhosted.org> Message-ID: <1646926206.99.0.140423309989.issue35677@roundup.psfhosted.org> P?draig Brady

added the comment: I think this change is not needed as fstatat() implies AT_NO_AUTOMOUNT since Linux 4.11 The fstatat(2) man page is confusing, and I've attempted to clarify with the patch attached to: https://lists.gnu.org/archive/html/coreutils/2022-03/msg00014.html ---------- nosy: +pixelbeat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:05:37 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 10 Mar 2022 16:05:37 +0000 Subject: [issue46771] Add some form of cancel scopes In-Reply-To: <1645034352.96.0.773044052656.issue46771@roundup.psfhosted.org> Message-ID: <1646928337.9.0.412145387987.issue46771@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5 by Andrew Svetlov in branch 'main': bpo-46771: Implement asyncio context managers for handling timeouts (GH-31394) https://github.com/python/cpython/commit/f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:08:13 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 10 Mar 2022 16:08:13 +0000 Subject: [issue46771] Add some form of cancel scopes In-Reply-To: <1645034352.96.0.773044052656.issue46771@roundup.psfhosted.org> Message-ID: <1646928493.28.0.308293341229.issue46771@roundup.psfhosted.org> Guido van Rossum added the comment: I'm closing this, the asyncio.timeout() context manager has been merged. Thanks Andrew! @agronholm you said you were interested in tweaking the cancellation behavior some more. If you're still interested, let's discuss that in a separate bpo (please +nosy me if you create one). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:20:23 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 16:20:23 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646929223.23.0.990852596877.issue46198@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97 by Nikita Sobolev in branch 'main': bpo-46198: rename duplicate tests and remove unused code (GH-30297) https://github.com/python/cpython/commit/6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97 ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:22:11 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 10 Mar 2022 16:22:11 +0000 Subject: [issue46771] Add some form of cancel scopes In-Reply-To: <1645034352.96.0.773044052656.issue46771@roundup.psfhosted.org> Message-ID: <1646929331.43.0.396559216709.issue46771@roundup.psfhosted.org> Andrew Svetlov added the comment: The implementation has landed, docs are still required. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:24:06 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 10 Mar 2022 16:24:06 +0000 Subject: [issue46771] Add some form of cancel scopes In-Reply-To: <1645034352.96.0.773044052656.issue46771@roundup.psfhosted.org> Message-ID: <1646929446.24.0.0958859346184.issue46771@roundup.psfhosted.org> Guido van Rossum added the comment: Good think I forgot to close the issue. ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:24:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 16:24:30 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646929470.27.0.621675498359.issue46198@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +29899 pull_request: https://github.com/python/cpython/pull/31796 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:25:19 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Thu, 10 Mar 2022 16:25:19 +0000 Subject: [issue46771] Add some form of cancel scopes In-Reply-To: <1645034352.96.0.773044052656.issue46771@roundup.psfhosted.org> Message-ID: <1646929519.96.0.272501952663.issue46771@roundup.psfhosted.org> Alex Gr?nholm added the comment: Yeah, I'm still interested. I'll create a new BPO when I have something. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:27:08 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 16:27:08 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646929628.53.0.490628866144.issue46198@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +29900 pull_request: https://github.com/python/cpython/pull/31797 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:38:01 2022 From: report at bugs.python.org (Battant) Date: Thu, 10 Mar 2022 16:38:01 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac Message-ID: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> New submission from Battant : Hello, Here is my configuration mac os 12.2.1 mac m1 pro 2021 step to reproduce 1. on mac m1, clone cpython repository main branch run ./confugure make Actual result : gcc -fno-semantic-interposition -fprofile-instr-generate -Wl,-stack_size,1000000 -framework CoreFoundation -o python.exe Programs/python.o libpython3.10d.a -ldl -framework CoreFoundation gcc -fno-semantic-interposition -fprofile-instr-generate -Wl,-stack_size,1000000 -framework CoreFoundation -o Programs/_testembed Programs/_testembed.o libpython3.10d.a -ldl -framework CoreFoundation Undefined symbols for architecture arm64: "_libintl_bindtextdomain", referenced from: Undefined symbols for architecture arm64: "_libintl_bindtextdomain", referenced from: __locale_bindtextdomain_impl in libpython3.10d.a(_localemodule.o) __locale_bindtextdomain_impl in libpython3.10d.a(_localemodule.o) "_libintl_dcgettext", referenced from: "_libintl_dcgettext", referenced from: __locale_dcgettext_impl in libpython3.10d.a(_localemodule.o) __locale_dcgettext_impl in libpython3.10d.a(_localemodule.o) "_libintl_dgettext", referenced from: "_libintl_dgettext", referenced from: __locale_dgettext_impl in libpython3.10d.a(_localemodule.o) __locale_dgettext_impl in libpython3.10d.a(_localemodule.o) "_libintl_gettext", referenced from: "_libintl_gettext", referenced from: __locale_gettext_impl in libpython3.10d.a(_localemodule.o) __locale_gettext_impl in libpython3.10d.a(_localemodule.o) "_libintl_setlocale", referenced from: "_libintl_setlocale", referenced from: __locale_setlocale_impl in libpython3.10d.a(_localemodule.o) _locale_decode_monetary in libpython3.10d.a(_localemodule.o) __locale_setlocale_impl in libpython3.10d.a(_localemodule.o) _locale_decode_monetary in libpython3.10d.a(_localemodule.o) "_libintl_textdomain", referenced from: "_libintl_textdomain", referenced from: __locale_textdomain_impl in libpython3.10d.a(_localemodule.o) __locale_textdomain_impl in libpython3.10d.a(_localemodule.o) ld: symbol(s) not found for architecture arm64 ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [python.exe] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: *** [Programs/_testembed] Error 1 make[2]: *** [build_all_generate_profile] Error 2 make[1]: *** [profile-gen-stamp] Error 2 make: *** [profile-run-stamp] Error 2 Could you help me please to fix this issus ? Best regards Battant ---------- components: macOS messages: 414859 nosy: Battant, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:41:04 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 16:41:04 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1646930464.21.0.157620778768.issue46677@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 8a207e0321db75f3342692905e342f1d5e1add54 by Charlie Zhao in branch 'main': bpo-46677: Add examples of inheritance and attributes to `TypedDict` docs (GH-31349) https://github.com/python/cpython/commit/8a207e0321db75f3342692905e342f1d5e1add54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:43:52 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 16:43:52 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1646930632.03.0.340251762843.issue46677@roundup.psfhosted.org> Jelle Zijlstra added the comment: (assigning to myself to remind myself to see the backports through) ---------- assignee: docs at python -> Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:46:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 16:46:43 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646930803.67.0.894969371662.issue46917@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-46906 "Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API": the implementation supports non-IEEE 754 formats. Once the public C API is added, support for non-IEEE 754 formats should be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:47:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 16:47:26 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646930846.22.0.703029185798.issue46917@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7854012077009b9f364f198a8ae38b546ec58313 by Victor Stinner in branch 'main': bpo-46917: math.nan is now always available (GH-31793) https://github.com/python/cpython/commit/7854012077009b9f364f198a8ae38b546ec58313 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:52:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 16:52:54 +0000 Subject: [issue46656] Remove the Py_NO_NAN macro: require NAN to build Python 3.11 In-Reply-To: <1644141275.01.0.967715714071.issue46656@roundup.psfhosted.org> Message-ID: <1646931174.33.0.0220282606352.issue46656@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-46656: Remove Py_NO_NAN macro (GH-31160) Change documented by: New changeset 7854012077009b9f364f198a8ae38b546ec58313 by Victor Stinner in branch 'main': bpo-46917: math.nan is now always available (GH-31793) https://github.com/python/cpython/commit/7854012077009b9f364f198a8ae38b546ec58313 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:53:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 16:53:43 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646931223.03.0.218086510162.issue46917@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-46917: math.nan is now always available (GH-31793) Technically, it was already the case in practice: see bpo-46656 for the rationale and the history of Py_NAN. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:54:12 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 10 Mar 2022 16:54:12 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1646931252.13.0.681138581416.issue46677@roundup.psfhosted.org> Change by Alex Waygood : ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:55:14 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 10 Mar 2022 16:55:14 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1646931314.33.0.141278838011.issue46581@roundup.psfhosted.org> Change by Alex Waygood : ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 11:56:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 16:56:24 +0000 Subject: [issue46917] Require IEEE 754 floating point to build Python 3.11 In-Reply-To: <1646347183.1.0.816750157745.issue46917@roundup.psfhosted.org> Message-ID: <1646931384.47.0.790663844997.issue46917@roundup.psfhosted.org> STINNER Victor added the comment: > Remove code handling missing NAN and infinity: float("nan"), float("inf"), math.nan and math.inf are always available. The code to support missing NaN was already removed by: New changeset 1b2611eb0283055835e5df632a7a735db8c894b8 by Victor Stinner in branch 'main': bpo-46656: Remove Py_NO_NAN macro (GH-31160) https://github.com/python/cpython/commit/1b2611eb0283055835e5df632a7a735db8c894b8 In fact, math.inf is already always available in Python 3.10 and older. There was no "#ifdef" for missing infinity support. In Python 3.10, math.inf is implemented as: static double m_inf(void) { #ifndef PY_NO_SHORT_FLOAT_REPR return _Py_dg_infinity(0); #else return Py_HUGE_VAL; #endif } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:01:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 17:01:28 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646931688.19.0.758323131479.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: Current status of tests skipped on ASAN, MSAN and UBSAN. Only ASAN (1): * _test_multiprocessing.py:76:if support.check_sanitizer(address=True): ASAN and MSAN (10): * test___all__.py:14:if support.check_sanitizer(address=True, memory=True): * test_concurrent_futures.py:35:if support.check_sanitizer(address=True, memory=True): * test_crypt.py:7: if check_sanitizer(address=True, memory=True): * test_decimal.py:5510: @unittest.skipIf(check_sanitizer(address=True, memory=True), * test_idle.py:5:if check_sanitizer(address=True, memory=True): * test_peg_generator/__init__.py:7:if support.check_sanitizer(address=True, memory=True): * test_tix.py:7:if check_sanitizer(address=True, memory=True): * test_tk.py:6:if check_sanitizer(address=True, memory=True): * test_tools/__init__.py:10:if support.check_sanitizer(address=True, memory=True): * test_ttk_guionly.py:6:if check_sanitizer(address=True, memory=True): Only UB (1): * test_hashlib.py:68:SKIP_SHA3 = support.check_sanitizer(ub=True) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:03:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Mar 2022 17:03:38 +0000 Subject: [issue46973] Provide make target to regenerate autoconf files with container In-Reply-To: <1646918954.08.0.6866798038.issue46973@roundup.psfhosted.org> Message-ID: <1646931818.09.0.124635019238.issue46973@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 434ffb7f1f86e6b0cdfad3ede59993934d86e464 by Christian Heimes in branch 'main': bpo-46973: Add regen-configure make target (GH-31792) https://github.com/python/cpython/commit/434ffb7f1f86e6b0cdfad3ede59993934d86e464 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:07:20 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 10 Mar 2022 17:07:20 +0000 Subject: [issue46976] Update macOS installer builds to use ncurses 6.3 Message-ID: <1646932040.18.0.686827963396.issue46976@roundup.psfhosted.org> New submission from Ned Deily : The python.org macOS installers include a private copy of the ncurses library; it has not been updated from 5.9 in a long time. The current upstream version is 6.3 and includes bug and security fixes; we should update to it. ---------- components: macOS messages: 414869 nosy: ned.deily, ronaldoussoren priority: high severity: normal stage: needs patch status: open title: Update macOS installer builds to use ncurses 6.3 versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:10:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 17:10:29 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646932229.35.0.711875821896.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: I enabled the test on ASAN on test_crypt and I confirm that I get a crash on calling a NULL function. The Python crypt.crypt() function calls the C function crypt_r() which is intercepted by libasan, but the libasan implementation calls a NULL function. I don't know why. $ ./configure --with-address-sanitizer --with-pydebug $ make clean $ ASAN_OPTIONS="detect_leaks=0:allocator_may_return_null=1:handle_segv=0" make $ ASAN_OPTIONS="detect_leaks=0:allocator_may_return_null=1:handle_segv=0" gdb -args ./python -m test -v test_crypt (gdb) run (...) 0:00:00 load avg: 0.53 Run tests sequentially 0:00:00 load avg: 0.53 [1/1] test_crypt Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) where #0 0x0000000000000000 in ?? () #1 0x00007ffff761189f in __interceptor_crypt_r.part.0 () from /lib64/libasan.so.6 #2 0x00007fffe6a40821 in crypt_crypt_impl (module=, word=0xfcb050 "", salt=0x6080004bc660 "$6$d8Imx7a5WbE12iK4") at /home/vstinner/python/main/Modules/_cryptmodule.c:44 #3 0x00007fffe6a40695 in crypt_crypt (module=, args=0x629000001368, nargs=2) at /home/vstinner/python/main/Modules/clinic/_cryptmodule.c.h:58 (...) $ ASAN_OPTIONS="detect_leaks=0:allocator_may_return_null=1:handle_segv=0" ./python -m test -v test_crypt (...) 0:00:00 load avg: 0.56 Run tests sequentially 0:00:00 load avg: 0.56 [1/1] test_crypt Fatal Python error: Segmentation fault Current thread 0x00007f367c6c77c0 (most recent call first): File "/home/vstinner/python/main/Lib/crypt.py", line 82 in crypt File "/home/vstinner/python/main/Lib/crypt.py", line 94 in _add_method File "/home/vstinner/python/main/Lib/crypt.py", line 105 in File "", line 241 in _call_with_frames_removed File "", line 931 in exec_module File "", line 690 in _load_unlocked File "", line 1149 in _find_and_load_unlocked File "", line 1178 in _find_and_load File "/home/vstinner/python/main/Lib/test/test_crypt.py", line 6 in (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:22:08 2022 From: report at bugs.python.org (Alexandre Feblot) Date: Thu, 10 Mar 2022 17:22:08 +0000 Subject: [issue46977] tempfile.TemporaryDirectory fails removing dir in some edge cases related to symlinks Message-ID: <1646932928.52.0.00833614207853.issue46977@roundup.psfhosted.org> New submission from Alexandre Feblot : ```python #!/usr/bin/env python3 import os import tempfile def createUnremovableDir(workdir): print(workdir) os.mkdir(f'{workdir}/mydir') os.symlink('/bin/bash', f'{workdir}/mydir/mylink') # Symlink to a root owned file os.chmod(f'{workdir}/mydir', 0o555) with tempfile.TemporaryDirectory() as workdir: createUnremovableDir(workdir) ``` Fails because `tempfile.TemporaryDirectory._rmtree` tries to execute os.chmod(path, 0o700) on the symlink, which by default tries to change the root owned file symlink target instead of the symlink itself: ``` /tmp/tmp1_dy42ef Traceback (most recent call last): File "/usr/lib/python3.9/shutil.py", line 682, in _rmtree_safe_fd os.unlink(entry.name, dir_fd=topfd) PermissionError: [Errno 13] Permission denied: 'mylink' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "~/tempfile_demo_bug.py", line 13, in createUnremovableDir(workdir) File "/usr/lib/python3.9/tempfile.py", line 969, in __exit__ self.cleanup() File "/usr/lib/python3.9/tempfile.py", line 973, in cleanup self._rmtree(self.name) File "/usr/lib/python3.9/tempfile.py", line 955, in _rmtree _rmtree(name, onerror=onerror) File "/usr/lib/python3.9/shutil.py", line 727, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/usr/lib/python3.9/shutil.py", line 664, in _rmtree_safe_fd _rmtree_safe_fd(dirfd, fullname, onerror) File "/usr/lib/python3.9/shutil.py", line 684, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/usr/lib/python3.9/tempfile.py", line 941, in onerror resetperms(path) File "/usr/lib/python3.9/tempfile.py", line 936, in resetperms _os.chmod(path, 0o700) PermissionError: [Errno 1] Operation not permitted: '/tmp/tmp1_dy42ef/mydir/mylink' ``` and leaves: ``` (.venv python 3.9.9) $ find /tmp/tmp1_dy42ef -ls 148228 4 drwx------ 3 myuser myuser 4096 Mar 10 16:54 /tmp/tmp1_dy42ef 148229 4 drwx------ 2 myuser myuser 4096 Mar 10 16:54 /tmp/tmp1_dy42ef/mydir 148230 0 lrwxrwxrwx 1 myuser myuser 9 Mar 10 16:54 /tmp/tmp1_dy42ef/mydir/mylink -> /bin/bash ``` This fixes it: ``` python #!/usr/bin/env python3 import os import tempfile def createUnremovableDir(workdir): print(workdir) os.mkdir(f'{workdir}/mydir') os.symlink('/bin/bash', f'{workdir}/mydir/mylink') # Symlink to a root owned file os.chmod(f'{workdir}/mydir', 0o555) def _rmtree(cls, name, ignore_errors=False): def onerror(func, path, exc_info): if issubclass(exc_info[0], PermissionError): def resetperms(path): try: if os.chflags in os.supports_follow_symlinks: # This is the patch os.chflags(path, 0, follow_symlinks=False) # This is the patch elif not os.path.islink(path): # This is the patch os.chflags(path, 0) except AttributeError: pass if os.chmod in os.supports_follow_symlinks: # This is the patch os.chmod(path, 0o700, follow_symlinks=False) # This is the patch elif not os.path.islink(path): # This is the patch os.chmod(path, 0o700) try: if path != name: resetperms(os.path.dirname(path)) resetperms(path) try: os.unlink(path) # PermissionError is raised on FreeBSD for directories except (IsADirectoryError, PermissionError): cls._rmtree(path, ignore_errors=ignore_errors) except FileNotFoundError: pass elif issubclass(exc_info[0], FileNotFoundError): pass else: if not ignore_errors: raise shutil.rmtree(name, onerror=onerror) # Monkey patch the class method tempfile.TemporaryDirectory._rmtree from types import MethodType import shutil tempfile.TemporaryDirectory._rmtree = MethodType(_rmtree, tempfile.TemporaryDirectory) with tempfile.TemporaryDirectory() as workdir: createUnremovableDir(workdir) ---------- components: Library (Lib) messages: 414871 nosy: afeblot priority: normal severity: normal status: open title: tempfile.TemporaryDirectory fails removing dir in some edge cases related to symlinks versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:25:32 2022 From: report at bugs.python.org (Alexandre Feblot) Date: Thu, 10 Mar 2022 17:25:32 +0000 Subject: [issue46977] tempfile.TemporaryDirectory fails removing dir in some edge cases related to symlinks In-Reply-To: <1646932928.52.0.00833614207853.issue46977@roundup.psfhosted.org> Message-ID: <1646933132.38.0.520631398369.issue46977@roundup.psfhosted.org> Change by Alexandre Feblot : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:29:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Mar 2022 17:29:40 +0000 Subject: [issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing In-Reply-To: <1646324376.37.0.339343384367.issue46913@roundup.psfhosted.org> Message-ID: <1646933380.33.0.320685762364.issue46913@roundup.psfhosted.org> STINNER Victor added the comment: The crypt_r() interceptor issue was reported in January 2021 to libasan: https://github.com/google/sanitizers/issues/1365 > I enabled the test on ASAN on test_crypt and I confirm that I get a crash on calling a NULL function. Note: I built Python with GCC ASAN (-fsanitize=address). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:32:07 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 10 Mar 2022 17:32:07 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1646933527.98.0.663892380479.issue46975@roundup.psfhosted.org> Ned Deily added the comment: Without more details, this is only a guess but the messages seem to indicate that your build is detecting an installed version of the GNU gettext library, which is optional for Python builds and is not provided by default on macOS, and most likely that version is an Intel-only build of the package and its libintl shared library. Check whether you have an outdated version of gettext and libintl*.dylib installed somewhere, perhaps in /usr/local/, possibly via a third-party package manager like Homebrew or MacPorts, and either remove it or update it with a arm64 (or universal2 fat) build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 12:53:11 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 10 Mar 2022 17:53:11 +0000 Subject: [issue46976] Update macOS installer builds to use ncurses 6.3 In-Reply-To: <1646932040.18.0.686827963396.issue46976@roundup.psfhosted.org> Message-ID: <1646934791.66.0.955316484119.issue46976@roundup.psfhosted.org> Ned Deily added the comment: Assigning to myself as this will require some installer build testing. ---------- assignee: -> ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 13:54:38 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Mar 2022 18:54:38 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1646938478.23.0.134755653219.issue43224@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka nosy_count: 8.0 -> 9.0 pull_requests: +29901 pull_request: https://github.com/python/cpython/pull/31800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 13:56:58 2022 From: report at bugs.python.org (Dutcho) Date: Thu, 10 Mar 2022 18:56:58 +0000 Subject: [issue46969] `pip install wrapt` fails on ast.py in Python 3.11.0a6 In-Reply-To: <1646859853.98.0.761259079796.issue46969@roundup.psfhosted.org> Message-ID: <1646938618.56.0.193928286633.issue46969@roundup.psfhosted.org> Dutcho added the comment: yesterday's `wrapt *1.13.3*` still doesn't work, but today's `wrapt *1.14.0*` works as expected So this wasn't about Python 3.11 but about the wrapt version, which used the deprecated `formatargspec` from module `inspect` ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 14:07:42 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 10 Mar 2022 19:07:42 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1646939262.36.0.795456202631.issue43224@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 14:36:25 2022 From: report at bugs.python.org (Nicko van Someren) Date: Thu, 10 Mar 2022 19:36:25 +0000 Subject: [issue46978] Doc strings for built-in, in-place operators are misleading Message-ID: <1646940985.13.0.430689283969.issue46978@roundup.psfhosted.org> New submission from Nicko van Someren : Objects/typeobject.c uses slots to implement various operators and the IBSLOT macro is used to define slot entries for in-place binary operators. This macro creates a __doc__ string for the operators of the form "Return selfvalue." This doc string is misleading since an in-place operator statement can not be used as an L-value, so nothing is "returned". To fix this, the macro definition for IBSLOT should be updated to use a different word or phrase, such as "Compute selfvalue." ---------- components: Interpreter Core messages: 414876 nosy: nickovs priority: normal severity: normal status: open title: Doc strings for built-in, in-place operators are misleading 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 Thu Mar 10 14:50:26 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 10 Mar 2022 19:50:26 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1646941826.49.0.870558215076.issue46581@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:40:35 2022 From: report at bugs.python.org (Carl Meyer) Date: Thu, 10 Mar 2022 20:40:35 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646944835.53.0.415188715066.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: Thanks for outlining the use cases. They make sense. The current PR provides a flexible generic API that fully supports all three of those use cases (use cases 2 and 3 are strict subsets of use case 1.) Since the callback is called before the dict is modified, all the necessary information is available to the callback to decide whether the event is interesting to it or not. The question is how much of the bookkeeping to classify events as "interesting" or "uninteresting" should be embedded in the core dispatch vs being handled by the callback. One reason to prefer keeping this logic in the callback is that with potentially multiple chained callbacks in play, the filtering logic must always exist in the callback, regardless. E.g. if callback A wants to watch only keys-version changes to dict X, but callback B wants to watch all changes to it, events will fire for all changes, and callback A must still disregard "uninteresting" events that it may receive (just like it may receive events for dicts it never asked to watch at all.) So providing API for different "levels" of watching means that the "is this event interesting to me" predicate must effectively be duplicated both in the callback and in the watch level chosen. The proposed rationale for this complexity and duplication is the idea that filtering out uninteresting events at dispatch will provide better performance. But this is hypothetical: it assumes the existence of perf-bottleneck code paths that repeatedly rebind globals. The only benchmark workload with this characteristic that I know of is pystone, and it is not even part of the pyperformance suite, I think precisely because it is not representative of real-world code patterns. And even assuming that we do need to optimize for such code, it's also not obvious that it will be noticeably cheaper in practice to filter on the dispatch side. It may be more useful to focus on API. If we get the API right, internal implementation details can always be adjusted in future if a different implementation can be shown to be noticeably faster for relevant use cases. And if we get existing API right, we can always add new API if we have to. I don't think anything about the proposed simple API precludes adding `PyDict_WatchKeys` as an additional feature, if it turns out to be necessary. One modification to the simple proposed API that should improve the performance (and ease of implementation) of use case #2 would be to split the current `PyDict_EVENT_MODIFIED` into two separate event types: `PyDict_EVENT_MODIFIED` and `PyDict_EVENT_NEW_KEY`. Then the callback-side event filtering for use case #2 would just be `event == PyDict_EVENT_NEW_KEY` instead of requiring a lookup into the dict to see whether the key was previously set or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 15:43:21 2022 From: report at bugs.python.org (Bankole Jesutofunmi) Date: Thu, 10 Mar 2022 20:43:21 +0000 Subject: [issue46979] Master piece Message-ID: <1646945000.99.0.420885762408.issue46979@roundup.psfhosted.org> New submission from Bankole Jesutofunmi : Protection ---------- components: Build, Demos and Tools messages: 414878 nosy: Banky_1104, teoliphant priority: normal severity: normal status: open title: Master piece type: security versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:11:22 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 10 Mar 2022 21:11:22 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646946682.08.0.939033965839.issue46198@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood nosy_count: 3.0 -> 4.0 pull_requests: +29902 pull_request: https://github.com/python/cpython/pull/31801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:18:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 21:18:30 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646947110.88.0.601183290884.issue46198@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset f7f7838b41d45efa129a61f104136f8e12f3488a by Jelle Zijlstra in branch '3.9': [3.9] bpo-46198: rename duplicate tests and remove unused code (GH-30297) (GH-31797) https://github.com/python/cpython/commit/f7f7838b41d45efa129a61f104136f8e12f3488a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:23:47 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 10 Mar 2022 21:23:47 +0000 Subject: [issue46979] Spam In-Reply-To: <1646945000.99.0.420885762408.issue46979@roundup.psfhosted.org> Message-ID: <1646947427.83.0.837785360806.issue46979@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- components: -Build resolution: -> not a bug stage: -> resolved status: open -> closed title: Master piece -> Spam type: security -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:33:23 2022 From: report at bugs.python.org (Nicko van Someren) Date: Thu, 10 Mar 2022 21:33:23 +0000 Subject: [issue46978] Doc strings for built-in, in-place operators are misleading In-Reply-To: <1646940985.13.0.430689283969.issue46978@roundup.psfhosted.org> Message-ID: <1646948003.53.0.438269870146.issue46978@roundup.psfhosted.org> Change by Nicko van Someren : ---------- keywords: +patch pull_requests: +29903 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:34:05 2022 From: report at bugs.python.org (Roundup Robot) Date: Thu, 10 Mar 2022 21:34:05 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1646948045.5.0.364730968145.issue46744@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +29904 pull_request: https://github.com/python/cpython/pull/31803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:36:35 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 21:36:35 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646948195.62.0.343525919778.issue46198@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 4052dd2296da2ff304b1fa787b100befffa1c9ca by Alex Waygood in branch 'main': bpo-46198: Fix `test_asyncio.test_sslproto` (GH-31801) https://github.com/python/cpython/commit/4052dd2296da2ff304b1fa787b100befffa1c9ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:38:13 2022 From: report at bugs.python.org (Bernie Hackett) Date: Thu, 10 Mar 2022 21:38:13 +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: <1646948293.22.0.88211717354.issue43923@roundup.psfhosted.org> Change by Bernie Hackett : ---------- nosy: +behackett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 16:53:58 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Mar 2022 21:53:58 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646949238.38.0.19502073312.issue46198@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 4199b7ffbbaa5fe52a4c85c8672ac6773a75ba8f by Jelle Zijlstra in branch '3.10': [3.10] bpo-46198: rename duplicate tests and remove unused code (GH-30297) (GH-31796) https://github.com/python/cpython/commit/4199b7ffbbaa5fe52a4c85c8672ac6773a75ba8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 17:51:09 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Thu, 10 Mar 2022 22:51:09 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1646952669.66.0.0326778808367.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29905 pull_request: https://github.com/python/cpython/pull/31804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:18:46 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 10 Mar 2022 23:18:46 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1646954326.2.0.904293164266.issue46198@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 18:40:14 2022 From: report at bugs.python.org (Carl Meyer) Date: Thu, 10 Mar 2022 23:40:14 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646955614.63.0.57493446197.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: I've updated the PR to split `PyDict_EVENT_MODIFIED` into separate `PyDict_EVENT_ADDED`, `PyDict_EVENT_MODIFIED`, and `PyDict_EVENT_DELETED` event types. This allows callbacks only interested in e.g. added keys (case #2) to more easily and cheaply skip uninteresting events. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 20:03:01 2022 From: report at bugs.python.org (Hu Di) Date: Fri, 11 Mar 2022 01:03:01 +0000 Subject: [issue46971] python takes long time when return big data In-Reply-To: <1646905386.12.0.964981264374.issue46971@roundup.psfhosted.org> Message-ID: <1646960581.08.0.0472593604518.issue46971@roundup.psfhosted.org> Hu Di <476658825 at qq.com> added the comment: thanks for your explaining, by the way, why it costs lots of time when del a large array? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 20:15:58 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 11 Mar 2022 01:15:58 +0000 Subject: [issue46892] Async Call-Stack Reconstruction In-Reply-To: <1646172818.87.0.620414144341.issue46892@roundup.psfhosted.org> Message-ID: <1646961358.93.0.401688092005.issue46892@roundup.psfhosted.org> Andrew Svetlov added the comment: > We?d like to merge our implementation into CPython Could you provide a link first, please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 21:24:40 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 11 Mar 2022 02:24:40 +0000 Subject: [issue46881] Statically allocate and initialize the latin1 characters. In-Reply-To: <1646053348.55.0.937753092888.issue46881@roundup.psfhosted.org> Message-ID: <1646965480.58.0.419568756091.issue46881@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra nosy_count: 5.0 -> 6.0 pull_requests: +29906 pull_request: https://github.com/python/cpython/pull/31805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 21:40:00 2022 From: report at bugs.python.org (Hu Di) Date: Fri, 11 Mar 2022 02:40:00 +0000 Subject: [issue46971] python takes long time when return big data In-Reply-To: <1646905386.12.0.964981264374.issue46971@roundup.psfhosted.org> Message-ID: <1646966400.85.0.354812206723.issue46971@roundup.psfhosted.org> Hu Di <476658825 at qq.com> added the comment: I am currently processing large data, and the time spent by del is unacceptable. Is there any way to process del in parallel? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 22:08:56 2022 From: report at bugs.python.org (Ruishi) Date: Fri, 11 Mar 2022 03:08:56 +0000 Subject: [issue46980] ast.FunctionDef cannot find functions under if statement Message-ID: <1646968136.79.0.973896459669.issue46980@roundup.psfhosted.org> New submission from Ruishi : When I use the Python ast package to get the functions of Python files, I find the functions defined in the body of `if` statement cannot be recognized. Here is my code: with open(py_file, 'r') as f: data = f.read() module = ast.parse(data) func_def = [node for node in module.body if isinstance(node, ast.FunctionDef)] Here is an example of Python file: if supports_bytes_environ: def _check_bytes(value): if not isinstance(value, bytes): raise TypeError("bytes expected, not %s" % type(value).__name__) return value The function `_check_bytes` is not in `func_def`. I also tested `ast.iter_child_nodes(module)` and it also has this issue. ---------- components: Parser messages: 414886 nosy: Ruishi, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: ast.FunctionDef cannot find functions under if statement type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 22:11:24 2022 From: report at bugs.python.org (Ruishi) Date: Fri, 11 Mar 2022 03:11:24 +0000 Subject: [issue46980] ast.FunctionDef cannot find functions under if statement In-Reply-To: <1646968136.79.0.973896459669.issue46980@roundup.psfhosted.org> Message-ID: <1646968284.24.0.800817134351.issue46980@roundup.psfhosted.org> Ruishi added the comment: I'm not sure whether I should file this issue here or on Github and I'm not an expert on this so I think I cannot contribute to this but only report to you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 23:09:18 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 11 Mar 2022 04:09:18 +0000 Subject: [issue46980] ast.FunctionDef cannot find functions under if statement In-Reply-To: <1646968136.79.0.973896459669.issue46980@roundup.psfhosted.org> Message-ID: <1646971758.29.0.315506426441.issue46980@roundup.psfhosted.org> Jelle Zijlstra added the comment: This is the right place to file an issue. Your code is incorrect; it will find only top-level functions. Functions within an `if` statement will be nested inside an `ast.If` node. To find all functions in a file, you'll need to recurse into nested nodes. For example, you could use `ast.walk`, an `ast.NodeVisitor`, or manually check for nodes like `ast.If`. Which one is best depends on your needs. For example, the first two will also find methods in classes. The ast module documentation has more information. ---------- nosy: +Jelle Zijlstra resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 10 23:21:57 2022 From: report at bugs.python.org (Charlie Zhao) Date: Fri, 11 Mar 2022 04:21:57 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1646972517.12.0.359567116466.issue46677@roundup.psfhosted.org> Change by Charlie Zhao : ---------- pull_requests: +29907 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/31808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 00:54:15 2022 From: report at bugs.python.org (Inada Naoki) Date: Fri, 11 Mar 2022 05:54:15 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1646978055.51.0.563873044804.issue39829@roundup.psfhosted.org> Inada Naoki added the comment: > Changes compared here: https://github.com/python/cpython/compare/main...thatbirdguythatuknownot:patch-17 Looks good to me. Would you create a pull request? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 00:58:21 2022 From: report at bugs.python.org (Stanley) Date: Fri, 11 Mar 2022 05:58:21 +0000 Subject: =?utf-8?q?=5Bissue9182=5D_document_=E2=80=9C--=E2=80=9D_as_a_way_to_disti?= =?utf-8?q?nguish_option_w/_narg=3D=27+=27_from_positional_argument_in_arg?= =?utf-8?q?parse?= In-Reply-To: <1278433481.81.0.201692715302.issue9182@psf.upfronthosting.co.za> Message-ID: <1646978301.84.0.0646874035488.issue9182@roundup.psfhosted.org> Change by Stanley : ---------- nosy: +slateny nosy_count: 13.0 -> 14.0 pull_requests: +29908 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:21:01 2022 From: report at bugs.python.org (Larry Hastings) Date: Fri, 11 Mar 2022 06:21:01 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1646979661.82.0.419889736644.issue46761@roundup.psfhosted.org> Larry Hastings added the comment: Nobody I've nosied on this issue recently has expressed any opinion on the matter. I'm gonna try one more person: Graham Dumpleton, the maintainer of "wrapt", Python's premier function-wrapping. Graham, care to express any opinions about this issue? Can we fix it without causing widespread wailing and gnashing of teeth? Do you think people are depending on the current how-can-you-describe-it-as-anything-but-broken behavior? ---------- nosy: +grahamd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:33:09 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 11 Mar 2022 06:33:09 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646980389.12.0.421161321353.issue46920@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- pull_requests: +29909 pull_request: https://github.com/python/cpython/pull/31811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:37:16 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 11 Mar 2022 06:37:16 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646980636.94.0.619528024332.issue46920@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- pull_requests: +29910 pull_request: https://github.com/python/cpython/pull/31812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:40:30 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 11 Mar 2022 06:40:30 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646980830.92.0.758396759657.issue46920@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- pull_requests: +29911 pull_request: https://github.com/python/cpython/pull/31813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 01:41:13 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 11 Mar 2022 06:41:13 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1646980873.19.0.0010847392661.issue46920@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- pull_requests: +29912 pull_request: https://github.com/python/cpython/pull/31814 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:01:38 2022 From: report at bugs.python.org (Ruishi) Date: Fri, 11 Mar 2022 07:01:38 +0000 Subject: [issue46980] ast.FunctionDef cannot find functions under if statement In-Reply-To: <1646968136.79.0.973896459669.issue46980@roundup.psfhosted.org> Message-ID: <1646982098.47.0.053181736402.issue46980@roundup.psfhosted.org> Ruishi added the comment: I see. It's my misunderstanding. Thank you for your help! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 02:09:36 2022 From: report at bugs.python.org (Charlie Zhao) Date: Fri, 11 Mar 2022 07:09:36 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1646982576.84.0.640009887212.issue46677@roundup.psfhosted.org> Change by Charlie Zhao : ---------- pull_requests: +29913 pull_request: https://github.com/python/cpython/pull/31815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:21:12 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 08:21:12 +0000 Subject: [issue46981] Empty typing.Tuple Message-ID: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are two empty typing.Tuple. They have the same repr but are not equal. >>> from typing import * >>> t1 = Tuple[()] >>> t2 = t1.copy_with(()) >>> t1 typing.Tuple[()] >>> t2 typing.Tuple[()] >>> t1 == t2 False >>> t1.__args__ ((),) >>> t2.__args__ () The only differences is that one has empty __args__, while other has __args__ containing an empty tuple. There is a code purposed to make __args__ containing an empty tuple in this case. What is the purpose? It is not pure theoretical question. This affects unpacked TypeVarTuple substitution. With natural implementation Tuple[Unpack[Ts]][()] is not equal to Tuple[()] and I still have not figured which and where code should be added to handle this special case. It would be easier if such special case did not exist. Built-in tuple does not have a special case: >>> tuple[()].__args__ () ---------- components: Library (Lib) messages: 414892 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Empty typing.Tuple _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:25:03 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 08:25:03 +0000 Subject: [issue46982] Error in the experts list Message-ID: <1646987103.96.0.139741803932.issue46982@roundup.psfhosted.org> New submission from Serhiy Storchaka : After adding experts for typing module, I get an error when try to submit changes: Error: property nosy: 'JelleZijlstra' is not a user. I think there is a typo in the experts list. ---------- messages: 414893 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Error in the experts list _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:38:02 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 08:38:02 +0000 Subject: [issue35677] Do not automount in stat() by default In-Reply-To: <1546852678.92.0.232634094535.issue35677@roundup.psfhosted.org> Message-ID: <1646987882.6.0.78450110386.issue35677@roundup.psfhosted.org> Serhiy Storchaka added the comment: Glad to see that this old inconsistency was fixed. But seems that if we will add support for statx() we will need to set AT_NO_AUTOMOUNT by default. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 03:47:56 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 08:47:56 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1646988476.21.0.677667998214.issue44796@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b6a5d8590c4bfe4553d796b36af03bda8c0d5af5 by Serhiy Storchaka in branch 'main': bpo-44796: Unify TypeVar and ParamSpec substitution (GH-31143) https://github.com/python/cpython/commit/b6a5d8590c4bfe4553d796b36af03bda8c0d5af5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 04:05:16 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 11 Mar 2022 09:05:16 +0000 Subject: [issue46881] Statically allocate and initialize the latin1 characters. In-Reply-To: <1646053348.55.0.937753092888.issue46881@roundup.psfhosted.org> Message-ID: <1646989516.6.0.0722172475594.issue46881@roundup.psfhosted.org> Ken Jin added the comment: New changeset 54ab9ad312ea53db40e31712454272e1d4c0315f by Jelle Zijlstra in branch 'main': bpo-46881: Fix refleak from GH-31616 (GH-31805) https://github.com/python/cpython/commit/54ab9ad312ea53db40e31712454272e1d4c0315f ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 04:37:10 2022 From: report at bugs.python.org (Jeremiah Pascual) Date: Fri, 11 Mar 2022 09:37:10 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1646991430.2.0.236149889622.issue39829@roundup.psfhosted.org> Change by Jeremiah Pascual : ---------- keywords: +patch pull_requests: +29914 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 04:40:00 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 11 Mar 2022 09:40:00 +0000 Subject: [issue46982] Error in the experts list In-Reply-To: <1646987103.96.0.139741803932.issue46982@roundup.psfhosted.org> Message-ID: <1646991600.59.0.613014227219.issue46982@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 04:55:20 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Mar 2022 09:55:20 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1646992520.22.0.771301622395.issue46943@roundup.psfhosted.org> Irit Katriel added the comment: @spaceone I'd suggest you create a new PR. Once many people are subscribed to a PR we don't like to reopen it and spam everyone. It would also be necessary to add a unit test. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 05:16:34 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 11 Mar 2022 10:16:34 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1646993794.59.0.679498842525.issue46841@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +29915 pull_request: https://github.com/python/cpython/pull/31817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 06:11:39 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 11 Mar 2022 11:11:39 +0000 Subject: [issue46892] Async Call-Stack Reconstruction In-Reply-To: <1646172818.87.0.620414144341.issue46892@roundup.psfhosted.org> Message-ID: <1646997099.61.0.241428190648.issue46892@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +gvanrossum, kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 06:14:53 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 11 Mar 2022 11:14:53 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646997293.98.0.611618941046.issue46896@roundup.psfhosted.org> Mark Shannon added the comment: You might not like global variables, they may not show up much in benchmarks, but people do use them. I suspect a lot of jupyter notebooks have quite a few global variables. There should not be much of a slowdown for this code when watching `CONST`: CONST = ... # watched var = 0 for _ in range(LARGE_NUMBER): var += 1 CONST = ... # trigger event. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 06:20:47 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 11 Mar 2022 11:20:47 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1646997647.51.0.312200630085.issue46896@roundup.psfhosted.org> Mark Shannon added the comment: Another use of this is to add watch points in debuggers. To that end, it would better if the callback were a Python object. The overhead is relatively small if using the vectorcall protocol. If the call overhead matters that much, there is something wrong as way too many callbacks are happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 07:24:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 12:24:41 +0000 Subject: [issue46983] test_sqlite3: test_trace_too_much_expanded_sql() failed on AMD64 Arch Linux Usan 3.x Message-ID: <1647001481.77.0.569348369265.issue46983@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Arch Linux Usan 3.x: https://buildbot.python.org/all/#/builders/719/builds/672 Python configured with: ./configure CC=clang LD=clang CFLAGS=-fno-sanitize-recover --with-undefined-behavior-sanitizer 0:12:11 load avg: 1.63 Re-running test_sqlite3 in verbose mode (matching: test_trace_too_much_expanded_sql) test_sqlite3: testing with version '2.6.0', sqlite_version '3.37.0' test_trace_too_much_expanded_sql (test.test_sqlite3.test_hooks.TraceCallbackTests) ... FAIL ====================================================================== FAIL: test_trace_too_much_expanded_sql (test.test_sqlite3.test_hooks.TraceCallbackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_sqlite3/test_userfunctions.py", line 62, in check_tracebacks yield ^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_sqlite3/test_userfunctions.py", line 47, in wrapper func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_sqlite3/test_dbapi.py", line 61, in cx_limit yield limit ^^^^^^^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_sqlite3/test_hooks.py", line 338, in test_trace_too_much_expanded_sql with self.check_stmt_trace(cx, [unexpanded_query]): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/contextlib.py", line 144, in __exit__ next(self.gen) ^^^^^^^^^^^^^^ File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Lib/test/test_sqlite3/test_hooks.py", line 238, in check_stmt_trace self.assertEqual(traced, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Lists differ: ['sel[41 chars] "a"=\'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[39 chars]a\''] != ['sel[41 chars] "a"=?'] First differing element 0: 'sele[40 chars] "a"=\'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[38 chars]aa\'' 'sele[40 chars] "a"=?' - ['select \'b\' as "a" from sqlite_master where ' + ['select \'b\' as "a" from sqlite_master where "a"=?'] ? +++++ + - '"a"=\'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\''] ---------- components: Library (Lib) messages: 414900 nosy: erlendaasland, vstinner priority: normal severity: normal status: open title: test_sqlite3: test_trace_too_much_expanded_sql() failed on AMD64 Arch Linux Usan 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:27:03 2022 From: report at bugs.python.org (SpaceOne) Date: Fri, 11 Mar 2022 13:27:03 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1647005223.33.0.436656024071.issue46943@roundup.psfhosted.org> SpaceOne added the comment: @iritkatriel I added a unit test to the branch. I can't create a new PR without creating a new branch. But that doesn't make much sense from a technical point. It only increases the number of existing merge requests. Also all the people subscribed to the current MR will receive another email for the new merge request. So just clicking on "Reopen" on your side should be simple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:30:32 2022 From: report at bugs.python.org (Pradyun Gedam) Date: Fri, 11 Mar 2022 13:30:32 +0000 Subject: [issue46985] Upgrade bundled pip to 22.0.4 Message-ID: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> New submission from Pradyun Gedam : Looks like I forgot to file PRs for the last few pip releases. :) ---------- components: Library (Lib) messages: 414904 nosy: pradyunsg priority: normal severity: normal status: open title: Upgrade bundled pip to 22.0.4 type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:38:13 2022 From: report at bugs.python.org (Pradyun Gedam) Date: Fri, 11 Mar 2022 13:38:13 +0000 Subject: [issue46985] Upgrade bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647005893.89.0.744510627469.issue46985@roundup.psfhosted.org> Change by Pradyun Gedam : ---------- keywords: +patch pull_requests: +29917 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:38:38 2022 From: report at bugs.python.org (Pradyun Gedam) Date: Fri, 11 Mar 2022 13:38:38 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647005918.59.0.0151636070364.issue46985@roundup.psfhosted.org> Change by Pradyun Gedam : ---------- title: Upgrade bundled pip to 22.0.4 -> Upgrade ensurepip bundled pip to 22.0.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:44:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Mar 2022 13:44:14 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1647006254.37.0.0639334434397.issue46943@roundup.psfhosted.org> Irit Katriel added the comment: The people subscribed to the closed pr will not receive an email about a new pr which is opened correctly. What makes you think they would? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:47:45 2022 From: report at bugs.python.org (Pradyun Gedam) Date: Fri, 11 Mar 2022 13:47:45 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 Message-ID: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> New submission from Pradyun Gedam : This is closely related to bpo-46985. I'm changing up the regular strategy of a single PR that bumps both pip + setuptools in a single PR. So... here's a separate bpo issue for that. ---------- components: Library (Lib) messages: 414906 nosy: pradyunsg priority: normal severity: normal status: open title: Upgrade ensurepip bundled setuptools to 60.9.3 type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:55:01 2022 From: report at bugs.python.org (Pradyun Gedam) Date: Fri, 11 Mar 2022 13:55:01 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647006901.48.0.196453872683.issue46986@roundup.psfhosted.org> Change by Pradyun Gedam : ---------- keywords: +patch pull_requests: +29918 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 08:58:37 2022 From: report at bugs.python.org (Matt Bogosian) Date: Fri, 11 Mar 2022 13:58:37 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1647007117.87.0.0645124203581.issue46581@roundup.psfhosted.org> Change by Matt Bogosian : ---------- pull_requests: +29919 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/31821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:08:22 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 11 Mar 2022 14:08:22 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId Message-ID: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> New submission from Dong-hee Na : There is no usage of _PySys_GetObjectId / _PySys_GetObjectId private APIs in CPython project. Since these APIs use _Py_Identifier as the parameter, it looks good to be removed this time when there is no usage at all. But before removing these APIs, I will investigate the current usage of external projects even if they are not intended to be used from outside. ---------- assignee: corona10 components: C API messages: 414907 nosy: corona10, eric.snow, vstinner priority: normal severity: normal status: open title: Remove _PySys_GetObjectId / _PySys_GetObjectId type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:37:26 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 11 Mar 2022 14:37:26 +0000 Subject: [issue46944] Use FASTCALL calling convention in generator.throw In-Reply-To: <1646654196.99.0.903506705512.issue46944@roundup.psfhosted.org> Message-ID: <1647009446.09.0.887349279847.issue46944@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 304197b3820309e3ed695ff3e6a71461881a1728 by Kumar Aditya in branch 'main': bpo-46944: use FASTCALL calling convention in generator.throw (GH-31723) https://github.com/python/cpython/commit/304197b3820309e3ed695ff3e6a71461881a1728 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:43:01 2022 From: report at bugs.python.org (SpaceOne) Date: Fri, 11 Mar 2022 14:43:01 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1647009781.9.0.874263487518.issue46943@roundup.psfhosted.org> SpaceOne added the comment: @iritkatriel they were automatically added by github via your `.github/CODEOWNERS` file with the `**/*imap* @python/email-team` match. And they all will also be informed by another pull request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:52:45 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 11 Mar 2022 14:52:45 +0000 Subject: [issue45149] Cover directory and zipfile execution in __main__ module docs In-Reply-To: <1631173542.48.0.638794162329.issue45149@roundup.psfhosted.org> Message-ID: <1647010365.72.0.165443691766.issue45149@roundup.psfhosted.org> Change by Petr Viktorin : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:58:05 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 14:58:05 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1647010685.93.0.949203668133.issue46581@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 3bc801960655ea265599805eac24173164b511a6 by Matt Bogosian in branch '3.10': [3.10] bpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061) (GH-31821) https://github.com/python/cpython/commit/3bc801960655ea265599805eac24173164b511a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 09:58:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 14:58:44 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1647010724.81.0.905496401939.issue46581@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:03:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Mar 2022 15:03:27 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1647011007.64.0.164024128334.issue46943@roundup.psfhosted.org> Irit Katriel added the comment: That happened because your PR was wrong - it contained many commits that touched many files, all of whose owners were modified. If you make the PR against the main branch, the diff will not have all those files a and they will not be notified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:06:54 2022 From: report at bugs.python.org (Zachary Ware) Date: Fri, 11 Mar 2022 15:06:54 +0000 Subject: [issue46982] Error in the experts list In-Reply-To: <1646987103.96.0.139741803932.issue46982@roundup.psfhosted.org> Message-ID: <1647011214.73.0.539491231013.issue46982@roundup.psfhosted.org> Zachary Ware added the comment: Jelle, I think the simplest solution would be to remove the space from your bpo login name. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:32:23 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 11 Mar 2022 15:32:23 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647012743.87.0.940676780789.issue46987@roundup.psfhosted.org> Dong-hee Na added the comment: ./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stdin) // borrowed ref ./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stdout) // borrowed ref ./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stderr) // borrowed ref ./top_5000/pickle5-0.0.12.tar.gz: pickle5-0.0.12/pickle5/_pickle.c: modules = _PySys_GetObjectId(&PyId_modules); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:38:12 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 11 Mar 2022 15:38:12 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647013092.21.0.645242522942.issue46987@roundup.psfhosted.org> Dong-hee Na added the comment: @pitrou https://github.com/pitrou/pickle5-backport/blob/e6117502435aba2901585cc6c692fb9582545f08/pickle5/_pickle.c#L1937 Do you have a plan to use PySys_GetObject("modules") instead of _PySys_GetObjectId(&PyId_modules)? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:40:19 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 11 Mar 2022 15:40:19 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647013219.19.0.984890896758.issue46987@roundup.psfhosted.org> Dong-hee Na added the comment: @vstinner >From my view, PySys_GetObject is available since Python3.2 both APIs look safe to remove. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:46:47 2022 From: report at bugs.python.org (SpaceOne) Date: Fri, 11 Mar 2022 15:46:47 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1647013607.69.0.449113232255.issue46943@roundup.psfhosted.org> Change by SpaceOne : ---------- pull_requests: +29920 pull_request: https://github.com/python/cpython/pull/31823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 10:48:11 2022 From: report at bugs.python.org (SpaceOne) Date: Fri, 11 Mar 2022 15:48:11 +0000 Subject: [issue46943] fix[imaplib]: call Exception with string instance In-Reply-To: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org> Message-ID: <1647013691.57.0.185544076477.issue46943@roundup.psfhosted.org> SpaceOne added the comment: @iritkatriel alright, I am sorry. I created another PR: https://github.com/python/cpython/pull/31823 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:38:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 16:38:40 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647016720.2.0.102901707708.issue46987@roundup.psfhosted.org> STINNER Victor added the comment: https://pypi.org/project/pickle5/ should not be used on Python 3.8 and newer: it's a backport for Python 3.7 and older. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:40:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 16:40:05 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647016805.17.0.23987969598.issue46987@roundup.psfhosted.org> STINNER Victor added the comment: > From my view, PySys_GetObject is available since Python3.2 both APIs look safe to remove. _PySys_GetObjectId() and _PySys_GetObjectId() are private API and can be removed anytime. We don't provide any backward compatibility warranty on the private API: https://docs.python.org/dev/c-api/stable.html#c-api-stability "Names prefixed by an underscore, such as _Py_InternalState, are private API that can change without notice even in patch releases." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:41:05 2022 From: report at bugs.python.org (markhuang3310) Date: Fri, 11 Mar 2022 16:41:05 +0000 Subject: [issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError Message-ID: <1647016865.89.0.743756251929.issue46988@roundup.psfhosted.org> New submission from markhuang3310 : Env: Windows 10 Python3.8.10 amd64 Desciption: I try to get output from a python program with a subprocess. The python program print a unicode character. ``` import subprocess import sys cmd = rf'''{sys.executable} -c "print('\u042f')"''' print('case 1') stdout, stderr = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=None).communicate() print('case 2') stdout, stderr = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate() print(stderr) ``` The issue is that: In case 1, I can see the "?" (\u042f) form console. In case 2, I try to get the output from subprocess.Popen(command).communicate()[0], the python process fail with UnicodeEncodeError. Expected result: In case2, I should get stdout == b'\u042f' ---------- components: Windows files: test.py messages: 414919 nosy: markhuang3310, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50667/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:41:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 16:41:39 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647016899.13.0.813085772226.issue46987@roundup.psfhosted.org> STINNER Victor added the comment: > ./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stdout) // borrowed ref It would be nice to notify datatable, or even propose a PR, if the _PySys_GetObjectId() is removed in Python 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:43:29 2022 From: report at bugs.python.org (markhuang3310) Date: Fri, 11 Mar 2022 16:43:29 +0000 Subject: [issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError In-Reply-To: <1647016865.89.0.743756251929.issue46988@roundup.psfhosted.org> Message-ID: <1647017009.51.0.053456846653.issue46988@roundup.psfhosted.org> markhuang3310 added the comment: the test output: PS C:\case_dev> python3 .\test.py case 1 ? case 2 b'Traceback (most recent call last):\r\n File "", line 1, in \r\n File "C:\\Python36\\lib\\encodings\\cp1252.py", line 19, in encode\r\n return codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\nUnicodeEncodeError: \'charmap\' codec can\'t encode character \'\\u042f\' in position 0: character maps to \r\n' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 07:27:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 12:27:27 +0000 Subject: [issue46984] test_concurrent_futures logs many UndefinedBehaviorSanitizer "DEADLYSIGNAL" errors on AMD64 Arch Linux Usan 3.x Message-ID: <1647001647.41.0.938869406277.issue46984@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Arch Linux Usan 3.x: https://buildbot.python.org/all/#/builders/719/builds/672 I don't know if ASAN_OPTIONS env var is set on this buildbot. test.pythoninfo doesn't log ASAN_OPTIONS env var. 0:04:22 load avg: 1.30 [130/433] test_concurrent_futures passed (2 min 48 sec) -- running: test_multiprocessing_fork (44.3 sec) UndefinedBehaviorSanitizer:DEADLYSIGNAL ==348616==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e8000551c8 (pc 0x7fec1ffcc702 bp 0x000000000000 sp 0x7ffc39f5d020 T348616) ==348616==The signal is caused by a READ memory access. #0 0x7fec1ffcc702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x555e6be87c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x555e6be87c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x555e6bce3c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #9 0x7fec1e2fca2d in load_reduce /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6761:15 #10 0x7fec1e2fca2d in load /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6909:9 #11 0x7fec1e2f23b7 in _pickle_loads_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:7861:14 #12 0x7fec1e2f23b7 in _pickle_loads /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/clinic/_pickle.c.h:834:20 #13 0x555e6bce2d27 in cfunction_vectorcall_FASTCALL_KEYWORDS /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:443:24 #14 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #15 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #16 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #17 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #18 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #19 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #20 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #21 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #22 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #23 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #24 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #25 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #26 0x555e6bd1bcf4 in slot_tp_init /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7802:15 #27 0x555e6bd07c21 in type_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:1116:19 #28 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #29 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #30 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #31 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #32 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #33 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #34 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #35 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #36 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #37 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #38 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #39 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #40 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #41 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #42 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #43 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #44 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #45 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #46 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #47 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #48 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #49 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #50 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #51 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #52 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #53 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #54 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #55 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #56 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #57 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #58 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #59 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #60 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #61 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #62 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #63 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #64 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #65 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #66 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #67 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #68 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #69 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #70 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #71 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #72 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #73 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #74 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #75 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #76 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #77 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #78 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #79 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #80 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #81 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #82 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #83 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #84 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #85 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #86 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #87 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #88 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #89 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #90 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #91 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #92 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #93 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #94 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #95 0x555e6bf0d044 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #96 0x555e6bf0e5b2 in partial_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/_functoolsmodule.c:223:16 #97 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #98 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #99 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #100 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #101 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #102 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #103 0x555e6bc71d53 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:52:18 #104 0x555e6bc6e182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #105 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #106 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #107 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #108 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #109 0x555e6bdc4abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #110 0x555e6bdbf5c8 in builtin_exec_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/bltinmodule.c:1040:13 #111 0x555e6bdbf5c8 in builtin_exec /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/clinic/bltinmodule.c.h:371:20 #112 0x555e6bce2bf3 in cfunction_vectorcall_FASTCALL /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:427:24 #113 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #114 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #115 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #116 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #117 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #118 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #119 0x555e6be802ac in pymain_run_module /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:293:14 #120 0x555e6be7f6c0 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c #121 0x555e6be7f6c0 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #122 0x555e6be80059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #123 0x555e6be80106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #124 0x7fec1fdecb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #125 0x555e6bbce69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==348616==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==348627==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e8000551d3 (pc 0x7fec1ffcc702 bp 0x000000000000 sp 0x7ffc39f5d1e0 T348627) ==348627==The signal is caused by a READ memory access. #0 0x7fec1ffcc702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x555e6be87c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x555e6be87c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x555e6bce3c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #9 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #10 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #11 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #12 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #13 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #14 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #15 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #16 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #17 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #18 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #19 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #20 0x555e6bd1bcf4 in slot_tp_init /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7802:15 #21 0x555e6bd07c21 in type_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:1116:19 #22 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #23 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #24 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #25 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #26 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #27 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #28 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #29 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #30 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #31 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #32 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #33 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #34 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #35 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #36 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #37 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #38 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #39 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #40 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #41 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #42 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #43 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #44 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #45 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #46 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #47 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #48 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #49 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #50 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #51 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #52 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #53 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #54 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #55 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #56 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #57 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #58 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #59 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #60 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #61 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #62 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #63 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #64 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #65 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #66 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #67 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #68 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #69 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #70 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #71 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #72 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #73 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #74 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #75 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #76 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #77 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #78 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #79 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #80 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #81 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #82 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #83 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #84 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #85 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #86 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #87 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #88 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #89 0x555e6bf0d044 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #90 0x555e6bf0e5b2 in partial_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/_functoolsmodule.c:223:16 #91 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #92 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #93 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #94 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #95 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #96 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #97 0x555e6bc71d53 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:52:18 #98 0x555e6bc6e182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #99 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #100 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #101 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #102 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #103 0x555e6bdc4abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #104 0x555e6bdbf5c8 in builtin_exec_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/bltinmodule.c:1040:13 #105 0x555e6bdbf5c8 in builtin_exec /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/clinic/bltinmodule.c.h:371:20 #106 0x555e6bce2bf3 in cfunction_vectorcall_FASTCALL /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:427:24 #107 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #108 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #109 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #110 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #111 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #112 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #113 0x555e6be802ac in pymain_run_module /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:293:14 #114 0x555e6be7f6c0 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c #115 0x555e6be7f6c0 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #116 0x555e6be80059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #117 0x555e6be80106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #118 0x7fec1fdecb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #119 0x555e6bbce69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==348627==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==348638==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e8000551de (pc 0x7fec1ffcc702 bp 0x000000000000 sp 0x7ffc39f5cdb0 T348638) ==348638==The signal is caused by a READ memory access. #0 0x7fec1ffcc702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x555e6be87c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x555e6be87c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x555e6bce3c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #9 0x555e6bc71d90 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:60:20 #10 0x555e6bd113c3 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #11 0x555e6bd1476d in _PyObject_CallNoArgs /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:107:12 #12 0x555e6bd1476d in object___reduce_ex___impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:5421:19 #13 0x555e6bce3136 in cfunction_vectorcall_O /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:513:24 #14 0x555e6bc6e7b3 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #15 0x555e6bc6e7b3 in PyObject_CallOneArg /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:375:12 #16 0x7fec1e2f407c in _Pickle_FastCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:374:14 #17 0x7fec1e2f407c in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4419:32 #18 0x7fec1e2f5720 in batch_dict_exact /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:3279:17 #19 0x7fec1e2f5720 in save_dict /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:3333:22 #20 0x7fec1e2f3d72 in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4311:18 #21 0x7fec1e2f8426 in save_reduce /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4217:17 #22 0x7fec1e2f3f8a in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4456:14 #23 0x7fec1e2f2d8a in dump /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4502:9 #24 0x7fec1e30437f in _pickle_Pickler_dump /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4573:9 #25 0x555e6bdc8bcb in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5106:29 #26 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #27 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #28 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #29 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #30 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #31 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #32 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #33 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #34 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #35 0x555e6bd1bcf4 in slot_tp_init /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7802:15 #36 0x555e6bd07c21 in type_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:1116:19 #37 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #38 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #39 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #40 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #41 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #42 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #43 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #44 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #45 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #46 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #47 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #48 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #49 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #50 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #51 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #52 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #53 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #54 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #55 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #56 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #57 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #58 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #59 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #60 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #61 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #62 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #63 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #64 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #65 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #66 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #67 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #68 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #69 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #70 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #71 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #72 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #73 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #74 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #75 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #76 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #77 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #78 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #79 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #80 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #81 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #82 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #83 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #84 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #85 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #86 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #87 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #88 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #89 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #90 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #91 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #92 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #93 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #94 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #95 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #96 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #97 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #98 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #99 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #100 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #101 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #102 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #103 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #104 0x555e6bf0d044 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #105 0x555e6bf0e5b2 in partial_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/_functoolsmodule.c:223:16 #106 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #107 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #108 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #109 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #110 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #111 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #112 0x555e6bc71d53 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:52:18 #113 0x555e6bc6e182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #114 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #115 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #116 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #117 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #118 0x555e6bdc4abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #119 0x555e6bdbf5c8 in builtin_exec_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/bltinmodule.c:1040:13 #120 0x555e6bdbf5c8 in builtin_exec /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/clinic/bltinmodule.c.h:371:20 #121 0x555e6bce2bf3 in cfunction_vectorcall_FASTCALL /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:427:24 #122 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #123 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #124 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #125 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #126 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #127 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #128 0x555e6be802ac in pymain_run_module /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:293:14 #129 0x555e6be7f6c0 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c #130 0x555e6be7f6c0 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #131 0x555e6be80059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #132 0x555e6be80106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #133 0x7fec1fdecb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #134 0x555e6bbce69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==348638==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==348739==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e800055243 (pc 0x7fec1ffcc702 bp 0x000000000000 sp 0x7ffc39f5d500 T348739) ==348739==The signal is caused by a READ memory access. #0 0x7fec1ffcc702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x555e6be87c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x555e6be87c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x555e6bce3c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x555e6bc6e182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #9 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #10 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #11 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #12 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #13 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #14 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #15 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #16 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #17 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #18 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #19 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #20 0x555e6bd1bcf4 in slot_tp_init /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7802:15 #21 0x555e6bd07c21 in type_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:1116:19 #22 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #23 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #24 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #25 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #26 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #27 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #28 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #29 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #30 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #31 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #32 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #33 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #34 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #35 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #36 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #37 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #38 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #39 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #40 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #41 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #42 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #43 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #44 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #45 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #46 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #47 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #48 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #49 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #50 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #51 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #52 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #53 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #54 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #55 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #56 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #57 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #58 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #59 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #60 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #61 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #62 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #63 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #64 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #65 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #66 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #67 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #68 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #69 0x555e6bc71e23 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:82:18 #70 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #71 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #72 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #73 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #74 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #75 0x555e6bc6d5f9 in _PyObject_FastCallDictTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:141:15 #76 0x555e6bc6ecb8 in _PyObject_Call_Prepend /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:481:24 #77 0x555e6bd1a505 in slot_tp_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:7571:15 #78 0x555e6bc6d93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #79 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #80 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #81 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #82 0x555e6bf0d044 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #83 0x555e6bf0e5b2 in partial_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/_functoolsmodule.c:223:16 #84 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #85 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #86 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #87 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #88 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #89 0x555e6bc73034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #90 0x555e6bc71d53 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:52:18 #91 0x555e6bc6e182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #92 0x555e6bdd5695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #93 0x555e6bdd5695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #94 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #95 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #96 0x555e6bdc4abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #97 0x555e6bdbf5c8 in builtin_exec_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/bltinmodule.c:1040:13 #98 0x555e6bdbf5c8 in builtin_exec /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/clinic/bltinmodule.c.h:371:20 #99 0x555e6bce2bf3 in cfunction_vectorcall_FASTCALL /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:427:24 #100 0x555e6bc6e398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #101 0x555e6bc6e398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #102 0x555e6bdd2729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #103 0x555e6bdc4cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #104 0x555e6bdc4cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #105 0x555e6bc6e228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #106 0x555e6be802ac in pymain_run_module /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:293:14 #107 0x555e6be7f6c0 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c #108 0x555e6be7f6c0 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #109 0x555e6be80059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #110 0x555e6be80106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #111 0x7fec1fdecb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #112 0x555e6bbce69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==348739==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==349296==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e800055470 (pc 0x7f875fbba702 bp 0x000000000000 sp 0x7fffbda60ea0 T349296) ==349296==The signal is caused by a READ memory access. #0 0x7f875fbba702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x55affa668c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x55affa668c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x55affa4c4c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x55affa44e93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x55affa5b3729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x55affa44f228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #9 0x7f875f0fba2d in load_reduce /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6761:15 #10 0x7f875f0fba2d in load /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6909:9 #11 0x7f875f0f13b7 in _pickle_loads_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:7861:14 #12 0x7f875f0f13b7 in _pickle_loads /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/clinic/_pickle.c.h:834:20 #13 0x55affa4c3d27 in cfunction_vectorcall_FASTCALL_KEYWORDS /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:443:24 #14 0x55affa44f398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #15 0x55affa44f398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #16 0x55affa5b3729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #17 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #18 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #19 0x55affa44f228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #20 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #21 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #22 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #23 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #24 0x55affa44f182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #25 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #26 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #27 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #28 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #29 0x55affa5a5abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #30 0x55affa63328a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #31 0x55affa630527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #32 0x55affa630527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #33 0x55affa63041e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #34 0x55affa660505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #35 0x55affa660505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #36 0x55affa660505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #37 0x55affa661059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #38 0x55affa661106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #39 0x7f875f9dab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #40 0x55affa3af69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==349296==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==349308==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e80005547c (pc 0x7f875fbba702 bp 0x000000000000 sp 0x7fffbda61060 T349308) ==349308==The signal is caused by a READ memory access. #0 0x7f875fbba702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x55affa668c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x55affa668c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x55affa4c4c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x55affa44e93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x55affa5b3729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x55affa44f228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #9 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #10 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #11 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #12 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #13 0x55affa44f228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #14 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #15 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #16 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #17 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #18 0x55affa44f182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #19 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #20 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #21 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #22 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #23 0x55affa5a5abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #24 0x55affa63328a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #25 0x55affa630527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #26 0x55affa630527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #27 0x55affa63041e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #28 0x55affa660505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #29 0x55affa660505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #30 0x55affa660505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #31 0x55affa661059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #32 0x55affa661106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #33 0x7f875f9dab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #34 0x55affa3af69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==349308==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==349325==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e80005548d (pc 0x7f875fbba702 bp 0x000000000000 sp 0x7fffbda60be0 T349325) ==349325==The signal is caused by a READ memory access. #0 0x7f875fbba702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x55affa668c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x55affa668c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x55affa4c4c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x55affa44e93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x55affa5b3729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x55affa454034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #9 0x55affa452d90 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:60:20 #10 0x55affa4f23c3 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #11 0x55affa4f576d in _PyObject_CallNoArgs /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:107:12 #12 0x55affa4f576d in object___reduce_ex___impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:5421:19 #13 0x55affa4c4136 in cfunction_vectorcall_O /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:513:24 #14 0x55affa44f7b3 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #15 0x55affa44f7b3 in PyObject_CallOneArg /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:375:12 #16 0x7f875f0f307c in _Pickle_FastCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:374:14 #17 0x7f875f0f307c in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4419:32 #18 0x7f875f0f4720 in batch_dict_exact /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:3279:17 #19 0x7f875f0f4720 in save_dict /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:3333:22 #20 0x7f875f0f2d72 in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4311:18 #21 0x7f875f0f7426 in save_reduce /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4217:17 #22 0x7f875f0f2f8a in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4456:14 #23 0x7f875f0f1d8a in dump /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4502:9 #24 0x7f875f10337f in _pickle_Pickler_dump /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4573:9 #25 0x55affa46080e in method_vectorcall_O /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/descrobject.c:458:24 #26 0x55affa44f398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #27 0x55affa44f398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #28 0x55affa5b3729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #29 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #30 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #31 0x55affa44f228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #32 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #33 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #34 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #35 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #36 0x55affa44f182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #37 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #38 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #39 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #40 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #41 0x55affa5a5abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #42 0x55affa63328a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #43 0x55affa630527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #44 0x55affa630527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #45 0x55affa63041e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #46 0x55affa660505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #47 0x55affa660505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #48 0x55affa660505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #49 0x55affa661059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #50 0x55affa661106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #51 0x7f875f9dab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #52 0x55affa3af69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==349325==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==349442==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e800055502 (pc 0x7f875fbba702 bp 0x000000000000 sp 0x7fffbda61060 T349442) ==349442==The signal is caused by a READ memory access. #0 0x7f875fbba702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x55affa668c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x55affa668c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x55affa4c4c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x55affa44e93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x55affa5b3729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x55affa44f182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #9 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #10 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #11 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #12 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #13 0x55affa44f228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #14 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #15 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #16 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #17 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #18 0x55affa44f182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #19 0x55affa5b6695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #20 0x55affa5b6695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #21 0x55affa5a5cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #22 0x55affa5a5cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #23 0x55affa5a5abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #24 0x55affa63328a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #25 0x55affa630527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #26 0x55affa630527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #27 0x55affa63041e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #28 0x55affa660505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #29 0x55affa660505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #30 0x55affa660505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #31 0x55affa661059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #32 0x55affa661106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #33 0x7f875f9dab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #34 0x55affa3af69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==349442==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==350038==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e800055756 (pc 0x7f7c80aee702 bp 0x000000000000 sp 0x7ffea76dfc30 T350038) ==350038==The signal is caused by a READ memory access. #0 0x7f7c80aee702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x562c9f93dc4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x562c9f93dc4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x562c9f799c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x562c9f72393a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x562c9f888729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x562c9f87acb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x562c9f87acb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x562c9f724228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #9 0x7f7c80836a2d in load_reduce /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6761:15 #10 0x7f7c80836a2d in load /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:6909:9 #11 0x7f7c8082c3b7 in _pickle_loads_impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:7861:14 #12 0x7f7c8082c3b7 in _pickle_loads /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/clinic/_pickle.c.h:834:20 #13 0x562c9f798d27 in cfunction_vectorcall_FASTCALL_KEYWORDS /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:443:24 #14 0x562c9f724398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #15 0x562c9f724398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #16 0x562c9f888729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #17 0x562c9f87acb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #18 0x562c9f87acb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #19 0x562c9f724228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #20 0x562c9f88b695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #21 0x562c9f88b695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #22 0x562c9f87acb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #23 0x562c9f87acb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #24 0x562c9f87aabd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #25 0x562c9f90828a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #26 0x562c9f905527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #27 0x562c9f905527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #28 0x562c9f90541e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #29 0x562c9f935505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #30 0x562c9f935505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #31 0x562c9f935505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #32 0x562c9f936059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #33 0x562c9f936106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #34 0x7f7c8090eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #35 0x562c9f68469d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==350038==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==350049==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e800055761 (pc 0x7f27fd82f702 bp 0x000000000000 sp 0x7ffcfd641190 T350049) ==350049==The signal is caused by a READ memory access. #0 0x7f27fd82f702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x55a565d49c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x55a565d49c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x55a565ba5c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x55a565b2f93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x55a565c94729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x55a565c86cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x55a565c86cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x55a565b30228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #9 0x55a565c97695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #10 0x55a565c97695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #11 0x55a565c86cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #12 0x55a565c86cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #13 0x55a565b30228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #14 0x55a565c97695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #15 0x55a565c97695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #16 0x55a565c86cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #17 0x55a565c86cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #18 0x55a565c86abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #19 0x55a565d1428a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #20 0x55a565d11527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #21 0x55a565d11527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #22 0x55a565d1141e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #23 0x55a565d41505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #24 0x55a565d41505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #25 0x55a565d41505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #26 0x55a565d42059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #27 0x55a565d42106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #28 0x7f27fd64fb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #29 0x55a565a9069d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==350049==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==350060==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e80005576c (pc 0x7fe3d4be5702 bp 0x000000000000 sp 0x7ffe92fe2230 T350060) ==350060==The signal is caused by a READ memory access. #0 0x7fe3d4be5702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x55d6a924fc4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x55d6a924fc4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x55d6a90abc09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x55d6a903593a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x55d6a919a729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x55d6a918ccb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x55d6a918ccb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x55d6a903b034 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #9 0x55d6a9039d90 in method_vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/classobject.c:60:20 #10 0x55d6a90d93c3 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #11 0x55d6a90dc76d in _PyObject_CallNoArgs /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:107:12 #12 0x55d6a90dc76d in object___reduce_ex___impl /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/typeobject.c:5421:19 #13 0x55d6a90ab136 in cfunction_vectorcall_O /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:513:24 #14 0x55d6a90367b3 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #15 0x55d6a90367b3 in PyObject_CallOneArg /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:375:12 #16 0x7fe3d492507c in _Pickle_FastCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:374:14 #17 0x7fe3d492507c in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4419:32 #18 0x7fe3d4926720 in batch_dict_exact /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:3279:17 #19 0x7fe3d4926720 in save_dict /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:3333:22 #20 0x7fe3d4924d72 in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4311:18 #21 0x7fe3d4929426 in save_reduce /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4217:17 #22 0x7fe3d4924f8a in save /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4456:14 #23 0x7fe3d4923d8a in dump /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4502:9 #24 0x7fe3d493537f in _pickle_Pickler_dump /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/_pickle.c:4573:9 #25 0x55d6a904780e in method_vectorcall_O /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/descrobject.c:458:24 #26 0x55d6a9036398 in _PyObject_VectorcallTstate /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_call.h:92:11 #27 0x55d6a9036398 in PyObject_Vectorcall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:298:12 #28 0x55d6a919a729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #29 0x55d6a918ccb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #30 0x55d6a918ccb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #31 0x55d6a9036228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #32 0x55d6a919d695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #33 0x55d6a919d695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #34 0x55d6a918ccb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #35 0x55d6a918ccb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #36 0x55d6a918cabd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #37 0x55d6a921a28a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #38 0x55d6a9217527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #39 0x55d6a9217527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #40 0x55d6a921741e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #41 0x55d6a9247505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #42 0x55d6a9247505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #43 0x55d6a9247505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #44 0x55d6a9248059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #45 0x55d6a9248106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #46 0x7fe3d4a05b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #47 0x55d6a8f9669d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==350060==ABORTING UndefinedBehaviorSanitizer:DEADLYSIGNAL ==350176==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x03e8000557e0 (pc 0x7f7958e59702 bp 0x000000000000 sp 0x7fff04e21290 T350176) ==350176==The signal is caused by a READ memory access. #0 0x7f7958e59702 in raise (/usr/lib/libpthread.so.0+0x13702) #1 0x5624a3fd5c4d in faulthandler_raise_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1065:5 #2 0x5624a3fd5c4d in faulthandler_sigsegv /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Modules/faulthandler.c:1081:9 #3 0x5624a3e31c09 in cfunction_call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/methodobject.c:549:18 #4 0x5624a3dbb93a in _PyObject_MakeTpCall /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:214:18 #5 0x5624a3f20729 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c #6 0x5624a3f12cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #7 0x5624a3f12cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #8 0x5624a3dbc182 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:256:24 #9 0x5624a3f23695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #10 0x5624a3f23695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #11 0x5624a3f12cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #12 0x5624a3f12cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #13 0x5624a3dbc228 in _PyVectorcall_Call /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/call.c:244:16 #14 0x5624a3f23695 in do_call_core /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:7142:12 #15 0x5624a3f23695 in _PyEval_EvalFrameDefault /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:5220:22 #16 0x5624a3f12cb1 in _PyEval_EvalFrame /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/./Include/internal/pycore_ceval.h:53:16 #17 0x5624a3f12cb1 in _PyEval_Vector /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:6252:24 #18 0x5624a3f12abd in PyEval_EvalCode /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/ceval.c:1101:21 #19 0x5624a3fa028a in run_eval_code_obj /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1680:9 #20 0x5624a3f9d527 in run_mod /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1701:19 #21 0x5624a3f9d527 in PyRun_StringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:1571:15 #22 0x5624a3f9d41e in PyRun_SimpleStringFlags /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Python/pythonrun.c:487:9 #23 0x5624a3fcd505 in pymain_run_command /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:248:11 #24 0x5624a3fcd505 in pymain_run_python /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:583:21 #25 0x5624a3fcd505 in Py_RunMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:671:5 #26 0x5624a3fce059 in pymain_main /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:701:12 #27 0x5624a3fce106 in Py_BytesMain /buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Modules/main.c:725:12 #28 0x7f7958c79b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #29 0x5624a3d1c69d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/python+0x2f469d) UndefinedBehaviorSanitizer can not provide additional info. SUMMARY: UndefinedBehaviorSanitizer: SEGV (/usr/lib/libpthread.so.0+0x13702) in raise ==350176==ABORTING ---------- components: Tests messages: 414901 nosy: gregory.p.smith, pablogsal, vstinner priority: normal severity: normal status: open title: test_concurrent_futures logs many UndefinedBehaviorSanitizer "DEADLYSIGNAL" errors on AMD64 Arch Linux Usan 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 11:58:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 16:58:08 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647017888.34.0.587190209752.issue46968@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29921 pull_request: https://github.com/python/cpython/pull/31824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:08:32 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 11 Mar 2022 17:08:32 +0000 Subject: [issue46982] Error in the experts list In-Reply-To: <1646987103.96.0.139741803932.issue46982@roundup.psfhosted.org> Message-ID: <1647018512.27.0.494991413075.issue46982@roundup.psfhosted.org> Jelle Zijlstra added the comment: Oops, sorry for that! I just edited my username, hopefully that fixes things. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:26:56 2022 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 11 Mar 2022 17:26:56 +0000 Subject: [issue46971] python takes long time when return big data In-Reply-To: <1646905386.12.0.964981264374.issue46971@roundup.psfhosted.org> Message-ID: <1647019616.94.0.45857992133.issue46971@roundup.psfhosted.org> Mark Dickinson added the comment: > why it costs lots of time when del a large array? That's probably a question for the NumPy folks, or possibly for Stack Overflow or some other question-and-answer resource. It'll depend on how NumPy arrays are de-allocated. > Is there any way to process del in parallel? Seems unlikely, given GIL constraints. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:28:58 2022 From: report at bugs.python.org (markhuang3310) Date: Fri, 11 Mar 2022 17:28:58 +0000 Subject: [issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError In-Reply-To: <1647016865.89.0.743756251929.issue46988@roundup.psfhosted.org> Message-ID: <1647019738.14.0.136667331063.issue46988@roundup.psfhosted.org> markhuang3310 added the comment: sorry, I found the duplication https://bugs.python.org/issue34618 ---------- resolution: -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:29:02 2022 From: report at bugs.python.org (markhuang3310) Date: Fri, 11 Mar 2022 17:29:02 +0000 Subject: [issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError In-Reply-To: <1647016865.89.0.743756251929.issue46988@roundup.psfhosted.org> Message-ID: <1647019742.99.0.0951628571511.issue46988@roundup.psfhosted.org> Change by markhuang3310 : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:35:41 2022 From: report at bugs.python.org (Sam Bull) Date: Fri, 11 Mar 2022 17:35:41 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1647020141.87.0.129352076909.issue37658@roundup.psfhosted.org> Sam Bull added the comment: There is still an issue here. I proposed a possible solution at: https://github.com/python/cpython/pull/28149#issuecomment-1007823782 You can also scroll up through the lengthy discussion to see how I reached that conclusion. I've not had time yet to actually try implementing something yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 12:45:48 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 11 Mar 2022 17:45:48 +0000 Subject: [issue45993] Main branch of CPython does not build anymore on macOS In-Reply-To: <1638777618.8.0.921239379718.issue45993@roundup.psfhosted.org> Message-ID: <1647020748.14.0.686216495792.issue45993@roundup.psfhosted.org> Andrei Kulakov added the comment: I'm getting the same exact error but on `arm64`, and clearing the cache does not help. clang=13.0.0 MacOS=11.5.2 Should I open a new issue for this? 257 warnings generated. 257 warnings generated. Undefined symbols for architecture arm64: "_libintl_bindtextdomain", referenced from: __locale_bindtextdomain_impl in _localemodule.o "_libintl_dcgettext", referenced from: __locale_dcgettext_impl in _localemodule.o "_libintl_dgettext", referenced from: __locale_dgettext_impl in _localemodule.o "_libintl_gettext", referenced from: __locale_gettext_impl in _localemodule.o "_libintl_setlocale", referenced from: __locale_setlocale_impl in _localemodule.o _locale_decode_monetary in _localemodule.o "_libintl_textdomain", referenced from: __locale_textdomain_impl in _localemodule.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Programs/_freeze_module] Error 1 ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:12:37 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 11 Mar 2022 18:12:37 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647022357.52.0.0978710709639.issue46785@roundup.psfhosted.org> Eryk Sun added the comment: Itai, you can add a test to Win32NtTests in Lib/test/test_os.py. Maybe spawn a child process that creates and unlinks a file in a loop. In the parent process execute a loop that tries to stat the file and ignores errors when the file or path isn't found. For example: @support.requires_subprocess() def test_stat_unlink_race(self): # bpo-46785: the implementation of os.stat() falls back on reading # the parent directory if CreateFileW() fails with a permission # error. If reading the parent directory fails because the file or # directory is subsequently unlinked or because the volume or # share is no longer available, then the original permission error # should not be restored. fname = os.path.join(os.environ['TEMP'], os_helper.TESTFN + '_46785') self.addCleanup(os_helper.unlink, fname) command = '''if 1: import os import sys fname = sys.argv[1] while True: try: with open(fname, "w") as f: pass except OSError: pass try: os.remove(fname) except OSError: pass ''' ignored_errors = ( 2, # ERROR_FILE_NOT_FOUND 3, # ERROR_PATH_NOT_FOUND 21, # ERROR_NOT_READY 67, # ERROR_BAD_NET_NAME ) deadline = time.time() + 5 p = subprocess.Popen([sys.executable, '-c', command, fname]) try: while time.time() < deadline: try: os.stat(fname) except OSError as e: if e.winerror not in ignored_errors: raise finally: p.terminate() As the above test shows, I think the error should also be kept if attributes_from_dir() fails with ERROR_NOT_READY or ERROR_BAD_NET_NAME. For example: switch (error) { case ERROR_ACCESS_DENIED: /* Cannot sync or read attributes. */ case ERROR_SHARING_VIOLATION: /* It's a paging file. */ /* Try reading the parent directory. */ if (!attributes_from_dir(path, &fileInfo, &tagInfo.ReparseTag)) { /* Cannot read the parent directory. */ switch (GetLastError()) { // keep these error codes case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: case ERROR_NOT_READY: case ERROR_BAD_NET_NAME: break; // restore the error from CreateFileW() default: SetLastError(error); } return -1; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:14:47 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 11 Mar 2022 18:14:47 +0000 Subject: [issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError In-Reply-To: <1647016865.89.0.743756251929.issue46988@roundup.psfhosted.org> Message-ID: <1647022486.99.0.0641457280493.issue46988@roundup.psfhosted.org> Change by Eryk Sun : ---------- superseder: -> Encoding error running in subprocess with captured output _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:17:44 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Mar 2022 18:17:44 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647022664.24.0.716453202389.issue46566@roundup.psfhosted.org> Steve Dower added the comment: I'm working on what's become a rewrite of the launcher. If anyone would like to follow along, you can see my changes at https://github.com/python/cpython/compare/main...zooba:bpo-46566 It's still missing some functionality, and I'm not sure it's any faster or less complex than the previous version :) But it should handle ARM64 properly, and also knows how to do an install of a requested version if you don't already have it (still TBD whether that stays) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:18:02 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Mar 2022 18:18:02 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647022682.77.0.734914755844.issue46566@roundup.psfhosted.org> Steve Dower added the comment: Hah, that's funny URL formatting. Let's see if this is any better: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 13:43:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 11 Mar 2022 18:43:26 +0000 Subject: [issue45993] Main branch of CPython does not build anymore on macOS In-Reply-To: <1638777618.8.0.921239379718.issue45993@roundup.psfhosted.org> Message-ID: <1647024206.85.0.304133790963.issue45993@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:02:59 2022 From: report at bugs.python.org (Matt Page) Date: Fri, 11 Mar 2022 19:02:59 +0000 Subject: [issue46892] Async Call-Stack Reconstruction In-Reply-To: <1646172818.87.0.620414144341.issue46892@roundup.psfhosted.org> Message-ID: <1647025379.23.0.0815669732687.issue46892@roundup.psfhosted.org> Matt Page added the comment: Sorry for the confusion, I'm working on a PR. I filed the BPO to gauge interest in the feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:05:58 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Mar 2022 19:05:58 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647025558.73.0.682167044085.issue31327@roundup.psfhosted.org> miss-islington added the comment: New changeset c83fc9c02c9846ec3a2d0123999c98e02f00b3f5 by slateny in branch 'main': bpo-31327: Update time documentation to reflect possible errors (GH-31460) https://github.com/python/cpython/commit/c83fc9c02c9846ec3a2d0123999c98e02f00b3f5 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:06:13 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Mar 2022 19:06:13 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647025573.94.0.0497025728568.issue31327@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29922 pull_request: https://github.com/python/cpython/pull/31825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:06:22 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Mar 2022 19:06:22 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647025582.2.0.531158194093.issue31327@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29924 pull_request: https://github.com/python/cpython/pull/31827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:06:17 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Mar 2022 19:06:17 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647025577.64.0.533685844549.issue31327@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29923 pull_request: https://github.com/python/cpython/pull/31826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:12:02 2022 From: report at bugs.python.org (Enji Cooper) Date: Fri, 11 Mar 2022 19:12:02 +0000 Subject: [issue46989] signal.signal, et al, doesn't support [SIGRTMIN, SIGRTMAX] on FreeBSD (not included in NSIG) Message-ID: <1647025922.75.0.622565693029.issue46989@roundup.psfhosted.org> New submission from Enji Cooper : As noted in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262487, cpython relies on the definition of NSIG when building signal handlers to determine what signals are and aren't invalid. Unfortunately on FreeBSD, NSIG doesn't include [SIGRTMIN,SIGRTMAX], as shown below: $ python2 Python 2.7.18 (default, Dec 3 2020, 01:19:40) [GCC 4.2.1 Compatible FreeBSD Clang 8.0.1 (tags/RELEASE_801/final 366581)] on freebsd12 Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> signal.signal(signal.SIGRTMIN, signal.SIG_DFL) Traceback (most recent call last): File "", line 1, in ValueError: signal number out of range >>> exit() $ python3 Python 3.8.12 (default, Jan 4 2022, 01:10:15) [Clang 10.0.1 (git at github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611a on freebsd12 Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> signal.signal(signal.SIGRTMIN, signal.SIG_IGN) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ValueError: signal number out of range >>> exit() $ python3.11 Python 3.11.0a3 (main, Feb 4 2022, 02:34:52) [Clang 10.0.1 (git at github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa on freebsd12 Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> signal.signal(signal.SIGRTMIN, signal.SIG_IGN) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.11/signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: signal number out of range >>> exit() $ This results in a cpython interface which doesn't match the OS's signal(3) interface: ``` $ cat signal_rtmin.c #include #include int main(void) { if (signal(SIGRTMIN, SIG_DFL) == SIG_ERR) warn("signal"); return (0); } $ cc -o signal_rtmin -Wall signal_rtmin.c $ ./signal_rtmin $ uname -a FreeBSD picasso.local 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 GENERIC amd64 $ ``` Linux includes [SIGRTMIN,SIGRTMAX] in NSIG, which means it allows these values in signal.signal without issue (confirmed on Ubuntu 18.04.6 LTS). While one can definitely argue that this is an OS portability defect and this should be resolved in FreeBSD (and thus, not fixed in cpython), it doesn't address existing behavior on older versions of FreeBSD where this hasn't been resolved yet. FreeBSD bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262487 ---------- components: FreeBSD messages: 414932 nosy: koobs, ngie priority: normal severity: normal status: open title: signal.signal, et al, doesn't support [SIGRTMIN,SIGRTMAX] on FreeBSD (not included in NSIG) versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:28:47 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Mar 2022 19:28:47 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647026927.7.0.148522737884.issue31327@roundup.psfhosted.org> miss-islington added the comment: New changeset 30d80213ae305bd0f0ed6bec7a0dff3e97b1c321 by Miss Islington (bot) in branch '3.9': bpo-31327: Update time documentation to reflect possible errors (GH-31460) https://github.com/python/cpython/commit/30d80213ae305bd0f0ed6bec7a0dff3e97b1c321 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:29:55 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Mar 2022 19:29:55 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647026995.24.0.890443491508.issue31327@roundup.psfhosted.org> miss-islington added the comment: New changeset b35b36e106152245fe68880f4073fd99ec17f65d by Miss Islington (bot) in branch '3.10': bpo-31327: Update time documentation to reflect possible errors (GH-31460) https://github.com/python/cpython/commit/b35b36e106152245fe68880f4073fd99ec17f65d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:38:58 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 11 Mar 2022 19:38:58 +0000 Subject: [issue46981] Empty typing.Tuple In-Reply-To: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> Message-ID: <1647027538.2.0.114288214214.issue46981@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:44:15 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 19:44:15 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647027855.87.0.619153881124.issue43224@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 5b1b9eacb92dd47d10793a8868246df6ea477ed6 by Serhiy Storchaka in branch 'main': bpo-43224: Implement substitution of unpacked TypeVarTuple (GH-31800) https://github.com/python/cpython/commit/5b1b9eacb92dd47d10793a8868246df6ea477ed6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 14:48:11 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Mar 2022 19:48:11 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647028091.92.0.71779557998.issue43224@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +29925 pull_request: https://github.com/python/cpython/pull/31828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 15:15:47 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 11 Mar 2022 20:15:47 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647029747.37.0.690173938594.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29926 pull_request: https://github.com/python/cpython/pull/31829 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:05:25 2022 From: report at bugs.python.org (Zachary Ware) Date: Fri, 11 Mar 2022 21:05:25 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647032725.67.0.121773576395.issue46566@roundup.psfhosted.org> Zachary Ware added the comment: If it's already turning into a rewrite, how feasible would it be to adopt Brett's `py` launcher? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 16:20:40 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Fri, 11 Mar 2022 21:20:40 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1647033640.58.0.637279212632.issue46761@roundup.psfhosted.org> Graham Dumpleton added the comment: My vague recollection was that I identified some time back that partial() didn't behave correctly regards introspection for some use case I was trying to apply it to in the wrapt implementation. As a result I ended up creating my own PartialCallableObjectProxy implementation based around wrapt's own transparent object proxy object so that introspection worked properly and went with that where I needed it. I don't remember the exact details at the moment and don't think commit comments in code are likely to help. Even so, will try and spend some time this weekend looking more at the issue and see what I can remember about it and see if there is anything more I can comment on that may help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:01:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 22:01:44 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647036104.27.0.40219603956.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: New changeset dc374ac7b0fabaed49461a2044c220765f48d229 by Victor Stinner in branch 'main': bpo-46968: Add os.sysconf_names['SC_MINSIGSTKSZ'] (GH-31824) https://github.com/python/cpython/commit/dc374ac7b0fabaed49461a2044c220765f48d229 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:19:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 22:19:43 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647037183.1.0.274385088704.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3b128c054885fe881c3b57a5978de3ea89c81a9c by Oleksandr Pavlyk in branch 'main': bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789) https://github.com/python/cpython/commit/3b128c054885fe881c3b57a5978de3ea89c81a9c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:22:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 22:22:48 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647037368.72.0.0264733260566.issue46968@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29927 pull_request: https://github.com/python/cpython/pull/31830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:25:23 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 11 Mar 2022 22:25:23 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647037523.92.0.988485628654.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ecfff63e06e77e22035a7f7caa26986f033f3aea by Christian Heimes in branch 'main': bpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829) https://github.com/python/cpython/commit/ecfff63e06e77e22035a7f7caa26986f033f3aea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:30:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 22:30:19 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647037819.58.0.00749174079443.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: The latest faulthandler bug on sigaltstack() was bpo-21131 about FPU state stored by "XSAVE" and a Linux kernel change to fix a security vulnerability: https://bugs.python.org/issue21131#msg349688 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:37:20 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 11 Mar 2022 22:37:20 +0000 Subject: [issue46990] Surprising list overallocation from .split() Message-ID: <1647038240.05.0.997478605012.issue46990@roundup.psfhosted.org> New submission from Tim Peters : When looking into a StackOverflow question about surprisingly high memory use, I stumbled into this (under 3.10.1, Win64): >>> import sys >>> s = "1 2 3 4 5".split() >>> s ['1', '2', '3', '4', '5'] >>> sys.getsizeof(s) 152 >>> _ - sys.getsizeof([]) 96 >>> 96 / 8 12.0 That is, we allocated enough space in the list to store 12(!) elements, despite that only 5 are used. Other ways of building a 5-element list I've tried overallocate by at most 3 slots: >>> sys.getsizeof([ch for ch in "12345"]) 120 >>> sys.getsizeof([1, 2, 3, 4, 5]) 120 (and 120 - 56 = 64, room for 8 pointers) Then there's this curiosity, which allocates space for exactly the 5 needed: >>> sys.getsizeof(list(tuple("1 2 3 4 5".split()))) 96 (and 96 - 56 = 40, room for the 5 pointers needed) I don't expect this to be consistent, but allocating space for 12 when only 5 are needed is unreasonable. Even allocating space for 8 is pushing it ;-) ---------- components: Interpreter Core messages: 414942 nosy: tim.peters priority: normal severity: normal status: open title: Surprising list overallocation from .split() type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 17:37:35 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 11 Mar 2022 22:37:35 +0000 Subject: [issue46990] Surprising list overallocation from .split() In-Reply-To: <1647038240.05.0.997478605012.issue46990@roundup.psfhosted.org> Message-ID: <1647038255.94.0.296383354374.issue46990@roundup.psfhosted.org> Change by Tim Peters : ---------- type: behavior -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:04:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 23:04:29 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647039869.82.0.0489705056183.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 393e2bf6bc6effbfe821f051a230978f0edd70df by Victor Stinner in branch '3.10': bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789) (GH-31830) https://github.com/python/cpython/commit/393e2bf6bc6effbfe821f051a230978f0edd70df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:10:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 23:10:10 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647040210.53.0.534781925006.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 882d8096c262a5945e0cfdd706e5db3ad2b73543 by Victor Stinner in branch 'main': bpo-46906: Add PyFloat_Pack8() to the C API (GH-31657) https://github.com/python/cpython/commit/882d8096c262a5945e0cfdd706e5db3ad2b73543 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:13:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 23:13:06 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647040386.49.0.0815912913909.issue46968@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29928 pull_request: https://github.com/python/cpython/pull/31831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:18:27 2022 From: report at bugs.python.org (Michael Merickel) Date: Fri, 11 Mar 2022 23:18:27 +0000 Subject: [issue22543] -W option cannot use non-standard categories In-Reply-To: <1412285520.72.0.615712160291.issue22543@psf.upfronthosting.co.za> Message-ID: <1647040707.15.0.35933359143.issue22543@roundup.psfhosted.org> Michael Merickel added the comment: Updated affected versions as I ran into this on 3.9.7. ---------- nosy: +mmerickel versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:23:34 2022 From: report at bugs.python.org (Mark Roseman) Date: Fri, 11 Mar 2022 23:23:34 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1647041014.25.0.289694388616.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: Just a note, that an (updated) version of the auto-generated API reference has been "officially" added to TkDocs ... see https://tkdocs.com/pyref/ Few more things I'd like to do with it in the short term, but it's a decent starting point. Let me know if you have further suggestions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:35:09 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 11 Mar 2022 23:35:09 +0000 Subject: [issue46981] Empty typing.Tuple In-Reply-To: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> Message-ID: <1647041709.37.0.486935819971.issue46981@roundup.psfhosted.org> Guido van Rossum added the comment: Alas, I have no idea. I don't even recall what copy_with() is for (it was apparently introduced in 3.7). Possibly vopy_with() is wrong here? I imaging some of this has to do with the special casing needed so that repr() of an empty Tuple type doesn't print "Tuple[]" (which IIRC it did, long ago). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:36:27 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 11 Mar 2022 23:36:27 +0000 Subject: [issue46892] Async Call-Stack Reconstruction In-Reply-To: <1646172818.87.0.620414144341.issue46892@roundup.psfhosted.org> Message-ID: <1647041787.65.0.324657263597.issue46892@roundup.psfhosted.org> Guido van Rossum added the comment: I've recently dabbled a bit in some new primitives for asyncio, and based on that experience I think this would be very useful. IIRC Trio does this (presumably at considerable cost) in userland. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:37:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 23:37:38 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647041858.65.0.637518985521.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ba2b7956fa3932769a5c0aa2575de5c8d7e7ba4b by Victor Stinner in branch '3.9': bpo-46968: Fix faulthandler for Sapphire Rapids Xeon (GH-31789) (GH-31831) https://github.com/python/cpython/commit/ba2b7956fa3932769a5c0aa2575de5c8d7e7ba4b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:38:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 23:38:59 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647041939.17.0.167147380723.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Oleksandr Pavlyk for your nice enhancement! I merged your change to 3.9, 3.10 and main branches! I also added os.sysconf('SC_MINSIGSTKSZ') to Python 3.11. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:42:33 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 11 Mar 2022 23:42:33 +0000 Subject: [issue46983] test_sqlite3: test_trace_too_much_expanded_sql() failed on AMD64 Arch Linux Usan 3.x In-Reply-To: <1647001481.77.0.569348369265.issue46983@roundup.psfhosted.org> Message-ID: <1647042153.49.0.449747722521.issue46983@roundup.psfhosted.org> Erlend E. Aasland added the comment: The change that introduced this regression was reverted in GH-31788 ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 18:58:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Mar 2022 23:58:18 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647043098.24.0.146983661897.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: PR for msgpack: https://github.com/msgpack/msgpack-python/pull/499 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:08:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:08:42 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647043722.9.0.899558637333.issue46906@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29929 pull_request: https://github.com/python/cpython/pull/31832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:12:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:12:53 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647043973.23.0.316468009535.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: PR for bitstruct: https://github.com/eerimoq/bitstruct/pull/26 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:21:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:21:16 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647044476.25.0.380916696828.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: zodbpickle issue: https://github.com/zopefoundation/zodbpickle/issues/67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:30:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:30:51 +0000 Subject: [issue29971] threading.Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1647045051.18.0.379706356057.issue29971@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:31:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:31:02 +0000 Subject: [issue45274] Race condition in Thread._wait_for_tstate_lock() In-Reply-To: <1632427989.48.0.0399900831112.issue45274@roundup.psfhosted.org> Message-ID: <1647045062.96.0.294930600737.issue45274@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:31:58 2022 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 12 Mar 2022 00:31:58 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1647045118.58.0.38250409876.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset a89c29fbcc7e7e85848499443d819c3fab68c78a by Brandt Bucher in branch 'main': bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780) https://github.com/python/cpython/commit/a89c29fbcc7e7e85848499443d819c3fab68c78a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:35:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:35:14 +0000 Subject: =?utf-8?q?=5Bissue46915=5D_Build_with_Py=5FLIMITED=5FAPI_fails_unknown_ty?= =?utf-8?b?cGUgbmFtZSDigJhQeU1vZHVsZURlZl9TbG904oCZ?= In-Reply-To: <1646342125.75.0.0439874391605.issue46915@roundup.psfhosted.org> Message-ID: <1647045314.46.0.59328152676.issue46915@roundup.psfhosted.org> STINNER Victor added the comment: > Fixed by https://github.com/python/cpython/commit/0b63215bb152c06404cecbd5303b1a50969a9f9f This change is now part of Python 3.11 alpha6 released a few days ago. Python 3.11a6 news entries were merged into the Misc/NEWS.d/3.11.0a6.rst file. > Please add a blurb entry. I consider that the changelog is for changes which impacts users when they update. The regression was introduced after 3.11 alpha5 but fixed before Python 3.11 alpha6. Only projects using contiguous integration were impacted. Only the cryptography project was impacted in practice. > https://github.com/pyca/cryptography/issues/6929 This issue was closed as with the comment: "Going to close this as it's an upstream python bug that's now been fixed." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:47:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 00:47:37 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647046057.6.0.221656215829.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: On my x86-64 Fedora 35 with the CPU "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", I get: * SIGSTKSZ = 8192 * getauxval(AT_MINSIGSTKSZ) = 2032 * faulthandler stack.ss_size = 10224 * os.sysconf('SC_MINSIGSTKSZ') = 2032 In C, sysconf(_SC_MINSIGSTKSZ) is similar to getauxval(AT_MINSIGSTKSZ), but the glibc sysconf(_SC_MINSIGSTKSZ) is more generic, whereas IMO getauxval(AT_MINSIGSTKSZ) is more the low-level Linux API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 19:56:51 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 00:56:51 +0000 Subject: [issue46990] Surprising list overallocation from .split() In-Reply-To: <1647038240.05.0.997478605012.issue46990@roundup.psfhosted.org> Message-ID: <1647046611.05.0.749731858769.issue46990@roundup.psfhosted.org> Jelle Zijlstra added the comment: The value 12 is hardcoded here: https://github.com/python/cpython/blob/a89c29fbcc7e7e85848499443d819c3fab68c78a/Objects/stringlib/split.h#L14 The comment there says that this is because most .split() calls are on lines of human-readable text, which has about 11 words per line. I don't know if I believe that. ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:04:00 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:04:00 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1647047040.83.0.104549017654.issue46677@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 28f20a6613b9d9287848bb78369b881a72941a39 by Charlie Zhao in branch '3.10': [3.10] bpo-46677: Add examples of inheritance and attributes to `TypedDict` docs (GH-31349) (GH-31815) https://github.com/python/cpython/commit/28f20a6613b9d9287848bb78369b881a72941a39 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:10:23 2022 From: report at bugs.python.org (Oleksandr Pavlyk) Date: Sat, 12 Mar 2022 01:10:23 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647047423.64.0.444516180633.issue46968@roundup.psfhosted.org> Oleksandr Pavlyk added the comment: So where getauxval(AT_MINSIGSTKSZ) < SIGSTKSZ the merged changes actually resulted in decrease of the allocated signal deliver stack. On Sapphire Rapids due to tile registers size we have getauxval(AT_MINSIGSTKSZ) > SIGSTKSZ. This is why the initial proposal was to use SIGSTKSZ + max(getauxval(AT_MINSIGSTKSZ), SIGSTKSZ). I suppose, ultimately I am saying that we should check that bpo-21131 does not regress. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:12:25 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:12:25 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647047545.83.0.584322067934.issue46644@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 870b22b9c442d035190d2b8fb82256cd9a03da48 by Gregory Beauregard in branch 'main': bpo-46644: Remove callable() requirement from typing._type_check (GH-31151) https://github.com/python/cpython/commit/870b22b9c442d035190d2b8fb82256cd9a03da48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:12:52 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:12:52 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647047572.73.0.79601266904.issue46644@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks for your contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:14:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:14:30 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1647047670.34.0.745519602617.issue46677@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset b5140a5811aa35f4b488849fb55d84504732d135 by Charlie Zhao in branch '3.9': [3.9] bpo-46677: Add examples of inheritance and attributes to `TypedDict` docs. (GH-31349) (GH-31808) https://github.com/python/cpython/commit/b5140a5811aa35f4b488849fb55d84504732d135 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:15:11 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:15:11 +0000 Subject: [issue46677] TypedDict docs are incomplete In-Reply-To: <1644262079.95.0.663870450502.issue46677@roundup.psfhosted.org> Message-ID: <1647047711.15.0.538093714068.issue46677@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks @CharliieZhao for the improved documentation! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:31:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Mar 2022 01:31:53 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647048713.26.0.945540661851.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: > So where getauxval(AT_MINSIGSTKSZ) < SIGSTKSZ the merged changes actually resulted in decrease of the allocated signal deliver stack. faulthandler stack is only used in the least likely case: on a fatal error. It should reduce its memory footprint, so it's good that it uses less memory. To fix bpo-21131, I chose to use SIGSTKSZ * 2 because: * the fix is trivial: add "* 2" * it "just works" * there was no API to query how many bytes Linux uses on the stack Previously, faulthandler had between 0 and SIGSTKSZ bytes depending on which CPU extension was used or not on the process. If I understood correctly, on Linux 5.14 with the change, faulthandler now always has SIGSTKSZ bytes for its own usage, and the other bytes are used by the Linux kernel. So it's more reliable for faulthandler, to always have the same amount of memory for its personal use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:37:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:37:30 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647049050.28.0.208701689767.issue46644@roundup.psfhosted.org> Jelle Zijlstra added the comment: Some tests are failing on main, probably due to a race. PR incoming. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 20:49:57 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 01:49:57 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647049797.65.0.409450491341.issue46644@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +29930 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 21:17:53 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 02:17:53 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647051473.81.0.598736301743.issue46644@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 75174371e6cac935b598a68c1113f6db1e0d6ed8 by Jelle Zijlstra in branch 'main': bpo-46644: Fix test_typing test broken by GH-31151 due to a merge race (GH-31833) https://github.com/python/cpython/commit/75174371e6cac935b598a68c1113f6db1e0d6ed8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 21:46:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 02:46:05 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647053165.99.0.331277333882.issue46644@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 22:06:27 2022 From: report at bugs.python.org (admin) Date: Sat, 12 Mar 2022 03:06:27 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1647054387.41.0.671432568092.issue2771@roundup.psfhosted.org> Change by admin : ---------- github: 1 -> 18614 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 22:24:49 2022 From: report at bugs.python.org (Tim Peters) Date: Sat, 12 Mar 2022 03:24:49 +0000 Subject: [issue46990] Surprising list overallocation from .split() In-Reply-To: <1647038240.05.0.997478605012.issue46990@roundup.psfhosted.org> Message-ID: <1647055489.9.0.896345569782.issue46990@roundup.psfhosted.org> Tim Peters added the comment: Well, that's annoying ;-) In context, the OP was saving a list of 10 million splits. So each overallocation by a single element burned 80 million bytes of RAM. Overallocating by 7 burned 560 million bytes. Which is unusual. Usually a split result is short-lived, consumed once then thrown away. OTOH, the overwhelming motivation for overallocating at all is to acheive O(1) amortized time after a long _sequence_ of appends, and split results typically aren't appended to at all. split() appears to be using it as a timing micro-optimization for tiny lists instead. So, like I said, it's annoying ;-) For "small" lists, split() really shouldn't overallocate at all (because, as before, split results are rarely appended to). A compromise could be to save pointers to the first N (12, whatever) instances of the splitting string in a stack ("auto") vector, before any list object (or result string object) is created. If it's out of stuff to do before reaching N, fine, build a result out of exactly what was found. If there's more to do, build a result from the first N, and go on as currently (letting PyList_Append deal with it - overallocation is huge in percentage terms when the list is short, but not so much as the list gets longer). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 22:36:25 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 03:36:25 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1647056185.5.0.964081436402.issue44799@roundup.psfhosted.org> Jelle Zijlstra added the comment: This is now fixed in main thanks to bpo-46644: ``` >>> get_type_hints(Foo) {'attr': dataclasses.InitVar[int]} ``` We're not backporting that change to the bugfix branches. If we want to fix this issue in 3.10 and 3.9, we'll have to add a `__call__` method to `InitVar`. My inclination is that that's not worth it. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 22:39:46 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 03:39:46 +0000 Subject: [issue46642] typing: tested TypeVar instance subclass TypeError is incidental In-Reply-To: <1644011961.17.0.0152846458354.issue46642@roundup.psfhosted.org> Message-ID: <1647056386.34.0.478046522019.issue46642@roundup.psfhosted.org> Jelle Zijlstra added the comment: This still behaves similarly after the bpo-46642 fix: >>> class V(TypeVar("T")): pass ... Traceback (most recent call last): File "", line 1, in File "/Users/jelle/py/cpython/Lib/typing.py", line 906, in __init__ self.__constraints__ = tuple(_type_check(t, msg) for t in constraints) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jelle/py/cpython/Lib/typing.py", line 906, in self.__constraints__ = tuple(_type_check(t, msg) for t in constraints) ^^^^^^^^^^^^^^^^^^^ File "/Users/jelle/py/cpython/Lib/typing.py", line 189, in _type_check raise TypeError(f"{msg} Got {arg!r:.100}.") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: TypeVar(name, constraint, ...): constraints must be types. Got (~T,). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 11 23:07:29 2022 From: report at bugs.python.org (Ken Jin) Date: Sat, 12 Mar 2022 04:07:29 +0000 Subject: [issue46991] Specialize list[slice] Message-ID: <1647058048.98.0.646431453049.issue46991@roundup.psfhosted.org> New submission from Ken Jin : According to https://github.com/faster-cpython/ideas/blob/main/stats.md#binary_subscr it's the second most common failed specialization. array.array[int] is quite hard to specialize, considering that array.array deals with 13 different item types based on its initial type argument. IMO specializing for it is only useful to bump benchmark numbers, but we won't see any real effects in real-world benchmarks. ---------- messages: 414971 nosy: kj priority: normal severity: normal status: open title: Specialize list[slice] versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 00:01:38 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 05:01:38 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. Message-ID: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> New submission from ??? : If use textwrap.dedent with string formatting, may get unintended sentences. For example, a sentence like this: ``` import textwrap def get_something_string(): return textwrap.dedent("""\ test text2 test text3 test text4""") textwrap.dedent(f"""\ test text1 {get_something_string()} test text5 test text6""") ``` I look forward to the following results. ``` test text1 test text2 test text3 test text4 test text5 test text6 ``` But the actual result is: ``` test text1 test text2 test text3 test text4 test text5 test text6 ``` I understand that this code works in this way because the intent of the string defined inside the method is different from the intent of the string outside the method. However, regular users, like me, will think of having a consistent intent result value. (because they believe dedent will clear a consistent intent) If you are concerned that the existing code will be broken, I can implement the function using the flag parameter. If you agree with my opinion, I will submit a PR. ---------- components: Library (Lib) messages: 414972 nosy: xncbf12 priority: normal severity: normal status: open title: If use textwrap.dedent with string formatting, may get unintended sentences. 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 Sat Mar 12 00:04:53 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 05:04:53 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647061493.7.0.138400235076.issue46992@roundup.psfhosted.org> ??? added the comment: Sorry, it's an indent , not an intent . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:32:30 2022 From: report at bugs.python.org (Kevin Locke) Date: Sat, 12 Mar 2022 06:32:30 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1647066750.2.0.16077123155.issue31975@roundup.psfhosted.org> Change by Kevin Locke : ---------- nosy: +kevinoid nosy_count: 7.0 -> 8.0 pull_requests: +29931 pull_request: https://github.com/python/cpython/pull/23172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:46:13 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 12 Mar 2022 06:46:13 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1647067573.42.0.00579799348011.issue44799@roundup.psfhosted.org> Eric V. Smith added the comment: I agree it's not worth fixing in 3.9 and 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 01:50:08 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 12 Mar 2022 06:50:08 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647067808.07.0.163916408447.issue46992@roundup.psfhosted.org> Eric V. Smith added the comment: What is the flag you mention? What would it do? This sounds like a new feature, which can only go in to 3.11. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:12:13 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 07:12:13 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647069133.3.0.656195030856.issue46992@roundup.psfhosted.org> ??? added the comment: If it's only for version 3.11, what do you think of the default behavior of the dedent method being changed? The method description says: > Remove any common leading whitespace from every line in `text`. ``` def get_something_string(): return textwrap.dedent("""\ test text2 test text3 test text4""") textwrap.dedent(f"""\ test text1 {get_something_string()} << test text5 test text6""") ``` I think it should work assuming that the indentation of {get_something_string()} and the indentation of test text2 are on the same line. ---------- versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:16:03 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 12 Mar 2022 07:16:03 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647069363.43.0.154501244099.issue46992@roundup.psfhosted.org> Eric V. Smith added the comment: What would the presence of "<<" do? You haven't described your proposal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:17:16 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 07:17:16 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647069436.57.0.892254429537.issue46992@roundup.psfhosted.org> ??? added the comment: "<<" This marks that line. ignore it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:21:41 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 12 Mar 2022 07:21:41 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647069701.37.0.0528519888989.issue46992@roundup.psfhosted.org> Eric V. Smith added the comment: What would x be equal to here: def get_something_string(): return textwrap.dedent("""\ test text2 test text3 test text4""") x = f"""\ test text1 {get_something_string()} test text5 test text6""" ? With 3.10 it is: ' test text1\n test text2\ntest text3\ntest text4\n test text5\n test text6' Are you proposing to change that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:30:38 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 07:30:38 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647070238.87.0.891689055662.issue46992@roundup.psfhosted.org> ??? added the comment: No, I know `textwrap.dedent` as a convenience function used for code readability. But to have the result I want, I currently need to do something like this: If it's a method inside a class, it's even more ugly. Class A: def get_something_string(): return textwrap.dedent("""\ test text2 test text3 test text4""") x = f"""\ test text1 {A.get_something_string()} test text5 test text6""" The duplicate use of dedent is to show an example. Thought I needed a consistent dedent for every line while using the string formatting feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:32:33 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 07:32:33 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647070353.24.0.615315635525.issue46992@roundup.psfhosted.org> ??? added the comment: Sorry, Can't edit comments Please see the code example below ``` Class A: def get_something_string(): return textwrap.dedent("""\ test text2 test text3 test text4""") textwrap.dedent(f"""\ test text1 {A.get_something_string()} test text5 test text6""") ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:40:30 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 12 Mar 2022 07:40:30 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647070830.83.0.83676337328.issue46992@roundup.psfhosted.org> Eric V. Smith added the comment: I?m sorry, I don?t understand your proposal. Please answer my question about what ?x? would be equal to under your proposed change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 02:50:03 2022 From: report at bugs.python.org (=?utf-8?b?6rmA7KSA7ZmY?=) Date: Sat, 12 Mar 2022 07:50:03 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1647071403.35.0.384228894479.issue46992@roundup.psfhosted.org> ??? added the comment: x does not change. sorry. I also haven't figured out the implementation in my head yet. I want to provide some functionality to provide consistent indentation while using formatting . For example """ test {multi_line_text} """.format(multi_line_text, consistent_indent=True) It's just a suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:00:18 2022 From: report at bugs.python.org (Kevin Locke) Date: Sat, 12 Mar 2022 09:00:18 +0000 Subject: [issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes In-Reply-To: <1536622594.77.0.0269046726804.issue34624@psf.upfronthosting.co.za> Message-ID: <1647075618.99.0.398912484409.issue34624@roundup.psfhosted.org> Change by Kevin Locke : ---------- nosy: +kevinoid nosy_count: 10.0 -> 11.0 pull_requests: +29932 pull_request: https://github.com/python/cpython/pull/23172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:27:59 2022 From: report at bugs.python.org (Julien Palard) Date: Sat, 12 Mar 2022 09:27:59 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1647077279.47.0.461716160715.issue42238@roundup.psfhosted.org> Julien Palard added the comment: News: Hitting 3 months without a true positive from `make suspicious`, looks like sphinxlint starting to take over properly, I hope to close this issue soon (like in a few months maybe). Also sphinxlint attracted some contributors [1] \o/ [1] https://github.com/sphinx-contrib/sphinx-lint ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:30:23 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 09:30:23 +0000 Subject: [issue46892] Async Call-Stack Reconstruction In-Reply-To: <1646172818.87.0.620414144341.issue46892@roundup.psfhosted.org> Message-ID: <1647077423.84.0.27532178439.issue46892@roundup.psfhosted.org> Andrew Svetlov added the comment: The idea looks interesting. The devil in the details I guess. I'm curious what is the memory and performance penalty. Waiting for the PR as the discussion starting point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:37:42 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Mar 2022 09:37:42 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647077862.02.0.437148021463.issue46987@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +29933 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:37:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2022 09:37:44 +0000 Subject: [issue46981] Empty typing.Tuple In-Reply-To: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> Message-ID: <1647077864.51.0.219038963175.issue46981@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +29934 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:40:10 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2022 09:40:10 +0000 Subject: [issue46981] Empty typing.Tuple In-Reply-To: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> Message-ID: <1647078010.39.0.817831861878.issue46981@roundup.psfhosted.org> Serhiy Storchaka added the comment: If for repr(Tuple[()]), it is no longer needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 04:40:17 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 12 Mar 2022 09:40:17 +0000 Subject: [issue46993] Speed up bytearray creation from list and tuple Message-ID: <1647078017.1.0.00491619232852.issue46993@roundup.psfhosted.org> New submission from Kumar Aditya : The attached PR speeds up bytearray creation from list and tuple. Benchmark (uses pyperf): ----------------------------------------------------- import pyperf runner = pyperf.Runner() runner.timeit(name="bench bytearray", stmt="bytearray([42]*10000)",) ----------------------------------------------------- Results: ----------------------------------------------------- Mean +- std dev: [base] 74.8 us +- 5.5 us -> [patch] 53.2 us +- 3.3 us: 1.41x faster ----------------------------------------------------- ---------- components: Interpreter Core messages: 414987 nosy: gvanrossum, kumaraditya303 priority: normal pull_requests: 29935 severity: normal status: open title: Speed up bytearray creation from list and tuple type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 05:26:38 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 12 Mar 2022 10:26:38 +0000 Subject: [issue46953] use FASTCALL for __import__ builtin In-Reply-To: <1646725956.31.0.303716044647.issue46953@roundup.psfhosted.org> Message-ID: <1647080798.11.0.443379349119.issue46953@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 05:26:58 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 12 Mar 2022 10:26:58 +0000 Subject: [issue46944] Use FASTCALL calling convention in generator.throw In-Reply-To: <1646654196.99.0.903506705512.issue46944@roundup.psfhosted.org> Message-ID: <1647080818.91.0.0580098255786.issue46944@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 05:33:08 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 10:33:08 +0000 Subject: [issue46994] Accept explicit contextvars.Context in asyncio create_task() API Message-ID: <1647081188.22.0.709370904314.issue46994@roundup.psfhosted.org> New submission from Andrew Svetlov : Now asyncio creates a new context copy on task creation. It is the perfect behavior *by default* and should stay as is. However, sometimes passing an explicit context into a task and using back the context modified by task code is desired. The most obvious use-case is testing: both unittest and pytest have multi-phase test initialization (asyncSetUp() methods and async fixtures correspondingly). If asyncSetUp() updates context variable -- test code expects to see this change. Currently, unittest runs the setup-test-cleanup chain in a single task and uses an internal queue to push a new coroutine for execution and get results back. It works but is cumbersome. Another solution is to create a task per test execution step and wrap the task creation with Context.run(). The problem is in getting the updated context back. A task creates a context copy on starting, thus the modified context is stored in the task internal attribute only. To get it back a trampoline async function should be used, e.g. async def wrapper(coro): try: return await coro finally: context = contextvars.copy_context() # store the context copy somewhere Again, it looks more complicated as it should be. The proposal is: 1. Add 'context' keyword-only argument to asyncio.create_task() and loop.create_task(). 2. Use this context if explicitly passed, create a copy of the current context otherwise. The proposal is backward-compatible. Low-level API (call_soon(), call_later() etc.) already accept 'context' argument. The attached PR demonstrates how the proposed API simplifies unittest.IsolatedAsyncioTestCase internals. ---------- components: asyncio messages: 414988 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Accept explicit contextvars.Context in asyncio create_task() API type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 05:35:20 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 10:35:20 +0000 Subject: [issue46994] Accept explicit contextvars.Context in asyncio create_task() API In-Reply-To: <1647081188.22.0.709370904314.issue46994@roundup.psfhosted.org> Message-ID: <1647081320.83.0.7558444003.issue46994@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +29936 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 06:25:09 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 12 Mar 2022 11:25:09 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647084309.53.0.115412027791.issue46987@roundup.psfhosted.org> Oleg Iarygin added the comment: > ./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stdin) // borrowed ref All three occurences look like this [1] for two years (see git blame): #ifndef Py_LIMITED_API _PySys_GetObjectId(&PyId_stdin) // borrowed ref #else PySys_GetObject("stdin") // borrowed ref #endif So everything is fixed already. [1]: https://github.com/h2oai/datatable/search?q=_PySys_GetObjectId ---------- nosy: +arhadthedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 06:48:31 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 11:48:31 +0000 Subject: [issue46995] Make Task.set_name() mandatory for third-parties Message-ID: <1647085711.65.0.890439672207.issue46995@roundup.psfhosted.org> New submission from Andrew Svetlov : The method was introduced by Python 3.8 Let's raise DeprecationWarning if third-party task implementation doesn't support it. Convert the depreciation into a strict error in Python 3.13 ---------- components: asyncio messages: 414990 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Make Task.set_name() mandatory for third-parties versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 06:51:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 11:51:55 +0000 Subject: [issue46995] Make Task.set_name() mandatory for third-parties In-Reply-To: <1647085711.65.0.890439672207.issue46995@roundup.psfhosted.org> Message-ID: <1647085915.16.0.891423061388.issue46995@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +29937 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 07:20:16 2022 From: report at bugs.python.org (Ken Jin) Date: Sat, 12 Mar 2022 12:20:16 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647087616.84.0.460032753306.issue43224@roundup.psfhosted.org> Ken Jin added the comment: New changeset af2277e461aee4eb96affd06b4af25aad31c81ea by Matthew Rahtz in branch 'main': bpo-43224: Implement PEP 646 changes to genericaliasobject.c (GH-31019) https://github.com/python/cpython/commit/af2277e461aee4eb96affd06b4af25aad31c81ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 08:54:12 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2022 13:54:12 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1647093252.03.0.877368493755.issue44796@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 31143 simplified some code without changing the common API: Objects/genericaliasobject.c | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) Lib/_collections_abc.py | 63 +++++++++------------------------------------------------------ 1 file changed, 9 insertions(+), 54 deletions(-) PR 27511 will simplify it even more: Objects/genericaliasobject.c | 60 ++++++++++++++++++------------------------------------------ 1 file changed, 18 insertions(+), 42 deletions(-) (Lib/typing.py will be simplified too, even if this does not reduce the number of lines). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 09:03:27 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 14:03:27 +0000 Subject: [issue39951] Ignore specific errors when closing ssl connections In-Reply-To: <1584070801.03.0.867475481059.issue39951@roundup.psfhosted.org> Message-ID: <1647093807.01.0.3326849177.issue39951@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:40:09 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:40:09 +0000 Subject: [issue40977] asyncio.trsock.TransportSocket says some APIs will be prohibited in 3.9 In-Reply-To: <1592141114.24.0.475548647885.issue40977@roundup.psfhosted.org> Message-ID: <1647099609.2.0.424637059057.issue40977@roundup.psfhosted.org> Andrew Svetlov added the comment: Fixed in Python 3.10 ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:43:41 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:43:41 +0000 Subject: [issue44795] asyncio.run does not allow for graceful shutdown of main task In-Reply-To: <1627735470.13.0.162641750734.issue44795@roundup.psfhosted.org> Message-ID: <1647099821.44.0.31489041132.issue44795@roundup.psfhosted.org> Andrew Svetlov added the comment: Please use TaskGroup from Python 3.11 for structural concurrency. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:45:41 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:45:41 +0000 Subject: [issue44373] make Event an Awaitable In-Reply-To: <1623310462.97.0.487595968193.issue44373@roundup.psfhosted.org> Message-ID: <1647099941.06.0.570781283571.issue44373@roundup.psfhosted.org> Andrew Svetlov added the comment: Please re-read the rejection reason: https://bugs.python.org/issue33544#msg316962 ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:46:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:46:50 +0000 Subject: [issue41879] Outdated description of async iterables in documentation of async for statement In-Reply-To: <1601324135.53.0.963696566223.issue41879@roundup.psfhosted.org> Message-ID: <1647100010.83.0.972026029657.issue41879@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:49:28 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:49:28 +0000 Subject: [issue32181] runaway Tasks with Task.cancel() ignored. In-Reply-To: <1512048559.34.0.213398074469.issue32181@psf.upfronthosting.co.za> Message-ID: <1647100168.11.0.977734475267.issue32181@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:51:15 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:51:15 +0000 Subject: [issue28534] Replace asynchat In-Reply-To: <1477420373.21.0.38842063017.issue28534@psf.upfronthosting.co.za> Message-ID: <1647100275.08.0.132962182329.issue28534@roundup.psfhosted.org> Andrew Svetlov added the comment: Superseded by #28533 ---------- nosy: +asvetlov resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Remove asyncore, asynchat and smtpd modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:55:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:55:22 +0000 Subject: [issue44221] ImportError: sys.meta_path is None, Python is likely shutting down In-Reply-To: <1621815537.06.0.915921602571.issue44221@roundup.psfhosted.org> Message-ID: <1647100522.43.0.3238628124.issue44221@roundup.psfhosted.org> Andrew Svetlov added the comment: Reproducer is missing ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 10:58:26 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 15:58:26 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1647100706.56.0.0337701872626.issue44604@roundup.psfhosted.org> Andrew Svetlov added the comment: TaskGroup has landed, aiodag is present on pypi. Closing. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:03:38 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2022 16:03:38 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 Message-ID: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> New submission from Serhiy Storchaka : In issue45979 E. Paine suggested to drop support of Tcl/Tk older than 8.5.12 (8.5.12 was released on 2012-07-27 and 8.6.0 on 2012-12-20). Tkinter tests contain workarounds and special cases for older versions of Tcl/Tk, many of them can be removed. Also some Python and C code of tkinter can be simplified. ---------- components: Library (Lib), Tests messages: 414999 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Drop support of Tcl/Tk older than 8.5.12 type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 11:10:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Mar 2022 16:10:37 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647101437.4.0.914849227547.issue46996@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +29938 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:01:01 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:01:01 +0000 Subject: [issue22476] asyncio task chapter confusion about 'task', 'future', and 'schedule' In-Reply-To: <1411522444.59.0.775206973129.issue22476@psf.upfronthosting.co.za> Message-ID: <1647104461.97.0.76794873558.issue22476@roundup.psfhosted.org> Andrew Svetlov added the comment: Docs were rewritten from scratch in Python 3.8, they are much better now. ---------- nosy: +asvetlov resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:03:15 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:03:15 +0000 Subject: [issue25230] asyncio/Windows: Unix datagram sockets not supported In-Reply-To: <1443132861.89.0.286854164453.issue25230@psf.upfronthosting.co.za> Message-ID: <1647104595.95.0.551629224975.issue25230@roundup.psfhosted.org> Andrew Svetlov added the comment: Implemented a long time ago, closing ---------- nosy: +asvetlov resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:05:57 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:05:57 +0000 Subject: [issue28464] BaseEventLoop.close should shutdown executor before marking itself closed In-Reply-To: <1476741251.72.0.37603874415.issue28464@psf.upfronthosting.co.za> Message-ID: <1647104757.59.0.550635166394.issue28464@roundup.psfhosted.org> Andrew Svetlov added the comment: loop.shutdown_default_executor() exists for it, asyncio.run() calls the method ---------- nosy: +asvetlov resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:10:56 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:10:56 +0000 Subject: [issue32396] Implement method to write/read to serials without blocking on windows with asyncio In-Reply-To: <1513860129.41.0.213398074469.issue32396@psf.upfronthosting.co.za> Message-ID: <1647105056.54.0.95146710108.issue32396@roundup.psfhosted.org> Andrew Svetlov added the comment: No activity, closing. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:13:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:13:55 +0000 Subject: [issue35392] Create asyncio/sockutils.py In-Reply-To: <1543864023.37.0.788709270274.issue35392@psf.upfronthosting.co.za> Message-ID: <1647105235.71.0.535058218802.issue35392@roundup.psfhosted.org> Andrew Svetlov added the comment: I support the idea but we have no PR yet. The request is not very strong. Anyway, if you still want such change -- please recreate an issue. ---------- resolution: -> postponed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:26:27 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:26:27 +0000 Subject: [issue37529] Mimetype module duplicates In-Reply-To: <1562680761.15.0.288138014947.issue37529@roundup.psfhosted.org> Message-ID: <1647105987.37.0.274014078787.issue37529@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset d9db07a3100105768ba83ffd67991e78452bb22e by andrei kulakov in branch 'main': bpo-37529: Add test for guessing extensions (GH-28243) https://github.com/python/cpython/commit/d9db07a3100105768ba83ffd67991e78452bb22e ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:26:54 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:26:54 +0000 Subject: [issue37529] Mimetype module duplicates In-Reply-To: <1562680761.15.0.288138014947.issue37529@roundup.psfhosted.org> Message-ID: <1647106014.11.0.617538753618.issue37529@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 12:28:18 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 17:28:18 +0000 Subject: [issue42760] inspect.iscoroutine returns False for asynchronous generator methods In-Reply-To: <1609101687.37.0.151159530312.issue42760@roundup.psfhosted.org> Message-ID: <1647106098.84.0.972452456119.issue42760@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 13:00:32 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 12 Mar 2022 18:00:32 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1647108032.19.0.971689343294.issue44799@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 13:01:12 2022 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 12 Mar 2022 18:01:12 +0000 Subject: [issue46644] typing: remove callable() check from typing._type_check In-Reply-To: <1644015777.96.0.875814750019.issue46644@roundup.psfhosted.org> Message-ID: <1647108072.36.0.0123006739921.issue46644@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- nosy: +uriyyo nosy_count: 8.0 -> 9.0 pull_requests: +29939 pull_request: https://github.com/python/cpython/pull/27553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:08:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:08:55 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1647112135.87.0.480470518085.issue46829@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +29940 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31840 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:21:04 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:21:04 +0000 Subject: [issue40967] asyncio.Task.all_tasks() and asyncio.Task.current_task() must be removed in 3.9 In-Reply-To: <1592045282.09.0.91488246101.issue40967@roundup.psfhosted.org> Message-ID: <1647112864.03.0.976836579616.issue40967@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:26:41 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:26:41 +0000 Subject: [issue40251] selectors.KqueueSelector hangs on EOF, unlike other selectors In-Reply-To: <1586560424.88.0.351958580551.issue40251@roundup.psfhosted.org> Message-ID: <1647113201.13.0.857599585912.issue40251@roundup.psfhosted.org> Andrew Svetlov added the comment: Using selectors with blocked files looks weird at least. Should we care? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:39:37 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:39:37 +0000 Subject: [issue40487] Unexpected exception handler behavior in Jupyter when returning task objects created with create_task In-Reply-To: <1588527401.93.0.870743970124.issue40487@roundup.psfhosted.org> Message-ID: <1647113977.76.0.177163933904.issue40487@roundup.psfhosted.org> Andrew Svetlov added the comment: tasks are not awaited, this is the problem. The reproducer is not correct. Closing. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:42:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:42:35 +0000 Subject: [issue40454] DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere In-Reply-To: <1588277169.66.0.186559339191.issue40454@roundup.psfhosted.org> Message-ID: <1647114155.76.0.0383939345112.issue40454@roundup.psfhosted.org> Andrew Svetlov added the comment: Fixed by #41696 ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:44:10 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:44:10 +0000 Subject: [issue38955] Non indemnpotent behavior of asyncio.get_event_loop and asyncio.run sequence. In-Reply-To: <1575311987.47.0.389219942485.issue38955@roundup.psfhosted.org> Message-ID: <1647114250.09.0.288124716892.issue38955@roundup.psfhosted.org> Andrew Svetlov added the comment: The usage of get_event_loop() outside of a loop is deprecated since Python 3.10 ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 14:57:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 19:57:50 +0000 Subject: [issue40227] SSLError is not passed to the client during handshake In-Reply-To: <1586356655.96.0.9896517853.issue40227@roundup.psfhosted.org> Message-ID: <1647115070.92.0.466100256819.issue40227@roundup.psfhosted.org> Andrew Svetlov added the comment: asyncio ssl support was rewritten from scratch. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 15:01:32 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 20:01:32 +0000 Subject: [issue41696] asyncio.run interacts surprisingly with debug mode In-Reply-To: <1599093230.84.0.897076872177.issue41696@roundup.psfhosted.org> Message-ID: <1647115292.99.0.982879865222.issue41696@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 15:03:31 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 20:03:31 +0000 Subject: [issue25292] [asyncio] ssl socket gets into broken state when client exits during handshake In-Reply-To: <1443729972.18.0.386386409576.issue25292@psf.upfronthosting.co.za> Message-ID: <1647115411.65.0.958005101772.issue25292@roundup.psfhosted.org> Andrew Svetlov added the comment: asyncio ssl support was rewritten from scratch. If you still observe the problem, please open a new issue. ---------- nosy: +asvetlov resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 15:11:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 20:11:35 +0000 Subject: [issue45279] avoid redundant _commit_removals pending_removals guard In-Reply-To: <1632481640.03.0.970036840438.issue45279@roundup.psfhosted.org> Message-ID: <1647115895.62.0.211426637727.issue45279@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 15:54:08 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 12 Mar 2022 20:54:08 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1647118448.51.0.529666326139.issue32642@roundup.psfhosted.org> Jason R. Coombs added the comment: I'm in support of adding Path support for sys.path, but I also agree with Eric, there are innumerable consumers of sys.path beyond importlib. and since pathlib.Path isn't a str, it would likely introduce incompatibility. On the other hand, users introducing Path objects to sys.path could be warned that although importlib supports Path objects, other consumers may not, and that support for it in importlib isn't endorsement of the use of those types and the consequences aren't necessarily supported. As an aside, it's too bad a Path object couldn't have been a str subclass (as it is for [path](https://pypi.org/project/path), which would have made problems like this one much safer to solve. ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 15:55:28 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 12 Mar 2022 20:55:28 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1647118528.31.0.505473207173.issue46829@roundup.psfhosted.org> Guido van Rossum added the comment: Before we land GH-31840 we should have a somewhat more public discussion (e.g. on python-dev or maybe in Async-SIG, https://discuss.python.org/c/async-sig/20; or at least here) about deprecating the cancel message. I'm all for it but certainly Chris Jerdonek (who wrote the original code, see bpo-31033) needs to have a say, and from a comment on GH-19951 it looks Yury Selivanov also really liked it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 16:08:21 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 21:08:21 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1647119301.16.0.0430211219302.issue46829@roundup.psfhosted.org> Andrew Svetlov added the comment: If the cancellation message should be kept it needs improvements anyway, the single message doesn't work well with multiple `.cancel()` calls. I can imagine a 'CancelledError(*msgs)' and 'raise exc.drop_msg(msg)' as a function equivalent of task cancellation counter and `.cancel()` / `.uncancel()` pairing. A similar to MultiError, some sort of. The counter is easier to understand I guess. Both multi-message and counter require new APIs, timeout() can be adapted to any solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 16:23:30 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 12 Mar 2022 21:23:30 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647120210.74.0.941360959363.issue46907@roundup.psfhosted.org> Ned Deily added the comment: https://sqlite.org/releaselog/3_38_1.html ---------- title: Update Windows and MacOS installer to SQLite 3.38.0. -> Update Windows and MacOS installer to SQLite 3.38.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 16:30:01 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 12 Mar 2022 21:30:01 +0000 Subject: [issue46918] The vulnerability is included in /lib/python3.9/ensurepip after python 3.9.2 is installed. In-Reply-To: <1646386315.18.0.392218219699.issue46918@roundup.psfhosted.org> Message-ID: <1647120601.84.0.067896721245.issue46918@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 Mar 12 17:14:16 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 12 Mar 2022 22:14:16 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647123256.66.0.300023035773.issue46985@roundup.psfhosted.org> Ned Deily added the comment: We should probably include this update in the next round of releases. ---------- nosy: +lukasz.langa, ned.deily, pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 17:14:34 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 12 Mar 2022 22:14:34 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647123274.3.0.853812987122.issue46986@roundup.psfhosted.org> Ned Deily added the comment: We should probably include this update in the next round of releases. ---------- nosy: +lukasz.langa, ned.deily, pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 17:17:33 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 12 Mar 2022 22:17:33 +0000 Subject: [issue45993] Main branch of CPython does not build anymore on macOS In-Reply-To: <1638777618.8.0.921239379718.issue45993@roundup.psfhosted.org> Message-ID: <1647123453.08.0.563781938238.issue45993@roundup.psfhosted.org> Ned Deily added the comment: @Andrei, see Issue46975. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 18:30:59 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 23:30:59 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1647127859.09.0.195277180304.issue44318@roundup.psfhosted.org> Andrew Svetlov added the comment: 1. Guido van Rossum explicitly designed asyncio to *don't* use slots. 2. Changing it produces potential backward incompatibility issues. Very many stdlib classes don't have slots, as already mentioned. The default is really the reverse: no slots. Closing. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 18:55:08 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 23:55:08 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1647129308.4.0.266099010116.issue43215@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 3543ddb4c4ebc26fb2d6c67a97e66f5267876f72 by Illia Volochii in branch 'main': bpo-43215: Document Happy Eyeballs args of asyncio.open_connection (GH-24525) https://github.com/python/cpython/commit/3543ddb4c4ebc26fb2d6c67a97e66f5267876f72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 18:56:32 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 12 Mar 2022 23:56:32 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1647129392.37.0.0432494679951.issue43215@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- 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 Sat Mar 12 21:05:03 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 02:05:03 +0000 Subject: [issue46997] Invalid memory write in bytearray Message-ID: <1647137103.05.0.520249500347.issue46997@roundup.psfhosted.org> New submission from Jelle Zijlstra : Inspired by Guido's comment in https://github.com/python/cpython/pull/31834/files#r825352900, I found that there are some places in bytearrayobject.c where we can write to free'd memory if we encounter an object with a sneaky __index__ method: $ cat basneak.py ba = bytearray([0 for _ in range(10000)]) class sneaky: def __index__(self): ba.clear() return 1 ba[-1] = sneaky() $ valgrind ./python basneak.py ==87894== Memcheck, a memory error detector ==87894== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==87894== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==87894== Command: ./python basneak.py ==87894== ==87894== Invalid write of size 1 ==87894== at 0x49B70F: bytearray_ass_subscript (bytearrayobject.c:632) ==87894== by 0x488E03: PyObject_SetItem (abstract.c:211) In bytearray_setitem(), we first do bounds checking, and then call _getbytevalue() to get the numeric value of the argument. I think there's a similar bug in bytearray_ass_subscript(). ---------- messages: 415021 nosy: JelleZijlstra, gvanrossum priority: normal severity: normal status: open title: Invalid memory write in bytearray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 21:12:32 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 02:12:32 +0000 Subject: [issue46997] Invalid memory write in bytearray In-Reply-To: <1647137103.05.0.520249500347.issue46997@roundup.psfhosted.org> Message-ID: <1647137552.34.0.248951512717.issue46997@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- components: +Interpreter Core versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 21:14:01 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 02:14:01 +0000 Subject: [issue46997] Invalid memory write in bytearray In-Reply-To: <1647137103.05.0.520249500347.issue46997@roundup.psfhosted.org> Message-ID: <1647137641.83.0.100065912943.issue46997@roundup.psfhosted.org> Jelle Zijlstra added the comment: 3.9 segfaults. (gdb) bt #0 bytearray_ass_subscript (self=, index=0x7ffff7e118f0, values=0x7ffff6f918b0) at Objects/bytearrayobject.c:640 #1 0x0000000000536302 in _PyEval_EvalFrameDefault (tstate=, f=0x999a80, throwflag=) at Python/ceval.c:1990 #2 0x0000000000534775 in _PyEval_EvalFrame (throwflag=0, f=0x999a80, tstate=0x93de90) at ./Include/internal/pycore_ceval.h:40 ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 22:06:37 2022 From: report at bugs.python.org (Shantanu) Date: Sun, 13 Mar 2022 03:06:37 +0000 Subject: [issue46998] Allow subclassing Any at runtime Message-ID: <1647140797.69.0.86032805072.issue46998@roundup.psfhosted.org> New submission from Shantanu : Discussed on typing-sig at https://mail.python.org/archives/list/typing-sig at python.org/thread/GULRKYI7XOB3FLAEFC6OYSTBS5FIA5PU/ ---------- components: Library (Lib) messages: 415023 nosy: JelleZijlstra, hauntsaninja priority: normal severity: normal status: open title: Allow subclassing Any at runtime versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 22:07:25 2022 From: report at bugs.python.org (Shantanu) Date: Sun, 13 Mar 2022 03:07:25 +0000 Subject: [issue46998] Allow subclassing Any at runtime In-Reply-To: <1647140797.69.0.86032805072.issue46998@roundup.psfhosted.org> Message-ID: <1647140845.05.0.509328389012.issue46998@roundup.psfhosted.org> Change by Shantanu : ---------- keywords: +patch pull_requests: +29941 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 23:25:27 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 04:25:27 +0000 Subject: [issue46998] Allow subclassing Any at runtime In-Reply-To: <1647140797.69.0.86032805072.issue46998@roundup.psfhosted.org> Message-ID: <1647145527.6.0.452367522467.issue46998@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +AlexWaygood, gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 23:35:30 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Sun, 13 Mar 2022 04:35:30 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1647146130.1.0.0441937660501.issue46761@roundup.psfhosted.org> Graham Dumpleton added the comment: I am still working through this and thinking about implications, but my first impression is that the functools.partial object should provide an attribute (property) __signature__ which yields the correct result. When you think about it, any user who wants to implement a function wrapper using a class to do so rather than using functools.update_wrapper(), has to implement __signature__ if the wrapper is a signature changing decorator. So why shouldn't Python itself follow the same mechanism that is forced on users in their own wrappers. If functools.partial were to implement __signature__, then the part of PEP 362 where it says: > If the object is an instance of functools.partial, construct a new Signature from its partial.func attribute, and account for already bound partial.args and partial.kwargs becomes redundant as the code to deal with it is localised within the functools.partial implementation by virtue of __signature__ on that type rather than having a special case in inspect.signature(). If this was seen as making more sense, one might even argue that FunctionType and the bound variant could implement __signature__ and so localise things to those implementations as well, which would further simplify inspect.signature(). This would set a good precedent going forward that if any special callable wrapper objects are added to the Python core in the future, that they implement __signature__, rather than someone thinking that further special cases could be added to inspect.signature() to deal with them. I have yet to do some actual code experiments so might have more thoughts on the matter later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 23:38:15 2022 From: report at bugs.python.org (Larry Hastings) Date: Sun, 13 Mar 2022 04:38:15 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1647146295.21.0.416526806914.issue46761@roundup.psfhosted.org> Larry Hastings added the comment: You make a good point. I filed a separate bug (#46846) suggesting that partial objects should set their own annotations and signature. I agree that objects performing such magic should take care of these details themselves, rather than requiring the inspect module to have workarounds based on deep knowledge of these other modules' inner workings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 12 23:40:42 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Sun, 13 Mar 2022 04:40:42 +0000 Subject: [issue46846] functools.partial objects should set __signature__ and _annotations__ In-Reply-To: <1645695561.69.0.398852174273.issue46846@roundup.psfhosted.org> Message-ID: <1647146442.9.0.212258064033.issue46846@roundup.psfhosted.org> Change by Graham Dumpleton : ---------- nosy: +grahamd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 00:11:02 2022 From: report at bugs.python.org (Jeremiah Pascual) Date: Sun, 13 Mar 2022 05:11:02 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1647148262.38.0.941080931679.issue39829@roundup.psfhosted.org> Jeremiah Pascual added the comment: > Looks good to me. Would you create a pull request? Created a pull request (31816). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 00:17:57 2022 From: report at bugs.python.org (Matthias Klose) Date: Sun, 13 Mar 2022 05:17:57 +0000 Subject: [issue46999] test_multiprocessing_fork running without any timeout Message-ID: <1647148677.24.0.613958447679.issue46999@roundup.psfhosted.org> New submission from Matthias Klose : the test_multiprocessing_fork test is a bit unreliable, at least on both the Debian and Ubuntu test infrastructures, sometimes running for 100+ hours. When running locally, I cannot reproduce these issues. Note that the test and build infrastructure is usually limited to 4-6 cores and 20GB of RAM (including swap). What else could be an issue for these hangs? How can this test reliably timeout? I know it takes a few hours on slow architectures even when succeeding. ---------- components: Tests messages: 415027 nosy: doko priority: normal severity: normal status: open title: test_multiprocessing_fork running without any timeout _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:09:52 2022 From: report at bugs.python.org (Inada Naoki) Date: Sun, 13 Mar 2022 06:09:52 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. Message-ID: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> New submission from Inada Naoki : Currently, `encoding="locale"` is just shortcut of `encoding=locale.getpreferredencoding(False)`. `encoding="locale"` means that "locale encoding should be used here, even if Python default encoding is changed to UTF-8". I am not sure that UTF-8 mode becomes the default or not. But some user want to use UTF-8 mode to change default encoding in their Python environments without waiting Python default encoding changed. So I think `encoding="locale"` should use real locale encoding (ACP on Windows) regardless UTF-8 mode is enabled or not. Currently, UTF-8 mode affects to `_Py_GetLocaleEncoding()`. So it is difficult that make encoding="locale" ignores UTF-8 mode. Is it safe to use `locale.getlocale(locale.LC_CTYPE)[1] or "UTF-8"`? ---------- components: Unicode messages: 415028 nosy: ezio.melotti, methane, vstinner priority: normal severity: normal status: open title: Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 01:43:48 2022 From: report at bugs.python.org (Rocco Matano) Date: Sun, 13 Mar 2022 06:43:48 +0000 Subject: [issue47001] deadlock in ctypes? Message-ID: <1647153828.18.0.33672344904.issue47001@roundup.psfhosted.org> New submission from Rocco Matano : When using ctypes under Windows, I have observed a baffling behavior which I am not sure if it is the result of a bug in ctypes, or is simply due to false expectations on my part. Environment: - Windows 10 Pro, 21H1, 19043.1586, x64 - Python versions 3.6 up to 3.10, x64 What I was trying to do was to enumerate all the icons in the resource section of an executable file. The Windows-API for such a case is EnumResourceNamesW, which requires the pointer to a callback function as an argument. I wanted to hide the details of the corresponding code so that a user of that code does not have to deal with ctypes directly and can supply a regular Python function for the callback. So I added an extra level of indirection. When I ran my code, I was surprised to observe that the program was stuck. After several tries, I found a solution that differed from the original code only in one small detail: Use different types when describing the C callback. Below is a self contained sample that can be used to show the successful case as well as to trigger the blocking. Unfortunately it is quit long. import sys import ctypes from ctypes.wintypes import HMODULE, LPVOID, LPWSTR, BOOL # context structure that is used to use regular python functions as callbacks # where external C code expects C callbacks with a certain signature. class CallbackContext(ctypes.Structure): _fields_ = ( ("callback", ctypes.py_object), ("context", ctypes.py_object), ) CallbackContextPtr = ctypes.POINTER(CallbackContext) # quote from # https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nc-libloaderapi-enumresnameprocw # # BOOL Enumresnameprocw( # [in, optional] HMODULE hModule, # LPCWSTR lpType, # LPWSTR lpName, # [in] LONG_PTR lParam # ) # Note that the arguments lpType and lpName are declared as pointers to strings. if len(sys.argv) > 1 and sys.argv[1].lower() == "fail": # Declaring them as pointers to strings in the ctypes prototype does NOT work. EnumResNameCallback_prototype = ctypes.WINFUNCTYPE( BOOL, HMODULE, LPWSTR, LPWSTR, CallbackContextPtr ) else: # Declaring them as void pointers does work! EnumResNameCallback_prototype = ctypes.WINFUNCTYPE( BOOL, HMODULE, LPVOID, LPVOID, CallbackContextPtr ) # this is the ctypes callback function that mimics the required C call signature @EnumResNameCallback_prototype def EnumResNameCallback(hmod, typ, name, ctxt): cbc = ctxt.contents return cbc.callback(hmod, typ, name, cbc.context) kernel32 = ctypes.windll.kernel32 EnumResourceNames = kernel32.EnumResourceNamesW EnumResourceNames.restype = BOOL EnumResourceNames.argtypes = ( HMODULE, LPWSTR, EnumResNameCallback_prototype, CallbackContextPtr ) # Get a module handle for an executable that contains icons GetModuleHandle = kernel32.GetModuleHandleW GetModuleHandle.restype = HMODULE GetModuleHandle.argtypes = (LPWSTR,) hmod = GetModuleHandle(sys.executable) if hmod == 0: raise ctypes.WinError() RT_GROUP_ICON = ctypes.cast(14, LPWSTR) # this is the 'regular' callback function that does not have to care about # the C call signature def enum_callback(hmod, typ, name, unused_context): print(hmod, typ, name) return True cbc = CallbackContext(enum_callback, None) rcbc = ctypes.byref(cbc) print("Trying to enumerate icons.") print("In the case of failure, this WILL BLOCK indefinitely!") EnumResourceNames(hmod, RT_GROUP_ICON, EnumResNameCallback, rcbc) ---------- components: ctypes messages: 415029 nosy: rocco.matano priority: normal severity: normal status: open title: deadlock in ctypes? type: behavior versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:48:12 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 13 Mar 2022 07:48:12 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails In-Reply-To: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> Message-ID: <1647157692.01.0.221349810161.issue46961@roundup.psfhosted.org> Dennis Sweeney added the comment: I believe the issue is the usage of the x_divrem function. x_divrem always returns fresh ints, never cached small ints. This behavior is relied upon in the long_true_divide function, as it mutates the returned quotient at the line """x->ob_digit[0] = low & ~(2U*mask-1U);""". The other uses of x_divrem account for this when handling the *quotient*, but apparently missed checking for small ints in the *remainder*. uses of x_divrem: - long_divrem - uses maybe_small_long on quotient - doesn't check if remainder is small <---- oops - long_rem - throws away quotient - doesn't check if remainder is small <---- oops - long_true_divide - modifies the quotient - throws away remainder Possible patches to fix it: 1) Modify long_divrem and long_rem to check for small remainders, in addition to the small-quotient checks they already do. 2) Modify x_divrem to check for small remainders, but still always return fresh quotients. 3) Modify x_divrem to return cached quotients and remainders, and modify long_true_divide to make a copy before mutating. I'd lean towards #1, since that quotient check already exists. In #2, the mismatch of checking/not checking between quotient/remainder would be confusing. In #3, an extra int allocation gets added to integer true divide, which isn't ideal. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 03:51:00 2022 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sun, 13 Mar 2022 07:51:00 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1647157860.22.0.194543630525.issue32642@roundup.psfhosted.org> Change by Chih-Hsuan Yen : ---------- nosy: -yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 04:08:05 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 13 Mar 2022 08:08:05 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails In-Reply-To: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> Message-ID: <1647158885.26.0.879163462743.issue46961@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +29942 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31843 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 04:29:17 2022 From: report at bugs.python.org (Pythass) Date: Sun, 13 Mar 2022 08:29:17 +0000 Subject: [issue47002] argparse - "expected one argument" when used -: in argument Message-ID: <1647160157.96.0.277366172749.issue47002@roundup.psfhosted.org> New submission from Pythass : By using argparse, and by passing a string as argument that has both a dash "-" and colon ":", python returns "expected one argument" error, despite it works when I use only "-" without ":". An example of code is attached at the ticket. Examples of triggering "expected one argument" error: python test.py -u -1:00 python test.py -u -1: Examples of NON triggering "expected one argument" error: python test.py -u -1 python test.py -u=-1:00 ---------- components: Parser files: test.py messages: 415031 nosy: Pythass, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: argparse - "expected one argument" when used -: in argument type: compile error versions: Python 3.10 Added file: https://bugs.python.org/file50668/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 05:38:02 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 13 Mar 2022 09:38:02 +0000 Subject: [issue46961] Caching/interning of small ints sometimes fails In-Reply-To: <1646754525.83.0.497190179669.issue46961@roundup.psfhosted.org> Message-ID: <1647164282.1.0.467039479112.issue46961@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: -AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 06:09:13 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 13 Mar 2022 10:09:13 +0000 Subject: [issue47002] argparse - "expected one argument" when used -: in argument In-Reply-To: <1647160157.96.0.277366172749.issue47002@roundup.psfhosted.org> Message-ID: <1647166153.46.0.686779678467.issue47002@roundup.psfhosted.org> Eric V. Smith added the comment: Here's a simplified reproducer: import argparse parser = argparse.ArgumentParser() parser.add_argument("-u", "--utc", choices=["-1:00"]) args = parser.parse_args() I assume this is related to argparse guessing if an argument is a negative number. See https://stackoverflow.com/questions/9025204/python-argparse-issue-with-optional-arguments-which-are-negative-numbers >From a suggestion there, note that python test.py -u ' -1:00' doesn't give the "expected one argument" error. I realize that doesn't solve your problem, but it does shed some light on the issue. I suspect this can't be fixed without breaking other usages of argparse. ---------- components: +Library (Lib) -Parser nosy: +eric.smith, paul.j3 -lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 06:38:20 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 13 Mar 2022 10:38:20 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1647167900.65.0.486461822886.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: I've updated the title to better reflect the actual problem. An update on the current state of this issue: I haven't looked at the code for a couple of days because because I got stuck. With a fresh mind I've continued debugging and noticed that I'm looking in the wrong place... I've added some warn() calls to the end of getpath.py to print the updated variables: `` warn(f"END prefix: {config['prefix']}") warn(f"END exec_prefix: {config['exec_prefix']}") warn(f"END base_prefix: {config['base_prefix']}") warn(f"END base_exec_prefix: {config['base_exec_prefix']}") ``` When I use this build with a framework build with and alternate name (``--enable-framework --with-framework-name=DebugPython``) and then create a venv in ``X/workenv`` I get expected output when I use the python in that venv: ``` $ X/workenv/bin/python -c 'import sys; print(f"ACTUAL prefix: {sys.prefix}\nACTUAL base_prefix: {sys.base_prefix}")' END prefix: /Library/Frameworks/DebugPython.framework/Versions/3.11 END exec_prefix: /Library/Frameworks/DebugPython.framework/Versions/3.11 END base_prefix: /Library/Frameworks/DebugPython.framework/Versions/3.11 END base_exec_prefix: /Library/Frameworks/DebugPython.framework/Versions/3.11 ACTUAL prefix: /Users/ronald/Projects/Forks/cpython/build/X/workenv ACTUAL base_prefix: /Library/Frameworks/DebugPython.framework/Versions/3.11 ``` Note how "ACTUAL prefix" is different from "END prefix". The weird bit is that the only reference to 'workenv' (the name of the venv) is in the value of config["executable"]. I'm now convinced that sys.prefix is set after ``_PyConfig_InitPathConfig``, I've added some more debug prints around the call to ``_PyConfig_FromDict`` in ``_PyConfig_InitPathConfig`` and that prints: ``` before reconfig: config->prefix = (null) before reconfig: sys.prefix = (not set) after reconfig: config->prefix = /Library/Frameworks/DebugPython.framework/Versions/3.11 after reconfig: sys.prefix = (not set) ``` I have no idea where sys.prefix get's initialised though, the configuration initialisation code could use some documentation. I've attached a new version of my patch, still work in progress and including debug code. Definitely not ready for merging. In short: my patch (v3) seems to work, but I have no idea why. ---------- title: venv does not create "python" link in python 3.11 -> getpath problems with framework build Added file: https://bugs.python.org/file50669/issue-46890-v3.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 07:50:49 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 13 Mar 2022 11:50:49 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647172249.08.0.224192068958.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29943 pull_request: https://github.com/python/cpython/pull/31844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 08:04:51 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 13 Mar 2022 12:04:51 +0000 Subject: [issue45995] string formatting: normalize negative zero In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org> Message-ID: <1647173091.16.0.0773535121541.issue45995@roundup.psfhosted.org> Mark Dickinson added the comment: I forgot to update here: > PEP at https://github.com/python/peps/pull/2295 For the record, PEP 682 has been accepted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 08:08:30 2022 From: report at bugs.python.org (Zara Youmi) Date: Sun, 13 Mar 2022 12:08:30 +0000 Subject: [issue46940] Suggestion messages don't properly work in nested getattr calls In-Reply-To: <1646597681.21.0.64157062994.issue46940@roundup.psfhosted.org> Message-ID: <1647173310.77.0.567751815691.issue46940@roundup.psfhosted.org> Change by Zara Youmi : ---------- components: +2to3 (2.x to 3.x conversion tool), C API, Extension Modules, IO, Installation, SSL, Unicode, Windows nosy: +ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware, zarayoumi3 type: -> resource usage Added file: https://bugs.python.org/file50670/LogDebug.vb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 08:12:54 2022 From: report at bugs.python.org (Safihre) Date: Sun, 13 Mar 2022 12:12: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: <1647173574.46.0.0406975753434.issue37355@roundup.psfhosted.org> Safihre added the comment: Pinging in hope for a review on https://github.com/python/cpython/pull/31492 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 08:53:33 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 13 Mar 2022 12:53:33 +0000 Subject: [issue47002] argparse - "expected one argument" when used -: in argument In-Reply-To: <1647160157.96.0.277366172749.issue47002@roundup.psfhosted.org> Message-ID: <1647176013.45.0.253962281321.issue47002@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 08:57:09 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 13 Mar 2022 12:57:09 +0000 Subject: [issue47002] argparse - "expected one argument" when used -: in argument In-Reply-To: <1647160157.96.0.277366172749.issue47002@roundup.psfhosted.org> Message-ID: <1647176229.99.0.756289915331.issue47002@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Seems related to https://bugs.python.org/issue9334 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 09:12:39 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 13 Mar 2022 13:12:39 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647177159.64.0.841016811694.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29944 pull_request: https://github.com/python/cpython/pull/31845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 09:29:11 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 13 Mar 2022 13:29:11 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647178151.01.0.0563546096641.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29945 pull_request: https://github.com/python/cpython/pull/31846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 11:14:54 2022 From: report at bugs.python.org (Marvin Poul) Date: Sun, 13 Mar 2022 15:14:54 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1647184494.12.0.719279084837.issue43743@roundup.psfhosted.org> Marvin Poul added the comment: I hope you don't mind me necro posting, but I ran into this issue again and have a small patch to solve it. I attached an MWE that triggers the BlockingIOError reliably on ext4 filesystems in linux 4.12.14 and python 3.8.12. Running under strace -e sendfile gives the following output # manually calling sendfile to check that it works > sendfile(5, 4, [0] => [8388608], 8388608) = 8388608 # sendfile calls originating in shutil.copy > sendfile(5, 4, [0] => [8388608], 8388608) = 8388608 > sendfile(5, 4, [8388608], 8388608) = -1 EAGAIN (Resource temporarily unavailable) > Shutil Failed! > [Errno 11] Resource temporarily unavailable: '/cmmc/u/zora/scratch/sendfile_bug/tmpaqx2o4uj' -> '/cmmc/u/zora/scratch/sendfile_bug/tmpb8rzg8rg' > +++ exited with 0 +++ This shows that the first call to sendfile actually copies the whole file and the EAGAIN is only triggered on the second, unnecessary, call. I have tested with a small C program that it's triggered whenever sendfile's offset + count exceeds the file size of in_fd. This is weird behaviour on the kernels side that seems to have changed in newer kernel versions (issue is not present e.g. on my 5.16.12 laptop). Anyways my patch makes that second call not appear by keeping track of the file size and the bytes written so far. It's against the current python main branch, but if I see correctly this part hasn't changed in years. I have checked the error is not thrown when the patch is applied. (I can only attach one file, so patch is attached in a new one.) ---------- nosy: +pmrv Added file: https://bugs.python.org/file50671/sendfile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 11:22:25 2022 From: report at bugs.python.org (Marvin Poul) Date: Sun, 13 Mar 2022 15:22:25 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1647184945.35.0.547839400605.issue43743@roundup.psfhosted.org> Marvin Poul added the comment: Here's the small patch. Sadly I have no overview what the affected linux kernel version are. I guess technically you can all this "working around a bug in specific linux version", but since it's a very minor change that saves one syscall even for non-breaking version, I feel it's justified. Let me know if you'd like any modification done however. ---------- keywords: +patch Added file: https://bugs.python.org/file50672/shutil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 12:22:51 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 13 Mar 2022 16:22:51 +0000 Subject: [issue47001] deadlock in ctypes? In-Reply-To: <1647153828.18.0.33672344904.issue47001@roundup.psfhosted.org> Message-ID: <1647188571.93.0.341329691639.issue47001@roundup.psfhosted.org> Eryk Sun added the comment: Pointers to resource type/name strings use the lower 16-bit range for integer identifiers such as RT_ICON (3) and RT_GROUP_ICON (14). C code checks for these cases using the IS_INTRESOURCE() macro. It's incorrect to use a simple C string pointer type such as ctypes.c_wchar_p (i.e. wintypes.LPWSTR) for a resource type/name string. Simple types get automatically converted to the corresponding Python type (e.g. str), but a 16-bit ID is not a valid pointer. Support for resource IDs can be implemented by a subclass of ctypes.c_wchar_p, since subclasses of simple types don't get converted automatically. For example: class LPWSTR(ctypes.c_wchar_p): @property def value(self): v = ctypes.c_void_p.from_buffer(self).value or 0 if v >> 16 == 0: return v return super().value @value.setter def value(self, v): ctypes.c_wchar_p.value.__set__(self, v) def __eq__(self, other): if not isinstance(other, __class__): return NotImplemented return self.value == other.value def __hash__(self): return hash(self.value) RT_ICON = LPWSTR(3) RT_GROUP_ICON = LPWSTR(RT_ICON.value + 11) > kernel32 = ctypes.windll.kernel32 I recommend using `kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)`, which creates function pointers that capture the last error value before they return. Call ctypes.get_last_error() to get the captured error value. To get an exception for the error value, use ctypes.WinError(ctypes.get_last_error()). This is more reliable since there's a chance that the thread executes some WinAPI code that modifies the last error before GetLastError() is called. This is particularly likely when working with ctypes calls in the interactive shell. Using a separate WinDLL() instance also isolates a library from other libraries. Since ctypes.windll caches modules, which cache function pointers, it's a problem when multiple libraries require different function prototypes (i.e. restype, argtypes, errcheck). The last library to set the prototype wins. The other libraries will probably be broken in some way. Their function calls may raise a ctypes.ArgumentError, or their post-call errcheck() isn't used, or their required restype isn't returned. > hmod = GetModuleHandle(sys.executable) This is unnecessary and possibly wrong since there's no guarantee that sys.executable is a valid file, let alone a file that's loaded as a module in the current process. Pass hModule as NULL (None) to use the main module of the process (i.e. the process image / executable). > context structure that is used to use regular python functions as callbacks > where external C code expects C callbacks with a certain signature. Generally there's no need to use C context parameters, which aren't necessary in object-oriented and functional programming paradigms. The callback function can defined as a nested function, with access to closure variables, or as a method, with access to instance attributes. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 12:34:58 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 16:34:58 +0000 Subject: [issue46995] Make Task.set_name() mandatory for third-parties In-Reply-To: <1647085711.65.0.890439672207.issue46995@roundup.psfhosted.org> Message-ID: <1647189298.03.0.99022087926.issue46995@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 7e473e94a52024ac821dd2f206290423e4987ead by Andrew Svetlov in branch 'main': bpo-46995: Deprecate missing asyncio.Task.set_name() for third-party task implementations (GH-31838) https://github.com/python/cpython/commit/7e473e94a52024ac821dd2f206290423e4987ead ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 12:35:26 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 16:35:26 +0000 Subject: [issue46995] Make Task.set_name() mandatory for third-parties In-Reply-To: <1647085711.65.0.890439672207.issue46995@roundup.psfhosted.org> Message-ID: <1647189326.7.0.250824044526.issue46995@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 12:42:40 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 16:42:40 +0000 Subject: [issue46805] Add low level UDP socket functions to asyncio In-Reply-To: <1645352829.56.0.926800544018.issue46805@roundup.psfhosted.org> Message-ID: <1647189760.01.0.286860873749.issue46805@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 9f04ee569cebb8b4c6f04bea95d91a19c5403806 by Alex Gr?nholm in branch 'main': bpo-46805: Add low level UDP socket functions to asyncio (GH-31455) https://github.com/python/cpython/commit/9f04ee569cebb8b4c6f04bea95d91a19c5403806 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 12:43:13 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 16:43:13 +0000 Subject: [issue46805] Add low level UDP socket functions to asyncio In-Reply-To: <1645352829.56.0.926800544018.issue46805@roundup.psfhosted.org> Message-ID: <1647189793.87.0.435324272773.issue46805@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:07:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:07:03 +0000 Subject: [issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod In-Reply-To: <1427087434.95.0.234111642557.issue23743@psf.upfronthosting.co.za> Message-ID: <1647191223.27.0.196688855297.issue23743@roundup.psfhosted.org> Irit Katriel added the comment: IIUC: (1) 2.7 is well past its EOL date, so it's not clear whether this issue is still there. (2) mingw is not supported and distutils is deprecated, so it's not clear if it's relevant. (3) it was, to begin with, a documentation issue and it was not clear where this point should be documented. If there won't be any objections, I will close this. ---------- nosy: +iritkatriel resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:11:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:11:47 +0000 Subject: [issue12516] imghdr.what should take one argument In-Reply-To: <1310068606.02.0.0739859897948.issue12516@psf.upfronthosting.co.za> Message-ID: <1647191507.14.0.0492178235891.issue12516@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be more enhancements to it. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:12:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:12:37 +0000 Subject: [issue28591] imghdr doesn't recognize some jpeg formats In-Reply-To: <1478117178.16.0.265494893112.issue28591@psf.upfronthosting.co.za> Message-ID: <1647191557.48.0.0388452699822.issue28591@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:12:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:12:50 +0000 Subject: [issue12516] imghdr.what should take one argument In-Reply-To: <1310068606.02.0.0739859897948.issue12516@psf.upfronthosting.co.za> Message-ID: <1647191570.18.0.993540793685.issue12516@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: rejected -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:15:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:15:04 +0000 Subject: [issue21574] Port image types detections from PIL to the imghdr module In-Reply-To: <1401010621.11.0.919611847501.issue21574@psf.upfronthosting.co.za> Message-ID: <1647191704.73.0.290397370694.issue21574@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:14:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:14:14 +0000 Subject: [issue27121] imghdr does not support jpg files with Lavc bytes In-Reply-To: <1464170447.09.0.218380322577.issue27121@psf.upfronthosting.co.za> Message-ID: <1647191654.18.0.736510859127.issue27121@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:16:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:16:22 +0000 Subject: [issue26337] Bypass imghdr module determines the type of image In-Reply-To: <1455170117.9.0.169068464747.issue26337@psf.upfronthosting.co.za> Message-ID: <1647191782.61.0.214575535678.issue26337@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:17:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:17:13 +0000 Subject: [issue43194] Add JFXX as jpeg marker in imghdr module In-Reply-To: <1612967841.33.0.0362829630893.issue43194@roundup.psfhosted.org> Message-ID: <1647191833.35.0.0587535335396.issue43194@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:18:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:18:14 +0000 Subject: [issue6497] Support for digital Cinema/film DPX and Kodak Cineon image file formats in imghdr module In-Reply-To: <1247779729.41.0.45019789349.issue6497@psf.upfronthosting.co.za> Message-ID: <1647191894.19.0.141109429085.issue6497@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:19:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:19:08 +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: <1647191948.45.0.967519555027.issue42916@roundup.psfhosted.org> Irit Katriel added the comment: imghdr is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:21:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:21:41 +0000 Subject: [issue9544] [doc] xdrlib.Packer().pack_fstring throws a TypeError when called with a str() In-Reply-To: <1281333086.43.0.820305754452.issue9544@psf.upfronthosting.co.za> Message-ID: <1647192101.04.0.685763338992.issue9544@roundup.psfhosted.org> Irit Katriel added the comment: xdrlib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:26:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:26:12 +0000 Subject: [issue34165] uu.decode() raises binascii.Error instead of uu.Error on invalid data In-Reply-To: <1532080428.61.0.56676864532.issue34165@psf.upfronthosting.co.za> Message-ID: <1647192372.29.0.658241098211.issue34165@roundup.psfhosted.org> Irit Katriel added the comment: uu is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:27:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:27:03 +0000 Subject: [issue18979] Use argparse in the uu module In-Reply-To: <1378661024.73.0.529726485343.issue18979@psf.upfronthosting.co.za> Message-ID: <1647192423.14.0.847320355835.issue18979@roundup.psfhosted.org> Irit Katriel added the comment: uu is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:30:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:30:08 +0000 Subject: [issue11352] Update cgi module doc In-Reply-To: <1298895261.86.0.965235067518.issue11352@psf.upfronthosting.co.za> Message-ID: <1647192608.19.0.936741761163.issue11352@roundup.psfhosted.org> Irit Katriel added the comment: cgi is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:32:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:32:24 +0000 Subject: [issue34129] CGITB does not mangle variables names In-Reply-To: <1531767859.43.0.56676864532.issue34129@psf.upfronthosting.co.za> Message-ID: <1647192744.5.0.474718226068.issue34129@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:33:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:33:40 +0000 Subject: [issue32669] cgitb file to print OSError exceptions In-Reply-To: <1516906988.26.0.467229070634.issue32669@psf.upfronthosting.co.za> Message-ID: <1647192820.39.0.317565576071.issue32669@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:34:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:34:55 +0000 Subject: [issue1047397] cgitb failures Message-ID: <1647192895.09.0.995307363272.issue1047397@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:35:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:35:29 +0000 Subject: [issue33507] Improving the html rendered by cgitb.html In-Reply-To: <1526331345.66.0.682650639539.issue33507@psf.upfronthosting.co.za> Message-ID: <1647192929.47.0.418434989193.issue33507@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:36:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:36:10 +0000 Subject: [issue15749] cgitb prints html for text when display disabled. In-Reply-To: <1345523795.76.0.397222969623.issue15749@psf.upfronthosting.co.za> Message-ID: <1647192970.22.0.447510796787.issue15749@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:37:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:37:37 +0000 Subject: [issue1178136] cgitb.py support for frozen images Message-ID: <1647193057.5.0.433677128118.issue1178136@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:41:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:41:14 +0000 Subject: [issue12026] Support more of MSI api In-Reply-To: <1304743825.08.0.890355737934.issue12026@psf.upfronthosting.co.za> Message-ID: <1647193274.99.0.248986022357.issue12026@roundup.psfhosted.org> Irit Katriel added the comment: msilib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:41:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:41:45 +0000 Subject: [issue12201] Returning FILETIME is unsupported in msilib.SummaryInformation.GetProperty() In-Reply-To: <1306590826.19.0.496191579279.issue12201@psf.upfronthosting.co.za> Message-ID: <1647193305.93.0.115862253432.issue12201@roundup.psfhosted.org> Irit Katriel added the comment: msilib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:42:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:42:25 +0000 Subject: [issue8526] msilib doesn't support multiple CAB instances in same installer In-Reply-To: <1272154034.54.0.42494510324.issue8526@psf.upfronthosting.co.za> Message-ID: <1647193345.16.0.215576164568.issue8526@roundup.psfhosted.org> Irit Katriel added the comment: msilib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:44:24 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 17:44:24 +0000 Subject: [issue47003] Cleanup _overlapped module Message-ID: <1647193464.85.0.127988629584.issue47003@roundup.psfhosted.org> New submission from Andrew Svetlov : 1. CancelIoEx is mandatory for supported Windows versions, there is no need for dynamic checks. 2. Argument Clinic supports Py_buffer, use it. ---------- components: asyncio messages: 415064 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Cleanup _overlapped module versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:44:43 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 17:44:43 +0000 Subject: [issue47003] Cleanup _overlapped module In-Reply-To: <1647193464.85.0.127988629584.issue47003@roundup.psfhosted.org> Message-ID: <1647193483.91.0.850415890391.issue47003@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +29946 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:47:43 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:47:43 +0000 Subject: [issue8934] aifc should use str instead of bytes (wave, sunau compatibility) In-Reply-To: <1275936965.71.0.27334704307.issue8934@psf.upfronthosting.co.za> Message-ID: <1647193663.08.0.682792904777.issue8934@roundup.psfhosted.org> Irit Katriel added the comment: aifc is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:49:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:49:05 +0000 Subject: [issue13681] Aifc read compressed frames fix In-Reply-To: <1325243830.12.0.0659769703479.issue13681@psf.upfronthosting.co.za> Message-ID: <1647193745.44.0.998828294104.issue13681@roundup.psfhosted.org> Irit Katriel added the comment: aifc is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 13:52:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 17:52:33 +0000 Subject: [issue22094] oss_audio_device.write(data) produces short writes In-Reply-To: <1406543360.46.0.562125681265.issue22094@psf.upfronthosting.co.za> Message-ID: <1647193953.12.0.81744773347.issue22094@roundup.psfhosted.org> Irit Katriel added the comment: ossaudiodev is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:06:30 2022 From: report at bugs.python.org (Pythass) Date: Sun, 13 Mar 2022 18:06:30 +0000 Subject: [issue47002] argparse - "expected one argument" when used -: in argument In-Reply-To: <1647160157.96.0.277366172749.issue47002@roundup.psfhosted.org> Message-ID: <1647194790.23.0.461213701744.issue47002@roundup.psfhosted.org> Pythass added the comment: The curious aspect is that for: import argparse parser = argparse.ArgumentParser() parser.add_argument("-u", "--utc", choices=["-1"]) args = parser.parse_args() it works. But if we use the colon (:) character as: import argparse parser = argparse.ArgumentParser() parser.add_argument("-u", "--utc", choices=["-1:"]) args = parser.parse_args() it does not work anymore... I could think maybe the issue could be related to the presence of ":" character together with "-" character. For example for: choices=["-:"] does not work choices=["-"] works choices=[":"] works choices=[":-"] works So, we get the error if the option start with "-" and has inside also ":" character. At this point I don't think it is related strictly to "negative numbers". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:14:28 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 18:14:28 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647195268.4.0.00878509432728.issue46985@roundup.psfhosted.org> Ned Deily added the comment: New changeset d87f1b787ed38dfd307d82452f2efe9dc5b93942 by Pradyun Gedam in branch 'main': bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) https://github.com/python/cpython/commit/d87f1b787ed38dfd307d82452f2efe9dc5b93942 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:14:39 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Mar 2022 18:14:39 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647195279.59.0.139233282306.issue46985@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29947 pull_request: https://github.com/python/cpython/pull/31849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:14:44 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Mar 2022 18:14:44 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647195284.08.0.585037234658.issue46985@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29948 pull_request: https://github.com/python/cpython/pull/31850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:40:08 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 18:40:08 +0000 Subject: [issue46774] Importlib.metadata.version picks first distribution not latest In-Reply-To: <1645062095.18.0.489026763345.issue46774@roundup.psfhosted.org> Message-ID: <1647196808.96.0.601370473349.issue46774@roundup.psfhosted.org> Jason R. Coombs added the comment: The behavior you describe is intentional _and_ deterministic. The library discovers distributions in the order found based on the search path provided, with the search path defaulting to sys.path. The expectation is therefore that the metadata should be discovered in its order of precedence. Thanks for the repro. I attempted to follow it, but was unsuccessful: ``` FROM jaraco/multipy-tox RUN git clone https://github.com/kkirsche/poetry-remove-untracked RUN pip install poetry WORKDIR poetry-remove-untracked RUN git checkout before RUN poetry install --remove-untracked RUN git checkout after RUN poetry install --remove-untracked CMD python -c "import importlib.metadata as md; print(md.version('poetry-remove-untracked'))" ``` Running that Dockerfile reports that the package isn't installed. ``` draft $ docker run -it @$(docker build -q .) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 955, in version return distribution(distribution_name).version File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 928, in distribution return Distribution.from_name(distribution_name) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 518, in from_name raise PackageNotFoundError(name) importlib.metadata.PackageNotFoundError: No package metadata was found for poetry-remove-untracked ``` I think you'll have to teach me a bit about how poetry works in order to understand how to properly reproduce the issue so I can examine the relevant environment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:45:05 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 18:45:05 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647197105.48.0.213153512718.issue46985@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29949 pull_request: https://github.com/python/cpython/pull/31851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:46:40 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 18:46:40 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647197200.29.0.31778284924.issue46985@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29950 pull_request: https://github.com/python/cpython/pull/31852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:47:44 2022 From: report at bugs.python.org (Maximilian Hils) Date: Sun, 13 Mar 2022 18:47:44 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647197264.56.0.943218515896.issue43253@roundup.psfhosted.org> Maximilian Hils added the comment: We are hitting the same traceback with mitmproxy on Windows without ever passing a socket object to open_connection. In other words, this can be triggered without performing any action on 'sock' due to some race conditions in the Windows network stack. I unfortunately don't have a better repro for that race other than what Daniel provided. ---------- nosy: +mhils _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:48:23 2022 From: report at bugs.python.org (Maximilian Hils) Date: Sun, 13 Mar 2022 18:48:23 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647197303.32.0.0727982360013.issue43253@roundup.psfhosted.org> Change by Maximilian Hils : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:49:35 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 18:49:35 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647197375.89.0.332220671707.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset c99ac3c364ee21be72263791b71ee8b55f64de08 by Pradyun Gedam in branch 'main': bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820) https://github.com/python/cpython/commit/c99ac3c364ee21be72263791b71ee8b55f64de08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:50:42 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 18:50:42 +0000 Subject: [issue46774] Importlib.metadata.version picks first distribution not latest In-Reply-To: <1645062095.18.0.489026763345.issue46774@roundup.psfhosted.org> Message-ID: <1647197442.82.0.570940857763.issue46774@roundup.psfhosted.org> Jason R. Coombs added the comment: Aha. I learned how to run commands in the poetry environment... and how to locate files in that environment. With that, I figured out where the environment is and where the package metadata is coming from: ``` $ docker run -it @$(docker build -q .) bash -c 'ls $(poetry env info -p)/lib/python3.10/site-packages/poetry*' /root/.cache/pypoetry/virtualenvs/poetry-remove-untracked-Qran5nGc-py3.10/lib/python3.10/site-packages/poetry_remove_untracked.pth /root/.cache/pypoetry/virtualenvs/poetry-remove-untracked-Qran5nGc-py3.10/lib/python3.10/site-packages/poetry_remove_untracked-0.1.0.dist-info: INSTALLER METADATA RECORD /root/.cache/pypoetry/virtualenvs/poetry-remove-untracked-Qran5nGc-py3.10/lib/python3.10/site-packages/poetry_remove_untracked-0.2.0.dist-info: INSTALLER METADATA RECORD ``` In this case, it's clear there is metadata for the `poetry-remove-untracked` package in duplicate, and importlib.metadata loads that metadata in whatever order the operating system provides it (lexicographic alphabetic sort usually). `importlib.metadata` doesn't have any means to determine which of those metadata are appropriate and doesn't support multiple versions of the same distribution being installed into the same path. Since poetry has acknowledged this issue is a bug, I suspect there's nothing more for importlib.metadata to do here, but do please report back if you have different expectations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:52:16 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Mar 2022 18:52:16 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647197536.16.0.00187382895675.issue46985@roundup.psfhosted.org> miss-islington added the comment: New changeset 1ceda9787f586e11ccd2a94171422a2d70622a27 by Miss Islington (bot) in branch '3.10': [3.10] bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31849) https://github.com/python/cpython/commit/1ceda9787f586e11ccd2a94171422a2d70622a27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:53:39 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 18:53:39 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647197619.69.0.0962697229954.issue47004@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- assignee: -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:53:30 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 18:53:30 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. Message-ID: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> New submission from Jason R. Coombs : Importlib_metadata 4.11.1-3 introduced a few bug fixes. Importantly, 4.11.2 fixed a [serious defect](https://github.com/python/importlib_metadata/issues/369). Let's incorporate those fixes into CPython. ---------- messages: 415075 nosy: jaraco priority: normal severity: normal status: open title: Apply bugfixes from importlib_metadata 4.11.3. versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:53:56 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Mar 2022 18:53:56 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647197636.69.0.37228846666.issue46986@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29951 pull_request: https://github.com/python/cpython/pull/31853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 14:55:35 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Mar 2022 18:55:35 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647197735.76.0.0658320460958.issue46985@roundup.psfhosted.org> miss-islington added the comment: New changeset 4f340b07392dd50800f255ceee0ec1b7edd77dc9 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31850) https://github.com/python/cpython/commit/4f340b07392dd50800f255ceee0ec1b7edd77dc9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:01:26 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Sun, 13 Mar 2022 19:01:26 +0000 Subject: [issue47005] Improve performance of bytes_repeat Message-ID: <1647198086.65.0.133480575826.issue47005@roundup.psfhosted.org> New submission from Pieter Eendebak : The bytearray_repeat and bytearray_irepeat are inefficient for small arrays and a high number of repeats. This can be improved by using the same approach is in the corresponding bytes_repeat method. Microbenchmark: python -m pyperf timeit "b=bytearray([1,2,])*100" Mean +- std dev: [base100] 479 ns +- 29 ns -> [patch100] 274 ns +- 18 ns: 1.75x faster python -m pyperf timeit "b=bytearray([1,2,])*1000" Mean +- std dev: [base1000] 2.58 us +- 0.18 us -> [patch1000] 399 ns +- 26 ns: 6.46x faster ---------- components: Interpreter Core messages: 415077 nosy: pieter.eendebak priority: normal severity: normal status: open title: Improve performance of bytes_repeat type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:01:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:01:35 +0000 Subject: [issue32007] deprecate the nis module In-Reply-To: <1510419983.02.0.213398074469.issue32007@psf.upfronthosting.co.za> Message-ID: <1647198095.15.0.307937264632.issue32007@roundup.psfhosted.org> Irit Katriel added the comment: is deprecated as per PEP 594, so there is no need for a separate issue for it. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:02:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:02:26 +0000 Subject: [issue2148] nis module not supporting group aliases In-Reply-To: <1203510631.66.0.497834646199.issue2148@psf.upfronthosting.co.za> Message-ID: <1647198146.26.0.535765672396.issue2148@roundup.psfhosted.org> Irit Katriel added the comment: nis is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:04:32 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 19:04:32 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647198272.84.0.00515545644226.issue47004@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +29952 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:04:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:04:45 +0000 Subject: [issue12506] NIS module cant handle multiple NIS map entries for the same GID In-Reply-To: <1309956537.93.0.737876319543.issue12506@psf.upfronthosting.co.za> Message-ID: <1647198285.38.0.934979501819.issue12506@roundup.psfhosted.org> Irit Katriel added the comment: nis is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:06:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:06:04 +0000 Subject: [issue40735] test_nntplib depends on unreliable external servers In-Reply-To: <1590181665.98.0.604811088124.issue40735@roundup.psfhosted.org> Message-ID: <1647198364.95.0.761821643716.issue40735@roundup.psfhosted.org> Irit Katriel added the comment: nntplib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:06:41 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 19:06:41 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647198401.65.0.207006610267.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29953 pull_request: https://github.com/python/cpython/pull/31855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:07:01 2022 From: report at bugs.python.org (Roundup Robot) Date: Sun, 13 Mar 2022 19:07:01 +0000 Subject: [issue47005] Improve performance of bytes_repeat In-Reply-To: <1647198086.65.0.133480575826.issue47005@roundup.psfhosted.org> Message-ID: <1647198421.42.0.754326407346.issue47005@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +29954 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:08:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:08:26 +0000 Subject: [issue1186900] nntplib shouldn't raise generic EOFError Message-ID: <1647198506.2.0.0291895443257.issue1186900@roundup.psfhosted.org> Irit Katriel added the comment: nntplib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:10:34 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 19:10:34 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647198634.84.0.175498177211.issue43253@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: not a bug -> status: closed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:12:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:12:42 +0000 Subject: [issue46967] Type union for except In-Reply-To: <1646848142.9.0.223249735581.issue46967@roundup.psfhosted.org> Message-ID: <1647198762.8.0.862454528433.issue46967@roundup.psfhosted.org> Irit Katriel added the comment: > I don't think that `except A|B` looks better than `except (A, B)` I agree. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:15:29 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Mar 2022 19:15:29 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647198929.95.0.843342833796.issue46986@roundup.psfhosted.org> miss-islington added the comment: New changeset 25962e4e60235645f945d23281431b30b3c3d573 by Miss Islington (bot) in branch '3.10': bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820) https://github.com/python/cpython/commit/25962e4e60235645f945d23281431b30b3c3d573 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:17:57 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 19:17:57 +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: <1647199077.83.0.87976526696.issue37355@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- nosy: -asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:29:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:29:19 +0000 Subject: [issue42548] debugger stops at breakpoint of `pass` that is not actually reached In-Reply-To: <1606948585.89.0.450511023817.issue42548@roundup.psfhosted.org> Message-ID: <1647199759.25.0.861525705552.issue42548@roundup.psfhosted.org> Irit Katriel added the comment: On second thought I won't keep this open till it expires. This is a low priority bug which no longer exists in new versions because it was fixed by accident due to another change. I don't believe anyone would care enough about this to investigate how it accidentally got fixed (and then investigate how it can be fixed in 3.9). In my judgement it's not worth anyone (core devs or contributors) spending any more time on this (even just reading it and moving on). We have over 7000 open issues and only a handful of volunteers reviewing and fixing them. I found msg412785 a bit rude, but I will give you the benefit of the doubt that you didn't intend for it to come across that way. If you still believe that I am overstepping my authority and this should be decided by the RMs, I suggest you raise this with the SC or on python-dev. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:33:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:33:16 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1647199996.91.0.636680379649.issue45711@roundup.psfhosted.org> Irit Katriel added the comment: We have agreed on python-dev [1] that the cpython changes will not be reverted, and the issue will be fixed in cython. So I am closing this again. [1] https://mail.python.org/archives/list/python-dev at python.org/message/BHIQL4P6F7OPMCAP6U24XEZUPQKI62UT/ ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:37:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:37:57 +0000 Subject: [issue45744] Fix Flawfinder C Errors In-Reply-To: <1636313482.78.0.504082429267.issue45744@roundup.psfhosted.org> Message-ID: <1647200277.37.0.0454463814375.issue45744@roundup.psfhosted.org> Irit Katriel added the comment: There is not enough information in this report. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:49:45 2022 From: report at bugs.python.org (Itai Steinherz) Date: Sun, 13 Mar 2022 19:49:45 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647200985.22.0.399192916099.issue46785@roundup.psfhosted.org> Itai Steinherz added the comment: Thanks for the comprehensive reply, Eryk! I have a few questions regarding your suggestion: 1. Why catch ERROR_NOT_READY and ERROR_BAD_NET_NAME as well? How do you know that FindFirstFileW() may return them? 2. Why can't the filename of the "foo"-like file in the test be simply os_helper.TESTFN, as done in some other tests? 3. I noticed some code snippets used in tests are wrapped in a seemingly-redundant `if 1: ...` statement. Why is that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:53:36 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 19:53:36 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647201216.4.0.417937559518.issue47004@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset b1e286860742e7ba6fadc75e3ddb6c2899a56919 by Jason R. Coombs in branch 'main': bpo-47004: Sync with importlib_metadata 4.11.3. (#31854) https://github.com/python/cpython/commit/b1e286860742e7ba6fadc75e3ddb6c2899a56919 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:55:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 19:55:29 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647201329.9.0.0913966097394.issue2604@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced this on 3.11 as well. The patch here needs to be converted to a GitHub PR and then tested and reviewed. The patch on issue9736 has a unit test as well, which should be included (because the pjd's patch doesn't have one). ---------- keywords: +easy nosy: +iritkatriel versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:58:06 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 19:58:06 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647201486.33.0.56797958297.issue46985@roundup.psfhosted.org> Ned Deily added the comment: New changeset 5a8e968c38cc239c07eba15ded439a12818a852f by Ned Deily in branch '3.7': bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31852) https://github.com/python/cpython/commit/5a8e968c38cc239c07eba15ded439a12818a852f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 15:58:07 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 19:58:07 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647201487.93.0.787214499676.issue47004@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +29955 pull_request: https://github.com/python/cpython/pull/31857 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:02:13 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 20:02:13 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647201733.81.0.643481234429.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset bda64b3c0c4e45de4c82ba1b8722f56db5ac88ba by Ned Deily in branch '3.9': bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820) (GH-31855) https://github.com/python/cpython/commit/bda64b3c0c4e45de4c82ba1b8722f56db5ac88ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:16:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 20:16:36 +0000 Subject: [issue18820] json.dump() ignores its 'default' option when serializing dictionary keys In-Reply-To: <1377253830.03.0.463497944995.issue18820@psf.upfronthosting.co.za> Message-ID: <1647202596.63.0.709983860962.issue18820@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:16:59 2022 From: report at bugs.python.org (Itai Steinherz) Date: Sun, 13 Mar 2022 20:16:59 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647202619.41.0.339383667371.issue46785@roundup.psfhosted.org> Change by Itai Steinherz : ---------- keywords: +patch pull_requests: +29956 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:22:51 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 13 Mar 2022 20:22:51 +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: <1647202971.47.0.581779891699.issue37355@roundup.psfhosted.org> Christian Heimes added the comment: We have very few people that are familar with ssl module and especially with its I/O layer. I'm busy with other topics. Others are directly affected by war in Ukraine. I'm not a particular fan of the new "eager_recv" property introduced by your PR. Also the improvement should be implemented for read and write ops. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:32:07 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 20:32:07 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647203527.32.0.383069103685.issue47004@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +29957 pull_request: https://github.com/python/cpython/pull/31859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:35:47 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 20:35:47 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647203747.8.0.888888455026.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29958 pull_request: https://github.com/python/cpython/pull/31860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:35:59 2022 From: report at bugs.python.org (Safihre) Date: Sun, 13 Mar 2022 20:35:59 +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: <1647203759.64.0.56018760675.issue37355@roundup.psfhosted.org> Safihre added the comment: Implementing for write is not needed as OpenSSL's SSL_write_ex that is used by write() already writes the whole buffer at once. Only reading OpenSSL does in the 16k segments. The new option was introduced to prevent the compatibility problems for code that would not expect the EOF being read in a sinhle read(), as Josh explained in his initial PR. This way the faster (but breaking) behavior can be enabled explicitly. The info is also in the PR, in case there is time to review in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:39:28 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 13 Mar 2022 20:39:28 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647203968.36.0.831675353594.issue46785@roundup.psfhosted.org> Eryk Sun added the comment: > Why catch ERROR_NOT_READY and ERROR_BAD_NET_NAME as well? When os.stat() falls back on FindFirstFileW(), an error that means the file doesn't exist should be kept. ERROR_BAD_NET_NAME is an obvious error to keep because it's already mapped to ENOENT (i.e. file not found). This error typically means that share was removed or the network went down. ERROR_NOT_READY typically means that the media was removed from a volume (e.g. ejected disk). pathlib.Path.exists() returns False for ERROR_NOT_READY. > Why can't the filename of the "foo"-like file in the test be > simply os_helper.TESTFN, as done in some other tests? I suppose the current working directory will be fine. I was looking to keep the test on a NTFS filesystem, with known behavior, but there's no hard guarantee that the user's temp directory is on the system volume. > I noticed some code snippets used in tests are wrapped in a > seemingly-redundant `if 1: ...` statement. Why is that? The `if 1` test is logically redundant but convenient for using a multiline string that has an arbitrary indentation level. For example: >>> exec(''' ... print(42) ... ''') Traceback (most recent call last): File "", line 1, in File "", line 2 print(42) IndentationError: unexpected indent >>> exec('''if 1: ... print(42) ... ''') 42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:39:33 2022 From: report at bugs.python.org (paul j3) Date: Sun, 13 Mar 2022 20:39:33 +0000 Subject: [issue47002] argparse - "expected one argument" when used -: in argument In-Reply-To: <1647160157.96.0.277366172749.issue47002@roundup.psfhosted.org> Message-ID: <1647203973.91.0.452197067849.issue47002@roundup.psfhosted.org> paul j3 added the comment: '-1' and '-1.23' are recognized as numbers, and treated as arguments. '-1' requires some special handling because it is allowed as a flag, as in parser.add_argument('-1','--one') '-1:00' on the other hand is no different from a string like '-foo'. Default is to parse it as a flag. If you don't get this error argument -f: expected one argument you are likely to get: error: unrecognized arguments: -1:23 This can probably be closed as a duplicate of: https://bugs.python.org/issue9334 argparse does not accept options taking arguments beginning with dash (regression from optparse) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:39:49 2022 From: report at bugs.python.org (Yury Selivanov) Date: Sun, 13 Mar 2022 20:39:49 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1647203989.87.0.298624349965.issue46829@roundup.psfhosted.org> Yury Selivanov added the comment: Andrew asked me for my opinion on the matter -- I think we should get rid of the message. Exception messages for "signals" can be easily lost if an exception was re-raised. If the reason of why something is being cancelled is important (in my experience it never is) it should be recorded elsewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:42:00 2022 From: report at bugs.python.org (Yury Selivanov) Date: Sun, 13 Mar 2022 20:42:00 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1647204120.34.0.350607122923.issue46829@roundup.psfhosted.org> Yury Selivanov added the comment: IOW I think that supporting custom messages is a needless complication of our API. Given how complex task trees can become with TaskGroups collecting those messages and presenting them all to the user isn't trivial, showing just first/last defeats the purpose. So i'm in favor of dropping it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:46:16 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 20:46:16 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior Message-ID: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> New submission from Jelle Zijlstra : We've had some disagreement about the behavior of TypeVarTuple substitution related to PEP 646, and the discussion has now spilled around multiple PRs. I'd like to use this issue to come to an agreement so we don't have to chase through so many different places. Links: - GH-31021 (merged) implements PEP 646 in typing.py. Matthew initially implemented full TypeVar substitution support, but took it out after I suggested an alternative solution in https://github.com/python/cpython/pull/31021#pullrequestreview-890627941. - GH-31800 (merged without review) implements TypeVarTuple substitution in Python. - GH-31828 implements TypeVarTuple substitution in C. - GH-31844 and GH-31846 add additional test cases. - GH-31804 (closed) implements my proposed solution. I'd like to ask that until we come to an agreement we hold off on making any more changes, so we don't have to go back and forth and we ensure that the eventual solution covers all edge cases. The disagreement is about what to do with TypeVarTuple substitution: the behavior when a generic type is subscripted, like `tuple[*Ts][int, str]`. There are two possible extreme approaches: - Implement full substitution support, just as we have it for existing TypeVars. This is complicated because TypeVarTuple makes it much harder to match up the types correctly. However, it is consistent with the behavior for other TypeVar-like objects. My example would turn into GenericAlias(tuple, (int, str)). - Give up on substitution and just return a new GenericAlias object: GenericAlias(GenericAlias(tuple, Unpack[Ts]), (int, str). This avoids implementing any complex runtime behavior, but it inconsistent with existing behavior and less pretty when you print out the type. I prefer this approach because there's less risk that future enhancements to typing will break it. I also want to explore extending this approach to ParamSpec substitution. ---------- assignee: JelleZijlstra messages: 415100 nosy: JelleZijlstra, gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: PEP 646: Decide on substitution behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:46:48 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 20:46:48 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647204408.19.0.422016352528.issue47006@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +mrahtz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:51:52 2022 From: report at bugs.python.org (Yury Selivanov) Date: Sun, 13 Mar 2022 20:51:52 +0000 Subject: [issue46994] Accept explicit contextvars.Context in asyncio create_task() API In-Reply-To: <1647081188.22.0.709370904314.issue46994@roundup.psfhosted.org> Message-ID: <1647204712.96.0.610135737151.issue46994@roundup.psfhosted.org> Yury Selivanov added the comment: Yeah, +1 to add a parameter. Fwiw it was on my idea list when i was working on the pep ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:52:12 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 20:52:12 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647204732.97.0.345273790333.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29959 pull_request: https://github.com/python/cpython/pull/31861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 16:53:20 2022 From: report at bugs.python.org (Itai Steinherz) Date: Sun, 13 Mar 2022 20:53:20 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647204800.53.0.861301929085.issue46785@roundup.psfhosted.org> Itai Steinherz added the comment: Interesting, thanks again :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:05:20 2022 From: report at bugs.python.org (Antony Lee) Date: Sun, 13 Mar 2022 21:05:20 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647205520.47.0.254540861912.issue46785@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:28:59 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 21:28:59 +0000 Subject: [issue47003] Cleanup _overlapped module In-Reply-To: <1647193464.85.0.127988629584.issue47003@roundup.psfhosted.org> Message-ID: <1647206939.33.0.0261456234982.issue47003@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:29:04 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 21:29:04 +0000 Subject: [issue47003] Cleanup _overlapped module In-Reply-To: <1647193464.85.0.127988629584.issue47003@roundup.psfhosted.org> Message-ID: <1647206944.82.0.340406102212.issue47003@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 690490e4de9f2baf07171b3d63fc440239928fb4 by Andrew Svetlov in branch 'main': bpo-47003: Cleanup _overlapped module (GH-31848) https://github.com/python/cpython/commit/690490e4de9f2baf07171b3d63fc440239928fb4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:29:53 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 21:29:53 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647206993.7.0.8145767552.issue47004@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset d929aa70e2a324ea48fed221c3257f929be05115 by Jason R. Coombs in branch '3.10': [3.10] bpo-47004: Sync with importlib_metadata 4.11.3. (GH-31854). (GH-31857) https://github.com/python/cpython/commit/d929aa70e2a324ea48fed221c3257f929be05115 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:30:11 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 21:30:11 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647207011.56.0.131194520485.issue47004@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 177be52517da9a876a3f9e670f88c4731b906986 by Jason R. Coombs in branch '3.9': [3.9] bpo-47004: Sync with importlib_metadata 4.11.3. (GH-31854). (GH-31859) https://github.com/python/cpython/commit/177be52517da9a876a3f9e670f88c4731b906986 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:30:36 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 13 Mar 2022 21:30:36 +0000 Subject: [issue47004] Apply bugfixes from importlib_metadata 4.11.3. In-Reply-To: <1647197610.76.0.445327879408.issue47004@roundup.psfhosted.org> Message-ID: <1647207036.56.0.0372277056876.issue47004@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 Sun Mar 13 17:40:03 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Mar 2022 21:40:03 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647207603.7.0.646123893511.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset 0fbab8a593dcd94cfc788700dd9bf67a73f85920 by Ned Deily in branch '3.7': bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820) (GH-31861) https://github.com/python/cpython/commit/0fbab8a593dcd94cfc788700dd9bf67a73f85920 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 17:59:28 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 13 Mar 2022 21:59:28 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647208768.9.0.726349872416.issue47006@roundup.psfhosted.org> Matthew Rahtz added the comment: Thanks for starting this, Jelle - I was a bit unsure about how to proceed here. Given that https://github.com/python/cpython/pull/31800 is already merged, I'd also propose something halfway between the two extremes: return a sensible substitution when the logic to compute that isn't too onerous, and a new GenericAlias object when it is. The upsides are that we'd probably be able to return reasonable substitutions for the vast majority of cases, and that we wouldn't have to remove what's already been merged. The downsides would be lack of consistency, and the potential for changing rules about what does and doesn't return a full substitution as time goes on and new features are added. ---------- nosy: +matthew.rahtz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 18:01:18 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 13 Mar 2022 22:01:18 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647208878.01.0.935921908801.issue47006@roundup.psfhosted.org> Matthew Rahtz added the comment: (Having said that, to be clear: my preferred solution currently would still be the solution where we just return a new GenericAlias for anything involving a TypeVarTuple. The crux is what Serhiy is happy with.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 18:10:02 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 13 Mar 2022 22:10:02 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647209402.89.0.185081472996.issue47006@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks Matthew! Merged PRs can still be reverted, and we have some time before the feature freeze. I'd like to hear what Guido and Ken think too. If we go with the GenericAlias substitution, we need to make sure that such aliases still work as base class. That would need some C work to make types.GenericAlias.__mro_entries__ recurse if the alias's origin is itself a GenericAlias. There's a few other subtleties to think about; I can work on that but don't have a ton of time today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 18:57:37 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 13 Mar 2022 22:57:37 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647212257.06.0.0179165889099.issue47006@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 19:35:48 2022 From: report at bugs.python.org (Jeremiah Pascual) Date: Sun, 13 Mar 2022 23:35:48 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1647214548.65.0.885670657863.issue39829@roundup.psfhosted.org> Change by Jeremiah Pascual : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 19:42:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 13 Mar 2022 23:42:35 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1647214955.43.0.030435835688.issue39829@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 19:58:06 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 23:58:06 +0000 Subject: [issue44886] asyncio: create_datagram_endpoint() does not return a DatagramTransport In-Reply-To: <1628671129.22.0.924495128156.issue44886@roundup.psfhosted.org> Message-ID: <1647215886.66.0.981732157191.issue44886@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 19:59:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 13 Mar 2022 23:59:35 +0000 Subject: [issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message In-Reply-To: <1643123783.64.0.215214582085.issue46522@roundup.psfhosted.org> Message-ID: <1647215975.68.0.0777055738134.issue46522@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 20:40:21 2022 From: report at bugs.python.org (Vanshaj Singhania) Date: Mon, 14 Mar 2022 00:40:21 +0000 Subject: [issue47007] [doc] str docs are inconsistent with special method lookup Message-ID: <1647218421.76.0.418268186673.issue47007@roundup.psfhosted.org> New submission from Vanshaj Singhania : The documentation for the `str` class[^1] says: > If neither encoding nor errors is given, str(object) returns object.__str__() This led our students[^2] to try the following code: >>> class Test: ... def __str__(self): ... return 'hi' ... >>> test = Test() >>> test.__str__ = lambda self: 'bye' >>> str(test) The expected result was calling `test.__str__()`, but instead the interpreter output was `'hi'`. The docs for special method lookup[^3] do say that instance attributes are ignored: > For custom classes, implicit invocations of special methods are only guaranteed to work correctly if defined on an object?s type, not in the object?s instance dictionary. This makes sense, and explains the observed behavior, but the `str` class docs seem to be inconsistent with this. Perhaps it would be more clear if the `str` documentation mentioned that it called `type(object).__str__()` instead of `object.__str__()`. [^1]: https://docs.python.org/3/library/stdtypes.html#str [^2]: CS 61A at UC Berkeley, https://cs61a.org [^3]: https://docs.python.org/3/reference/datamodel.html#special-method-lookup ---------- assignee: docs at python components: Documentation messages: 415110 nosy: docs at python, itsvs priority: normal severity: normal status: open title: [doc] str docs are inconsistent with special method lookup type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:24:06 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 14 Mar 2022 01:24:06 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1647221046.42.0.244071388661.issue39829@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 2153daf0a02a598ed5df93f2f224c1ab2a2cca0d by Crowthebird in branch 'main': bpo-39829: Fix `__len__()` is called twice in list() constructor (GH-31816) https://github.com/python/cpython/commit/2153daf0a02a598ed5df93f2f224c1ab2a2cca0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:24:29 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 14 Mar 2022 01:24:29 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1647221069.72.0.314645658801.issue39829@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 21:24:38 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 14 Mar 2022 01:24:38 +0000 Subject: [issue39829] __len__ called twice in the list() constructor In-Reply-To: <1583163376.54.0.165592229385.issue39829@roundup.psfhosted.org> Message-ID: <1647221078.33.0.414525195854.issue39829@roundup.psfhosted.org> Inada Naoki added the comment: Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:07:42 2022 From: report at bugs.python.org (Jeremiah Gabriel Pascual) Date: Mon, 14 Mar 2022 03:07:42 +0000 Subject: [issue37907] speed-up PyLong_As*() for large longs In-Reply-To: <1566404262.5.0.0996699211051.issue37907@roundup.psfhosted.org> Message-ID: <1647227262.17.0.58862937714.issue37907@roundup.psfhosted.org> Jeremiah Gabriel Pascual added the comment: Revisiting this 2+ year-old bug report, can I create another PR that implements the old PR's comments' suggestions? ---------- nosy: +Crowthebird _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:21:53 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 03:21:53 +0000 Subject: [issue47008] Add Lib/site-packages to .gitignore Message-ID: <1647228113.84.0.370767511712.issue47008@roundup.psfhosted.org> New submission from Dennis Sweeney : It would be nice to add the following to .gitignore, so that I can `./python -m pip install [whatever]` without overwhelming the output of `git status`. Lib/site-packages/* !Lib/test/data/README.txt ---------- messages: 415114 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Add Lib/site-packages to .gitignore type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:23:01 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 03:23:01 +0000 Subject: [issue47008] Add Lib/site-packages to .gitignore In-Reply-To: <1647228113.84.0.370767511712.issue47008@roundup.psfhosted.org> Message-ID: <1647228181.72.0.142684965397.issue47008@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +29960 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 13 23:27:52 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 03:27:52 +0000 Subject: [issue47008] Add Lib/site-packages to .gitignore In-Reply-To: <1647228113.84.0.370767511712.issue47008@roundup.psfhosted.org> Message-ID: <1647228472.4.0.883194560038.issue47008@roundup.psfhosted.org> Dennis Sweeney added the comment: I made a copy/paste error, it should be: Lib/site-packages/* !Lib/site-packages/README.txt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:07:55 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Mar 2022 04:07:55 +0000 Subject: [issue47007] [doc] str docs are inconsistent with special method lookup In-Reply-To: <1647218421.76.0.418268186673.issue47007@roundup.psfhosted.org> Message-ID: <1647230875.77.0.302514891991.issue47007@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:56:23 2022 From: report at bugs.python.org (Vanshaj Singhania) Date: Mon, 14 Mar 2022 04:56:23 +0000 Subject: [issue47007] [doc] str docs are inconsistent with special method lookup In-Reply-To: <1647218421.76.0.418268186673.issue47007@roundup.psfhosted.org> Message-ID: <1647233783.07.0.123183652593.issue47007@roundup.psfhosted.org> Change by Vanshaj Singhania : ---------- keywords: +patch pull_requests: +29961 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:57:38 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 04:57:38 +0000 Subject: [issue47009] Streamline list.append for the common case Message-ID: <1647233858.4.0.304324509353.issue47009@roundup.psfhosted.org> New submission from Dennis Sweeney : list_resize is a long function that probably won't get inlined. But for the vast majority of cases in list.append, we just need to check whether the list is big enough (not whether it's small enough, or whether it's null or the wrong type), then insert and update the size. This can be inlined, with an actual call only taking place whenever we need to resize. We can also add a reference-consuming version of PyList_Append to elide an INCREF/DECREF pair. ---------- components: Interpreter Core messages: 415116 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Streamline list.append for the common case type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 00:58:45 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 04:58:45 +0000 Subject: [issue47009] Streamline list.append for the common case In-Reply-To: <1647233858.4.0.304324509353.issue47009@roundup.psfhosted.org> Message-ID: <1647233925.2.0.482510839307.issue47009@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +29962 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 01:04:37 2022 From: report at bugs.python.org (Rocco Matano) Date: Mon, 14 Mar 2022 05:04:37 +0000 Subject: [issue47001] deadlock in ctypes? In-Reply-To: <1647153828.18.0.33672344904.issue47001@roundup.psfhosted.org> Message-ID: <1647234277.7.0.341827225365.issue47001@roundup.psfhosted.org> Rocco Matano added the comment: @Eryk I think you hit the nail on the head with your recommendation to avoid ctypes.c_wchar_p (i.e. wintypes.LPWSTR) as the parameter type when dealing resource type/name strings. Of course ctypes automatic conversion from a C character pointer to a Python string will cause problems when being confronted with a 16-bit ID that is NOT a valid pointer. Now that it is clear that the problem was in front of the monitor, I consider this case closed. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 01:23:19 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 14 Mar 2022 05:23:19 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647235399.88.0.937315252595.issue47000@roundup.psfhosted.org> Inada Naoki added the comment: I created a related topic on discuss.python.org. https://discuss.python.org/t/jep-400-utf-8-by-default-and-future-of-python/14246 If we recommend `PYTHONUTF8` as opt-in "UTF-8 by default", `encoding="locale"` should locale encoding in UTF-8 mode. If we don't change `PYTHONUTF8` behavior, we need yet another option for opt-in "UTF-8 by default". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 01:42:24 2022 From: report at bugs.python.org (Jeremiah Gabriel Pascual) Date: Mon, 14 Mar 2022 05:42:24 +0000 Subject: [issue37907] speed-up PyLong_As*() for large longs In-Reply-To: <1566404262.5.0.0996699211051.issue37907@roundup.psfhosted.org> Message-ID: <1647236544.06.0.0763738412045.issue37907@roundup.psfhosted.org> Jeremiah Gabriel Pascual added the comment: New benchmarks with the new changes: PyLong_AsSsize_t: Mean +- std dev: [orig] 10.3 us +- 0.6 us -> [modif] 9.03 us +- 0.61 us: 1.14x faster PyLong_AsSize_t: Mean +- std dev: [orig] 10.5 us +- 2.4 us -> [modif] 9.26 us +- 0.17 us: 1.13x faster PyLong_AsLong: Mean +- std dev: [orig] 12.7 us +- 0.1 us -> [modif] 11.2 us +- 0.4 us: 1.14x faster PyLong_AsUnsignedLong: Mean +- std dev: [orig] 12.5 us +- 0.4 us -> [modif] 11.4 us +- 0.6 us: 1.10x faster Benchmark hidden because not significant (2): PyLong_AsLongLong, PyLong_AsUnsignedLongLong Geometric mean: 1.09x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 02:38:02 2022 From: report at bugs.python.org (Paulo Costa) Date: Mon, 14 Mar 2022 06:38:02 +0000 Subject: [issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info In-Reply-To: <1616338437.57.0.677049840589.issue43582@roundup.psfhosted.org> Message-ID: <1647239882.97.0.936795056271.issue43582@roundup.psfhosted.org> Paulo Costa added the comment: Hello! Has this been addressed? I'm also working on implementing acme-tls/1 protocol and having exactly the same difficulties ---------- nosy: +paulo-raca _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 03:35:48 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 14 Mar 2022 07:35:48 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ In-Reply-To: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> Message-ID: <1647243348.19.0.0666228899606.issue46246@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 Mon Mar 14 04:19:46 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 14 Mar 2022 08:19:46 +0000 Subject: [issue47009] Streamline list.append for the common case In-Reply-To: <1647233858.4.0.304324509353.issue47009@roundup.psfhosted.org> Message-ID: <1647245986.46.0.486632430185.issue47009@roundup.psfhosted.org> Inada Naoki added the comment: Hmm. Would you measure benefit from inlining and skipping incref/decref separately? If benefit of inlining is very small, making _PyList_AppendTakeRef() as regular internal API looks better to me. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:28:20 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 14 Mar 2022 08:28:20 +0000 Subject: [issue47007] [doc] str docs are inconsistent with special method lookup In-Reply-To: <1647218421.76.0.418268186673.issue47007@roundup.psfhosted.org> Message-ID: <1647246500.77.0.764036363435.issue47007@roundup.psfhosted.org> Vedran ?a?i? added the comment: You mean `type(object).__str__(object)` instead of `type(object).__str__()`, obviously. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 04:37:24 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 14 Mar 2022 08:37:24 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647247044.15.0.352648198809.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29963 pull_request: https://github.com/python/cpython/pull/31865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 05:08:41 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 14 Mar 2022 09:08:41 +0000 Subject: [issue35228] Index search in CHM help crashes viewer In-Reply-To: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za> Message-ID: <1647248921.77.0.00092806588503.issue35228@roundup.psfhosted.org> Inada Naoki added the comment: I know chm is handy. But Microsoft abandoned it already. I think we should stop providing chm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 05:18:42 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 14 Mar 2022 09:18:42 +0000 Subject: [issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio Message-ID: <1647249522.0.0.992096149336.issue47010@roundup.psfhosted.org> New submission from Kumar Aditya : Currently, _SelectorSocketTransport transport creates a copy of the data before sending which in case of large amount of data, can create multiple giga bytes copies of data before sending. Script demonstrating current behavior: ------------------------------------------------------------------------- import asyncio import memory_profiler @memory_profiler.profile async def handle_echo(reader: asyncio.StreamReader, writer: asyncio.StreamWriter): data = b'x' * 1024 * 1024 * 1000 # 1000 MiB payload writer.write(data) await writer.drain() writer.close() async def main(): server = await asyncio.start_server( handle_echo, '127.0.0.1', 8888) addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets) print(f'Serving on {addrs}') async with server: asyncio.create_task(server.start_serving()) reader, writer = await asyncio.open_connection('127.0.0.1', 8888) while True: data = await reader.read(1024 * 1024 * 100) if not data: break asyncio.run(main()) ------------------------------------------------------------------------- Memory profile result: ------------------------------------------------------------------------ Filename: test.py Line # Mem usage Increment Occurrences Line Contents ============================================================= 4 17.7 MiB 17.7 MiB 1 @memory_profiler.profile 5 async def handle_echo(reader: asyncio.StreamReader, writer: asyncio.StreamWriter): 6 1017.8 MiB 1000.1 MiB 1 data = b'x' * 1024 * 1024 * 1000 # 1000 MiB payload 7 2015.3 MiB 997.5 MiB 1 writer.write(data) 8 2015.3 MiB -988.1 MiB 2 await writer.drain() 9 1027.1 MiB -988.1 MiB 1 writer.close() ------------------------------------------------------------------------ To make it zero copy, python's buffer protocol can be used and use memory views of data to save RAM. The writelines method currently joins all the data before sending whereas it can use `socket.sendmsg` to make it more memory efficient. Links: - writelines - https://github.com/python/cpython/blob/2153daf0a02a598ed5df93f2f224c1ab2a2cca0d/Lib/asyncio/transports.py#L116 - socket.sendmsg - https://docs.python.org/3/library/socket.html#socket.socket.sendmsg - memory_profiler - https://pypi.org/project/memory-profiler/ ---------- components: asyncio messages: 415124 nosy: asvetlov, gvanrossum, kumaraditya303, yselivanov priority: normal severity: normal status: open title: Implement zero copy writes in SelectorSocketTransport in asyncio type: resource usage versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 05:43:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 09:43:38 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647251018.35.0.00857771461487.issue46906@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29964 pull_request: https://github.com/python/cpython/pull/31866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:25:59 2022 From: report at bugs.python.org (Learn Coding) Date: Mon, 14 Mar 2022 10:25:59 +0000 Subject: [issue47011] Cloned turtle pen is not cleared completely Message-ID: <1647253559.7.0.0341872922214.issue47011@roundup.psfhosted.org> New submission from Learn Coding : When calling clear() method on a cloned turtle, some painted lines still remain on the screen. ---------- components: Library (Lib) files: testturtle.py messages: 415125 nosy: learncoding priority: normal severity: normal status: open title: Cloned turtle pen is not cleared completely versions: Python 3.10 Added file: https://bugs.python.org/file50673/testturtle.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:31:11 2022 From: report at bugs.python.org (Learn Coding) Date: Mon, 14 Mar 2022 10:31:11 +0000 Subject: [issue47011] Cloned turtle pen is not cleared completely In-Reply-To: <1647253559.7.0.0341872922214.issue47011@roundup.psfhosted.org> Message-ID: <1647253871.81.0.268784226333.issue47011@roundup.psfhosted.org> Learn Coding added the comment: Tested on Windows 10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:35:39 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 10:35:39 +0000 Subject: [issue47009] Streamline list.append for the common case In-Reply-To: <1647233858.4.0.304324509353.issue47009@roundup.psfhosted.org> Message-ID: <1647254139.91.0.09798128077.issue47009@roundup.psfhosted.org> Dennis Sweeney added the comment: The attached _PyList_AppendTakeRef.diff has the ceval.c, but this implementation: int _PyList_AppendTakeRef(PyListObject *self, PyObject *newitem) { assert(self != NULL && newitem != NULL); assert(PyList_Check(self)); Py_ssize_t len = PyList_GET_SIZE(self); Py_ssize_t allocated = self->allocated; assert((size_t)len + 1 < PY_SSIZE_T_MAX); if (allocated > len) { PyList_SET_ITEM(self, len, newitem); Py_SET_SIZE(self, len + 1); return 0; } if (list_resize(self, len + 1) < 0) { Py_DECREF(newitem); return -1; } PyList_SET_ITEM(self, len, newitem); return 0; } Results: | Benchmark | main | PR 31864 | _PyList_AppendTakeRef.diff | |-----------------|:-----------------:|:---------------------:|:--------------------------:| | listcomp 100 | 1.61 us | 1.33 us: 1.21x faster | 1.55 us: 1.04x faster | | append 100 | 2.11 us | 1.82 us: 1.15x faster | 2.05 us: 1.03x faster | | listcomp 1000 | 12.6 us | 9.83 us: 1.28x faster | 11.9 us: 1.06x faster | | append 1000 | 18.1 us | 15.3 us: 1.18x faster | 17.6 us: 1.03x faster | | listcomp 10000 | 121 us | 93.2 us: 1.29x faster | 114 us: 1.06x faster | | append 10000 | 175 us | 150 us: 1.17x faster | 172 us: 1.02x faster | | listcomp 100000 | 1.17 ms | 923 us: 1.26x faster | 1.15 ms: 1.02x faster | | append 100000 | 1.70 ms | 1.49 ms: 1.14x faster | not significant | | Geometric mean | (ref) | 1.21x faster | 1.03x faster | ---------- Added file: https://bugs.python.org/file50674/_PyList_AppendTakeRef.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 06:54:47 2022 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 14 Mar 2022 10:54:47 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647255287.35.0.406937641886.issue43253@roundup.psfhosted.org> Maximilian Hils added the comment: asvetlov: Sorry if I articulated myself badly, but I do think this is a valid bug. It's unfortunately hard to provide a better repro (I tried), but we are hitting this regularly when mitmproxy is accepting connections under heavy load. We're just calling `asyncio.start_server(handler, "127.0.0.1", 8080)` in mitmproxy and never interact with the underlying socket object. Here are some observations that are true for all crashes: - The socket fileno is -1 when it crashes. - `_call_connection_lost` is called by `_ProactorBasePipeTransport.close`, which is called by `_ProactorBasePipeTransport.__del__` [1] - There are no previous calls to `_call_connection_lost`. - Windows only, loopback connections in our case. - Wireshark shows that client and server are first happily exchanging packets. At some point the client sends a FIN, which the Python server ACKs immediately. A few seconds later the Python server sends a FIN back. An obvious fix without understanding the root cause would be to check fileno in https://github.com/python/cpython/blob/d929aa70e2a324ea48fed221c3257f929be05115/Lib/asyncio/proactor_events.py#L161. I'm not too familar with proactor to assess if that is a good idea. Sorry for not being able to provide more details. [1] https://github.com/python/cpython/blob/d929aa70e2a324ea48fed221c3257f929be05115/Lib/asyncio/proactor_events.py#L102-L116 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:13:25 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 14 Mar 2022 11:13:25 +0000 Subject: [issue47012] Speed up iteration of bytes and bytearray Message-ID: <1647256405.01.0.318214910817.issue47012@roundup.psfhosted.org> New submission from Kumar Aditya : Benchmark and results are attached in the PR. ---------- messages: 415129 nosy: gvanrossum, kumaraditya303 priority: normal pull_requests: 29965 severity: normal status: open title: Speed up iteration of bytes and bytearray type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:14:42 2022 From: report at bugs.python.org (Illia Volochii) Date: Mon, 14 Mar 2022 11:14:42 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1647256482.65.0.429504535625.issue43215@roundup.psfhosted.org> Change by Illia Volochii : ---------- pull_requests: +29966 pull_request: https://github.com/python/cpython/pull/31868 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:17:42 2022 From: report at bugs.python.org (Illia Volochii) Date: Mon, 14 Mar 2022 11:17:42 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1647256662.74.0.994116005661.issue43215@roundup.psfhosted.org> Change by Illia Volochii : ---------- pull_requests: +29967 pull_request: https://github.com/python/cpython/pull/31869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:38:23 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 14 Mar 2022 11:38:23 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1647257903.48.0.566926497223.issue40001@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya nosy_count: 3.0 -> 4.0 pull_requests: +29968 pull_request: https://github.com/python/cpython/pull/19214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:44:22 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 14 Mar 2022 11:44:22 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1647258262.97.0.278727892183.issue40001@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: -29968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:44:39 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 14 Mar 2022 11:44:39 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1647258279.98.0.546847583099.issue40001@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: -BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:54:32 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 11:54:32 +0000 Subject: [issue46994] Accept explicit contextvars.Context in asyncio create_task() API In-Reply-To: <1647081188.22.0.709370904314.issue46994@roundup.psfhosted.org> Message-ID: <1647258872.01.0.625123082346.issue46994@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:54:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 11:54:33 +0000 Subject: [issue46994] Accept explicit contextvars.Context in asyncio create_task() API In-Reply-To: <1647081188.22.0.709370904314.issue46994@roundup.psfhosted.org> Message-ID: <1647258873.52.0.337248445123.issue46994@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 9523c0d84f351a610dc651b234461eb015fa3b82 by Andrew Svetlov in branch 'main': bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API (GH-31837) https://github.com/python/cpython/commit/9523c0d84f351a610dc651b234461eb015fa3b82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 07:57:47 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 11:57:47 +0000 Subject: [issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio In-Reply-To: <1647249522.0.0.992096149336.issue47010@roundup.psfhosted.org> Message-ID: <1647259067.74.0.61472706544.issue47010@roundup.psfhosted.org> Andrew Svetlov added the comment: Known problem, PR is welcome! I expect the fix is not trivial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:07:12 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 12:07:12 +0000 Subject: [issue46843] PersistentTaskGroup API In-Reply-To: <1645680865.21.0.230450894933.issue46843@roundup.psfhosted.org> Message-ID: <1647259632.89.0.0043905915585.issue46843@roundup.psfhosted.org> Andrew Svetlov added the comment: I think we should close the PR now. I'm open to the discussion resurrection in Python 3.12 or 3.13, when aiotools implementation will be battle-tested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:48:09 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 14 Mar 2022 12:48:09 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647262089.03.0.641845640714.issue46987@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset bb1c543f4a183f5cfdf15aad59f59094d50b37fd by Dong-hee Na in branch 'main': bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835) https://github.com/python/cpython/commit/bb1c543f4a183f5cfdf15aad59f59094d50b37fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 08:48:17 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 14 Mar 2022 12:48:17 +0000 Subject: [issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId In-Reply-To: <1647007702.33.0.743675415066.issue46987@roundup.psfhosted.org> Message-ID: <1647262097.5.0.458379118234.issue46987@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:15:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 13:15:55 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1647263755.79.0.0437968597955.issue43215@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 649cc9d688f79765cf052429683b708678c26fbd by Illia Volochii in branch '3.9': [3.9] bpo-43215: Document Happy Eyeballs args of asyncio.open_connection (GH-24525) (GH-31868) https://github.com/python/cpython/commit/649cc9d688f79765cf052429683b708678c26fbd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:16:34 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 13:16:34 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1647263794.0.0.780267624484.issue43215@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset c6828408342cb1a2f8ba5038adccfbc1a95250cc by Illia Volochii in branch '3.10': [3.10] bpo-43215: Document Happy Eyeballs args of asyncio.open_connection (GH-24525) (GH-31869) https://github.com/python/cpython/commit/c6828408342cb1a2f8ba5038adccfbc1a95250cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:17:10 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 14 Mar 2022 13:17:10 +0000 Subject: [issue46991] Specialize list[slice] In-Reply-To: <1647058048.98.0.646431453049.issue46991@roundup.psfhosted.org> Message-ID: <1647263830.1.0.744122061667.issue46991@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +29969 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:40:36 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 14 Mar 2022 13:40:36 +0000 Subject: [issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio In-Reply-To: <1647249522.0.0.992096149336.issue47010@roundup.psfhosted.org> Message-ID: <1647265236.69.0.197200072776.issue47010@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +29970 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:40:43 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 14 Mar 2022 13:40:43 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647265243.09.0.917255402623.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset f00ced8396f2d7683e58b9d5ebbf5797992bf477 by Christian Heimes in branch 'main': bpo-40280: select: Use NULL for empty fdset (GH-31865) https://github.com/python/cpython/commit/f00ced8396f2d7683e58b9d5ebbf5797992bf477 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:56:59 2022 From: report at bugs.python.org (Aur Saraf) Date: Mon, 14 Mar 2022 13:56:59 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647266219.21.0.806558218353.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: Tarek, Are you still working on this? Would you like me to take over? Aur ---------- nosy: +Aur.Saraf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 09:56:58 2022 From: report at bugs.python.org (Shakeeb Alireza) Date: Mon, 14 Mar 2022 13:56:58 +0000 Subject: [issue42514] Relocatable framework for macOS In-Reply-To: <1606760917.9.0.450918621788.issue42514@roundup.psfhosted.org> Message-ID: <1647266218.77.0.404781733125.issue42514@roundup.psfhosted.org> Shakeeb Alireza added the comment: I have struggled with this exact issue in my py-js project (https://github.com/shakfu/py-js) which embeds a python3 interpreter in a max/msp plugin or in a relocatable folder (package) structure. For the latter case, Greg's solution, which is based on standard methods, has been absolutely crucial. Thank you! I have found that trying to do the same with a python distro built with --enable-shared is basically impossible because in this case sys.prefix is hardcoded and it dos not respond (like the framework structure) to the same @rpath methods used by Greg. It would be great for those who embed python for a fun or profit to have these issues addressed across all of the standard build structures. ---------- nosy: +shakfu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:00:05 2022 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 14 Mar 2022 14:00:05 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647266405.98.0.448906515551.issue45150@roundup.psfhosted.org> Tarek Ziad? added the comment: @Aur, go for it, I started to implement it and got lost into the details for each backend.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:09:41 2022 From: report at bugs.python.org (Learn Coding) Date: Mon, 14 Mar 2022 14:09:41 +0000 Subject: [issue47011] Cloned turtle pen is not cleared completely In-Reply-To: <1647253559.7.0.0341872922214.issue47011@roundup.psfhosted.org> Message-ID: <1647266981.79.0.483496211134.issue47011@roundup.psfhosted.org> Change by Learn Coding : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:22:50 2022 From: report at bugs.python.org (Shakeeb Alireza) Date: Mon, 14 Mar 2022 14:22:50 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1647267770.98.0.192594537141.issue18309@roundup.psfhosted.org> Shakeeb Alireza added the comment: I have exactly the same need and use-case as Mathias in my project which includes a requirement to embed python3 in a relocatable folder structure w which serves as an application package (https://github.com/shakfu/py-js). This can be done using the Framework structure, thanks to Greg Neagle's solution referenced in (https://bugs.python.org/issue42514), but not for any python builds with --enabled-shared. In any case, providing options (at the c-level or otherwise, for embedded applications as described by Mathias would be ideal: "I can imagine to provide several functions to build up the pythonpath starting from something. So say, have a 'get python path from argv[0]', a 'get python path from shared python library' and a 'get python path from prefix' function (I may miss a variant)." ---------- nosy: +shakfu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:13:50 2022 From: report at bugs.python.org (Aur Saraf) Date: Mon, 14 Mar 2022 14:13:50 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647267230.89.0.790460648583.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: OK, I'll give it a go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:27:17 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 14 Mar 2022 14:27:17 +0000 Subject: [issue46923] Implement stack overflow protection for supported platforms In-Reply-To: <1646412859.37.0.291420290315.issue46923@roundup.psfhosted.org> Message-ID: <1647268037.4.0.233380582823.issue46923@roundup.psfhosted.org> Ronald Oussoren added the comment: issue33955 is an older issue about implementing the current functionality for this on macOS, which has an API for querying stack limits. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:41:51 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 14 Mar 2022 14:41:51 +0000 Subject: [issue46991] Specialize list[slice] In-Reply-To: <1647058048.98.0.646431453049.issue46991@roundup.psfhosted.org> Message-ID: <1647268911.5.0.926063607236.issue46991@roundup.psfhosted.org> Ken Jin added the comment: Closed for now. See https://github.com/python/cpython/pull/31870#issuecomment-1066884537 for an explanation. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:47:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 14:47:14 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1647269234.14.0.955880883383.issue18309@roundup.psfhosted.org> STINNER Victor added the comment: In Python 3.11, Modules/getpath.c has been rewritten in Python: Modules/getpath.py. Maybe it's now simpler to hack this file. But you must rebuild Python to take changes in account. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 10:52:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 14:52:19 +0000 Subject: [issue37907] speed-up PyLong_As*() for large longs In-Reply-To: <1566404262.5.0.0996699211051.issue37907@roundup.psfhosted.org> Message-ID: <1647269539.0.0.766681228724.issue37907@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:03:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 15:03:05 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647270185.88.0.941703665631.issue47000@roundup.psfhosted.org> STINNER Victor added the comment: > So I think `encoding="locale"` should use real locale encoding (ACP on Windows) regardless UTF-8 mode is enabled or not. If you want to change the default, would it be possible to add a function to get this encoding? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:01:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 15:01:37 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647270097.22.0.570841017393.issue47000@roundup.psfhosted.org> STINNER Victor added the comment: There are multiple "locale encodings": * "current" locale encoding: locale.nl_langinfo(locale.CODESET) * "Python" locale encoding: locale.getpreferredencoding(False), ignore the locale in UTF-8 Mode (always return "UTF-8"), ignore the locale on Android and VxWorks (always return "UTF-8") * Python "filesystem" encoding: similar to the Python locale encoding, but always use UTF-8 on Android, macOS and VxWorks Include/pyport.h: --- #if defined(__ANDROID__) || defined(__VXWORKS__) // Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale. // See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale() // and PyUnicode_EncodeLocale(). # define _Py_FORCE_UTF8_LOCALE #endif #if defined(_Py_FORCE_UTF8_LOCALE) || defined(__APPLE__) // Use UTF-8 as the filesystem encoding. // See PyUnicode_DecodeFSDefaultAndSize(), PyUnicode_EncodeFSDefault(), // Py_DecodeLocale() and Py_EncodeLocale(). # define _Py_FORCE_UTF8_FS_ENCODING #endif --- See bpo-43552 "Add locale.get_locale_encoding() and locale.get_current_locale_encoding()" (rejected). Marc-Andre Lemburg dislikes locale.getpreferredencoding(False) API and suggested adding a new function locale.getencoding() with no argument: https://bugs.python.org/issue46659#msg412667 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:23:11 2022 From: report at bugs.python.org (Shakeeb Alireza) Date: Mon, 14 Mar 2022 15:23:11 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1647271391.34.0.542888165819.issue18309@roundup.psfhosted.org> Shakeeb Alireza added the comment: Thanks, Victor. I can imagine getpath.py will be more hackable (even if it is frozen). Still, it replicates the old algorithm: # Before any searches are done, the location of the executable is # determined. If Py_SetPath() was called, or if we are running on # Windows, the 'real_executable' path is used (if known). Otherwise, # we use the config-specified program name or default to argv[0]. In my case (and I think for Mathias), the executable is a non python application and what is actually dynamically linking to libpythonX.Y.dylib (built via --enable-shared) is a c-based plugin (which calls PyInitialize()), and these two are only aware of their relative locations via the @rpath, @loader_path mechanism. Currently, in this scenario, libpythonX.Y.dylib doesn't know here pythonhome is unless explicitly told via PySetPath() or it defaults to the hardcoded sys.prefix . If this is to be relocatable, then PySetPath() should be able to handle relative paths. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:42:46 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Mar 2022 15:42:46 +0000 Subject: [issue46843] PersistentTaskGroup API In-Reply-To: <1645680865.21.0.230450894933.issue46843@roundup.psfhosted.org> Message-ID: <1647272566.58.0.191538776132.issue46843@roundup.psfhosted.org> Guido van Rossum added the comment: Okay. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:49:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 15:49:20 +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: <1647272960.01.0.713910266159.issue37355@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:50:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 15:50:45 +0000 Subject: [issue40735] test_nntplib depends on unreliable external servers In-Reply-To: <1590181665.98.0.604811088124.issue40735@roundup.psfhosted.org> Message-ID: <1647273045.58.0.35080808684.issue40735@roundup.psfhosted.org> STINNER Victor added the comment: It tomorrow a test_nntplib test fails too often, I suggest to simply skip it, since PEP 594 is accepted. Especially tests using external real NNTP servers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:51:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 15:51:57 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647273117.22.0.404958023804.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 11c25b87aeed162d422bc18530fe9699f311e586 by Victor Stinner in branch 'main': bpo-46906: Mention native endian in PyFloat_Pack8() doc (GH-31866) https://github.com/python/cpython/commit/11c25b87aeed162d422bc18530fe9699f311e586 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 11:58:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 15:58:36 +0000 Subject: [issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API In-Reply-To: <1646276972.11.0.142101531058.issue46906@roundup.psfhosted.org> Message-ID: <1647273516.68.0.215343705282.issue46906@roundup.psfhosted.org> STINNER Victor added the comment: msgpack and bitstruct use the newly added functions: my two PRs got merged. msgpack was my main motivation to add these functions :-) Thanks to great reviews, the functions got a new better documentation! I close the issue. Thanks again for reviews! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:02:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:02:49 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1647273769.2.0.132384059418.issue46920@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e885ac3d5f2fd83617ab75a098aab269b7a446c3 by Oleg Iarygin in branch 'main': bpo-46920: Remove code that has no explainer why it was disabled (GH-31814) https://github.com/python/cpython/commit/e885ac3d5f2fd83617ab75a098aab269b7a446c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:03:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:03:30 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1647273810.47.0.400022925392.issue46920@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a52f82baf246e2fbbc58fe03ef7a51f3cc9514e1 by Oleg Iarygin in branch 'main': bpo-46920: Remove disabled debug code added decades ago and likely unnecessary (GH-31812) https://github.com/python/cpython/commit/a52f82baf246e2fbbc58fe03ef7a51f3cc9514e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:04:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:04:26 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1647273866.44.0.572402902347.issue46920@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 13b041222399152acb555337572bd1d571734984 by Oleg Iarygin in branch 'main': bpo-46920: Remove code that has explainers why it was disabled (GH-31813) https://github.com/python/cpython/commit/13b041222399152acb555337572bd1d571734984 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:05:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:05:14 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1647273914.98.0.160079399143.issue46920@roundup.psfhosted.org> STINNER Victor added the comment: Can this issue be closed? Or is there remaining dead code that you want to remove? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:12:53 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 14 Mar 2022 16:12:53 +0000 Subject: [issue46587] datetime and time tests use non-portable "%4Y" format In-Reply-To: <1643555688.39.0.0858908096334.issue46587@roundup.psfhosted.org> Message-ID: <1647274373.1.0.153323497853.issue46587@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +29971 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:14:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:14:07 +0000 Subject: [issue47013] 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10 Message-ID: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> New submission from STINNER Victor : Since build 298, test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10: https://buildbot.python.org/all/#/builders/694/builds/298 2 changes of build 298: * bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)(21 hours ago) * [3.10] bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31849)(21 hours ago) Logs: 0:02:03 load avg: 9.95 [213/427/1] test_distutils failed (uncaught exception) -- running: test_concurrent_futures (42.4 sec) test test_distutils crashed -- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py", line 335, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py", line 280, in _runtest_inner2 the_module = importlib.import_module(abstest) File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/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 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_distutils.py", line 15, in import distutils.tests ModuleNotFoundError: No module named 'distutils.tests' ====================================================================== FAIL: test_skip (test.test_bdb.StateTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_bdb.py", line 730, in test_skip with TracerRun(self, skip=skip) as tracer: File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_bdb.py", line 448, in __exit__ self.test_case.fail(err_msg) File "/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_bdb.py", line 582, in fail raise self.failureException(msg) from None AssertionError: Wrong event type at expect_set item 2, got 'call' Expected: ('line', 3, 'tfunc_import') Got: ('call', 84, 'find_spec'), ('quit',), ---------- components: Tests messages: 415157 nosy: vstinner priority: normal severity: normal status: open title: 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:15:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:15:17 +0000 Subject: [issue47013] 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10 In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647274517.54.0.662379672888.issue47013@roundup.psfhosted.org> STINNER Victor added the comment: Reproduce: $ ./configure --prefix /opt/py310 && make clean && make && make install $ cd /somewhere/else/ $ /opt/py310/bin/python3 -m test -v test_bdb ... FAIL: test_skip (test.test_bdb.StateTestCase) ... $ /opt/py310/bin/python3 -m test -v test_distutils ... ModuleNotFoundError: No module named 'distutils.tests' ... setuptools installs this file: $ cat /opt/py310/lib/python3.10/site-packages/distutils-precedence.pth import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'local') == 'local'; enabled and __import__('_distutils_hack').add_shim(); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:16:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:16:04 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647274564.11.0.553007310943.issue46986@roundup.psfhosted.org> STINNER Victor added the comment: This update broke the "s390x Fedora Rawhide Clang Installed 3.10" buildbot: bpo-47013. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:18:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:18:47 +0000 Subject: [issue47013] 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10 In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647274727.81.0.935250761907.issue47013@roundup.psfhosted.org> STINNER Victor added the comment: See: [BUG] Having setuptools installed causes cpython stdlib build to fail https://github.com/pypa/setuptools/issues/3007 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:21:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:21:51 +0000 Subject: [issue47013] test_bdb and test_distutils fail on installed Python 3.9 and 3.10 (setuptools 60.9.3, pip 22.0.4) In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647274911.04.0.824929036292.issue47013@roundup.psfhosted.org> STINNER Victor added the comment: x86 Gentoo Installed with X 3.9: https://buildbot.python.org/all/#builders/527/builds/474 4 tests failed: test_bdb test_distutils test_importlib test_peg_generator Python 3.9 gets two more issues: test_importlib and test_peg_generator. ====================================================================== FAIL: test_package_discovery (test.test_importlib.test_main.DiscoveryTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_importlib/test_main.py", line 159, in test_package_discovery assert all( AssertionError 0:06:27 load avg: 3.96 [ 83/425/3] test_peg_generator failed (uncaught exception) -- running: test_multiprocessing_forkserver (1 min 27 sec) Warning -- warnings.filters was modified by test_peg_generator Failed to import test module: test.test_peg_generator.test_c_parser Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/unittest/loader.py", line 436, in _find_test_path module = self._get_module_from_name(name) File "/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name __import__(name) File "/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_peg_generator/test_c_parser.py", line 4, in from distutils.tests.support import TempdirManager ModuleNotFoundError: No module named 'distutils.tests' ---------- title: 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10 -> test_bdb and test_distutils fail on installed Python 3.9 and 3.10 (setuptools 60.9.3, pip 22.0.4) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:23:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:23:16 +0000 Subject: [issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4) In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647274996.74.0.756199695694.issue47013@roundup.psfhosted.org> STINNER Victor added the comment: AMD64 Fedora Stable Clang Installed 3.x: https://buildbot.python.org/all/#builders/350/builds/1621 2 re-run tests: test_bdb test_distutils ---------- title: test_bdb and test_distutils fail on installed Python 3.9 and 3.10 (setuptools 60.9.3, pip 22.0.4) -> test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4) versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:24:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:24:14 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647275054.46.0.773331979061.issue46986@roundup.psfhosted.org> STINNER Victor added the comment: > This update broke the "s390x Fedora Rawhide Clang Installed 3.10" buildbot: bpo-47013. test_bdb and test_distutils fail on 3.9, 3.10 and main branches when run on an installed Python. I didn't check Python 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:26:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:26:11 +0000 Subject: [issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4) In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647275171.27.0.388818631953.issue47013@roundup.psfhosted.org> STINNER Victor added the comment: > $ ./configure --prefix /opt/py310 && make clean && make && make install > $ cd /somewhere/else/ > $ /opt/py310/bin/python3 -m test -v test_bdb I also reproduce test_bdb and test_distutils failures on the main branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:56:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:56:41 +0000 Subject: [issue45786] Avoid allocating when exiting frame; it may be unsafe. In-Reply-To: <1636643049.78.0.0321804916993.issue45786@roundup.psfhosted.org> Message-ID: <1647277001.96.0.076615551275.issue45786@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 2.0 -> 3.0 pull_requests: +29972 pull_request: https://github.com/python/cpython/pull/31874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:58:01 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 14 Mar 2022 16:58:01 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1647277081.18.0.199215421284.issue46920@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 12:59:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 16:59:42 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1647277182.13.0.681517074721.issue31415@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29973 pull_request: https://github.com/python/cpython/pull/31875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:02:40 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 17:02:40 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647277360.17.0.519544942843.issue46566@roundup.psfhosted.org> Steve Dower added the comment: > If it's already turning into a rewrite, how feasible would it be to adopt Brett's `py` launcher? I looked at it already, and I'd have to write literally the same code to implement what's needed :) (as well as learning Rust and convincing everyone to let us use Rust in CPython...). Practically nothing can be reused - there's no registry, no shebang handling, and our process launching on Windows is already very complex (and has to remain that way for compatibility). For now, the old launcher will remain to be used for venv redirectors, but I've got the setup in the new one to be able to play the same role, as well as potentially being able to be a script or .pyz launcher with a simple rename. If Brett's proposal for extensions (other executables on PATH that know how to identify Python installs) happens, we'll probably copy it, though PEP 514 covers Windows adequately (and the rewrite allows non-PythonCore installs to be found/launched). But the codebase itself isn't helpful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:03:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 17:03:07 +0000 Subject: [issue46920] Remove code made dead long ago with #if 0 In-Reply-To: <1646395996.16.0.71823057586.issue46920@roundup.psfhosted.org> Message-ID: <1647277387.0.0.846472682657.issue46920@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Oleg Iarygin for the cleanup! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:07:07 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 17:07:07 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1647203968.36.0.831675353594.issue46785@roundup.psfhosted.org> Message-ID: <1d71935a-ed86-3a1e-dfdc-9edc719dfe26@python.org> Steve Dower added the comment: >> Why can't the filename of the "foo"-like file in the test be >> simply os_helper.TESTFN, as done in some other tests? > > I suppose the current working directory will be fine. I was looking to keep the test on a NTFS filesystem, with known behavior, but there's no hard guarantee that the user's temp directory is on the system volume. All tests should use the current working directory, or the test helper for getting other directories. *Do not look up other directories*, because it prevents test runners from ensuring that tests run in valid locations (and skips implicit tests for directories with spaces/Unicode characters/etc.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:13:20 2022 From: report at bugs.python.org (Paul Moore) Date: Mon, 14 Mar 2022 17:13:20 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647278000.44.0.793548510026.issue46566@roundup.psfhosted.org> Paul Moore added the comment: > as well as potentially being able to be a script or .pyz launcher with a simple rename. Would it be possible to also make the launcher work when prepended to a zipfile? That's a really useful use-case (make a zipapp automatically runnable, but still a single file) that at the moment needs a 3rd party launcher (Vinay's simple-launcher project). If not, then that's fine, but if we're already doing a significant rewrite that might be a good time to add it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:14:48 2022 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 14 Mar 2022 17:14:48 +0000 Subject: [issue47014] ProactorEventLoop ignores Ctrl+C after closing unrelated loop Message-ID: <1647278088.02.0.528648197947.issue47014@roundup.psfhosted.org> New submission from Maximilian Hils : When a (second) ProactorEventLoop is garbage-collected, the current ProactorEventLoop starts to ignore Ctrl+C on Windows until it is woken up. The attached repro shows a minimal example. Uncommenting the `create_task` call or not using a second event loop fixes the behavior. I couldn't find any shared/global objects in asyncio/windows_events.py, so I'm not sure what is causing this, or why the wakeup task helps. FWIW, the second event loop in our code base originated from a stray `get_event_loop()` call, one more example that speaks in favor of `get_running_loop()`! ---------- components: asyncio files: proactor-repro.py messages: 415169 nosy: asvetlov, mhils, yselivanov priority: normal severity: normal status: open title: ProactorEventLoop ignores Ctrl+C after closing unrelated loop type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50675/proactor-repro.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:39:59 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Mar 2022 17:39:59 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1647279599.39.0.349715104225.issue31415@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 29624e769c5c3c1e59c6acc8b69383ead53e8a9f by Victor Stinner in branch 'main': bpo-31415: importtime was made by Inada Naoki (GH-31875) https://github.com/python/cpython/commit/29624e769c5c3c1e59c6acc8b69383ead53e8a9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:42:33 2022 From: report at bugs.python.org (Rocco Matano) Date: Mon, 14 Mar 2022 17:42:33 +0000 Subject: [issue47001] deadlock in ctypes? In-Reply-To: <1647153828.18.0.33672344904.issue47001@roundup.psfhosted.org> Message-ID: <1647279753.73.0.833554177412.issue47001@roundup.psfhosted.org> Rocco Matano added the comment: I forgot to say thank you. I would like to make up for that: Thank you, Eryk. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:46:33 2022 From: report at bugs.python.org (=?utf-8?q?Mathias_Fr=C3=B6hlich?=) Date: Mon, 14 Mar 2022 17:46:33 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1647279993.87.0.709167272467.issue18309@roundup.psfhosted.org> Mathias Fr?hlich added the comment: Hey, Shakeeb Alireza is right, the original problem was an application that links and embeds against libpython*{so,dll,dynlib} and should more easily find components like /*/lib*/python*.*/site.py and most probably now it needs to find getpath.py as well. While I am no longer working on that application where I wanted to have that feature, I still believe it would be worthwhile to find the *.py files in the file system relative to the location of the libpython*{so,dll,dynlib} file. Thanks for taking care. Mathias ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 13:59:21 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 17:59:21 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647280761.35.0.129342946866.issue46566@roundup.psfhosted.org> Steve Dower added the comment: I'd like to, the main challenge with that is it'd invalidate the code signature on the file, which will make it basically unusable (at the very least, you'll get warnings). A simple rename does not. But yeah, it can probably go in. Hopefully my restructure will make it easier to follow where certain things get checked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:01:05 2022 From: report at bugs.python.org (Darrel O'Pry) Date: Mon, 14 Mar 2022 18:01:05 +0000 Subject: [issue46950] Windows 11, VENV not working with case sensitive windows paths In-Reply-To: <1646677731.73.0.904643383001.issue46950@roundup.psfhosted.org> Message-ID: <1647280865.72.0.915528867642.issue46950@roundup.psfhosted.org> Darrel O'Pry added the comment: I've done some additional troubleshooting today. I have case sensitivity enabled in my git checkouts where I am creating the virtual env. I do this for a more consistent cross-platform experience for managing code with team members also using linux and macos. I have had issues in the past with case changes in filenames causing issue on projects and enabling case sensitivity has eliminate these issues when working with my counterparts on other platforms. I've tested the following with both powershell and bash. ``` mkdir test-venv-case-sensitivity cd test-venv-case-sensitivity fsutil.exe file setCaseSensitiveInfo . enable python -m venv ./venv ./venv/Scripts/Activate.ps1 pip # you should get the error "No module named 'pip' cd ./venv/ fsutil.exe file setCaseSensitiveInfo . disable pip # the command now works ``` This wasn't an issue prior to upgrading to Windows 11, so something may have changed in the handling of the case sensitivity flag on Windows. I have a venv created on windows 10, prior to my windows 11 upgrade that does work. I didn't encounter the issue until setting up an installation of Python 3.9.10 to support another project, then trying to create a new 3.10.2 venv. I can work around the issue by specifically disabling case sentitivity in my venv folders, but it would be nice if venvs worked out of the box with case sensitive filesytems on windows. It seems like some code is making assumptions about case sensitivity on windows. I found that if I disable case sensitivity in the venv folder, the venv starts working again. ---------- title: Windows 11 venv -> Windows 11, VENV not working with case sensitive windows paths _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:04:51 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 18:04:51 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1647281091.27.0.761443021613.issue46890@roundup.psfhosted.org> Steve Dower added the comment: The sys module gets initialised in _PySys_UpdateConfig() in Python/sysmodule.c. It gets called later in pylifecycle.c. But it ought to just copy directly from the config. However, it's the site.py module that actually updates sys.prefix for the venv. So you may just be inspecting at the wrong point? Or possibly it's in a codepath that doesn't run on macOS because *previously* it was being set correctly in getpath instead of being deferred until later? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:05:59 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 14 Mar 2022 18:05:59 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1645174237.48.0.436213701589.issue46785@roundup.psfhosted.org> Message-ID: <1647281159.04.0.437387408713.issue46785@roundup.psfhosted.org> Eryk Sun added the comment: I was following the pattern of StatAttributeTests.test_access_denied(), which uses the current user's temp directory to get a filesystem that supports security. It would probably be better to skip tests if the filesystem of the current working directory doesn't support the test, e.g. if it needs NTFS or needs support for security, hard links, or reparse points. For example, Win32JunctionTests should be skipped if reparse points aren't supported. The os_helper module could implement a function that calls GetVolumeInformationW() to get the filesystem name (e.g. "Ntfs") and flags (e.g. FILE_PERSISTENT_ACLS, FILE_SUPPORTS_HARD_LINKS, FILE_SUPPORTS_REPARSE_POINTS). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 14:14:11 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 18:14:11 +0000 Subject: [issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file In-Reply-To: <1647281159.04.0.437387408713.issue46785@roundup.psfhosted.org> Message-ID: <2417718c-d07f-74b5-c939-01d57dfd746b@python.org> Steve Dower added the comment: > It would probably be better to skip tests if the filesystem of the current working directory doesn't support the test, Yes, this would be good. Then whoever is configuring the test runner can move where tests are run to make sure it is supported. There are command line options specifically for this, that also correctly handle multiprocessing. Tests that bypass the CWD make this unfixable by the runner, which is why they should just use CWD. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:07:21 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 14 Mar 2022 19:07:21 +0000 Subject: [issue47008] Add Lib/site-packages to .gitignore In-Reply-To: <1647228113.84.0.370767511712.issue47008@roundup.psfhosted.org> Message-ID: <1647284841.01.0.583436364425.issue47008@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:35:55 2022 From: report at bugs.python.org (Brett Cannon) Date: Mon, 14 Mar 2022 19:35:55 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647286555.4.0.197486582206.issue46566@roundup.psfhosted.org> Brett Cannon added the comment: "Practically nothing can be reused - there's no registry, no shebang handling, and our process launching on Windows is already very complex (and has to remain that way for compatibility)." I do process the shebang to restrict searching, or did you mean something else? And registry support [is planned](https://github.com/brettcannon/python-launcher/issues/15). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:57:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Mar 2022 19:57:23 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1647287843.01.0.103409273905.issue30677@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 879fbd9472753149b627f32add3ddca90ac47ab7 by slateny in branch 'main': bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError (GH-31548) https://github.com/python/cpython/commit/879fbd9472753149b627f32add3ddca90ac47ab7 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:57:31 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 19:57:31 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1647287851.82.0.0446710318445.issue30677@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +29974 pull_request: https://github.com/python/cpython/pull/31877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 15:57:36 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 19:57:36 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1647287856.44.0.337220314892.issue30677@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29975 pull_request: https://github.com/python/cpython/pull/31878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:05:08 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:05:08 +0000 Subject: [issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4) In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647288308.38.0.238636781621.issue47013@roundup.psfhosted.org> Ned Deily added the comment: (The buildbot failures were triggered by yesterday's merges for Issue46986 which updated the bundled setuptools in ensurepip. I'm reverting those merges now to unblock planned releases.) ---------- nosy: +jaraco, ned.deily versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:05:43 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 20:05:43 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647288343.41.0.408992132133.issue46566@roundup.psfhosted.org> Steve Dower added the comment: > I do process the shebang to restrict searching, or did you mean something else? That's what I meant. Guess I missed seeing it when scanning the code (probably I should've read the docs :D ) > And registry support [is planned](https://github.com/brettcannon/python-launcher/issues/15). It's attached to a milestone with no due date and 0% completion ;) Being aware that you'll need to do it isn't the same as planning to do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:08:17 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:08:17 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647288497.65.0.00597424556626.issue46986@roundup.psfhosted.org> Ned Deily added the comment: My apologies for not testing running the test suite with installed Pythons as I usually do and thanks, Victor, for noting the buildbot failures. I'm reverting these setuptools updates to avoid blocking releases. We can track the issue with setuptools in bpo-47013. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:09:59 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:09:59 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647288599.84.0.538530232731.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29976 pull_request: https://github.com/python/cpython/pull/31879 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:14:58 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 14 Mar 2022 20:14:58 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647288898.14.0.894310120139.issue46975@roundup.psfhosted.org> Andrei Kulakov added the comment: I've had the same issue and fixed it with: brew remove --ignore-dependencies gettext @Ned thanks for help! ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:24:23 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:24:23 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647289463.66.0.742656057529.issue46975@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:30:50 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:30:50 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647289850.83.0.872428417523.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset 19f69993ae97db0bbea3b845a33b060b73b658b3 by Ned Deily in branch 'main': Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31879) https://github.com/python/cpython/commit/19f69993ae97db0bbea3b845a33b060b73b658b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:36:23 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:36:23 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647290183.42.0.848213138959.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29977 pull_request: https://github.com/python/cpython/pull/31880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:38:01 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 14 Mar 2022 20:38:01 +0000 Subject: [issue47015] Update tests from asyncore to asyncio Message-ID: <1647290281.28.0.271890781969.issue47015@roundup.psfhosted.org> New submission from Oleg Iarygin : PEP 594 ? Removing dead batteries from the standard library [1] removes asyncore and asynchat in 3.12 with the following note: > The asyncore module is also used in stdlib tests. The tests for ftplib, logging, smptd, smtplib, and ssl are partly based on asyncore. These tests must be updated to use asyncio or threading. (Note: the tests for `os` module are not mentioned and smtpd will be removed in 3.12 along with its tests anyway) I'm performing the update now to avoid keeping asynchat and asyncore as private subpackages of `test` package. [1] https://peps.python.org/pep-0594/ ---------- components: Tests messages: 415185 nosy: arhadthedev priority: normal severity: normal status: open title: Update tests from asyncore to asyncio type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:40:15 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 14 Mar 2022 20:40:15 +0000 Subject: [issue47015] Update tests from asyncore to asyncio In-Reply-To: <1647290281.28.0.271890781969.issue47015@roundup.psfhosted.org> Message-ID: <1647290415.88.0.570256485789.issue47015@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +29978 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:44:47 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:44:47 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647290687.31.0.945507401211.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29979 pull_request: https://github.com/python/cpython/pull/31881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:51:01 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 20:51:01 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1647291061.56.0.899340274978.issue30677@roundup.psfhosted.org> miss-islington added the comment: New changeset efa72501599029d9ac3f8a2e5ce900302c7d8f56 by Miss Islington (bot) in branch '3.10': [3.10] bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError (GH-31548) (GH-31877) https://github.com/python/cpython/commit/efa72501599029d9ac3f8a2e5ce900302c7d8f56 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:52:16 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 20:52:16 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1647291136.67.0.431059077656.issue30677@roundup.psfhosted.org> miss-islington added the comment: New changeset b4fd91b4d931dd97ceaf76750d227dd042c236f8 by Miss Islington (bot) in branch '3.9': [3.9] bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError (GH-31548) (GH-31878) https://github.com/python/cpython/commit/b4fd91b4d931dd97ceaf76750d227dd042c236f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:52:25 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 20:52:25 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647291145.94.0.385808759598.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29980 pull_request: https://github.com/python/cpython/pull/31882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 16:53:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Mar 2022 20:53:04 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1647291184.66.0.443571034593.issue30677@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:01:20 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 21:01:20 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647291680.28.0.164831076443.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset 80cc10fa7d5f41daaf59ae9173022303f35a403c by Ned Deily in branch '3.7': Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31882) https://github.com/python/cpython/commit/80cc10fa7d5f41daaf59ae9173022303f35a403c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:05:39 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 21:05:39 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1647291939.38.0.963143945347.issue31415@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +29981 pull_request: https://github.com/python/cpython/pull/31883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:05:44 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 21:05:44 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1647291944.01.0.831922265074.issue31415@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29982 pull_request: https://github.com/python/cpython/pull/31884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:08:35 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 21:08:35 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647292115.77.0.945311614625.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset 0cfcc0cbee4a0d48c412169f46b7199728fb298a by Ned Deily in branch '3.10': Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31880) https://github.com/python/cpython/commit/0cfcc0cbee4a0d48c412169f46b7199728fb298a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:10:24 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 21:10:24 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647292224.86.0.150392519402.issue46986@roundup.psfhosted.org> Ned Deily added the comment: New changeset 1b1239205d1b7ace1b054477c14fe77d54f471c4 by Ned Deily in branch '3.9': Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31881) https://github.com/python/cpython/commit/1b1239205d1b7ace1b054477c14fe77d54f471c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:12:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Mar 2022 21:12:17 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647292337.68.0.344796925291.issue46986@roundup.psfhosted.org> STINNER Victor added the comment: Ned Deily: > My apologies for not testing running the test suite with installed Pythons as I usually do and thanks, Victor, for noting the buildbot failures. Well, the change didn't land into a Python release. Right now, the test suite is only run on an installed Python on buildbots. The regression was noticed early, so it's fine. Yeah, a revert is better to unblock the releases, to have more time to investigate what's going on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:15:11 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 14 Mar 2022 21:15:11 +0000 Subject: [issue46986] Upgrade ensurepip bundled setuptools to 60.9.3 In-Reply-To: <1647006465.36.0.073605933611.issue46986@roundup.psfhosted.org> Message-ID: <1647292511.49.0.745810275705.issue46986@roundup.psfhosted.org> Change by Ned Deily : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:17:31 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 21:17:31 +0000 Subject: [issue46950] Windows 11, VENV not working with case sensitive windows paths In-Reply-To: <1646677731.73.0.904643383001.issue46950@roundup.psfhosted.org> Message-ID: <1647292651.34.0.0957525407655.issue46950@roundup.psfhosted.org> Steve Dower added the comment: As a quick (wild) guess, is it expecting the "Lib" directory to be lowercase "lib"? Could you try renaming that directory in your venv and see if it changes anything? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:21:37 2022 From: report at bugs.python.org (Illia Volochii) Date: Mon, 14 Mar 2022 21:21:37 +0000 Subject: [issue47016] Create a test verifying bundled pip and setuptools wheels Message-ID: <1647292897.69.0.328290401406.issue47016@roundup.psfhosted.org> New submission from Illia Volochii : Bundled pip and setuptools wheels have to be verified manually at the moment when they are upgraded. We can automate this by comparing their checksums to ones provided by Warehouse?s JSON API (e.g., https://pypi.org/pypi/pip/json.) Since such a check requires network activity and not to slow down tests, creating a GitHub Actions workflow that runs only when the files are changed is a good option. I suggested this in https://github.com/python/cpython/pull/30178#issuecomment-998765841 originally. ---------- components: Library (Lib) messages: 415193 nosy: illia-v priority: normal severity: normal status: open title: Create a test verifying bundled pip and setuptools wheels type: enhancement 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 Mar 14 17:24:53 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 21:24:53 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1647293093.93.0.844705189522.issue31415@roundup.psfhosted.org> miss-islington added the comment: New changeset 9f1587e8d3f18729a0982774c6c4409472cbd9e3 by Miss Islington (bot) in branch '3.10': bpo-31415: importtime was made by Inada Naoki (GH-31875) https://github.com/python/cpython/commit/9f1587e8d3f18729a0982774c6c4409472cbd9e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:29:36 2022 From: report at bugs.python.org (Illia Volochii) Date: Mon, 14 Mar 2022 21:29:36 +0000 Subject: [issue47016] Create a test verifying bundled pip and setuptools wheels In-Reply-To: <1647292897.69.0.328290401406.issue47016@roundup.psfhosted.org> Message-ID: <1647293376.08.0.299188036567.issue47016@roundup.psfhosted.org> Change by Illia Volochii : ---------- keywords: +patch pull_requests: +29983 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:29:52 2022 From: report at bugs.python.org (Darrel O'Pry) Date: Mon, 14 Mar 2022 21:29:52 +0000 Subject: [issue46950] Windows 11, VENV not working with case sensitive windows paths In-Reply-To: <1646677731.73.0.904643383001.issue46950@roundup.psfhosted.org> Message-ID: <1647293392.63.0.0995272725039.issue46950@roundup.psfhosted.org> Darrel O'Pry added the comment: renaming Lib to lib seems to also resolve the problem... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:30:22 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 21:30:22 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1647293422.38.0.322095264188.issue31415@roundup.psfhosted.org> miss-islington added the comment: New changeset 73943ce7d31595d152dc01bf0008b37c802c0d3b by Miss Islington (bot) in branch '3.9': bpo-31415: importtime was made by Inada Naoki (GH-31875) https://github.com/python/cpython/commit/73943ce7d31595d152dc01bf0008b37c802c0d3b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:36:11 2022 From: report at bugs.python.org (Darrel O'Pry) Date: Mon, 14 Mar 2022 21:36:11 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1647293771.41.0.225196044801.issue42863@roundup.psfhosted.org> Darrel O'Pry added the comment: steve, I would be willing to champion this change. The process seems pretty straightforward. Create a release that creates the consistent layout on windows, symlinks the legacy paths, and adds some deprecation warnings. Then in a later release remove the symlinks and deprecation warnings.. Any way you would be willing to guide me through the process? ---------- nosy: +darrel.opry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:37:49 2022 From: report at bugs.python.org (Illia Volochii) Date: Mon, 14 Mar 2022 21:37:49 +0000 Subject: [issue47016] Create a test verifying bundled pip and setuptools wheels In-Reply-To: <1647292897.69.0.328290401406.issue47016@roundup.psfhosted.org> Message-ID: <1647293869.06.0.601874049748.issue47016@roundup.psfhosted.org> Change by Illia Volochii : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 17:54:30 2022 From: report at bugs.python.org (Eric Vergnaud) Date: Mon, 14 Mar 2022 21:54:30 +0000 Subject: [issue45336] xml.etree.ElementTree.write does not support `standalone` option In-Reply-To: <1633031921.76.0.241035024911.issue45336@roundup.psfhosted.org> Message-ID: <1647294870.73.0.201105110471.issue45336@roundup.psfhosted.org> Eric Vergnaud added the comment: This is not a feature request, it's a bug fix request, so should be fixed asap. Why is it a bug ? XML spec says that "the default namespace does not apply to attribute names" (see section 6.3), therefore having a simple attribute name when using a default namespace is a perfectly valid scenario. Raising a ValueError in add_qname (line 864) is therefore incorrect if the qname being added is a simple name of an attribute not sure if lxml is able to parse very large documents (>4g) but I'll try it ---------- nosy: +ericvergnaud _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:00:39 2022 From: report at bugs.python.org (Eric Vergnaud) Date: Mon, 14 Mar 2022 22:00:39 +0000 Subject: [issue45336] xml.etree.ElementTree.write does not support `standalone` option In-Reply-To: <1633031921.76.0.241035024911.issue45336@roundup.psfhosted.org> Message-ID: <1647295239.19.0.45451519505.issue45336@roundup.psfhosted.org> Eric Vergnaud added the comment: lxml tostring does not support the default_namespace value so not an option ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:01:02 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 22:01:02 +0000 Subject: [issue47014] ProactorEventLoop ignores Ctrl+C after closing unrelated loop In-Reply-To: <1647278088.02.0.528648197947.issue47014@roundup.psfhosted.org> Message-ID: <1647295262.68.0.418150334924.issue47014@roundup.psfhosted.org> Andrew Svetlov added the comment: Ctrl-C handling is added by #23057 It uses signal.set_wakeup_fd() https://github.com/asvetlov/cpython/blob/main/Lib/asyncio/proactor_events.py#L631-L634 So, the last event loop steals Ctrl+C handling. Not sure if we can improve it. Running two concurrent loops in the same thread is a bad idea for many reasons. Ctrl+C is not the only reason. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:19:11 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 22:19:11 +0000 Subject: [issue46950] Windows 11, VENV not working with case sensitive windows paths In-Reply-To: <1646677731.73.0.904643383001.issue46950@roundup.psfhosted.org> Message-ID: <1647296351.06.0.832121045184.issue46950@roundup.psfhosted.org> Steve Dower added the comment: Okay, so that means there's some code somewhere that has a lowercase "lib". If you change it back to "Lib", can you do "python -m pip"? If that works, but a direct "pip" does not, it'll be an issue in pip (or a dependency), as those executables are generated by them. There are likely many places where we rely on case-insensitivity throughout the codebase though, and certainly a number of places where we unconditionally casefold on Windows before doing comparisons. It's going to take a decent amount of time to track these down, and may not always be feasible, but if we can start enumerating them then it's worth making the fixes. ---------- versions: +Python 3.11 -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:25:29 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Mar 2022 22:25:29 +0000 Subject: [issue42863] Python venv inconsistent folder structure on windows In-Reply-To: <1610068238.28.0.631501714908.issue42863@roundup.psfhosted.org> Message-ID: <1647296729.0.0.377754072225.issue42863@roundup.psfhosted.org> Steve Dower added the comment: Considering you've just been encountering issues with mismatched case, you're likely aware of how much harder that will make it to fix. First you'll need a proposal on how to ensure deprecation warnings reach those who need them. I'd suggest for "Scripts"->"bin", you'll need to generate different stubs in "Scripts" that warn when they are called, but not the ones in "bin". This alone affects enough of the ecosystem to need a PEP and a lot of coordination. It's not a simple change - sure you're ready for it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:25:32 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Mar 2022 22:25:32 +0000 Subject: [issue47017] frozen modules are on by default in dev build Message-ID: <1647296732.49.0.681504882715.issue47017@roundup.psfhosted.org> New submission from Guido van Rossum : At least on Windows and macOS, this repro shows that frozen modules are on in a dev build: Mac: ~/cpython$ ./python.exe -c 'import os; print(os._exists.__code__)' ", line 41> ~/cpython$ ./python.exe -Xfrozen_modules=off -c 'import os; print(os._exists.__code__)' On Windows, the same except use .\python.bat. ---------- messages: 415203 nosy: eric.snow, gvanrossum priority: normal severity: normal status: open title: frozen modules are on by default in dev build _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:25:59 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Mar 2022 22:25:59 +0000 Subject: [issue47017] frozen modules are on by default in dev build In-Reply-To: <1647296732.49.0.681504882715.issue47017@roundup.psfhosted.org> Message-ID: <1647296759.21.0.399677039318.issue47017@roundup.psfhosted.org> Change by Guido van Rossum : ---------- type: -> behavior versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:29:44 2022 From: report at bugs.python.org (Eric Vergnaud) Date: Mon, 14 Mar 2022 22:29:44 +0000 Subject: [issue45336] xml.etree.ElementTree.write does not support `standalone` option In-Reply-To: <1633031921.76.0.241035024911.issue45336@roundup.psfhosted.org> Message-ID: <1647296984.72.0.115932564242.issue45336@roundup.psfhosted.org> Eric Vergnaud added the comment: Actually there are 2 distinct issues here: - ValueError: cannot use non-qualified names with default_namespace option - lack of 'standalone' option when writing XML PI ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:37:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 22:37:35 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647297455.0.0.267562128233.issue43253@roundup.psfhosted.org> Andrew Svetlov added the comment: Maximilian, thanks for the investigation. A check for 'fileno != -1' seems correct to me. Would you prepare a pull request? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:41:25 2022 From: report at bugs.python.org (AverseMoon54797) Date: Mon, 14 Mar 2022 22:41:25 +0000 Subject: [issue47018] ImportError: cannot import name '_simple_enum' from 'enum' Message-ID: <1647297685.19.0.68502356884.issue47018@roundup.psfhosted.org> New submission from AverseMoon54797 : Why is this happening? Is there a fix for this I can't even fix the install because I get this error trying to reinstall cpython. ---------- messages: 415206 nosy: AverseMoon priority: normal severity: normal status: open title: ImportError: cannot import name '_simple_enum' from 'enum' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:50:24 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 14 Mar 2022 22:50:24 +0000 Subject: [issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers In-Reply-To: <1485909545.04.0.650924943503.issue29406@psf.upfronthosting.co.za> Message-ID: <1647298224.01.0.228570088988.issue29406@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 18:51:50 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 14 Mar 2022 22:51:50 +0000 Subject: [issue47018] ImportError: cannot import name '_simple_enum' from 'enum' In-Reply-To: <1647297685.19.0.68502356884.issue47018@roundup.psfhosted.org> Message-ID: <1647298310.49.0.770997876549.issue47018@roundup.psfhosted.org> Steven D'Aprano added the comment: What makes you think you are supposed to be able to import _simple_enum? It is a name with a leading underscore, so even if it exists, it is private and you shouldn't touch it. Unless _simple_enum is documented as something you can use, this is not a bug and there is nothing to fix. I don't see "_simple_enum" listed anywhere in the enum documentation, so why do you think you should be able to import it? https://docs.python.org/3/library/enum.html By the way, "reinstall Python" is almost never the solution to problems. Why do you think you need to "fix the install"? ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:00:30 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 14 Mar 2022 23:00:30 +0000 Subject: [issue35844] Calling `Multiprocessing.Queue.close()` too quickly causes intermittent failure (BrokenPipeError) In-Reply-To: <1548707332.73.0.0560406738777.issue35844@roundup.psfhosted.org> Message-ID: <1647298830.29.0.953178706707.issue35844@roundup.psfhosted.org> Change by G?ry : ---------- nosy: +maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:27:54 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 14 Mar 2022 23:27:54 +0000 Subject: [issue47016] Create a test verifying bundled pip and setuptools wheels In-Reply-To: <1647292897.69.0.328290401406.issue47016@roundup.psfhosted.org> Message-ID: <1647300474.1.0.00506950667014.issue47016@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:29:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Mar 2022 23:29:05 +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: <1647300545.65.0.650329908884.issue43721@roundup.psfhosted.org> Irit Katriel added the comment: New changeset e3d348a5252549708fd19338b675a2c23b60d677 by Irit Katriel in branch 'main': bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046) https://github.com/python/cpython/commit/e3d348a5252549708fd19338b675a2c23b60d677 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:29:41 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 23:29:41 +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: <1647300581.7.0.972066711593.issue43721@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +29984 pull_request: https://github.com/python/cpython/pull/31886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:29:45 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 23:29:45 +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: <1647300585.82.0.877095887901.issue43721@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29985 pull_request: https://github.com/python/cpython/pull/31887 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:33:15 2022 From: report at bugs.python.org (Jeremiah Gabriel Pascual) Date: Mon, 14 Mar 2022 23:33:15 +0000 Subject: [issue47012] Speed up iteration of bytes and bytearray In-Reply-To: <1647256405.01.0.318214910817.issue47012@roundup.psfhosted.org> Message-ID: <1647300795.5.0.0351549052735.issue47012@roundup.psfhosted.org> Change by Jeremiah Gabriel Pascual : ---------- nosy: +Crowthebird _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:52:04 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 23:52:04 +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: <1647301924.86.0.395845036404.issue43721@roundup.psfhosted.org> miss-islington added the comment: New changeset cebdc325580b49f4c7eb3c61a24c9e7f41ca736b by Miss Islington (bot) in branch '3.10': bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046) https://github.com/python/cpython/commit/cebdc325580b49f4c7eb3c61a24c9e7f41ca736b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:55:22 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Mar 2022 23:55:22 +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: <1647302122.3.0.660787962815.issue43721@roundup.psfhosted.org> miss-islington added the comment: New changeset f1a5e1b89a526da0d66c5b368c924298291abb1a by Miss Islington (bot) in branch '3.9': bpo-43721: Fix docstrings for property.getter/setter/deleter (GH-31046) https://github.com/python/cpython/commit/f1a5e1b89a526da0d66c5b368c924298291abb1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 19:57:16 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 14 Mar 2022 23:57:16 +0000 Subject: [issue46950] Windows 11, VENV not working with case sensitive windows paths In-Reply-To: <1646677731.73.0.904643383001.issue46950@roundup.psfhosted.org> Message-ID: <1647302236.28.0.187800952169.issue46950@roundup.psfhosted.org> Eryk Sun added the comment: In 3.10, you should be able to work around the problem for the venv site-packages directory by setting the environment variable "PYTHONPLATLIBDIR" to "Lib". This sets sys.platlibdir, which the site module uses to create the site-packages directory. The default value is "lib", which isn't properly capitalized. In 3.11, sys.platlibdir defaults to "DLLs" in Windows, and the site module ignores this attribute. However, the site module does hard code the properly capitalized value "Lib". In POSIX, sys.platlibdir (e.g. "lib" or "lib64") is a common base directory for the standard library and its extension modules. It isn't just the directory for extension modules, as might be implied by changing the value to "DLLs" in Windows. The "DLLs" directory in Windows Python is split off from "Lib" (for some legacy reason, I suppose), so Windows would need separate sys.platlibdir ("Lib") and sys.platextdir ("DLLs") values, if that mattered, which it doesn't since the names are fixed. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:12:50 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 15 Mar 2022 00:12:50 +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: <1647303170.97.0.748018860878.issue43721@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:18:22 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 00:18:22 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 Message-ID: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> New submission from hydroflask : _destructor in connection.c in Python 3.10+ now calls `PyGILState_Ensure()`, this is a problem because if the destructor is being called while the thread is being torn down it will cause an unbalanced/erroneous call to "PyEval_RestoreThread" in PyGILState_Ensure which will eventually trigger a Fatal Python Error. A perfect repro has been attached, should be run on Linux. My recommended fix is to call sqlite3_close() within Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, and manually Py_DECREF all connection-related functions afterward. ---------- components: Extension Modules, Library (Lib) files: sqlite3_fatal_python_error.py messages: 415212 nosy: erlendaasland, hydroflask priority: normal severity: normal status: open title: Fatal Python Error in sqlite3 Python 3.10 type: crash versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50676/sqlite3_fatal_python_error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 20:45:19 2022 From: report at bugs.python.org (Pablo Dumas) Date: Tue, 15 Mar 2022 00:45:19 +0000 Subject: [issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation). Message-ID: <1647305119.03.0.119079591211.issue47020@roundup.psfhosted.org> New submission from Pablo Dumas : float('nan')==math.nan does NOT evaluate to True (as suggested by documentation). On the other hand, float('inf')==math.inf DOES evaluate to True (as suggested by documentation). Documentation we're referring to: https://docs.python.org/3.8/library/math.html ---------- assignee: docs at python components: Documentation messages: 415213 nosy: docs at python, w0rthle$$ priority: normal severity: normal status: open title: float('nan')==math.nan does NOT evaluate to True (as suggested by documentation). type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 21:05:59 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 15 Mar 2022 01:05:59 +0000 Subject: [issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation). In-Reply-To: <1647305119.03.0.119079591211.issue47020@roundup.psfhosted.org> Message-ID: <1647306359.09.0.145976532589.issue47020@roundup.psfhosted.org> Jelle Zijlstra added the comment: I'm guessing you're referring to https://docs.python.org/3.8/library/math.html#math.nan. The text says explicitly that math.nan is "equivalent" to float("nan"), not that it is equal. This is correct. nan is not equal to itself, because (for better or worse) that's what the IEEE standard requires. You can instead use math.isnan() to check whether a number is a nan. ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 21:21:51 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 15 Mar 2022 01:21:51 +0000 Subject: [issue47020] float('nan')==math.nan does NOT evaluate to True (as suggested by documentation). In-Reply-To: <1647305119.03.0.119079591211.issue47020@roundup.psfhosted.org> Message-ID: <1647307311.37.0.872001714055.issue47020@roundup.psfhosted.org> Eric V. Smith added the comment: Jelle gives the correct reason for what you're seeing. Also note: >>> math.nan == math.nan False >>> float('nan') == float('nan') False If there's some specific part of the documentation that you think is misleading, please reopen this and point us to the wording that's confusing. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 21:37:46 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 01:37:46 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647308266.18.0.526596478589.issue47019@roundup.psfhosted.org> hydroflask added the comment: If you connect to the sqlite3 database in the example without using the factory, it will simply segfault. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 21:57:55 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 15 Mar 2022 01:57:55 +0000 Subject: [issue47015] Update tests from asyncore to asyncio In-Reply-To: <1647290281.28.0.271890781969.issue47015@roundup.psfhosted.org> Message-ID: <1647309475.64.0.472957628279.issue47015@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +asvetlov, giampaolo.rodola, josiahcarlson, stutzbach, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 14 22:10:46 2022 From: report at bugs.python.org (Duck) Date: Tue, 15 Mar 2022 02:10:46 +0000 Subject: [issue47021] Add separate match and case doc to pydoc Message-ID: <1647310246.64.0.911179917615.issue47021@roundup.psfhosted.org> New submission from Duck : Currently pydoc (and therefore things like the interactive help prompt) do not have documentation for the soft-keywords "match" and "case". ``` help> match No Python documentation found for 'match'. Use help() to get the interactive help utility. Use help(str) for help on the str class. ``` I think that it would make sense for both of these prompts to give the docs for the match statement (https://docs.python.org/3/reference/compound_stmts.html#the-match-statement) similar to the other compound statements. The "compound" doc already contains the match statement documentation, but is unnecessarily long at over 48000 characters, and is only accessed by the unhelpful named for this purpose "LOOPING" prompt. As soft keywords, they also might be best added in a separate section in "keywords" (and potentially with "_", although this already refers to "PRIVATENAMES" and is in "symbols"). A standalone match and case doc is not currently present in the Lib/pydoc_data/topics.py file automatically generated from documentation, and would need to be added in some way to do this. ---------- components: Library (Lib) messages: 415217 nosy: duckboycool priority: normal severity: normal status: open title: Add separate match and case doc to pydoc type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 01:34:35 2022 From: report at bugs.python.org (Shakeeb Alireza) Date: Tue, 15 Mar 2022 05:34:35 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1647322475.98.0.0319302483422.issue18309@roundup.psfhosted.org> Shakeeb Alireza added the comment: Thanks, Mathias. This is all about improving python's 'relocatability'. Just to expand on my prior point: the scenario we are talking about is where one embeds python in a host application's plugin system rather than in the host application itself. In this case, sys.executable is the host application and a relocatable plugin embeds a 'python client'. If a full python distribution is not bundled within this client[*], it needs to (1) link to libpythonX.Y.dylib and (2) get the location of the standard library. There are standard cross-platform methods for (1) to be achieved by way of symmetrical @rpath lookups on the client and libpythonX.Y.dylib sides. So this resolvable even in the case when python is compiled with --enabled-shared. However, even if (1) is achieved, the client cannot get, programmatically via the python c-api, the location of libpythonX.Y.dylib (even if it is properly dynamically linking to it), because it cannot rely on sys.executable. I think this is crux of Mathias' argument. Of course there are workarounds, but they are (at least to me) all platform specific. The first and easiest is to just build using the Framework structure and don't ever use --enable-shared, provided you find Greg Neagle's solution (https://bugs.python.org/issue42514) Another workaround which is specific to my context (which I have attached), is to use Apple's CoreFoundation library to get the path to the plugin bundle and from there find our way to the python distribution in the containing folder structure (package). [*] It is possible to insert a full python distribution into a bundle (in the osx meaning), but then it becomes necessarily frozen or 'sealed' due to Apple's codesigning and notarization requirements, and it basically means that the user cannot extend it with further installations of python packages which contain c-extensions unless they jump through some additional codesigning and notarization hoops. ---------- Added file: https://bugs.python.org/file50677/workaround.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 01:36:00 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 15 Mar 2022 05:36:00 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1647322560.59.0.82465327226.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29986 pull_request: https://github.com/python/cpython/pull/31888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:00:47 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 07:00:47 +0000 Subject: [issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch In-Reply-To: <1633611397.74.0.642629173294.issue45405@roundup.psfhosted.org> Message-ID: <1647327647.77.0.634007720576.issue45405@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29987 pull_request: https://github.com/python/cpython/pull/31889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:02:59 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 07:02:59 +0000 Subject: [issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch In-Reply-To: <1633611397.74.0.642629173294.issue45405@roundup.psfhosted.org> Message-ID: <1647327779.46.0.890597964185.issue45405@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +29988 pull_request: https://github.com/python/cpython/pull/31890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:11:15 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 15 Mar 2022 07:11:15 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647328275.86.0.375590054328.issue47000@roundup.psfhosted.org> Inada Naoki added the comment: I created another topic relating this issue. https://discuss.python.org/t/add-legacy-text-encoding-option-to-make-utf-8-default/14281 If we add another option (e.g. legacy_text_encoding), we do not need to change UTF-8 mode behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:16:04 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 07:16:04 +0000 Subject: [issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch In-Reply-To: <1633611397.74.0.642629173294.issue45405@roundup.psfhosted.org> Message-ID: <1647328564.08.0.0499822672807.issue45405@roundup.psfhosted.org> Ned Deily added the comment: As of Xcode 13.3, released 2022-03-14 to support macOS 12.3 et al, the included Apple Clang (Apple clang version 13.1.6 (clang-1316.0.21.2)) now supports the --print-multiarch option and so Python 3.8 and 3.7 are now vulnerable to this issue when building with that version of Xcode or Apple Command Line Tools on macOS. While both 3.8 and 3.7 are now in the security-fix-only phase of their life cycles and are not fully supported on macOS 12, you should still be able to run ./configure without error using the current Apple Developer Tools. PR 31889 and PR 31890 are backports of this to 3.8 and 3.7. Setting to "release blocker" priority for upcoming 3.8 and 3.7 releases. ---------- nosy: +lukasz.langa priority: normal -> release blocker resolution: fixed -> stage: resolved -> commit review status: closed -> open versions: +Python 3.7, Python 3.8 -Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:18:42 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 07:18:42 +0000 Subject: [issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch In-Reply-To: <1633611397.74.0.642629173294.issue45405@roundup.psfhosted.org> Message-ID: <1647328722.62.0.0877473336323.issue45405@roundup.psfhosted.org> Ned Deily added the comment: New changeset 720bb456dc711b0776bae837d1f9a0b10c28ddf2 by Ned Deily in branch '3.7': bpo-45405: Prevent internal configure error when running configure with recent versions of clang. (GH-28845) (GH-31890) https://github.com/python/cpython/commit/720bb456dc711b0776bae837d1f9a0b10c28ddf2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:27:58 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 15 Mar 2022 07:27:58 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd Message-ID: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> New submission from Hugo van Kemenade : PEP 594 ? Removing dead batteries from the standard library As mentioned in the SC acceptance: > One thing we?d like to see happen while implementing it: Document the status of the modules being deprecated and removed and backport those deprecation updates to older CPython branch documentation (at least back to 3.9). That gets the notices in front of more people who may use the docs for their specific Python version. So let's update documentation and deprecation warnings to make clear in which release they're to be removed. This first one is just for the three modules (asynchat, asyncore and smtpd) slated for removal soonest, in 3.12: https://peps.python.org/pep-0594/#deprecated-modules ---------- components: Library (Lib) messages: 415222 nosy: hugovk priority: normal severity: normal status: open title: PEP 594: Document removal of asynchat, asyncore and smtpd versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:38:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Mar 2022 07:38:29 +0000 Subject: [issue24224] test_msilib is inadequate In-Reply-To: <1431928593.08.0.843064802562.issue24224@psf.upfronthosting.co.za> Message-ID: <1647329909.6.0.806054488652.issue24224@roundup.psfhosted.org> Irit Katriel added the comment: msilib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:50:40 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 15 Mar 2022 07:50:40 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647330640.67.0.259448746643.issue47022@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch pull_requests: +29989 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:51:17 2022 From: report at bugs.python.org (Maximilian Hils) Date: Tue, 15 Mar 2022 07:51:17 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647330677.13.0.313428626432.issue43253@roundup.psfhosted.org> Change by Maximilian Hils : ---------- pull_requests: +29990 pull_request: https://github.com/python/cpython/pull/31892 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:54:07 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 15 Mar 2022 07:54:07 +0000 Subject: [issue37907] speed-up PyLong_As*() for large longs In-Reply-To: <1566404262.5.0.0996699211051.issue37907@roundup.psfhosted.org> Message-ID: <1647330847.52.0.098882485647.issue37907@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:54:28 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 15 Mar 2022 07:54: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: <1647330868.67.0.158220482471.issue43721@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- nosy: +hugovk nosy_count: 4.0 -> 5.0 pull_requests: +29991 pull_request: https://github.com/python/cpython/pull/31893 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 03:58:51 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 15 Mar 2022 07:58:51 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647331131.67.0.743327458902.issue46996@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Tkinter nosy: +christian.heimes, epaine, erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:03:26 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 15 Mar 2022 08:03:26 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647331406.5.0.057591688921.issue45979@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a great idea. I have opened issue46996 for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:17:57 2022 From: report at bugs.python.org (Siddhesh Sathe) Date: Tue, 15 Mar 2022 08:17:57 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param Message-ID: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> New submission from Siddhesh Sathe : Python 3.9.10 (main, Jan 15 2022, 18:56:52) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re.sub(r"{\w}", "\s", "Hello! {user}") Traceback (most recent call last): File "/usr/lib/python3.9/sre_parse.py", line 1039, in parse_template this = chr(ESCAPES[this][1]) KeyError: '\\s' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/re.py", line 210, in sub return _compile(pattern, flags).sub(repl, string, count) File "/usr/lib/python3.9/re.py", line 327, in _subx template = _compile_repl(template, pattern) File "/usr/lib/python3.9/re.py", line 318, in _compile_repl return sre_parse.parse_template(repl, pattern) File "/usr/lib/python3.9/sre_parse.py", line 1042, in parse_template raise s.error('bad escape %s' % this, len(this)) re.error: bad escape \s at position 0 >>> ---------- components: Regular Expressions messages: 415225 nosy: ezio.melotti, mrabarnett, siddheshsathe priority: normal severity: normal status: open title: re.sub shows key error on regex escape chars provided in repl param type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:28:31 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 08:28:31 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n Message-ID: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> New submission from Christian Heimes : Update OpenSSL to 1.1.1n and test with OpenSSL 3.0.2. The update will become available later today and features a HIGH security bug, https://mta.openssl.org/pipermail/openssl-announce/2022-March/000216.html $ sed -i 's/1.1.1m/1.1.1n/g' Tools/ssl/multissltests.py .azure-pipelines/pr.yml .azure-pipelines/ci.yml .github/workflows/build.yml PCbuild/python.props PCbuild/get_externals.bat Mac/BuildScript/build-installer.py $ sed -i 's/3.0.1/3.0.2/g' Tools/ssl/multissltests.py .github/workflows/build.yml ---------- assignee: christian.heimes components: Build, Windows, macOS messages: 415226 nosy: christian.heimes, lukasz.langa, ned.deily, pablogsal, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware priority: release blocker severity: normal status: open title: Update to OpenSSL 1.1.1n type: security versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:30:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 08:30:13 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647333013.22.0.158340336007.issue47024@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +29992 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:31:56 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 08:31:56 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647333116.61.0.739648734847.issue45979@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 04:58:19 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 08:58:19 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647334699.42.0.657961602647.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'm removing 3.11 from the versions field: $ python3.11 sqlite3_fatal_python_error.py Exception ignored in: Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-build/sqlite3_fatal_python_error.py", line 10, in __del__ self.close() ^^^^^^^^^^^^ sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 123145443913728 and this is thread id 4506211840. ---------- versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:01:07 2022 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 15 Mar 2022 09:01:07 +0000 Subject: [issue46557] Logging captured warnings with a format string unnecessarily groups warnings together In-Reply-To: <1643330332.28.0.388721320926.issue46557@roundup.psfhosted.org> Message-ID: <1647334867.23.0.480849674281.issue46557@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset d8066b420b888591f485d132e62979d07abfc3f4 by Michael P. Nitowski in branch 'main': bpo-46557: Log captured warnings without format string (GH-30975) https://github.com/python/cpython/commit/d8066b420b888591f485d132e62979d07abfc3f4 ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 05:41:15 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 09:41:15 +0000 Subject: [issue46587] datetime and time tests use non-portable "%4Y" format In-Reply-To: <1643555688.39.0.0858908096334.issue46587@roundup.psfhosted.org> Message-ID: <1647337275.56.0.704969920993.issue46587@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 2cf7f865f099db11cc6903b334d9c376610313e8 by Christian Heimes in branch 'main': bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873) https://github.com/python/cpython/commit/2cf7f865f099db11cc6903b334d9c376610313e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:08:40 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 10:08:40 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647338920.12.0.131693411353.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: > A perfect repro has been attached, should be run on Linux. FTR, the repo works on macOS 12.2.1 as well: $ python3.10 ./sqlite3_fatal_python_error.py Fatal Python error: PyThreadState_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: initialized Thread 0x00000001126e7600 (most recent call first): File "/Users/erlendaasland/src/cpython-build/./sqlite3_fatal_python_error.py", line 52 in zsh: abort python3.10 ./sqlite3_fatal_python_error.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:12:30 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 10:12:30 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647339150.71.0.425025958043.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: > My recommended fix is to call sqlite3_close() within Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, and manually Py_DECREF all connection-related functions afterward. 3.11 already drops the GIL before sqlite3_close_v2(); backporting this change to 3.10 results in the following assertion error: $ ./python.exe sqlite3_fatal_python_error.py Assertion failed: (!_PyMem_IsPtrFreed(tstate->interp)), function is_tstate_valid, file ceval.c, line 155. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:12:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Mar 2022 10:12:54 +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: <1647339174.53.0.397750304124.issue43863@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_distutils emits deprecation warning about distutils _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:15:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Mar 2022 10:15:21 +0000 Subject: [issue46884] [doc] msilib.rst uses data directive to document modules In-Reply-To: <1646069613.09.0.14886937024.issue46884@roundup.psfhosted.org> Message-ID: <1647339321.9.0.0154922598929.issue46884@roundup.psfhosted.org> Irit Katriel added the comment: msilib is deprecated as per PEP 594, so there won't be further enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:32:43 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 10:32:43 +0000 Subject: [issue47025] bytes do not work on sys.path Message-ID: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> New submission from Thomas Grainger : importing a module with bytes in `sys.path` fails with: File "", line 182, in _path_isabs TypeError: startswith first arg must be bytes or a tuple of bytes, not str (see reproducer in attached demo.py) however `sys.path` is documented as supporting bytes "Only strings and bytes should be added to sys.path; all other data types are ignored during import." https://docs.python.org/3/library/sys.html?highlight=Only%20strings%20and%20bytes#sys.path bytes are allowed in PathFinder._find_spec https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/importlib/_bootstrap_external.py#L1460-L1462 but perhaps they should be ignored or explicitly fsdecoded ? see also: https://bugs.python.org/issue32642 https://github.com/python/importlib_metadata/issues/372#issuecomment-1067799424 ---------- files: demo.py messages: 415233 nosy: graingert priority: normal severity: normal status: open title: bytes do not work on sys.path Added file: https://bugs.python.org/file50678/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:33:28 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 10:33:28 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647340408.02.0.141576364042.issue47025@roundup.psfhosted.org> Change by Thomas Grainger : ---------- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 06:58:24 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 10:58:24 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647341904.93.0.519124730283.issue47025@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch pull_requests: +29993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:03:37 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 15 Mar 2022 11:03:37 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647342217.51.0.13879680728.issue47025@roundup.psfhosted.org> Eric V. Smith added the comment: In case it helps anyone: On Windows 3.11.0a5+ the full traceback is: $ ./python.bat demo.py Running Debug|x64 interpreter... Traceback (most recent call last): File "...\demo.py", line 23, in sys.exit(main()) ^^^^^^ File "...\Lib\contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\demo.py", line 11, in _tmp_path yield pathlib.Path(tmp_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\demo.py", line 18, in main import module ^^^^^^^^^^^^^ File "", line 1178, in _find_and_load File "", line 1140, in _find_and_load_unlocked File "", line 1080, in _find_spec File "", line 1487, in find_spec File "", line 1459, in _get_spec File "", line 1596, in find_spec File "", line 1656, in _fill_cache TypeError: a bytes-like object is required, not 'str' And on cygwin 3.8.12: $ python demo.py Traceback (most recent call last): File "", line 1346, in _path_importer_cache KeyError: b'/tmp/tmprpymgive' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "demo.py", line 23, in sys.exit(main()) File "demo.py", line 18, in main import module File "", line 991, in _find_and_load File "", line 971, in _find_and_load_unlocked File "", line 914, in _find_spec File "", line 1407, in find_spec File "", line 1376, in _get_spec File "", line 1348, in _path_importer_cache File "", line 1324, in _path_hooks File "", line 1594, in path_hook_for_FileFinder File "", line 1469, in __init__ File "", line 177, in _path_isabs TypeError: startswith first arg must be bytes or a tuple of bytes, not str ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:11:17 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 11:11:17 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647342677.72.0.361792532569.issue47025@roundup.psfhosted.org> Thomas Grainger added the comment: this is a regression from 3.2: ``` Python 3.2.6 (default, Jan 18 2016, 19:21:14) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tempfile >>> tempfile.TemporaryDirectory() >>> v = _ >>> tmp_dir = str(v.__enter__()) >>> tmp_dir '/tmp/tmpd4jzut' >>> f = open(tmp_dir + "/module.py", "w") >>> f.write("def function():\n return 1\n") 29 >>> f.close() >>> import sys >>> sys.path.append(tmp_dir.encode()) >>> import module >>> module >>> ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:14:32 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 11:14:32 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647342872.66.0.742538070446.issue47025@roundup.psfhosted.org> Thomas Grainger added the comment: https://docs.python.org/3/reference/import.html#path-entry-finders says "The encoding of bytes entries is determined by the individual path entry finders." see https://github.com/python/cpython/commit/82c1c781c7ee6496bd4c404b7ba972eed5dbcb12 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:22:09 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 11:22:09 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647343329.94.0.0586156899855.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29994 pull_request: https://github.com/python/cpython/pull/31898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:24:43 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 11:24:43 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647343483.28.0.111542035557.issue47025@roundup.psfhosted.org> Thomas Grainger added the comment: interestingly bytes filenames pointing to zip files on sys.path do support bytes (see zipfile_demo.py) ---------- Added file: https://bugs.python.org/file50679/zipfile_demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:29:08 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 15 Mar 2022 11:29:08 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647343748.79.0.0260999483282.issue47025@roundup.psfhosted.org> Eryk Sun added the comment: > this is a regression from 3.2 In Windows, bytes paths in sys.path do not work in 3.2+. I didn't test 3.0 and 3.1, but practically one can say that bytes paths were never supported in Python 3 on Windows. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:35:16 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 11:35:16 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647344116.0.0.112310933637.issue47025@roundup.psfhosted.org> Thomas Grainger added the comment: zipimporter.zipimporter handles non-bytes paths here: https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/zipimport.py#L65-L67 I think FileFinder should do the same ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:40:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Mar 2022 11:40:57 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1647344457.7.0.554988315578.issue46291@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29995 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 07:52:19 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 15 Mar 2022 11:52:19 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647328275.86.0.375590054328.issue47000@roundup.psfhosted.org> Message-ID: <75625f99-b4ab-b56a-2b0f-73a34ff6d0bb@egenix.com> Marc-Andre Lemburg added the comment: FWIW: I don't think the "locale" encoding is a good idea. Instead of trying to fix this to make it more usable, I'd suggest to deprecate and remove it again. When it comes to encodings, explicit is better than implicit. If an application wants to work with some user defined locale settings, it's better for the application to decide where to pick the locale settings from, e.g. the OS, the UI, an application config setting, etc. There are too many ways this can be done and trying to build magic to determine the "right" one is bound to fail in one way or another. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 08:27:31 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 15 Mar 2022 12:27:31 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1647347251.94.0.874319362617.issue46841@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +29996 pull_request: https://github.com/python/cpython/pull/31901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:13:15 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 15 Mar 2022 13:13:15 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param In-Reply-To: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> Message-ID: <1647349995.45.0.679053648097.issue47023@roundup.psfhosted.org> Eric V. Smith added the comment: Isn't '\s' covered by: " Unknown escapes of ASCII letters are reserved for future use and treated as errors" (https://docs.python.org/3/library/re.html#re.sub)? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:21:55 2022 From: report at bugs.python.org (Hanno Boeck) Date: Tue, 15 Mar 2022 13:21:55 +0000 Subject: [issue31892] ssl.get_server_certificate should allow specifying certificate / key type In-Reply-To: <1509271146.03.0.213398074469.issue31892@psf.upfronthosting.co.za> Message-ID: <1647350515.16.0.586832298256.issue31892@roundup.psfhosted.org> Hanno Boeck added the comment: Any update? :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:25:46 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 13:25:46 +0000 Subject: [issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za> Message-ID: <1647350746.76.0.620331499922.issue20392@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 5dd7ec52b83e7f239774cf7478106fcc7b0a36f3 by Kumar Aditya in branch 'main': bpo-20392: Fix inconsistency with uppercase file extensions in mimetypes.guess_type (GH-30229) https://github.com/python/cpython/commit/5dd7ec52b83e7f239774cf7478106fcc7b0a36f3 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:27:34 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 13:27:34 +0000 Subject: [issue46993] Speed up bytearray creation from list and tuple In-Reply-To: <1647078017.1.0.00491619232852.issue46993@roundup.psfhosted.org> Message-ID: <1647350854.27.0.583312306867.issue46993@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 6dfe09fc5fd5a3ddc6009d5656e635eae30c5240 by Kumar Aditya in branch 'main': bpo-46993: Speed up bytearray creation from list and tuple (GH-31834) https://github.com/python/cpython/commit/6dfe09fc5fd5a3ddc6009d5656e635eae30c5240 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 09:29:09 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Mar 2022 13:29:09 +0000 Subject: [issue47026] BytesWarning in zipimport paths on sys.path Message-ID: <1647350949.19.0.783799424166.issue47026@roundup.psfhosted.org> New submission from Thomas Grainger : importing from a bytes zipimport path on sys.path results in a BytesWarning: Comparison between bytes and string running the reproducer with `python -b` shows: python -b zipfile_demo.py :1345: BytesWarning: Comparison between bytes and string see also https://bugs.python.org/issue47025 ---------- components: Library (Lib) files: zipfile_demo.py messages: 415245 nosy: graingert priority: normal severity: normal status: open title: BytesWarning in zipimport paths on sys.path versions: Python 3.10, Python 3.11, Python 3.9 Added file: https://bugs.python.org/file50680/zipfile_demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:23:55 2022 From: report at bugs.python.org (Colin 't Hart) Date: Tue, 15 Mar 2022 14:23:55 +0000 Subject: [issue8704] cgitb sends a bogus HTTP header if the app crashes before finishing headers In-Reply-To: <1273759972.28.0.178671810955.issue8704@psf.upfronthosting.co.za> Message-ID: <1647354235.68.0.711646951329.issue8704@roundup.psfhosted.org> Colin 't Hart added the comment: 1. This module is scheduled to be removed by Python 3.13 (although I preseonally am of the opinion that it is a useful module and would like to see it brought up-to-date). 2. Is reset() even necessary anymore? Can't the same results be achieved with CSS since we are in the third decade of the 2000s after all? ---------- nosy: +cthart _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:39:54 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 15 Mar 2022 14:39:54 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647355194.86.0.142849648601.issue46985@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7a315d8a0d4df01f96d82286739b86920ccebc05 by Ned Deily in branch '3.8': bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31851) https://github.com/python/cpython/commit/7a315d8a0d4df01f96d82286739b86920ccebc05 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:39:24 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 15 Mar 2022 14:39:24 +0000 Subject: [issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch In-Reply-To: <1633611397.74.0.642629173294.issue45405@roundup.psfhosted.org> Message-ID: <1647355164.51.0.0529031272904.issue45405@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset dea270a2a80214de22afadaaca2043d0d782eb7d by Ned Deily in branch '3.8': bpo-45405: Prevent internal configure error when running configure with recent versions of clang. (GH-28845) (GH-31889) https://github.com/python/cpython/commit/dea270a2a80214de22afadaaca2043d0d782eb7d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:47:54 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 14:47:54 +0000 Subject: [issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch In-Reply-To: <1633611397.74.0.642629173294.issue45405@roundup.psfhosted.org> Message-ID: <1647355674.19.0.812811518988.issue45405@roundup.psfhosted.org> Change by Ned Deily : ---------- priority: release blocker -> resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:48:57 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 14:48:57 +0000 Subject: [issue46985] Upgrade ensurepip bundled pip to 22.0.4 In-Reply-To: <1647005432.9.0.668386387215.issue46985@roundup.psfhosted.org> Message-ID: <1647355737.58.0.670576884306.issue46985@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:49:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 14:49:22 +0000 Subject: [issue46993] Speed up bytearray creation from list and tuple In-Reply-To: <1647078017.1.0.00491619232852.issue46993@roundup.psfhosted.org> Message-ID: <1647355762.43.0.290590789516.issue46993@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:50:28 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 14:50:28 +0000 Subject: [issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za> Message-ID: <1647355828.99.0.748047762297.issue20392@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29998 pull_request: https://github.com/python/cpython/pull/31904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:50:23 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 14:50:23 +0000 Subject: [issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za> Message-ID: <1647355823.34.0.413854553952.issue20392@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +29997 pull_request: https://github.com/python/cpython/pull/31903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:55:54 2022 From: report at bugs.python.org (Yann Droneaud) Date: Tue, 15 Mar 2022 14:55:54 +0000 Subject: [issue47027] subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter Message-ID: <1647356154.7.0.125333178117.issue47027@roundup.psfhosted.org> New submission from Yann Droneaud : subprocess.run() and subprocess.Popen() accepts a cwd= parameter to change directory before running the subprocess. Unfortunately it's not possible to use a file descriptor to run the subprocess in a directory already opened. For example: import os import subprocess with os.open('/usr/bin', os.O_RDONLY) as f: subprocess.run(["ls", "-l"], cwd=f, check=True) fails with Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1754, in _execute_child self.pid = _posixsubprocess.fork_exec( Using a file descriptor instead of path is useful to address TOCTOU issues. Maybe a mean to convert a file descriptor to a Path-like object would do the trick. ---------- components: Library (Lib) messages: 415249 nosy: ydroneaud priority: normal severity: normal status: open title: subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter type: enhancement versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:57:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 14:57:55 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647356275.47.0.347634721219.issue43253@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:59:12 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 14:59:12 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647356352.2.0.0565629841401.issue43253@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 70155412f1543f100d4aa309b8691cbcabd3e0e1 by Maximilian Hils in branch 'main': bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892) https://github.com/python/cpython/commit/70155412f1543f100d4aa309b8691cbcabd3e0e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:59:26 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 14:59:26 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647356366.56.0.336290589207.issue43253@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +29999 pull_request: https://github.com/python/cpython/pull/31905 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 10:59:30 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 14:59:30 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647356370.41.0.766669604295.issue43253@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30000 pull_request: https://github.com/python/cpython/pull/31906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:04:52 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 15:04:52 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647356692.44.0.712511261911.issue46907@roundup.psfhosted.org> Ned Deily added the comment: New changeset ea786a882b9ed4261eafabad6011bc7ef3b5bf94 by Mariusz Felisiak in branch 'main': bpo-46907: Update macOS installer to SQLite 3.38.1. (GH-31656) https://github.com/python/cpython/commit/ea786a882b9ed4261eafabad6011bc7ef3b5bf94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:14:27 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 15:14:27 +0000 Subject: [issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za> Message-ID: <1647357267.94.0.994861555908.issue20392@roundup.psfhosted.org> miss-islington added the comment: New changeset 3c4f24face4cca9256ae79bf6968663a04daf655 by Miss Islington (bot) in branch '3.10': bpo-20392: Fix inconsistency with uppercase file extensions in mimetypes.guess_type (GH-30229) https://github.com/python/cpython/commit/3c4f24face4cca9256ae79bf6968663a04daf655 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:16:50 2022 From: report at bugs.python.org (Carl Meyer) Date: Tue, 15 Mar 2022 15:16:50 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1647357410.4.0.458296407322.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: > There should not be much of a slowdown for this code when watching `CONST`: How and when (and based on what data?) would the adaptive interpreter make the decision that for this code sample the key `CONST`, but not the key `var`, should be watched in the module globals dict? It's easy to contrive an example in which it's beneficial to watch one key but not another, but this is practically irrelevant unless it's also feasible for an optimizer to consistently make the right decision about which key(s) to watch. The code sample also suggests that the module globals dict for a module is being watched while that module's own code object is being executed. In module body execution, writing to globals (vs reading them) is relatively much more common, compared to any other Python code execution context, and it's much less common for the same global to be read many times. Given this, how frequently would watching module globals dictionaries during module body execution be a net win at all? Certainly cases can be contrived in which it would be, but it seems unlikely that it would be a net win overall. And again, unless the optimizer can reliably (and in advance, since module bodies are executed only once) distinguish the cases where it's a win, it seems the example is not practically relevant. > Another use of this is to add watch points in debuggers. > To that end, it would better if the callback were a Python object. It is easy to create a C callback that delegates to a Python callable if someone wants to implement this use case, so the vectorcall overhead is paid only when needed. The core API doesn't need to be made more complex for this, and there's no reason to impose any overhead at all on low-level interpreter-optimization use cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:22:02 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 15 Mar 2022 15:22:02 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647357722.93.0.179596609817.issue47022@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:22:09 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 15:22:09 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647357729.95.0.0346697653115.issue43253@roundup.psfhosted.org> miss-islington added the comment: New changeset 88c243fd8d5a43282ef06bd0872e3b88c68bb856 by Miss Islington (bot) in branch '3.10': bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892) https://github.com/python/cpython/commit/88c243fd8d5a43282ef06bd0872e3b88c68bb856 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:23:52 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 15:23:52 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647357832.28.0.564460588395.issue43253@roundup.psfhosted.org> miss-islington added the comment: New changeset 64a68c39cb508b016e5a4486ebb4052f6e65fca0 by Miss Islington (bot) in branch '3.9': bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892) https://github.com/python/cpython/commit/64a68c39cb508b016e5a4486ebb4052f6e65fca0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:37:28 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 15 Mar 2022 15:37:28 +0000 Subject: [issue45923] Improve performance of sys.settracing based tools. In-Reply-To: <1638185877.94.0.453545318764.issue45923@roundup.psfhosted.org> Message-ID: <1647358648.74.0.389159430549.issue45923@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +30001 pull_request: https://github.com/python/cpython/pull/31908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:38:25 2022 From: report at bugs.python.org (John K.) Date: Tue, 15 Mar 2022 15:38:25 +0000 Subject: [issue47028] Incorrect behaviour when zipping a bunch of maps Message-ID: <1647358705.36.0.73644114297.issue47028@roundup.psfhosted.org> New submission from John K. : map(f, itr) is supposed to be the lazy way to do [f(val) for val in itr]. However, when unpacking and zipping a list of maps, I get a different result from when evaluating eagerly. More precisely: Python 3.10.2 | packaged by conda-forge | (main, Mar 8 2022, 15:53:57) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> maps = [map(lambda x: x**i, range(7)) for i in range(5)] >>> for z in zip(*maps): ... print(z) ... (0, 0, 0, 0, 0) (1, 1, 1, 1, 1) (16, 16, 16, 16, 16) (81, 81, 81, 81, 81) (256, 256, 256, 256, 256) (625, 625, 625, 625, 625) (1296, 1296, 1296, 1296, 1296) >>> lists = [[x**i for x in range(7)] for i in range(5)] >>> for z in zip(*lists): ... print(z) ... (1, 0, 0, 0, 0) (1, 1, 1, 1, 1) (1, 2, 4, 8, 16) (1, 3, 9, 27, 81) (1, 4, 16, 64, 256) (1, 5, 25, 125, 625) (1, 6, 36, 216, 1296) ---------- components: Interpreter Core messages: 415256 nosy: khoodolphin priority: normal severity: normal status: open title: Incorrect behaviour when zipping a bunch of maps type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:39:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 15:39:07 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647358747.51.0.896589326507.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30002 pull_request: https://github.com/python/cpython/pull/31909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:49:39 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 15:49:39 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647359379.19.0.896424541398.issue43253@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks! ---------- resolution: -> fixed status: -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:50:33 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Mar 2022 15:50:33 +0000 Subject: [issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za> Message-ID: <1647359433.47.0.839762929798.issue20392@roundup.psfhosted.org> miss-islington added the comment: New changeset 32ae9ab55f2cd97b5a28d5398c4820d8bc96f30c by Miss Islington (bot) in branch '3.9': bpo-20392: Fix inconsistency with uppercase file extensions in mimetypes.guess_type (GH-30229) https://github.com/python/cpython/commit/32ae9ab55f2cd97b5a28d5398c4820d8bc96f30c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 11:50:53 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 15:50:53 +0000 Subject: [issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type In-Reply-To: <1390670268.05.0.579524422182.issue20392@psf.upfronthosting.co.za> Message-ID: <1647359453.92.0.926308224162.issue20392@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:14:23 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 16:14:23 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647360863.86.0.135325884056.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b43b9b49be7d42d2826106c719d1e51f0776be0a by Christian Heimes in branch 'main': bpo-40280: Skip wakeup_fd pipe tests on Emscripten (GH-31909) https://github.com/python/cpython/commit/b43b9b49be7d42d2826106c719d1e51f0776be0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:16:17 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 15 Mar 2022 16:16:17 +0000 Subject: [issue47028] Incorrect behaviour when zipping a bunch of maps In-Reply-To: <1647358705.36.0.73644114297.issue47028@roundup.psfhosted.org> Message-ID: <1647360977.19.0.202973107688.issue47028@roundup.psfhosted.org> Dennis Sweeney added the comment: This is because i is not captured by the function definition. `lambda x: x**i` always makes the "input to the ith power" function, never the "input to the 3rd power" function, even if i happens to be 3 right now. Consider replacing `lambda x: x**i` with `lambda x, i=i: x**i` to explicitly capture the current value of i as a default. Changing the scoping rules now would be a big backwards-incompatible change. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:16:21 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 15 Mar 2022 16:16:21 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1647360981.62.0.79319847654.issue46896@roundup.psfhosted.org> Mark Shannon added the comment: Let me give you an example. #module eggs eggs_var = 0 # a variable, maybe a counter or similar EGGS_CONST # a constant #module spam import eggs spam_var # Another variable def foo(): use(eggs.EGGS_CONST) ------------- We will want to treat `eggs.EGGS_CONST` as a constant. To do that we need to be notified if `spam.eggs` or `eggs.EGGS_CONST` changes, but we do not want be notified whenever `spam.spam_var` or `eggs.eggs_var` changes. This might not be necessary for us right now, but we will want to implement optimizations over larger regions than a single bytecode in 3.12. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:18:38 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 15 Mar 2022 16:18:38 +0000 Subject: [issue47028] Incorrect behaviour when zipping a bunch of maps In-Reply-To: <1647358705.36.0.73644114297.issue47028@roundup.psfhosted.org> Message-ID: <1647361118.66.0.941654153675.issue47028@roundup.psfhosted.org> Dennis Sweeney added the comment: There's an FAQ entry here: https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:26:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Mar 2022 16:26:47 +0000 Subject: [issue46817] Add a line-start table to the code object. In-Reply-To: <1645448352.85.0.240103559175.issue46817@roundup.psfhosted.org> Message-ID: <1647361607.58.0.205198336994.issue46817@roundup.psfhosted.org> Irit Katriel added the comment: I can see the linestarts used in trace.py to figure out coverage. But for this duplications don't make a difference (they are deduped in _find_lines_from_code anyway), right? Where else are they used, such that the current scheme may not work? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:34:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 16:34:42 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647362082.68.0.88599862374.issue45997@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30003 pull_request: https://github.com/python/cpython/pull/31910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:51:14 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 15 Mar 2022 16:51:14 +0000 Subject: [issue46817] Add a line-start table to the code object. In-Reply-To: <1645448352.85.0.240103559175.issue46817@roundup.psfhosted.org> Message-ID: <1647363074.79.0.0260650314653.issue46817@roundup.psfhosted.org> Mark Shannon added the comment: sys.settrace line events cannot use the co_lines table. They need additional state, as we don't want to trace the same line twice (unless there is a backwards jump). Using the start of a entry in `co_lines` doesn't work when some entries have no line number. E.g. list(co.co_lines): (0, 2, 1) (2, 4, None) (4, 6, 1) The instruction @ byte offset 4 starts an entry for line 1, but does not start line 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:55:21 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 15 Mar 2022 16:55:21 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647363321.17.0.368451860822.issue46907@roundup.psfhosted.org> Steve Dower added the comment: New changeset a8c728b8b742fd8ca5a225f79d99014794b8fdf3 by Mariusz Felisiak in branch 'main': bpo-46907: Update Windows installer to SQLite 3.38.1. (GH-31655) https://github.com/python/cpython/commit/a8c728b8b742fd8ca5a225f79d99014794b8fdf3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 12:55:32 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 15 Mar 2022 16:55:32 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647363332.03.0.672042480901.issue46907@roundup.psfhosted.org> Steve Dower added the comment: Was there any reason/need to backport this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:06:49 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 15 Mar 2022 17:06:49 +0000 Subject: [issue45923] Improve performance of sys.settracing based tools. In-Reply-To: <1638185877.94.0.453545318764.issue45923@roundup.psfhosted.org> Message-ID: <1647364009.94.0.408588226503.issue45923@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 099f75614100e88ed90b68d20a51a8d9c22f81a7 by Mark Shannon in branch 'main': bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908) https://github.com/python/cpython/commit/099f75614100e88ed90b68d20a51a8d9c22f81a7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:17:40 2022 From: report at bugs.python.org (Carl Meyer) Date: Tue, 15 Mar 2022 17:17:40 +0000 Subject: [issue46896] add support for watching writes to selected dictionaries In-Reply-To: <1646173145.14.0.810360820171.issue46896@roundup.psfhosted.org> Message-ID: <1647364660.95.0.705729892028.issue46896@roundup.psfhosted.org> Carl Meyer added the comment: Thanks for the extended example. I think in order for this example to answer the question I asked, a few more assumptions should be made explicit: 1) Either `spam_var` and/or `eggs_var` are frequently re-bound to new values in a hot code path somewhere. (Given the observations above about module-level code, we should assume for a relevant example this takes place in a function that uses `global spam_var` or `global eggs_var` to allow such rebinding.) 2) But `spam_var` and `eggs_var` are not _read_ in any hot code path anywhere, because if they were, then the adaptive interpreter would be just as likely to decide to watch them as it is to watch `EGGS_CONST`, in which case any benefit of per-key watching in this example disappears. (Keep in mind that with possibly multiple watchers around, "unwatching" anything on the dispatch side is never an option, so we can't say that the adaptive interpreter would decide to unwatch the frequently-re-bound keys after it observes them being re-bound. It can always "unwatch" them in the sense of no longer being interested in them in its callback, though.) It is certainly possible that this case could occur, where some module contains both a frequently-read-but-not-written global and also a global that is re-bound using `global` keyword in a hot path, but rarely read. But it doesn't seem warranted to pre-emptively add a lot of complexity to the API in order to marginally improve the performance of this quite specific case, unsupported by any benchmark or sample workload demonstrating it. > This might not be necessary for us right now I think it's worth keeping in mind that `PyDict_WatchKey` API can always be added later without disturbing or changing semantics of the `PyDict_Watch` API added here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:18:03 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 17:18:03 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647364683.78.0.979265646925.issue46907@roundup.psfhosted.org> Ned Deily added the comment: I think we can hold off on deciding whether to backport until at least the next round of bugfix releases. I don't know of any pressing reason one way or the other, ATM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:20:23 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 17:20:23 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647364823.72.0.3776620261.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: Updating to SQLite 3.37 was backported because of a data corruption bug that was fixed. AFAIK, there?s nothing like that in 3.38. I would prefer waiting to see if more patch releases appear. (That was also my intent, given how many patch releases we saw with 3.35; I?ll start using the dont-merge label from now on.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:21:45 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 17:21:45 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647364905.34.0.612632907966.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing this tonight, unless someone objects. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 13:39:46 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 17:39:46 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647365986.5.0.594244862839.issue47024@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +30004 pull_request: https://github.com/python/cpython/pull/31911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 14:15:56 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 18:15:56 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647368156.36.0.894972267976.issue47024@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +30005 pull_request: https://github.com/python/cpython/pull/31912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 14:28:33 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 15 Mar 2022 18:28:33 +0000 Subject: [issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected Message-ID: <1647368913.23.0.350559928091.issue47029@roundup.psfhosted.org> New submission from G?ry : A `BrokenPipeError` exception is raised when the queue thread of a `multiprocessing.Queue` still sends enqueued items to the write end of the queue pipe *after* the read end of the queue pipe has been [automatically closed during its garbage collection](https://docs.python.org/3/library/socket.html#socket.socket.close) following the garbage collection of the queue (the write end of the queue pipe is not garbage collected because it is also referenced by the queue thread): ``` import multiprocessing def main(): q = multiprocessing.Queue() q.put(0) if __name__ == '__main__': main() ``` ---------- components: Library (Lib) messages: 415272 nosy: maggyero priority: normal severity: normal status: open title: Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 14:28:50 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 15 Mar 2022 18:28:50 +0000 Subject: [issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected In-Reply-To: <1647368913.23.0.350559928091.issue47029@roundup.psfhosted.org> Message-ID: <1647368930.82.0.232474961526.issue47029@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +30006 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 14:43:00 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 15 Mar 2022 18:43:00 +0000 Subject: [issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected In-Reply-To: <1647368913.23.0.350559928091.issue47029@roundup.psfhosted.org> Message-ID: <1647369780.17.0.382055777222.issue47029@roundup.psfhosted.org> G?ry added the comment: I have attached the following patch: pass a reference to the reader end of the queue pipe to the queue thread so that the reader end is not garbage collected and closed before the queue thread has sent all the buffered data to the writer end. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 14:46:49 2022 From: report at bugs.python.org (Randolf Scholz) Date: Tue, 15 Mar 2022 18:46:49 +0000 Subject: [issue47030] singledispatch does not work with positional arguments with default values. Message-ID: <1647370009.1.0.761981911738.issue47030@roundup.psfhosted.org> New submission from Randolf Scholz : from functools import singledispatch from typing import Optional @singledispatch def load(key: Optional[str] = None, /) -> None: raise NotImplementedError @load.register def _(key: None, /) -> None: print(f"loaded {key=}") @load.register def _(key: str, /) -> None: print(f"loaded {key=}") load() # TypeError: load requires at least 1 positional argument ---------- messages: 415274 nosy: randolf.scholz priority: normal severity: normal status: open title: singledispatch does not work with positional arguments with default values. type: enhancement versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 14:54:38 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 15 Mar 2022 18:54:38 +0000 Subject: [issue47028] Incorrect behaviour when zipping a bunch of maps In-Reply-To: <1647358705.36.0.73644114297.issue47028@roundup.psfhosted.org> Message-ID: <1647370478.16.0.816988170112.issue47028@roundup.psfhosted.org> Dennis Sweeney added the comment: https://bugs.python.org/issue45469 is similar. Thanks for the report, but I'll go ahead and close this. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:09:47 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 19:09:47 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.1 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1647371387.44.0.876411538079.issue46907@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:10:19 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 15 Mar 2022 19:10:19 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647371419.51.0.454955797218.issue45997@roundup.psfhosted.org> Yury Selivanov added the comment: Andrew, the same problem exists in asyncio.Queue which is also critical. Here's how I fixed it in edgedb code base: https://github.com/edgedb/edgedb/blob/08e41341024828df22a01cd690b11fcff00bca5e/edb/server/compiler_pool/queue.py#L51-L74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:10:34 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 19:10:34 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647371434.22.0.626705275665.issue47019@roundup.psfhosted.org> hydroflask added the comment: If you connect with check_same_thread=False, I believe the issue may still present itself on 3.11+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:12:24 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 19:12:24 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647371544.96.0.147175063.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: > If you connect with check_same_thread=False, I believe the issue may still present itself on 3.11+ Nope, works swell on my Mac. Do you see this on Linux with latest 3.11? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:25:46 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 19:25:46 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647372346.05.0.523168497386.issue47019@roundup.psfhosted.org> hydroflask added the comment: I don't see it immediately but I think it's still possible to happen since all the same offending code is in place. There are two reasosn why it probably doesn't happen in 3.11+: 1) because something is deferring calling the finalizer for the zero-ref object to another thread instead on immediately on the thread that is dying as in <=3.10 2) In 3.11+ it is fixed so that PyGILState_Ensure can be called in a sequence started by PyGILState_Release. @vstinner is this correct? If the reason it doesn't happen in 3.11+ is because of 1) then I don't think that is specified to happen anywhere and changing the GC in future versions could theoretically trigger the same bug. If it is 2) then it is fixed in a more robust location. IMO, the most robust fix is to destroy the function callbacks in connection_close() and avoid using the destructor_callback and calling PyGILState_Ensure() altogether. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:29:14 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 19:29:14 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647372554.11.0.222303115379.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: All callbacks triggered from external libraries must protect Python C API calls. You may call it offending, but that is the reality; a callback may trigger at any point in time, so we need to make sure the GIL is held before calling any Py API. That is also the case for the destructor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:30:54 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 15 Mar 2022 19:30:54 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647372654.48.0.215728016614.issue47024@roundup.psfhosted.org> Ned Deily added the comment: New changeset b6204466c1209de5a0794c475096429fdb457a16 by Ned Deily in branch '3.7': bpo-47024: Update Windows builds and macOS installer build to use OpenSSL 1.1.1n. (GH-31911) https://github.com/python/cpython/commit/b6204466c1209de5a0794c475096429fdb457a16 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:32:13 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 19:32:13 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647372733.87.0.828400841291.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-44304 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:34:36 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 19:34:36 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647372876.25.0.115820187006.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also Petrs msg400205: > [...] I recommend that any function passed to SQLite (and only those) should > - be named `*_callback`, for clarity > - acquire the GIL at the very start > - release the GIL at the very end ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:36:21 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 19:36:21 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647372981.44.0.157590334021.issue47019@roundup.psfhosted.org> hydroflask added the comment: > All callbacks triggered from external libraries must protect Python C API calls. You may call it offending, but that is the reality; a callback may trigger at any point in time, so we need to make sure the GIL is held before calling any Py API. That is also the case for the destructor. Sure but I'm suggesting sidestepping and not using the destructor_callback entirely. You can DECREF the callbacks manually in connection_close() after calling sqlite3_close_v2(). Doing this makes sense to me since the destructor may be called under special conditions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:43:31 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 19:43:31 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647373411.16.0.902882045567.issue47019@roundup.psfhosted.org> hydroflask added the comment: If PyGILState_Ensure() has been fixed to become re-entrant during PyGILState_Release() in 3.11+ then I believe that change should be backported to 3.10. @vstinner would know ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:45:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 19:45:14 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647373514.26.0.483630255493.issue45997@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks, Yuri. I'll take a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:49:20 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 19:49:20 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647373760.28.0.340439275367.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, PyGILState_Ensure may be called by a thread as many times as you want, and it has been so for a very long time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:54:57 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 19:54:57 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647374097.38.0.108637301299.issue47019@roundup.psfhosted.org> hydroflask added the comment: So what is causing this bug in 3.10 is the following stack: thread_entry_point() PyGILState_Ensure() PyGILState_Release() ... PyGILState_Ensure() The core issue is that PyGILState_Ensure is getting called while the tstate itself is in the process of being destroyed. This causes an invalid state and eventually results in a segfault or "Fatal Python Error." I think the most robust fix is to allow re-entrancy to PyGILState_Release/PyGILState_Ensure. If that is prohibitively complex and/or is not specified to be allowed, I believe the most robust fix is to avoid using sqlite3 destructor callbacks to DECREF Python objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 15:58:08 2022 From: report at bugs.python.org (hydroflask) Date: Tue, 15 Mar 2022 19:58:08 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1647374288.55.0.167634093118.issue42698@roundup.psfhosted.org> hydroflask added the comment: Closing this issue since sqlite3_close{,_v2}() is no longer called with the GIL held in 3.11+ ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:03:27 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:03:27 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647374607.33.0.363157657538.issue47024@roundup.psfhosted.org> Christian Heimes added the comment: New changeset af0a50de4b77dc774fcfdf5468ec320b08bfb53b by Christian Heimes in branch 'main': bpo-47024: Update OpenSSL to 1.1.1n (GH-31895) https://github.com/python/cpython/commit/af0a50de4b77dc774fcfdf5468ec320b08bfb53b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:05:15 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:05:15 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647374715.06.0.380959132148.issue47024@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30007 pull_request: https://github.com/python/cpython/pull/31916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:06:44 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:06:44 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647374804.44.0.943467280518.issue47024@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30008 pull_request: https://github.com/python/cpython/pull/31917 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:17:55 2022 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Tue, 15 Mar 2022 20:17:55 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1647375475.84.0.364862935986.issue46404@roundup.psfhosted.org> Lum?r Balhar added the comment: In my opinion, we should keep it simple for attrs and dataclasses to fix closure cells when a class is replaced and therefore it seems to be correct to have it mutable as it currently is in 3.11. My plan is to implement the fix for dataclasses and some tests for these use cases so the behavior should not change in the future. For attrs it means one more branch in the code now but much simpler code when the support for older releases gets dropped. Any other opinions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:31:08 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:31:08 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647376268.1.0.403232142407.issue47024@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a59ac1e7d20713573c15c5259c83e998a73e9094 by Christian Heimes in branch '3.10': [3.10] bpo-47024: Update OpenSSL to 1.1.1n (GH-31895) (GH-31916) https://github.com/python/cpython/commit/a59ac1e7d20713573c15c5259c83e998a73e9094 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:34:53 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:34:53 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647376493.48.0.12236064547.issue47024@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 513911b359c88df2b32d0bc2776438f52d5e4584 by Christian Heimes in branch '3.9': [3.9] bpo-47024: Update OpenSSL to 1.1.1n (GH-31895) (#31917) https://github.com/python/cpython/commit/513911b359c88df2b32d0bc2776438f52d5e4584 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:42:59 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Mar 2022 20:42:59 +0000 Subject: [issue47019] Fatal Python Error in sqlite3 Python 3.10 In-Reply-To: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org> Message-ID: <1647376979.03.0.14502641521.issue47019@roundup.psfhosted.org> Erlend E. Aasland added the comment: Maybe related: bpo-20891 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:50:48 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 20:50:48 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1647377448.94.0.0651074846357.issue38912@roundup.psfhosted.org> Andrew Svetlov added the comment: The main branch is clear ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:53:57 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 15 Mar 2022 20:53:57 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647377637.73.0.369766303259.issue47024@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e8b72fc7f3937b6b86354110917da161ca36cff7 by Ned Deily in branch '3.8': [3.8] bpo-47024: Update Windows builds and macOS installer build to use OpenSSL 1.1.1n. (GH-31912) https://github.com/python/cpython/commit/e8b72fc7f3937b6b86354110917da161ca36cff7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:54:24 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:54:24 +0000 Subject: [issue47024] Update to OpenSSL 1.1.1n In-Reply-To: <1647332911.51.0.546215674057.issue47024@roundup.psfhosted.org> Message-ID: <1647377664.22.0.226093836963.issue47024@roundup.psfhosted.org> Change by Christian Heimes : ---------- priority: release blocker -> normal resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:55:47 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 15 Mar 2022 20:55:47 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647377747.99.0.664984396215.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a4674f0194067a801f6c6bdb4fc6448e3a40e069 by Christian Heimes in branch 'main': bpo-40280: Detect presence of time.tzset and thread_time clock (GH-31898) https://github.com/python/cpython/commit/a4674f0194067a801f6c6bdb4fc6448e3a40e069 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 16:58:47 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 20:58:47 +0000 Subject: [issue46457] test_unittest: TestAsyncCase.test_debug_cleanup_same_loop() hangs with gc.set_threshold(500) In-Reply-To: <1642778488.24.0.387685452896.issue46457@roundup.psfhosted.org> Message-ID: <1647377927.97.0.855392748368.issue46457@roundup.psfhosted.org> Andrew Svetlov added the comment: #46994 fixed this problem ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 17:04:48 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 15 Mar 2022 21:04:48 +0000 Subject: [issue25291] better Exception message for certain task termination scenario In-Reply-To: <1443729479.04.0.835148542508.issue25291@psf.upfronthosting.co.za> Message-ID: <1647378288.55.0.56909236473.issue25291@roundup.psfhosted.org> Andrew Svetlov added the comment: Python 3.7 forbids Task.set_exception() and Task.set_result(), the error message is pretty clear. Nothing to do here ---------- nosy: +asvetlov resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 17:34:28 2022 From: report at bugs.python.org (Zsolt Dollenstein) Date: Tue, 15 Mar 2022 21:34:28 +0000 Subject: [issue46963] Deep Lazy Imports - Interpreter-level deferred module loading In-Reply-To: <1646767934.68.0.126950906489.issue46963@roundup.psfhosted.org> Message-ID: <1647380068.55.0.535017986384.issue46963@roundup.psfhosted.org> Change by Zsolt Dollenstein : ---------- nosy: +zsol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 17:44:20 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 15 Mar 2022 21:44:20 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1647380660.4.0.850462728924.issue46404@roundup.psfhosted.org> Eric V. Smith added the comment: @frenzy: I'm not sure what your fix would do. You could either describe it in rough terms (if you'd like a pre-PR opinion on the approach), or I'm happy to wait to see your PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 17:47:47 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 15 Mar 2022 21:47:47 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> Message-ID: <1647380867.19.0.355966768896.issue46965@roundup.psfhosted.org> Guido van Rossum added the comment: The link https://github.com/facebookincubator/cinder/blob/cinder/3.8/Python/ceval.c#L6617 points to something that I wouldn't associate with the subject. @Dino, could you provide a new link (preferably a permalink)? FWIW rather than dynamically checking what the next opcode is, maybe we could use a super-instruction for CALL + GET_AWAITABLE? (Understanding that there are a bunch of different CALL opcodes.) The gather code you link to is all in C. Is rewriting gather in C the only way to benefit from this speedup? (I guess you could just add your gather impl to the existing _asynciomodule.c, in the same or a separate PR.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 18:47:25 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 15 Mar 2022 22:47:25 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything Message-ID: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> New submission from Steven D'Aprano : The IEEE-754 requirement that NANs are never equal to anything, even to themselves, is a common stumbling block for those new to the consequences of IEEE-754. See for example #47020. The documentation for math.nan would be a good place to add a note like "Due to the requirements of the `IEEE-754 standard `_, math.nan and float('nan') are never equal to any other value, including themselves. Use math.isnan to test for NANs." https://docs.python.org/3.8/library/math.html#math.nan ---------- assignee: docs at python components: Documentation keywords: easy messages: 415302 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: math.nan should note that NANs do not compare equal to anything type: enhancement 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 Mar 15 18:50:14 2022 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Tue, 15 Mar 2022 22:50:14 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1647384614.07.0.194576492303.issue46404@roundup.psfhosted.org> Lum?r Balhar added the comment: We have the same problem reported in attrs here in dataclasses and because it's not tested the way to manipulate __closure__ cells changes frequently. My plan is to implement something similar to this into dataclasses: https://github.com/python-attrs/attrs/blob/5c040f30e3e4b3c9c0f27c8ac6ff13d604c1818c/src/attr/_make.py#L895-L916 Basically, when a new dataclass is created (with slots=True), look for references to the original class and fix them. This fixes the problem reported to attrs in dataclasses and when we fix it and add some tests for it, the future behavior should be more stable. What do you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 19:27:21 2022 From: report at bugs.python.org (Roundup Robot) Date: Tue, 15 Mar 2022 23:27:21 +0000 Subject: [issue18795] pstats - allow stats sorting by cumulative time per call and total time per call In-Reply-To: <1377042491.98.0.765142916486.issue18795@psf.upfronthosting.co.za> Message-ID: <1647386841.63.0.2821255532.issue18795@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +30009 pull_request: https://github.com/python/cpython/pull/31919 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 19:29:12 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Tue, 15 Mar 2022 23:29:12 +0000 Subject: [issue18795] pstats - allow stats sorting by cumulative time per call and total time per call In-Reply-To: <1377042491.98.0.765142916486.issue18795@psf.upfronthosting.co.za> Message-ID: <1647386952.83.0.207312962197.issue18795@roundup.psfhosted.org> Dani?l van Noord added the comment: I resubmitted the original patch and updated it with documentation and news item changes. This would still be a valuable addition imo, as it can help single out expensive calls in your module/script. ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:07:13 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 00:07:13 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647389233.37.0.434616224165.issue46948@roundup.psfhosted.org> Steve Dower added the comment: The fix for this regressed the installer for the py.exe launcher, which breaks our release builds. I'm patching it now. It's going under the same issue number because it will be needed for anyone applying this patch directly and then building the installer themselves. ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:08:44 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 16 Mar 2022 00:08:44 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1647389324.92.0.773916373249.issue46841@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 49e1e1e1bd59cac1855b1ef4dec05d649ebcd81a by Mark Shannon in branch 'main': bpo-46841: Don't scan backwards in bytecode (GH-31901) https://github.com/python/cpython/commit/49e1e1e1bd59cac1855b1ef4dec05d649ebcd81a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:18:38 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 00:18:38 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647389918.01.0.320172163455.issue46948@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30011 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:20:54 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 00:20:54 +0000 Subject: [issue47032] CI does not detect launcher installer build failure Message-ID: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> New submission from Steve Dower : When changes are made under the Tools/msi directory, extra tests are run in GitHub Actions to build the installer. Apparently, these tests do not fail when the launcher installer fails to build. They need to. ---------- assignee: steve.dower messages: 415308 nosy: steve.dower priority: normal severity: normal stage: needs patch status: open title: CI does not detect launcher installer build failure versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:38:22 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 00:38:22 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647391102.45.0.882446177226.issue47032@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +30012 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:46:37 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 00:46:37 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647391597.53.0.469327504833.issue46948@roundup.psfhosted.org> Steve Dower added the comment: New changeset 708812085355c92f32e547d1f1d1f29aefbbc27e by Steve Dower in branch 'main': bpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920) https://github.com/python/cpython/commit/708812085355c92f32e547d1f1d1f29aefbbc27e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:46:49 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 00:46:49 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647391609.45.0.186971374936.issue46948@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +30013 pull_request: https://github.com/python/cpython/pull/31922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:46:54 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 00:46:54 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647391614.97.0.115217948738.issue46948@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30014 pull_request: https://github.com/python/cpython/pull/31923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:47:02 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 00:47:02 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647391622.31.0.464661263334.issue46948@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30015 pull_request: https://github.com/python/cpython/pull/31924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 20:47:07 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 00:47:07 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647391627.26.0.0800397876936.issue46948@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30016 pull_request: https://github.com/python/cpython/pull/31925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:13:15 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 01:13:15 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647393195.94.0.671052293385.issue46948@roundup.psfhosted.org> miss-islington added the comment: New changeset 58d30b992d67c8471f79a7307e4c1cda64311e3b by Miss Islington (bot) in branch '3.10': bpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920) https://github.com/python/cpython/commit/58d30b992d67c8471f79a7307e4c1cda64311e3b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:15:39 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 16 Mar 2022 01:15:39 +0000 Subject: [issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4) In-Reply-To: <1647274447.55.0.120489432605.issue47013@roundup.psfhosted.org> Message-ID: <1647393339.38.0.561569479032.issue47013@roundup.psfhosted.org> Jason R. Coombs added the comment: See https://github.com/pypa/setuptools/issues/3007#issuecomment-1068621865 where I did a brief analysis and probable explanation. What it boils down to: Setuptools needs to supply its own copy of distutils aggressively. It provides an opt out for this behavior and is able to offer built in opt out based on whatever signal is available. The default opt out is the SETUPTOOLS_USE_DISTUTILS=stdlib env var. for CPython, it also disables the behavior when ./pybuilddir.txt is present, but installed Pythons probably don?t have this config. Can those test runners be updated to set this environment variable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:19:48 2022 From: report at bugs.python.org (Ghyslain Leclerc) Date: Wed, 16 Mar 2022 01:19:48 +0000 Subject: [issue47033] Build failure on macOS Big Sur Message-ID: <1647393588.68.0.457618836458.issue47033@roundup.psfhosted.org> New submission from Ghyslain Leclerc : I have tried to compile python on macOS and I have failed. I have cloned the cpython repository, then used ./configure and make. There are build errors on my system. They seem related to https://bugs.python.org/issue42692. I have tried the __has_builtin(__builtin_available) code in a single main.c file and it compiles and has the appropriate behavior. I have then tried to add #warnings in the file posixmodule.c. It seems that when compiling this file, the preprocessor define does not work. I run macOS version 11.6.4 (20G417). I have Xcode Version 13.0 (13A233). The compiler version is: Apple clang version 13.0.0 (clang-1300.0.29.3) Target: x86_64-apple-darwin20.6.0 Thank you. ---------- components: macOS messages: 415312 nosy: Ghyslain Leclerc, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Build failure on macOS Big Sur type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:20:45 2022 From: report at bugs.python.org (Ghyslain Leclerc) Date: Wed, 16 Mar 2022 01:20:45 +0000 Subject: [issue47033] Build failure on macOS Big Sur In-Reply-To: <1647393588.68.0.457618836458.issue47033@roundup.psfhosted.org> Message-ID: <1647393645.61.0.360843515456.issue47033@roundup.psfhosted.org> Ghyslain Leclerc added the comment: Here is a build output. ---------- Added file: https://bugs.python.org/file50681/build.out _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:30:14 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 01:30:14 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647394214.66.0.169278758055.issue46948@roundup.psfhosted.org> miss-islington added the comment: New changeset 70eb9db39817a8f9abef801a2a4a7bb2c7411654 by Miss Islington (bot) in branch '3.9': bpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920) https://github.com/python/cpython/commit/70eb9db39817a8f9abef801a2a4a7bb2c7411654 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:36:27 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 01:36:27 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647394587.18.0.526830614239.issue47032@roundup.psfhosted.org> Steve Dower added the comment: New changeset 7c776521418676c074a483266339d31c950f516e by Steve Dower in branch 'main': bpo-47032: Ensure Windows install builds fail correctly with a non-zero exit code when part of the build fails (GH-31921) https://github.com/python/cpython/commit/7c776521418676c074a483266339d31c950f516e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:45:12 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 01:45:12 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647395112.47.0.807725068291.issue47032@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30017 pull_request: https://github.com/python/cpython/pull/31926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:45:36 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 01:45:36 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647395136.95.0.844034320681.issue47032@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30018 pull_request: https://github.com/python/cpython/pull/31927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 21:58:21 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 16 Mar 2022 01:58:21 +0000 Subject: [issue47033] Build failure on macOS Big Sur In-Reply-To: <1647393588.68.0.457618836458.issue47033@roundup.psfhosted.org> Message-ID: <1647395901.39.0.41011086236.issue47033@roundup.psfhosted.org> Ned Deily added the comment: You don't say exactly what changeset of the cpython repo you are trying to build from. The line numbers in the compiler warnings in your build.out extract do not seem to match up with either a current 3.10 branch checkout or a main branch checkout. Please make sure your repo is up-to-date with the current github version for whatever branch you are trying to build. You shouldn't have any problems like shown when building any of the current branches on macOS 11.6.x with its current Xcode or Command Line Tools installed. The Python Developers Guide might be of assistance: https://devguide.python.org If you still have problems, please show the output of: git show as well as the exact configure and make commands in use, and the complete configure and make output. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:00:38 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 16 Mar 2022 02:00:38 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647396038.32.0.208695698401.issue46948@roundup.psfhosted.org> Ned Deily added the comment: New changeset 4a1d65fe8528c3a6e0cf2f4f9d4b58249164589d by Miss Islington (bot) in branch '3.7': bpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920) (GH-31925) https://github.com/python/cpython/commit/4a1d65fe8528c3a6e0cf2f4f9d4b58249164589d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:07:53 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 02:07:53 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647396473.82.0.0300455730544.issue47032@roundup.psfhosted.org> miss-islington added the comment: New changeset 04fdbb4f7003a7399f7ba626cf548e2b9dac1045 by Steve Dower in branch '3.10': [3.10] bpo-47032: Ensure Windows install builds fail correctly with a non-zero exit code when part of the build fails (GH-31921) (GH-31926) https://github.com/python/cpython/commit/04fdbb4f7003a7399f7ba626cf548e2b9dac1045 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:11:47 2022 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2022 02:11:47 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647396707.22.0.426072705685.issue45150@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +30019 pull_request: https://github.com/python/cpython/pull/31928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:12:09 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 02:12:09 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647396729.56.0.327630677386.issue47032@roundup.psfhosted.org> miss-islington added the comment: New changeset ad6ddd89006b9fa4836a944c99f8076f26faf299 by Steve Dower in branch '3.9': [3.9] bpo-47032: Ensure Windows install builds fail correctly with a non-zero exit code when part of the build fails (GH-31921) (GH-31927) https://github.com/python/cpython/commit/ad6ddd89006b9fa4836a944c99f8076f26faf299 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:14:05 2022 From: report at bugs.python.org (Aur Saraf) Date: Wed, 16 Mar 2022 02:14:05 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647396845.79.0.938181544875.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: PR contains a draft implementation, would appreciate some review before I implement the same interface on all builtin hashes as well as OpenSSL hashes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:21:23 2022 From: report at bugs.python.org (Aur Saraf) Date: Wed, 16 Mar 2022 02:21:23 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647397283.85.0.45925942384.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: The rationale behind `from_raw_file()` and the special treatment of non-buffered IO is that there is no `read_buffer()` API or other clean way to say "I want to read just what's currently in the buffer so that from now on I could read directly from the file descriptor without harm". If you want to read from a buffered file object, sure, just call `from_file()`. If you want to ensure you'll get full performance benefits, call `from_raw_file()`. If you pass an eligible file object to `from_file()` you'll get the benefits anyway, because why not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:28:31 2022 From: report at bugs.python.org (Ghyslain Leclerc) Date: Wed, 16 Mar 2022 02:28:31 +0000 Subject: [issue47033] Build failure on macOS Big Sur In-Reply-To: <1647393588.68.0.457618836458.issue47033@roundup.psfhosted.org> Message-ID: <1647397711.96.0.584928030895.issue47033@roundup.psfhosted.org> Change by Ghyslain Leclerc : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:28:14 2022 From: report at bugs.python.org (Ghyslain Leclerc) Date: Wed, 16 Mar 2022 02:28:14 +0000 Subject: [issue47033] Build failure on macOS Big Sur In-Reply-To: <1647393588.68.0.457618836458.issue47033@roundup.psfhosted.org> Message-ID: <1647397694.84.0.0609538329826.issue47033@roundup.psfhosted.org> Ghyslain Leclerc added the comment: Thank you for your quick answer. Your comment about the configure output has made me think to look at it more carefully. No error was reported, so I did not think to look at it before. Looking at it and trying to figure out the problems, I figured out the problem and was able to compile. Just to give more info for anyone running into the same problem, I had a clean checkout of the v3.10.2 tag. The problem was that I actually had a gcc version installed from MacPorts and it seems that it was getting picked up. When I removed it from my path, everything started compiling fine. Sorry for making you waste your time. This issue can be closed. Thanks again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:33:13 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 16 Mar 2022 02:33:13 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647397993.24.0.875013835529.issue47025@roundup.psfhosted.org> Jason R. Coombs added the comment: I'd advocate for not supporting bytes paths and instead updating the documentation to require strings. ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:36:04 2022 From: report at bugs.python.org (Aur Saraf) Date: Wed, 16 Mar 2022 02:36:04 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647398164.57.0.670119740472.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: Forgot an important warning: this is the first time I write C code against the Python API, and I didn't thoroughly read the guide (or at all, to be honest). I think I did a good job, but please suspect my code of noob errors. I'm especially not confident that it's OK to not do any special handling of signals. Can read() return 0 if it was interrupted by a signal? This will stop the hash calculation midway and behave as if it succeeded. Sounds suspiciously like something we don't want. Also, I probably should support signals because such a long operation is something the user definitely might want to interrupt? May I have some guidance please? Would it be enough to copy the code from fileutils.c _Py_Read() and addi an outer loop so we can do many reads with the GIL released and still call PyErr_CheckSignals when needed with the GIL taken? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:36:53 2022 From: report at bugs.python.org (conio) Date: Wed, 16 Mar 2022 02:36:53 +0000 Subject: [issue46744] installers on ARM64 suggest wrong folders In-Reply-To: <1644796252.37.0.322200421464.issue46744@roundup.psfhosted.org> Message-ID: <1647398213.87.0.570345747834.issue46744@roundup.psfhosted.org> conio added the comment: I opened a PR for this change (https://github.com/python/cpython/pull/31803). I'd appreciate your comments and/or approval. I didn't add anything to the NEWS.d folder since it seems to me like something completely internal to the build process and so minor not worth mentioning there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 15 22:58:43 2022 From: report at bugs.python.org (Aur Saraf) Date: Wed, 16 Mar 2022 02:58:43 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647399523.17.0.719700221448.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: Added an attempt to handle signals. I don't think it's working, because when I press Ctrl+C while hashing a long file, it only raises KeyboardInterrupt after waiting the amount of time it usually takes the C code to return, but maybe that's not a good test? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 00:00:42 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 16 Mar 2022 04:00:42 +0000 Subject: [issue47009] Streamline list.append for the common case In-Reply-To: <1647233858.4.0.304324509353.issue47009@roundup.psfhosted.org> Message-ID: <1647403242.88.0.788447694377.issue47009@roundup.psfhosted.org> Inada Naoki added the comment: Thank you. I agree that inlining is worth enough. But we already inlined too many functions in ceval and there is an issue caused by it... (bpo-45116) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 03:54:10 2022 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2022 07:54:10 +0000 Subject: [issue34861] Improve cProfile standard output In-Reply-To: <1538392397.89.0.545547206417.issue34861@psf.upfronthosting.co.za> Message-ID: <1647417250.28.0.159371109419.issue34861@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +30020 pull_request: https://github.com/python/cpython/pull/31929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:31:29 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Wed, 16 Mar 2022 08:31:29 +0000 Subject: =?utf-8?q?=5Bissue46507=5D_enabling_cProfile_to_profile_code_given_as_an_?= =?utf-8?q?argument_=22=C3=A0_la=22_timeit?= In-Reply-To: <1643059545.59.0.789365625233.issue46507@roundup.psfhosted.org> Message-ID: <1647419489.98.0.273133001597.issue46507@roundup.psfhosted.org> Dani?l van Noord added the comment: There were some comments on the (now closed) PR associated to this report. One was about requiring a new flag to tell cProfile to consider the code in question code instead of a file path. `-c` was proposed, I presume abbreviating `--code`. Is this indeed the way to go? Allow `cProfile` to profile code directly by supplying the `-c` or `--code` argument, which indicates that the last argument should be considered code instead of a file path? ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 04:34:17 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Wed, 16 Mar 2022 08:34:17 +0000 Subject: [issue25804] Make Profile.print_stats support sorting by mutiple values In-Reply-To: <1449303952.27.0.310214243782.issue25804@psf.upfronthosting.co.za> Message-ID: <1647419657.21.0.139675676866.issue25804@roundup.psfhosted.org> Dani?l van Noord added the comment: @wdv4758h, do you think you will be able to resubmit the patch to Github? This would probably still be a useful addition and some review has already been done. If not, I could pick up the patch and re-submit, but I don't want to take credit for your work unnecessarily. ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 05:17:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Mar 2022 09:17:27 +0000 Subject: [issue26545] [doc] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1647422247.73.0.197838831805.issue26545@roundup.psfhosted.org> Irit Katriel added the comment: I agree with Stanley. The documentation for os is clear that recursion is used and the documentation for RecursionError links to getrecursionlimit(). This seems sufficient. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:12:15 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 16 Mar 2022 10:12:15 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647425535.35.0.0876356660576.issue46948@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2b97cfdce8df9d0d455f65a22b1e0d34a29dc200 by Miss Islington (bot) in branch '3.8': bpo-46948: Fix launcher installer build failure due to first part of fix (GH-31920) (GH-31924) https://github.com/python/cpython/commit/2b97cfdce8df9d0d455f65a22b1e0d34a29dc200 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:12:59 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 16 Mar 2022 10:12:59 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647425579.48.0.627800500437.issue31327@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4d8e08b21ce5d2cc08da82cf9f3ca50d9617cbdc by Miss Islington (bot) in branch '3.8': bpo-31327: Update time documentation to reflect possible errors (GH-31460) (GH-31827) https://github.com/python/cpython/commit/4d8e08b21ce5d2cc08da82cf9f3ca50d9617cbdc ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:13:59 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 16 Mar 2022 10:13:59 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1647425639.31.0.783254164342.issue45382@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0b0609d0d1a2f231c94bab2177095dd9a46fc137 by Miss Islington (bot) in branch '3.9': [3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891) (GH-30894) https://github.com/python/cpython/commit/0b0609d0d1a2f231c94bab2177095dd9a46fc137 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 06:23:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Mar 2022 10:23:07 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1647426187.12.0.15695074392.issue31327@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 07:00:49 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 16 Mar 2022 11:00:49 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1647428449.9.0.376966272127.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: > However, it's the site.py module that actually updates sys.prefix for the venv. So you may just be inspecting at the wrong point? Or possibly it's in a codepath that doesn't run on macOS because *previously* it was being set correctly in getpath instead of being deferred until later? I just noticed the same. Is this intentional? This means that "python -S" doesn't work with a virtual environment. I also noticed that site.py's venv support contains some special code for framework builds that shouldn't be necessary. But I guess that's something for some other tickets. I'm pretty sure I now just have to clean up my patch and create a PR from it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 07:26:31 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 11:26:31 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1647428449.9.0.376966272127.issue46890@roundup.psfhosted.org> Message-ID: <648718f7-ec1c-dc57-c088-933b559c9535@python.org> Steve Dower added the comment: > I just noticed the same. Is this intentional? Honestly, no idea. I just copied how it was designed before, and had nothing to do with the original venv implementation. At a guess, I think virtualenv did everything with a patched site.py, so when it was absorbed as venv it was retained. Changing this to calculate more in getpath.py was a goal of the rewrite, it just wasn't one that I wanted to do at the same time as the conversion, and am not particularly motivated to do myself anyway (when I hack install layouts, I don't use venvs at all ;) ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 07:49:27 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 16 Mar 2022 11:49:27 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647431367.41.0.542638454506.issue45150@roundup.psfhosted.org> Christian Heimes added the comment: Before we continue hacking on an implementation, let's discuss some API design. - Multiple functions or multiple dispatch (name, fileobj) are confusing to users. Let's keep it simple and only implement one function that operates on file objects. - The function should work with most binary file-like including open(..., "rb"), BytesIO, SocketIO. mmap.mmap() is not file-like enough. Anon mapping doesn't provide a fileno and the mmap object has no readinto(). - The function should accept either digest name, digest constructor, or a callable that returns a digest object. The latter makes it possible to reuse file_digest() with MAC constructs like HMAC. - Don't do any I/O in C unless you are prepared to enter a world of pain and suffering. It's hard to get it right across platforms. For example your C code does not work for SocketIO on Windows. - If we decide to implement an accelerator in C, then we don't have to bother with our fallback copies like _sha256module.c. They are slow and only used when OpenSSL is not available. ---------- assignee: tarek -> christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 07:49:42 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 16 Mar 2022 11:49:42 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647431382.84.0.886165328319.issue45150@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30021 pull_request: https://github.com/python/cpython/pull/31930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 08:17:46 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Wed, 16 Mar 2022 12:17:46 +0000 Subject: [issue35212] Expressions with format specifiers in f-strings give wrong code position in AST In-Reply-To: <1541939640.9.0.788709270274.issue35212@psf.upfronthosting.co.za> Message-ID: <1647433066.65.0.915553575395.issue35212@roundup.psfhosted.org> Dani?l van Noord added the comment: This was fixed by https://github.com/python/cpython/pull/27729. On 3.10: ```console >>> ast.parse("f'{a}'").body[0].value.values[0].value.col_offset 3 >>> ast.parse("f'{a:b}'").body[0].value.values[0].value.col_offset 3 ``` The other issue also no longer reproduces. ---------- message_count: 3.0 -> 4.0 nosy: +danielnoord nosy_count: 5.0 -> 6.0 pull_requests: +30022 pull_request: https://github.com/python/cpython/pull/27729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 08:19:31 2022 From: report at bugs.python.org (Maximilian Hils) Date: Wed, 16 Mar 2022 12:19:31 +0000 Subject: [issue43253] asyncio open_connection fails when a socket is explicitly closed In-Reply-To: <1613655985.97.0.0380110039523.issue43253@roundup.psfhosted.org> Message-ID: <1647433170.99.0.0411389557931.issue43253@roundup.psfhosted.org> Maximilian Hils added the comment: Thank you for the super quick turnaround. My heart goes out to you and everyone else in Ukraine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 08:23:37 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 12:23:37 +0000 Subject: [issue47032] CI does not detect launcher installer build failure In-Reply-To: <1647390054.87.0.900076587852.issue47032@roundup.psfhosted.org> Message-ID: <1647433417.97.0.194218236603.issue47032@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 Mar 16 08:23:48 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 12:23:48 +0000 Subject: [issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer In-Reply-To: <1646670798.02.0.138739339843.issue46948@roundup.psfhosted.org> Message-ID: <1647433428.56.0.449716566385.issue46948@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 Mar 16 08:23:28 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 16 Mar 2022 12:23:28 +0000 Subject: [issue35212] Expressions with format specifiers in f-strings give wrong code position in AST In-Reply-To: <1541939640.9.0.788709270274.issue35212@psf.upfronthosting.co.za> Message-ID: <1647433408.72.0.867291207165.issue35212@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Incorrect exception highlighting for fstring format _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 09:35:32 2022 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2022 13:35:32 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647437732.51.0.0542184537842.issue2604@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +30023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 09:35:32 2022 From: report at bugs.python.org (Roundup Robot) Date: Wed, 16 Mar 2022 13:35:32 +0000 Subject: [issue9736] doctest.DocTestSuite doesn't handle test globs correctly In-Reply-To: <1283367674.32.0.228375766546.issue9736@psf.upfronthosting.co.za> Message-ID: <1647437732.63.0.109460824538.issue9736@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +30024 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 09:37:03 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Wed, 16 Mar 2022 13:37:03 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647437823.23.0.174560414491.issue2604@roundup.psfhosted.org> Dani?l van Noord added the comment: I have created a PR that combines the patch here with the patch from issue9736. ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 09:58:33 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 16 Mar 2022 13:58:33 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1647439113.15.0.181090443851.issue46329@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +30025 pull_request: https://github.com/python/cpython/pull/31933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:18:28 2022 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 16 Mar 2022 14:18:28 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647440308.9.0.77730629693.issue47025@roundup.psfhosted.org> Thomas Grainger added the comment: > I'd advocate for not supporting bytes paths and instead updating the documentation to require strings. I've got PR GH-31934 started to do this ---------- message_count: 8.0 -> 9.0 pull_requests: +30026 pull_request: https://github.com/python/cpython/pull/31934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:24:35 2022 From: report at bugs.python.org (jeffersonqin) Date: Wed, 16 Mar 2022 14:24:35 +0000 Subject: [issue47034] pickle not working correctly when custom field is directly initialized by constructors Message-ID: <1647440675.94.0.131191569547.issue47034@roundup.psfhosted.org> New submission from jeffersonqin <1247006353 at qq.com>: For the following code piece: ``` import pickle class Child: def __init__(self, field): self.field = field class Parent: child = Child(0.5) if __name__ == '__main__': i = input() if i == 'd': parent = Parent() parent.child.field = 0.6 pickle.dump(parent, open('test.pkl', 'wb+')) else: parent = pickle.load(open('test.pkl', 'rb')) print(parent.child.field) ``` After dumping, when we load the file throught `pickles.load`, `parent.child.field` is 0.5, and is not 0.6, which we intend it to be. However, after removing the line `child = Child(0.5)` and moving it to `__init__(self)` of `Parent`, everything works fine. I'm not sure whether this is indeed an issue. If not, sorry for take your time. ---------- components: Library (Lib) files: test.py messages: 415341 nosy: jeffersonqin priority: normal severity: normal status: open title: pickle not working correctly when custom field is directly initialized by constructors type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50682/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:25:28 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 14:25:28 +0000 Subject: [issue47035] Rewrite asyncio queue tests with IsolatedAsyncioTestCase Message-ID: <1647440728.46.0.0769834491684.issue47035@roundup.psfhosted.org> New submission from Andrew Svetlov : It can help with future maintenance a lot. Current tests are cumbersome. ---------- components: asyncio messages: 415342 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Rewrite asyncio queue tests with IsolatedAsyncioTestCase versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:29:38 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 16 Mar 2022 14:29:38 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1647440978.09.0.404774170154.issue46890@roundup.psfhosted.org> Eryk Sun added the comment: > This means that "python -S" doesn't work with a virtual environment. Does that matter? I've only used a virtual environment to override or extend the system site packages. Is there a reason to use one without site packages? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:34:38 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 14:34:38 +0000 Subject: [issue47035] Rewrite asyncio queue tests with IsolatedAsyncioTestCase In-Reply-To: <1647440728.46.0.0769834491684.issue47035@roundup.psfhosted.org> Message-ID: <1647441278.59.0.579680651083.issue47035@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30027 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 10:48:18 2022 From: report at bugs.python.org (PySimpleGUI) Date: Wed, 16 Mar 2022 14:48:18 +0000 Subject: [issue46180] Button clicked failed when mouse hover tooltip and tooltip destroyed In-Reply-To: <1640515148.68.0.766649384181.issue46180@roundup.psfhosted.org> Message-ID: <1647442098.86.0.695945216512.issue46180@roundup.psfhosted.org> PySimpleGUI added the comment: We've been able to verify this is a problem on Windows, Mac and Linux using the code that Jason posted earlier. Here's a video of the behavior on Linux. The problem you'll see is that button click events stop being generated. I'm hoping this is a symptom of a larger problem as there are other problems we've seen on 8.6.12. This is unusual as tkinter has been rock solid since I've been using it over the past few years. https://user-images.githubusercontent.com/46163555/158422534-964b7edb-f845-468b-adba-57f9139009c4.mp4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:04:06 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 16 Mar 2022 15:04:06 +0000 Subject: [issue46939] Specialize calls for Python classes In-Reply-To: <1646574571.32.0.472167982786.issue46939@roundup.psfhosted.org> Message-ID: <1647443046.64.0.601044571983.issue46939@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +30028 pull_request: https://github.com/python/cpython/pull/31936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:13:56 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 16 Mar 2022 15:13:56 +0000 Subject: [issue47034] pickle not working correctly when custom field is directly initialized by constructors In-Reply-To: <1647440675.94.0.131191569547.issue47034@roundup.psfhosted.org> Message-ID: <1647443636.34.0.308919049349.issue47034@roundup.psfhosted.org> Eric V. Smith added the comment: child is not an attribute of a Parent instance, but rather of the Parent class. So it's not going to be saved when you dump "parent", which is an instance of Parent. I'm not sure what you're doing when you create a Parent.__init__ method, but presumably setting self.child, which will then create an instance attribute which will get saved by pickle. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:19:47 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 16 Mar 2022 15:19:47 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1647443987.63.0.630043371614.issue46890@roundup.psfhosted.org> Ronald Oussoren added the comment: venv requiring site isn't really a problem, although it is a bit weird that sys.prefix changes when using the -S flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:24:53 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 15:24:53 +0000 Subject: [issue47035] Rewrite asyncio queue tests with IsolatedAsyncioTestCase In-Reply-To: <1647440728.46.0.0769834491684.issue47035@roundup.psfhosted.org> Message-ID: <1647444293.73.0.601271174273.issue47035@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:25:04 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 15:25:04 +0000 Subject: [issue47035] Rewrite asyncio queue tests with IsolatedAsyncioTestCase In-Reply-To: <1647440728.46.0.0769834491684.issue47035@roundup.psfhosted.org> Message-ID: <1647444304.43.0.122170619363.issue47035@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:52:49 2022 From: report at bugs.python.org (jeffersonqin) Date: Wed, 16 Mar 2022 15:52:49 +0000 Subject: [issue47034] pickle not working correctly when custom field is directly initialized by constructors In-Reply-To: <1647440675.94.0.131191569547.issue47034@roundup.psfhosted.org> Message-ID: <1647445969.09.0.539830151066.issue47034@roundup.psfhosted.org> jeffersonqin <1247006353 at qq.com> added the comment: Thanks! This fully answers my question. Sorry, but I've got another question regards to your answer. It is that when I deal with other fields in class Parent similar to child, with the only difference is that their types are builtin types such as integer and boolean, everything works fine and can be correctly serialized after been modified. What's the difference between these two cases? Again, sorry for disturbing and thanks a lot for your detailed answer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:56:36 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 16 Mar 2022 15:56:36 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1647446196.62.0.0822783949278.issue46769@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 81b425d4dc43b60dd11a3e9abc5c84a4b8b384db by Alex Waygood in branch 'main': bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712) https://github.com/python/cpython/commit/81b425d4dc43b60dd11a3e9abc5c84a4b8b384db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 11:58:37 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 16 Mar 2022 15:58:37 +0000 Subject: [issue47034] pickle not working correctly when custom field is directly initialized by constructors In-Reply-To: <1647440675.94.0.131191569547.issue47034@roundup.psfhosted.org> Message-ID: <1647446317.39.0.262700579223.issue47034@roundup.psfhosted.org> Eric V. Smith added the comment: You're probably doing something like: parent.i = 3 instead of: parent.child.field = 0.6 In the first one, you're setting an instance attribute on parent, on the second, you're modifying an attribute of the class attribute. In any event, there's no bug here, so I'm going to close this. If you have followup questions, I suggest you use the python-list mailing list or https://discuss.python.org/c/users ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 12:27:25 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 16 Mar 2022 16:27:25 +0000 Subject: [issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected In-Reply-To: <1647368913.23.0.350559928091.issue47029@roundup.psfhosted.org> Message-ID: <1647448045.13.0.249319513391.issue47029@roundup.psfhosted.org> G?ry added the comment: I forgot to include the output of the above program: ``` Traceback (most recent call last): File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/queues.py", line 251, in _feed send_bytes(obj) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 205, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 416, in _send_bytes self._send(header + buf) File "/usr/local/Cellar/python at 3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 373, in _send n = write(self._handle, buf) BrokenPipeError: [Errno 32] Broken pipe ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 12:44:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Mar 2022 16:44:32 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647449072.52.0.958856785486.issue45979@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30029 pull_request: https://github.com/python/cpython/pull/31938 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 12:54:37 2022 From: report at bugs.python.org (Mark Mentovai) Date: Wed, 16 Mar 2022 16:54:37 +0000 Subject: [issue38435] Start the deprecation cycle for subprocess preexec_fn In-Reply-To: <1570731497.4.0.313201495913.issue38435@roundup.psfhosted.org> Message-ID: <1647449677.74.0.318498540324.issue38435@roundup.psfhosted.org> Mark Mentovai added the comment: Another use case for preexec_fn: establishing a new controlling terminal, typically in conjunction with start_new_session=True. A preexec_fn may do something like os.close(os.open(os.ttyname(sys.stdin.fileno(), os.O_RDWR))) with discussion at https://chromium-review.googlesource.com/c/chromium/src/+/3524204/comments/59f03e7c_f103cd7e. ---------- nosy: +markmentovai _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 13:16:49 2022 From: report at bugs.python.org (munky) Date: Wed, 16 Mar 2022 17:16:49 +0000 Subject: [issue47036] Nested list in Dict, multiprocessing manager Message-ID: <1647451009.46.0.388425415857.issue47036@roundup.psfhosted.org> New submission from munky : Sorry for this post but I found an unusual behaviour. from multiprocessing import Manager manager = Manager() managerdict = manager.dict() managerdict["first"]= {"stat" : [0,1]} managerdict["first"]["stat"][0] += 1 managerdict["first"]["stat"][1] += 1 print(managerdict) anotherdict = {} anotherdict['foo'] = {"stat" : [0, 1]} anotherdict['foo']["stat"][0] += 1 anotherdict['foo']["stat"][1] += 1 print(anotherdict) Which outputs: {'first': {'stat': [0, 1]}} {'foo': {'stat': [1, 2]}} What am I doing wrong? Thanks! ---------- components: Library (Lib) messages: 415353 nosy: munky99999 priority: normal severity: normal status: open title: Nested list in Dict, multiprocessing manager type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 13:17:08 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Mar 2022 17:17:08 +0000 Subject: [issue30080] Add the --duplicate option for timeit In-Reply-To: <1492323164.81.0.971695586502.issue30080@psf.upfronthosting.co.za> Message-ID: <1647451028.64.0.275429289574.issue30080@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 13:39:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Mar 2022 17:39:22 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647452362.95.0.726972257627.issue45979@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset dbbe4d2d0075fa0e95b069fb4780d79aae3514c7 by Serhiy Storchaka in branch 'main': bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938) https://github.com/python/cpython/commit/dbbe4d2d0075fa0e95b069fb4780d79aae3514c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:01:25 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 16 Mar 2022 18:01:25 +0000 Subject: [issue46817] Add a line-start table to the code object. In-Reply-To: <1645448352.85.0.240103559175.issue46817@roundup.psfhosted.org> Message-ID: <1647453685.16.0.231044746294.issue46817@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:08:34 2022 From: report at bugs.python.org (munky) Date: Wed, 16 Mar 2022 18:08:34 +0000 Subject: [issue47036] Nested list in Dict, multiprocessing manager In-Reply-To: <1647451009.46.0.388425415857.issue47036@roundup.psfhosted.org> Message-ID: <1647454114.5.0.0205922460292.issue47036@roundup.psfhosted.org> Change by munky : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:30:03 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 16 Mar 2022 18:30:03 +0000 Subject: [issue47037] Build problems on Windows Message-ID: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> New submission from Terry J. Reedy : 3.11 apparently builds without error, and 'python' and 'python -m idlelib' appears to start normally, but there is a new problem. python -m test raises OS box with 'Debug Assertion Failed!', program python_d.exe, File minkernal\crts\ucrt\src\time\wcsftime.exe Line 1184, expression false. Dismiss box and a few tests run until box repeats and Command Prompt eventually locks. ...test test_idle finished OK once after dismissing box. On retry, test ran OK but CP locked instead of showing new prompt. 3.10 and 3.9 (but not 3.11): compiling show a newish warning. pythonw.vcxproj -> f:\dev\310\PCbuild\amd64\pythonw_d.exe pythonw.vcxproj -> f:\dev\310\PCbuild\amd64\pythonw_d.pdb (Full PDB) f:\dev\310\PCbuild\pythoncore.vcxproj(554,5): warning : A copy of vcruntime140.dll is also required Does not 3.11 also require this? (wherever it is supposed to be?). Aside from the warning, 3.10 appear to be working normally. There is no error box when starting tests and 50 have run so far without a box. ---------- components: Build, Windows messages: 415355 nosy: lukasz.langa, pablogsal, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Build problems on Windows type: compile error versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:41:57 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 18:41:57 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647456117.68.0.421858112262.issue45979@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +30030 pull_request: https://github.com/python/cpython/pull/31940 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:43:01 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 16 Mar 2022 18:43:01 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1647456181.99.0.195997868253.issue46769@roundup.psfhosted.org> Change by Alex Waygood : ---------- pull_requests: +30031 pull_request: https://github.com/python/cpython/pull/31941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:49:01 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 18:49:01 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647456541.49.0.537581585359.issue45979@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30032 pull_request: https://github.com/python/cpython/pull/31939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 14:51:44 2022 From: report at bugs.python.org (Aur Saraf) Date: Wed, 16 Mar 2022 18:51:44 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647456704.46.0.481208606987.issue45150@roundup.psfhosted.org> Aur Saraf added the comment: I don't think HMAC of a file is a common enough use case to support, but I have absolutely no problem conceding this point, the cost of supporting it is very low. I/O in C is a world of pain in general. In the specific case of `io.RawIOBase` objects (non-buffered binary files) to my understanding it's not _that_ terrible (am I right? Does my I/O code work as-is?). To my understanding, providing a fast path *just for this case* that calculates the hash without taking the GIL for every chunk would be very nice to have for many use cases. Now, we could just be happy with `file_digest()` having an `if` for `isinstance(io.RawIOBase)` that chooses a fast code path silently. But since non-buffered binary files are so hard to tell apart from other types of file-like objects, as a user of this code I would like to have a way to say "I want the fast path, please raise if I accidentally passed the wrong things and got the regular path". We could have `file_digest('sha256', open(path, 'rb', buffered=0), ensure_fast_io=True)`, but I think for this use case `raw_file_digest('sha256', open(path, 'rb', buffered=0))` is cleaner. In all other cases you just call `file_digest()`, probably get the Python I/O and not the C I/O, and are still happy to have that loop written for you by someone who knows what they're doing. For the same reason I think the fast path should only support hash names and not constructors/functions/etc', which would complicate it because new-object-can-be-accessed-without-GIL wouldn't necessarily apply. Does this make sense? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:11:00 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 16 Mar 2022 19:11:00 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <85afbb05-0cd9-fb08-70d2-b14d15241cb9@python.org> Steve Dower added the comment: This sounds more like recent installation changes on your machine. Have you updated Visual Studio or something like that? Perhaps the debug UCRT has gone missing. I'm not aware of any recent compilation changes that would cause this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:18:59 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 16 Mar 2022 19:18:59 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647458339.18.0.340265115326.issue47037@roundup.psfhosted.org> Tim Peters added the comment: Actually, I see this ('Debug Assertion Failed!' in the same spot) every time I try to run the test suite with a debug build, starting yesterday. Didn't have time to track it down. It _appeared_ to an obscure consequence of this commit: """ $ git log timemodule.c commit a4674f0194067a801f6c6bdb4fc6448e3a40e069 Author: Christian Heimes Date: Tue Mar 15 22:55:35 2022 +0200 bpo-40280: Detect presence of time.tzset and thread_time clock (GH-31898) """ ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:22:03 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 19:22:03 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase Message-ID: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> New submission from Andrew Svetlov : It simplifies future maintenance. ---------- components: Tests, asyncio messages: 415359 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:23:03 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 19:23:03 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647458583.76.0.106026528294.issue47038@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30033 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:30:48 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 16 Mar 2022 19:30:48 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647459048.56.0.484802073215.issue47037@roundup.psfhosted.org> Tim Peters added the comment: BTW, the frequency of this new failure mode appears to be vastly increased if running the debug tests with "-j0". For example, the box popping up is reliably the very first sign of life if I run this from the PCBuild directory: rt -q -d -j0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:49:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 19:49:22 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647460162.27.0.0721969748827.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset dd0082c627713634c7fd88ad33d18b5cc9f4a7b8 by Andrew Svetlov in branch 'main': bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942) https://github.com/python/cpython/commit/dd0082c627713634c7fd88ad33d18b5cc9f4a7b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:49:26 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 19:49:26 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647460166.02.0.337552858196.issue47038@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +30034 pull_request: https://github.com/python/cpython/pull/31943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 15:49:51 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 16 Mar 2022 19:49:51 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647460191.72.0.558952889463.issue47037@roundup.psfhosted.org> Eryk Sun added the comment: bpo-46587 added top-level code to "Lib/test/support/__init__.py" to check whether time.strftime("%4Y") works. Since "Lib/test/libregrtest/setup.py" imports the support module, that code executes before suppress_msvcrt_asserts() is called by setup_tests(). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:01:12 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 16 Mar 2022 20:01:12 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647460872.16.0.0425851455594.issue47037@roundup.psfhosted.org> Dennis Sweeney added the comment: indeed, bisected to 2cf7f865f099db11cc6903b334d9c376610313e8 is the first bad commit commit 2cf7f865f099db11cc6903b334d9c376610313e8 Author: Christian Heimes Date: Tue Mar 15 11:41:04 2022 +0200 bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873) Co-authored-by: Victor Stinner ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:10:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 20:10:35 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647461435.17.0.530803520518.issue47038@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30035 pull_request: https://github.com/python/cpython/pull/31944 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:15:19 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 20:15:19 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647461719.4.0.747987849749.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 4186dd662cf22613b21af948163978af4243a8d6 by Miss Islington (bot) in branch '3.10': bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942) (GH-31943) https://github.com/python/cpython/commit/4186dd662cf22613b21af948163978af4243a8d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:22:08 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 16 Mar 2022 20:22:08 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647462128.77.0.105862844167.issue47037@roundup.psfhosted.org> Christian Heimes added the comment: Ouch, is Python crashes because of an unsupported strftime call? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:26:37 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 16 Mar 2022 20:26:37 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647462397.88.0.84998941028.issue47037@roundup.psfhosted.org> Tim Peters added the comment: Christian, yes, but only in a debug build. See Eryk Sun's message a bit above: the machinery to prevent this is already present, but isn't getting called early enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:31:03 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 16 Mar 2022 20:31:03 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647462663.46.0.872392773066.issue47037@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30036 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:45:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 20:45:50 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647463550.41.0.723132961783.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 3244659521798417810100904f39ae5dabe60a7f by Andrew Svetlov in branch '3.9': [3.9] bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942). (GH-31944) https://github.com/python/cpython/commit/3244659521798417810100904f39ae5dabe60a7f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 16:46:16 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 20:46:16 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647463576.14.0.00665648639897.issue47038@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:08:47 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 16 Mar 2022 21:08:47 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647464927.05.0.278003554302.issue47037@roundup.psfhosted.org> Terry J. Reedy added the comment: Re the 3.9/3.10 warnings: I have not intentionally touched my C install in years. I don't know what Windows' updates do (most recently yesterday) . I presume vcruntime140.dll is on my C: ssd, which has shown no problems. Debug runs w/o -j0 normally take about 18 minutes. After 51 minutes, the 3.10 test run froze CP (as in, had to close with [X] and reopen). Output ends with "0:51:02 load avg: 0.01 [407/427] test_winconsoleio ?^Z" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:16:06 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 21:16:06 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647465366.83.0.614445301707.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: test_cancel_blocking_wait_for() / test_cancel_wait_for() is not converted still. ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:42:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 21:42:33 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647466953.84.0.043776747296.issue47038@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30037 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 17:59:21 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 16 Mar 2022 21:59:21 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647467961.95.0.957292319555.issue47037@roundup.psfhosted.org> Eryk Sun added the comment: > Ouch, is Python crashes because of an unsupported strftime call? It's not a crash. It's a CRT error report dialog, which is enabled by default for the _CRT_ASSERT and _CRT_ERROR macros in debug builds. This dialog can be helpful when debugging interactively. It gives a developer the option to abort, retry, or ignore. If a debugger is attached, the retry option breaks into the debugger. I attached a debugger to the test runner to diagnose the problem with format code "%4Y". For example: >>> time.strftime('%4Y') Debug Assertion Failed! [...] (Press Retry to debug the application) (1a6c.101c): Break instruction exception - code 80000003 (first chance) ucrtbased!_Wcsftime_l+0x5af: 00007ff8`a582b9af cc int 3 backtrace: 0:000> kc 4 Call Site ucrtbased!_Wcsftime_l ucrtbased!_Strftime_l ucrtbased!strftime python311_d!time_strftime locals: 0:000> dv _Expr_val = 0n0 string = 0x00000226`fe38d1c0 "" max_size = 0x400 format = 0x00000226`fe37e7d0 "%4Y" timeptr = 0x00000041`c1feeda0 lc_time_arg = 0x00000000`00000000 locale = 0x00000000`00000000 locale_update = class _LocaleUpdate format_it = 0x00000226`fe37e7d2 "4Y" remaining = 0x400 lc_time = 0x00007ff8`a5868550 failed = true string_it = 0x00000226`fe38d1c0 "" resume, with the STATUS_BREAKPOINT (0x80000003) exception handled: 0:000> gh Traceback (most recent call last): File "", line 1, in ValueError: Invalid format string >>> For non-interactive testing the report mode needs to be configured to 0 (no report) or to report to stderr. For example: >>> msvcrt.CrtSetReportMode(msvcrt.CRT_ERROR, msvcrt.CRTDBG_MODE_FILE) 4 >>> msvcrt.CrtSetReportFile(msvcrt.CRT_ERROR, msvcrt.CRTDBG_FILE_STDERR) 18446744073709551615 >>> os.abort() abort() has been called For time.strftime('%4Y'), the source of the report is _VALIDATE_RETURN(false, EINVAL, 0) in _Wcsftime_l(). This macro includes an _ASSERT_EXPR(expr, msg) check. In a debug build, this calls _CrtDbgReportW(_CRT_ASSERT, ...) if the expression is false. If the latter returns 1 (retry), the __debugbreak() intrinsic is called to break into the debugger. To suppress the dialog, either temporarily set the CRT_ASSERT report mode to 0, or set it to report to stderr. For example: >>> msvcrt.CrtSetReportMode(msvcrt.CRT_ASSERT, msvcrt.CRTDBG_MODE_FILE) 4 >>> msvcrt.CrtSetReportFile(msvcrt.CRT_ASSERT, msvcrt.CRTDBG_FILE_STDERR) 18446744073709551615 >>> time.strftime('%4Y') minkernel\crts\ucrt\src\appcrt\time\wcsftime.cpp(1163) : Assertion failed: false Traceback (most recent call last): File "", line 1, in ValueError: Invalid format string ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 18:30:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 16 Mar 2022 22:30:26 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647469826.07.0.756105077355.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30038 pull_request: https://github.com/python/cpython/pull/31947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:20:34 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 23:20:34 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647472834.28.0.0256139555102.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 3dd9bfac04d3dcdbfd3f8011a6c9d4b9ac8c116a by Andrew Svetlov in branch 'main': bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946) https://github.com/python/cpython/commit/3dd9bfac04d3dcdbfd3f8011a6c9d4b9ac8c116a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:20:57 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 23:20:57 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647472857.78.0.721747265403.issue47038@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30039 pull_request: https://github.com/python/cpython/pull/31948 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:21:02 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 23:21:02 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647472862.82.0.622611210377.issue47038@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30040 pull_request: https://github.com/python/cpython/pull/31949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:44:30 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Mar 2022 23:44:30 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647474270.07.0.429527516663.issue47038@roundup.psfhosted.org> miss-islington added the comment: New changeset 0412e3ae03a694af1e27d4af61ca503a6513394d by Miss Islington (bot) in branch '3.9': bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946) https://github.com/python/cpython/commit/0412e3ae03a694af1e27d4af61ca503a6513394d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:53:06 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 23:53:06 +0000 Subject: [issue47039] Normalize asyncio future and task repr() Message-ID: <1647474786.61.0.902124780631.issue47039@roundup.psfhosted.org> New submission from Andrew Svetlov : Return `...` in the case of recursive representation. Now the only result is replaced with `...`, all other future properties are still printed. It doesn't follow `repr()` for other stdlib objects. ---------- components: asyncio messages: 415375 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Normalize asyncio future and task repr() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 19:55:11 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 16 Mar 2022 23:55:11 +0000 Subject: [issue47039] Normalize asyncio future and task repr() In-Reply-To: <1647474786.61.0.902124780631.issue47039@roundup.psfhosted.org> Message-ID: <1647474911.33.0.309478580779.issue47039@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30041 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:13:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Mar 2022 00:13:34 +0000 Subject: [issue1573931] WSGI, cgi.FieldStorage incompatibility Message-ID: <1647476014.6.0.602497591913.issue1573931@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:18:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Mar 2022 00:18:42 +0000 Subject: [issue24080] asyncio.Event.wait() Task was destroyed but it is pending In-Reply-To: <1430402398.63.0.270088920542.issue24080@psf.upfronthosting.co.za> Message-ID: <1647476322.3.0.903985784374.issue24080@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:19:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 00:19:55 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647476395.55.0.588631595881.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 36f62c55759c4246f969f60f7470ba756f77b268 by Miss Islington (bot) in branch '3.10': bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946) (#31948) https://github.com/python/cpython/commit/36f62c55759c4246f969f60f7470ba756f77b268 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:23:06 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 00:23:06 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647476586.65.0.565138533459.issue47038@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30042 pull_request: https://github.com/python/cpython/pull/31951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:36:11 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 17 Mar 2022 00:36:11 +0000 Subject: [issue45116] Performance regression 3.10b1: inlining issue in the big _PyEval_EvalFrameDefault() function with Visual Studio (MSC) In-Reply-To: <1630942038.24.0.156228540374.issue45116@roundup.psfhosted.org> Message-ID: <1647477371.27.0.244560753955.issue45116@roundup.psfhosted.org> Guido van Rossum added the comment: I can't yet confirm a regression in 3.11 (the main branch, currently) compared to 3.10. See my adventures in https://github.com/faster-cpython/ideas/discussions/315. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:54:45 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 00:54:45 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647478485.1.0.611127121567.issue47038@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset a7c54148322781cb0f332d440a3454d550ef6414 by Andrew Svetlov in branch 'main': bpo-47038: Increase a test timeout for slow CI machines (GH-31951) https://github.com/python/cpython/commit/a7c54148322781cb0f332d440a3454d550ef6414 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:54:48 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 00:54:48 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647478488.22.0.853933720305.issue47038@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30043 pull_request: https://github.com/python/cpython/pull/31952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 20:54:51 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 00:54:51 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647478491.89.0.0477566749294.issue47038@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30044 pull_request: https://github.com/python/cpython/pull/31953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 21:03:15 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 01:03:15 +0000 Subject: [issue47039] Normalize asyncio future and task repr() In-Reply-To: <1647474786.61.0.902124780631.issue47039@roundup.psfhosted.org> Message-ID: <1647478995.25.0.099262344575.issue47039@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 30b5d41fabad04f9f34d603f1ce2249452c18c71 by Andrew Svetlov in branch 'main': bpo-47039: Normalize repr() of asyncio future and task objects (GH-31950) https://github.com/python/cpython/commit/30b5d41fabad04f9f34d603f1ce2249452c18c71 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 21:03:44 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 01:03:44 +0000 Subject: [issue47039] Normalize asyncio future and task repr() In-Reply-To: <1647474786.61.0.902124780631.issue47039@roundup.psfhosted.org> Message-ID: <1647479024.1.0.596923276495.issue47039@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 21:19:36 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 01:19:36 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647479976.59.0.10768775266.issue47038@roundup.psfhosted.org> miss-islington added the comment: New changeset 4e9bb27eaeb8bedcec6f25f4345824b50fc25337 by Miss Islington (bot) in branch '3.9': bpo-47038: Increase a test timeout for slow CI machines (GH-31951) https://github.com/python/cpython/commit/4e9bb27eaeb8bedcec6f25f4345824b50fc25337 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 21:20:13 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 01:20:13 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647480013.48.0.825818318313.issue47038@roundup.psfhosted.org> miss-islington added the comment: New changeset ba76f901923d80ad9b24bb1636aa751d55e0c768 by Miss Islington (bot) in branch '3.10': bpo-47038: Increase a test timeout for slow CI machines (GH-31951) https://github.com/python/cpython/commit/ba76f901923d80ad9b24bb1636aa751d55e0c768 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 22:41:25 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 02:41:25 +0000 Subject: [issue22859] unittest.TestProgram.usageExit no longer invoked In-Reply-To: <1415874322.06.0.308310544849.issue22859@psf.upfronthosting.co.za> Message-ID: <1647484885.73.0.960527939916.issue22859@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 7c353b7594545fb9403b3123a17ad06cadc2f73d by Carlos Damazio in branch 'main': bpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293) https://github.com/python/cpython/commit/7c353b7594545fb9403b3123a17ad06cadc2f73d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 22:41:51 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 02:41:51 +0000 Subject: [issue22859] unittest.TestProgram.usageExit no longer invoked In-Reply-To: <1415874322.06.0.308310544849.issue22859@psf.upfronthosting.co.za> Message-ID: <1647484911.13.0.65623452177.issue22859@roundup.psfhosted.org> Jelle Zijlstra added the comment: It is now marked deprecated, to be removed in 3.13. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 23:02:39 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 03:02:39 +0000 Subject: [issue46480] Implement typing.assert_type In-Reply-To: <1642915152.65.0.424582308271.issue46480@roundup.psfhosted.org> Message-ID: <1647486159.5.0.553763481238.issue46480@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 96568e995d840c66edb25b6b9d85e4dcccf5a936 by Jelle Zijlstra in branch 'main': bpo-46480: add typing.assert_type (GH-30843) https://github.com/python/cpython/commit/96568e995d840c66edb25b6b9d85e4dcccf5a936 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 16 23:04:56 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 03:04:56 +0000 Subject: [issue46480] Implement typing.assert_type In-Reply-To: <1642915152.65.0.424582308271.issue46480@roundup.psfhosted.org> Message-ID: <1647486296.93.0.989720777284.issue46480@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 00:11:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 04:11:05 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647490265.36.0.0860319971355.issue43224@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +30045 pull_request: https://github.com/python/cpython/pull/31954 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 01:35:08 2022 From: report at bugs.python.org (Ma Lin) Date: Thu, 17 Mar 2022 05:35:08 +0000 Subject: [issue47040] Remove an invalid versionchanged in doc Message-ID: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> New submission from Ma Lin : Since CPython 3.0.0, the checksums are always truncated to `unsigned int`: https://github.com/python/cpython/blob/v3.0/Modules/zlibmodule.c#L930 https://github.com/python/cpython/blob/v3.0/Modules/zlibmodule.c#L950 ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 415386 nosy: docs at python, gregory.p.smith, malin priority: normal severity: normal status: open title: Remove an invalid versionchanged in doc versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 01:39:59 2022 From: report at bugs.python.org (yonghao hu) Date: Thu, 17 Mar 2022 05:39:59 +0000 Subject: [issue47041] requests module parse url failed Message-ID: <1647495599.59.0.763514720796.issue47041@roundup.psfhosted.org> New submission from yonghao hu : Run the following code or report an error, and the URL is a normal URL? ''' python3 -c "import requests;requests.get('http://183.246.199.100:8321')" ''' Error code? ''' requests.exceptions.InvalidURL: Failed to parse: http://183.246.199.100:8321:8321/SSO/EnrollList ''' ---------- components: Parser messages: 415387 nosy: cc97654321, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: requests module parse url failed versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 01:57:25 2022 From: report at bugs.python.org (Ma Lin) Date: Thu, 17 Mar 2022 05:57:25 +0000 Subject: [issue47040] Remove an invalid versionchanged in doc In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647496645.98.0.266444900688.issue47040@roundup.psfhosted.org> Change by Ma Lin : ---------- keywords: +patch pull_requests: +30046 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 01:58:28 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 05:58:28 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1647496708.69.0.751638426345.issue44859@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 4674fd4e938eb4a29ccd5b12c15455bd2a41c335 by Erlend Egeberg Aasland in branch 'main': bpo-44859: Raise more accurate exceptions in `sqlite3` (GH-27695) https://github.com/python/cpython/commit/4674fd4e938eb4a29ccd5b12c15455bd2a41c335 ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:01:08 2022 From: report at bugs.python.org (Ma Lin) Date: Thu, 17 Mar 2022 07:01:08 +0000 Subject: [issue47040] Remove invalid versionchanged in doc In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647500468.5.0.844982934909.issue47040@roundup.psfhosted.org> Ma Lin added the comment: `binascii.crc32` doc also has this invalid document: doc: https://docs.python.org/3/library/binascii.html#binascii.crc32 3.0.0 code: https://github.com/python/cpython/blob/v3.0/Modules/binascii.c#L1035 In addition, `binascii.crc32` has an `USE_ZLIB_CRC32` code path, but it's buggy. The length of zlib `crc32()` function is `unsigned int`, so if use `USE_ZLIB_CRC32` code path and the data > 4GiB, the result is wrong. Should we remove `USE_ZLIB_CRC32` code path in `binascii.c`, or fix it? `USE_ZLIB_CRC32` code path in binascii.c (bug code): https://github.com/python/cpython/blob/v3.11.0a6/Modules/binascii.c#L756-L767 crc32 in zlibmodule.c, it uses an UINT_MAX sliding window (right code): https://github.com/python/cpython/blob/v3.11.0a6/Modules/zlibmodule.c#L1436 ---------- title: Remove an invalid versionchanged in doc -> Remove invalid versionchanged in doc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:29:50 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 07:29:50 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647502190.04.0.684728918987.issue45979@roundup.psfhosted.org> miss-islington added the comment: New changeset 612019e60e3a5340542122dabbc7ce5a27a8c635 by Miss Islington (bot) in branch '3.9': bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938) https://github.com/python/cpython/commit/612019e60e3a5340542122dabbc7ce5a27a8c635 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 03:52:39 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 07:52:39 +0000 Subject: [issue46981] Empty typing.Tuple In-Reply-To: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> Message-ID: <1647503559.58.0.202764894403.issue46981@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 15df8f8d89a0e563bdd15e4cd6734298736a5a1d by Serhiy Storchaka in branch 'main': bpo-46981: Remove typing._TypingEmpty (GH-31836) https://github.com/python/cpython/commit/15df8f8d89a0e563bdd15e4cd6734298736a5a1d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:04:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 17 Mar 2022 08:04:38 +0000 Subject: [issue47041] requests module parse url failed In-Reply-To: <1647495599.59.0.763514720796.issue47041@roundup.psfhosted.org> Message-ID: <1647504278.77.0.674554098709.issue47041@roundup.psfhosted.org> Christian Heimes added the comment: Requests is a 3rd party package and not part of the standard library. There is a problem with the HTTP server at http://183.246.199.100:8321. It is sending a HTTP redirect with the port number duplicated: ":8321:8321". Please report the issue to the server admin. ---------- nosy: +christian.heimes resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:05:27 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Thu, 17 Mar 2022 08:05:27 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647504327.76.0.71433089914.issue46382@roundup.psfhosted.org> Arie Bovenberg added the comment: @eric.smith did you give this some thought? Would we want to imitate the attrs behavior regarding __weafref__? It'd be nice if I can submit a PR to be included in 3.11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:20:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 08:20:59 +0000 Subject: [issue46981] Empty typing.Tuple In-Reply-To: <1646986872.43.0.932223345125.issue46981@roundup.psfhosted.org> Message-ID: <1647505259.46.0.627846565528.issue46981@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:27:49 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 17 Mar 2022 08:27:49 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647505669.57.0.734483369639.issue46996@roundup.psfhosted.org> Ronald Oussoren added the comment: One consideration is support for older LTS distributions of Linux, RHEL/Centos 7 appears to ship with Tcl/Tk 8.5. The system install of Tcl/Tk on macOS is also 8.5, but that variant has too many bugs to try to support it. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 04:43:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 08:43:22 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647506602.65.0.120474630856.issue46996@roundup.psfhosted.org> Serhiy Storchaka added the comment: 8.5.12 will be 10 years old at the time of releasing 3.11. We can relax the requirements for 8.5.x, so the code can be build with older versions, but some tests will fail because we removed workarounds for differences in behavior in older versions from tests. The LTS distributions can also provide their own patches which relax the requirements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 06:01:08 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 17 Mar 2022 10:01:08 +0000 Subject: [issue46890] getpath problems with framework build In-Reply-To: <1646151946.28.0.599042990928.issue46890@roundup.psfhosted.org> Message-ID: <1647511268.1.0.183185812354.issue46890@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- keywords: +patch pull_requests: +30047 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31958 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 06:57:10 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 10:57:10 +0000 Subject: [issue47042] Fix test_html_doc in test_pydoc Message-ID: <1647514630.11.0.12702662455.issue47042@roundup.psfhosted.org> New submission from Serhiy Storchaka : Due to missed splitlines() in test_pydoc the HTML output was not tested correctly. Instead of testing that the actual output contains every *line* from the expected output it tested that the actual output contains every *character* from the expected output. The test would pass with any actual output which contains all Latin letters and some punctuation. The following PR fixes this bug and makes the test even more strict. Now it tests that the actual output contains the same lines as the expected output, in the same order, ignoring indentation and empty lines. ---------- components: Tests messages: 415396 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix test_html_doc in test_pydoc type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:03:19 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 11:03:19 +0000 Subject: [issue47042] Fix test_html_doc in test_pydoc In-Reply-To: <1647514630.11.0.12702662455.issue47042@roundup.psfhosted.org> Message-ID: <1647514999.25.0.846838732667.issue47042@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30048 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:04:12 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 11:04:12 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647515052.65.0.143574974315.issue40296@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- dependencies: +Fix test_html_doc in test_pydoc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:06:10 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 11:06:10 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647515170.25.0.702638856336.issue46996@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset c2e3c06139e9468efb32629d147d99a1672d9e19 by Serhiy Storchaka in branch 'main': bpo-46996: Remove support of Tcl/Tk < 8.5.12 (GH-31839) https://github.com/python/cpython/commit/c2e3c06139e9468efb32629d147d99a1672d9e19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:06:28 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 11:06:28 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647515188.24.0.332289642919.issue46996@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:10:05 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 17 Mar 2022 11:10:05 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647515405.55.0.338609315394.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ef1327e3b622e0cafdf8bfc1f480fed0dd386be6 by Christian Heimes in branch 'main': bpo-40280: Skip more tests on Emscripten (GH-31947) https://github.com/python/cpython/commit/ef1327e3b622e0cafdf8bfc1f480fed0dd386be6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:36:02 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 11:36:02 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647516962.91.0.875628160767.issue46382@roundup.psfhosted.org> Serhiy Storchaka added the comment: __slotnames__ is used for storing all slot names. New object.__getstate__() proposed in issue26579 may have some relation to this discussion. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 07:53:54 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Mar 2022 11:53:54 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647518034.98.0.394036602264.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: Serhiy: Could you point to some documentation on __slotnames__? I see a few references in the code to it, but it's not set on simple test class. >>> class A: ... __slots__=('a',) ... >>> A.__slotnames__ Traceback (most recent call last): File "", line 1, in AttributeError: type object 'A' has no attribute '__slotnames__'. Did you mean: '__slots__'? >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:29:11 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 12:29:11 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1647518034.98.0.394036602264.issue46382@roundup.psfhosted.org> Message-ID: Serhiy Storchaka added the comment: > > It is not set automatically. It is set in object.__reduce__ by calling > some helper function from the copyreg module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:48:15 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 12:48:15 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647521295.21.0.363048666072.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Commit 393e2bf6bc6effbfe821f051a230978f0edd70df has broken CPython in RedHat 6: [2022-03-16T18:49:20.608Z] 2022/03/16 14:48:55 ERROR /tmp/python3.10-3.10.3-0/Modules/faulthandler.c:28:12: fatal error: sys/auxv.h: No such file or directory # include ^~~~~~~~~~~~ compilation terminated. ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:49:44 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 12:49:44 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647521384.57.0.337909270644.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is problematic because this has been backported to stable releases. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:49:59 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 12:49:59 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647521399.63.0.177491171195.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We may need to revert these commits and do another release.... sigh :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:55:19 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 12:55:19 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647521719.1.0.316680437969.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The code is assuming that if linux/auxvec.h then sys/auxv.h will be available, which is wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:54:32 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 12:54:32 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647521672.47.0.097516474521.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The configure file is checking for "linux/auxvec.h" checking linux/auxvec.h usability... yes but the code is including "sys/auxvec.h" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 08:56:21 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 12:56:21 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647521781.92.0.737035687034.issue46968@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:02:03 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 13:02:03 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647522123.47.0.818041618743.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This may be quite bad, because this means that 3.10 and 3.9 doesn't build in CentOS 6, which is used for manylinux2010 wheels ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:02:51 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 13:02:51 +0000 Subject: [issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase In-Reply-To: <1647458523.65.0.149238052361.issue47038@roundup.psfhosted.org> Message-ID: <1647522171.99.0.617955998503.issue47038@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:08:24 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 13:08:24 +0000 Subject: [issue42941] Infinite loop in asyncio sslproto In-Reply-To: <1610817009.05.0.00842749014089.issue42941@roundup.psfhosted.org> Message-ID: <1647522504.62.0.897351535176.issue42941@roundup.psfhosted.org> Andrew Svetlov added the comment: sslproto was rewritten from scratch in Python 3.11 ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:11:02 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 13:11:02 +0000 Subject: [issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O In-Reply-To: <1584565201.4.0.349669786045.issue40007@roundup.psfhosted.org> Message-ID: <1647522662.3.0.923825497089.issue40007@roundup.psfhosted.org> Andrew Svetlov added the comment: A duplicate of #47010 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Implement zero copy writes in SelectorSocketTransport in asyncio _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:16:16 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 13:16:16 +0000 Subject: [issue40811] Allow to create new Event Loops on Threads In-Reply-To: <1590688479.36.0.418054824205.issue40811@roundup.psfhosted.org> Message-ID: <1647522976.71.0.735955408845.issue40811@roundup.psfhosted.org> Andrew Svetlov added the comment: I suggest closing. The documentation explicitly describes how asyncio works with threads. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:17:06 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 13:17:06 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. In-Reply-To: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> Message-ID: <1647523026.15.0.30111461317.issue42838@roundup.psfhosted.org> Andrew Svetlov added the comment: asyncio.run() does the task ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:17:16 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Mar 2022 13:17:16 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param In-Reply-To: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> Message-ID: <1647523036.82.0.548659825632.issue47023@roundup.psfhosted.org> Change by Eric V. Smith : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 09:49:54 2022 From: report at bugs.python.org (rive_n) Date: Thu, 17 Mar 2022 13:49:54 +0000 Subject: [issue47043] Argparse can't parse subparsers with parse_known_args Message-ID: <1647524994.61.0.940749160258.issue47043@roundup.psfhosted.org> New submission from rive_n : Let's say we have default parser configuration: https://docs.python.org/3/library/argparse.html#other-utilities Like this one: ```python3 import argparse parser = argparse.ArgumentParser(prog='PROG') parser.add_argument('--foo', action='store_true', help='foo help') subparsers = parser.add_subparsers(help='sub-command help') # create the parser for the "a" command parser_a = subparsers.add_parser('a', help='a help') parser_a.add_argument('-a', help='bar help') # create the parser for the "b" command parser_b = subparsers.add_parser('b', help='b help') parser_b.add_argument('-b', help='baz help') ``` So i want to parse all subparsers arguments. For this purpose i could use `parse_known_args` method. But for some reason there is no way to get all of current args specified via command prompt or via list: `print(parser.parse_known_args(['a', '-a', '12', 'b', '-b', '32']))` - will not print 'a' and 'b' data. It will only contain first valid argument; This is pretty strange behavior. Why i can't just get all of actions (subparsers) ? ---------- components: Parser messages: 415412 nosy: lys.nikolaou, pablogsal, rive-n priority: normal severity: normal status: open title: Argparse can't parse subparsers with parse_known_args type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:25:27 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 14:25:27 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647527127.35.0.230881362129.issue46968@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +30049 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:31:21 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Mar 2022 14:31:21 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1647527481.93.0.0457620960596.issue46553@roundup.psfhosted.org> Eric V. Smith added the comment: Is there any reason to keep this issue open? The PR was merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 10:34:07 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 14:34:07 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1647527647.8.0.377198276607.issue46553@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:04:28 2022 From: report at bugs.python.org (rive_n) Date: Thu, 17 Mar 2022 15:04:28 +0000 Subject: [issue47043] Argparse can't parse subparsers with parse_known_args In-Reply-To: <1647524994.61.0.940749160258.issue47043@roundup.psfhosted.org> Message-ID: <1647529468.85.0.424002173163.issue47043@roundup.psfhosted.org> rive_n added the comment: Let's say we have default parser configuration: https://docs.python.org/3/library/argparse.html#other-utilities Like this one: ```python3 import argparse parser = argparse.ArgumentParser(prog='PROG') parser.add_argument('--foo', action='store_true', help='foo help') subparsers = parser.add_subparsers(help='sub-command help') # create the parser for the "a" command parser_a = subparsers.add_parser('a', help='a help') parser_a.add_argument('-a', help='bar help') # create the parser for the "b" command parser_b = subparsers.add_parser('b', help='b help') parser_b.add_argument('-b', help='baz help') ``` So i want to parse all subparsers arguments. For this purpose i could use `parse_known_args` method. But for some reason there is no way to get all of current args specified via command prompt or via list: `print(parser.parse_known_args(['a', '-a', '12', 'b', '-b', '32']))` - will not print 'a' and 'b' data. It will only contain first valid argument; This is pretty strange behavior. Why i can't just get all of actions (subparsers) ? --- I've found a solutions: 1. Easy way (and most stupid): ```python3 args, unk_args = (parser.parse_known_args(['a', '-a', '12', 'b', '-b', '32'])) args, unk_args = (parser.parse_known_args(unk_args)) ``` Simple recursive calls on `unk_args` 2. Hard way -> sources fork (or just fix this, lul!) `parse_know_args` -> 1799-1807 lines: ```python3 try: namespace, args = self._parse_known_args(args, namespace) if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR): args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) return namespace, args except ArgumentError: err = _sys.exc_info()[1] self.error(str(err)) ``` There is only 1 call to `self._parse_known_args` instead of amount of current subparsers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:07:37 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Mar 2022 15:07:37 +0000 Subject: [issue47043] Argparse can't parse subparsers with parse_known_args In-Reply-To: <1647524994.61.0.940749160258.issue47043@roundup.psfhosted.org> Message-ID: <1647529657.78.0.809816832351.issue47043@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:09:05 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 15:09:05 +0000 Subject: [issue43019] wait_for(to_thread)) does not work as expected. Extra documentation or fix needed. In-Reply-To: <1611552771.11.0.601335924509.issue43019@roundup.psfhosted.org> Message-ID: <1647529745.58.0.775674643893.issue43019@roundup.psfhosted.org> Andrew Svetlov added the comment: Threads are not interruptable in Python. The same for concurrent.future executor. asyncio and `wait_for` is not special. I'm not sure should we document it and *if* yes -- where should we do it? Adding a note to every function could be cumbersome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:10:08 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 15:10:08 +0000 Subject: [issue42683] asyncio should handle keyboard interrupt while the event loop is running In-Reply-To: <1608377188.51.0.0510456786918.issue42683@roundup.psfhosted.org> Message-ID: <1647529808.1.0.6213103756.issue42683@roundup.psfhosted.org> Andrew Svetlov added the comment: Duplicate for #39622 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> KeyboardInterrupt is ignored when await asyncio.sleep(0) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:16:17 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 15:16:17 +0000 Subject: [issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects In-Reply-To: <1495867380.86.0.533205071954.issue30491@psf.upfronthosting.co.za> Message-ID: <1647530177.4.0.387540808549.issue30491@roundup.psfhosted.org> Andrew Svetlov added the comment: Implemented by #32591 ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:22:59 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Thu, 17 Mar 2022 15:22:59 +0000 Subject: [issue40465] Deprecate the optional *random* argument to random.shuffle() In-Reply-To: <1588321901.81.0.617278241299.issue40465@roundup.psfhosted.org> Message-ID: <1647530579.42.0.310684086256.issue40465@roundup.psfhosted.org> Hugo van Kemenade added the comment: GH-31818 adds an entry to What's New in 3.11. ---------- message_count: 5.0 -> 6.0 nosy: +hugovk nosy_count: 3.0 -> 4.0 pull_requests: +30050 pull_request: https://github.com/python/cpython/pull/31818 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:50:08 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 15:50:08 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647532208.9.0.861084327278.issue46382@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry, the previous message was written via a phone because of blackout, so the formatting is a tine bit messy. __slotnames__ is set in copyreg._slotnames(). If you want to keep a list of all slots you should save it in __slotnames__, either using copyreg._slotnames() directly or by duplicating its code. But as for the original issue, I do not think that the current behavior is incorrect. At least it is consistent with the behavior of regular classes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 11:59:00 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 17 Mar 2022 15:59:00 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647532740.55.0.983602196117.issue46996@roundup.psfhosted.org> Terry J. Reedy added the comment: Ronald: According to a page (which I cannot find, E. Paine should know) Centos 7 has the oldest tcl among current *nix distributions. https://centos.pkgs.org/7/centos-x86_64/tcl-8.5.13-8.el7.x86_64.rpm.html says it is 8.5.13, which is what I remember from the comparison page. Serhiy: IDLE has required TkVersion >= 8.5 for some years (currently top of pyshell.py). Does the _tkinter.c line #error "Tk older than 8.5.12 not supported" translate into an ImportError (which is already caught). I never worried about someone trying to import 8.3 or before, but Apple's 8.5.9 is possible. Is there any reason that IDLE might someday require 8.6 before tkinter does? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:08:00 2022 From: report at bugs.python.org (Laurent Delphin) Date: Thu, 17 Mar 2022 16:08:00 +0000 Subject: [issue47044] Python 2.7.18 + tck/tk 8.6.1 + Osx Lion : tkinter built failes Message-ID: <1647533280.64.0.67321104584.issue47044@roundup.psfhosted.org> New submission from Laurent Delphin : Hello Python developers : The module tkinter failed to be built for Python 2.7.18, although for Python 3,it works with the following test : python -m tkinter. It doesn't with Python2. Configuration : Mac osx Lion 10.7.5. Python2 : 2.7.18 Compiler : clang (Xcode). Tcl/Tk : 8.6.12. If I succeed, log files will be enclosed hereby. Thank you. ---------- messages: 415421 nosy: laurentang001 priority: normal severity: normal status: open title: Python 2.7.18 + tck/tk 8.6.1 + Osx Lion : tkinter built failes type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:12:42 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 17 Mar 2022 16:12:42 +0000 Subject: [issue47044] Python 2.7.18 + tck/tk 8.6.1 + Osx Lion : tkinter built failes In-Reply-To: <1647533280.64.0.67321104584.issue47044@roundup.psfhosted.org> Message-ID: <1647533562.99.0.659792718895.issue47044@roundup.psfhosted.org> Christian Heimes added the comment: Python 2.7 is no longer supported by us and we no longer accept bug reports for it. Please update to a supported version. ---------- nosy: +christian.heimes resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:15:27 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Mar 2022 16:15:27 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1647533727.12.0.808217362399.issue46329@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 Mar 17 12:17:04 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 16:17:04 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647533824.86.0.40326907407.issue46996@roundup.psfhosted.org> Serhiy Storchaka added the comment: After PR 31839 has been merged you cannot build the _tkinter module with Tcl/Tk older than 8.5.12. If you will still try to run IDLE on such incomplete build, an import error during importing tkinter will be translated to IDLE error: $ ./python -m idlelib ** IDLE can't import Tkinter. Your Python may not be configured for Tk. ** IDLE might someday require 8.6 if it start using some 8.6 features non-optionally. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:23:10 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Mar 2022 16:23:10 +0000 Subject: [issue47045] Remove the RESUME instruction Message-ID: <1647534190.7.0.0573728232462.issue47045@roundup.psfhosted.org> New submission from Mark Shannon : The RESUME instruction was added to make resumption points explicit in the bytecode. This makes it easier to implement tracing, quickening, and interrupt checks as there is an explicit place to perform these checks. Unfortunately, it also has considerable overhead. So we should remove it. To do that, we need to: 1. Remove f_state from the InterpreterFrame so we don't need to update it. 2 .Quicken automatically in the adaptive instructions. 3. Check the evalbreaker when resuming a frame in the interpreter. 4. Add some metadata to the code object, so that we know when to fire "call" events when tracing. ---------- assignee: Mark.Shannon messages: 415424 nosy: Mark.Shannon priority: normal severity: normal status: open title: Remove the RESUME instruction type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:27:05 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 16:27:05 +0000 Subject: [issue34790] Deprecate-remove passing coroutine objects to asyncio.wait() In-Reply-To: <1537807353.36.0.956365154283.issue34790@psf.upfronthosting.co.za> Message-ID: <1647534425.44.0.312917726291.issue34790@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- title: Deprecate passing coroutine objects to asyncio.wait() -> Deprecate-remove passing coroutine objects to asyncio.wait() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:32:21 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 16:32:21 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647534741.8.0.331378767037.issue46996@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30051 pull_request: https://github.com/python/cpython/pull/31962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:32:46 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 16:32:46 +0000 Subject: [issue24080] asyncio.Event.wait() Task was destroyed but it is pending In-Reply-To: <1430402398.63.0.270088920542.issue24080@psf.upfronthosting.co.za> Message-ID: <1647534766.14.0.857750365131.issue24080@roundup.psfhosted.org> Andrew Svetlov added the comment: Duplicate for #39622 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> KeyboardInterrupt is ignored when await asyncio.sleep(0) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:33:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 16:33:01 +0000 Subject: [issue47042] Fix test_html_doc in test_pydoc In-Reply-To: <1647514630.11.0.12702662455.issue47042@roundup.psfhosted.org> Message-ID: <1647534781.89.0.863235535411.issue47042@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a5d246066b5352a7d72e70ec0acb643e7c0861fa by Serhiy Storchaka in branch 'main': bpo-47042: Fix testing the HTML output in test_pydoc (GH-31959) https://github.com/python/cpython/commit/a5d246066b5352a7d72e70ec0acb643e7c0861fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:40:39 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Mar 2022 16:40:39 +0000 Subject: [issue47046] Add `f_state` attribute to FrameObjects. Message-ID: <1647535239.19.0.523349265892.issue47046@roundup.psfhosted.org> New submission from Mark Shannon : When tracing, the event supplied is insufficient to determine what is actually happening. E.g. A "call" event could be a call to a function or resuming a generator or coroutine. Adding a state field to the FrameObject would allow these cases to be disambiguated without having to make dubious deductions from `f_lasti` or other frame attributes. The proposed states would be: FRAME_CREATED # Frame created, but not executed at all FRAME_SUSPENDED # Frame suspended after yield or yield from FRAME_EXECUTING # Frame is executed normally FRAME_COMPLETED # Frame has completed FRAME_CLEARED # Frame has been cleared Ned, any other states that you might need to know about? ---------- messages: 415427 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Add `f_state` attribute to FrameObjects. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:45:31 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Mar 2022 16:45:31 +0000 Subject: [issue47045] Remove the RESUME instruction In-Reply-To: <1647534190.7.0.0573728232462.issue47045@roundup.psfhosted.org> Message-ID: <1647535531.83.0.423858837729.issue47045@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +30052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31963 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:47:08 2022 From: report at bugs.python.org (Eryk Sun) Date: Thu, 17 Mar 2022 16:47:08 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647535628.04.0.672045637421.issue47037@roundup.psfhosted.org> Change by Eryk Sun : ---------- priority: normal -> critical _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:48:39 2022 From: report at bugs.python.org (Mikael Koli) Date: Thu, 17 Mar 2022 16:48:39 +0000 Subject: [issue47047] smtplib: allow custom policy or use msg.policy in send_message Message-ID: <1647535719.92.0.354581918183.issue47047@roundup.psfhosted.org> New submission from Mikael Koli : The method smtplib.SMTP.send_message does not use the message's Policy if all of the from_addrs or to_addrs are not international. See: https://github.com/python/cpython/blob/v3.10.3/Lib/smtplib.py#L983 (unchanged in current main). The email.generator.BytesGenerator does not capture the email's policy as it was not passed to its init. This has at least one notable setback: you cannot set the mangle_from to False meaning that the method will always turn "From ..." to ">From ..." in the plain text part (though often that is desirable). This is especially confusing as email library has the mangle_from as False by default for EmailMessages but smtplib.SMTP's send_message does not respect this by default. The smtplib.SMTP.send_message has a mention about this in the docstring thus not entirely sure if intentional: ... Otherwise the generator is called without modifying the policy. If we changed this line: https://github.com/python/cpython/blob/v3.10.3/Lib/smtplib.py#L983 from this: g = email.generator.BytesGenerator(bytesmsg) to this: g = email.generator.BytesGenerator(bytesmsg, policy=msg.policy.clone() smptlib's tests are passed but I suspect it's not that simple. The docstring mention indicates this is at some level intentional and I think the mangle_from needs to remain True as otherwise, it may cause security problems in existing code. Another option perhaps could be that the policy could be passed with the send_message and that is used if not None or we could have argument "msg_policy=False" that if True, the message's policy is used. One could also think that this could be overcome by subclassing the SMTP. However, the logic is such deep in that it is not convenient. So in short, the options I thought of: - Have an argument "policy" in send_message to force usage of your own policy (safe option) - Have an argument "msg_policy" (name debatable) in send_message and if True, the message's policy is always used (safe option) - Use the message's policy always (unsafe, possibly breaking and causing security issues in existing code) ---------- components: Library (Lib), email messages: 415428 nosy: Miksus, barry, r.david.murray priority: normal severity: normal status: open title: smtplib: allow custom policy or use msg.policy in send_message versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 12:56:39 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Mar 2022 16:56:39 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647536199.6.0.465490083677.issue46996@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:00:07 2022 From: report at bugs.python.org (Laurent Delphin) Date: Thu, 17 Mar 2022 17:00:07 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more Message-ID: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> New submission from Laurent Delphin : Hello developers : Hereafter somme comments about a fatal error when Running make. Enclosed log (txt) files if I succeed in uploading them. Python3 : 3.10.3. Osx : Lion 10.7.5. Compiler family : clang (Xcode). Message : return PyErr_SetFromErrno(PyExec_OSError) ; fatal error : error in backend etc. Kind regards, ---------- messages: 415429 nosy: laurentang001 priority: normal severity: normal status: open title: Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:05:02 2022 From: report at bugs.python.org (xloem) Date: Thu, 17 Mar 2022 17:05:02 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. In-Reply-To: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> Message-ID: <1647536702.35.0.84560534998.issue42838@roundup.psfhosted.org> xloem <0xloem at gmail.com> added the comment: I'm sorry, is this closure an error? Could you explain more how to use asyncio.run() to clean up resources when an unhandled exception is thrown? Is this new with a recent python improvement? ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:09:56 2022 From: report at bugs.python.org (Laurent Delphin) Date: Thu, 17 Mar 2022 17:09:56 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647536996.6.0.785304622647.issue47048@roundup.psfhosted.org> Change by Laurent Delphin : Added file: https://bugs.python.org/file50683/make.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:10:52 2022 From: report at bugs.python.org (Laurent Delphin) Date: Thu, 17 Mar 2022 17:10:52 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647537052.85.0.717138751185.issue47048@roundup.psfhosted.org> Change by Laurent Delphin : Added file: https://bugs.python.org/file50684/config.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:11:46 2022 From: report at bugs.python.org (Laurent Delphin) Date: Thu, 17 Mar 2022 17:11:46 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647537106.47.0.0764433138521.issue47048@roundup.psfhosted.org> Change by Laurent Delphin : Added file: https://bugs.python.org/file50685/my-configure.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:15:19 2022 From: report at bugs.python.org (Laurent Delphin) Date: Thu, 17 Mar 2022 17:15:19 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647537319.59.0.193013288123.issue47048@roundup.psfhosted.org> Laurent Delphin added the comment: But make OK with Gcc 4.9.4, built with the formentionned clang (Xcode) compiler. So, Compiler sensitive... Thank you, ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:17:37 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 17:17:37 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. In-Reply-To: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> Message-ID: <1647537457.5.0.653125453401.issue42838@roundup.psfhosted.org> Andrew Svetlov added the comment: asyncio.run() present since Python 3.7 After the main coroutine finish, it cancels all background tasks and waits for their termination. Background tasks can use old good `try/finally` for resources cleanup. An additional API is not required IMHO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:27:01 2022 From: report at bugs.python.org (Dino Viehland) Date: Thu, 17 Mar 2022 17:27:01 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> Message-ID: <1647538021.38.0.610917547305.issue46965@roundup.psfhosted.org> Dino Viehland added the comment: Doh, sorry about that link, this one goes to a specific commit: https://github.com/facebookincubator/cinder/blob/6863212ada4b569c15cd95c4e7a838f254c8ccfb/Python/ceval.c#L6642 I do think a new opcode is a good way to go, and that could just be emitted by the compiler when it recognizes the pattern. I think we mainly avoided that because we had some issues around performance testing when we updated the byte code version and the peek was negligible, but with improved call performance in 3.11 that may not be the case anymore. It's probably possible to keep most of gather in Python if necessary, there'd still need to be a C wrapper which could flow the wrapper in and the wait handle creation would need to be possible from Python (which slightly scares me). There's probably also a perf win from the C implementation - I'll see if @v2m has any data on that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:32:23 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 17 Mar 2022 17:32:23 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647538343.28.0.548401257058.issue46996@roundup.psfhosted.org> Terry J. Reedy added the comment: tk release availability is a bit confusing. https://wiki.tcl-lang.org/page/Changes+in+Tcl%2FTk+8%2E6 appears to lists things 'new' in 3.6.1, but that seems to mean new since 8.5.1, as it includes thing introduced in 8.5.n, where n > 1. For instance, ttk spinbox is listed in this doc, but was available in 8.5.9, so is in 8.5.12+ and can be used without an 8.6 requirement. Similarly, https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_treeview.html the 8.5.19 doc for the widget, shows the 'new in 8.6' treeview tag commands. I suspect that they were present in 8.5.13. Is there a specific 8.5.12 doc available? I searched and tried adding '.12' in the url above and both failed. Buildbots without _tkinter don't help either. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:33:03 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 17 Mar 2022 17:33:03 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647538383.51.0.192390471382.issue46996@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 13:39:21 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 17:39:21 +0000 Subject: [issue34790] Deprecate-remove passing coroutine objects to asyncio.wait() In-Reply-To: <1537807353.36.0.956365154283.issue34790@psf.upfronthosting.co.za> Message-ID: <1647538761.21.0.434651086913.issue34790@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30053 pull_request: https://github.com/python/cpython/pull/31964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:24:07 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Mar 2022 18:24:07 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647541447.16.0.402762192674.issue47037@roundup.psfhosted.org> Steve Dower added the comment: I think this is also a good enough reason to switch the GitHub CI back to a debug build, rather than release, so that assert failures are caught before they get merged. This is not the first time it's happened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:25:24 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Mar 2022 18:25:24 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647541524.49.0.952705729242.issue47037@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30054 pull_request: https://github.com/python/cpython/pull/31965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:34:59 2022 From: report at bugs.python.org (Mikael Koli) Date: Thu, 17 Mar 2022 18:34:59 +0000 Subject: [issue47047] smtplib: allow custom policy or use msg.policy in send_message In-Reply-To: <1647535719.92.0.354581918183.issue47047@roundup.psfhosted.org> Message-ID: <1647542099.14.0.931446122121.issue47047@roundup.psfhosted.org> Mikael Koli added the comment: It seems the message's policy is actually used. However, the mangle_from_ is still always True as the policy is not passed in the initiation of the generator. It seems though that all the options I mentioned could still make the mangle_from_ to be changeable if one wishes so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:50:19 2022 From: report at bugs.python.org (Zoltan Vajda) Date: Thu, 17 Mar 2022 18:50:19 +0000 Subject: [issue47049] Incorrect shutil.copytree() behaviour with symlinks Message-ID: <1647543019.32.0.96447570107.issue47049@roundup.psfhosted.org> New submission from Zoltan Vajda : shutil.copytree incorrectly does not copy symlink contents if called with symlink=False and ignore_dangling_symlinks=True. The wrong behaviour can be reproduced like this: $ tree . ??? a ??? a.txt ??? b ??? a.txt -> ../a.txt $ python3 -c "import shutil;shutil.copytree('a/b', 'c', symlinks=False, ignore_dangling_symlinks=True)" As a result directoy c will be created but it will remain empty. Expected result is a file c/a.txt with the contents of a/b/a.txt. ---------- components: Library (Lib) messages: 415437 nosy: vajdaz priority: normal severity: normal status: open title: Incorrect shutil.copytree() behaviour with symlinks versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:51:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 17 Mar 2022 18:51:45 +0000 Subject: [issue47050] Cannot install Python 3.10.3 on Windows Message-ID: <1647543105.33.0.65197408482.issue47050@roundup.psfhosted.org> New submission from Alex Waygood : I have tried several times now to upgrade to Python 3.10.3 using the 64-bit installer for Windows at https://www.python.org/downloads/release/python-3103/. Each time, I encounter an error message stating that "The feature you are trying to use is on a network resource that is unavailable". Further error messages include statements that "The older version of Python 3.10.3 Test Suite (64-bit) cannot be removed", and finally, "0x80070643 - Fatal error during installation". Screenshots of the full error messages are attached. Hardware details: - Microsoft Windows 10 Home, Version 10.0.19043 Build 19043 - A x64-based PC - An HP Pavilion Notebook laptop - Processor AMD A8-7410 APU Does anybody have any idea what might be going wrong? I initially tried installing Python 3.10.3 with 3.10.2 still installed, but have now uninstalled Python 3.10.2 from my machine. It has made no difference. ---------- components: Windows files: error_messages-compressed.pdf messages: 415438 nosy: AlexWaygood, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Cannot install Python 3.10.3 on Windows versions: Python 3.10 Added file: https://bugs.python.org/file50686/error_messages-compressed.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:53:48 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Mar 2022 18:53:48 +0000 Subject: [issue47050] Cannot install Python 3.10.3 on Windows In-Reply-To: <1647543105.33.0.65197408482.issue47050@roundup.psfhosted.org> Message-ID: <1647543228.76.0.0307957077903.issue47050@roundup.psfhosted.org> Steve Dower added the comment: Looks like you may have "cleaned up" your package cache at some point, which means you can't uninstall the old version anymore. Try getting the 3.10.2 installer and running it directly. If it's the right one, you'll get Modify/Repair/Uninstall options, and those should work. (At worst, "Repair" will work and then it should be uninstallable.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:54:42 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 17 Mar 2022 18:54:42 +0000 Subject: [issue47050] Cannot install Python 3.10.3 on Windows In-Reply-To: <1647543105.33.0.65197408482.issue47050@roundup.psfhosted.org> Message-ID: <1647543282.73.0.941032736446.issue47050@roundup.psfhosted.org> Alex Waygood added the comment: Attaching the log file from the installation. ---------- Added file: https://bugs.python.org/file50687/installer_log_file.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:56:16 2022 From: report at bugs.python.org (Zoltan Vajda) Date: Thu, 17 Mar 2022 18:56:16 +0000 Subject: [issue47049] Incorrect shutil.copytree() behaviour with symlinks In-Reply-To: <1647543019.32.0.96447570107.issue47049@roundup.psfhosted.org> Message-ID: <1647543376.82.0.59974680336.issue47049@roundup.psfhosted.org> Change by Zoltan Vajda : ---------- keywords: +patch pull_requests: +30055 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 14:56:51 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 17 Mar 2022 18:56:51 +0000 Subject: [issue47050] Cannot install Python 3.10.3 on Windows In-Reply-To: <1647543105.33.0.65197408482.issue47050@roundup.psfhosted.org> Message-ID: <1647543411.61.0.884600762012.issue47050@roundup.psfhosted.org> Alex Waygood added the comment: > Looks like you may have "cleaned up" your package cache at some point, which means you can't uninstall the old version anymore. Not knowingly! > Try getting the 3.10.2 installer and running it directly. Thanks, I'll have a go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:00:22 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 17 Mar 2022 19:00:22 +0000 Subject: [issue47050] Cannot install Python 3.10.3 on Windows In-Reply-To: <1647543105.33.0.65197408482.issue47050@roundup.psfhosted.org> Message-ID: <1647543622.5.0.317032553824.issue47050@roundup.psfhosted.org> Alex Waygood added the comment: Hmm, well if I try running the 3.10.2 installer, it now presents me with an error message saying that "a newer version of Python 3.10 is already installed". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:19:36 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 17 Mar 2022 19:19:36 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647544776.56.0.119968055422.issue47025@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 15:22:31 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 17 Mar 2022 19:22:31 +0000 Subject: [issue47025] bytes do not work on sys.path In-Reply-To: <1647340363.27.0.242980103727.issue47025@roundup.psfhosted.org> Message-ID: <1647544951.79.0.381152668368.issue47025@roundup.psfhosted.org> Brett Cannon added the comment: I think it depends on whether we want to say the standard/included/built-in import mechanisms don't support byte paths, or byte paths are entirely not supported even for 3rd-party code? I definitely think we should at least do the former, but I'm hesitant to close the door for those that need it by doing the latter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:11:28 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 17 Mar 2022 20:11:28 +0000 Subject: [issue47046] Add `f_state` attribute to FrameObjects. In-Reply-To: <1647535239.19.0.523349265892.issue47046@roundup.psfhosted.org> Message-ID: <1647547888.14.0.268771416866.issue47046@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:15:46 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 17 Mar 2022 20:15:46 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1647548146.41.0.804154363033.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +30057 pull_request: https://github.com/python/cpython/pull/31968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:36:37 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 17 Mar 2022 20:36:37 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param In-Reply-To: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> Message-ID: <1647549397.1.0.691798928908.issue47023@roundup.psfhosted.org> Raymond Hettinger added the comment: There seem to be a number of escaping problems in the OP's example. Is this what was intended? >>> re.sub(r"\{(\w+)\}", r"\1", "Hello! {user}") 'Hello! user' ---------- nosy: +rhettinger status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:39:27 2022 From: report at bugs.python.org (Donald O'Donnell) Date: Thu, 17 Mar 2022 20:39:27 +0000 Subject: [issue47051] Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harder to read serif font. Message-ID: <1647549567.72.0.246808188141.issue47051@roundup.psfhosted.org> Change by Donald O'Donnell : ---------- assignee: docs at python components: Documentation nosy: DonnieODonnell, docs at python priority: normal severity: normal status: open title: Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harder to read serif font. type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:40:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 20:40:14 +0000 Subject: [issue46030] socket module add couple of FreeBSD constants In-Reply-To: <1639119971.08.0.15845075802.issue46030@roundup.psfhosted.org> Message-ID: <1647549614.91.0.824620893063.issue46030@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 33698e8ff40fcc67df3d95658e87196f8021de6f by David CARLIER in branch 'main': bpo-46030: socket module add couple of FreeBSD constants. (GH-30018) https://github.com/python/cpython/commit/33698e8ff40fcc67df3d95658e87196f8021de6f ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:40:43 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 20:40:43 +0000 Subject: [issue46030] socket module add couple of FreeBSD constants In-Reply-To: <1639119971.08.0.15845075802.issue46030@roundup.psfhosted.org> Message-ID: <1647549643.28.0.0111372464598.issue46030@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:51:52 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 20:51:52 +0000 Subject: [issue34790] Deprecate-remove passing coroutine objects to asyncio.wait() In-Reply-To: <1537807353.36.0.956365154283.issue34790@psf.upfronthosting.co.za> Message-ID: <1647550312.17.0.764587178869.issue34790@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 903f0a02c16240dc769a08c30e8d072a4fb09154 by Andrew Svetlov in branch 'main': bpo-34790: Remove passing coroutine objects to asyncio.wait() (GH-31964) https://github.com/python/cpython/commit/903f0a02c16240dc769a08c30e8d072a4fb09154 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 16:52:30 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 20:52:30 +0000 Subject: [issue34790] Deprecate-remove passing coroutine objects to asyncio.wait() In-Reply-To: <1537807353.36.0.956365154283.issue34790@psf.upfronthosting.co.za> Message-ID: <1647550350.18.0.27234029601.issue34790@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:03:45 2022 From: report at bugs.python.org (arne123) Date: Thu, 17 Mar 2022 21:03:45 +0000 Subject: [issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() ) Message-ID: <1647551025.23.0.82482579805.issue47052@roundup.psfhosted.org> New submission from arne123 : I use Python to support some C development. Often I need to convert bytearrays to C like convention: 0x12, 0x34 It would be very convenient for this use case if the separator could be a string (like ", 0x") instead of just a single character. ---------- components: IO messages: 415447 nosy: arne123 priority: normal severity: normal status: open title: allow string as sep in _Py_strhex_impl ( bytearray.hex() ) type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:04:27 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Mar 2022 21:04:27 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param In-Reply-To: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> Message-ID: <1647551067.39.0.460963781375.issue47023@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, I assume that's what the OP intended, but then stumbled across the error with '\s'. In any event, I don't think there's a bug here so I'm going to close this. @siddheshsathe: if you disagree, please respond here. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:08:10 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Mar 2022 21:08:10 +0000 Subject: [issue47050] Cannot install Python 3.10.3 on Windows In-Reply-To: <1647543105.33.0.65197408482.issue47050@roundup.psfhosted.org> Message-ID: <1647551290.05.0.86285915408.issue47050@roundup.psfhosted.org> Steve Dower added the comment: Okay, that kind of makes sense. If you try to uninstall 3.10.3 (either through Programs & Features, or through the installer), how far can you get? Hopefully far enough that one of the 3.10.2 options will work, or possibly for a new 3.10.3 install to succeed. Unfortunately, once an install gets corrupted like this, it gets real hard to clean things up. The next option is to find a tool that will remove MSI metadata from your system so you can just delete the installs that way, clean up the files manually, and start fresh. But there's no nice recovery here, I'm afraid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:23:01 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 21:23:01 +0000 Subject: [issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() ) In-Reply-To: <1647551025.23.0.82482579805.issue47052@roundup.psfhosted.org> Message-ID: <1647552181.39.0.625687322677.issue47052@roundup.psfhosted.org> Dennis Sweeney added the comment: Would there be substantial benefit of a new feature over using the existing feature and then calling str.replace()? >>> b = b'abracadabra' >>> "0x" + b.hex(":").replace(":", ", 0x") '0x61, 0x62, 0x72, 0x61, 0x63, 0x61, 0x64, 0x61, 0x62, 0x72, 0x61' ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:30:40 2022 From: report at bugs.python.org (arne123) Date: Thu, 17 Mar 2022 21:30:40 +0000 Subject: [issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() ) In-Reply-To: <1647551025.23.0.82482579805.issue47052@roundup.psfhosted.org> Message-ID: <1647552640.38.0.23469514942.issue47052@roundup.psfhosted.org> arne123 added the comment: Well, I think there are many ways to solve this in python (e.g. I used iteration before, wasn't aware of the sep. at all), but when there is already a separator, why limiting it to one character? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 17:45:08 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 21:45:08 +0000 Subject: [issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() ) In-Reply-To: <1647551025.23.0.82482579805.issue47052@roundup.psfhosted.org> Message-ID: <1647553508.26.0.631293150657.issue47052@roundup.psfhosted.org> Dennis Sweeney added the comment: In particular, it's one ascii character: >>> b'abracadabra'.hex('?') ValueError: sep must be ASCII. I wouldn't be completely opposed to allowing longer strings, but since there are easy enough ways to do it already, put me at a -0. We can see if anyone else is in favor. ---------- components: +Interpreter Core -IO nosy: +gregory.p.smith versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:12:19 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Mar 2022 22:12:19 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647555139.71.0.132483257587.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: I don't have a problem saying that for a class to be used as a base class for a dataclass, its __slots__ must not be an iterator that's been exhausted. That doesn't seem like a very onerous requirement. I'm also not concerned about people using __slots__ to iterate over the fields, but I agree that a documentation note couldn't hurt. @ariebovenberg: go ahead and submit your PR. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:16:35 2022 From: report at bugs.python.org (Matthew Barnett) Date: Thu, 17 Mar 2022 22:16:35 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param In-Reply-To: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> Message-ID: <1647555395.1.0.289228041114.issue47023@roundup.psfhosted.org> Matthew Barnett added the comment: I'd just like to point out that to a user it could _look_ like a bug, that an error occurred while reporting, because the traceback isn't giving a 'clean' report; the stuff about the KeyError is an internal detail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:44:38 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 22:44:38 +0000 Subject: [issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE Message-ID: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org> New submission from Dennis Sweeney : There was a discussion here: https://github.com/faster-cpython/ideas/discussions/269 Checking for whether the assignment target is the left-hand side, rather than just checking for the right refcount, is more stable and reduces the number of deoptimizations, and even increases performance on some benchmarks. Note that `PyUnicode_Append` is already a somewhat expensive function that already checks for the right reference counts, so it's fine to let as much code as possible get there, even if it will take the slow path -- we mostly just want to reduce allocations and avoid the quadratic string concatenation otherwise. ---------- components: Interpreter Core messages: 415455 nosy: Dennis Sweeney, brandtbucher priority: normal severity: normal status: open title: Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE type: security versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:45:49 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 22:45:49 +0000 Subject: [issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE In-Reply-To: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org> Message-ID: <1647557149.31.0.64873972878.issue47053@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +30058 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31318 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 18:50:51 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 22:50:51 +0000 Subject: [issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE In-Reply-To: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org> Message-ID: <1647557451.3.0.0195678003018.issue47053@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- type: security -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:03:14 2022 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 17 Mar 2022 23:03:14 +0000 Subject: [issue47046] Add `f_state` attribute to FrameObjects. In-Reply-To: <1647535239.19.0.523349265892.issue47046@roundup.psfhosted.org> Message-ID: <1647558194.64.0.205441521874.issue47046@roundup.psfhosted.org> Ned Batchelder added the comment: These look great. Currently, coverage.py only tries to distinguish between return/yield, which I guess will now be COMPLETED and SUSPENDED? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:10:55 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 23:10:55 +0000 Subject: [issue47005] Improve performance of bytes_repeat In-Reply-To: <1647198086.65.0.133480575826.issue47005@roundup.psfhosted.org> Message-ID: <1647558655.1.0.27074472485.issue47005@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset ac8308d3eaf2526318c1bbf13d4a214fd24605d2 by Pieter Eendebak in branch 'main': bpo-47005: Improve performance of bytearray_repeat and bytearray_irepeat (GH-31856) https://github.com/python/cpython/commit/ac8308d3eaf2526318c1bbf13d4a214fd24605d2 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:11:46 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 23:11:46 +0000 Subject: [issue47005] Improve performance of bytes_repeat In-Reply-To: <1647198086.65.0.133480575826.issue47005@roundup.psfhosted.org> Message-ID: <1647558706.88.0.85528878387.issue47005@roundup.psfhosted.org> Dennis Sweeney added the comment: Thanks for the contribution -- that's a really nice speedup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:11:56 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 17 Mar 2022 23:11:56 +0000 Subject: [issue47005] Improve performance of bytes_repeat In-Reply-To: <1647198086.65.0.133480575826.issue47005@roundup.psfhosted.org> Message-ID: <1647558716.25.0.459152484139.issue47005@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:14:33 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Mar 2022 23:14:33 +0000 Subject: [issue47023] re.sub shows key error on regex escape chars provided in repl param In-Reply-To: <1647332277.42.0.883314287614.issue47023@roundup.psfhosted.org> Message-ID: <1647558873.34.0.625388858137.issue47023@roundup.psfhosted.org> Eric V. Smith added the comment: I agree the error message could be better. Also, "s.error('bad escape %s' % this, len(this))" should probably be "from None", since as @mrabarnett notes the KeyError is an implementation detail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:32:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 23:32:50 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1647559970.9.0.954751529903.issue46223@roundup.psfhosted.org> Andrew Svetlov added the comment: Fixed by #47039 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Normalize asyncio future and task repr() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:38:00 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 17 Mar 2022 23:38:00 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1647560280.2.0.0781383164543.issue46421@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb by Bader Zaidan in branch 'main': bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654) https://github.com/python/cpython/commit/a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:38:20 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 23:38:20 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1647560300.8.0.144960022128.issue46421@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +30059 pull_request: https://github.com/python/cpython/pull/31969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:38:25 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Mar 2022 23:38:25 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1647560305.09.0.605929952027.issue46421@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30060 pull_request: https://github.com/python/cpython/pull/31970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 19:41:03 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 17 Mar 2022 23:41:03 +0000 Subject: [issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0) In-Reply-To: <1581577789.38.0.529951784345.issue39622@roundup.psfhosted.org> Message-ID: <1647560463.37.0.627070238264.issue39622@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- assignee: -> asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 20:01:05 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Mar 2022 00:01:05 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1647561665.17.0.803446527085.issue46421@roundup.psfhosted.org> miss-islington added the comment: New changeset 0b5f99ad1af0892a2d6043abd8aeb10d685d3844 by Miss Islington (bot) in branch '3.10': bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654) https://github.com/python/cpython/commit/0b5f99ad1af0892a2d6043abd8aeb10d685d3844 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 21:11:12 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Mar 2022 01:11:12 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647565872.84.0.105267281422.issue40296@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 21:17:42 2022 From: report at bugs.python.org (Bluenix) Date: Fri, 18 Mar 2022 01:17:42 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" should be "parameter" Message-ID: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> New submission from Bluenix : Running the code below will produce a SyntaxError with the message: "non-default argument follows default argument". def test(a=None, b): return b if a is None else a The issue is that `a` and `b` aren't *arguments*, rather, they are *parameters*. The error message should be changed to: "non-default parameter follows default parameter". This change appears simple enough and although it is not something I've found to be troublesome, it will help users to use correct keywords (arguments vs. parameters) when searching on the internet. ---------- components: Interpreter Core messages: 415463 nosy: Bluenix2 priority: normal severity: normal status: open title: "SyntaxError: non-default argument follows default argument" should be "parameter" versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 21:44:26 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Mar 2022 01:44:26 +0000 Subject: [issue42782] shutil.move creates a new directory even on failure In-Reply-To: <1609267376.56.0.274024517588.issue42782@roundup.psfhosted.org> Message-ID: <1647567866.63.0.333739299554.issue42782@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +JelleZijlstra nosy_count: 3.0 -> 4.0 pull_requests: +30061 pull_request: https://github.com/python/cpython/pull/31971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 21:56:32 2022 From: report at bugs.python.org (Tim Mitchell) Date: Fri, 18 Mar 2022 01:56:32 +0000 Subject: [issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument In-Reply-To: <1556414496.49.0.573446462504.issue36744@roundup.psfhosted.org> Message-ID: <1647568592.65.0.8589708617.issue36744@roundup.psfhosted.org> Tim Mitchell added the comment: I would really prefer the dispatch logic remains simple and fast, rather than handle single keyword arguments. ---------- nosy: +Tim Mitchell2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 21:59:38 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Mar 2022 01:59:38 +0000 Subject: [issue9736] doctest.DocTestSuite doesn't handle test globs correctly In-Reply-To: <1283367674.32.0.228375766546.issue9736@psf.upfronthosting.co.za> Message-ID: <1647568778.89.0.314615731813.issue9736@roundup.psfhosted.org> Jelle Zijlstra added the comment: Yes. ---------- nosy: +JelleZijlstra resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> doctest.DocTestCase fails when run repeatedly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 22:46:04 2022 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 18 Mar 2022 02:46:04 +0000 Subject: [issue42782] shutil.move creates a new directory even on failure In-Reply-To: <1609267376.56.0.274024517588.issue42782@roundup.psfhosted.org> Message-ID: <1647571564.65.0.447251109277.issue42782@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset e808c9d5c78e5a7a9d804eced013a02c0c7df1a5 by Jelle Zijlstra in branch '3.9': [3.9] bpo-42782: fix broken shutil test (GH-31971) https://github.com/python/cpython/commit/e808c9d5c78e5a7a9d804eced013a02c0c7df1a5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 22:52:35 2022 From: report at bugs.python.org (mobiusklein) Date: Fri, 18 Mar 2022 02:52:35 +0000 Subject: [issue47055] `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8 Message-ID: <1647571955.22.0.67382471148.issue47055@roundup.psfhosted.org> New submission from mobiusklein : The following code looks correct: ```python import os class A(os.PathLike): pass class B(os.PathLike): pass assert issubclass(A, os.PathLike) # direct inheritance relationship assert issubclass(B, os.PathLike) # direct inheritance relationship assert not issubclass(A, B) # A is not derived from B or vice-versa ``` On Python 3.7.0-3.7.6 and 3.8.0-3.8.1 the third assertion fails. The expected behavior was restored in 3.7.7 and 3.8.2. This seems to be around when the internals of `abc` were translated to C. Given that the behavior was fixed, but a bug fix matching this behavior wasn't listed in the changelog, the only resolution is to document that this behavior may be extant in older but still supported minor versions of Python. Where should that text be placed? ---------- components: Library (Lib) messages: 415467 nosy: mobiusklein priority: normal severity: normal status: open title: `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8 type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 23:25:04 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Mar 2022 03:25:04 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1647573904.13.0.806114149219.issue46421@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 1cab44d8650ae3eece90b04fca373908205e7ee0 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654) (GH-31970) https://github.com/python/cpython/commit/1cab44d8650ae3eece90b04fca373908205e7ee0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 17 23:25:14 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Mar 2022 03:25:14 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1647573914.62.0.175524877834.issue46421@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 00:48:34 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 18 Mar 2022 04:48:34 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" should be "parameter" In-Reply-To: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> Message-ID: <1647578914.25.0.136336020424.issue47054@roundup.psfhosted.org> Vedran ?a?i? added the comment: The problem is more subtle. The thing is, "default parameter" doesn't make sense in this context. Yes, a and b are parameter, but a is not "default parameter" in any sensible way. It is _None_ which is the default argument for parameter a, while parameter b has no default argument. In other words, if the function weren't called with a first argument, the default argument would be used. So, the fix should be a bit more complicated. Maybe, "a parameter without a default follows a parameter with a default"? ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:05:56 2022 From: report at bugs.python.org (Tim Mitchell) Date: Fri, 18 Mar 2022 06:05:56 +0000 Subject: [issue36457] functools.singledispatchmethod interacts poorly with subclasses In-Reply-To: <1553744559.32.0.207343635807.issue36457@roundup.psfhosted.org> Message-ID: <1647583556.1.0.167831534681.issue36457@roundup.psfhosted.org> Tim Mitchell added the comment: I've come up with a version that does not require a base class. Seems a bit hacky as the descriptor __get__ method now modifies the class to put the dispatch table in place the first time the method is accessed. ---------- Added file: https://bugs.python.org/file50688/singledispatchmethod.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:10:24 2022 From: report at bugs.python.org (Tim Mitchell) Date: Fri, 18 Mar 2022 06:10:24 +0000 Subject: [issue36457] functools.singledispatchmethod interacts poorly with subclasses In-Reply-To: <1553744559.32.0.207343635807.issue36457@roundup.psfhosted.org> Message-ID: <1647583824.33.0.111853049498.issue36457@roundup.psfhosted.org> Change by Tim Mitchell : Added file: https://bugs.python.org/file50689/test_sdm.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 02:31:52 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Fri, 18 Mar 2022 06:31:52 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647585112.73.0.763467320102.issue46382@roundup.psfhosted.org> Arie Bovenberg added the comment: @eric.smith awesome! What would you like to do about the __weakref__ slot? 1. take no action 2. create a separate ticket to discuss further 3. implement as done in attrs, now that we're changing __slots__ dataclass behavior anyway I wouldn't recommend (1), because sooner or later this feature request will pop up. It seems reasonable to support it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 03:30:21 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 18 Mar 2022 07:30:21 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647588621.06.0.83391607575.issue46996@roundup.psfhosted.org> Ronald Oussoren added the comment: Terry: tkinter on macOS already effectively does not support Tk 8.5, or basically anything bug the latest 8.6.x release. That's because older versions have too many bugs that affect Python users, which mostly show up on our tracker as bug reports about IDLE. Because of this we generally close issues that mention using tkinter with 8.5 on macOS unless the problem can be reproduced using 8.6 as well (using the installer on python.org). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:05:27 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 09:05:27 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647594327.26.0.805528197171.issue40296@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset cd44afc573e2e2de8d7e5a9119c347373066cd10 by Serhiy Storchaka in branch 'main': bpo-40296: Fix supporting generic aliases in pydoc (GH-30253) https://github.com/python/cpython/commit/cd44afc573e2e2de8d7e5a9119c347373066cd10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:07:29 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 18 Mar 2022 09:07:29 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647594449.11.0.396773753286.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: I thought there was an existing issue that covered this, but now I can't find it. I'd prefer #2, create a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:27:33 2022 From: report at bugs.python.org (Shin-Myoung-Serp) Date: Fri, 18 Mar 2022 09:27:33 +0000 Subject: [issue47056] turtle.write() causes flickering when the tracer is turned off. Message-ID: <1647595653.53.0.61025954383.issue47056@roundup.psfhosted.org> New submission from Shin-Myoung-Serp : When implementing an animation with turtle, usually the tracer is turned off via turtle.tracer(0, 0) and turtle.update() is called manually. When the tracer is off, most of drawing functions skips update() calls on the underlying Canvas. But turtle.write() does not do that. (See the implementation of TurtleScreenBase._write().) This causes flickering, as can be seen when you run the attached script. (Press space key to hide/show texts.) ---------- components: Library (Lib) files: test_anim_write.py messages: 415475 nosy: relent95 priority: normal severity: normal status: open title: turtle.write() causes flickering when the tracer is turned off. type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50690/test_anim_write.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:35:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Mar 2022 09:35:37 +0000 Subject: [issue42682] awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks In-Reply-To: <1608365364.67.0.620283086401.issue42682@roundup.psfhosted.org> Message-ID: <1647596137.26.0.853336811715.issue42682@roundup.psfhosted.org> Irit Katriel added the comment: I don't think the OP is complaining about the internal asyncio machinery frames, but rather about the repetition of the "return f.result() # May raise f.exception()." frame. I will paste the output of the script in the next comment. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:36:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Mar 2022 09:36:01 +0000 Subject: [issue42682] awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks In-Reply-To: <1608365364.67.0.620283086401.issue42682@roundup.psfhosted.org> Message-ID: <1647596161.02.0.345751956058.issue42682@roundup.psfhosted.org> Irit Katriel added the comment: >>> asyncio.run(main()) Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! Traceback (most recent call last): File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 6, in main File "C:\Users\User\src\cpython\Lib\asyncio\tasks.py", line 597, in _wait_for_one return f.result() # May raise f.exception(). ^^^^^^^^^^ File "", line 2, in wait File "", line 2, in wait File "", line 2, in wait [Previous line repeated 7 more times] File "", line 2, in crash Exception: crash! >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:37:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Mar 2022 09:37:02 +0000 Subject: [issue42682] awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks In-Reply-To: <1608365364.67.0.620283086401.issue42682@roundup.psfhosted.org> Message-ID: <1647596222.75.0.615632533907.issue42682@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Incorrect traceback when future's exception is raised multiple times _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:37:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Mar 2022 09:37:26 +0000 Subject: [issue45924] Incorrect traceback when future's exception is raised multiple times In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org> Message-ID: <1647596246.84.0.285870140643.issue45924@roundup.psfhosted.org> Irit Katriel added the comment: Closed issue42682 as duplicate of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:53:35 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 18 Mar 2022 09:53:35 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1647597215.72.0.311746012316.issue45413@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 48d926269963cfe7a49c0a4f34af4fe9b832399b by Miro Hron?ok in branch 'main': bpo-45413: Define "posix_venv", "nt_venv" and "venv" sysconfig installation schemes (GH-31034) https://github.com/python/cpython/commit/48d926269963cfe7a49c0a4f34af4fe9b832399b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 05:58:44 2022 From: report at bugs.python.org (lilydjwg) Date: Fri, 18 Mar 2022 09:58:44 +0000 Subject: [issue45924] Incorrect traceback when future's exception is raised multiple times In-Reply-To: <1638186926.45.0.137493772787.issue45924@roundup.psfhosted.org> Message-ID: <1647597524.19.0.15889448067.issue45924@roundup.psfhosted.org> Change by lilydjwg : ---------- nosy: +lilydjwg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:17:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2022 10:17:20 +0000 Subject: [issue45786] Avoid allocating when exiting frame; it may be unsafe. In-Reply-To: <1636643049.78.0.0321804916993.issue45786@roundup.psfhosted.org> Message-ID: <1647598640.77.0.795175113193.issue45786@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2217462bda1865a047d358306088682ee6a091ed by Victor Stinner in branch 'main': bpo-45786: Remove _PyFrame_Fini() and _PyFrame_DebugMallocStats() (GH-31874) https://github.com/python/cpython/commit/2217462bda1865a047d358306088682ee6a091ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:24:26 2022 From: report at bugs.python.org (xloem) Date: Fri, 18 Mar 2022 10:24:26 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. In-Reply-To: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> Message-ID: <1647599066.01.0.936106749193.issue42838@roundup.psfhosted.org> xloem <0xloem at gmail.com> added the comment: hey, I don't have the capacity to stay on this, but thanks for the attention, time, and clear response. there are of course other situations such as returning a resource to library code or manual loop management, but I don't have the use case present any more. maybe an aatexit library could patch this in if needed. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:25:02 2022 From: report at bugs.python.org (xloem) Date: Fri, 18 Mar 2022 10:25:02 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. In-Reply-To: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> Message-ID: <1647599102.67.0.620555530223.issue42838@roundup.psfhosted.org> Change by xloem <0xloem at gmail.com>: ---------- resolution: out of date -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:26:23 2022 From: report at bugs.python.org (xloem) Date: Fri, 18 Mar 2022 10:26:23 +0000 Subject: [issue42838] Wait for cleanup coroutines before event loop is closed. In-Reply-To: <1609941368.33.0.950412728581.issue42838@roundup.psfhosted.org> Message-ID: <1647599183.86.0.0350002527027.issue42838@roundup.psfhosted.org> Change by xloem <0xloem at gmail.com>: ---------- resolution: wont fix -> out of date _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:27:03 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 18 Mar 2022 10:27:03 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647599223.42.0.570039492132.issue47048@roundup.psfhosted.org> Christian Heimes added the comment: It does not look like a Python problem. "fatal error: error in backend" suggests that clang is crashing with an internal error. macOS 10.7 is about a decade old. Can you update to a more recent macOS and Xcode version? ---------- components: +macOS nosy: +christian.heimes, ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:33:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2022 10:33:55 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647599635.24.0.09407089204.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: > Commit 393e2bf6bc6effbfe821f051a230978f0edd70df has broken CPython in RedHat 6 Too bad that we want to support RHEL 6 but have no buildbot for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:35:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2022 10:35:06 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1647599706.79.0.337258064745.issue18309@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:38:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2022 10:38:39 +0000 Subject: [issue46994] Accept explicit contextvars.Context in asyncio create_task() API In-Reply-To: <1647081188.22.0.709370904314.issue46994@roundup.psfhosted.org> Message-ID: <1647599919.45.0.462591192213.issue46994@roundup.psfhosted.org> STINNER Victor added the comment: Nice enhancement! ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 06:41:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2022 10:41:20 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647600080.29.0.000708254249797.issue45979@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.10 didn't get a fix? https://github.com/python/cpython/pull/31939 was closed, not merged. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 07:27:29 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 18 Mar 2022 11:27:29 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647602849.67.0.933176497978.issue47037@roundup.psfhosted.org> Steve Dower added the comment: New changeset d190a9351be577a534a84fd1899f02a9f50f7276 by Christian Heimes in branch 'main': bpo-47037: Don't test for strftime('%4Y') on Windows (GH-31945) https://github.com/python/cpython/commit/d190a9351be577a534a84fd1899f02a9f50f7276 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:03:28 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Mar 2022 12:03:28 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647605008.77.0.404963532386.issue46968@roundup.psfhosted.org> miss-islington added the comment: New changeset 8e3fde728f547f1d32bde8adf62b4c50bb877b9d by Pablo Galindo Salgado in branch 'main': bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961) https://github.com/python/cpython/commit/8e3fde728f547f1d32bde8adf62b4c50bb877b9d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:05:08 2022 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Fri, 18 Mar 2022 12:05:08 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647605108.44.0.140729491322.issue46968@roundup.psfhosted.org> Change by L?szl? Kiss Koll?r : ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:15:42 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 12:15:42 +0000 Subject: [issue47042] Fix test_html_doc in test_pydoc In-Reply-To: <1647514630.11.0.12702662455.issue47042@roundup.psfhosted.org> Message-ID: <1647605742.11.0.543408765696.issue47042@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is 3.11 only issue. ---------- 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 Mar 18 08:23:21 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 18 Mar 2022 12:23:21 +0000 Subject: [issue47057] Use FASTCALL convention for FutureIter.throw() In-Reply-To: <1647606117.3.0.361797260817.issue47057@roundup.psfhosted.org> Message-ID: <1647606201.65.0.254280904274.issue47057@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30063 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:18:40 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Mar 2022 12:18:40 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647605920.8.0.265067018625.issue45979@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30062 pull_request: https://github.com/python/cpython/pull/31972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:21:57 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 18 Mar 2022 12:21:57 +0000 Subject: [issue47057] Use FASTCALL convention for FutureIter.throw() Message-ID: <1647606117.3.0.361797260817.issue47057@roundup.psfhosted.org> New submission from Andrew Svetlov : All other asyncio functions are converted to fast calls already. ---------- components: asyncio messages: 415489 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Use FASTCALL convention for FutureIter.throw() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:28:44 2022 From: report at bugs.python.org (rive_n) Date: Fri, 18 Mar 2022 12:28:44 +0000 Subject: [issue47043] Argparse can't parse subparsers with parse_known_args In-Reply-To: <1647524994.61.0.940749160258.issue47043@roundup.psfhosted.org> Message-ID: <1647606524.17.0.34252988268.issue47043@roundup.psfhosted.org> rive_n added the comment: Hi again. previous solution with: ```python3 try: namespace, args = self._parse_known_args(args, namespace) if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR): args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) return namespace, args except ArgumentError: err = _sys.exc_info()[1] self.error(str(err)) ``` Is not working at all. So i spent some time (a lot of time) to make changes in source code. I figured out exactly how the algorithm works, I read about 3,000 lines of code. And here's what I came up with: argparse.py: line 1774: parse_known_args basically this function calling protected one on line 1800: amespace, args = self._parse_known_args(args, namespace) This one is making magic. But we need to check line 1856: def take_action(action, argument_strings, option_string=None): This function creating objects of necessary classes. For example: _SubParsersAction (problem in it). Before fix: ```python3 def __call__(self, parser, namespace, values, option_string=None): parser_name = values[0] arg_strings = values[1:] # set the parser name if requested if self.dest is not SUPPRESS: setattr(namespace, self.dest, parser_name) # select the parser try: parser = self._name_parser_map[parser_name] except KeyError: args = {'parser_name': parser_name, 'choices': ', '.join(self._name_parser_map)} msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args raise ArgumentError(self, msg) # parse all the remaining options into the namespace # store any unrecognized options on the object, so that the top # level parser can decide what to do with them # In case this subparser defines new defaults, we parse them # in a new namespace object and then update the original # namespace for the relevant parts. subnamespace, arg_strings = parser.parse_known_args(arg_strings, None) for key, value in vars(subnamespace).items(): setattr(namespace, key, value) if arg_strings: vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, []) getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings) ``` After fix: ```python3 def __call__(self, parser, namespace, values, option_string=None, arg_strings_pattern:list =None): o_amount = arg_strings_pattern.count("O") if not o_amount: raise ValueError("No Os found") o_start, o_stop, indexes = arg_strings_pattern.index('O'), len(arg_strings_pattern), [] print(parser) try: while arg_strings_pattern.index('O', o_start, o_stop): indexes.append(arg_strings_pattern.index('O', o_start, o_stop)) o_start = arg_strings_pattern.index('O', o_start + 1, o_stop) except ValueError: pass for parser in range(o_amount): parser_name = values[indexes[parser] - 1] # indexes[parser] could give int (real index) arg_strings = values[indexes[parser]: indexes[(parser + 1)] - 1] if parser < len(indexes) - 1 else \ values[indexes[parser]:] # could give all data # set the parser name if requested if self.dest is not SUPPRESS: setattr(namespace, self.dest, parser_name) # select the parser try: parser = self._name_parser_map[parser_name] except KeyError: args = {'parser_name': parser_name, 'choices': ', '.join(self._name_parser_map)} msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args raise ArgumentError(self, msg) # parse all the remaining options into the namespace # store any unrecognized options on the object, so that the top # level parser can decide what to do with them # In case this subparser defines new defaults, we parse them # in a new namespace object and then update the original # namespace for the relevant parts. subnamespace, arg_strings = parser.parse_known_args(arg_strings, None) for key, value in vars(subnamespace).items(): setattr(namespace, key, value) if arg_strings: vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, []) getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings) ``` That's not the best solution but this solution works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:38:00 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Mar 2022 12:38:00 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647607080.99.0.519950881803.issue46968@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +30064 pull_request: https://github.com/python/cpython/pull/31974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:39:42 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Mar 2022 12:39:42 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647607182.22.0.68351152084.issue46968@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +30065 pull_request: https://github.com/python/cpython/pull/31975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:44:39 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 18 Mar 2022 12:44:39 +0000 Subject: [issue46343] Add PyErr_GetActiveException and PyErr_SetActiveException In-Reply-To: <1641905020.84.0.19361344207.issue46343@roundup.psfhosted.org> Message-ID: <1647607479.65.0.494189910311.issue46343@roundup.psfhosted.org> Andrew Svetlov added the comment: I have a side question. generator.throw() and coroutine.throw() have throw(type[, value[, traceback]]) signature. Is there a plan to update generators somehow to accept the exception value only? The change can go in line with other exception API changes. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 08:45:01 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Mar 2022 12:45:01 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647607501.3.0.962474805856.issue45979@roundup.psfhosted.org> miss-islington added the comment: New changeset d27af88c1bcf3c6c185f81218b7bf86b38128ea9 by Miss Islington (bot) in branch '3.10': bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938) https://github.com/python/cpython/commit/d27af88c1bcf3c6c185f81218b7bf86b38128ea9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:02:29 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 13:02:29 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647608549.34.0.507374820022.issue40296@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30066 pull_request: https://github.com/python/cpython/pull/31976 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:13:28 2022 From: report at bugs.python.org (Julien Palard) Date: Fri, 18 Mar 2022 13:13:28 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1647609208.67.0.983688717635.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +30067 pull_request: https://github.com/python/cpython/pull/31977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:20:22 2022 From: report at bugs.python.org (Jakub Kulik) Date: Fri, 18 Mar 2022 13:20:22 +0000 Subject: [issue47058] Skip tests failing on Solaris worker Message-ID: <1647609622.01.0.142147822424.issue47058@roundup.psfhosted.org> New submission from Jakub Kulik : There are several tests failing on the recently added Solaris buildbot worker. This Issue aims to fix/skip the to make Solaris green on buildbot. ################ ## test_posix ## ################ Issues with the `os.sched_get_priority_min`; fix offered here: https://bugs.python.org/issue41839 ################# ## test_shutil ## ################# Issues with `sendfile` being disabled on Solaris (and test suite not being able to handle that); fix offered here: https://bugs.python.org/issue41843 ################# ## test_locale ## ################# Strxfrm does not work in the current implementation due to the difference in Solaris locale encoding (most of which was solved with https://bugs.python.org/issue43667). Internally we have fixed this issue with: https://github.com/oracle/solaris-userland/blob/master/components/python/python39/patches/24-strxfrm-fix.patch But this idea was previously rejected in https://bugs.python.org/issue16258 Because of that, those tests are skipped on Solaris in the attached PR. ############# ## test_re ## ############# On SPARC there are some weird matches in some regexes: Traceback (most recent call last): File ".../build/Lib/test/test_re.py", line 1907, in test_locale_caching self.check_en_US_utf8() File ".../build/Lib/test/test_re.py", line 1924, in check_en_US_utf8 self.assertIsNone(re.match(b'\xc5', b'\xe5', re.L|re.I)) AssertionError: is not None I have no idea why this is happening. I presume it is locale related, but I didn't find anything problematic yet. The simplest way to reproduce this is (meaning that this probably isn't caching related): ``` import locale import re locale.setlocale(locale.LC_CTYPE, 'en_US.utf8') print(re.match(b'\xc5', b'\xe5', re.L|re.I)) ``` This returns: on Solaris and None on Linux. I am happy to investigate it further; any pointers as for where to look would be appreciated as I am stuck a little bit. ################# ## test_socket ## ################# There are two issues here. The first one is similar to what BSD, Darwin and AIX experience with testFDPass tests: https://bugs.python.org/issue22397 https://bugs.python.org/issue12958 These tests are skipped on Solaris in the attached PR. The other one is an incorrect assumption about CMSG_SPACE on SPARC Solaris; it grows slightly sooner when increasing length compared to other platforms I tested. with toobig == 2147483632 length socket.CMSG_SPACE output 2147483619 2147483632 2147483620 2147483632 2147483621 2147483640 2147483622 2147483640 2147483623 2147483640 2147483624 2147483640 2147483625 2147483640 2147483626 2147483640 2147483627 2147483640 2147483628 2147483640 2147483629 <- OverflowError ====================================================================== ERROR: testCMSG_SPACE (test.test_socket.CmsgMacroTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builds/jkulik/testing/components/python/python39/Python-3.9.9/Lib/test/test_socket.py", line 3360, in testCMSG_SPACE ret = socket.CMSG_SPACE(n) OverflowError: CMSG_SPACE() argument out of range (on other platforms, increases generally happen with lengths divisible by 8, meaning that it gets all the way to 2147483631). I am unsure how to fix this (currently, PR includes change we use internally but is likely not acceptable) as I don't know how to correctly guess the largest CMSG_SPACE on all platforms. Is it even necessary though (it can test OverflowError on other values than just the first failing one and can end slightly sooner)? ############### ## test_time ## ############### This was recently fixed with: https://bugs.python.org/issue46099 ---------- components: Tests messages: 415493 nosy: kulikjak priority: normal severity: normal status: open title: Skip tests failing on Solaris worker versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:20:32 2022 From: report at bugs.python.org (Jakub Kulik) Date: Fri, 18 Mar 2022 13:20:32 +0000 Subject: [issue47058] Skip tests failing on Solaris worker In-Reply-To: <1647609622.01.0.142147822424.issue47058@roundup.psfhosted.org> Message-ID: <1647609632.68.0.0647464179464.issue47058@roundup.psfhosted.org> Change by Jakub Kulik : ---------- keywords: +patch pull_requests: +30068 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:22:10 2022 From: report at bugs.python.org (Jakub Kulik) Date: Fri, 18 Mar 2022 13:22:10 +0000 Subject: [issue47058] Skip tests failing on Solaris In-Reply-To: <1647609622.01.0.142147822424.issue47058@roundup.psfhosted.org> Message-ID: <1647609730.09.0.333695837227.issue47058@roundup.psfhosted.org> Change by Jakub Kulik : ---------- title: Skip tests failing on Solaris worker -> Skip tests failing on Solaris _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:23:17 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 18 Mar 2022 13:23:17 +0000 Subject: [issue47055] `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8 In-Reply-To: <1647571955.22.0.67382471148.issue47055@roundup.psfhosted.org> Message-ID: <1647609797.17.0.59743731659.issue47055@roundup.psfhosted.org> Eric V. Smith added the comment: Since those releases are no longer supported, I don't think there's any place you could put this that would be seen. And we wouldn't want to put a note in a current release about a bug in a non-supported version that was fixed in another non-supported version. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:26:06 2022 From: report at bugs.python.org (Jean-Paul Calderone) Date: Fri, 18 Mar 2022 13:26:06 +0000 Subject: [issue22628] Idle: Tree lines are spaced too close together. In-Reply-To: <1413256178.66.0.725794954703.issue22628@psf.upfronthosting.co.za> Message-ID: <1647609966.71.0.767520234213.issue22628@roundup.psfhosted.org> Jean-Paul Calderone added the comment: This is still/again broken, probably because the "fixed" version still hard-codes all of the geometry values and these will certainly not be correct for all combinations of display dpi, font configuration, etc. Instead, `TreeNode.draw` and `TreeNode.drawtext` (at least) need to consider the size of the children and space them accordingly. ---------- nosy: +exarkun resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:33:11 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Mar 2022 13:33:11 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647610391.81.0.34197388799.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a12ef81231d65da5efbef4fa1434716270a19af6 by Pablo Galindo Salgado in branch '3.9': [3.9] bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961). (GH-31975) https://github.com/python/cpython/commit/a12ef81231d65da5efbef4fa1434716270a19af6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:33:14 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Mar 2022 13:33:14 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647610394.94.0.42718737709.issue46968@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6fd9737373f2bed03f409440b4fd50b9f8f121cb by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961). (GH-31974) https://github.com/python/cpython/commit/6fd9737373f2bed03f409440b4fd50b9f8f121cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 09:33:30 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Mar 2022 13:33:30 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647610410.38.0.634002258143.issue46968@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 Mar 18 09:43:51 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 13:43:51 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1647611031.6.0.978049261605.issue14156@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30069 pull_request: https://github.com/python/cpython/pull/31979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:05:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Mar 2022 14:05:02 +0000 Subject: [issue46343] Add PyErr_GetActiveException and PyErr_SetActiveException In-Reply-To: <1641905020.84.0.19361344207.issue46343@roundup.psfhosted.org> Message-ID: <1647612302.53.0.894304339.issue46343@roundup.psfhosted.org> Irit Katriel added the comment: We should make throw accept an exception instance, the same thing was done in the traceback module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:07:58 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Mar 2022 14:07:58 +0000 Subject: [issue46114] OpenSSL 3.0 uses different version scheme In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org> Message-ID: <1647612478.04.0.980267571978.issue46114@roundup.psfhosted.org> Miro Hron?ok added the comment: 3.8 is security only, so I suppose there is no chance of getting the test fixed as well? ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 10:15:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Mar 2022 14:15:32 +0000 Subject: [issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA In-Reply-To: <1646852822.75.0.964834360067.issue46968@roundup.psfhosted.org> Message-ID: <1647612932.55.0.768824082269.issue46968@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for the fix Pablo. ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:02:53 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 15:02:53 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1647615773.9.0.659543372986.issue14156@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4d2099f455229b10f88846dbe9fe6debbee55356 by Serhiy Storchaka in branch '3.9': [3.9] bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165) (GH-31979) https://github.com/python/cpython/commit/4d2099f455229b10f88846dbe9fe6debbee55356 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:03:40 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 15:03:40 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1647615820.77.0.582206484533.issue14156@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:05:18 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 18 Mar 2022 15:05:18 +0000 Subject: [issue46114] OpenSSL 3.0 uses different version scheme In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org> Message-ID: <1647615918.76.0.953046462443.issue46114@roundup.psfhosted.org> Christian Heimes added the comment: Correct, I didn't backport this fix and several other OpenSSL 3.0 related fixes to Python 3.8 because 3.8 is in security-only mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:07:49 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Mar 2022 15:07:49 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647616069.71.0.466291347901.issue47037@roundup.psfhosted.org> Terry J. Reedy added the comment: I recompiled, retested, and all tests are ok, with no unexpected box. Thank you all. The vcruntime warnings are also gone, so I will chalk them up to a onetime glitch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:11:51 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Mar 2022 15:11:51 +0000 Subject: [issue46114] OpenSSL 3.0 uses different version scheme In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org> Message-ID: <1647616311.23.0.616129936956.issue46114@roundup.psfhosted.org> Miro Hron?ok added the comment: Ack, will do it downstream-only. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:17:19 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 15:17:19 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1647616639.48.0.59747605317.issue44405@roundup.psfhosted.org> Serhiy Storchaka added the comment: Neither of tokenize, ast or symtable modules support passing the source string as argument. If add this feature in the dis module, we will need to add it in all other modules with similar CLI. I do not think it is practical. You always can pass the source string via stdin. And you do not even need to pass /dev/stdin as argument, stdin is the default. I usually use it with rlwrap. It allows to use some editing and history. rlwrap ./python -m dis I propose to close this issue and open a new issue for documenting the CLI of the dis module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:19:15 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Mar 2022 15:19:15 +0000 Subject: [issue31552] IDLE: Convert browswers to use ttk.Treeview In-Reply-To: <1506093531.0.0.600281497403.issue31552@psf.upfronthosting.co.za> Message-ID: <1647616755.0.0.0558851994395.issue31552@roundup.psfhosted.org> Terry J. Reedy added the comment: 3. continued. As noted in #22628, idlelib.tree has line spacing and other stuff hardcoded so it will not work properly on all monitors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:44:13 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Mar 2022 15:44:13 +0000 Subject: [issue22628] Idle: Tree lines are spaced too close together. In-Reply-To: <1413256178.66.0.725794954703.issue22628@psf.upfronthosting.co.za> Message-ID: <1647618253.77.0.0638641725502.issue22628@roundup.psfhosted.org> Terry J. Reedy added the comment: We started using ttk widgets in 3.6. As I said above, the real solution should be to use ttk.Treeview. This is issue 31552. ---------- resolution: -> fixed status: open -> closed superseder: -> IDLE: Convert browswers to use ttk.Treeview _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 11:57:19 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 18 Mar 2022 15:57:19 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647619039.83.0.948965907852.issue47037@roundup.psfhosted.org> Eryk Sun added the comment: The main entry point for python[_d].exe should support a command-line -X option or environment variable that suppresses Windows error/assert/warn reporting, or redirects it to stderr in verbose mode. This would be useful to simplify everyone's automated testing. It should require opting in, both for backward compatibility and also because the dialogs are useful for interactive testing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:07:36 2022 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 18 Mar 2022 16:07:36 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1647619656.71.0.881287975939.issue45413@roundup.psfhosted.org> Filipe La?ns added the comment: With PR 31034 merged, we can now mark this as resolved. As mentioned in the PR, there are still some concerns about maintainability and avoiding similar issues to happen in the future. That can be done later, as people find time to work on it. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:34:59 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Fri, 18 Mar 2022 16:34:59 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647621299.48.0.0921048402597.issue46382@roundup.psfhosted.org> Change by Arie Bovenberg : ---------- keywords: +patch pull_requests: +30070 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:41:52 2022 From: report at bugs.python.org (Ben Darnell) Date: Fri, 18 Mar 2022 16:41:52 +0000 Subject: [issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio In-Reply-To: <1645524928.96.0.755041008121.issue46824@roundup.psfhosted.org> Message-ID: <1647621712.88.0.480890345767.issue46824@roundup.psfhosted.org> Ben Darnell added the comment: To summarize the justification, this patch does two things: it moves an optimization from create_connection to getaddrinfo, which makes it apply to more callers (including Tornado), and it makes the code simpler and less redundant (net reduction of 47 non-test lines in the patch). As far as we can tell, the reason it wasn't done this way in the first place is that at the time getaddrinfo held a global lock on some platforms, but this is no longer true. If there's still some locking in or around getaddrinfo on some platforms (or some libc implementations), this patch would be a bad idea. Is there a good way to test for that? I suppose we could set up a deliberately-slow DNS server and try to call getaddrinfo with AI_NUMERICHOST while another thread is blocked talking to that server, but that seems like a lot of test infrastructure to build out. ---------- nosy: +Ben.Darnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 12:45:34 2022 From: report at bugs.python.org (Ben Darnell) Date: Fri, 18 Mar 2022 16:45:34 +0000 Subject: [issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio In-Reply-To: <1645524928.96.0.755041008121.issue46824@roundup.psfhosted.org> Message-ID: <1647621934.61.0.837299726312.issue46824@roundup.psfhosted.org> Ben Darnell added the comment: On MacOS in 2015, getaddrinfo was found to be much slower than inet_pton. Unless that's changed, this patch would be a performance regression on that platform. Data and benchmark script in https://groups.google.com/g/python-tulip/c/-SFI8kkQEj4/m/m1-oCMSABgAJ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 13:02:01 2022 From: report at bugs.python.org (Laurent Delphin) Date: Fri, 18 Mar 2022 17:02:01 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647622921.68.0.412408971526.issue47048@roundup.psfhosted.org> Laurent Delphin added the comment: I didn't expect to buy in a very next future a new Mac. The main reason 8s,because I have too much third parties to rebuild, and needing some months to spend. But it is forecasted. Besides, the Compiler Gcc 4.9.4 I built with clang seems working. But with a new bug, even though Python is built. Thank you very much for your reply. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 13:19:41 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 18 Mar 2022 17:19:41 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647623981.23.0.575424396823.issue47037@roundup.psfhosted.org> Steve Dower added the comment: New changeset d0a91bd277d1122b41d59e8022b596e3b3ae24fe by Steve Dower in branch 'main': bpo-47037: Test debug builds on Windows in CI so that native assertions are noticed sooner (GH-31965) https://github.com/python/cpython/commit/d0a91bd277d1122b41d59e8022b596e3b3ae24fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 13:56:48 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Mar 2022 17:56:48 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647626208.76.0.285469565861.issue43224@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 3a2b89580ded72262fbea0f7ad24096a90c42b9c by Jelle Zijlstra in branch 'main': bpo-43224: Add TypeVarTuple.__name__ (GH-31954) https://github.com/python/cpython/commit/3a2b89580ded72262fbea0f7ad24096a90c42b9c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:00:50 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Fri, 18 Mar 2022 18:00:50 +0000 Subject: [issue47059] Mechanism to enable __weakref__ slot on dataclass(slots=True) Message-ID: <1647626450.19.0.913464434191.issue47059@roundup.psfhosted.org> New submission from Arie Bovenberg : As discussed in bpo-46382, dataclasses may want to support the __weakref__ slot. Currently, automatically slotted dataclasses are not given a __weakref__ slot. This makes auto-slotted dataclasses incompatible with weakref. The attrs library has chosen for the following approeach: - when slots are generated, a __weakref__ slot is added by default - this may be optionally disabled with the weakref_slot=False flag See this discussion on why that approach was taken: https://github.com/python-attrs/attrs/pull/420 The question for dataclass is: do we want to follow suit? Or perhaps make __weakref__ slot opt-in instead of opt-out? ---------- components: Library (Lib) messages: 415515 nosy: ariebovenberg, eric.smith priority: normal severity: normal status: open title: Mechanism to enable __weakref__ slot on dataclass(slots=True) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:11:51 2022 From: report at bugs.python.org (David Robertson) Date: Fri, 18 Mar 2022 18:11:51 +0000 Subject: [issue47060] importlib.metadata.version can return None Message-ID: <1647627111.5.0.916218060724.issue47060@roundup.psfhosted.org> New submission from David Robertson : Originally written up at the typeshed repo: https://github.com/python/typeshed/issues/7513. The conclusion was that this is a bug in the implementation rather than an incorrect annotation. To my surprise, I discovered in https://github.com/matrix-org/synapse/issues/12223 that it is possible for `importlib.metadata.version(...)` to return `None`. To reproduce this: 1. Create a new virtual environment. I'm using CPython 3.10.2 as my interpreter. 2. Within the venv, `pip install bottle`. (Any package will do; I choose `bottle` because it's small and doesn't have any dependencies). 3. Check importlib reports the `version` of `bottle`: ```python >>> import importlib.metadata as m >>> m.version('bottle') '0.12.19' ``` 4. Here's the dirty bit: remove the metadata files for that package but keep the metadata directory. - Use `pip show bottle` to find the `site-packages` location - From there, remove all files in the `bottle-VERSION-.dist-info` directory: `rm /path/to/site-packages/bottle-VERSION.dist-info/*'. 5. The `version` of `bottle` is now judged to be `None`: ```python >>> import importlib.metadata as m >>> m.version("bottle") is None True ``` `pip show bottle` now determines that `bottle` isn't installed: ```shell $ pip show bottle WARNING: Package(s) not found: bottle ``` As well as importlib.metadata.version, importlib.metadata.Distribution.version and importlib.metadata.Distribution.name return None in this situation. I couldn't see any suggestion in the stdlib docs (https://docs.python.org/3.10/library/importlib.metadata.html#distribution-versions) that this was possible. (Aside: it'd be great if the docs mention that PackageNotFoundError is raised if a package is not installed.) No-one in their right mind should do step 4 willingly, but I have seen it happen in the wild (https://github.com/matrix-org/synapse/issues/12223). We suspected a botched backup or similar was to blame. I'm not familiar with all the machinery of Python package management, but I think I'd expect there to be a PackageNotFoundError raised in this situation? (I can imagine a package that doesn't declare its version, where `version()` returning `None` might make sense; but that feels odd.) Is the behaviour as intended? It looks like this might be related to https://github.com/python/importlib_metadata/issues/371? ---------- components: Library (Lib) messages: 415516 nosy: David Robertson priority: normal severity: normal status: open title: importlib.metadata.version can return None type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:16:59 2022 From: report at bugs.python.org (Zachary Ware) Date: Fri, 18 Mar 2022 18:16:59 +0000 Subject: [issue47060] importlib.metadata.version can return None In-Reply-To: <1647627111.5.0.916218060724.issue47060@roundup.psfhosted.org> Message-ID: <1647627419.13.0.216497461454.issue47060@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:22:22 2022 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 18 Mar 2022 18:22:22 +0000 Subject: [issue46114] OpenSSL 3.0 uses different version scheme In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org> Message-ID: <1647627742.91.0.16234715645.issue46114@roundup.psfhosted.org> Charalampos Stratakis added the comment: 3.8 builds are still running on the buildbots so not fixing 3.8 will cause them to fail. ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:46:16 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 18 Mar 2022 18:46:16 +0000 Subject: [issue47015] Update tests from asyncore to asyncio In-Reply-To: <1647290281.28.0.271890781969.issue47015@roundup.psfhosted.org> Message-ID: <1647629176.09.0.39197305763.issue47015@roundup.psfhosted.org> Oleg Iarygin added the comment: The PR is ready for a review; I sorted out all bugs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:46:42 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Mar 2022 18:46:42 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647629202.29.0.632730598346.issue40296@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +30071 pull_request: https://github.com/python/cpython/pull/31981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 14:46:48 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 18:46:48 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647629208.87.0.75932561269.issue40296@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a5b7678a67ac99edd50822827b772e7d9afc8e64 by Serhiy Storchaka in branch '3.10': [3.10] bpo-40296: Fix supporting generic aliases in pydoc (GH-30253). (GH-31976) https://github.com/python/cpython/commit/a5b7678a67ac99edd50822827b772e7d9afc8e64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:00:09 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 18 Mar 2022 19:00:09 +0000 Subject: [issue433030] SRE: Atomic Grouping (?>...) is not supported Message-ID: <1647630009.57.0.657351100563.issue433030@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30072 pull_request: https://github.com/python/cpython/pull/31982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:29:33 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 18 Mar 2022 19:29:33 +0000 Subject: [issue433030] SRE: Atomic Grouping (?>...) is not supported Message-ID: <1647631773.29.0.201652086436.issue433030@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: effbot -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:45:54 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Mar 2022 19:45:54 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647632754.77.0.789562570463.issue47022@roundup.psfhosted.org> miss-islington added the comment: New changeset 77473846439b8a3eae66de1a1cfe931619f38513 by Hugo van Kemenade in branch 'main': bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 (GH-31891) https://github.com/python/cpython/commit/77473846439b8a3eae66de1a1cfe931619f38513 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:46:22 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 19:46:22 +0000 Subject: [issue47061] Document PEP 594 deprecations In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647632782.14.0.458881401002.issue47061@roundup.psfhosted.org> Change by Brett Cannon : ---------- dependencies: +PEP 594: Document removal of asynchat, asyncore and smtpd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:46:10 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 19:46:10 +0000 Subject: [issue47061] Document PEP 594 deprecations Message-ID: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> New submission from Brett Cannon : https://peps.python.org/pep-0594/ The SC has asked that all modules deprecated by PEP 594 have the documented deprecation backported. The message should also not have any specific removal version to avoid any potential delay, but then making the bugfix-only docs incorrect. - [ ] aifc - [ ] asynchat: https://bugs.python.org/issue47022 - [ ] asyncore: https://bugs.python.org/issue47022 - [ ] audioop - [ ] cgi - [ ] cgitb - [ ] chunk - [ ] crypt - [ ] imghdr - [ ] msilib - [ ] nntplib - [ ] nis - [ ] ossaudiodev - [ ] pipes - [ ] smtpd: https://bugs.python.org/issue47022 - [ ] sndhdr - [ ] spwd - [ ] sunau - [ ] telnetlib - [ ] uu - [ ] xdrlib ---------- assignee: brett.cannon components: Library (Lib) messages: 415521 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Document PEP 594 deprecations versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:51:20 2022 From: report at bugs.python.org (Roundup Robot) Date: Fri, 18 Mar 2022 19:51:20 +0000 Subject: [issue16845] warnings.simplefilter should validate input In-Reply-To: <1357173726.64.0.0586309357998.issue16845@psf.upfronthosting.co.za> Message-ID: <1647633080.55.0.0299184076404.issue16845@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +30073 pull_request: https://github.com/python/cpython/pull/31983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 15:52:15 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Fri, 18 Mar 2022 19:52:15 +0000 Subject: [issue16845] warnings.simplefilter should validate input In-Reply-To: <1357173726.64.0.0586309357998.issue16845@psf.upfronthosting.co.za> Message-ID: <1647633135.04.0.288642774447.issue16845@roundup.psfhosted.org> Dani?l van Noord added the comment: I have submitted the path by @berker.peksag with one additional test case in a new PR. @nanjekyejoannah I saw you responded to the other PR, but that died down. Would you mind taking a look at mine? I'm happy to help land this :) ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:00:31 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 20:00:31 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647633631.71.0.590661545361.issue47061@roundup.psfhosted.org> Change by Brett Cannon : ---------- title: Document PEP 594 deprecations -> Deprecate modules listed in PEP 594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:04:02 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 18 Mar 2022 20:04:02 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647633842.75.0.604804571589.issue47061@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:05:49 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Fri, 18 Mar 2022 20:05:49 +0000 Subject: [issue15393] JSONDecoder.raw_decode breaks on leading whitespace In-Reply-To: <1342692596.02.0.962530841473.issue15393@psf.upfronthosting.co.za> Message-ID: <1647633949.52.0.333337380616.issue15393@roundup.psfhosted.org> Dani?l van Noord added the comment: @Bayard Randel, do you want to make this patch into a GitHub PR? If not, I could help by doing so and try to get this landed. ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:11:26 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 20:11:26 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647634286.8.0.0687041570889.issue47022@roundup.psfhosted.org> Brett Cannon added the comment: Merged into `main`, but the backports to 3.10 and 3.9 failed. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:18:15 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 18 Mar 2022 20:18:15 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647634695.35.0.842371195866.issue47022@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: patch review -> backport needed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:26:59 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 20:26:59 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647635219.98.0.768010596369.issue47061@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +30074 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:32:05 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 20:32:05 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647635525.39.0.277763079971.issue47061@roundup.psfhosted.org> Brett Cannon added the comment: The first PR for documenting the modules is up. Once this gets merged and backported I will add a helper function in `warnings` and then make the appropriate code changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:32:18 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Mar 2022 20:32:18 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647635538.98.0.188149326067.issue47061@roundup.psfhosted.org> Change by Brett Cannon : ---------- priority: normal -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:37:06 2022 From: report at bugs.python.org (Bluenix) Date: Fri, 18 Mar 2022 20:37:06 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" should be "parameter" In-Reply-To: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> Message-ID: <1647635826.56.0.76409147702.issue47054@roundup.psfhosted.org> Bluenix added the comment: Yes I agree, that would be the best. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:44:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 18 Mar 2022 20:44:42 +0000 Subject: [issue47062] Implement asyncio.Runner context manager Message-ID: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> New submission from Andrew Svetlov : Sometimes asyncio.run() is not enough. For example, unittest test case needs to call several async functions (setup, test, teardown) from the synchronous code using the same execution context and event loop. The proposal provides the following: with Runner() as runner: runner.run(async_func()) ---------- components: asyncio messages: 415527 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Implement asyncio.Runner context manager versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 16:45:28 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 18 Mar 2022 20:45:28 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1647636328.86.0.167459945309.issue47062@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30075 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 17:36:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Mar 2022 21:36:42 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1647639402.43.0.433083618902.issue44439@roundup.psfhosted.org> Irit Katriel added the comment: Can this be closed now or is there anything else to do? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 17:42:56 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 18 Mar 2022 21:42:56 +0000 Subject: [issue47060] importlib.metadata.version can return None In-Reply-To: <1647627111.5.0.916218060724.issue47060@roundup.psfhosted.org> Message-ID: <1647639776.61.0.128084475348.issue47060@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks for the report. Yes, the issues are related, where .version and .name returning None are specific manifestations of the metadata not having that key and the behavior being ill-defined. I haven't yet decided if metadata items being undefined should result in None or raise an Exception (maybe KeyError). For the specific case of a missing Name or Version, however, the packaging spec says that these fields are required (https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata-specifications), so it may be reasonable for the behavior when the specification is not met that the resulting behavior would be undefined (i.e. importlib.metadata should be able to assume the specification). It's outside the scope of importlib.metadata to detect, report, and repair invalid metadata. I would welcome and even encourage a third-party package to take on the responsibility of validating all distributions in an environment and reporting on non-compliant aspects. In that sense, the type declaration is correct. `.name` and `.version` should always return `str` or raise an exception. This additional example leads me stronger toward the position that `.metadata[missing]` should raise a KeyError, which would also fix this issue. I'd also argue that if the metadata file is missing altogether, that should perhaps be a different error. That is, missing metadata is different from null metadata. Right now, the two are indistinguishable from the interface. > I'd expect there to be a PackageNotFoundError raised in this situation That doesn't sound quite right to me. If there's a `.dist-info` directory, that implies a package is present. e.g.: ``` ~ $ mkdir foo.dist-info ~ $ py -c "import importlib.metadata as md; print(md.distribution('foo'))" ``` I'm going to ponder this one some more and probably address the `.metadata` issue(s) first before making any pronouncements on the best approach here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:45:41 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 19 Mar 2022 00:45:41 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" should be "parameter" In-Reply-To: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> Message-ID: <1647650741.57.0.12019555014.issue47054@roundup.psfhosted.org> Terry J. Reedy added the comment: Current message same in 3.11 and 3.9, but I am not sure about backporting to old parser. However merges a change, if any, can decide. ---------- nosy: +pablogsal, terry.reedy stage: -> needs patch type: -> behavior versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:46:08 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 19 Mar 2022 00:46:08 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" confuses In-Reply-To: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> Message-ID: <1647650768.58.0.162462109128.issue47054@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: "SyntaxError: non-default argument follows default argument" should be "parameter" -> "SyntaxError: non-default argument follows default argument" confuses _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 20:56:59 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 19 Mar 2022 00:56:59 +0000 Subject: [issue47056] turtle.write() causes flickering when the tracer is turned off. In-Reply-To: <1647595653.53.0.61025954383.issue47056@roundup.psfhosted.org> Message-ID: <1647651419.18.0.782971461512.issue47056@roundup.psfhosted.org> Terry J. Reedy added the comment: On Win10, running 3.11.0a5+ from command line, upper ABC and boxes flicker when strings are displayed. (When run with from IDLE editor, there is no flicker except sometimes when moving mouse over or off title bar buttons.) (3.8 only gets security fixes.) ---------- nosy: +terry.reedy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 21:20:28 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 19 Mar 2022 01:20:28 +0000 Subject: [issue31552] IDLE: Convert browswers to use ttk.Treeview In-Reply-To: <1506093531.0.0.600281497403.issue31552@psf.upfronthosting.co.za> Message-ID: <1647652828.03.0.382443919791.issue31552@roundup.psfhosted.org> Terry J. Reedy added the comment: ttk.Treeview also has problems, at least on some systems and versions. https://mail.python.org/pipermail/tkinter-discuss/2022-March/004226.html HiDPI displays and tkinter [cont] https://mail.python.org/pipermail/tkinter-discuss/attachments/20220316/843e7076/attachment-0001.png Apparently on linux. https://mail.python.org/pipermail/tkinter-discuss/2022-March/004228.html https://www.tcl.tk/man/tcl/TkCmd/ttk_treeview.html under "Styling Options' there is parameter to set the -rowheight that needs to be defined as ttk::style configure Treeview \ -rowheight [expr {[font metrics font -linespace] + 2}] however I could not find how to call this command, and when If I do the following style = ttk.Style() style.configure("Treeview", rowheight="30") it works, but it is not dynamic with the font size/dpi Response has suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 18 23:26:02 2022 From: report at bugs.python.org (Stanley) Date: Sat, 19 Mar 2022 03:26:02 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1647660362.94.0.657952940802.issue47031@roundup.psfhosted.org> Stanley added the comment: How does this sound instead? The unequalness is pushed to the front and the IEEE part back so it's less likely missed: Math.nan and float('nan') are never equal to any other value, including themselves, as per IEEE 754. Use math.isnan to test for NANs. ---------- nosy: +slateny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 00:25:14 2022 From: report at bugs.python.org (Myron Walker) Date: Sat, 19 Mar 2022 04:25:14 +0000 Subject: [issue47063] SimpleHTTPRequestHandler has hard coded index page list. Message-ID: <1647663914.0.0.21035920987.issue47063@roundup.psfhosted.org> New submission from Myron Walker : SimpleHTTPRequestHandler has hard coded index page list in the send_head method. The fixed hard-coded list means that if you want to have a custom index page that is not named "index.htm" or "index.html" then you have to override the send_head method. There is alot of code in send_head so overriding it is not optimal just to have a custom indexer filename. ---------- components: Library (Lib) messages: 415534 nosy: Myron Walker priority: normal severity: normal status: open title: SimpleHTTPRequestHandler has hard coded index page list. type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 00:27:07 2022 From: report at bugs.python.org (Myron Walker) Date: Sat, 19 Mar 2022 04:27:07 +0000 Subject: [issue47063] SimpleHTTPRequestHandler has hard coded index page list. In-Reply-To: <1647663914.0.0.21035920987.issue47063@roundup.psfhosted.org> Message-ID: <1647664027.8.0.503698311107.issue47063@roundup.psfhosted.org> Myron Walker added the comment: I am adding a Github PR for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 00:28:01 2022 From: report at bugs.python.org (Roundup Robot) Date: Sat, 19 Mar 2022 04:28:01 +0000 Subject: [issue47063] SimpleHTTPRequestHandler has hard coded index page list. In-Reply-To: <1647663914.0.0.21035920987.issue47063@roundup.psfhosted.org> Message-ID: <1647664081.87.0.553699116368.issue47063@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +30076 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 02:02:11 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 19 Mar 2022 06:02:11 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1647669731.85.0.732697742529.issue47031@roundup.psfhosted.org> Vedran ?a?i? added the comment: I'm not satisfied with "and" formulation. For all practical purposes, math.nan is the "same" object as float('nan'), they just represent two ways of referring to it (or constructing it). To me it sounds a bit like "2 and 1+1 are the only even prime numbers." I suggest the docs only speak of math.nan here, and elsewhere to say that they can also be constructed by float('nan'). ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 04:04:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 08:04:21 +0000 Subject: [issue38307] Add .end_lineno attribute to pyclbr _Objects In-Reply-To: <1569691590.29.0.185701662636.issue38307@roundup.psfhosted.org> Message-ID: <1647677061.19.0.0506525682061.issue38307@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 04:43:15 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 19 Mar 2022 08:43:15 +0000 Subject: [issue31552] IDLE: Convert browsers to use ttk.Treeview In-Reply-To: <1506093531.0.0.600281497403.issue31552@psf.upfronthosting.co.za> Message-ID: <1647679395.75.0.835564344202.issue31552@roundup.psfhosted.org> Change by Alex Waygood : ---------- title: IDLE: Convert browswers to use ttk.Treeview -> IDLE: Convert browsers to use ttk.Treeview _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 04:45:54 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 19 Mar 2022 08:45:54 +0000 Subject: [issue433030] SRE: Atomic Grouping (?>...) is not supported Message-ID: <1647679554.2.0.476508002554.issue433030@roundup.psfhosted.org> Change by Alex Waygood : ---------- versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:22:00 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 09:22:00 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1647681720.77.0.488206313713.issue47031@roundup.psfhosted.org> Serhiy Storchaka added the comment: We cannot guarantee that NAN never equal to anything, because we can create an object equal to it. For example mock.ANY. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:25:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 19 Mar 2022 09:25:26 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647681926.39.0.214586791943.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30077 pull_request: https://github.com/python/cpython/pull/31986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 05:57:26 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 19 Mar 2022 09:57:26 +0000 Subject: [issue47064] thread QOS attribute on macOS Message-ID: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> New submission from Ronald Oussoren : Arm based Mac systems have several types of cores: performance cores and efficiency cores. The system has no way to directly specify which core a particular proces or thread uses, but programs can use an API for setting the QOS class of a thread that will influence which type of core a proces is scheduled on. The primary use case for this would be to select a lower QOS class for background tasks to ensure that those minimally impact interactive code. It would be nice to expose this functionality in Python. One way to do this is to expose two or three new APIs: 0. Expose an enum.IntEnum on macOS for the various QOS classes 1. An API for setting the QOS class of a particular thread (which could also be used to change that class for the main thread), for example a read/write property ``threading.Thread.qos_class`` 2. A new keyword argument ``qos_class`` to ``threading.Thread.__init__()`` 3. Optional: an API for setting changing the default value for that new keyword argument The new API would only exist on macOS. One consideration: This is a platform specific option, in my limited research I haven't found an easy way to accomplish similar results on Linux or Windows. Background information: https://developer.apple.com/documentation/apple-silicon/tuning-your-code-s-performance-for-apple-silicon ---------- components: Interpreter Core, macOS messages: 415538 nosy: ned.deily, ronaldoussoren priority: normal severity: normal status: open title: thread QOS attribute on macOS type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 06:39:28 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 10:39:28 +0000 Subject: [issue433030] SRE: Atomic Grouping (?>...) is not supported Message-ID: <1647686368.96.0.220871739442.issue433030@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +mrabarnett priority: low -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:10:26 2022 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 19 Mar 2022 11:10:26 +0000 Subject: [issue47065] test_curses fails if terminal defaults to bright white text (15) Message-ID: <1647688226.18.0.712110754923.issue47065@roundup.psfhosted.org> New submission from Nick Coghlan : test_curses fails for me by default (running on Fedora 35 in KDE's Konsole): ``` [ncoghlan at thechalk cpython]$ echo $TERM xterm-256color [ncoghlan at thechalk cpython]$ ./python -m test -u curses test_curses 0:00:00 load avg: 0.88 Run tests sequentially 0:00:00 load avg: 0.88 [1/1] test_curses test test_curses failed -- Traceback (most recent call last): File "/home/ncoghlan/devel/cpython/Lib/test/test_curses.py", line 48, in wrapped test(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ncoghlan/devel/cpython/Lib/test/test_curses.py", line 993, in test_use_default_colors self.assertIn(old, [(curses.COLOR_WHITE, curses.COLOR_BLACK), (-1, -1), (0, 0)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: (15, 0) not found in [(7, 0), (-1, -1), (0, 0)] test_curses failed (1 failure) == Tests result: FAILURE == 1 test failed: test_curses Total duration: 466 ms Tests result: FAILURE ``` The active terminal info indicates that the default text colour is indeed bright white (assuming I'm reading the infocmp output correctly), so it feels like (15, 0) is just missing from the set of permissible "old" colour pairs in the test case: ``` [ncoghlan at thechalk cpython]$ infocmp -L | grep initialize_color initialize_color=\E]4;%p1%d;rgb\072%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\, ``` ---------- components: Tests messages: 415539 nosy: ncoghlan, petr.viktorin, twouters priority: normal severity: normal stage: needs patch status: open title: test_curses fails if terminal defaults to bright white text (15) type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:21:26 2022 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 19 Mar 2022 11:21:26 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1647688886.37.0.421658907965.issue44800@roundup.psfhosted.org> Change by Nick Coghlan : ---------- pull_requests: +30078 pull_request: https://github.com/python/cpython/pull/31987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:22:19 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 11:22:19 +0000 Subject: [issue46410] TypeError when parsing regexp with unicode named character sequence escape In-Reply-To: <1642422690.85.0.963373421806.issue46410@roundup.psfhosted.org> Message-ID: <1647688939.32.0.75363304241.issue46410@roundup.psfhosted.org> Serhiy Storchaka added the comment: >>> import unicodedata >>> unicodedata.lookup('KEYCAP NUMBER SIGN') '#?' >>> print(ascii(unicodedata.lookup('KEYCAP NUMBER SIGN'))) '#\ufe0f\u20e3' Support of Unicode Named Character Sequences in the unicodeescape codec and in the RE parser would be a new feature. ---------- components: +Interpreter Core, Unicode nosy: +serhiy.storchaka, vstinner type: behavior -> enhancement versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:40:36 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 11:40:36 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647690036.89.0.547363580618.issue39394@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30079 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 07:45:47 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 11:45:47 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647690347.36.0.604245678966.issue39394@roundup.psfhosted.org> Serhiy Storchaka added the comment: This warning was introduced in 3.6. It is a time to convert it into an error. RE error messages contain position. But I understand that very few users will use 3.11 in nearest future, so I am going to add a position to warning message and backport this change. It is not a bugfix in strong meaning, but I think it is safe to backport it. ---------- versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:00:57 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 19 Mar 2022 12:00:57 +0000 Subject: [issue44075] Add a PEP578 audit hook for Asyncio loop stalls In-Reply-To: <1620476386.35.0.418122152623.issue44075@roundup.psfhosted.org> Message-ID: <1647691257.74.0.0392478104115.issue44075@roundup.psfhosted.org> Andrew Svetlov added the comment: I am still not convinced that audit events should be used. Maybe support of explicit callbacks pair (on_start() + on_finish()) with `None` for fast-and-cheap "do nothing flag" is a better alternative for catching stale coroutines? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:01:51 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 19 Mar 2022 12:01:51 +0000 Subject: [issue47057] Use FASTCALL convention for FutureIter.throw() In-Reply-To: <1647606117.3.0.361797260817.issue47057@roundup.psfhosted.org> Message-ID: <1647691311.06.0.0624837032914.issue47057@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 0a8b8e0d262eae83ffbc6b414a1f5747cdbd1d88 by Andrew Svetlov in branch 'main': bpo-47057: Use FASTCALL convention for FutureIter.throw() (GH-31973) https://github.com/python/cpython/commit/0a8b8e0d262eae83ffbc6b414a1f5747cdbd1d88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:09:48 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 12:09:48 +0000 Subject: [issue47066] Convert a warning about flags not at the start of the regular expression into error Message-ID: <1647691788.19.0.394073158016.issue47066@roundup.psfhosted.org> New submission from Serhiy Storchaka : This warning was introduced in 3.6. The reason is that in most other regular expression implementations global inline flags in the middle of the expression have different semantic: they affect only the part of the expression after the flag. But in Python they affect the whole expression. It caused confusion and was a source of bugs. After 5 releases it is a time to convert this warning into error. In future we can allow global inline flags in the middle of the expression with different semantic. It is safer if one or more intermediate versions will raise an error. ---------- components: Library (Lib), Regular Expressions messages: 415544 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal status: open title: Convert a warning about flags not at the start of the regular expression into error type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:13:36 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 12:13:36 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647692016.28.0.1678234348.issue39394@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4142961b9f5ad3bf93976a6a7162f8049e354018 by Serhiy Storchaka in branch 'main': bpo-39394: Improve warning message in the re module (GH-31988) https://github.com/python/cpython/commit/4142961b9f5ad3bf93976a6a7162f8049e354018 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:13:53 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 12:13:53 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647692033.27.0.864832455956.issue39394@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +30080 pull_request: https://github.com/python/cpython/pull/31989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:13:57 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 12:13:57 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647692037.52.0.978198490433.issue39394@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30081 pull_request: https://github.com/python/cpython/pull/31990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:27:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 19 Mar 2022 12:27:42 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1647692862.1.0.349929193649.issue44544@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset cb7874f49d3d55df73a3c529773af14e2e344fb7 by andrei kulakov in branch 'main': bpo-44544: add textwrap placeholder arg (GH-27671) https://github.com/python/cpython/commit/cb7874f49d3d55df73a3c529773af14e2e344fb7 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:27:44 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 12:27:44 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1647692864.75.0.887747330923.issue44544@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30082 pull_request: https://github.com/python/cpython/pull/31992 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:27:49 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 12:27:49 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1647692869.18.0.0853569428085.issue44544@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30083 pull_request: https://github.com/python/cpython/pull/31993 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:28:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 19 Mar 2022 12:28:14 +0000 Subject: [issue47057] Use FASTCALL convention for FutureIter.throw() In-Reply-To: <1647606117.3.0.361797260817.issue47057@roundup.psfhosted.org> Message-ID: <1647692894.94.0.953686070286.issue47057@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:33:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 12:33:22 +0000 Subject: [issue47066] Convert a warning about flags not at the start of the regular expression into error In-Reply-To: <1647691788.19.0.394073158016.issue47066@roundup.psfhosted.org> Message-ID: <1647693202.41.0.0979106329529.issue47066@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30084 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:48:02 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 12:48:02 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1647694082.73.0.652166778313.issue44544@roundup.psfhosted.org> miss-islington added the comment: New changeset c1f327f30db09388fc777196e233b7a6182c6efa by Miss Islington (bot) in branch '3.10': bpo-44544: add textwrap placeholder arg (GH-27671) https://github.com/python/cpython/commit/c1f327f30db09388fc777196e233b7a6182c6efa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 08:54:15 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 12:54:15 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1647694455.54.0.710810545565.issue44544@roundup.psfhosted.org> miss-islington added the comment: New changeset fcd57996899569ec6b8028bc5b75f973f7074e21 by Miss Islington (bot) in branch '3.9': bpo-44544: add textwrap placeholder arg (GH-27671) https://github.com/python/cpython/commit/fcd57996899569ec6b8028bc5b75f973f7074e21 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 09:19:59 2022 From: report at bugs.python.org (Ma Lin) Date: Sat, 19 Mar 2022 13:19:59 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1647695999.15.0.689465526846.issue44439@roundup.psfhosted.org> Ma Lin added the comment: `_Stream.write` method in tarfile.py also has this code: https://github.com/python/cpython/blob/v3.11.0a6/Lib/tarfile.py#L434 But this bug will not be triggered. When calling this method, always pass bytes data. `_ConnectionBase.send_bytes` method in multiprocessing\connection.py can be micro-optimized: https://github.com/python/cpython/blob/v3.11.0a6/Lib/multiprocessing/connection.py#L193 This can be done in another issue. So I think this issue can be closed. ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:09:53 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 14:09:53 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647698993.42.0.341127628918.issue39394@roundup.psfhosted.org> miss-islington added the comment: New changeset 906f1a4a95e9ca82171a40a28b16533a14fa339c by Miss Islington (bot) in branch '3.10': bpo-39394: Improve warning message in the re module (GH-31988) https://github.com/python/cpython/commit/906f1a4a95e9ca82171a40a28b16533a14fa339c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:10:02 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Mar 2022 14:10:02 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647699002.74.0.762113346856.issue39394@roundup.psfhosted.org> miss-islington added the comment: New changeset cbcd2e36d6cbb1d8b6a2b30a2cf1484b7857e7d6 by Miss Islington (bot) in branch '3.9': bpo-39394: Improve warning message in the re module (GH-31988) https://github.com/python/cpython/commit/cbcd2e36d6cbb1d8b6a2b30a2cf1484b7857e7d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:10:48 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 14:10:48 +0000 Subject: [issue47066] Convert a warning about flags not at the start of the regular expression into error In-Reply-To: <1647691788.19.0.394073158016.issue47066@roundup.psfhosted.org> Message-ID: <1647699048.61.0.445626895753.issue47066@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 92a6abf72e7a8274f96edbb5297119d4ff055be7 by Serhiy Storchaka in branch 'main': bpo-47066: Convert a warning about flags not at the start of the regular expression into error (GH-31994) https://github.com/python/cpython/commit/92a6abf72e7a8274f96edbb5297119d4ff055be7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:11:50 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 14:11:50 +0000 Subject: [issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early In-Reply-To: <1579517044.97.0.328160626256.issue39394@roundup.psfhosted.org> Message-ID: <1647699110.45.0.152193008838.issue39394@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:12:52 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 14:12:52 +0000 Subject: [issue47066] Convert a warning about flags not at the start of the regular expression into error In-Reply-To: <1647691788.19.0.394073158016.issue47066@roundup.psfhosted.org> Message-ID: <1647699172.27.0.794703365358.issue47066@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:32:15 2022 From: report at bugs.python.org (Hans-Christoph Steiner) Date: Sat, 19 Mar 2022 14:32:15 +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: <1647700335.11.0.13551438498.issue37952@roundup.psfhosted.org> Hans-Christoph Steiner added the comment: We're working on the HTTP Transport Auth draft (https://www.ietf.org/archive/id/draft-schinazi-httpbis-transport-auth-05.html) in the IETF that also needs this method. I would really love to see this land, any advice? If it is just a matter of updating the patch for the current Python, I can probably handle that. ---------- nosy: +eighthave _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 10:48:27 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 14:48:27 +0000 Subject: [issue45979] Fix Tkinter tests with old Tk In-Reply-To: <1638617927.57.0.610724634525.issue45979@roundup.psfhosted.org> Message-ID: <1647701307.88.0.523022537208.issue45979@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:01:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 15:01:30 +0000 Subject: [issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module In-Reply-To: <1639499930.14.0.345587742085.issue46073@roundup.psfhosted.org> Message-ID: <1647702090.75.0.98456009416.issue46073@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> AttributeError in ast.unparse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:12:56 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 15:12:56 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647702776.76.0.219233847359.issue40296@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset e207d721fcea01123f0e3edb83b6decdcb5e5e63 by Miss Islington (bot) in branch '3.9': [3.9] bpo-40296: Fix supporting generic aliases in pydoc (GH-30253). (GH-31976) (GH-31981) https://github.com/python/cpython/commit/e207d721fcea01123f0e3edb83b6decdcb5e5e63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:13:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 15:13:37 +0000 Subject: [issue40296] help(list[int]) fails In-Reply-To: <1586983817.03.0.686824683966.issue40296@roundup.psfhosted.org> Message-ID: <1647702817.24.0.584608984834.issue40296@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:14:25 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 15:14:25 +0000 Subject: [issue46996] Drop support of Tcl/Tk older than 8.5.12 In-Reply-To: <1647101018.44.0.57860605779.issue46996@roundup.psfhosted.org> Message-ID: <1647702865.34.0.812291297249.issue46996@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 383a3bec74f0bf0c1b1bef9e0048db389c618452 by Serhiy Storchaka in branch 'main': bpo-46996: IDLE: Drop workarounds for old Tk versions (GH-31962) https://github.com/python/cpython/commit/383a3bec74f0bf0c1b1bef9e0048db389c618452 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:31:34 2022 From: report at bugs.python.org (penguin_wwy) Date: Sat, 19 Mar 2022 15:31:34 +0000 Subject: [issue47067] Add vectorcall for generica alias object Message-ID: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> New submission from penguin_wwy <940375606 at qq.com>: Although `ga_call` determines whether `origin` has a vectorcall, it needs to be unpacked the parameters that are already packed. /-> origin.vectorcall(unpacked) MakeTpCall(packed) -> ga_call -> PyObject_Call \-> origin.tp_call We can advance the `vectorcall` judgment to the `setup` phase. ga_vectorcall -> origin.vectorcall or ga_make_tp_call -> _PyObject_MakeTpCall(packed argument) -> origin.tp_call This will have no effect on tp_call, which still only needs to be packed once, while vectorcall does not need packed/unpacked ---------- components: Library (Lib) messages: 415556 nosy: penguin_wwy priority: normal severity: normal status: open title: Add vectorcall for generica alias object versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:32:44 2022 From: report at bugs.python.org (penguin_wwy) Date: Sat, 19 Mar 2022 15:32:44 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647703964.45.0.234727056061.issue47067@roundup.psfhosted.org> Change by penguin_wwy <940375606 at qq.com>: ---------- keywords: +patch pull_requests: +30085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 11:32:54 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 15:32:54 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647703974.17.0.900680651016.issue47006@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am for consistent behavior. If return GenericAlias(GenericAlias(tuple, Unpack[Ts]), (int, str)) for tuple[*Ts][int, str], we should also return GenericAlias(GenericAlias(list, T), int) for list[T][int], etc. And it will cause multiple problems: * A repr can be less readable. * It will break equality comparison and hashing. Good bye caching. * What about __origin__, __parameters__, __args__? How will they be calculated? * It can break code which uses annotations for something. For example it can break dataclasses. It may be that will need to use it as a fallback for cases like tuple[T, *Ts][*Ts2] (currently it is error). But I am not sure that such cases should be supported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:06:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 16:06:17 +0000 Subject: [issue28584] ICC compiler check is too permissive In-Reply-To: <1478035366.63.0.90573648053.issue28584@psf.upfronthosting.co.za> Message-ID: <1647705977.28.0.239893013265.issue28584@roundup.psfhosted.org> Irit Katriel added the comment: Closed issue44832 as a duplicate of this. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:05:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 16:05:54 +0000 Subject: [issue44832] Compiler detection is not strict enough In-Reply-To: <1628099537.98.0.0593378255107.issue44832@roundup.psfhosted.org> Message-ID: <1647705954.46.0.625257684366.issue44832@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ICC compiler check is too permissive _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:11:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 16:11:10 +0000 Subject: [issue41864] Compiler error in _zoneinfo.c:1227: error: #pragma GCC diagnostic not allowed inside functions In-Reply-To: <1601114691.42.0.0298399391813.issue41864@roundup.psfhosted.org> Message-ID: <1647706270.93.0.890591650406.issue41864@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Compiler warnings in _zoneinfo.c on Windows build in 64-bit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:24:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 16:24:42 +0000 Subject: [issue45214] implement LOAD_NONE opcode Message-ID: <1647707082.56.0.380285349458.issue45214@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> later stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:36:51 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Mar 2022 16:36:51 +0000 Subject: [issue47065] test_curses fails if terminal defaults to bright white text (15) In-Reply-To: <1647688226.18.0.712110754923.issue47065@roundup.psfhosted.org> Message-ID: <1647707811.74.0.110038656446.issue47065@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am surprised. I use Konsole too, and the TERM value and the infocmp output are the same for me. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 12:48:09 2022 From: report at bugs.python.org (AN Long) Date: Sat, 19 Mar 2022 16:48:09 +0000 Subject: [issue43702] [Windows] correctly sort and remove duplicates in _winapi getenvironment() In-Reply-To: <1617336974.49.0.41114511179.issue43702@roundup.psfhosted.org> Message-ID: <1647708489.71.0.636433657124.issue43702@roundup.psfhosted.org> AN Long added the comment: I have a question, how to determine which name should be stored if they are duplicated with case insensitive? ---------- nosy: +asaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 13:01:56 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 17:01:56 +0000 Subject: [issue11160] ZipFile.comment expects bytes In-Reply-To: <1297264140.97.0.306129367766.issue11160@psf.upfronthosting.co.za> Message-ID: <1647709316.18.0.253391293581.issue11160@roundup.psfhosted.org> Irit Katriel added the comment: The documentation has been updated by now [1]: ZipFile.comment The comment associated with the ZIP file as a bytes object. If assigning a comment to a ZipFile instance created with mode 'w', 'x' or 'a', it should be no longer than 65535 bytes. Comments longer than this will be truncated. [1] https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.comment ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 13:19:22 2022 From: report at bugs.python.org (Kaleb Barrett) Date: Sat, 19 Mar 2022 17:19:22 +0000 Subject: [issue47068] Improve __repr__ of TypeVar Message-ID: <1647710362.53.0.530954484666.issue47068@roundup.psfhosted.org> New submission from Kaleb Barrett : Currently the __repr__ for TypeVar includes the variance information and the type name (for example ~T, +T_co, -T_contra), but it does not contain bound or constraint information. I'm not sure what value including variance but not bound information in the __repr__ is, both are important for the use of interfaces that use that variable. I propose we add the bound and constraint information to the __repr__. The __repr__ is arbitrary as popular type checking tools, such as mypy, and documentation tools, such as Sphinx, do not use the standard __repr__. Nor is the __repr__ eval()-able like many builtin types. And for documentation tools that do use the standard __repr__, this improvement will be propagated to those tools. (I originally requested this improvement in pdoc which uses the standard __repr__; the maintainer agreed with this improvement.) Bounds can be represented using an ASCII representation of the subset operator "<=" and then the bound. Constraints can be represented using "<=" with a tuple of the constraints. Perhaps spaces should be added around the "<=" operator? I have no opinion. Some examples of the proposed __repr__: >>> TypeVar("T") ~T >>> IntT = TypeVar("IntT", bound=int) >>> IntT ~IntT<=int >>> TypeVar("AnyStr", str, bytes) ~AnyStr<=(str, bytes) >>> List[IntT] List[~IntT<=int] ---------- messages: 415562 nosy: ktbarrett priority: normal severity: normal status: open title: Improve __repr__ of TypeVar type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 14:03:11 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 19 Mar 2022 18:03:11 +0000 Subject: [issue43702] [Windows] correctly sort and remove duplicates in _winapi getenvironment() In-Reply-To: <1617336974.49.0.41114511179.issue43702@roundup.psfhosted.org> Message-ID: <1647712991.31.0.259916065491.issue43702@roundup.psfhosted.org> Eryk Sun added the comment: > which name should be stored if they are duplicated with case insensitive? Ideally os.environ would preserve the original case of the process environment, and os.environ.copy() would return a copy that's also case insensitive. That would prevent most problems with duplicates keys. See msg387676 in bpo-28824, and msg414319 in bpo-15373. In msg390038 I suggested keeping the first key that's encountered. However, dicts preserve insertion order nowadays, so one could assume that the last one is the one that the caller wants to keep. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 15:44:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 19:44:09 +0000 Subject: [issue26019] collections.abc documentation incomplete In-Reply-To: <1452045912.74.0.509683701942.issue26019@psf.upfronthosting.co.za> Message-ID: <1647719049.43.0.954907403045.issue26019@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted to a GitHub PR and reviewed. ---------- components: +Library (Lib) keywords: +easy nosy: +iritkatriel versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 15:47:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 19:47:30 +0000 Subject: [issue35577] side_effect mocked method lose reference to instance In-Reply-To: <1545664740.73.0.712150888896.issue35577@roundup.psfhosted.org> Message-ID: <1647719250.25.0.400323853083.issue35577@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 15:53:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 19:53:30 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1647719610.44.0.805721315399.issue18217@roundup.psfhosted.org> Irit Katriel added the comment: There were several votes in the discussion for rejecting this deprecation, so I am closing the issue. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:06:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 20:06:01 +0000 Subject: [issue19991] configparser instances cannot be pretty printed In-Reply-To: <1387152835.44.0.30925026143.issue19991@psf.upfronthosting.co.za> Message-ID: <1647720361.14.0.906061213873.issue19991@roundup.psfhosted.org> Irit Katriel added the comment: It's not just that it can't be pretty printed - it doesn't even have __str__ or __repr__. I think the only thing we have now it write, which can do this: >>> config = configparser.ConfigParser() >>> config['DEFAULT'] = {'ServerAliveInterval': '45','Compression': 'yes','CompressionLevel': '9'} >>> f = io.StringIO() >>> config.write(f) >>> f.getvalue() '[DEFAULT]\nserveraliveinterval = 45\ncompression = yes\ncompressionlevel = 9\n\n' >>> pprint.pprint(f.getvalue()) ('[DEFAULT]\n' 'serveraliveinterval = 45\n' 'compression = yes\n' 'compressionlevel = 9\n' '\n') >>> Is this enough, or should something be added? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:08:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 20:08:33 +0000 Subject: [issue42528] Improve the docs of most Py*_Check{,Exact} API calls In-Reply-To: <1606841265.25.0.130640674128.issue42528@roundup.psfhosted.org> Message-ID: <1647720513.31.0.0724443237094.issue42528@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:12:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 20:12:11 +0000 Subject: [issue23647] imaplib.py MAXLINE value is too low for gmail In-Reply-To: <1426174765.08.0.908432771269.issue23647@psf.upfronthosting.co.za> Message-ID: <1647720731.93.0.943266732208.issue23647@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:15:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 20:15:50 +0000 Subject: [issue29906] Add callback parameter to concurrent.futures.Executor.map In-Reply-To: <1490491114.58.0.0924318232997.issue29906@psf.upfronthosting.co.za> Message-ID: <1647720950.95.0.077546620964.issue29906@roundup.psfhosted.org> Irit Katriel added the comment: Since nobody followed up on this for 5 years, I would suggest that (if you are still interested in this) you raise this on python-ideas and ideally also implement and submit a patch. If this is abandoned I will close the issue in a couple of weeks. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:18:03 2022 From: report at bugs.python.org (FeRD (Frank Dana)) Date: Sat, 19 Mar 2022 20:18:03 +0000 Subject: [issue47069] socket._GLOBAL_DEFAULT_TIMEOUT being an object() makes for ugly docstrings, can be better Message-ID: <1647721083.32.0.0857684709094.issue47069@roundup.psfhosted.org> New submission from FeRD (Frank Dana) : socket._GLOBAL_DEFAULT_TIMEOUT's status as a bare object() instance has been brought up before (bpo-12441). That was reported as a bug, but appeared to stem from developer confusion, so it was correctly closed as "not a bug". At the time @orsenthil defended _GLOBAL_DEFAULT_TIMEOUT's current status quo as: > The _GLOBAL_DEFAULT_TIMEOUT usage is an established pattern with socket > module. https://github.com/python/cpython/blob/main/Lib/socket.py#L805 I don't disagree with that, but I think it can be improved upon, which is why I'm opening this as an enhancement instead of a bug report. If nothing else, the current implementation of _GLOBAL_DEFAULT_TIMEOUT makes for some really ugly method synopses, both in socket.py and in other classes that make use of it: >>> import socket, urllib.request >>> help(socket.create_connection) Help on function create_connection in module socket: create_connection(address, timeout=, source_address=None) Connect to *address* and return the socket object. >>> help(urllib.request.urlopen) Help on function urlopen in module urllib.request: urlopen(url, data=None, timeout=, *, cafile=None, capath=None, cadefault=False, context=None) Open the URL url, which can be either a string or a Request object. >>> ...Converting socket._GLOBAL_DEFAULT_TIMEOUT from an object() instance to a bare class definition, in the style of an Exception subclass, appears to be semantically equivalent in all cases, but has the advantage that the resulting docstrings become VASTLY more readable: >>> import myedits; import myedits.socket as socket >>> help(socket.create_connection) Help on function create_connection in module myedits.socket: create_connection(address, timeout=, source_address=None) Connect to *address* and return the socket object. >>> import sys; sys.modules['socket'] = myedits.socket >>> import myedits.urllib.request >>> help(myedits.urllib.request.urlopen) urlopen(url, data=None, timeout=, *, cafile=None, capath=None, cadefault=False, context=None) Open the URL url, which can be either a string or a Request object. >>> Unless someone objects, I'd like to open a PR changing the definition of socket._GLOBAL_DEFAULT_TIMEOUT from: _GLOBAL_DEFAULT_TIMEOUT = object() to: class _GLOBAL_DEFAULT_TIMEOUT: pass While leaving everything else the same. AFAICT from testing, that should have no impact on the functionality of socket or its consumers, but improve life for Python developers by making the module more readable and self-documenting. ---------- components: Library (Lib) messages: 415568 nosy: ferdnyc priority: normal severity: normal status: open title: socket._GLOBAL_DEFAULT_TIMEOUT being an object() makes for ugly docstrings, can be better type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:40:36 2022 From: report at bugs.python.org (Cebtenzzre) Date: Sat, 19 Mar 2022 20:40:36 +0000 Subject: [issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support In-Reply-To: <1581793568.31.0.586113837137.issue39640@roundup.psfhosted.org> Message-ID: <1647722436.31.0.977222226159.issue39640@roundup.psfhosted.org> Change by Cebtenzzre : ---------- nosy: +cebtenzzre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:46:16 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 19 Mar 2022 20:46:16 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647722776.99.0.432211566627.issue47022@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +30086 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/31997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 16:53:15 2022 From: report at bugs.python.org (Christer Weinigel) Date: Sat, 19 Mar 2022 20:53:15 +0000 Subject: [issue37952] Add support for export_keying_material to SSL library In-Reply-To: <1647700335.11.0.13551438498.issue37952@roundup.psfhosted.org> Message-ID: <3dbde53e5ba94569a57fddc006eac9768a725a28.camel@weinigel.se> Christer Weinigel added the comment: Hi, unfortunately the maintainer of the openssl library in Python doesn't want to take my patch. He says that he doesn't want the burden of supporting more functions in the API. I'm a bit frustrated about the whole situation, I've redone my patch over and over again for at least six months just to receive no feedback at all and to finally be told that it was all in vain. If you add a comment to the merge request saying that you also need that functionality it might help to change his mind, but probably not. But it would show that it's not only me that would like to be able to use that function. I have kept my patch up to date up to a few weeks ago so unless something major has happened it ought to apply fairly cleanly to the latest mainline branch of python. https://github.com/wingel/cpython/tree/export_keying_material-master Usually there will be conflict due to an automatically generated checksum at the end of the file _ssl.c.h but to get around that, just skip that part of the patch and rerun "clinic" to regenerate the checksum. Here's what I usually do to build and test my patch: ./configure --prefix=/opt/python-master python3 Tools/clinic/clinic.py -f Modules/_ssl.c Modules/clinic/_ssl.c.h make -j24 make install Regards, Christer On Sat, 2022-03-19 at 14:32 +0000, Hans-Christoph Steiner wrote: > > Hans-Christoph Steiner added the comment: > > We're working on the HTTP Transport Auth draft > (https://www.ietf.org/archive/id/draft-schinazi-httpbis-transport-auth-05.html > ) in the IETF that also needs this method.? I would really love to > see this land, any advice?? If it is just a matter of updating the > patch for the current Python, I can probably handle that. > > ---------- > nosy: +eighthave > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:01:23 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 19 Mar 2022 21:01:23 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647723683.62.0.533767493319.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 82e9b0bb0ac44d4942b9e01b2cdd2ca85c17e563 by Arie Bovenberg in branch 'main': bpo-46382 dataclass(slots=True) now takes inherited slots into account (GH-31980) https://github.com/python/cpython/commit/82e9b0bb0ac44d4942b9e01b2cdd2ca85c17e563 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:01:51 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 19 Mar 2022 21:01:51 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1647723711.3.0.263701323243.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for all of your work, @ariebovenberg! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:03:41 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 19 Mar 2022 21:03:41 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647723821.81.0.716015708075.issue47022@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +30087 pull_request: https://github.com/python/cpython/pull/31998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:27:18 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Sat, 19 Mar 2022 21:27:18 +0000 Subject: [issue47070] Improve performance of array_inplace_repeat Message-ID: <1647725238.0.0.579298604794.issue47070@roundup.psfhosted.org> New submission from Pieter Eendebak : The array_inplace_repeat is inefficient for small arrays and a high number of repeats. This can be improved by using the same approach as in https://bugs.python.org/issue47005 ---------- components: Interpreter Core messages: 415572 nosy: pieter.eendebak priority: normal severity: normal status: open title: Improve performance of array_inplace_repeat type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:36:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 21:36:23 +0000 Subject: [issue32547] csv.DictWriter emits strange errors if fieldnames is an iterator In-Reply-To: <1515890504.43.0.467229070634.issue32547@psf.upfronthosting.co.za> Message-ID: <1647725783.13.0.680408971748.issue32547@roundup.psfhosted.org> Irit Katriel added the comment: Perhaps we could raise an exception with a clearer error message when fieldnames not a sequence? ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:39:44 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 19 Mar 2022 21:39:44 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647725984.41.0.126343023483.issue47061@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- nosy: +hugovk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:42:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 21:42:22 +0000 Subject: [issue47040] Remove invalid versionchanged in doc In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647726142.84.0.604398711307.issue47040@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset b3f2d4c8bab52573605c96c809a1e2162eee9d7e by Ma Lin in branch 'main': bpo-47040: improve document of checksum functions (gh-31955) https://github.com/python/cpython/commit/b3f2d4c8bab52573605c96c809a1e2162eee9d7e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:43:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 21:43:39 +0000 Subject: [issue5888] mmap enhancement - resize with sequence notation In-Reply-To: <1241116451.53.0.52928290171.issue5888@psf.upfronthosting.co.za> Message-ID: <1647726219.79.0.299775565575.issue5888@roundup.psfhosted.org> Irit Katriel added the comment: I am closing this because in the 13 years since it was opened there was only one (negative) response and I don't think this will be picked up now. If you still want to pursue this idea, I would suggest raising it on python-ideas to get more feedback, and then possibly reopening this or creating a new issue. ---------- nosy: +iritkatriel resolution: -> rejected stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:45:56 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 21:45:56 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647726356.35.0.583246450597.issue47040@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- title: Remove invalid versionchanged in doc -> Fix confusing versionchanged note in crc32 and adler32 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 17:47:14 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Sat, 19 Mar 2022 21:47:14 +0000 Subject: [issue47070] Improve performance of array_inplace_repeat In-Reply-To: <1647725238.0.0.579298604794.issue47070@roundup.psfhosted.org> Message-ID: <1647726434.19.0.778672468104.issue47070@roundup.psfhosted.org> Change by Pieter Eendebak : ---------- keywords: +patch pull_requests: +30088 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:09:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 22:09:59 +0000 Subject: [issue27198] Adding an assertClose() method to unittest.TestCase In-Reply-To: <1464979712.74.0.398203716413.issue27198@psf.upfronthosting.co.za> Message-ID: <1647727799.77.0.570842169332.issue27198@roundup.psfhosted.org> Irit Katriel added the comment: To summarize the discussion: There were objections to adding assertClose, but more agreement for adding an option to assertAlomstEqual that does the equivalent. Chris was to come back with an implementation (that was in 2016). Are we still pursuing this or shall we close the issue? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:25:10 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 22:25:10 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647728710.33.0.719738450317.issue38256@roundup.psfhosted.org> Gregory P. Smith added the comment: ``` $ python3.8 Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import binascii, zlib >>> bigdata=memoryview(bytearray((1<<32) + 100)) >>> >>> print(binascii.crc32(bigdata)) 2838121701 >>> crc = binascii.crc32(bigdata[:1000]) >>> crc = binascii.crc32(bigdata[1000:], crc) >>> print(crc) 2838121701 >>> >>> print(zlib.crc32(bigdata)) 2838121701 >>> crc = zlib.crc32(bigdata[:1000]) >>> crc = zlib.crc32(bigdata[1000:], crc) >>> print(crc) 2838121701 ``` ---------- nosy: +gregory.p.smith resolution: -> works for me stage: -> resolved status: open -> closed versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:35:31 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 22:35:31 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647729331.98.0.130749484731.issue38256@roundup.psfhosted.org> Gregory P. Smith added the comment: it depends on the build. USE_ZLIB_CRC32 causes it due to zlib's 32-bitness as noted my marko. $ ./python Python 3.11.0a6+ (heads/main-dirty:b3f2d4c8ba, Mar 19 2022, 15:32:04) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import binascii, zlib >>> bigdata=memoryview(bytearray((1<<32) + 100)) >>> >>> print(binascii.crc32(bigdata)) 2575877834 >>> crc = binascii.crc32(bigdata[:1000]) >>> crc = binascii.crc32(bigdata[1000:], crc) >>> print(crc) 2838121701 >>> >>> print(zlib.crc32(bigdata)) 2838121701 >>> crc = zlib.crc32(bigdata[:1000]) >>> crc = zlib.crc32(bigdata[1000:], crc) >>> print(crc) 2838121701 >>> ---------- resolution: works for me -> stage: resolved -> needs patch status: closed -> open title: binascii.crc32 is not 64-bit clean -> binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:41:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 22:41:58 +0000 Subject: [issue42884] array.index() missing start and end In-Reply-To: <1610308310.47.0.185082010282.issue42884@roundup.psfhosted.org> Message-ID: <1647729718.66.0.42619614842.issue42884@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add start and stop parameters to the array.index() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:42:30 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 19 Mar 2022 22:42:30 +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: <1647729750.05.0.0397778351016.issue37952@roundup.psfhosted.org> Christian Heimes added the comment: Neither venting frustration at my expense nor emotional blackmail is going to increase the likeliness, that I will spend my limited personal time to review a patch for a new feature. Feel free to find another core dev who is willing to land and maintain your patch. ---------- assignee: christian.heimes -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:44:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 19 Mar 2022 22:44:14 +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: <1647729854.95.0.410196780039.issue37952@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:52:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Mar 2022 22:52:33 +0000 Subject: [issue40074] pickle module dump and load: add support for string file names In-Reply-To: <1585221916.12.0.582442173764.issue40074@roundup.psfhosted.org> Message-ID: <1647730353.18.0.676674098741.issue40074@roundup.psfhosted.org> Irit Katriel added the comment: -1. This is basically a request to add API to the stdlib to turn a two-liner into a one-liner. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 18:53:44 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 19 Mar 2022 22:53:44 +0000 Subject: [issue26019] collections.abc documentation incomplete In-Reply-To: <1452045912.74.0.509683701942.issue26019@psf.upfronthosting.co.za> Message-ID: <1647730424.12.0.968961878685.issue26019@roundup.psfhosted.org> Raymond Hettinger added the comment: This was fixed in commit 62fa613f6a6e872723505ee9d56242c31a654a9d ---------- nosy: +rhettinger resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:06:19 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 23:06:19 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647731179.13.0.837478766381.issue38256@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +30089 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:07:12 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 23:07:12 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647731232.07.0.345895577531.issue47040@roundup.psfhosted.org> Gregory P. Smith added the comment: FYI - https://bugs.python.org/issue38256 covers the 32-bit bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:08:03 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 23:08:03 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647731283.52.0.594928476106.issue47040@roundup.psfhosted.org> Gregory P. Smith added the comment: If you want to backport the documentation updates, feel free to make PRs for that. ---------- assignee: docs at python -> gregory.p.smith resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:09:13 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 19 Mar 2022 23:09:13 +0000 Subject: [issue47070] Improve performance of array_inplace_repeat In-Reply-To: <1647725238.0.0.579298604794.issue47070@roundup.psfhosted.org> Message-ID: <1647731353.04.0.20104427037.issue47070@roundup.psfhosted.org> Dennis Sweeney added the comment: I'd bet we could add a couple of utility functions that could be used in multiple places, to keep the "trick" all in one place. Something like void _PyBytes_RepeatInPlace(char **buffer, size_t start_len, size_t end_len) { // Repeatedly double. size_t copied = start_len; while (copied < end_len) { size_t to_copy = Py_MIN(copied, end_len - copied); memcpy(buffer + copied, buffer, to_copy); copied += to_copy; } } void _PyBytes_Repeat(char *dest, size_t len_dest, const char *src, size_t len_src) { // XXX maybe handle zero lengths // XXX maybe use memset for len_src == 1 memcpy(dest, src, len_src); _PyBytes_RepeatInPlace(dest, len_src, len_dest); } ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:32:06 2022 From: report at bugs.python.org (Christer Weinigel) Date: Sat, 19 Mar 2022 23:32:06 +0000 Subject: [issue37952] Add support for export_keying_material to SSL library In-Reply-To: <1647729750.05.0.0397778351016.issue37952@roundup.psfhosted.org> Message-ID: <520457554a784b8dccafe365dba1fb0a8765521a.camel@weinigel.se> Christer Weinigel added the comment: Sorry about the venting, but it is kind of frustrating to spend months working on something with no feedback just to be told that it all was for nothing. But that's how it is. I'll just keep updating my path every now and then since I need it anyway and don't want my application to fall too far behind compared to mainstream Python. My point is mostly that that export_keying_material is starting to be used in more IETF RFCs. The most recent one was accepted just a few weeks ago. I think that is a bit of a shame that Python doesn't have support for that functionality out of the box. If enough people say it's useful for them maybe that would influence your decision. As for the rest of my mail. Since I am trying to keep my patch sort of up date, I might as well point to it and explain how to use it. Hopefully that will reduce your support burden since it will allow those who need that functionality to build a Python interpreter on their own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 19:48:10 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Mar 2022 23:48:10 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647733690.18.0.896831359769.issue38256@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 21:09:10 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 01:09:10 +0000 Subject: [issue27198] Adding an assertClose() method to unittest.TestCase In-Reply-To: <1464979712.74.0.398203716413.issue27198@psf.upfronthosting.co.za> Message-ID: <1647738550.26.0.116376290876.issue27198@roundup.psfhosted.org> Gregory P. Smith added the comment: I agree with the decision, assertAlmostEqual is where the feature belongs. >From a practical point of view I suspect a lot of people who want this in the wider world today use just `assert math.isclose(...)` despite the less useful error message. ---------- nosy: +gregory.p.smith status: pending -> open versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 21:17:54 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 01:17:54 +0000 Subject: [issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support In-Reply-To: <1581793568.31.0.586113837137.issue39640@roundup.psfhosted.org> Message-ID: <1647739074.96.0.830453133859.issue39640@roundup.psfhosted.org> Gregory P. Smith added the comment: The os module provides a pretty low level simple shim over platform APIs. It is better for logic like this to live in a higher level application library rather than make big assumptions on the part of the user. ``` try: os.fdatasync(fd) except Exception as err: logging.debug("fdatasync(fd) failed %s, falling back to fsync(fd)", err) os.fsync(fd) ``` ---------- nosy: +gregory.p.smith resolution: -> rejected stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 22:41:40 2022 From: report at bugs.python.org (=?utf-8?q?Gr=C3=A9gory_Starck?=) Date: Sun, 20 Mar 2022 02:41:40 +0000 Subject: [issue40074] pickle module dump and load: add support for string file names In-Reply-To: <1585221916.12.0.582442173764.issue40074@roundup.psfhosted.org> Message-ID: <1647744100.83.0.845971597199.issue40074@roundup.psfhosted.org> Gr?gory Starck added the comment: FWIW -1 as well, for same reasons. ---------- nosy: +gstarck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 23:45:30 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 03:45:30 +0000 Subject: [issue40074] pickle module dump and load: add support for string file names In-Reply-To: <1585221916.12.0.582442173764.issue40074@roundup.psfhosted.org> Message-ID: <1647747930.88.0.616505302372.issue40074@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 23:48:15 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 03:48:15 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647748095.43.0.347200370762.issue47067@roundup.psfhosted.org> Dong-hee Na added the comment: We decided not to add it see bpo-40369 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 23:51:04 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 03:51:04 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647748264.76.0.751014003247.issue47067@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 23:51:35 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 03:51:35 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647748295.07.0.151984292476.issue47064@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 23:54:46 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 03:54:46 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647748486.88.0.0337506269929.issue47064@roundup.psfhosted.org> Dong-hee Na added the comment: I am +1 on with supporting a way to select QOS attribute but I would like to consider using a more seamless way :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 19 23:57:35 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 03:57:35 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647748655.44.0.981727963316.issue47064@roundup.psfhosted.org> Dong-hee Na added the comment: > but I would like to consider using a more seamless way For example, using a priority policy that actually uses QOS attribute :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 00:39:49 2022 From: report at bugs.python.org (Ma Lin) Date: Sun, 20 Mar 2022 04:39:49 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647751189.22.0.964369026071.issue47040@roundup.psfhosted.org> Change by Ma Lin : ---------- pull_requests: +30090 pull_request: https://github.com/python/cpython/pull/32002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 00:43:37 2022 From: report at bugs.python.org (Ma Lin) Date: Sun, 20 Mar 2022 04:43:37 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647751417.82.0.892428568086.issue47040@roundup.psfhosted.org> Ma Lin added the comment: PR 32002 is for 3.10/3.9 branches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 01:17:52 2022 From: report at bugs.python.org (Inada Naoki) Date: Sun, 20 Mar 2022 05:17:52 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647753472.74.0.0400575246136.issue47000@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +30091 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 01:26:54 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 20 Mar 2022 05:26:54 +0000 Subject: [issue27198] Adding an assertClose() method to unittest.TestCase In-Reply-To: <1464979712.74.0.398203716413.issue27198@psf.upfronthosting.co.za> Message-ID: <1647754014.83.0.989157960228.issue27198@roundup.psfhosted.org> Vedran ?a?i? added the comment: An important point nobody made, as far as I can see: * the main usability improvement justifying math.isclose is that you don't know the order of magnitude of your correct value--it could be anything (even infinite), and the manner of comparison depends on it. That's why it uses a sensible rel_tol out of the box, but no abs_tol--obviously, since it doesn't want to give nonsense results for e.g. values close to zero. * but when you write tests, you always know the exact value you should get, right? In almost all cases the second argument is a numeric literal. So the delta-approach is perfectly ok in that context, since you're in control of how much discrepancy you're going to tolerate, and in the moment that you're deciding on this, you have the exact value expected right in front of you. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 02:57:16 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 06:57:16 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647759436.37.0.34490277252.issue47040@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 6d290d5862375799e997f1192ef56abca4e9182e by Ma Lin in branch '3.10': [3.10] bpo-47040: improve document of checksum functions (GH-31955) (GH-32002) https://github.com/python/cpython/commit/6d290d5862375799e997f1192ef56abca4e9182e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 02:57:35 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 06:57:35 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647759455.79.0.627913072944.issue47040@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +30092 pull_request: https://github.com/python/cpython/pull/32004 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 03:09:09 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 20 Mar 2022 07:09:09 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647760149.33.0.98264489523.issue47061@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 03:21:41 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 07:21:41 +0000 Subject: [issue47040] Fix confusing versionchanged note in crc32 and adler32 In-Reply-To: <1647495308.71.0.557199294207.issue47040@roundup.psfhosted.org> Message-ID: <1647760901.74.0.0304325735251.issue47040@roundup.psfhosted.org> miss-islington added the comment: New changeset 73f4b475d1d70c9ef0db9e6c79771d1a43d43a33 by Miss Islington (bot) in branch '3.9': [3.10] bpo-47040: improve document of checksum functions (GH-31955) (GH-32002) https://github.com/python/cpython/commit/73f4b475d1d70c9ef0db9e6c79771d1a43d43a33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:09:12 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 20 Mar 2022 09:09:12 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647767352.04.0.885977213788.issue47064@roundup.psfhosted.org> Ronald Oussoren added the comment: > For example, using a priority policy that actually uses QOS attribute :) How would that look? The QOS class is already a high level interface that affects a number of low-level polices. The classes are comprehensively documented in sys/qos.h. In short (my rephrasing and summary of the documentation in sys/qos.h): * QOS_CLASS_INTERACTIVE This QOS class indicates that the work on the thread is interactive with the user. * QOS_CLASS_USER_INITIATED This QOS class indicates that work was initiated by the user and the user is likely waiting for the result. * QOS_CLASS_DEFAULT Default QOS class. * QOS_CLASS_UTILITY This QOS class indicates that work may or may not be initiated by the user and the user is unlikely to be waiting for the result. * QOS_CLASS_BACKGROUND This QOS class indicates that the work on this thread was not initiated by the user, and the user is not waiting for a result. Having a python policy object instead of these fixed classes might be more flexible, but tuning those is anything but trivial and exposing such a low-level interface directly to users would likely be too complex for most use cases. I'd be more interested in trying to implement the same interface on other platforms using the low-level APIs for those platforms (but won't do that, all my linux code is running on servers and uses tooling enternal to the application to control resource usage). The biggest problem with these predefined classes is that they are pretty much targeted toward end-user systems and not servers, but that's the target of macOS anyway. BTW. I'm working on a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:15:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 09:15:34 +0000 Subject: [issue32927] Add typeshed documentation for unittest.TestCase._feedErrorsToResult and ._outcome In-Reply-To: <1519424302.16.0.467229070634.issue32927@psf.upfronthosting.co.za> Message-ID: <1647767734.93.0.512805446006.issue32927@roundup.psfhosted.org> Irit Katriel added the comment: I think this should have been opened on the typeshed issue tracker. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:28:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 09:28:10 +0000 Subject: [issue40666] TarFile.add does not support pathlib.Path as a value to first argument. In-Reply-To: <1596214095.23.0.446616713825.issue40666@roundup.psfhosted.org> Message-ID: <1647768490.03.0.649864437055.issue40666@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:50:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 09:50:38 +0000 Subject: [issue46759] sys.excepthook documentation doesn't mention that it isn't called for SystemExit In-Reply-To: <1644927041.52.0.688076844331.issue46759@roundup.psfhosted.org> Message-ID: <1647769838.23.0.551555168949.issue46759@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue25489. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:51:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 09:51:16 +0000 Subject: [issue25489] sys.exit() caught in exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647769876.03.0.353891142709.issue25489@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue46759. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:58:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 09:58:16 +0000 Subject: [issue46013] Confusing period in object.__hash__ doc In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org> Message-ID: <1647770296.9.0.23778765674.issue46013@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 3af68fc77c528d4e7749046cf6e41fd79902e6e6 by jmcb in branch 'main': bpo-46013: Fix confusing kerning on period in docs (GH-29989) https://github.com/python/cpython/commit/3af68fc77c528d4e7749046cf6e41fd79902e6e6 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:58:22 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 09:58:22 +0000 Subject: [issue46013] Confusing period in object.__hash__ doc In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org> Message-ID: <1647770302.02.0.367586191584.issue46013@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +30093 pull_request: https://github.com/python/cpython/pull/32005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 05:58:25 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 09:58:25 +0000 Subject: [issue46013] Confusing period in object.__hash__ doc In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org> Message-ID: <1647770305.55.0.407654328076.issue46013@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30094 pull_request: https://github.com/python/cpython/pull/32006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 06:42:15 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 20 Mar 2022 10:42:15 +0000 Subject: [issue32927] Add typeshed documentation for unittest.TestCase._feedErrorsToResult and ._outcome In-Reply-To: <1519424302.16.0.467229070634.issue32927@psf.upfronthosting.co.za> Message-ID: <1647772935.81.0.460006817604.issue32927@roundup.psfhosted.org> Alex Waygood added the comment: Typeshed maintainer here: I agree. Feel free to open an issue over at https://github.com/python/typeshed if this is still a problem! ---------- nosy: +AlexWaygood resolution: -> third party stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:17:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 12:17:33 +0000 Subject: [issue46013] Confusing period in object.__hash__ doc In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org> Message-ID: <1647778653.88.0.271278076128.issue46013@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 87b3e202d46cdeb0a6b1ef041579a5ebc7c826a9 by Miss Islington (bot) in branch '3.10': bpo-46013: Fix confusing kerning on period in docs (GH-29989) (GH-32005) https://github.com/python/cpython/commit/87b3e202d46cdeb0a6b1ef041579a5ebc7c826a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:18:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 12:18:05 +0000 Subject: [issue46013] Confusing period in object.__hash__ doc In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org> Message-ID: <1647778685.83.0.941393049219.issue46013@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 504973a13336d8a4d20459f68de9647a1fb25966 by Miss Islington (bot) in branch '3.9': bpo-46013: Fix confusing kerning on period in docs (GH-29989) (GH-32006) https://github.com/python/cpython/commit/504973a13336d8a4d20459f68de9647a1fb25966 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 08:18:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 12:18:23 +0000 Subject: [issue46013] Confusing period in object.__hash__ doc In-Reply-To: <1638967048.9.0.598691354052.issue46013@roundup.psfhosted.org> Message-ID: <1647778703.96.0.243721856852.issue46013@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:03:40 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 14:03:40 +0000 Subject: [issue28080] Allow reading member names with bogus encodings in zipfile In-Reply-To: <1473620375.38.0.155906896901.issue28080@psf.upfronthosting.co.za> Message-ID: <1647785020.94.0.699886345781.issue28080@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30095 pull_request: https://github.com/python/cpython/pull/32007 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:18:50 2022 From: report at bugs.python.org (Hans-Christoph Steiner) Date: Sun, 20 Mar 2022 14:18:50 +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: <1647785930.17.0.657491758487.issue37952@roundup.psfhosted.org> Hans-Christoph Steiner added the comment: I understand the frustrations here, but this is really not a place to vent, since that only harms everyone's interests. When a core maintainer voices concerns or questions, they need to be addressed. This goes for any project. I'll see if I can contribute to https://bugs.python.org/issue43902, that would also work for exporting keying material. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:22:14 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 14:22:14 +0000 Subject: [issue28080] Allow reading member names with bogus encodings in zipfile In-Reply-To: <1473620375.38.0.155906896901.issue28080@psf.upfronthosting.co.za> Message-ID: <1647786134.43.0.53464721257.issue28080@roundup.psfhosted.org> Serhiy Storchaka added the comment: I experimented with this a lot. There is a problem with the append mode. We can read in the append mode, therefore we need an encoding. But when we close a ZipFile after appending, non-ASCII file names will be encoded in UTF-8 in the central directory. Next time when we open the archive for reading with different encoding we will get an error because filenames in the central directory and in local headers are different. We need to write non-ASCII files back with the specified encoding to get a self-consistent data. Finally I left this as it was initially. We can return to the problem with the append module later. The differences between PR 32007 and your patches: * The parameter was renamed to metadata_encoding to avoid confusion with existing parameter of ZipFile.open() encoding. In future I am going to use it also for comments. The attribute and the CLI option were renamed correspondingly. * --metadata-encoding can also be used with the -t option. * "surrogateescape" no longer used. If the encoding in not suitable, you will get an error. Use the default and decode filenames manually in such cases. We can change this in future. * Updated documentation. * Tests were significantly rewritten. Now they test the behavior with wrong metadata_encoding, mixed UTF-8 and legacy encodings, and reading after append. I was going to make more changes, but left it for future. ---------- versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:22:54 2022 From: report at bugs.python.org (Hans-Christoph Steiner) Date: Sun, 20 Mar 2022 14:22:54 +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: <1647786174.28.0.857937610968.issue43902@roundup.psfhosted.org> Hans-Christoph Steiner added the comment: This general idea sounds nice to have, I hope it can be included. `ctx._call_with_ctypes("SSL_CTX_set_ciphersuites"...` also sounds totally workable to me, if that has the best security profile. Defense in depth is important, but it is not a reason to prevent key functionality from landing. For example, "export_keying_material" is an RFC and widely implemented (Go crypto/tls, Rustls, Conscrypt, nodejs, boringssl, openssl, BouncyCastle, etc see links here https://github.com/python/cpython/pull/25255#issuecomment-1073256270). It is used in IETF protocols like SRTP and NTS. Perhaps that could be a concrete use case here for thinking about the security profile? ---------- nosy: +eighthave _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:26:23 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 14:26:23 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1647786383.99.0.59014336157.issue42369@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset e730ae7effe4f13b24f1b5fb1fca005709c86acb by Kevin Mehall in branch 'main': bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974) https://github.com/python/cpython/commit/e730ae7effe4f13b24f1b5fb1fca005709c86acb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:26:48 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 14:26:48 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1647786408.96.0.657694704716.issue42369@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +30096 pull_request: https://github.com/python/cpython/pull/32008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:26:52 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 14:26:52 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1647786412.8.0.55911555586.issue42369@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30097 pull_request: https://github.com/python/cpython/pull/32009 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:39:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 20 Mar 2022 14:39:33 +0000 Subject: [issue47015] Update tests from asyncore to asyncio In-Reply-To: <1647290281.28.0.271890781969.issue47015@roundup.psfhosted.org> Message-ID: <1647787173.68.0.111619823854.issue47015@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 3ae975f1ac880c47d51cca6c9e305547bd365be7 by Oleg Iarygin in branch 'main': bpo-47015: Update test_os from asyncore to asyncio (GH-31876) https://github.com/python/cpython/commit/3ae975f1ac880c47d51cca6c9e305547bd365be7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:39:53 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 20 Mar 2022 14:39:53 +0000 Subject: [issue47015] Update tests from asyncore to asyncio In-Reply-To: <1647290281.28.0.271890781969.issue47015@roundup.psfhosted.org> Message-ID: <1647787193.51.0.759343569364.issue47015@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:51:22 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 14:51:22 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1647787882.29.0.365428563957.issue42369@roundup.psfhosted.org> miss-islington added the comment: New changeset 4352ca234e979ad1c7158981addf899b119cd448 by Miss Islington (bot) in branch '3.10': bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974) https://github.com/python/cpython/commit/4352ca234e979ad1c7158981addf899b119cd448 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:54:38 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Mar 2022 14:54:38 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1647788078.6.0.651205602526.issue42369@roundup.psfhosted.org> miss-islington added the comment: New changeset 4aa8b802513340d12a6ffea3d5e2228ac6c7d5b8 by Miss Islington (bot) in branch '3.9': bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974) https://github.com/python/cpython/commit/4aa8b802513340d12a6ffea3d5e2228ac6c7d5b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 10:58:17 2022 From: report at bugs.python.org (Erik Soma) Date: Sun, 20 Mar 2022 14:58:17 +0000 Subject: [issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening Message-ID: <1647788297.71.0.92757207379.issue47071@roundup.psfhosted.org> New submission from Erik Soma : Reproducer attached. Change `USE_PROACTOR` to `False` to use the `SelectorEventLoop` instead, which doesn't exhibit this behavior. The output on my machine when using the proactor loop is: ``` datagram received b'ping 1' datagram received b'ping 2' ``` And the selector loop (which is the behavior I would expect): ``` datagram received b'ping 1' datagram received b'ping 2' datagram received b'ping 3' ``` At a high level, after sending data to an address that isn't listening the asyncio protocol will no longer receive messages. Digging deeper, `_ProactorDatagramTransport._loop_reading` encounters the windows error 1234 (ERROR_PORT_UNREACHABLE) after the "bad send". It appears this a (undocumented/buggy?) behavior of `WSARecvFrom` where the next call to it after an unreachable `WSASendTo` in UDP mode will return the ICMP unreachable message. The actual error is returned from `GetOverlappedResult`. I've hacked together a fix that retries `IocpProactor.recvfrom` if the result is ERROR_PORT_UNREACHABLE. It fixes the issue for the reproducer and my actual use case, but it's probably not ideal. My solution for the moment is just to use the SelectorEventLoop instead. ---------- components: Windows, asyncio files: udpbug2.py messages: 415611 nosy: asvetlov, esoma, paul.moore, steve.dower, tim.golden, yselivanov, zach.ware priority: normal severity: normal status: open title: asyncio proactor udp transport stops responding after send to port that isn't listening versions: Python 3.10 Added file: https://bugs.python.org/file50691/udpbug2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:00:21 2022 From: report at bugs.python.org (Erik Soma) Date: Sun, 20 Mar 2022 15:00:21 +0000 Subject: [issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening In-Reply-To: <1647788297.71.0.92757207379.issue47071@roundup.psfhosted.org> Message-ID: <1647788421.84.0.246504433085.issue47071@roundup.psfhosted.org> Erik Soma added the comment: Uploading my hack to `asyncio.windows_events.py` -- this is based off 3.10.2's distribution. ---------- Added file: https://bugs.python.org/file50692/windows_events.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:04:25 2022 From: report at bugs.python.org (penguin_wwy) Date: Sun, 20 Mar 2022 15:04:25 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647788665.61.0.571474932949.issue47067@roundup.psfhosted.org> penguin_wwy <940375606 at qq.com> added the comment: The point of bpo-40369 issue seems to be to provide vectorcall to the `GenericAliasType`, means vectorcall for `Queue[int]` However, my idea is to add vectorcall to gaobject, like this: ``` d = dict[int] d(a=1, b=2) <-- vectorcall ``` The idea came from my desire to implement different subclasses of a type when implementing some kind of factory model? ``` class ChildClassBuilder: ... def set_type(self, t: Type): self.t = t def build(): instance = self.t() ... return instance ``` In the case of high type-hint coverage, the `self.t` is often a gaobject. Benchmark example? ``` def test(): d = dict[int] for _ in range(1000000): d(a=1, b=2) ``` Speedup 20% in my wsl2 ``` opt: ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.728 1.728 :1() 1 1.728 1.728 1.728 1.728 test.py:4(test) master: ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 2.271 2.271 :1() 1 2.271 2.271 2.271 2.271 test.py:4(test) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:20:04 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 20 Mar 2022 15:20:04 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647789604.78.0.480157185613.issue47067@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +JelleZijlstra, gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:38:09 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 20 Mar 2022 15:38:09 +0000 Subject: [issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening In-Reply-To: <1647788297.71.0.92757207379.issue47071@roundup.psfhosted.org> Message-ID: <1647790689.71.0.0753560178157.issue47071@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks for the report. Could you make a pull request? The whole attached windows_events.py is hard to analyze. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:43:03 2022 From: report at bugs.python.org (penguin_wwy) Date: Sun, 20 Mar 2022 15:43:03 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647790983.83.0.0947134719089.issue47067@roundup.psfhosted.org> penguin_wwy <940375606 at qq.com> added the comment: There is a small problem with the example: ``` d = dict[int] ``` should ``` d = dict[str, int] ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:46:56 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 20 Mar 2022 15:46:56 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647791216.37.0.528504373324.issue47067@roundup.psfhosted.org> Guido van Rossum added the comment: @Dennis, if/when the PR looks good to you, you can merge it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:47:09 2022 From: report at bugs.python.org (AN Long) Date: Sun, 20 Mar 2022 15:47:09 +0000 Subject: [issue42658] os.path.normcase() is inconsistent with Windows file system In-Reply-To: <1608122666.52.0.137113409131.issue42658@roundup.psfhosted.org> Message-ID: <1647791229.9.0.674384912281.issue42658@roundup.psfhosted.org> Change by AN Long : ---------- keywords: +patch nosy: +asaka nosy_count: 7.0 -> 8.0 pull_requests: +30098 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:48:18 2022 From: report at bugs.python.org (Erik Soma) Date: Sun, 20 Mar 2022 15:48:18 +0000 Subject: [issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening In-Reply-To: <1647788297.71.0.92757207379.issue47071@roundup.psfhosted.org> Message-ID: <1647791298.34.0.36154338176.issue47071@roundup.psfhosted.org> Change by Erik Soma : ---------- keywords: +patch pull_requests: +30099 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 11:48:54 2022 From: report at bugs.python.org (Erik Soma) Date: Sun, 20 Mar 2022 15:48:54 +0000 Subject: [issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening In-Reply-To: <1647788297.71.0.92757207379.issue47071@roundup.psfhosted.org> Message-ID: <1647791334.68.0.0765490327936.issue47071@roundup.psfhosted.org> Erik Soma added the comment: Certainly: https://github.com/python/cpython/pull/32011 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:00:10 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 20 Mar 2022 16:00:10 +0000 Subject: [issue25489] sys.exit() caught in exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647792010.35.0.89710987313.issue25489@roundup.psfhosted.org> Guido van Rossum added the comment: Andrew, would you be interested in investigating this? I can't even follow the flow through asyncio that causes the observed behavior (though I seem to have confirmed it). ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:00:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 16:00:32 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1647792032.28.0.0221038352769.issue42369@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:19:27 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 20 Mar 2022 16:19:27 +0000 Subject: [issue25489] sys.exit() caught in exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647793167.59.0.181229623891.issue25489@roundup.psfhosted.org> Andrew Svetlov added the comment: Not sure if the issue is still relevant. asyncio re-raises KeyboardInterrupt explicitly in all loop.call_exception_handler() branches: https://github.com/python/cpython/blob/main/Lib/asyncio/base_events.py#L1759-L1814 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:21:58 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 20 Mar 2022 16:21:58 +0000 Subject: [issue25489] sys.exit() caught in exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647793318.39.0.587342475952.issue25489@roundup.psfhosted.org> Andrew Svetlov added the comment: The change exists since Python 3.8 (October of 2019) The issue discussion belongs to 2015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:36:54 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 20 Mar 2022 16:36:54 +0000 Subject: [issue25489] sys.exit() caught in exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647794214.53.0.499713769626.issue25489@roundup.psfhosted.org> Guido van Rossum added the comment: Nevertheless, the example code still hangs after calling sys.exit(). I can't quite tell where it is hanging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:39:17 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 20 Mar 2022 16:39:17 +0000 Subject: [issue25489] sys.exit() caught in exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647794357.47.0.160774371835.issue25489@roundup.psfhosted.org> Guido van Rossum added the comment: With python built from main I get: /Users/guido/test_sys_exit_in_exception_handler.py:12: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() Got error, exiting Exception ignored in: > Traceback (most recent call last): File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 1749, in call_exception_handler self._exception_handler(self, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/test_sys_exit_in_exception_handler.py", line 6, in handler sys.exit(42) ^^^^^^^^^^^^ SystemExit: 42 This is printed from write_unraisable_exc_file(). Earlier comments in this issue indicate that the exception is being raised from a finalizer (__del__ method). But how? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 12:44:40 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 20 Mar 2022 16:44:40 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647794680.18.0.36613104423.issue47006@roundup.psfhosted.org> Guido van Rossum added the comment: I think I'm with Serhiy, I don't understand the hesitance to transform tuple[*Ts][int, str] into tuple[int, str]. What would be an example of a substitution that's too complex to do? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 13:00:21 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 17:00:21 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> Message-ID: <1647795620.99.0.451301497931.issue46965@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 13:10:42 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 20 Mar 2022 17:10:42 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647796242.61.0.608546051068.issue47064@roundup.psfhosted.org> Dong-hee Na added the comment: > I'd be more interested in trying to implement the same interface on other platforms using the low-level APIs for those platforms Yeah, I am on the same line, I prefer to provide the interface that the user actually doesn't care about implementation detail. But it looks hard to map to priority policy. A similar discussion from the Ruby team: https://bugs.ruby-lang.org/issues/17566 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 13:29:23 2022 From: report at bugs.python.org (Hubert Tournier) Date: Sun, 20 Mar 2022 17:29:23 +0000 Subject: [issue47072] Database corruption with the shelve module Message-ID: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> New submission from Hubert Tournier : After adding a few records, the shelve module corrupts the database keys (the database is still readable if an element key is known, but no more iterable): Traceback (most recent call last): File "./shelve-test.py", line 81, in _verify_whois_cache() File "./shelve-test.py", line 61, in _verify_whois_cache for key in db.keys(): File "/usr/local/lib/python3.8/_collections_abc.py", line 720, in __iter__ yield from self._mapping File "/usr/local/lib/python3.8/shelve.py", line 95, in __iter__ for k in self.dict.keys(): SystemError: Negative size passed to PyBytes_FromStringAndSize I provide a short test program and data that systematically reproduces the bug. I added the a script showing execution messages, the resulting database in DB and text formats. Tested with Python 3.8.12 on FreeBSD 13.0-RELEASE-p8. I suppose Python is using my system package db5-5.3.28_8 (Oracle Berkeley DB, revision 5.3). See also similar issues: https://bugs.python.org/issue33074 https://bugs.python.org/issue30388 ---------- components: Library (Lib) files: shelve-test.zip messages: 415625 nosy: HubTou priority: normal severity: normal status: open title: Database corruption with the shelve module type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50693/shelve-test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 14:28:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 18:28:34 +0000 Subject: [issue37789] Update doc strings for test.bytecode_helper In-Reply-To: <1565205727.21.0.329229994167.issue37789@roundup.psfhosted.org> Message-ID: <1647800914.22.0.87239125136.issue37789@roundup.psfhosted.org> Irit Katriel added the comment: This has been fixed by now. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 14:33:59 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 20 Mar 2022 18:33:59 +0000 Subject: [issue47051] Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harder to read serif font. Message-ID: <1647801239.68.0.634208394265.issue47051@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 14:42:31 2022 From: report at bugs.python.org (Anton Agestam) Date: Sun, 20 Mar 2022 18:42:31 +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: <1647801751.14.0.390616200539.issue43463@roundup.psfhosted.org> Anton Agestam added the comment: As a consumer of `get_type_hints()` I think it'd be valuable to even have partially resolved types. My use case is that I provide an `Annotated` alias with a marker, and all I care about when inspecting user type hints is whether or not the arguments of an `Annotated` type contains my marker object. So ideally the fallback to an unresolved string or a sentinel object such as the proposed `typing.Unresolvable` should happen at the "lowest resolvable level" so that what can be resolved isn't lost. By example, I'm saying that I think that this code: marker = object() def dec(cls): print(get_type_hints(cls)) return cls @dec class A(abc.ABC): forward: Annotated[B, marker] class B: ... Should produce: {"forward": Annotated[Unresolvable["B"], marker]} I guess this would apply in situations where for instance a part of a union isn't resolvable too. If we have a union A|B where A is resolvable and B isn't, it should be resolved to: A | Unresolvable["B"] And not to: Unresolvable["A | B"] (I think for this perspective it's irrelevant whether unresolved types have a sentinel type or are just represented as strings). (Here's the library that's my use case for the curious: https://github.com/antonagestam/abcattrs) ---------- nosy: +antonagestam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:21:43 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 20 Mar 2022 19:21:43 +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: <1647804103.54.0.0940085996262.issue43463@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:28:39 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 19:28:39 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647804519.84.0.829197842959.issue38256@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 9d1c4d69dbc800ac344565119337fcf490cdc800 by Gregory P. Smith in branch 'main': bpo-38256: Fix binascii.crc32() when inputs are 4+GiB (GH-32000) https://github.com/python/cpython/commit/9d1c4d69dbc800ac344565119337fcf490cdc800 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:42:16 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 19:42:16 +0000 Subject: [issue42871] Regex compilation crashed if I change order of alternatives under quantifier In-Reply-To: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org> Message-ID: <1647805336.91.0.424654361481.issue42871@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:48:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 19:48:04 +0000 Subject: [issue34406] Typo in documentation In-Reply-To: <1534259088.23.0.56676864532.issue34406@psf.upfronthosting.co.za> Message-ID: <1647805684.14.0.211902491568.issue34406@roundup.psfhosted.org> Irit Katriel added the comment: This has been fixed by now. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:53:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 19:53:26 +0000 Subject: [issue33028] [doc] tempfile.TemporaryDirectory documentation improvements In-Reply-To: <1520503262.87.0.467229070634.issue33028@psf.upfronthosting.co.za> Message-ID: <1647806006.29.0.588890624999.issue33028@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: tempfile.TemporaryDirectory incorrectly documented -> [doc] tempfile.TemporaryDirectory documentation improvements versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:54:52 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 20 Mar 2022 19:54:52 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647806092.62.0.56191624086.issue47067@roundup.psfhosted.org> Dennis Sweeney added the comment: I profiled dict[str, int](a=1, b=2), and it looks like a decent chunk of time comes from PyUnicode_New as used by PyObject_SetAttrString. You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and adding "__orig_class__" to the global strings with Tools/scripts/generate_global_objects.py, probably for a later PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 15:58:49 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 20 Mar 2022 19:58:49 +0000 Subject: [issue47060] importlib.metadata.version can return None In-Reply-To: <1647627111.5.0.916218060724.issue47060@roundup.psfhosted.org> Message-ID: <1647806329.05.0.623811203088.issue47060@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- assignee: -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:00:26 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 20 Mar 2022 20:00:26 +0000 Subject: [issue46774] Importlib.metadata.version picks first distribution not latest In-Reply-To: <1645062095.18.0.489026763345.issue46774@roundup.psfhosted.org> Message-ID: <1647806426.73.0.499227907546.issue46774@roundup.psfhosted.org> Jason R. Coombs added the comment: Closing without prejudice. Happy to revisit if there's more information on how importlib could/should behave differently. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:17:23 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 20:17:23 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647807443.42.0.56657481203.issue23691@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30100 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:17:52 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Mar 2022 20:17:52 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647807472.85.0.722968513342.issue23691@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:24:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Mar 2022 20:24:29 +0000 Subject: [issue39971] [doc] Error in functional how-to example In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1647807869.76.0.251244498341.issue39971@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: Error in functional how-to example -> [doc] Error in functional how-to example versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:31:12 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 20:31:12 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647808272.79.0.556484661064.issue38256@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +30101 pull_request: https://github.com/python/cpython/pull/32013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:38:09 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 20 Mar 2022 20:38:09 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647808689.94.0.540058150793.issue47022@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 94f038cbb27dc6d1a74ae2bfedea674911f8e8c6 by Hugo van Kemenade in branch '3.10': [3.10] bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 (GH-31891) (#31997) https://github.com/python/cpython/commit/94f038cbb27dc6d1a74ae2bfedea674911f8e8c6 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 16:41:06 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 20:41:06 +0000 Subject: [issue25489] sys.exit() caught in async event loop exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647808865.99.0.0990228299488.issue25489@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- title: sys.exit() caught in exception handler -> sys.exit() caught in async event loop exception handler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:10:53 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 20 Mar 2022 21:10:53 +0000 Subject: [issue35967] Better platform.processor support In-Reply-To: <1549895363.53.0.252912531241.issue35967@roundup.psfhosted.org> Message-ID: <1647810653.43.0.852181751421.issue35967@roundup.psfhosted.org> Jason R. Coombs added the comment: I'm going to close this issue again, as the implementation is now present in at least a couple of releases. May I suggest that if there are ongoing concerns or issues to open up a new issue and reference this one and loop me into the conversation? I'm also happy to re-open this one as well. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:11:51 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 20 Mar 2022 21:11:51 +0000 Subject: [issue46125] Test the preferred API instead of relying on legacy for coverage In-Reply-To: <1639866651.22.0.383271924508.issue46125@roundup.psfhosted.org> Message-ID: <1647810711.3.0.52321608237.issue46125@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 Sun Mar 20 17:16:18 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 21:16:18 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" confuses In-Reply-To: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> Message-ID: <1647810978.41.0.391601325985.issue47054@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch nosy: +gregory.p.smith nosy_count: 4.0 -> 5.0 pull_requests: +30102 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:18:26 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 21:18:26 +0000 Subject: [issue47054] "SyntaxError: non-default argument follows default argument" confuses In-Reply-To: <1647566262.9.0.238891960992.issue47054@roundup.psfhosted.org> Message-ID: <1647811106.12.0.119801807607.issue47054@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:36:01 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 21:36:01 +0000 Subject: [issue47065] test_curses fails if terminal defaults to bright white text (15) In-Reply-To: <1647688226.18.0.712110754923.issue47065@roundup.psfhosted.org> Message-ID: <1647812161.62.0.4477499295.issue47065@roundup.psfhosted.org> Gregory P. Smith added the comment: can we reliably query for what the default is and add that to the expectations? or just skip the test if the defaults don't match our expectations (less ideal)? if those are a challenge to do reliably - adding 15, 0 to the expected set may be the most practical. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:43:36 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 21:43:36 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647812616.31.0.387532827765.issue47064@roundup.psfhosted.org> Gregory P. Smith added the comment: Definitely not an OS specific concept. Big.little configs are all over the place on all OSes and architectures these days. With a variety of ways OSes are experimenting with scheduling for them (nevermind that Android and iOS have been doing this for a decade). from scheduling policies such as users, cgroup membership, container membership, group membership, nice level, to QoS attributes as you mention here... If a given OS has specific APIs we should expose them via the os or _thread modules as appropriate. But unless multiple OSes congeal around common concepts, there isn't much we can do for abstraction. Perhaps a generic way to supply a generic OS specific settings instance to threading.Thread for implementation defined configuration purposes before Thread.start() is called. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:47:05 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 21:47:05 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647812825.28.0.924494837773.issue38256@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 4c989e19c84ec224655bbbde9422e16d4a838a80 by Gregory P. Smith in branch '3.10': [3.10] bpo-38256: Fix binascii.crc32 large input. (GH-32000) (GH-32013) https://github.com/python/cpython/commit/4c989e19c84ec224655bbbde9422e16d4a838a80 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:52:15 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 20 Mar 2022 21:52:15 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647813135.5.0.315689206388.issue38256@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +30103 pull_request: https://github.com/python/cpython/pull/32015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:54:06 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 20 Mar 2022 21:54:06 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647813246.83.0.45510769107.issue47006@roundup.psfhosted.org> Jelle Zijlstra added the comment: It's simple if you only look at simple examples. Here are some examples current main (with Serhiy's patch for the Python version of typing) gets wrong: >>> from typing import * >>> Ts = TypeVarTuple("Ts") >>> T1 = TypeVar("T1") >>> T2 = TypeVar("T2") >>> Tuple[T1, Unpack[Ts], T2][int, Unpack[tuple[int]]] # expect error typing.Tuple[int, *tuple[int]] >>> Tuple[T1, Unpack[Ts], str, T2][int, Unpack[Ts]] # expect error (T2 missing) typing.Tuple[int, str, *Ts] # it put *Ts in the wrong place >>> Tuple[T1, Unpack[Ts], str, T2][int, Unpack[Ts], Unpack[Ts]] # expect error (*Ts can't substitute T2) typing.Tuple[int, *Ts, str, *Ts] >>> class G(Generic[T1, Unpack[Ts], T2]): pass ... >>> G[int] # expect error __main__.G[int] We can probably fix that, but I'm not looking forward to implementing the fixed logic in both Python and C. Also, I'm worried that it won't work with future extensions to the type system (e.g., the rumored Map operator) that may go into 3.12 or later versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 17:57:30 2022 From: report at bugs.python.org (Stanley) Date: Sun, 20 Mar 2022 21:57:30 +0000 Subject: [issue33028] [doc] tempfile.TemporaryDirectory documentation improvements In-Reply-To: <1520503262.87.0.467229070634.issue33028@psf.upfronthosting.co.za> Message-ID: <1647813450.23.0.666325110128.issue33028@roundup.psfhosted.org> Change by Stanley : ---------- keywords: +patch nosy: +slateny nosy_count: 4.0 -> 5.0 pull_requests: +30104 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 18:25:42 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 20 Mar 2022 22:25:42 +0000 Subject: [issue45297] Improve the IDLE shell save command In-Reply-To: <1632702487.28.0.152974990593.issue45297@roundup.psfhosted.org> Message-ID: <1647815142.72.0.573648938609.issue45297@roundup.psfhosted.org> Steven D'Aprano added the comment: Here is another example of a newbie caught by this: https://discuss.python.org/t/syntax-error-in-python-3-10-when-running-on-terminal/14462 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 18:30:52 2022 From: report at bugs.python.org (Stanley) Date: Sun, 20 Mar 2022 22:30:52 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1647815452.81.0.683809219337.issue47031@roundup.psfhosted.org> Stanley added the comment: Vedran's got a good point, as existing documentation for math.nan already says "... Equivalent to the output of float('nan')." so it does seem a bit redundant to say both, though I wonder if we should still be explicit since >>> import math >>> math.nan is math.nan True >>> float('nan') is float('nan') False so they don't have the exact same behavior. Serhiy also has a good point, so maybe instead say that Math.nan/float('nan') is *generally* not equal to any other value? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 18:54:07 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 20 Mar 2022 22:54:07 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1647795621.05.0.759481080428.issue46965@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I will wait until there is a draft PR to review, or until you ping me.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 18:56:45 2022 From: report at bugs.python.org (Yonatan Dankner) Date: Sun, 20 Mar 2022 22:56:45 +0000 Subject: [issue47073] Solution for recursion error when comparing dataclass objects Message-ID: <1647817005.88.0.843741930968.issue47073@roundup.psfhosted.org> New submission from Yonatan Dankner : TL;DR: A possible method to avoid infinite recursion when comparing dataclasses with circular references, using a decorator. >>> @dataclass ... class A: ... x: int = 1 ... self_reference: Any = field(init=False) ... ... def __post_init__(self): ... self.self_reference = self ... >>> A(x=1) == A(x=1) Traceback (most recent call last): File "", line 1, in File "", line 3, in __eq__ File "", line 3, in __eq__ File "", line 3, in __eq__ [Previous line repeated 330 more times] RecursionError: maximum recursion depth exceeded in comparison It should in my opinion return True. To avoid a recursion error, I would like to suggest a solution using a wrapper, similar to the one implemented for repr (see dataclasses._recursive_repr): If within the process of comparing two objects, we have encountered an attempt to compare these objects (meaning we have reached a loop), we should return true, since no inequalities will be discovered if we continue recursing. I suggest an addition to dataclasses.py which would look something like this (drew inspiration from _recursive_repr): def _recursive_eq(user_function): # Decorator to make a eq function return True when a loop was detected. eq_running = set() @functools.wraps(user_function) def wrapper(self, other): key = id(self), id(other), _thread.get_ident() if key in eq_running: return True eq_running.add(key) try: result = user_function(self, other) finally: eq_running.discard(key) return result return wrapper # And then replacing the _cmp_fn with the following. def _cmp_fn(name, op, self_tuple, other_tuple): return _recursive_eq(_create_fn(name, ('self', 'other'), [ 'if other.__class__ is self.__class__:', f' return {self_tuple}{op}{other_tuple}', 'return NotImplemented'])) I would like to hear your thoughts! ---------- components: Library (Lib) messages: 415641 nosy: dankner priority: normal severity: normal status: open title: Solution for recursion error when comparing dataclass objects type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 19:20:36 2022 From: report at bugs.python.org (mobiusklein) Date: Sun, 20 Mar 2022 23:20:36 +0000 Subject: [issue47055] `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8 In-Reply-To: <1647571955.22.0.67382471148.issue47055@roundup.psfhosted.org> Message-ID: <1647818436.29.0.541516267046.issue47055@roundup.psfhosted.org> mobiusklein added the comment: Understood. It's probably good practice to keep the interpreter version up to date in any case when debugging. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 19:42:53 2022 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Sun, 20 Mar 2022 23:42:53 +0000 Subject: [issue35967] Better platform.processor support In-Reply-To: <1549895363.53.0.252912531241.issue35967@roundup.psfhosted.org> Message-ID: <1647819773.73.0.177354861489.issue35967@roundup.psfhosted.org> Change by Chih-Hsuan Yen : ---------- nosy: -yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 19:42:57 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 20 Mar 2022 23:42:57 +0000 Subject: [issue47073] Solution for recursion error when comparing dataclass objects In-Reply-To: <1647817005.88.0.843741930968.issue47073@roundup.psfhosted.org> Message-ID: <1647819777.34.0.552426635085.issue47073@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 19:44:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 20 Mar 2022 23:44:02 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647819842.67.0.238119031952.issue46850@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30105 pull_request: https://github.com/python/cpython/pull/32017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:11:50 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 21 Mar 2022 00:11:50 +0000 Subject: [issue47026] BytesWarning in zipimport paths on sys.path In-Reply-To: <1647350949.19.0.783799424166.issue47026@roundup.psfhosted.org> Message-ID: <1647821510.86.0.0164872299596.issue47026@roundup.psfhosted.org> Andrei Kulakov added the comment: This warning can be fixed by changing the following line: https://github.com/python/cpython/blob/9d1c4d69dbc800ac344565119337fcf490cdc800/Lib/importlib/_bootstrap_external.py#L1419 to: if not path and str(path) == '': and running `make regen-importlib; make` Alternatively the change can be: if not path and isinstance(path, (str,bytes)): I'm not sure which is preferable or if some other fix would be better (I don't know much about importlib). === Adding Brett as the expert -- Brett, can you take a look? Adding a full traceback with -bb argument: Traceback (most recent call last): File "/Users/ak/temp2/zipfile_demo.py", line 29, in sys.exit(main()) ^^^^^^ File "/Users/ak/opensource/cpython4/Lib/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ak/temp2/zipfile_demo.py", line 12, in _tmp_path yield pathlib.Path(tmp_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ak/temp2/zipfile_demo.py", line 24, in main import module ^^^^^^^^^^^^^ File "", line 1178, in _find_and_load File "", line 1140, in _find_and_load_unlocked File "", line 1080, in _find_spec File "", line 1493, in find_spec File "", line 1462, in _get_spec File "", line 1418, in _path_importer_cache BytesWarning: Comparison between bytes and string ---------- nosy: +andrei.avk, brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:15:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 00:15:51 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647821751.86.0.626954966988.issue46850@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 332b04bac35cd7305c60da2d5733940dc089949a by Victor Stinner in branch 'main': bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017) https://github.com/python/cpython/commit/332b04bac35cd7305c60da2d5733940dc089949a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:42:30 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 21 Mar 2022 00:42:30 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1647823350.86.0.187670232238.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: In an attempt to replicate Terry's usage, I added the following patch: ``` diff --git a/Lib/idlelib/idle_test/test_text.py b/Lib/idlelib/idle_test/test_text.py index 0f31179e04..be977bbfff 100644 --- a/Lib/idlelib/idle_test/test_text.py +++ b/Lib/idlelib/idle_test/test_text.py @@ -20,6 +20,10 @@ def test_init(self): self.assertEqual(self.text.get('end'), '') def test_index_empty(self): + """ + Failing test with bad description. + """ + raise ValueError() index = self.text.index for dex in (-1.0, 0.3, '1.-1', '1.0', '1.0 lineend', '1.end', '1.33', ``` When I did, I then ran the tests using the `-m` launcher: ``` $ ./python.exe -m test.test_idle -v -k test_index_empty idlelib.idle_test.test_configdialog (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_debugger (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_editmenu (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_help (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_parenmatch (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_percolator (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_replace (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_scrolledlist (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_search (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' test_index_empty (idlelib.idle_test.test_text.MockTextTest) Failing test with bad description. ... ERROR setUpClass (idlelib.idle_test.test_text.TkTextTest) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_textview (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_tooltip (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_tree (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' idlelib.idle_test.test_undo (unittest.loader.ModuleSkipped) ... skipped 'cannot run without OS X gui process' ====================================================================== ERROR: test_index_empty (idlelib.idle_test.test_text.MockTextTest) Failing test with bad description. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/jaraco/code/public/cpython/Lib/idlelib/idle_test/test_text.py", line 26, in test_index_empty raise ValueError() ^^^^^^^^^^^^^^^^^^ ValueError ---------------------------------------------------------------------- Ran 14 tests in 0.001s FAILED (errors=1, skipped=14) ``` As you can see, the location of the failing test in the log is masked, and instead the description is present. I've pushed https://github.com/python/cpython/tree/bpo-46126/disable-descriptions-unittest-m, which when applied disables the descriptions. This approach works as a surgical intervention, wrapping `unittest.main` in such a way that it could be replaced across the test suite to disable descriptions. By subclassing the TextTestRunner, it continues to honor other parameters from the command-line (such as verbosity). Terry, would you review the concept? Does it meet your needs? If so, I can apply it more broadly and prepare a PR. ---------- assignee: jaraco -> terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 20:42:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 00:42:46 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647823366.63.0.512553237493.issue46850@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30106 pull_request: https://github.com/python/cpython/pull/32018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:08:56 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 21 Mar 2022 01:08:56 +0000 Subject: [issue47073] Solution for recursion error when comparing dataclass objects In-Reply-To: <1647817005.88.0.843741930968.issue47073@roundup.psfhosted.org> Message-ID: <1647824936.49.0.253748683254.issue47073@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:24:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 01:24:18 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647825858.23.0.0976003473915.issue46850@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9087243e2c167e38570e819b228efc3492c38c9c by Victor Stinner in branch 'main': bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018) https://github.com/python/cpython/commit/9087243e2c167e38570e819b228efc3492c38c9c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:27:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 01:27:31 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647826051.54.0.350392383769.issue46850@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30107 pull_request: https://github.com/python/cpython/pull/32019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 21:46:48 2022 From: report at bugs.python.org (Zac Hatfield-Dodds) Date: Mon, 21 Mar 2022 01:46:48 +0000 Subject: [issue47074] Convenient `simplefilter()` in `warnings.catch_warnings()` Message-ID: <1647827208.52.0.288447694179.issue47074@roundup.psfhosted.org> New submission from Zac Hatfield-Dodds : Many pytest users would like a concise way to either suppress warnings, or convert them to errors [1]. The current best approach is: with warnings.catch_warnings(): warnings.simplefilter("ignore") # or "error" but even this becomes tediously verbose when repeated in hundreds of tests (which I suspect is responsible for many misuses of `pytest.raises()`). Since these two functions take disjoint arguments [2], I propose allowing catch_warnings() to accept arguments for simplefilter() and forward them on: with warnings.catch_warnings("ignore"): # or "error" I have a quick implementation at [3] which I can finish if the idea is acceptable. Although I don't have a concrete use-case for more than the 'action' and 'category' arguments, forwarding all rather than some makes the semantics very simple. I'd emphasize again that this is very much a convenience-focussed change: I estimate that 95% of all uses will pass only `action="error"` or `action="ignore"`. Supporting a concise and simple interface for this seems worth the small complication to the design of the warnings module. [1] see e.g. https://github.com/pytest-dev/pytest/issues/9404 for a long thread [2] unlike `filterwarnings()`, which has a `module=` argument which would collide with `catch_warnings()` [3] https://github.com/python/cpython/compare/main...Zac-HD:zac-hd/one-line-catch-warnings ---------- components: Library (Lib) messages: 415647 nosy: Zac Hatfield-Dodds priority: normal severity: normal status: open title: Convenient `simplefilter()` in `warnings.catch_warnings()` type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 22:03:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 02:03:35 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647828215.84.0.174206186359.issue46850@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e63894b3eed8ad2dd7690695f7f07bfbff59c05a by Victor Stinner in branch 'main': bpo-46850: Remove _PyEval_CallTracing() function (GH-32019) https://github.com/python/cpython/commit/e63894b3eed8ad2dd7690695f7f07bfbff59c05a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 22:52:14 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 21 Mar 2022 02:52:14 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1647831134.15.0.791409238541.issue46126@roundup.psfhosted.org> Inada Naoki added the comment: > As you can see, the location of the failing test in the log is masked, and instead the description is present. Could you elaborate? ``` test_index_empty (idlelib.idle_test.test_text.MockTextTest) Failing test with bad description. ... ERROR (snip) ====================================================================== ERROR: test_index_empty (idlelib.idle_test.test_text.MockTextTest) Failing test with bad description. ---------------------------------------------------------------------- ``` I can see `test_index_empty (idlelib.idle_test.test_text.MockTextTest)` in both places. What is masked? ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:01:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:01:30 +0000 Subject: [issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes Message-ID: <1647831690.39.0.167799487436.issue47075@roundup.psfhosted.org> New submission from STINNER Victor : Apply attached manager_timeout.patch and run the command: ./python -m test --fail-env-changed test_multiprocessing_spawn -v -m test_rapid_restart -F -j4 If you fail to reproduce the issue, replace -j4 with -j10 or use a larger number of concurrent jobs. Output: --- (...) 0:00:00 load avg: 2.85 Run tests in parallel using 4 child processes 0:00:06 load avg: 3.02 [ 1/1] test_multiprocessing_spawn failed (env changed) test_rapid_restart (test.test_multiprocessing_spawn.WithManagerTestManagerRestart) ... ok test_rapid_restart (test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok Warning -- Dangling processes: {, } test_rapid_restart (test.test_multiprocessing_spawn.WithThreadsTestManagerRestart) ... ok Warning -- Dangling processes: {, } Warning -- Dangling processes: {, } ---------------------------------------------------------------------- Ran 3 tests in 5.404s OK Kill process group Kill process group Kill process group == Tests result: ENV CHANGED == 1 test altered the execution environment: test_multiprocessing_spawn (...) --- Examples of similar old issues: * bpo-39932 at https://bugs.python.org/issue39932#msg363925 : * bpo-38447: * bpo-38796: * bpo-34150: * bpo-31069 at https://bugs.python.org/issue31069#msg301339 : See also the old fixed bpo-31234 "Make support.threading_cleanup() stricter". ---------- components: Tests files: manager_timeout.patch keywords: patch messages: 415650 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_spawn leaks QueueManager dangling processes versions: Python 3.11 Added file: https://bugs.python.org/file50694/manager_timeout.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:04:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:04:33 +0000 Subject: [issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes In-Reply-To: <1647831690.39.0.167799487436.issue47075@roundup.psfhosted.org> Message-ID: <1647831873.01.0.80729112547.issue47075@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +erlendaasland, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:06:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:06:58 +0000 Subject: [issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes In-Reply-To: <1647831690.39.0.167799487436.issue47075@roundup.psfhosted.org> Message-ID: <1647832018.43.0.290683015457.issue47075@roundup.psfhosted.org> STINNER Victor added the comment: BaseManager._finalize_manager() timeout should be configurable, the test should use the same timeout than support.wait_process() (SHORT_TIMEOUT), and maybe the default timeout should be increased? I propose to use the same timeout for the two process.join(timeout=xxx) calls (before/after terminate). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:10:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:10:08 +0000 Subject: [issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes In-Reply-To: <1647831690.39.0.167799487436.issue47075@roundup.psfhosted.org> Message-ID: <1647832208.52.0.151211530364.issue47075@roundup.psfhosted.org> STINNER Victor added the comment: Recent failures. AMD64 FreeBSD Non-Debug 3.x: https://buildbot.python.org/all/#/builders/172/builds/1654 --- Warning -- Dangling processes: {} Warning -- Dangling processes: {} 1 test altered the execution environment: test_multiprocessing_spawn --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:14:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:14:47 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x Message-ID: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> New submission from STINNER Victor : x86-64 macOS 3.x failures: * https://buildbot.python.org/all/#/builders/366/builds/2085 * https://buildbot.python.org/all/#/builders/366/builds/2078 * https://buildbot.python.org/all/#/builders/366/builds/2077 * https://buildbot.python.org/all/#/builders/366/builds/2073 * https://buildbot.python.org/all/#/builders/366/builds/2072 * https://buildbot.python.org/all/#/builders/366/builds/2069 Logs: --- 0:18:33 load avg: 2.21 Re-running test_asyncio in verbose mode (matching: test_get_cancelled) test_get_cancelled (test.test_asyncio.test_queues.QueueGetTests) ... ERROR ====================================================================== ERROR: test_get_cancelled (test.test_asyncio.test_queues.QueueGetTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/tasks.py", line 490, in wait_for return fut.result() ^^^^^^^^^^^^ File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/queues.py", line 158, in get await getter ^^^^^^^^^^^^ asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/unittest/async_case.py", line 66, in _callTestMethod if self._callMaybeAsync(method) is not None: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/unittest/async_case.py", line 93, in _callMaybeAsync return self._asyncioTestLoop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_asyncio/test_queues.py", line 179, in test_get_cancelled self.assertEqual(1, await get_task) ^^^^^^^^^^^^^^ File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_asyncio/test_queues.py", line 174, in queue_get return await asyncio.wait_for(q.get(), 0.051) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/tasks.py", line 492, in wait_for raise exceptions.TimeoutError() from exc ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TimeoutError --- Recent change related to this test: commit e707ceb6e464b24ddc9fdbdac7bfe15f7eeb43fd Author: Andrew Svetlov Date: Wed Mar 16 16:59:12 2022 +0200 Rewrite asyncio.Queue tests with IsolatedAsyncioTestCace (#31935) ---------- components: Tests, asyncio messages: 415653 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:15:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:15:20 +0000 Subject: [issue47035] Rewrite asyncio queue tests with IsolatedAsyncioTestCase In-Reply-To: <1647440728.46.0.0769834491684.issue47035@roundup.psfhosted.org> Message-ID: <1647832520.88.0.58332006675.issue47035@roundup.psfhosted.org> STINNER Victor added the comment: Please have a look at bpo-47076 "test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:15:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:15:52 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647832552.77.0.322152998401.issue47076@roundup.psfhosted.org> STINNER Victor added the comment: > Recent change related to this test: commit e707ceb6e464b24ddc9fdbdac7bfe15f7eeb43fd This change comes from bpo-47035 "Rewrite asyncio queue tests with IsolatedAsyncioTestCase". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:20:17 2022 From: report at bugs.python.org (penguin_wwy) Date: Mon, 21 Mar 2022 03:20:17 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647832817.45.0.196182197123.issue47067@roundup.psfhosted.org> penguin_wwy <940375606 at qq.com> added the comment: > You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and adding "__orig_class__" to the global strings with Tools/scripts/generate_global_objects.py, probably for a later PR. Already done via `make regen-global-objects` Also, I found that `regen-global-objects` depends on `regen-deepfreeze`, which should be a bug. This causes the `regen-global-objects` to be executed with the compile task first, and it does not compile successfully at this point because of the new symbols(_Py_ID(__orig_class__)) added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:23:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:23:16 +0000 Subject: [issue47077] test_asyncio ignores exception in _ProactorBasePipeTransport.__del__: RuntimeError('Event loop is closed') Message-ID: <1647832996.85.0.556447634064.issue47077@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Windows8.1 Refleaks 3.x: https://buildbot.python.org/all/#/builders/511/builds/274 Logs (reformatted manually): --- 0:52:04 load avg: 4.31 [147/433/1] test_asyncio failed (env changed) (41 min 6 sec) -- running: test_io (3 min 8 sec) beginning 6 repetitions 123456 . Executing cb=[_run_until_complete_cb() at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py:180] created at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\unittest\async_case.py:89> took 0.125 seconds Executing took 0.141 seconds .. Executing took 0.110 seconds D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\inspect.py:3030: ResourceWarning: unclosed arg_val = next(arg_vals) ResourceWarning: Enable tracemalloc to get the object allocation traceback D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\proactor_events.py:115: ResourceWarning: unclosed transport <_ProactorSocketTransport fd=-1 read=<_OverlappedFuture cancelled>> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\proactor_events.py", line 116, in __del__ self.close() ^^^^^^^^^^^^ File "D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\proactor_events.py", line 108, in close self._loop.call_soon(self._call_connection_lost, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py", line 758, in call_soon self._check_closed() ^^^^^^^^^^^^^^^^^^^^ File "D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py", line 519, in _check_closed raise RuntimeError('Event loop is closed') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Event loop is closed . Executing .foo() running at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\test\test_asyncio\test_waitfor.py:133> wait_for= cb=[_release_waiter()() at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\tasks.py:421] created at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\tasks.py:374> took 0.109 seconds . Executing cb=[_run_until_complete_cb() at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py:180] created at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\unittest\async_case.py:89> took 0.125 seconds Executing wait_for= cb=[_run_until_complete_cb() at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py:180] created at D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\unittest\async_case.py:89> took 0.141 seconds . --- ---------- components: Tests, asyncio messages: 415657 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio ignores exception in _ProactorBasePipeTransport.__del__: RuntimeError('Event loop is closed') versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:44:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:44:55 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9 Message-ID: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> New submission from STINNER Victor : aarch64 Fedora Rawhide 3.9: https://buildbot.python.org/all/#/builders/245/builds/445 It seems like the "ldconfig" command crashed (signal 11: SIGSEGV). ldconfig is used by _findSoname_ldconfig() of ctypes.util which runs the "/sbin/ldconfig -p" command with LC_ALL=C and LANG=C env vars. It looks like a Fedora issue rather than a Python bug. journalctl: --- mars 19 20:08:06 python-builder-fedora-rawhide-aarch64 systemd[1]: ldconfig.service - Rebuild Dynamic Linker Cache was skipped because all trigger condition checks failed. (...) mars 19 15:50:06 python-builder-fedora-rawhide-aarch64 audit[1587976]: ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 pid=1587976 comm="ldconfig" exe="/usr/sbin/ldconfig" sig=11 res=1 (...) mars 19 15:50:06 python-builder-fedora-rawhide-aarch64 audit[1587976]: ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 pid=1587976 comm="ldconfig" exe="/usr/sbin/ldconfig" sig=11 res=1 (...) mars 19 01:02:52 python-builder-fedora-rawhide-aarch64 audit[512983]: ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 pid=512983 comm="ldconfig" exe="/usr/sbin/ldconfig" sig=11 res=1 (...) mars 18 19:33:00 python-builder-fedora-rawhide-aarch64 systemd[1]: ldconfig.service - Rebuild Dynamic Linker Cache was skipped because all trigger condition checks failed. --- configure: --- checking for --with-system-ffi... yes --- test.pythoninfo: --- CC.version: gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0) --- Logs: --- 0:00:18 load avg: 12.24 [241/425/1] test_ctypes failed (env changed) Warning -- files was modified by test_ctypes test_anon (ctypes.test.test_anon.AnonTest) ... ok (...) test_variant_bool (ctypes.test.test_wintypes.WinTypesTest) ... ok ---------------------------------------------------------------------- Ran 494 tests in 1.350s OK (skipped=88) Before: [] After: ['.1587976'] 1 test altered the execution environment: test_ctypes --- ---------- components: Tests messages: 415658 nosy: vstinner priority: normal severity: normal status: open title: test_ctypes modified files on aarch64 Fedora Rawhide 3.9 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:45:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:45:04 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9 In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647834304.79.0.327013569594.issue47078@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:45:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:45:35 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647834335.62.0.738105597757.issue47078@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_ctypes modified files on aarch64 Fedora Rawhide 3.9 -> test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:46:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:46:36 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647834396.61.0.540153666273.issue47078@roundup.psfhosted.org> STINNER Victor added the comment: # rpm -qf /sbin/ldconfig glibc-2.35.9000-11.fc37.aarch64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:48:09 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 21 Mar 2022 03:48:09 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int Message-ID: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> New submission from Sergey B Kirpichev : As the __int__() method is required, I believe it can return self(1) instead. Also, probably +self normalization could be avoided in the Integral.numerator(). ---------- components: Library (Lib) messages: 415660 nosy: Sergey.Kirpichev priority: normal severity: normal status: open title: Integral.denominator shouldn't return an int type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 20 23:51:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 03:51:38 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647834698.13.0.398255671805.issue47078@roundup.psfhosted.org> STINNER Victor added the comment: /var/log/dnf.log: 2022-03-18T19:32:05+0100 DEBUG Upgraded: glibc-2.35.9000-11.fc37.aarch64 ... 2022-03-20T06:55:49+0100 DDEBUG Cleaning up. 2022-03-20T06:55:49+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35-2.fc37.aarch64.rpm removed 2022-03-20T06:55:49+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-7.fc37.aarch64.rpm removed 2022-03-20T06:55:49+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-10.fc37.aarch64.rpm removed 2022-03-20T06:55:50+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-11.fc37.aarch64.rpm removed 2022-03-20T06:55:50+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-6.fc37.aarch64.rpm removed 2022-03-20T06:55:50+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-5.fc37.aarch64.rpm removed 2022-03-20T06:55:50+0100 DDEBUG /var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-9.fc37.aarch64.rpm removed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 00:03:21 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 21 Mar 2022 04:03:21 +0000 Subject: [issue47080] Use atomic groups to simplify fnmatch Message-ID: <1647835401.09.0.198463274654.issue47080@roundup.psfhosted.org> New submission from Tim Peters : I added some excruciatingly obscure technical tricks to ensure that fnmatch.py's regexps can't fall into exponential-time match failures. It's hard to stop re from useless backtracking. But the new "atomic groups" make that easy instead in some cases, and make it trivial in the cases fnmatch needs. Of course addressing this has to wait for the atomic groups PR to get merged GH-31982) ---------- assignee: tim.peters components: Library (Lib) messages: 415662 nosy: tim.peters priority: normal severity: normal stage: needs patch status: open title: Use atomic groups to simplify fnmatch type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 00:27:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 04:27:40 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647836860.54.0.0811257000095.issue47078@roundup.psfhosted.org> STINNER Victor added the comment: Fedora glibc issue: https://bugzilla.redhat.com/show_bug.cgi?id=2066147 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 00:28:49 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 21 Mar 2022 04:28:49 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1647836929.31.0.400795913765.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > self(1) instead or, rather, type(self)(1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 00:49:39 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 21 Mar 2022 04:49:39 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1647838179.48.0.276173114424.issue46712@roundup.psfhosted.org> Dennis Sweeney added the comment: In bpo-47067, there was concern about the addition of the makefile target from PR 31637: regen-global-objects: regen-deepfreeze After a new `&_Py_ID(__orig_class__)` is added to Objects/genericaliasobject.c, running `make regen-global-objects` starts gcc -pthread -c [snipped] -DPy_BUILD_CORE -o Objects/genericaliasobject.o Objects/genericaliasobject.c which fails with a compilation error because that identifier is not yet defined. Is there a good way to convince `make` to regenerate the global objects without this sort of circular dependency? Am I missing a step? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 00:59:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 04:59:21 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647838761.79.0.670828803454.issue47078@roundup.psfhosted.org> STINNER Victor added the comment: Oh, the kernel was also upgraded. /var/log/dnf.log: --- 2022-03-18T19:32:05+0100 DEBUG Installed: kernel-5.17.0-0.rc8.123.fc37.aarch64 --- == Build 440 (old, ok) == https://buildbot.python.org/all/#/builders/245/builds/440 os.uname: posix.uname_result(sysname='Linux', nodename='python-builder-fedora-rawhide-aarch64', release='5.17.0-0.rc0.20220112gitdaadb3bd0e8d.63.fc36.aarch64', version='#1 SMP Wed Jan 12 18:56:05 UTC 2022', machine='aarch64') == Build 445 (new, bug) == https://buildbot.python.org/all/#/builders/245/builds/445 os.uname: posix.uname_result(sysname='Linux', nodename='python-builder-fedora-rawhide-aarch64', release='5.17.0-0.rc8.123.fc37.aarch64', version='#1 SMP Mon Mar 14 17:54:40 UTC 2022', machine='aarch64') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 01:21:53 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 05:21:53 +0000 Subject: [issue47080] Use atomic groups to simplify fnmatch In-Reply-To: <1647835401.09.0.198463274654.issue47080@roundup.psfhosted.org> Message-ID: <1647840113.62.0.67769516221.issue47080@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 02:16:29 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 21 Mar 2022 06:16:29 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647843389.07.0.893714599385.issue47076@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch nosy: +kumaraditya303 nosy_count: 3.0 -> 4.0 pull_requests: +30108 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 02:34:49 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 21 Mar 2022 06:34:49 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647844489.45.0.272060150664.issue38256@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 58a7e130375776b192a99b013bc563205a639edc by Gregory P. Smith in branch '3.9': bpo-38256: Fix binascii.crc32 large input. (GH-32000) (GH-32013) (GH-32015) https://github.com/python/cpython/commit/58a7e130375776b192a99b013bc563205a639edc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 02:35:29 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 06:35:29 +0000 Subject: [issue42885] Optimize re.search() for \A (and maybe ^) In-Reply-To: <1610315901.41.0.467379667553.issue42885@roundup.psfhosted.org> Message-ID: <1647844529.0.0.30594793872.issue42885@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30109 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 02:37:04 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 21 Mar 2022 06:37:04 +0000 Subject: [issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32 In-Reply-To: <1569224901.03.0.176047397678.issue38256@roundup.psfhosted.org> Message-ID: <1647844624.34.0.722532304439.issue38256@roundup.psfhosted.org> Gregory P. Smith added the comment: 3.8 and older are in security fix only mode. 3.9+ have been fixed. realistically this was a rare issue with multiple workarounds. The 3.9 and 3.10 fixes were strictly bugfix only. The 3.11 fix included some performance improvements. ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:01:16 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 21 Mar 2022 07:01:16 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1647846076.39.0.156569908852.issue47079@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- keywords: +patch pull_requests: +30110 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:02:30 2022 From: report at bugs.python.org (Shin-Myoung-Serp) Date: Mon, 21 Mar 2022 07:02:30 +0000 Subject: [issue47056] turtle.write() causes flickering when the tracer is turned off. In-Reply-To: <1647595653.53.0.61025954383.issue47056@roundup.psfhosted.org> Message-ID: <1647846150.15.0.225004387754.issue47056@roundup.psfhosted.org> Shin-Myoung-Serp added the comment: I tested on Ubuntu 20.04 with the following Python versions. 3.8.2(repository version) 3.11.0a5(compiled from the official tarball) Both cases cause flickering. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:04:26 2022 From: report at bugs.python.org (Ayaan Khan) Date: Mon, 21 Mar 2022 07:04:26 +0000 Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org> Message-ID: <1647846266.47.0.944202875028.issue41210@roundup.psfhosted.org> Ayaan Khan added the comment: Here is a BCJ only CFFI test project. https://www.avoid.uk.net/fmwhatsapp/ https://www.avoid.uk.net/yowhatsapp/ https://www.avoid.uk.net/fouad-whatsapp/ All works are very interesting. thanks, to post and your works. ---------- nosy: +blogavoid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:09:09 2022 From: report at bugs.python.org (neonene) Date: Mon, 21 Mar 2022 07:09:09 +0000 Subject: [issue43166] Unused letters in Windows-specific pragma optimize In-Reply-To: <1612813717.65.0.159919254593.issue43166@roundup.psfhosted.org> Message-ID: <1647846549.2.0.875014059153.issue43166@roundup.psfhosted.org> Change by neonene : ---------- nosy: +neonene nosy_count: 7.0 -> 8.0 pull_requests: +30111 pull_request: https://github.com/python/cpython/pull/32023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 03:09:09 2022 From: report at bugs.python.org (neonene) Date: Mon, 21 Mar 2022 07:09:09 +0000 Subject: [issue43271] AMD64 Windows10 3.x crash with Windows fatal exception: stack overflow In-Reply-To: <1613766414.64.0.363657915419.issue43271@roundup.psfhosted.org> Message-ID: <1647846549.34.0.163328601076.issue43271@roundup.psfhosted.org> Change by neonene : ---------- nosy: +neonene, pablogsal nosy_count: 8.0 -> 10.0 pull_requests: +30112 pull_request: https://github.com/python/cpython/pull/32023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 04:24:07 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 21 Mar 2022 08:24:07 +0000 Subject: [issue47064] thread QOS attribute on macOS In-Reply-To: <1647683846.62.0.6728584749.issue47064@roundup.psfhosted.org> Message-ID: <1647851047.59.0.445781745.issue47064@roundup.psfhosted.org> Ronald Oussoren added the comment: I agree. I'm working on a PR to expose this platform specific functionality in the threading module. It would have been nice if other platforms had similar functionality, but they don't. Emulating the API is possible, but a project in its own right and something that will result in a lot of discussion. IMHO this is something we shouldn't do within the CPython project. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:25:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 10:25:32 +0000 Subject: [issue32754] feature request: asyncio.gather/wait cancel children on first exception In-Reply-To: <1517614142.6.0.467229070634.issue32754@psf.upfronthosting.co.za> Message-ID: <1647858332.91.0.0957453515047.issue32754@roundup.psfhosted.org> Irit Katriel added the comment: Task groups are implemented under Issue46752. ---------- nosy: +iritkatriel resolution: -> duplicate status: open -> pending superseder: -> Introduce task groups to asyncio and change task cancellation semantics _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:33:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 10:33:27 +0000 Subject: [issue34071] asyncio: repr(task) raises AssertionError for coros which loop.create_task accepts; complications ensue In-Reply-To: <1531092771.84.0.56676864532.issue34071@psf.upfronthosting.co.za> Message-ID: <1647858807.09.0.438381626486.issue34071@roundup.psfhosted.org> Irit Katriel added the comment: This is a TypeError now, so there shouldn't be issues with unit tests anymore: >>> task = asyncio.get_event_loop().create_task(ag()) Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython/Lib/asyncio/base_events.py", line 436, in create_task task = tasks.Task(coro, loop=self, name=name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: a coroutine was expected, got ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:34:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 10:34:15 +0000 Subject: [issue34071] asyncio: repr(task) raises AssertionError for coros which loop.create_task accepts; complications ensue In-Reply-To: <1531092771.84.0.56676864532.issue34071@psf.upfronthosting.co.za> Message-ID: <1647858855.17.0.040904363163.issue34071@roundup.psfhosted.org> Irit Katriel added the comment: I'm closing this as out of date, please create a new issue if you are seeing an issue on current versions of python (>= 3.10). ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:51:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 10:51:26 +0000 Subject: [issue41275] [doc] Clarify that Futures can be awaited multiple times In-Reply-To: <1594435318.81.0.780838422603.issue41275@roundup.psfhosted.org> Message-ID: <1647859886.63.0.781532600298.issue41275@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: Clarify whether Futures can be awaited multiple times -> [doc] Clarify that Futures can be awaited multiple times versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 06:58:13 2022 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 21 Mar 2022 10:58:13 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1647860293.42.0.903009233162.issue44800@roundup.psfhosted.org> Change by Nick Coghlan : ---------- pull_requests: +30113 pull_request: https://github.com/python/cpython/pull/32024 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:00:46 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 11:00:46 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647860446.94.0.202915353602.issue23691@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 08eb754d840696914928355014c2d424131f8835 by Serhiy Storchaka in branch 'main': bpo-23691: Protect the re.finditer() iterator from re-entering (GH-32012) https://github.com/python/cpython/commit/08eb754d840696914928355014c2d424131f8835 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:01:09 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Mar 2022 11:01:09 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647860469.14.0.896029696237.issue23691@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +30114 pull_request: https://github.com/python/cpython/pull/32025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:01:14 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Mar 2022 11:01:14 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647860474.38.0.980119592834.issue23691@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30115 pull_request: https://github.com/python/cpython/pull/32026 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:11:47 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Mar 2022 11:11:47 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1647861107.62.0.213911016171.issue46841@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 2bde6827ea4f136297b2d882480b981ff26262b6 by Brandt Bucher in branch 'main': bpo-46841: Quicken code in-place (GH-31888) https://github.com/python/cpython/commit/2bde6827ea4f136297b2d882480b981ff26262b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:23:18 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 21 Mar 2022 11:23:18 +0000 Subject: [issue34071] asyncio: repr(task) raises AssertionError for coros which loop.create_task accepts; complications ensue In-Reply-To: <1531092771.84.0.56676864532.issue34071@psf.upfronthosting.co.za> Message-ID: <1647861798.83.0.964312466647.issue34071@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:28:49 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Mar 2022 11:28:49 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647862129.29.0.0994153713778.issue23691@roundup.psfhosted.org> miss-islington added the comment: New changeset f89949ec6741bd02841bece61f5b703e738dd13c by Miss Islington (bot) in branch '3.9': bpo-23691: Protect the re.finditer() iterator from re-entering (GH-32012) https://github.com/python/cpython/commit/f89949ec6741bd02841bece61f5b703e738dd13c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:31:07 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Mar 2022 11:31:07 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647862267.74.0.435455221683.issue23691@roundup.psfhosted.org> miss-islington added the comment: New changeset 1b21b55ee0ea57226c52dc9f3ee3c034a5d1dc7b by Miss Islington (bot) in branch '3.10': bpo-23691: Protect the re.finditer() iterator from re-entering (GH-32012) https://github.com/python/cpython/commit/1b21b55ee0ea57226c52dc9f3ee3c034a5d1dc7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:36:07 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 21 Mar 2022 11:36:07 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647862567.24.0.187063924317.issue47076@roundup.psfhosted.org> Andrew Svetlov added the comment: Again a relative short timeouts and super slow test boxes. I?'ll relax numbers. Thanks forbthe report! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:39:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 11:39:31 +0000 Subject: [issue34680] [doc] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1647862771.98.0.857940729855.issue34680@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: asyncio event_loop fails when accessed from multiple threads -> [doc] asyncio event_loop fails when accessed from multiple threads _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:45:31 2022 From: report at bugs.python.org (Dmitry Shachnev) Date: Mon, 21 Mar 2022 11:45:31 +0000 Subject: [issue44445] Add `site-include` install scheme path in sysconfig In-Reply-To: <1623942208.43.0.621445516609.issue44445@roundup.psfhosted.org> Message-ID: <1647863131.51.0.436907542783.issue44445@roundup.psfhosted.org> Change by Dmitry Shachnev : ---------- nosy: +mitya57 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 07:57:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 11:57:19 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647863839.0.0.731705867161.issue12029@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +30116 pull_request: https://github.com/python/cpython/pull/32027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 08:10:03 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 12:10:03 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647864603.76.0.116445260428.issue47078@roundup.psfhosted.org> STINNER Victor added the comment: I still reproduce the issue after an upgrade to the Linux kernel: 5.17.0-0.rc8.20220318git551acdc3c3d2.125.fc37.aarch64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 08:49:20 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 12:49:20 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1647866960.85.0.0426835883608.issue23691@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 Mar 21 08:57:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Mar 2022 12:57:42 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647867462.8.0.171738208459.issue47076@roundup.psfhosted.org> STINNER Victor added the comment: > Again a relative short timeouts and super slow test boxes. The problem is more that a sleep is not a reliable synchronization primitive: https://pythondev.readthedocs.io/unstable_tests.html#don-t-use-sleep-as-synchronization ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:36:32 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 21 Mar 2022 14:36:32 +0000 Subject: [issue47063] SimpleHTTPRequestHandler has hard coded index page list. In-Reply-To: <1647663914.0.0.21035920987.issue47063@roundup.psfhosted.org> Message-ID: <1647873392.95.0.19909970585.issue47063@roundup.psfhosted.org> Ethan Furman added the comment: `index.htm[l]` is pretty standard for the name of the index page. What's your use-case for wanting different names? Keep in mind that the word `Simple` is in the name for a reason. ---------- nosy: +ethan.furman versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 10:46:56 2022 From: report at bugs.python.org (Zachary Ware) Date: Mon, 21 Mar 2022 14:46:56 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1647874016.23.0.351125619447.issue47062@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 11:47:12 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 21 Mar 2022 15:47:12 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647877632.84.0.763818399839.issue46864@roundup.psfhosted.org> Christian Heimes added the comment: I'm getting tons of deprecation warnings from deepfreeze script. Please add _Py_COMP_DIAG_IGNORE_DEPR_DECL to Tools/scripts/deepfreeze.py. ---------- nosy: +christian.heimes resolution: fixed -> stage: resolved -> needs patch status: closed -> open type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:28:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 16:28:37 +0000 Subject: [issue433030] SRE: Atomic Grouping (?>...) is not supported Message-ID: <1647880117.84.0.861631002749.issue433030@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 345b390ed69f36681dbc41187bc8f49cd9135b54 by Serhiy Storchaka in branch 'main': bpo-433030: Add support of atomic grouping in regular expressions (GH-31982) https://github.com/python/cpython/commit/345b390ed69f36681dbc41187bc8f49cd9135b54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:39:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 16:39:01 +0000 Subject: [issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation Message-ID: <1647880741.05.0.407746154875.issue47081@roundup.psfhosted.org> New submission from Serhiy Storchaka : In the Web you can find that two terms are used for repetition operators (+, *, ?, and variants): "quantifiers" and "qualifiers". "Quantifiers" is much more common, it is used in Wikipedia and main on-line documentation resources. But "qualifiers" is consistently used in the re module code documentation. It looks to me that "qualifiers" is just a reproduced typo. I propose to replace it with "quantifiers". ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 415686 nosy: docs at python, ezio.melotti, mrabarnett, serhiy.storchaka, tim.peters priority: normal severity: normal status: open title: Replace "qualifiers" with "quantifiers" in the re module documentation type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 12:52:52 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 16:52:52 +0000 Subject: [issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation In-Reply-To: <1647880741.05.0.407746154875.issue47081@roundup.psfhosted.org> Message-ID: <1647881572.35.0.299132030579.issue47081@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30117 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:02:50 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 17:02:50 +0000 Subject: [issue47037] Build problems on Windows In-Reply-To: <1647455403.28.0.516957856389.issue47037@roundup.psfhosted.org> Message-ID: <1647882170.84.0.375210993384.issue47037@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 Mar 21 13:03:05 2022 From: report at bugs.python.org (Jens Henrik Goebbert) Date: Mon, 21 Mar 2022 17:03:05 +0000 Subject: [issue47082] No protection: `import numpy` in two different threads can lead to race-condition Message-ID: <1647882185.36.0.953866126148.issue47082@roundup.psfhosted.org> New submission from Jens Henrik Goebbert : While using [Xpra](https://github.com/Xpra-org/xpra) we came across a bug which might be a Python or a NumPy issue. Perhaps some of you can help us understanding some internals. Calling `import numpy` at the same time in two different threads of the Python program can lead to a race-condition. This happens for example with Xpra when loading the encoder nvjpeg: ``` 2022-03-20 12:54:59,298 cannot load enc_nvjpeg (nvjpeg encoder) Traceback (most recent call last): File "/lib/python3.9/site-packages/xpra/codecs/loader.py", line 52, in codec_import_check ic = __import__(class_module, {}, {}, classnames) File "xpra/codecs/nvjpeg/encoder.pyx", line 8, in init xpra.codecs.nvjpeg.encoder File "/lib/python3.9/site-packages/numpy/__init__.py", line 150, in from . import core File "/lib/python3.9/site-packages/numpy/core/__init__.py", line 51, in del os.environ[envkey] File "/lib/python3.9/os.py", line 695, in __delitem__ raise KeyError(key) from None KeyError: 'OPENBLAS_MAIN_FREE' ``` Here the environment variable OPENBLAS_MAIN_FREE is set in the `numpy` code: https://github.com/numpy/numpy/blob/maintenance/1.21.x/numpy/core/__init__.py#L18 and short after that it is deleted https://github.com/numpy/numpy/blob/maintenance/1.21.x/numpy/core/__init__.py#L51 But this deletion fails ... perhaps because the initialization runs at the same time in two threads :thinking: Shouldn't Python protect us by design? @seberg comments [HERE](https://github.com/numpy/numpy/issues/21223#issuecomment-1074008386): ``` So, my current hypothesis (and I have briefly checked the Python code) is that Python does not do manual locking. But it effectively locks due to this going into C and thus holding the GIL. But somewhere during the import of NumPy, NumPy probably releases the GIL briefly and that could allow the next thread to go into the import machinery. [..] NumPy may be doing some worse than typical stuff here, but right now it seems to me that Python should be protecting us. ``` Can anyone comment on this? ---------- components: Interpreter Core messages: 415687 nosy: jhgoebbert priority: normal severity: normal status: open title: No protection: `import numpy` in two different threads can lead to race-condition type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:04:47 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 17:04:47 +0000 Subject: [issue47051] Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harder to read serif font. Message-ID: <1647882287.04.0.0197194167693.issue47051@roundup.psfhosted.org> New submission from Steve Dower : I guess for 3.11 we should just switch to loose HTML files and using the default browser, rather than fighting with dead CHM tools. No idea what may have caused this. Has anyone tried analysing the file for unsupported JavaScript or something? I think that's what caused it last time. Maybe Sphinx got an update and is using unsupported CSS? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:09:40 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 21 Mar 2022 17:09:40 +0000 Subject: [issue47083] The __complex__ method is missing from the complex, float, and int built-in types Message-ID: <1647882580.13.0.610930198027.issue47083@roundup.psfhosted.org> New submission from G?ry : ## Expected outcome ``` >>> hasattr(complex(), '__complex__') True >>> hasattr(float(), '__complex__') True >>> hasattr(int(), '__complex__') True ``` ## Actual outcome ``` >>> hasattr(complex(), '__complex__') False >>> hasattr(float(), '__complex__') False >>> hasattr(int(), '__complex__') False ``` ## Rationale The `numbers.Complex` abstract base class has a `__complex__` abstract method and the `numbers.Real` and `numbers.Integral` abstract base classes inherit from `numbers.Complex` (https://github.com/python/cpython/blob/v3.10.3/Lib/numbers.py#L45-L47): ``` @abstractmethod def __complex__(self): """Return a builtin complex instance. Called for complex(self).""" ``` The `complex` built-in type is a virtual subclass (nominal subtype) of `numbers.Complex` (https://github.com/python/cpython/blob/v3.10.3/Lib/numbers.py#L144): ``` Complex.register(complex) ``` The `float` built-in type is a virtual subclass (nominal subtype) of `numbers.Real` (https://github.com/python/cpython/blob/v3.10.3/Lib/numbers.py#L264): ``` Real.register(float) ``` The `int` built-in type is a virtual subclass (nominal subtype) of `numbers.Integral` (https://github.com/python/cpython/blob/v3.10.3/Lib/numbers.py#L393): ``` Integral.register(int) ``` `__complex__` is the only method of the abstract base classes of `numbers` missing from `complex`, `float`, and `int`: ``` >>> import numbers >>> for attr in dir(numbers.Complex): ... if not hasattr(complex(), attr): print(attr) ... __abstractmethods__ __complex__ __module__ __slots__ _abc_impl >>> for attr in dir(numbers.Real): ... if not hasattr(float(), attr): print(attr) ... __abstractmethods__ __complex__ __module__ __slots__ _abc_impl >>> for attr in dir(numbers.Integral): ... if not hasattr(int(), attr): print(attr) ... __abstractmethods__ __complex__ __module__ __slots__ _abc_impl ``` ---------- components: Interpreter Core messages: 415689 nosy: maggyero priority: normal severity: normal status: open title: The __complex__ method is missing from the complex, float, and int built-in types type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:22:15 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 21 Mar 2022 17:22:15 +0000 Subject: [issue47080] Use atomic groups to simplify fnmatch In-Reply-To: <1647835401.09.0.198463274654.issue47080@roundup.psfhosted.org> Message-ID: <1647883335.68.0.783591679209.issue47080@roundup.psfhosted.org> Change by Tim Peters : ---------- keywords: +patch pull_requests: +30118 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:28:44 2022 From: report at bugs.python.org (Sebastian Berg) Date: Mon, 21 Mar 2022 17:28:44 +0000 Subject: [issue47082] No protection: `import numpy` in two different threads can lead to race-condition In-Reply-To: <1647882185.36.0.953866126148.issue47082@roundup.psfhosted.org> Message-ID: <1647883724.61.0.954763204287.issue47082@roundup.psfhosted.org> Sebastian Berg added the comment: To add to this: it would seem to me that the side-effects of importing should be guaranteed to only be called once? However, IO or other operations could be part of the import side-effects and release the GIL. So even a simple, pure-Python, package could run into this same issue and probably won't even realize that they can run into it. (Assuming I understand how this is happening correctly.) So it would seem to me that either: * Python should lock on the thread level or maybe the `sys.modules` dictionary? * The `threading` module could somehow ensure safety by hooking into the import machinery? * Packages that may release the GIL or have side-effects that must only be run once have to lock (i.e. NumPy). (But it seems to me that many packages will not even be aware of possible issues.) ---------- nosy: +seberg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:28:46 2022 From: report at bugs.python.org (Matthew Barnett) Date: Mon, 21 Mar 2022 17:28:46 +0000 Subject: [issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation In-Reply-To: <1647880741.05.0.407746154875.issue47081@roundup.psfhosted.org> Message-ID: <1647883726.85.0.75830439587.issue47081@roundup.psfhosted.org> Matthew Barnett added the comment: I don't think it's a typo, and you could argue the case for "qualifiers", but I still agree with the proposal as it's a more meaningful term in the context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:47:47 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 17:47:47 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647884867.56.0.296292617536.issue43224@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30119 pull_request: https://github.com/python/cpython/pull/32030 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:49:52 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 21 Mar 2022 17:49:52 +0000 Subject: [issue47080] Use atomic groups to simplify fnmatch In-Reply-To: <1647835401.09.0.198463274654.issue47080@roundup.psfhosted.org> Message-ID: <1647884992.86.0.295342875786.issue47080@roundup.psfhosted.org> Tim Peters added the comment: New changeset 5c3201e146b251017cd77202015f47912ddcb980 by Tim Peters in branch 'main': bpo-47080: Use atomic groups to simplify fnmatch (GH-32029) https://github.com/python/cpython/commit/5c3201e146b251017cd77202015f47912ddcb980 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 13:50:22 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 21 Mar 2022 17:50:22 +0000 Subject: [issue47080] Use atomic groups to simplify fnmatch In-Reply-To: <1647835401.09.0.198463274654.issue47080@roundup.psfhosted.org> Message-ID: <1647885022.72.0.338962014307.issue47080@roundup.psfhosted.org> Change by Tim Peters : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:08:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 18:08:32 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1647886112.31.0.0171267614786.issue43224@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +30120 pull_request: https://github.com/python/cpython/pull/32031 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:11:34 2022 From: report at bugs.python.org (Sophist) Date: Mon, 21 Mar 2022 18:11:34 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1647886294.25.0.947631184983.issue7946@roundup.psfhosted.org> Sophist added the comment: Please see also https://github.com/faster-cpython/ideas/discussions/328 for a proposal for a simple (much simpler than BFS) GIL scheduler only allocating the GIL between runable O/S threads waiting to have ownership of the GIL, and using the O/S scheduler for scheduling the threads. ---------- nosy: +Sophist _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:17:54 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Mar 2022 18:17:54 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647886674.51.0.128664224742.issue47006@roundup.psfhosted.org> Serhiy Storchaka added the comment: The first case will be practically fixed by GH 32030 after chenging the grammar to allow unpacking in index tuple: A[*B]. Two other cases will be fixed by GH 32031. It does not require any C code. In the last case no error is raised because some error checks are skipped if any of Generic arguments is a TypeVarTuple. We just need to add such checks. This is Python-only code too. Note that the alternative proposition is even more lenient to errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:32:06 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Mar 2022 18:32:06 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1647887526.69.0.614093655268.issue7946@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:37:52 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:37:52 +0000 Subject: [issue47084] Statically allocated Unicode objects leak cached representations Message-ID: <1647887872.48.0.319313487677.issue47084@roundup.psfhosted.org> New submission from Jeremy Kloth : The newly implemented statically allocated Unicode objects do not clear their cached representations (wstr and utf-8) at exit causing leaked blocks at exit (see also issue46857). At issue are the Unicode objects created by deepfreeze and the 1-character strings (ordinals < 256). ---------- components: Interpreter Core, Unicode messages: 415695 nosy: ezio.melotti, jkloth, vstinner priority: normal severity: normal status: open title: Statically allocated Unicode objects leak cached representations versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:44:02 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:44:02 +0000 Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org> Message-ID: <1647888242.16.0.35688585544.issue46084@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- keywords: +patch nosy: +jkloth nosy_count: 7.0 -> 8.0 pull_requests: +30121 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:45:11 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:45:11 +0000 Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org> Message-ID: <1647888311.02.0.213697963454.issue46084@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- pull_requests: -30121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:45:41 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:45:41 +0000 Subject: [issue47084] Statically allocated Unicode objects leak cached representations In-Reply-To: <1647887872.48.0.319313487677.issue47084@roundup.psfhosted.org> Message-ID: <1647888341.47.0.559597263834.issue47084@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- keywords: +patch pull_requests: +30122 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:45:41 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:45:41 +0000 Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org> Message-ID: <1647888341.56.0.760829561776.issue46084@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- pull_requests: +30123 pull_request: https://github.com/python/cpython/pull/32032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:46:36 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:46:36 +0000 Subject: [issue46084] Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not In-Reply-To: <1639580070.17.0.621007734089.issue46084@roundup.psfhosted.org> Message-ID: <1647888396.11.0.550190561532.issue46084@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- pull_requests: -30123 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 14:59:24 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 18:59:24 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647889164.31.0.437197247907.issue46788@roundup.psfhosted.org> Jeremy Kloth added the comment: OK, I know it has been a busy month for Python, but this issue is really hampering my bug fixing efforts. It makes the complete regrtest useless for me. I am required to run each affected test directly so it is possible to miss side-effects of changes made. The original PR is now 9 months old. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 15:07:16 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 21 Mar 2022 19:07:16 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) In-Reply-To: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> Message-ID: <1647889636.74.0.457473931817.issue46315@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30124 pull_request: https://github.com/python/cpython/pull/32033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 15:21:07 2022 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 21 Mar 2022 19:21:07 +0000 Subject: [issue47085] missing frame.f_lineno on JUMP_ABSOLUTE Message-ID: <1647890467.59.0.144255905293.issue47085@roundup.psfhosted.org> New submission from Thomas Grainger : the following code prints: import sys import dis import pprint def demo(): for i in range(1): if i >= 0: pass class Tracer: def __init__(self): self.events = [] def trace(self, frame, event, arg): self.events.append((frame.f_lineno, frame.f_lasti, event)) frame.f_trace_lines = True frame.f_trace_opcodes = True return self.trace def main(): t = Tracer() old_trace = sys.gettrace() try: sys.settrace(t.trace) demo() finally: sys.settrace(old_trace) dis.dis(demo) pprint.pp(t.events) if __name__ == "__main__": sys.exit(main()) 7 0 LOAD_GLOBAL 0 (range) 2 LOAD_CONST 1 (1) 4 CALL_FUNCTION 1 6 GET_ITER >> 8 FOR_ITER 7 (to 24) 10 STORE_FAST 0 (i) 8 12 LOAD_FAST 0 (i) 14 LOAD_CONST 2 (0) 16 COMPARE_OP 5 (>=) 18 POP_JUMP_IF_FALSE 11 (to 22) 9 20 NOP >> 22 JUMP_ABSOLUTE 4 (to 8) 7 >> 24 LOAD_CONST 0 (None) 26 RETURN_VALUE [(6, -1, 'call'), (7, 0, 'line'), (7, 0, 'opcode'), (7, 2, 'opcode'), (7, 4, 'opcode'), (7, 6, 'opcode'), (7, 8, 'opcode'), (7, 10, 'opcode'), (8, 12, 'line'), (8, 12, 'opcode'), (8, 14, 'opcode'), (8, 16, 'opcode'), (8, 18, 'opcode'), (9, 20, 'line'), (9, 20, 'opcode'), (None, 22, 'opcode'), (7, 8, 'line'), (7, 8, 'opcode'), (7, 24, 'opcode'), (7, 26, 'opcode'), (7, 26, 'return')] but I'd expect (9, 22, 'opcode') instead of (None, 22, 'opcode'), ---------- messages: 415697 nosy: graingert priority: normal severity: normal status: open title: missing frame.f_lineno on JUMP_ABSOLUTE versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 15:39:30 2022 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 21 Mar 2022 19:39:30 +0000 Subject: [issue47085] missing frame.f_lineno on JUMP_ABSOLUTE In-Reply-To: <1647890467.59.0.144255905293.issue47085@roundup.psfhosted.org> Message-ID: <1647891570.18.0.375446016071.issue47085@roundup.psfhosted.org> Change by Ned Batchelder : ---------- nosy: +Mark.Shannon, nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:26:39 2022 From: report at bugs.python.org (Omer Katz) Date: Mon, 21 Mar 2022 20:26:39 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1647887526.75.0.0516420221245.issue7946@roundup.psfhosted.org> Message-ID: Omer Katz added the comment: I think that we should focus our efforts on removing the GIL, now that we have a feasible solution for doing so without breaking anything (hopefully) however the removal of the GIL is still far from being complete and will need to be rebased upon the latest Python version to be merged. This issue would probably hurt Celery since some users use it with a thread pool and it uses a few threads itself but it seems like fixing it is too much effort so if we were to invest a lot of effort, I'd focus on removing the problem entirely. Instead, I suggest we document this with a warning in the relevant place so that people would know to avoid or workaround the problem entirely. On Mon, Mar 21, 2022, 20:32 Guido van Rossum wrote: > > Change by Guido van Rossum : > > > ---------- > nosy: +gvanrossum > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:33:25 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 21 Mar 2022 20:33:25 +0000 Subject: [issue47067] Add vectorcall for generica alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647894805.03.0.36190508744.issue47067@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset 1ea055bd53ccf976e88018983a3c13447c4502be by penguin_wwy in branch 'main': bpo-47067: Optimize calling GenericAlias objects (GH-31996) https://github.com/python/cpython/commit/1ea055bd53ccf976e88018983a3c13447c4502be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:37:17 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 21 Mar 2022 20:37:17 +0000 Subject: [issue45336] xml.etree.ElementTree.write does not support `standalone` option In-Reply-To: <1633031921.76.0.241035024911.issue45336@roundup.psfhosted.org> Message-ID: <1647895037.92.0.20949631314.issue45336@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +eli.bendersky, scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:38:56 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 20:38:56 +0000 Subject: [issue32592] Drop support of Windows Vista and Windows 7 In-Reply-To: <1516268238.05.0.467229070634.issue32592@psf.upfronthosting.co.za> Message-ID: <1647895136.88.0.281033913214.issue32592@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 Mar 21 16:41:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 20:41:44 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647895304.55.0.811148148058.issue12029@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 45833b50f0ccf2abb01304c900afee05b6d01b9e by Irit Katriel in branch 'main': bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type (GH-32027) https://github.com/python/cpython/commit/45833b50f0ccf2abb01304c900afee05b6d01b9e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:44:27 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 20:44:27 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM Message-ID: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> New submission from Steve Dower : CHM is getting too hard to handle (see e.g. issue47051 for the latest issue), so let's just bite the bullet and ship the HTML docs instead. ---------- components: Windows messages: 415701 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Include HTML docs with Windows installer instead of CHM type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:51:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 20:51:45 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647895905.68.0.793425670135.issue12029@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +30125 pull_request: https://github.com/python/cpython/pull/32034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:52:50 2022 From: report at bugs.python.org (Jim DeLaHunt) Date: Mon, 21 Mar 2022 20:52:50 +0000 Subject: [issue34071] asyncio: repr(task) raises AssertionError for coros which loop.create_task accepts; complications ensue In-Reply-To: <1531092771.84.0.56676864532.issue34071@psf.upfronthosting.co.za> Message-ID: <1647895970.38.0.537057850252.issue34071@roundup.psfhosted.org> Jim DeLaHunt added the comment: As the original reporter, I have no objection to closing this old report. It remains in the historical record. That was its purpose all along. Thank you to all the bug data maintainers! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 16:55:03 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 21 Mar 2022 20:55:03 +0000 Subject: [issue47027] subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter In-Reply-To: <1647356154.7.0.125333178117.issue47027@roundup.psfhosted.org> Message-ID: <1647896103.54.0.565644611036.issue47027@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:03:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 21:03:17 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647896597.09.0.369796445819.issue12029@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +30126 pull_request: https://github.com/python/cpython/pull/32035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:08:59 2022 From: report at bugs.python.org (Sophist) Date: Mon, 21 Mar 2022 21:08:59 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1647896939.53.0.170330314998.issue7946@roundup.psfhosted.org> Sophist added the comment: > I think that we should focus our efforts on removing the GIL, now that we have a feasible solution for doing so without breaking anything Is this really a thing? Something that is definitely happening in a reasonable timescale? Or are there some big compatibility issues likely to rear up and at best create delays, and at worse derail it completely? Can someone give me some links about this please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:15:20 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Mar 2022 21:15:20 +0000 Subject: [issue47067] Add vectorcall for generic alias object In-Reply-To: <1647703894.62.0.128061572822.issue47067@roundup.psfhosted.org> Message-ID: <1647897320.01.0.934815518942.issue47067@roundup.psfhosted.org> Change by Guido van Rossum : ---------- title: Add vectorcall for generica alias object -> Add vectorcall for generic alias object _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:18:31 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 21 Mar 2022 21:18:31 +0000 Subject: [issue47087] Implement PEP 655 (Required/NotRequired) Message-ID: <1647897511.2.0.22546468537.issue47087@roundup.psfhosted.org> New submission from Jelle Zijlstra : PEP 655 was just accepted, so we should implement it in typing.py! We should be able to largely reuse the typing-extensions implementation. (I can't find David Foster on BPO but I'll point him to this issue.) ---------- messages: 415704 nosy: AlexWaygood, JelleZijlstra, gvanrossum, kj priority: normal severity: normal status: open title: Implement PEP 655 (Required/NotRequired) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:22:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 21:22:53 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647897773.42.0.0191582508088.issue12029@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 7fc12540e3e873d8ff49711e70fd691185f977b9 by Irit Katriel in branch '3.10': bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type (GH-32027) (GH-32034) https://github.com/python/cpython/commit/7fc12540e3e873d8ff49711e70fd691185f977b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:24:35 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 21 Mar 2022 21:24:35 +0000 Subject: [issue47088] Implement PEP 675 (LiteralString) Message-ID: <1647897875.4.0.562368830483.issue47088@roundup.psfhosted.org> New submission from Jelle Zijlstra : This one should be quite simple at runtime. I'll send a PR this week. ---------- assignee: JelleZijlstra messages: 415706 nosy: AlexWaygood, JelleZijlstra, gvanrossum, kj priority: normal severity: normal stage: needs patch status: open title: Implement PEP 675 (LiteralString) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:24:59 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 21 Mar 2022 21:24:59 +0000 Subject: [issue47087] Implement PEP 655 (Required/NotRequired) In-Reply-To: <1647897511.2.0.22546468537.issue47087@roundup.psfhosted.org> Message-ID: <1647897899.7.0.143224165691.issue47087@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- components: +Library (Lib) stage: -> needs patch type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:25:08 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 21 Mar 2022 21:25:08 +0000 Subject: [issue47088] Implement PEP 675 (LiteralString) In-Reply-To: <1647897875.4.0.562368830483.issue47088@roundup.psfhosted.org> Message-ID: <1647897908.37.0.943406144463.issue47088@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:28:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 21:28:15 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647898095.76.0.815175913005.issue12029@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:28:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 21:28:16 +0000 Subject: [issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1647898096.63.0.152733758665.issue12029@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 2d5e9f8d6296cc52da9823bb57e7f03d60b34d27 by Irit Katriel in branch '3.9': bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type (GH-32027) (GH-32035) https://github.com/python/cpython/commit/2d5e9f8d6296cc52da9823bb57e7f03d60b34d27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:29:28 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Mar 2022 21:29:28 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1647898168.85.0.157931576948.issue7946@roundup.psfhosted.org> Guido van Rossum added the comment: Start here: https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsDFosB5e6BfnXLlejd9l0/edit AFAICT the SC hasn't made up their minds about this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:33:13 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 21 Mar 2022 21:33:13 +0000 Subject: [issue19961] MacOSX: Tkinter build failure when building without command-line tools In-Reply-To: <1386850286.1.0.287048995559.issue19961@psf.upfronthosting.co.za> Message-ID: <1647898393.2.0.203720071388.issue19961@roundup.psfhosted.org> Ned Deily added the comment: I think we can close this without further action as we no longer support using the Apple-supplied system Tcl and Tk and we know it is possible to build and link current version of Python 3.x with Tcl/Tk 8.6.8, at least, on macOS 10.9. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:33:50 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Mon, 21 Mar 2022 21:33:50 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647898430.65.0.999738298919.issue47006@roundup.psfhosted.org> Matthew Rahtz added the comment: [Guido] > What would be an example of a substitution that's too complex to do? We also need to remember the dreaded arbitrary-length tuple. For example, I think it should be the case that: ```python T = TypeVar('T') Ts = TypeVarTuple('Ts') class C(Generic[*Ts]): pass Alias = C[T, *Ts] Alias2 = Alias[*tuple[int, ...]] # Alias2 should be C[int, *tuple[int, ...]] ``` Ok, this is a bit of a silly example, but if we're committing to evaluating substitutions correctly, we should probably make even this kind of example behave correctly so that users who accidentally do something silly can debug what's gone wrong. [Serhiy] > A repr can be less readable. Definitely true. > It will break equality comparison and hashing. Good bye caching. Huh, I didn't know about this one. Fair enough, this is totally a downside. > What about __origin__, __parameters__, __args__? How will they be calculated? This could admittedly be thorny. We'd have to think it through carefully. Admittedly also a downside. > It can break code which uses annotations for something. For example it can break dataclasses. Oh, also interesting - I didn't know about this one either. Could you give an example? > The first case will be practically fixed by GH 32030 after chenging the grammar to allow unpacking in index tuple: A[*B]. We actually deliberately chose not to unpack concrete tuple types - see the description of https://github.com/python/cpython/pull/30398, under the heading 'Starred tuple types'. (If you see another way around it, though, let me know.) > Two other cases will be fixed by GH 32031. It does not require any C code. I'm also not sure about this one; disallowing unpacked TypeVarTuples in argument lists to generic aliases completely (if I've understood right?) seems like too restrictive a solution. I can imagine there might be completely legitimate cases where the ability to do this would be important. For example: ```python DType = TypeVar('DType') Shape = TypeVarTuple('Shape') class Tensor(Generic[DType, *Shape]): ... Uint8Tensor = Tensor[uint8, *Shape] Unit8BatchTensor = Uint8Tensor[Batch, *Shape] ``` > Note that the alternative proposition is even more lenient to errors. True, but at least it's predictably lenient to errors - I think the repr makes it very clear that "Woah, you're doing something advanced here. You're on your own!" I think it better fits the principle of least astonishment to have something that consistently lets through all errors of a certain class than something that sometimes catches errors and sometimes doesn't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:34:06 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 21:34:06 +0000 Subject: [issue47089] Avoid sporadic failure of test_compileall on Windows Message-ID: <1647898446.37.0.407539254542.issue47089@roundup.psfhosted.org> New submission from Jeremy Kloth : Testing on Windows occasionally has issues in test_compileall when running with multiple processes. This is due to other test files importing stdlib modules at the same time that compileall is doing its own testing. While not fatal (test_compileall succeeds on re-run), the transient warnings obfuscate the test results for other "real" warnings (e.g., compiler warnings) without digging into each run separately. This can be avoided by using the PYTHONPYCACHEPREFIX functionality to compile the stdlib modules locally. ---------- components: Tests messages: 415711 nosy: jkloth priority: normal severity: normal status: open title: Avoid sporadic failure of test_compileall on Windows versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:35:34 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Mon, 21 Mar 2022 21:35:34 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647898534.46.0.711328229314.issue47006@roundup.psfhosted.org> Matthew Rahtz added the comment: P.s. To be clear, (I think?) these are all substitutions that are computable. We *could* implement the logic to make all these evaluate correctly if we wanted to. It's just a matter of how much complexity we want to allow in typing.py (or in the runtime in general, if we say farmed some of this logic out to a separate module). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:36:22 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 21:36:22 +0000 Subject: [issue47089] Avoid sporadic failure of test_compileall on Windows In-Reply-To: <1647898446.37.0.407539254542.issue47089@roundup.psfhosted.org> Message-ID: <1647898582.9.0.316414464752.issue47089@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- keywords: +patch pull_requests: +30127 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:42:04 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 21:42:04 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647898924.82.0.513153909062.issue46788@roundup.psfhosted.org> Steve Dower added the comment: You're closer to this stuff than I am, so if you say it works for your scenarios and it doesn't break the existing ones, I'll merge it. Do we need to backport to 3.8 at this point? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 17:53:20 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 21:53:20 +0000 Subject: [issue26052] pydoc for __init__ with not docstring In-Reply-To: <1452295807.98.0.613500169742.issue26052@psf.upfronthosting.co.za> Message-ID: <1647899600.01.0.456561541507.issue26052@roundup.psfhosted.org> Irit Katriel added the comment: Is the "See help(type(self)) for accurate signature." part of object.__init__ docstring useful? May we can just remove it? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:05:04 2022 From: report at bugs.python.org (Sophist) Date: Mon, 21 Mar 2022 22:05:04 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1647900304.98.0.15384736016.issue7946@roundup.psfhosted.org> Sophist added the comment: > https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsDFosB5e6BfnXLlejd9l0/edit 1. The steering committee hasn't given the go ahead for this yet, and we have no idea when such a decision will be made nor whether the decision with be yes or no. 2. Even after the decision is made "Removing the GIL will be a large, multi-year undertaking with increased risk for introducing bugs and regressions." 3. The promised performance gains are actually small by comparison to the existing project that Guido is running is hoping to achieve. It is unclear whether the no-gil implementation would impact those gains, and if so whether a small reduction in the large planned performance gains would actually more than wipe out the modest performance gains promised by the no-gil project. 4. Given that this "Removing the GIL will require making trade-offs and taking on substantial risk", it is easy to see that this project could come across an unacceptable risk or insurmountable technical problem at any point and thus fall by the wayside. Taking all of the above points together, I think that there is still merit in considering the pros and cons of a GIL scheduler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:07:02 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 21 Mar 2022 22:07:02 +0000 Subject: [issue47027] subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter In-Reply-To: <1647356154.7.0.125333178117.issue47027@roundup.psfhosted.org> Message-ID: <1647900422.56.0.831505267587.issue47027@roundup.psfhosted.org> Gregory P. Smith added the comment: Basically you want it to call fchdir() instead of chdir() when passed a fd (integer) instead of a string/Path-like. That makes sense and should be a reasonably straight forward set of changes to _posixsubprocess.c. (A way to convert a fd into a Path-like object would _not_ work as that'd reintroduce the TOCTOU on the directory - that'd be a pathlib feature request anyways, not a subprocess one) ---------- stage: -> needs patch versions: +Python 3.11 -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:11:45 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 22:11:45 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647900705.47.0.522655255474.issue47086@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +30128 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:42:57 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 21 Mar 2022 22:42:57 +0000 Subject: [issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more In-Reply-To: <1647536407.51.0.0999811283469.issue47048@roundup.psfhosted.org> Message-ID: <1647902577.88.0.0776578413852.issue47048@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. This problem was reported previously in bpo-24844 and was determined to be due a partial implementation of atomics support in the early versions of LLVM compilers provided in the Apple Developer Tools for macOS 10.7. While the start of a patch was proposed there, it languished for lack of interest and the issue was subsequently closed by the submitter. Since you have already have a workaround (and using a newer compiler is a good idea in this), I think there will be little interest in reviving this issue. By the way, since you need to continue to use macOS 10.7, you may want to consider using Python (and many other third-party packages) from the MacPorts project. They provide pre-built binaries for these packages, including the latest versions of Python 3.10, built for multiple versions of macOS including 10.7 Lion. I was able to install MacPorts and a fully functional Python 3.10.3 on a 10.7.5 system in fewer than 5 minutes. https://www.macports.org/install.php#installing ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4 versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:43:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 21 Mar 2022 22:43:13 +0000 Subject: [issue47082] No protection: `import numpy` in two different threads can lead to race-condition In-Reply-To: <1647882185.36.0.953866126148.issue47082@roundup.psfhosted.org> Message-ID: <1647902593.74.0.459822706723.issue47082@roundup.psfhosted.org> Christian Heimes added the comment: Python used to have a global import lock. The global import lock prevented recursive imports from other threads while the current thread was importing. The import lock was source of issues and dead locks. Antoine replaced it with a fine grained import lock in bpo-9260. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:56:02 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 21 Mar 2022 22:56:02 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647903362.32.0.182736372593.issue46788@roundup.psfhosted.org> Jeremy Kloth added the comment: With 3.8 so close to security only, I would doubt it is worth it anymore. I've just run the PR against HEAD and it still works as is, so should be good to go. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 18:57:05 2022 From: report at bugs.python.org (Chris Barker) Date: Mon, 21 Mar 2022 22:57:05 +0000 Subject: [issue27198] Adding an assertClose() method to unittest.TestCase In-Reply-To: <1464979712.74.0.398203716413.issue27198@psf.upfronthosting.co.za> Message-ID: <1647903425.46.0.410835311964.issue27198@roundup.psfhosted.org> Chris Barker added the comment: Yes -- it was on me years ago to do this. Honestly, I haven't done it yet because I lost the momentum of PyCon, and I don't personally use unittest at all anyway. But I still think it's a good idea, and I'd like to keep it open with the understanding that if I don't get it done soon, it'll be closed (or someone else is welcome to do it, of course, if they want) is, say, three weeks soon enough? @Vedran ?a?i? wrote: "... and in the moment that you're deciding on this, you have the exact value expected right in front of you." Well, yes and no. First of all, not always a literal, though yes, most often it is. But: 1) If the "correct" value is, e.g. 1.2345678e23 -- the delta is not exactly "right there in front of you" -- yes, not that hard to figure out, but it takes a bit of thought, compared to "I want it to be close to this number within about 6 decimal places" (rel_tol=1e-6) 2) Sometimes you have a bunch of values that you are looping over in your tests, or doing parameterized tests -- it which case the relative tolerance could be constant, but the delta is not. 3) With that argument, why do we have the "decimal places" tolerance, rather than a delta always? Anyway, if I didn't consistently use pytest, I'd want this, so I'm happy to get it done. Thanks for the ping, @Irit Katriel ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:00:18 2022 From: report at bugs.python.org (Brett Cannon) Date: Mon, 21 Mar 2022 23:00:18 +0000 Subject: [issue47026] BytesWarning in zipimport paths on sys.path In-Reply-To: <1647350949.19.0.783799424166.issue47026@roundup.psfhosted.org> Message-ID: <1647903618.28.0.931049677695.issue47026@roundup.psfhosted.org> Change by Brett Cannon : ---------- dependencies: +bytes do not work on sys.path _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:00:44 2022 From: report at bugs.python.org (Brett Cannon) Date: Mon, 21 Mar 2022 23:00:44 +0000 Subject: [issue47026] BytesWarning in zipimport paths on sys.path In-Reply-To: <1647350949.19.0.783799424166.issue47026@roundup.psfhosted.org> Message-ID: <1647903644.05.0.642344158842.issue47026@roundup.psfhosted.org> Brett Cannon added the comment: bpo-47025 is a bigger discussion about bytes paths that probably needs to be resolved first before worrying about zipimport. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:04:38 2022 From: report at bugs.python.org (Sebastian Berg) Date: Mon, 21 Mar 2022 23:04:38 +0000 Subject: [issue47082] No protection: `import numpy` in two different threads can lead to race-condition In-Reply-To: <1647882185.36.0.953866126148.issue47082@roundup.psfhosted.org> Message-ID: <1647903878.8.0.133933479009.issue47082@roundup.psfhosted.org> Sebastian Berg added the comment: Thanks, so there should already be a lock in place (sorry, I missed that). But somehow we seem to get around it? Do you know what may cause the locking logic to fail in this case? Recursive imports in NumPy itself? Or Cython using low-level C-API? I.e. can you think of something to investigate that may help NumPy/Cython to make sure that locking is successful? /* Cythons Import code (slightly cleaned up for Python 3 only): */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { if (level == -1) { if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } if (!module) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); } } bad: Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:05:00 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 21 Mar 2022 23:05:00 +0000 Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org> Message-ID: <1647903900.7.0.157828484739.issue41210@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg415670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:07:21 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 23:07:21 +0000 Subject: [issue47051] Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harder to read serif font. In-Reply-To: <1647882287.04.0.0197194167693.issue47051@roundup.psfhosted.org> Message-ID: <1647904041.08.0.365306383748.issue47051@roundup.psfhosted.org> Steve Dower added the comment: Doesn't seem to be any relevant changes in the repo between v3.10.2 and v3.10.3, and the theme hasn't changed. Obviously the HTMLHelp tools haven't changed in a decade or so, and the only difference in the build logs looks like less errors in the later one (apparently index terms didn't get fixed up properly in 3.10.2). So other than running the build again and hoping (which we'll likely be doing later this week anyway), doesn't seem to be anything that can be fixed here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:10:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 23:10:41 +0000 Subject: [issue18241] Add unique option to heapq functions In-Reply-To: <1371480242.24.0.0078060677529.issue18241@psf.upfronthosting.co.za> Message-ID: <1647904241.04.0.431183715508.issue18241@roundup.psfhosted.org> Irit Katriel added the comment: I would dedup when extracting items from the queue, because it is trivial to find duplicates then. It can be done with a simple wrapper, without any changes to the queue. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:16:44 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Mar 2022 23:16:44 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647904604.35.0.537990187511.issue47061@roundup.psfhosted.org> miss-islington added the comment: New changeset 9ac2de922a0f783bd43b8e026e4fb70fd1888572 by Brett Cannon in branch 'main': bpo-47061: document module deprecations due to PEP 594 (GH-31984) https://github.com/python/cpython/commit/9ac2de922a0f783bd43b8e026e4fb70fd1888572 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:16:47 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Mar 2022 23:16:47 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647904607.87.0.879976974971.issue47061@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30129 pull_request: https://github.com/python/cpython/pull/32039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:17:26 2022 From: report at bugs.python.org (GalaxySnail) Date: Mon, 21 Mar 2022 23:17:26 +0000 Subject: [issue43141] `asdict` fails with frozen dataclass keys, using raw dict form In-Reply-To: <1612590414.63.0.106701107905.issue43141@roundup.psfhosted.org> Message-ID: <1647904646.05.0.0529358817514.issue43141@roundup.psfhosted.org> Change by GalaxySnail : ---------- nosy: +GalaxySnail _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:30:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 23:30:55 +0000 Subject: [issue1703592] [doc] mention that setlocale raises exception if given a nonexisting locale Message-ID: <1647905455.18.0.477251398291.issue1703592@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: have a way to ignore nonexisting locales in locale.setlocale -> [doc] mention that setlocale raises exception if given a nonexisting locale versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:34:53 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 21 Mar 2022 23:34:53 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647905693.72.0.131673940333.issue46788@roundup.psfhosted.org> Steve Dower added the comment: "So close" being some months ago ;) I need to retrigger address sanitiser so that it passes before merging, but after that, I'll merge (and hopefully the backport is clean). Copying Eryk Sun's comment here for posterity: This would be less fragile and more useful in general if support were added to _winapi for PdhOpenQueryW(), PdhAddEnglishCounterW(), PdhCollectQueryData(), PdhCollectQueryDataEx(), PdhGetFormattedCounterValue(), and PdhCloseQuery(). The English counter name is "\System\Processor Queue Length" -- no need to worry about localized names, hard-coded values, or hard-coded struct sizes and offsets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:44:35 2022 From: report at bugs.python.org (jakirkham) Date: Mon, 21 Mar 2022 23:44:35 +0000 Subject: [issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio In-Reply-To: <1647249522.0.0.992096149336.issue47010@roundup.psfhosted.org> Message-ID: <1647906275.08.0.123614412676.issue47010@roundup.psfhosted.org> Change by jakirkham : ---------- nosy: +jakirkham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:50:54 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 21 Mar 2022 23:50:54 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647906654.35.0.920550510046.issue46788@roundup.psfhosted.org> Eryk Sun added the comment: I was just wondering whether it's worth implementing it using the API. To be clear, I wasn't implying to hold off on applying Jeremy's PR. The existing code is causing him problems, and he has a working solution. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:55:45 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 21 Mar 2022 23:55:45 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647906945.41.0.159358321917.issue47076@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30130 pull_request: https://github.com/python/cpython/pull/32040 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 19:58:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Mar 2022 23:58:55 +0000 Subject: [issue22013] Add at least minimal support for thread groups In-Reply-To: <1405839394.09.0.812488093428.issue22013@psf.upfronthosting.co.za> Message-ID: <1647907135.26.0.555171311291.issue22013@roundup.psfhosted.org> Irit Katriel added the comment: And now we have TaskGroups in asyncio as well. I'm closing this as it seems to have been abandoned. Feel free to reopen if this is still needed. ---------- nosy: +iritkatriel stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:04:25 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 00:04:25 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647907465.74.0.511877963615.issue47076@roundup.psfhosted.org> Andrew Svetlov added the comment: > The problem is more that a sleep is not a reliable synchronization primitive Yes, sure! I'm trying to avoid 'sleep for synchronization' when I'm writing new tests or fixing existing ones. The problem with this particular queue tests is: I rewrote old-styled tests that used a loop time shift generator with IsolatedAsyncioTestCase keeping the minimal invasive changes. It doesn't work well, now tiny shifts are removed; only 'await sleep(0)' are left when a bare context switch is needed without a delay. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:07:03 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 00:07:03 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1647907623.4.0.612854099473.issue44336@roundup.psfhosted.org> Steve Dower added the comment: New changeset 19058b9f6271338bcc46b7d30fe79a83990cc35c by Jeremy Kloth in branch 'main': bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578) https://github.com/python/cpython/commit/19058b9f6271338bcc46b7d30fe79a83990cc35c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:08:13 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 00:08:13 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647907693.28.0.794802458855.issue46788@roundup.psfhosted.org> Steve Dower added the comment: Jeremy - backports need to be done manually. Can I leave that with you and just ping me on here when you're ready for a merge? ---------- stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:30:34 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 00:30:34 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647909034.99.0.146492358497.issue47061@roundup.psfhosted.org> miss-islington added the comment: New changeset c3538355f49f9394140428a848f2acf08175ff1a by Miss Islington (bot) in branch '3.10': [3.10] bpo-47061: document module deprecations due to PEP 594 (GH-31984) (GH-32039) https://github.com/python/cpython/commit/c3538355f49f9394140428a848f2acf08175ff1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 20:33:35 2022 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Mar 2022 00:33:35 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1647909215.11.0.200968124626.issue47061@roundup.psfhosted.org> Brett Cannon added the comment: One thing I forgot to mention is that I will be updating What's New as the code deprecations land. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 21:01:21 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 22 Mar 2022 01:01:21 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647910881.25.0.63082183118.issue47006@roundup.psfhosted.org> Guido van Rossum added the comment: I'd like to look at this as a case of simplifying something to its simplest canonical form, but no simpler. This is what the existing fixed-typevar expansion does: e.g. tuple[str, T, T][int] becomes tuple[str, int, int]. I propose that we try to agree on a set of rules for what can be simplified further and what cannot, when we have B = C[...]; A = B[...], (IOW A = C[...][...]), for various shapes of the subscripts to C and B. Note that what's relevant for the second subscript is C[...].__parameters__, so I'll call that "left" below. 1. Some edge case seems to be that if *tuple[...] is involved on either side we will never simplify. Or perhaps a better rule is that *tuple[...] is never simplified away (but fixed items before and after it may be). 2. Another edge case is that if neither side has any starred items we will always simplify (since this is the existing behavior in 3.10). This may raise an error if the number of subscripts on the right does not match the number of parameters on the left. 3. If there's a single *Ts on the left but not on the right, we should be able to simplify, which again may raise an error if there are not enough values on the right, but if there are more than enough, the excess will be consumed by *Ts (in fact that's the only way *Ts is fed). 4. If there's a *Ts on the right but not on the left, we should _not_ simplify, since whatever we have on the left serves as a constraint for *Ts. (E.g. tuple[int, int][*Ts] constrains *Ts to being (int, int).) 5. If there's exactly one *Ts on the left and one on the right, we _might__ be able to simplify if the prefix and suffix of the __parameters__ match the prefix and suffix of the subscript on the right. E.g. C[int, T, *Ts, float][str, *Ts] can be simplified to C[int, str, *Ts, float]. OTOH C[int, T, *Ts, float][*Ts] cannot be simplified -- but we cannot flag it as an error either. Note that __parameters__ in this example is (T, Ts); we have to assume that typevartuples in __parameters__ are always used as *Ts (since the PEP recognizes no valid unstarred uses of Ts). TBH case 5 is the most complex and I may have overlooked something. I'm more sure of cases 1-4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 21:09:02 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 01:09:02 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647911342.35.0.685877782704.issue47086@roundup.psfhosted.org> Steve Dower added the comment: New changeset 3751b6b030b4a3b88959b4f3c4ef2e58d325e497 by Steve Dower in branch 'main': bpo-47086: Remove .chm from Windows installer and add HTML docs (GH-32038) https://github.com/python/cpython/commit/3751b6b030b4a3b88959b4f3c4ef2e58d325e497 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 21:09:56 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 01:09:56 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647911396.88.0.305399155816.issue47086@roundup.psfhosted.org> Steve Dower added the comment: Leaving this open and assigned to myself for a couple of days to deal with any other fallout. In particular, I wasn't able to test the (minor) changes to the publishing steps (e.g. GPG signing), so will have to wait for the next release to see what works/doesn't there. ---------- assignee: -> steve.dower stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 21:10:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 01:10:42 +0000 Subject: [issue25489] sys.exit() caught in async event loop exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647911442.27.0.812344226828.issue25489@roundup.psfhosted.org> Andrew Svetlov added the comment: I can describe what happens with test_sys_exit_in_exception_handler.py 1. The 'boom' task raises an exception. 2. The task is not awaited, Future.__del__ calls the exception handler with 'Task exception was never retrieved' message. 3. The custom handler raises SystemExit. 4. SystemExit bubbles up and swallowed by __del__, the __del__ method cannot re-raise. The question is: what is the behavior expected? a) Now an exception raised by a custom exception handler is swallowed in this particular case (but is propagated if `loop.call_exception_handler()` is called from a function other than __del__). b) Yuri suggested re-schedule an exception generated by `loop.call_exception_handler` by `loop.call_soon()`. asyncio.Handle catches it and... calls `call_exception_handler()` with 'Exception in callback ...' message. At the end, we have an endless recursion. c) asyncio loop can call `loop.stop()` if an exception is raised by `loop.call_exception_handler()` from __del__. I think this behavior is terrible: a subtle error can terminate asyncio program. d) Assume that a custom exception handler should not raise an exception. Catch all exceptions in `call_exception_handler`, call sys.unraisablehook(), and suppress the exception. I believe that d) is the best thing that we can do here. I can prepare a fix if we agree on the solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 21:13:03 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 01:13:03 +0000 Subject: [issue25489] sys.exit() caught in async event loop exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647911583.1.0.758280802384.issue25489@roundup.psfhosted.org> Andrew Svetlov added the comment: Guido, perhaps you had problems with the problem detection because the asyncio uses _asyncio C Extesions by default. It drops some calls from the python stack trace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 22:39:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 02:39:01 +0000 Subject: [issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed In-Reply-To: <1647834295.59.0.927940933477.issue47078@roundup.psfhosted.org> Message-ID: <1647916741.08.0.00462460358507.issue47078@roundup.psfhosted.org> STINNER Victor added the comment: It's a Linux kernel 5.17 regression on static-pie programs affecting AArch64: https://bugzilla.kernel.org/show_bug.cgi?id=215720 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 22:58:10 2022 From: report at bugs.python.org (David Foster) Date: Tue, 22 Mar 2022 02:58:10 +0000 Subject: [issue47087] Implement PEP 655 (Required/NotRequired) In-Reply-To: <1647897511.2.0.22546468537.issue47087@roundup.psfhosted.org> Message-ID: <1647917890.18.0.737794529141.issue47087@roundup.psfhosted.org> Change by David Foster : ---------- nosy: +David Foster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 23:50:00 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 22 Mar 2022 03:50:00 +0000 Subject: [issue47030] singledispatch does not work with positional arguments with default values. In-Reply-To: <1647370009.1.0.761981911738.issue47030@roundup.psfhosted.org> Message-ID: <1647921000.05.0.733419142339.issue47030@roundup.psfhosted.org> Andrei Kulakov added the comment: This would be problematic for two reasons: - possible confusion between the default function that runs when an argument doesn't match any registered types, and another "default" which runs when argument is omitted. - to see which function will run when argument is omitted, you would need to check in two places - the default value of arg and then find the registered function that matches it. If we end up deciding there is a need to run a default handler when an argument is omitted, it would be more explicit and convenient and visually obvious to decorate the "default if no arg" handler in some way, which also means there'd be a single place where this behavior is defined. We can also consider adding a note to documentation that the first argument used for dispatch should not have a default value, to make it more explicit that dispatching on default value is not supported. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 21 23:53:35 2022 From: report at bugs.python.org (Matt Wozniski) Date: Tue, 22 Mar 2022 03:53:35 +0000 Subject: [issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()` In-Reply-To: <1643823106.57.0.535855742317.issue46614@roundup.psfhosted.org> Message-ID: <1647921215.83.0.189529734692.issue46614@roundup.psfhosted.org> Change by Matt Wozniski : ---------- keywords: +patch pull_requests: +30131 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 00:21:02 2022 From: report at bugs.python.org (Daniel Hillier) Date: Tue, 22 Mar 2022 04:21:02 +0000 Subject: [issue40172] ZipInfo corrupts file names in some old zip archives In-Reply-To: <1585925740.74.0.493426565247.issue40172@roundup.psfhosted.org> Message-ID: <1647922862.24.0.208902223186.issue40172@roundup.psfhosted.org> Daniel Hillier added the comment: Related to issue https://bugs.python.org/issue28080 which has a patch that covers a bit of this issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 00:50:29 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 22 Mar 2022 04:50:29 +0000 Subject: [issue25489] sys.exit() caught in async event loop exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647924629.22.0.401806280007.issue25489@roundup.psfhosted.org> Guido van Rossum added the comment: Andrew, thanks for explaining this. The key thing I was missing was that the root cause of the problem is that Future.__del__ is trying to log an error about the un-awaited task by calling the exception handler directly. That actually feels a little dodgy. This is why I'm not yet comfortable with (d). Looking at call_exception_handler(), whether it calls the default handler or a custom handler, it explicitly checks for SystemExit and KeyboardInterrupt and re-raises those. And only those -- everything ends up logging an error. Which makes me wonder. Maybe that error in Future.__del__ should not call any exception handler at all, but just call logger.error()? Or maybe Future.__del__ should catch exceptions coming out of there and log an error? Maybe a modified version of (d), but only implemented in Future.__del__, not in call_exception_handler()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 01:48:24 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 22 Mar 2022 05:48:24 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647928104.91.0.9780007489.issue46864@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +30132 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 01:49:16 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 22 Mar 2022 05:49:16 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647928156.03.0.901969367961.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: I'm sorry. Maybe, ccache hides the warning from me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:20:57 2022 From: report at bugs.python.org (Ma Lin) Date: Tue, 22 Mar 2022 06:20:57 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647930057.04.0.202032201008.issue46864@roundup.psfhosted.org> Ma Lin added the comment: If run this code, would it be slower? bytes_hash = hash(bytes_data) bytes_hash = hash(bytes_data) # get hash twice ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:31:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 06:31:22 +0000 Subject: [issue40172] ZipInfo corrupts file names in some old zip archives In-Reply-To: <1585925740.74.0.493426565247.issue40172@roundup.psfhosted.org> Message-ID: <1647930682.89.0.609479786809.issue40172@roundup.psfhosted.org> Gregory P. Smith added the comment: Examining Lib/zipfile.py code, the existing code makes sense. Python's zipfile module produces modern zipfiles when writing by setting the utf-8 flag and storing the filename as utf-8 when it is not ASCII. This is desirable for use with all normal zip implementations in the past 10-15 years. When decoding a zipfile, if the utf-8 flag is not set, we assume cp437 per the pkware zip appnotes.txt "spec". So our reading is correct as well, even for very old files. This is being strict in what we produce an lenient in what we accept. caveats? yes: If someone does need to produce zipfiles for use with ancient software that does not support utf-8, that also does not identify the unknown utf-8 flag as an error condition, it will interpret the name in a corrupt manner for non-ascii names. Similarly, even if written with cp437 names (as PR 19335 would do), in old zip system implementations where the implementation blindly uses the users locale encoding instead of cp437, it will always see corrupt data in that scenario. (aka mojibake?) These are not what I'd expect to be normal use cases. Do you have a common practical example of a need for this? (The PR on issue28080 provides a way to _read_ legacy zip files that used a codec other than cp437 if you know what it was.) --- https://www.loc.gov/preservation/digital/formats/fdd/fdd000354.shtml may also be of interest regarding the zip format. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:31:58 2022 From: report at bugs.python.org (Ben Boeckel) Date: Tue, 22 Mar 2022 06:31:58 +0000 Subject: [issue28584] ICC compiler check is too permissive In-Reply-To: <1478035366.63.0.90573648053.issue28584@psf.upfronthosting.co.za> Message-ID: <1647930718.08.0.347165731384.issue28584@roundup.psfhosted.org> Change by Ben Boeckel : ---------- nosy: +mathstuf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:40:23 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 06:40:23 +0000 Subject: [issue28080] Allow reading member names with bogus encodings in zipfile In-Reply-To: <1473620375.38.0.155906896901.issue28080@psf.upfronthosting.co.za> Message-ID: <1647931223.11.0.320380640095.issue28080@roundup.psfhosted.org> Gregory P. Smith added the comment: Your PR looks good to me. I agree with not making it easy to _write_ zipfiles with non-standard encoding used for names. There is a possibility that someone wants that ability when writing zip files (not yet clear) in https://bugs.python.org/issue40172. I don't like it, but if the need exists, that feature can be addressed on that issue via relevant options. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 02:51:17 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 22 Mar 2022 06:51:17 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647931877.53.0.384583093397.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: Since Python 3.13, yes. It will be bit slower. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 03:06:58 2022 From: report at bugs.python.org (Ma Lin) Date: Tue, 22 Mar 2022 07:06:58 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647932818.56.0.202693321419.issue46864@roundup.psfhosted.org> Ma Lin added the comment: Since hash() is a public function, maybe some users use hash value to manage bytes objects in their own way, then there may be a performance regression. For a rough example, dispatch data to 16 servers. h = hash(b) sendto(server_number=h & 0xF, data=b) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 03:48:09 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 22 Mar 2022 07:48:09 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1647935289.22.0.221112060191.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: Since the hash is randomized, using hash(bytes) for such use case is not recommended. User should use stable hash functions instead. I agree that there is few use cases this change cause performance regression. But it is really few compared to overhead of adding 8bytes for all bytes instances. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 04:38:53 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 08:38:53 +0000 Subject: [issue47090] Make zlib required on all platforms (simplifies code) Message-ID: <1647938333.52.0.126058309361.issue47090@roundup.psfhosted.org> New submission from Gregory P. Smith : We have a pile of conditionals and extra code in CPython to deal with building on systems that do not have zlib. The zlib C library has been around forever at this point and should be present on every system in the world. zlib is already required on Windows to build CPython. Proposal: simplify our code by removing the conditionals around zlib being optional. I'm attaching a draft PR to show what this would look like. ---------- assignee: gregory.p.smith components: Build, Extension Modules, Library (Lib) messages: 415750 nosy: gregory.p.smith priority: normal severity: normal stage: patch review status: open title: Make zlib required on all platforms (simplifies code) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 04:40:00 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 08:40:00 +0000 Subject: [issue47090] Make zlib required on all platforms (simplifies code) In-Reply-To: <1647938333.52.0.126058309361.issue47090@roundup.psfhosted.org> Message-ID: <1647938400.65.0.280203455099.issue47090@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +30133 pull_request: https://github.com/python/cpython/pull/32043 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 04:42:30 2022 From: report at bugs.python.org (rive_n) Date: Tue, 22 Mar 2022 08:42:30 +0000 Subject: [issue47043] Argparse can't parse subparsers with parse_known_args In-Reply-To: <1647524994.61.0.940749160258.issue47043@roundup.psfhosted.org> Message-ID: <1647938550.12.0.081893810281.issue47043@roundup.psfhosted.org> rive_n added the comment: Long time no updates here. Another fix. In past version more than 1 argument could not be parsed. Fix (finally with unittests): ```python3 def __call__(self, parser, namespace, values, option_string=None, arg_strings_pattern:list =None): o_amount = arg_strings_pattern.count("O") if not o_amount: raise ValueError("No Os found") o_start, o_stop, indexes = arg_strings_pattern.index('O'), len(arg_strings_pattern), [] print(parser) try: while arg_strings_pattern.index('O', o_start, o_stop): indexes.append(arg_strings_pattern.index('O', o_start, o_stop)) o_start = arg_strings_pattern.index('O', o_start + 1, o_stop) except ValueError: pass used_indexes = [] known_args = {} for i, index in enumerate(indexes): parser_name = values[index - 1] if not known_args.get(parser_name): known_args[parser_name] = [] known_args[parser_name] += values[index: indexes[i + 1] - 1] if i + 1 < len(indexes) else values[index:] if index not in used_indexes: for s, subindex in enumerate(indexes[1:]): subparser_name = values[subindex - 1] if parser_name == subparser_name: used_indexes.append(index) used_indexes.append(subindex) subparser_args = values[subindex: indexes[s + 2] - 1] if s + 2 < len(indexes) else values[subindex:] known_args[parser_name] += subparser_args for parser_name, args in known_args.items(): self._create_parser(namespace, parser_name, args) def _create_parser(self, namespace, parser_name, arg_strings): # set the parser name if requested if self.dest is not SUPPRESS: setattr(namespace, self.dest, parser_name) # select the parser try: parser = self._name_parser_map[parser_name] except KeyError: args = {'parser_name': parser_name, 'choices': ', '.join(self._name_parser_map)} msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args raise ArgumentError(self, msg) # parse all the remaining options into the namespace # store any unrecognized options on the object, so that the top # level parser can decide what to do with them # In case this subparser defines new defaults, we parse them # in a new namespace object and then update the original # namespace for the relevant parts. subnamespace, arg_strings = parser.parse_known_args(arg_strings, None) for key, value in vars(subnamespace).items(): setattr(namespace, key, value) if arg_strings: vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, []) getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings) ``` Unittests: ```python3 import unittest import argfork as argparse from argfork import Namespace class argparseTest(unittest.TestCase): def setUp(self) -> None: self.parser = argparse.ArgumentParser(prog='PROG') subparsers = self.parser.add_subparsers(help='sub-command help') # create the parser for the "a" command parser_a = subparsers.add_parser('a', help='a help') parser_a.add_argument('-a', help='bar help') # create the parser for the "b" command parser_b = subparsers.add_parser('b', help='b help') parser_b.add_argument('-b', help='baz help') parser_b.add_argument('-q', help='baz help') # create the parser for the "c" command parser_b = subparsers.add_parser('c', help='b help') parser_b.add_argument('-c', help='baz help') parser_b.add_argument('-k', help='baz help') # create the parser for the "c" command parser_b = subparsers.add_parser('d', help='b help') parser_b.add_argument('-d', help='baz help') parser_b.add_argument('-D', help='baz help') parser_b.add_argument('-R', help='baz help') def testSimple(self): case = ['a', '-a', 'test'] res_obj = Namespace(a='test').__dict__ rest_obj = self.parser.parse_known_args(case)[0].__dict__ res_k, res_v = res_obj.keys(), list(res_obj.values()) test_k, test_v = rest_obj.keys(), list(rest_obj.values()) self.assertEqual(res_v, test_v) self.assertEqual(res_k, test_k) def testMany(self): case = ['d', '-d', '1234', 'd', '-D', '12345', 'd', '-R', '1', 'c', '-c', '123', 'c', '-k', '555', 'b', '-q', 'test'] res_obj = Namespace(d='1234', D='12345', R='1', c='123', k='555', b=None, q='test').__dict__ rest_obj = self.parser.parse_known_args(case)[0].__dict__ res_k, res_v = res_obj.keys(), list(res_obj.values()) test_k, test_v = rest_obj.keys(), list(rest_obj.values()) self.assertEqual(res_v, test_v) self.assertEqual(res_k, test_k) def testZero(self): case = [] res_obj = Namespace().__dict__ rest_obj = self.parser.parse_known_args(case)[0].__dict__ res_k, res_v = res_obj.keys(), list(res_obj.values()) test_k, test_v = rest_obj.keys(), list(rest_obj.values()) self.assertEqual(res_v, test_v) self.assertEqual(res_k, test_k) if __name__ == '__main__': unittest.main() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 04:49:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 08:49:01 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647938941.56.0.667038828617.issue47006@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Alias = C[T, *Ts] > Alias2 = Alias[*tuple[int, ...]] > # Alias2 should be C[int, *tuple[int, ...]] tuple[int, ...] includes also an empty tuple, and in this case there is no value for T. > Oh, also interesting - I didn't know about this one either. Could you give an example? If __origin__, __parameters__, __args__ are a mess, it will definitely break a code which use them. > We actually deliberately chose not to unpack concrete tuple types - see the description of https://github.com/python/cpython/pull/30398, under the heading 'Starred tuple types'. (If you see another way around it, though, let me know.) You assumed that *tuple[str, bool] in def foo(*args: *tuple[str, bool]) should give foo.__annotations__['args'] = tuple[str, bool], but it should rather give (str, bool). No confusion with tuple[str, bool]. And one of PEP 646 options is to implement star-syntax only in subscription, not in var-parameter type annotations. > I'm also not sure about this one; disallowing unpacked TypeVarTuples in argument lists to generic aliases completely (if I've understood right?) No, it will only be disallowed in substitution of a VarType. Tuple[T][*Ts] -- error. Tuple[*Ts][*Ts2] -- ok. I propose to implement simple and strict rules, and later add support of new cases where it makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 05:06:58 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 09:06:58 +0000 Subject: [issue47006] PEP 646: Decide on substitution behavior In-Reply-To: <1647204376.33.0.359883240304.issue47006@roundup.psfhosted.org> Message-ID: <1647940018.7.0.712959001072.issue47006@roundup.psfhosted.org> Serhiy Storchaka added the comment: > 1. Some edge case seems to be that if *tuple[...] is involved on either side we will never simplify. Or perhaps a better rule is that *tuple[...] is never simplified away (but fixed items before and after it may be). I do not understand this. Do you forbid simplifying of tuple[*Ts, float][str, *tuple[int, ...]] to tuple[str, *tuple[int, ...], float]? I think that the rule should be that *tuple[X, ...] cannot split between different variables. Or that it cannot substitute a TypeVar. A more strong variant of rule 4. > 5. ... but we cannot flag it as an error either. I think that it will better to flag it as an error now. Later, after all code be merged and all edge cases be handled we can return here and reconsider this. There are workarounds for this. * You should not use Generic[*Ts] if you require at least one item, but Generic[*Ts, T]. * Instead of `def foo(*args: *Ts)` use `def foo(*args: *tuple[*Ts, T])`. These tricks are common in functional programming. The rest of the rules match my implementations more or less. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 05:37:24 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 09:37:24 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647941844.39.0.914766892954.issue45150@roundup.psfhosted.org> miss-islington added the comment: New changeset 4f97d64c831c94660ceb01f34d51fa236ad968b0 by Christian Heimes in branch 'main': bpo-45150: Add hashlib.file_digest() for efficient file hashing (GH-31930) https://github.com/python/cpython/commit/4f97d64c831c94660ceb01f34d51fa236ad968b0 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 05:45:04 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 09:45:04 +0000 Subject: [issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation In-Reply-To: <1647880741.05.0.407746154875.issue47081@roundup.psfhosted.org> Message-ID: <1647942304.93.0.348541226668.issue47081@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset c6cd3cc93c40363ce704d34a70e6fb73ea1d97a3 by Serhiy Storchaka in branch 'main': bpo-47081: Replace "qualifiers" with "quantifiers" in the re module documentation (GH-32028) https://github.com/python/cpython/commit/c6cd3cc93c40363ce704d34a70e6fb73ea1d97a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 05:53:24 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 09:53:24 +0000 Subject: [issue28080] Allow reading member names with bogus encodings in zipfile In-Reply-To: <1473620375.38.0.155906896901.issue28080@psf.upfronthosting.co.za> Message-ID: <1647942804.95.0.988243961587.issue28080@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a25a985535ccbb7df8caddc0017550ff4eae5855 by Serhiy Storchaka in branch 'main': bpo-28080: Add support for the fallback encoding in ZIP files (GH-32007) https://github.com/python/cpython/commit/a25a985535ccbb7df8caddc0017550ff4eae5855 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 05:54:55 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 09:54:55 +0000 Subject: [issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation In-Reply-To: <1647880741.05.0.407746154875.issue47081@roundup.psfhosted.org> Message-ID: <1647942895.75.0.636811961006.issue47081@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 06:04:50 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 10:04:50 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1647943490.29.0.531913036816.issue40280@roundup.psfhosted.org> miss-islington added the comment: New changeset deeaac49e267285158264643799624623f4a7b29 by Christian Heimes in branch 'main': bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986) https://github.com/python/cpython/commit/deeaac49e267285158264643799624623f4a7b29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 06:10:11 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 22 Mar 2022 10:10:11 +0000 Subject: [issue45563] inspect.getframeinfo() doesn't handle frames without lineno In-Reply-To: <1634853732.41.0.89193081236.issue45563@roundup.psfhosted.org> Message-ID: <1647943811.84.0.114758985107.issue45563@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch nosy: +graingert nosy_count: 4.0 -> 5.0 pull_requests: +30134 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/32044 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 06:52:45 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 10:52:45 +0000 Subject: [issue45563] inspect.getframeinfo() doesn't handle frames without lineno In-Reply-To: <1634853732.41.0.89193081236.issue45563@roundup.psfhosted.org> Message-ID: <1647946365.86.0.632711101838.issue45563@roundup.psfhosted.org> Mark Shannon added the comment: You are on own if you create code objects by calling `types.CodeType`. The docs could be a lot clearer about that, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 07:00:07 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 11:00:07 +0000 Subject: [issue47085] missing frame.f_lineno on JUMP_ABSOLUTE In-Reply-To: <1647890467.59.0.144255905293.issue47085@roundup.psfhosted.org> Message-ID: <1647946807.22.0.159889273078.issue47085@roundup.psfhosted.org> Mark Shannon added the comment: The `JUMP_ABSOLUTE` doesn't have a line number, as it doesn't correspond to any source. The jump back to the top could follow either the `if i >= 0:` or the `pass`, so cannot have a line number. Don't expect every bytecode to map directly back to the source, especially if it cannot raise an exception. Per-line tracing is well defined by PEP 626. Per-opcode tracing is not. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 07:39:09 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 22 Mar 2022 11:39:09 +0000 Subject: [issue46838] Parameters and arguments parser syntax error improvments In-Reply-To: <1645651401.14.0.658565183507.issue46838@roundup.psfhosted.org> Message-ID: <1647949149.7.0.0274433968522.issue46838@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7d810b6a4eab6eba689acc5bb05f85515478d690 by Pablo Galindo Salgado in branch 'main': bpo-46838: Syntax error improvements for function definitions (GH-31590) https://github.com/python/cpython/commit/7d810b6a4eab6eba689acc5bb05f85515478d690 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:36:05 2022 From: report at bugs.python.org (Larry Hastings) Date: Tue, 22 Mar 2022 12:36:05 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1647952565.56.0.342649628454.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: Jack: I've updated the PR, improving compatibility with the "blake3" package on PyPI. I took your notes, and also looked at the C module you wrote. The resulting commit is here: https://github.com/python/cpython/pull/31686/commits/37ce72b0444ad63fd1989ad36be5f7790e51f4f1 Specifically: * derive_key_context is now a string, which I internally encode into UTF-8. * I added the AUTO member to the module, set to -1. * max_threads may not be zero; it can be >= 1 or AUTO. * I added the reset() method. Some additional thoughts, both on what I did and on what you did: * In your new() method, your error string says "keys must be 32 bytes". I went with "key must be exactly 32 bytes"; the name of the parameter is "key", and I think "exactly" makes the message clearer. * In my new() method, I complain if the derive_key_context is zero-length. In your opinion, is that a good idea, or is that overly fussy? * In your copy() method, you hard-code Blake3Type. It's considered good form to use type(self) here, in case the user is calling copy on a user-created subclass of Blake3Type. * In your copy() method, if the original has a lock created, you create a lock in the copy too. I'm not sure why you bother; I leave the lock member uninitialized, and let the existing logic create the lock in the copy on demand. * In the Blake3_methods array, you list the "update" method twice. I suspect this is totally harmless, but it's unnecessary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:37:50 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Tue, 22 Mar 2022 12:37:50 +0000 Subject: [issue47091] Improve performance of list and tuple repeat methods Message-ID: <1647952670.83.0.274983393245.issue47091@roundup.psfhosted.org> New submission from Pieter Eendebak : Approach is similar to https://github.com/python/cpython/pull/31856 and https://github.com/python/cpython/pull/31999 ---------- components: Interpreter Core messages: 415762 nosy: pieter.eendebak priority: normal severity: normal status: open title: Improve performance of list and tuple repeat methods versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:43:55 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Tue, 22 Mar 2022 12:43:55 +0000 Subject: [issue47091] Improve performance of list and tuple repeat methods In-Reply-To: <1647952670.83.0.274983393245.issue47091@roundup.psfhosted.org> Message-ID: <1647953035.33.0.598585734223.issue47091@roundup.psfhosted.org> Change by Pieter Eendebak : ---------- keywords: +patch pull_requests: +30135 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32045 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:53:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 12:53:59 +0000 Subject: [issue47084] Statically allocated Unicode objects leak cached representations In-Reply-To: <1647887872.48.0.319313487677.issue47084@roundup.psfhosted.org> Message-ID: <1647953639.47.0.376306563807.issue47084@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 88872a29f19092d2fde27365af230abd6d301941 by Jeremy Kloth in branch 'main': bpo-47084: Clear Unicode cached representations on finalization (GH-32032) https://github.com/python/cpython/commit/88872a29f19092d2fde27365af230abd6d301941 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:54:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 12:54:36 +0000 Subject: [issue47084] Statically allocated Unicode objects leak cached representations In-Reply-To: <1647887872.48.0.319313487677.issue47084@roundup.psfhosted.org> Message-ID: <1647953676.05.0.190932934752.issue47084@roundup.psfhosted.org> STINNER Victor added the comment: > The newly implemented statically allocated Unicode objects do not clear their cached representations (wstr and utf-8) at exit causing leaked blocks at exit (see also issue46857). Good job to discover this single leaking memory allocation!!! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:55:03 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 12:55:03 +0000 Subject: [issue46857] Python leaks one reference at exit on Windows In-Reply-To: <1645808231.81.0.426207041717.issue46857@roundup.psfhosted.org> Message-ID: <1647953703.32.0.793074511997.issue46857@roundup.psfhosted.org> STINNER Victor added the comment: The last leak of a memory block on Windows was fixed by: New changeset 88872a29f19092d2fde27365af230abd6d301941 by Jeremy Kloth in branch 'main': bpo-47084: Clear Unicode cached representations on finalization (GH-32032) https://github.com/python/cpython/commit/88872a29f19092d2fde27365af230abd6d301941 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 08:57:28 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 12:57:28 +0000 Subject: [issue47045] Remove the RESUME instruction In-Reply-To: <1647534190.7.0.0573728232462.issue47045@roundup.psfhosted.org> Message-ID: <1647953848.15.0.375816765283.issue47045@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 49daf6dba8178c5ae5d4d65408b20566d39c36a8 by Mark Shannon in branch 'main': bpo-47045: Remove `f_state` field (GH-31963) https://github.com/python/cpython/commit/49daf6dba8178c5ae5d4d65408b20566d39c36a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:06:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 22 Mar 2022 13:06:13 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647954373.96.0.792204109015.issue45150@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30136 pull_request: https://github.com/python/cpython/pull/32046 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:11:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 13:11:35 +0000 Subject: [issue25489] sys.exit() caught in async event loop exception handler In-Reply-To: <1445945156.1.0.415307859083.issue25489@psf.upfronthosting.co.za> Message-ID: <1647954695.02.0.124524006992.issue25489@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:13:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 13:13:43 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647954823.36.0.410481807085.issue47000@roundup.psfhosted.org> STINNER Victor added the comment: > Is it safe to use `locale.getlocale(locale.LC_CTYPE)[1] or "UTF-8"`? I would like to deprecate getlocale(), see bpo-43557. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:18:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 13:18:22 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647955102.32.0.512284263183.issue47000@roundup.psfhosted.org> STINNER Victor added the comment: > But some user want to use UTF-8 mode to change default encoding in their Python environments without waiting Python default encoding changed. IMO it's a different use case and it should be a different thing. Changing encoding="locale" today is too late, since it's already shipped in Python 3.10 (PEP 597). I proposed the "current locale" name to distinguish it from the existing "locale": * "current locale": LC_CTYPE locale encoding or ANSI code page * "locale": "UTF-8" in UTF-8 Mode, or the current locale The unclear part to me is if "current locale" must change if the LC_CTYPE locale is changed, or if it should be read once at startup and then never change. There *are* use case to really read the *current* LC_CTYPE locale encoding. There is already C API for that: * PyUnicode_EncodeLocale() * PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() See also the "current_locale" parameter of the private API _Py_EncodeLocaleEx() and _Py_DecodeLocaleEx(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 09:30:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 13:30:06 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1647955806.51.0.282862246298.issue47000@roundup.psfhosted.org> STINNER Victor added the comment: I propose: * sys.getfilesystemencoding(): Python filesystem encoding, return "UTF-8" if the Python UTF-8 Mode is enabled * Implementation: PyConfig.filesystem_encoding * https://docs.python.org/dev/library/sys.html#sys.getfilesystemencoding * https://docs.python.org/dev/glossary.html#term-filesystem-encoding-and-error-handler * https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.filesystem_encoding * locale.getencoding(): Get the locale encoding, LC_CTYPE locale encoding or the Windows ANSI code page, *read at Python startup*. Ignore the Python UTF-8 Mode. * https://docs.python.org/dev/glossary.html#term-locale-encoding * Implementation: _Py_GetLocaleEncoding() * Existing *private* function: _locale._get_locale_encoding() * locale.getencoding(current=True): Get the *current* locale encoding. The difference with locale.getencoding() is that on Unix, it gets the LC_CTYPE locale encoding at each call. * Implementation: _Py_GetLocaleEncoding() modified to ignore the UTF-8 mode. None of these functions do locale.setlocale(locale.LC_CTYPE, "") to get the user preferred encoding. Only the locale.getpreferredencoding() function uses locale.setlocale(locale.LC_CTYPE, ""). Usage of locale.getpreferredencoding() should be discouraged in the documentation, but I don't think that it can be deprecated and scheduled for removal right now: too much code rely on it :-( --- So we have 3 encodings: * Python filesystem encoding * Locale encoding * Current locale encoding Examples of usage: * Python filesystem encoding: * os.fsdecode() / os.fsencode() * C: PyUnicode_EncodeFSDefault() / PyUnicode_DecodeFSDefault() * Locale encoding * _locale._get_locale_encoding() * On Unix, os.device_encoding() * To initialize PyConfig.stdio_encoding and PyConfig.filesystem_encoding * Current locale encoding * PyUnicode_EncodeLocale() / PyUnicode_DecodeLocale() * "current_locale" parameter of private _Py_EncodeLocaleEx() / _Py_DecodeLocaleEx() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:00:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 14:00:33 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647957633.8.0.510246938768.issue47076@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 673755bfbac46b3cd2c84d7e0d68c2c488e039c3 by Andrew Svetlov in branch 'main': bpo-47076: Make asyncio.Queue stable on slow test boxes (GH-32040) https://github.com/python/cpython/commit/673755bfbac46b3cd2c84d7e0d68c2c488e039c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:01:59 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 14:01:59 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647957719.62.0.0441439141424.issue47076@roundup.psfhosted.org> Andrew Svetlov added the comment: Fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:03:00 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 14:03:00 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647957780.7.0.534217866412.issue45997@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 32e77154ddfc514a3144d5912bffdd957246fd6c by Andrew Svetlov in branch 'main': bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) https://github.com/python/cpython/commit/32e77154ddfc514a3144d5912bffdd957246fd6c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:03:20 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 14:03:20 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647957800.15.0.532704017484.issue45997@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +30137 pull_request: https://github.com/python/cpython/pull/32047 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:04:22 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 14:04:22 +0000 Subject: [issue46724] Odd Bytecode Generation in 3.10 In-Reply-To: <1644600146.24.0.968453673832.issue46724@roundup.psfhosted.org> Message-ID: <1647957862.47.0.457044672583.issue46724@roundup.psfhosted.org> Mark Shannon added the comment: I think this is fixed (for 3.11 at least) by https://github.com/python/cpython/pull/31888 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:16:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 14:16:21 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647958581.87.0.351413571907.issue47076@roundup.psfhosted.org> STINNER Victor added the comment: Thank you Andrew! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:20:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 14:20:22 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647958822.49.0.00790848015011.issue45997@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30138 pull_request: https://github.com/python/cpython/pull/32049 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:31:46 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 22 Mar 2022 14:31:46 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1647959506.32.0.179150136273.issue44336@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- pull_requests: +30139 pull_request: https://github.com/python/cpython/pull/32050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:39:18 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 22 Mar 2022 14:39:18 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647959958.47.0.746516258899.issue46788@roundup.psfhosted.org> Jeremy Kloth added the comment: Backports state that they are ready... I'm just a little uneasy as I've never used cherry_picker before. 3.10 went smooth, but 3.9 required manual merging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:41:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 14:41:38 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function Message-ID: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> New submission from STINNER Victor : In Python 3.10, it's possible to call PyFrame_FastToLocalsWithError() on a frame to get all variables as a dictionary. In Python, getting frame.f_locals calls PyFrame_FastToLocalsWithError(). It's used by the pdb module for example: self.curframe_locals = self.curframe.f_locals The PyFrame_FastToLocalsWithError() function has multiple issues: * It's inefficient. * It may create a Python dictionary. * It can fail to add items to the dictionary. * Allocating memory can fail with memory allocation failure. The problem is that a debugger or profiler should not modify a process when it inspects it. It should avoid allocation memory for example. I propose adding a new API to prevent that. In Python 3.11, the PyFrameObject structure became opaque and changed deeply. There are differend kinds of variables stored differently: * Free variables: maybe in frame->f_func->func_closure[index], maybe in frame->localsplus[index] * Fast variable: frame->f_frame->localsplus[index] * Cell variable: also need to call PyCell_GET() Well... Look at _PyFrame_FastToLocalsWithError(), it's quite complicated ;-) I propose to add a new public C API just to get a single variable value: PyObject* PyFrame_GetVar(PyFrameObject *frame, PyObject *name) I prefer to use a PyObject* for the name. You can use PyUnicode_FromString() to get a PyObject* from a const char*. This function would get the value where the variable is stored, it doesn't have a to create a dictionary. Return NULL if the variable doesn't exist. If I understand correctly, it should be possible to ensure that this function would never raise an exception (never "fail"). So it should be possible to call it even if an exception is raised, which is convenient for a debugger. -- I plan to implement this API, but first I would like to make sure that there is an agreement that such API is needed and helpful ;-) -- See also draft PEP 558 and PEP 667 which propose API to *modify* variables and make sure that they remain consistent when they are set and then get. The scope of these PEPs is way wider than the simple propose PyFrame_GetVar() which would be simpler implementation than PyFrame_FastToLocalsWithError(). ---------- components: C API messages: 415776 nosy: Mark.Shannon, ncoghlan, vstinner priority: normal severity: normal status: open title: [C API] Add PyFrame_GetVar(frame, name) function versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:43:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 14:43:42 +0000 Subject: [issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1647960222.17.0.654825496248.issue40421@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-47092: [C API] Add PyFrame_GetVar(frame, name) function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:47:03 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 14:47:03 +0000 Subject: [issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x In-Reply-To: <1647832487.19.0.656994824934.issue47076@roundup.psfhosted.org> Message-ID: <1647960423.9.0.70157877124.issue47076@roundup.psfhosted.org> Andrew Svetlov added the comment: Welcome! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:47:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 14:47:09 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1647960429.42.0.471997567218.issue47092@roundup.psfhosted.org> STINNER Victor added the comment: > In Python 3.10, it's possible to call PyFrame_FastToLocalsWithError() on a frame to get all variables as a dictionary. In 2018, it was decided to *not* document this function: see bpo-19431. In C, It is possible to call PyObject_GetAttrString(frame, "f_locals") to call indirectly _PyFrame_FastToLocalsWithError() and get the dictionary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:53:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 14:53:26 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1647960806.12.0.860299554046.issue47092@roundup.psfhosted.org> STINNER Victor added the comment: Currently, Tools/gdb/libpython.py uses PyFramePtr.iter_locals() which iterates on PyFrameObject.f_frame.localsplus. There is a PyFramePtr.get_var_by_name() function which only checks for frame variables in PyFrameObject.f_frame.localsplus, or look up in globals and builtins. So it only supports some kinds of variables. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:55:59 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 14:55:59 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647960959.38.0.942441608252.issue46788@roundup.psfhosted.org> Eryk Sun added the comment: I implemented a ctypes prototype that replaces the registry-based implementation with the API calls PdhOpenQueryW(), PdhAddEnglishCounterW(), PdhCollectQueryData(), PdhGetRawCounterValue(), and PdhCloseQuery(). I'm attaching the script, but here's the class itself without the ctypes definitions: class WindowsLoadTracker(): """ This class asynchronously reads the system "Processor Queue Length" counter to calculate the system load on Windows. A raw thread is used to avoid interfering with tests of the threading module. """ def __init__(self): self._values = [] self._load = None self._hrunning = kernel32.CreateEventW(None, True, False, None) self._hstopped = kernel32.CreateEventW(None, True, False, None) self._hquery = wintypes.HANDLE() self._hcounter = wintypes.HANDLE() pdh.PdhOpenQueryW(None, None, ctypes.byref(self._hquery)) pdh.PdhAddEnglishCounterW(self._hquery, r"\System\Processor Queue Length", None, ctypes.byref(self._hcounter)) pdh.PdhCollectQueryData(self._hquery) _thread.start_new_thread(self._update_load, (), {}) def _update_load(self, # Localize module access to prevent shutdown errors. WaitForSingleObject=_winapi.WaitForSingleObject, SetEvent=kernel32.SetEvent): # run until signaled to stop while WaitForSingleObject(self._hrunning, 1000): self._calculate_load() # notify stopped SetEvent(self._hstopped) def _calculate_load(self, # Lcalize module access to prevent shutdown errors. PdhCollectQueryData=pdh.PdhCollectQueryData, PdhGetRawCounterValue=pdh.PdhGetRawCounterValue): counter_type = wintypes.DWORD() raw = PDH_RAW_COUNTER() PdhCollectQueryData(self._hquery) PdhGetRawCounterValue(self._hcounter, ctypes.byref(counter_type), ctypes.byref(raw)) if raw.CStatus < 0: return processor_queue_length = raw.FirstValue # Use an exponentially weighted moving average, imitating the # load calculation on Unix systems. # https://en.wikipedia.org/wiki/Load_(computing)#Unix-style_load_calculation # https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average if self._load is not None: self._load = (self._load * LOAD_FACTOR_1 + processor_queue_length * (1.0 - LOAD_FACTOR_1)) elif len(self._values) < NVALUE: self._values.append(processor_queue_length) else: self._load = sum(self._values) / len(self._values) def getloadavg(self): return self._load def close(self, # Localize module access to prevent shutdown errors. WaitForSingleObject=_winapi.WaitForSingleObject, INFINITE=_winapi.INFINITE, SetEvent=kernel32.SetEvent, CloseHandle=_winapi.CloseHandle, PdhCloseQuery=pdh.PdhCloseQuery): if self._hrunning is None: return # Tell the update thread to quit. SetEvent(self._hrunning) # Wait for the update thread to stop before cleanup. WaitForSingleObject(self._hstopped, INFINITE) CloseHandle(self._hrunning) CloseHandle(self._hstopped) PdhCloseQuery(self._hquery) self._hrunning = self._hstopped = None def __del__(self): self.close() return ---------- Added file: https://bugs.python.org/file50695/loadtracker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:56:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 14:56:07 +0000 Subject: [issue45963] Embed interpreter frame in generator. In-Reply-To: <1638448060.39.0.766103367856.issue45963@roundup.psfhosted.org> Message-ID: <1647960967.07.0.916820377174.issue45963@roundup.psfhosted.org> STINNER Victor added the comment: Leak fixed by: commit 064e53d19aea6d6906fa8f7706a2556a2c293ccd Author: Mark Shannon Date: Tue Dec 7 18:05:48 2021 +0000 Fix leak when an exception is raised during generator creation. (GH-29960) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 10:57:35 2022 From: report at bugs.python.org (J Y) Date: Tue, 22 Mar 2022 14:57:35 +0000 Subject: [issue47093] Documentation Fix: Remove .bat when activating venv on windows Message-ID: <1647961054.99.0.629275554112.issue47093@roundup.psfhosted.org> New submission from J Y : https://docs.python.org/3/tutorial/venv.html For windows, tutorial-env\Scripts\activate.bat doesn't appear to set up venv successfully. Instead, tutorial-env\Scripts\activate (without .bat) works. This may confuse new users if this is not rectified. ---------- assignee: docs at python components: Documentation messages: 415783 nosy: docs at python, jovinator priority: normal severity: normal status: open title: Documentation Fix: Remove .bat when activating venv on windows type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:04:47 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 15:04:47 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1647961487.59.0.481065551917.issue47092@roundup.psfhosted.org> Mark Shannon added the comment: I'm looking into adding two new APIs. One to round out the getters for FrameObject and one to introspect the internal frame stack. It would probably make more sense to add this capability to the frame stack API, as it would avoid creating the frame object as well as the locals dictionary. E.g. `PyFrameStack_GetVar(int depth, PyObject *name)` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:09:35 2022 From: report at bugs.python.org (Tk44) Date: Tue, 22 Mar 2022 15:09:35 +0000 Subject: [issue47094] index doesn't change while looping through same elements in a list Message-ID: <1647961775.52.0.996797054137.issue47094@roundup.psfhosted.org> New submission from Tk44 : Let us define a list where there are some duplicate elements. If we loop through that list as "for i in my_list" and print the index by my_list.index(i); the index doesn't change. e.g. my_list = [1,1,1,1,3] for elm in my_list: print(my_list.index(elm)) ==output== 0 0 0 0 4 This occurs where elements are of type string as well. Of course this can be overcome by using enumerate(); however I think this is a wrong behavior. ---------- messages: 415785 nosy: Tugberk priority: normal severity: normal status: open title: index doesn't change while looping through same elements in a list type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:16:00 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 15:16:00 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647962160.91.0.974153776558.issue45997@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 9d59381a5d20157930bae34e5f5a7bc5ef09fa89 by Miss Islington (bot) in branch '3.10': [3.10] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (#32047) https://github.com/python/cpython/commit/9d59381a5d20157930bae34e5f5a7bc5ef09fa89 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:16:39 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 22 Mar 2022 15:16:39 +0000 Subject: [issue45997] asyncio.Semaphore waiters deque doesn't work In-Reply-To: <1638799463.93.0.445533986487.issue45997@roundup.psfhosted.org> Message-ID: <1647962199.42.0.371434912462.issue45997@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset f47984b560f1dafe4d907cef4edadfb1746bf027 by Andrew Svetlov in branch '3.9': [3.9] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (GH-32049) https://github.com/python/cpython/commit/f47984b560f1dafe4d907cef4edadfb1746bf027 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:25:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 15:25:50 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1647962750.08.0.234232209966.issue46836@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30140 pull_request: https://github.com/python/cpython/pull/32051 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:28:05 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 15:28:05 +0000 Subject: [issue42885] Optimize re.search() for \A (and maybe ^) In-Reply-To: <1610315901.41.0.467379667553.issue42885@roundup.psfhosted.org> Message-ID: <1647962885.92.0.742186155148.issue42885@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 492d4109f4d953c478cb48f17aa32adbb912623b by Serhiy Storchaka in branch 'main': bpo-42885: Optimize search for regular expressions starting with "\A" or "^" (GH-32021) https://github.com/python/cpython/commit/492d4109f4d953c478cb48f17aa32adbb912623b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:27:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 15:27:54 +0000 Subject: [issue40065] py39: remove deprecation note for xml.etree.cElementTree In-Reply-To: <1585163379.04.0.795433622529.issue40065@roundup.psfhosted.org> Message-ID: <1647962874.7.0.682249388269.issue40065@roundup.psfhosted.org> Irit Katriel added the comment: > We are currently debating to bring the module back and warn users that it will be removed in 3.10. Doesn't look like it was removed in 3.10. Was this an oversight? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:28:31 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Mar 2022 15:28:31 +0000 Subject: [issue42885] Optimize re.search() for \A (and maybe ^) In-Reply-To: <1610315901.41.0.467379667553.issue42885@roundup.psfhosted.org> Message-ID: <1647962911.42.0.621246736055.issue42885@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:29:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 15:29:45 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1647962985.28.0.855745705236.issue47092@roundup.psfhosted.org> STINNER Victor added the comment: See also: * bpo-46836: [C API] Move PyFrameObject to the internal C API. * bpo-46836: GH-32051 "Add Doc/c-api/frame.rst" * bpo-40421: [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:30:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 15:30:47 +0000 Subject: [issue40421] [C API] Add public getter functions for the internal PyFrameObject structure In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1647963047.09.0.873732821241.issue40421@roundup.psfhosted.org> STINNER Victor added the comment: Issue title: "[C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API" bpo-46836 moved PyFrameObject to the internal C API. I update the issue title. ---------- title: [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API -> [C API] Add public getter functions for the internal PyFrameObject structure versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:32:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 15:32:27 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1647963147.81.0.370523958775.issue47092@roundup.psfhosted.org> STINNER Victor added the comment: If PyFrameStack_GetVar(depth, name) is added, would it make PyFrame_GetVar() irrelevant? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:41:04 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 22 Mar 2022 15:41:04 +0000 Subject: [issue45150] Add a file_digest() function in hashlib In-Reply-To: <1631181797.37.0.346326276713.issue45150@roundup.psfhosted.org> Message-ID: <1647963664.33.0.914759648447.issue45150@roundup.psfhosted.org> Christian Heimes added the comment: New changeset e03db6d5be7cf2e6b7b55284985c404de98a9420 by Christian Heimes in branch 'main': bpo-45150: Fix testing under FIPS mode (GH-32046) https://github.com/python/cpython/commit/e03db6d5be7cf2e6b7b55284985c404de98a9420 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:44:47 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 15:44:47 +0000 Subject: [issue47093] Documentation Fix: Remove .bat when activating venv on windows In-Reply-To: <1647961054.99.0.629275554112.issue47093@roundup.psfhosted.org> Message-ID: <1647963887.39.0.159385024241.issue47093@roundup.psfhosted.org> Eryk Sun added the comment: Running `tutorial-env\Scripts\activate` should suffice. The .bat script is for CMD, and the .ps1 script is for PowerShell. The shell should run the right script without having to include the extension. In Windows 10+, if you use a case-sensitive directory for the virtual environment, note that the script name for PowerShell is "Activate.ps1". PowerShell 7+ checks the directory for any name that case-insensitively matches "activate", but you'll have to run `tutorial-env\Scripts\Activate` in PowerShell 5.1. ---------- components: +Windows keywords: +easy nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware stage: -> needs patch versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 11:51:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 15:51:48 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647964308.0.0.551196607675.issue46850@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30141 pull_request: https://github.com/python/cpython/pull/32052 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:23:05 2022 From: report at bugs.python.org (Ian Good) Date: Tue, 22 Mar 2022 16:23:05 +0000 Subject: [issue38242] Revert the new asyncio Streams API In-Reply-To: <1569020325.08.0.390897413838.issue38242@roundup.psfhosted.org> Message-ID: <1647966185.65.0.784540865785.issue38242@roundup.psfhosted.org> Change by Ian Good : ---------- nosy: +icgood nosy_count: 9.0 -> 10.0 pull_requests: +30142 pull_request: https://github.com/python/cpython/pull/13143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:29:51 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 22 Mar 2022 16:29:51 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1647966591.62.0.812480594674.issue32033@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +christian.heimes nosy_count: 5.0 -> 6.0 pull_requests: +30143 pull_request: https://github.com/python/cpython/pull/32053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:37:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 16:37:07 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1647967027.24.0.147745008322.issue46850@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30144 pull_request: https://github.com/python/cpython/pull/32054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:50:02 2022 From: report at bugs.python.org (Vladimir Matveev) Date: Tue, 22 Mar 2022 16:50:02 +0000 Subject: [issue46965] Enable informing callee it's awaited via vector call flag In-Reply-To: <1646786244.6.0.865955728693.issue46965@roundup.psfhosted.org> Message-ID: <1647967802.82.0.244366912836.issue46965@roundup.psfhosted.org> Vladimir Matveev added the comment: - introducing dedicated opcodes for each kind of awaited call is definitely an option. In fact first implementation used it however as Dino has mentioned it was more of a logistical issue (there were several spots that produced .pyc files so compiler needed to be up to date across all of them). - there was some perf win that was coming from rewriting `gather` in C however main reason for us to do it was the ability to be await-aware which we made only available in C (also returning completed waithandle is not exposed to Python either) to reduce the scope. Providing ability to follow await-aware protocol (read indicator that call is awaited + return completed waithandle for eagerly completed calls) in pure Python is definitely possible - to provide some context why it was beneficial: typical implementation of endpoint in IG is an async function that in turn calls into numerous other async functions to generate an output. - `gather` is used all over the place in case if there are no sequential dependency between calls - amount of unique pieces of data that are ultimately fetched by async calls is not very big, i.e. the same fragment of information can be requested by different async calls which makes memoization a very attractive strategy to reduce I/O and heavyweight computations. - memoized pieces of data is represented effectively by completed futures and it is very common to have `gather` accept either memoized value or coroutine object that will be completed synchronously by awaiting memoized value. Before making gather await-aware if always have to follow the standard process and convert awaitables into tasks that are queued into the event loop for execution. In our workload task creation/queueing were adding a noticeable overhead. With await-aware gather we can execute coroutine objects eagerly and if they were not suspended - bypass task creation entirely. ``` import asyncio import time async def step(i): if i == 0: return await asyncio.gather(*[step(i - 1) for _ in range(6)]) async def main(): t0 = time.perf_counter() await step(6) t1 = time.perf_counter() print(f"{t1 - t0} s") N = 0 def create_task(loop, coro): global N N += 1 return asyncio.Task(coro, loop=loop) loop = asyncio.get_event_loop() loop.set_task_factory(create_task) loop.run_until_complete(main()) print(f"{N} tasks created") # Cinder # 0.028410961851477623 s # 1 tasks created # Python 3.8 # 1.2157012447714806 s # 55987 tasks created ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 12:55:33 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 16:55:33 +0000 Subject: [issue42917] Block stack size for frame objects should be dynamically sizable In-Reply-To: <1610502849.77.0.30833881241.issue42917@roundup.psfhosted.org> Message-ID: <1647968133.6.0.458290143784.issue42917@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +30145 pull_request: https://github.com/python/cpython/pull/32055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:21:32 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 17:21:32 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1647969692.62.0.785294652064.issue44336@roundup.psfhosted.org> Steve Dower added the comment: New changeset 8146e6b636905d9872140c990d93308ac20d13f0 by Jeremy Kloth in branch '3.10': bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578) https://github.com/python/cpython/commit/8146e6b636905d9872140c990d93308ac20d13f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:21:39 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 17:21:39 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1647969699.85.0.941415045634.issue44336@roundup.psfhosted.org> Steve Dower added the comment: New changeset 8db7610d1a7b1f90631bac26261338f27bd20727 by Jeremy Kloth in branch '3.9': bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578) https://github.com/python/cpython/commit/8db7610d1a7b1f90631bac26261338f27bd20727 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:21:55 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 17:21:55 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1647969715.98.0.806271454144.issue44336@roundup.psfhosted.org> Steve Dower added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:22:32 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 17:22:32 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647969752.33.0.936673025666.issue46788@roundup.psfhosted.org> Steve Dower added the comment: Backports have been merged ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:36:10 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 22 Mar 2022 17:36:10 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1647970570.35.0.123572606962.issue44336@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- pull_requests: +30146 pull_request: https://github.com/python/cpython/pull/32048 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:42:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 22 Mar 2022 17:42:26 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1647970946.6.0.357115441567.issue32033@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 4aea656d62860e78cd8384f2de375f0d4f1db579 by Christian Heimes in branch 'main': bpo-32033: Finalize WASI configure options (GH-32053) https://github.com/python/cpython/commit/4aea656d62860e78cd8384f2de375f0d4f1db579 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 13:54:49 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Mar 2022 17:54:49 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1647971689.53.0.892419737253.issue42197@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +30147 pull_request: https://github.com/python/cpython/pull/32055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:09:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 18:09:13 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1647972553.18.0.790776081205.issue42197@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-47092: [C API] Add PyFrame_GetVar(frame, name) function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:09:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Mar 2022 18:09:23 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1647972563.15.0.820676019062.issue47092@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-42197: Disable automatic update of frame locals during tracing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:13:04 2022 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Mar 2022 18:13:04 +0000 Subject: [issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd In-Reply-To: <1647329278.28.0.312815777301.issue47022@roundup.psfhosted.org> Message-ID: <1647972784.01.0.188320161589.issue47022@roundup.psfhosted.org> Brett Cannon added the comment: New changeset af341ebf00d9a45cadea4c07810564d8e8962b96 by Hugo van Kemenade in branch '3.9': [3.9] bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 (GH-31891) (#31998) https://github.com/python/cpython/commit/af341ebf00d9a45cadea4c07810564d8e8962b96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:27:30 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 22 Mar 2022 18:27:30 +0000 Subject: [issue47094] index doesn't change while looping through same elements in a list In-Reply-To: <1647961775.52.0.996797054137.issue47094@roundup.psfhosted.org> Message-ID: <1647973650.41.0.935972206508.issue47094@roundup.psfhosted.org> Dennis Sweeney added the comment: The help text says this: >>> help(list.index) Help on method_descriptor: index(self, value, start=0, stop=9223372036854775807, /) Return first index of value. Raises ValueError if the value is not present. Emphasis on *first* index. Example: >>> L = [0, 10, 20, 33, 0, 10] >>> L.index(10) 1 >>> L[5] 10 >>> L.index(L[5]) # the same meaning as L.index(10) 1 In your code, when elm has the value 1, it's just the value 1; there's no extra information carried along about where that 1 came from. If elm == 1, then my_list.index(elm) means the same as my_list.index(1). I'd suggest taking any further questions to either StackOverflow or https://discuss.python.org/c/users/ Thanks for the concern, but I'm closing this as "not a bug". Changing this behavior now would be backwards-incompatible and break lots of people's code. ---------- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:28:58 2022 From: report at bugs.python.org (Tiger) Date: Tue, 22 Mar 2022 18:28:58 +0000 Subject: [issue35540] dataclasses.asdict breaks with defaultdict fields In-Reply-To: <1545257204.19.0.788709270274.issue35540@psf.upfronthosting.co.za> Message-ID: <1647973738.08.0.643551937615.issue35540@roundup.psfhosted.org> Change by Tiger : ---------- nosy: +kwsp nosy_count: 7.0 -> 8.0 pull_requests: +30148 pull_request: https://github.com/python/cpython/pull/32056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 14:55:53 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Tue, 22 Mar 2022 18:55:53 +0000 Subject: [issue47091] Improve performance of list and tuple repeat methods In-Reply-To: <1647952670.83.0.274983393245.issue47091@roundup.psfhosted.org> Message-ID: <1647975353.01.0.619017332716.issue47091@roundup.psfhosted.org> Pieter Eendebak added the comment: The special case of a repeat with n=1 does not use memcpy. An implementation with it showed no performance improvement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:19:04 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 19:19:04 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1647976744.54.0.630501485177.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: hashlib creator and other maintainer here: I do not think it was a good idea for us to add blake2 to hashlib the way we did. So blake3 should not be presumed as a given, at least not done in the same manner. Background: While OpenSSL gained _some_ blake2 support in 2016, around when we were adding it to hashlib (not a coincidence), we made a mistake: We offered an overly complex API. OpenSSL's own support for blake2 is a subset, not sufficient to be used as a replacement for the API we exposed so we are stuck with our vendored copy with no easy way off. https://github.com/openssl/openssl/issues/980 OpenSSL is not going to gain native blake3 support. https://github.com/openssl/openssl/issues/11613 Given that I don't want to see us gain new vendored copies of significant but non-critical third party hash code in our tree (Modules/_blake3/impl/ in PR 31686) for anything but a known fixed term need (ex: the sha2 libtomcrypt code is gone from our tree as was clearly going to happen from the start), the only way I think we should include blake3 support is if there is already a plan for that code to leave our tree in the future with a high probability of success. A `configure.ac` check for an installed blake3 library to build and link against would be appropriate. Along with updating relevant CI systems and Windows and macOS release build systems to have that available. That'd significantly shrink the PR to reasonable size. This means blake3 support should be considered optional as anyone doing their own CPython build may not have it. This is primarily a documentation issue: list it as such and provide one official documented API to detect its availability. Our binary releases will include it as will most OS distro packagers. It also means implementation details, performance and platform tuning are **not our problem** but those of the OS distro or external library provider. Regarding setup.py, what Christian says is true, that is on its way out. Do not add new non-trivial statements to it as that just creates more work for those working to untangle the mess. Getting rid of the /impl/ build in favor of an autoconf detected library gets rid of that mess. I'll file a separate issue to track moving blake2 in the same direction so we can lose it's /impl/. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:51:17 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 22 Mar 2022 19:51:17 +0000 Subject: [issue47095] Deprecate blake2's tree hashing feature Message-ID: <1647978677.39.0.283744368692.issue47095@roundup.psfhosted.org> New submission from Christian Heimes : Python's blake2 implementation provides hashing, MAC (key, salt, personalization), variable length output, and tree hashing [1]. All features except for tree hashing are provided by OpenSSL 3.0.0 and newer [2]. It is unlikely that OpenSSL will get tree hashing any time soon, if all. [3] I would like to remove our vendored copy of blake2 eventually and just rely on OpenSSL. Therefore I propose to deprecate tree hashing feature so we can drop it in Python 3.13. The tree hashing parameters are: fanout, depth, leaf_size, node_offset, node_depth, inner_size, last_node Note: OpenSSL 3.0 might impose additional restrictions on the parameter. It might be possible that OpenSSL does not support salt and personalization (OSSL_MAC_PARAM_CUSTOM) without a MAC key. Alternatively we could replace our copy of blake2 and depend on libb2 from https://blake2.net/. libb2 is available in Fedora. [1] https://docs.python.org/3/library/hashlib.html#hashlib.blake2b [2] https://www.openssl.org/docs/manmaster/man7/EVP_MAC-BLAKE2.html [3] https://github.com/openssl/openssl/issues/980 ---------- components: Extension Modules messages: 415807 nosy: christian.heimes, gregory.p.smith priority: normal severity: normal status: open title: Deprecate blake2's tree hashing feature type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:51:28 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 19:51:28 +0000 Subject: [issue47096] Use the PDH API in WindowsLoadTracker Message-ID: <1647978688.65.0.802147114053.issue47096@roundup.psfhosted.org> New submission from Eryk Sun : In bpo-44336, a new version of WindowsLoadTracker was implemented in Lib/test/libregrtest/win_utils.py. This version resolves issues with the previous implementation that spawned typeperf.exe. The new implementation uses the registry API's HKEY_PERFORMANCE_DATA pseudohandle to access the performance counters. This requires hard-coding "2" as the key name of the system object, 44 as the index of the "Processor Queue Length" counter, and also several struct definitions. The HKEY_PERFORMANCE_DATA 'key' just wraps the API as an alternate way to consume counter data. Instead of taking this detour through a minimalist interface just to use the API in a roundabout way, it would be better to implement a few of the Performance Data Helper functions in _winapi. I've implemented a prototype in ctypes to demonstrate this, which I'm attaching as "loadtracker.py". The functions that would need to be implemented are PdhOpenQueryW(), PdhAddEnglishCounterW(), PdhCollectQueryData(), PdhGetRawCounterValue(), and PdhCloseQuery(). ---------- components: Windows files: loadtracker.py messages: 415808 nosy: eryksun, jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Use the PDH API in WindowsLoadTracker type: enhancement Added file: https://bugs.python.org/file50696/loadtracker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:51:47 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 19:51:47 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647978707.59.0.959582844026.issue46788@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg415781 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 15:51:55 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 19:51:55 +0000 Subject: [issue46788] regrtest fails to start on missing performance counter names In-Reply-To: <1645202169.41.0.134197812756.issue46788@roundup.psfhosted.org> Message-ID: <1647978715.44.0.815983063092.issue46788@roundup.psfhosted.org> Change by Eryk Sun : Removed file: https://bugs.python.org/file50695/loadtracker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 16:08:54 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 20:08:54 +0000 Subject: [issue47090] Make zlib required on all platforms (simplifies code) In-Reply-To: <1647938333.52.0.126058309361.issue47090@roundup.psfhosted.org> Message-ID: <1647979734.3.0.881589682781.issue47090@roundup.psfhosted.org> Gregory P. Smith added the comment: Bringing this up on discord, others point out that the windows build requires zlib for convenience when we transitioned from having a vendored copy in our repo and that smaller "embedded" use cases may not like this if they don't already need the dep. But there have been no complaints about it on the Windows side. `binascii.crc32` was one thing that motivated me to look into "just require zlib" to get out of carrying our own suboptimal crc32 code. along those lines, we should recommend people choose https://github.com/zlib-ng/zlib-ng rather than zlib.net for better performance. looking over my PR, it can make for some awkward code with zlib right next to others that we treat as optionals. good bad or indifferent? i'm leaning towards indifferent and still enjoying fewer lines of code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 16:50:57 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 22 Mar 2022 20:50:57 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1647982257.87.0.303827725595.issue46712@roundup.psfhosted.org> Eric Snow added the comment: > After a new `&_Py_ID(__orig_class__)` is added to Objects/genericaliasobject.c, running `make regen-global-objects` starts > > gcc -pthread -c [snipped] -DPy_BUILD_CORE -o Objects/genericaliasobject.o Objects/genericaliasobject.c > > which fails with a compilation error because that identifier is not yet defined. Is there a good way to convince `make` to regenerate the global objects without this sort of circular dependency? Am I missing a step? I'm looking into this. A temporary workaround is to run Tools/scripts/generate-global-objects.py directly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 16:50:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 20:50:47 +0000 Subject: [issue17733] Add tests to test__header_value_parser for RFC 2231 parsing code Message-ID: <1647982247.3.0.524832327607.issue17733@roundup.psfhosted.org> New submission from Irit Katriel : I believe this is about smtpd, which is now deprecated under PEP 594. So I think we can close it. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:01:19 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 22 Mar 2022 21:01:19 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647982879.44.0.812720294501.issue2604@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 7ba7eae50803b11766421cb8aae1780058a57e2b by Dani?l van Noord in branch 'main': bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932) https://github.com/python/cpython/commit/7ba7eae50803b11766421cb8aae1780058a57e2b ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:01:27 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 21:01:27 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647982887.44.0.889283769967.issue2604@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +30149 pull_request: https://github.com/python/cpython/pull/32057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:02:00 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 21:02:00 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647982920.56.0.210230896075.issue2604@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30150 pull_request: https://github.com/python/cpython/pull/32058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:13:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 21:13:10 +0000 Subject: [issue22260] Rearrange tkinter tests, use test discovery In-Reply-To: <1408824639.7.0.685120896496.issue22260@psf.upfronthosting.co.za> Message-ID: <1647983590.78.0.918049696887.issue22260@roundup.psfhosted.org> Irit Katriel added the comment: The patch looks very out of date. Let mw know if it's still needed, otherwise I'll close. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:24:56 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 21:24:56 +0000 Subject: [issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday In-Reply-To: <1320300850.58.0.556745870791.issue13330@psf.upfronthosting.co.za> Message-ID: <1647984296.89.0.735458292419.issue13330@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be reviewed. If the tests are still relevant and increase coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be closed. ---------- keywords: +easy -needs review, patch nosy: +iritkatriel versions: +Python 3.11 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:27:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 21:27:14 +0000 Subject: [issue25528] Attempt to further increase test coverage of calendar module In-Reply-To: <1446371863.84.0.773420016182.issue25528@psf.upfronthosting.co.za> Message-ID: <1647984434.5.0.263145240173.issue25528@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be reviewed. If the tests are still relevant and increase coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be closed. See also issue13330. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:27:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 21:27:37 +0000 Subject: [issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday In-Reply-To: <1320300850.58.0.556745870791.issue13330@psf.upfronthosting.co.za> Message-ID: <1647984457.7.0.559047310696.issue13330@roundup.psfhosted.org> Irit Katriel added the comment: See also issue25528. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:27:38 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 21:27:38 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647984458.84.0.354352978961.issue2604@roundup.psfhosted.org> miss-islington added the comment: New changeset 3c6019035f16b673cf0f0be6918f7d5493e5690e by Miss Islington (bot) in branch '3.9': bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932) https://github.com/python/cpython/commit/3c6019035f16b673cf0f0be6918f7d5493e5690e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:32:02 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Mar 2022 21:32:02 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1647984722.33.0.231679025185.issue2604@roundup.psfhosted.org> miss-islington added the comment: New changeset f163ad22d3321cb9bb4e6cbaac5a723444641565 by Miss Islington (bot) in branch '3.10': bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932) https://github.com/python/cpython/commit/f163ad22d3321cb9bb4e6cbaac5a723444641565 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:35:06 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 22 Mar 2022 21:35:06 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647984906.3.0.608545936159.issue47086@roundup.psfhosted.org> Ned Deily added the comment: If you remove the .chm file from the Windows installer, I believe IDLE needs to be updated to look for the installed html files instead (see Lib/idlelib/editor.py). And does this mean we should no longer produce .chm files at all for 3.11+? If so, there is work to be done in the Doc section of the repo (Makefile, make.bat, README.rst tools/* all have references to .chm and .hhp files). I guess other than the references to chm files in the docs, this change would not otherwise affect the on-line docs building system. (Nosying Terry and Julien as subject experts.) ---------- nosy: +mdk, ned.deily, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:42:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 21:42:01 +0000 Subject: [issue27132] New assert method that checks an error message for a list of strings In-Reply-To: <1464295693.41.0.439639952512.issue27132@psf.upfronthosting.co.za> Message-ID: <1647985321.39.0.511149762395.issue27132@roundup.psfhosted.org> Irit Katriel added the comment: > Personally I'd write multiple asserts rather than regex permutations. I would too, because then when one of them fails it's clear which of the strings is missing. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 17:55:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 21:55:07 +0000 Subject: [issue13670] Increase test coverage for pstats.py In-Reply-To: <1325081609.19.0.540376222409.issue13670@psf.upfronthosting.co.za> Message-ID: <1647986107.94.0.889193697998.issue13670@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be reviewed. If the tests are still relevant and increase coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be closed. ---------- keywords: +easy, newcomer friendly -patch nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:03:46 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 22:03:46 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647986626.89.0.832367623823.issue47086@roundup.psfhosted.org> Steve Dower added the comment: Good call on IDLE, I didn't even think to check there (there is a registry key that points at the documentation if it was installed, which would be the best approach for IDLE to use). The makefiles don't urgently need to remove those references. If people still want to build it, they're welcome to [try]. It gives people with their own build processes a chance to adapt - we can remove it all later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:05:36 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 22:05:36 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1647986736.71.0.520806667567.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: correction: our md5/sha1/sha2/sha3 code is not gone yet, but they are simple C implementations used as a fallback when the provider of optimal versions are unavailable (openssl for those). That keeps the copies of code in our tree simple and most people use the optimal library version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:06:41 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 22:06:41 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647986801.61.0.267069224357.issue47086@roundup.psfhosted.org> Steve Dower added the comment: For the registry key, reading the default value from key "HKCU\Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation" (or HKLM - no need to worry about the Wow6432Node bit here) and passing it to os.startfile() will work for all active releases. If the key is missing, so are the local docs, so falling back to the web docs is a fine option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:07:27 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 22:07:27 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647986847.06.0.997283779425.issue47086@roundup.psfhosted.org> Steve Dower added the comment: The key is defined at https://github.com/python/cpython/blob/main/Tools/msi/doc/doc.wxs#L17 and is not set for a Store install at all. But we don't include the docs in that either - go straight to the web. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:09:19 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 22 Mar 2022 22:09:19 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1647986959.58.0.393060894808.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: Inada, you're right. Good catch. I think I missed that behavior from before because I used `grep ERROR` and when I ran it this time, I just assumed the output would be the same, but it's clear that even _with descriptions enabled_, the location of the test is clearly reported in the case of launching with `-m unittest`. I'm now suspicious that my report in https://bugs.python.org/issue46126#msg408882 was also flawed as it uses `grep ERROR`, which could easily mask lines that adjacent to the error. I now believe that there are no concerns relating to Terry's concern, and likely not Brett's concern despite my best efforts to replicate. I'll bring back the original example and see if it in fact has the reported defect. ---------- assignee: terry.reedy -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:15:39 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 22:15:39 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647987339.47.0.754715522478.issue47086@roundup.psfhosted.org> Eryk Sun added the comment: Do you have any thoughts about distributing the docs in ePub format? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:20:11 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 22 Mar 2022 22:20:11 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647987611.4.0.612064740259.issue47086@roundup.psfhosted.org> Ned Deily added the comment: At a minimum, though, Doc/tools/templates/download.html should be changed to remove the chm reference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:20:58 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 22 Mar 2022 22:20:58 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647987339.47.0.754715522478.issue47086@roundup.psfhosted.org> Message-ID: <8e9284b3-2dfa-7171-4501-59a9ad1347d6@python.org> Steve Dower added the comment: > Do you have any thoughts about distributing the docs in ePub format? If Windows includes a reader for all supported versions, and it's easy to build, sure. But I don't think the first bit is true. Most people are going to be fairly comfortable with their default browser, and many are going to greatly prefer it. I think loose HTML files is a good option from every POV other than being a large number of loose files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:23:21 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 22 Mar 2022 22:23:21 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647987801.38.0.319460942456.issue47086@roundup.psfhosted.org> Ned Deily added the comment: > Do you have any thoughts about distributing the docs in ePub format? Note that it's *much* easier to manufacture the docs in html format than it is in ePub format. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:26:12 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 22 Mar 2022 22:26:12 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647987972.02.0.665212849558.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: I ran into this same issue. I notice that gettext is a dependency of git, so a common dependency when developing. Is there perhaps a way that CPython could be made to ignore gettext on macos Silicon or to detect an incompatible platform and thus ignore it? ---------- nosy: +jaraco status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:28:56 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 22 Mar 2022 22:28:56 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647988136.24.0.550847646236.issue46975@roundup.psfhosted.org> Ned Deily added the comment: There shouldn't be a problem as long as gettext is properly installed on an M1 Mac, i.e. with an arm64 arch or a universal build that includes arm64. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:30:09 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Mar 2022 22:30:09 +0000 Subject: [issue47095] Deprecate blake2's tree hashing feature In-Reply-To: <1647978677.39.0.283744368692.issue47095@roundup.psfhosted.org> Message-ID: <1647988209.56.0.273624867742.issue47095@roundup.psfhosted.org> Gregory P. Smith added the comment: In the short term we should prefer libb2 linkage when available. As for deprecation, it'd be useful to research how often the options going away are used in code in PyPI packages and in Github repos to understand the deprecation impact. The PyPI landscape for blake2 modules is not great because we've had it in hashlib for a while. One of those, or a new one, would need to be created by someone who needs the non openssl features. ultimate goal: simplify what's in Modules/_blake2/impl/ if it cannot be removed. Use an external library for the implementation when possible (and in all our binary releases. Those are better maintained to take advantage of performance or hw features over time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:32:23 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 22 Mar 2022 22:32:23 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1647988343.55.0.425558898039.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: And indeed, after removing the `grep ERROR` part of the repro, even the repro seems to be invalid: ``` cpython main $ ./python.exe -m test.test_importlib -v -k test_entry_points_unique test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests) Entry points should only be exposed for the first package ... ERROR test.test_importlib.test_windows (unittest.loader.ModuleSkipped) ... skipped "No module named 'winreg'" ====================================================================== ERROR: test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests) Entry points should only be exposed for the first package ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/jaraco/code/public/cpython/Lib/test/test_importlib/test_metadata_api.py", line 97, in test_entry_points_unique_packages raise ValueError("Failing on purpose") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: Failing on purpose ---------------------------------------------------------------------- Ran 2 tests in 0.006s FAILED (errors=1, skipped=1) ``` I'm effectively unable to replicate the behavior reported by Brett in the other issue (unless `| grep ERROR` is consider an important use-case to support). At this point, I propose one of two options: 1. Back out PR 30194 and restore the prior behavior with descriptions. 2. Leave PR 30194 to suppress descriptions for the default runner. And then simply declare that docstrings are acceptable for CPython tests. Given that descriptions are on by default, I'm slightly inclined toward (1). Thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:36:54 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 22 Mar 2022 22:36:54 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647988614.07.0.472569522828.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: Well, I'm using a mac with gettext installed as part of `brew install git` with homebrew installed using the standard procedure. Only after running `brew remove --ignore-dependencies gettext` and re-running configure/make did the command build, but doing so also broke features of git (I noticed that the branch name disappeared from my shell). I was able to reinstall git and gettext, but then configure/make failed. Do you have any advice on how to "properly install" gettext using homebrew on an M1 mac? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:44:09 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 22 Mar 2022 22:44:09 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647989049.22.0.564519223567.issue46975@roundup.psfhosted.org> Ned Deily added the comment: This also applies to any other third-party library that a cpython build may link to, like the OpenSSL libs. Some legacy tools that depend on them may work in Rosetta 2 Intel-64 emulation mode on an Apple Silicon Mac but eventually that will go away so it is important to move away from any inadvertent Rosetta dependencies. I don't use Homebrew myself but a quick web search comes up with a number of hits on how to proceed. It looks like the general idea is to save your list of installed brew packages, reinstall the base homebrew to install Apple Silicon native versions, and then reinstall the top-level packages you had and want and you should be good to go from there on. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:50:57 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 22 Mar 2022 22:50:57 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1647989457.78.0.0701450016708.issue47086@roundup.psfhosted.org> Change by Eryk Sun : ---------- nosy: -eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 18:53:09 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 22 Mar 2022 22:53:09 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1647989589.27.0.596022059999.issue46712@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +30151 pull_request: https://github.com/python/cpython/pull/32061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:00:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 23:00:05 +0000 Subject: [issue36692] Unexpected stderr output from test_sys_settrace In-Reply-To: <1555853588.91.0.708286420314.issue36692@roundup.psfhosted.org> Message-ID: <1647990004.99.0.903489403447.issue36692@roundup.psfhosted.org> Irit Katriel added the comment: I'm not seeing this output when I run the test. Are you still seeing it? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:07:28 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 23:07:28 +0000 Subject: [issue22608] test_socket fails with sem_init: Too many open files In-Reply-To: <1413026581.56.0.334221063135.issue22608@psf.upfronthosting.co.za> Message-ID: <1647990448.38.0.257409597733.issue22608@roundup.psfhosted.org> Irit Katriel added the comment: I think this was fixed in issue45212. ---------- nosy: +iritkatriel resolution: -> duplicate status: open -> pending superseder: -> Dangling threads in skipped tests in test_socket _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:20:19 2022 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 22 Mar 2022 23:20:19 +0000 Subject: [issue46114] OpenSSL 3.0 uses different version scheme In-Reply-To: <1639738279.91.0.163233406525.issue46114@roundup.psfhosted.org> Message-ID: <1647991219.2.0.612991421138.issue46114@roundup.psfhosted.org> Charalampos Stratakis added the comment: Case in point: https://buildbot.python.org/all/#/builders/355/builds/338 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:33:56 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 22 Mar 2022 23:33:56 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1647992036.56.0.679419692155.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: SG. Thanks for the advice. I'll dive in and experiment and report back when I have progress. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 19:34:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Mar 2022 23:34:33 +0000 Subject: [issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod In-Reply-To: <1427087434.95.0.234111642557.issue23743@psf.upfronthosting.co.za> Message-ID: <1647992073.54.0.399683984115.issue23743@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:04:35 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 23 Mar 2022 00:04:35 +0000 Subject: [issue672115] Assignment to __bases__ of direct object subclasses Message-ID: <1647993875.94.0.781923954208.issue672115@roundup.psfhosted.org> Change by G?ry : ---------- nosy: +maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:04:55 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 00:04:55 +0000 Subject: [issue37901] 21 tests fail when run on an IPv6-only host In-Reply-To: <1566340883.47.0.899841913634.issue37901@roundup.psfhosted.org> Message-ID: <1647993895.11.0.504151027322.issue37901@roundup.psfhosted.org> Gregory P. Smith added the comment: Here's how I created an IPv6-only host: https://gist.github.com/gpshead/f4f394593674e5f7a58e9424b4dba989 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:08:37 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 23 Mar 2022 00:08:37 +0000 Subject: [issue672115] Assignment to __bases__ of direct object subclasses Message-ID: <1647994117.85.0.260240074638.issue672115@roundup.psfhosted.org> Change by G?ry : ---------- versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:17:12 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 23 Mar 2022 00:17:12 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1647994632.12.0.504187056038.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: > Given that I don't want to see us gain new vendored copies of > significant but non-critical third party hash code in our tree > (Modules/_blake3/impl/ in PR 31686) for anything but a known > fixed term need (ex: the sha2 libtomcrypt code is gone from > our tree as was clearly going to happen from the start), > the only way I think we should include blake3 support is if > there is already a plan for that code to leave our tree in > the future with a high probability of success. You've said what you want, but not why. It sounds like you are against merging the BLAKE3 PR containing its own impl. Why? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:35:32 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 00:35:32 +0000 Subject: [issue43166] Unused letters in Windows-specific pragma optimize In-Reply-To: <1612813717.65.0.159919254593.issue43166@roundup.psfhosted.org> Message-ID: <1647995732.18.0.171298059486.issue43166@roundup.psfhosted.org> Steve Dower added the comment: New changeset cd05d0a423d97be69f9de4650f68f89e99ad68d1 by neonene in branch 'main': bpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023) https://github.com/python/cpython/commit/cd05d0a423d97be69f9de4650f68f89e99ad68d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:37:13 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 00:37:13 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647995833.57.0.192427859207.issue46566@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +30152 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32062 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:41:25 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 00:41:25 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1647996085.83.0.347900718658.issue46566@roundup.psfhosted.org> Steve Dower added the comment: Posted my WIP as a draft PR. I'm still adding docs, tests and ironing out minor issues, but the core functionality is there (as well as some added bonuses). Feel free to review, and importantly to mark anywhere you'd like more explanatory comments. Currently the main known issue is that the "-3-32" (and now-deprecated "-3-64") arguments are not supported. But they will be! There are also likely to be a range of shebang templates that need better handling, and I'll go through the open issues to see what ought to be fixed there compared to today's version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 20:56:28 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 23 Mar 2022 00:56:28 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1647996988.14.0.0461700963423.issue46964@roundup.psfhosted.org> Eric Snow added the comment: Here are reasons why PyConfig relates to the runtime and not each interpreter: * PyConfig was introduced so embedders could dictate how the *runtime* should be initialized * after initialization, it represents how the runtime was initialized * in the public API, PyConfig relates only to the runtime * more than a few PyConfig fields are specific to the entire runtime and not appropriate on a per-interpreter basis * such PyConfig fields are only used during runtime init * currently, every interpreter uses (a copy of) the original PyConfig, completely unchanged * there is no API for creating an interpreter with a different config * most of the things that one might want to customize on an interpreter can already be done right after the interpreter is initialized * thus far we have had no actual use cases for initializing an interpreter with a different config * for many of the PyConfig fields, allowing different values for each interpreter is an attractive nuisance and would invite confusion This is why PyConfig makes more sense as the global config, not a per-interpreter one. I think it was a mistake to store the config on PyInterpreterState. Keep in mind, though, that PyConfig was added several years before _PyRuntimeState existed. If _PyRuntimeState had been around, I'm sure that's where we would have kept the global config. Thus, it makes sense to move PyInterpreterState.config to _PyRuntimeState.config. If there's a need for a per-interpreter config later, we would do the following: * add a new PyInterpreterConfig with only the fields we need * add a new PyInterpreterState.config field of that type In fact, that is exactly what I'm proposing in PEP 684, where there is a need for creating an interpreter with various isolation options. That's what got me thinking about why PyConfig isn't good for customizing new interpreters. Even if we didn't move PyInterpreterState.config to _PyRuntimeState.config, PEP 684 would still not use PyConfig as the config to pass when creating a new interpreter. Using PyConfig would be confusing and an invitation for trouble. So I'd use a new PyInterpreterConfig either way. Consequently, having PyConfig on PyInterpreterState would be confusing, with no benefit. My intention with this BPO issue was to get our internal details aligned with what makes sense for a global config and set the stage for adding a proper per-interpreter config. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:04:17 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 01:04:17 +0000 Subject: [issue47095] Deprecate blake2's tree hashing feature In-Reply-To: <1647978677.39.0.283744368692.issue47095@roundup.psfhosted.org> Message-ID: <1647997457.25.0.359707224063.issue47095@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30153 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:12:18 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 01:12:18 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1647997938.81.0.617572467556.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: Because I don't think blake3 or blake2 _(though we've shipped it already so there's a challenge in making changes https://bugs.python.org/issue47095)_ are important enough to be _guaranteed_ present in all builds (our release binaries would include them). Depending on an external library for those to exist makes sense. I do not want CPython to get into the business of maintaining a complicated build process in-tree for third party architecture specific optimized code for non-core functionality purposes. That is best handled outside of the project & on CI and binary release hosts. I'm okay with blake3 in hashlib if we can avoid gaining another /impl/ tree that is a copy of large third party code and our own build system for it. Q: What benefits does having blake3 builtin vs getting it from PyPI bring? Q: Should we instead provide a way for third party provided hashes to be registered in `hashlib` similar to `codecs.register()`? I view the NIST standard hashes as important enough to attempt to guarantee as present (all the SHAs and MD5) as built-in. Others should really demonstrate practical application popularity to gain included battery status rather than just using PyPI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:17:18 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 23 Mar 2022 01:17:18 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1647998238.12.0.481399930955.issue46541@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +30154 pull_request: https://github.com/python/cpython/pull/32063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:50:23 2022 From: report at bugs.python.org (Jack O'Connor) Date: Wed, 23 Mar 2022 01:50:23 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648000223.38.0.991765995985.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: > maintaining a complicated build process in-tree For what it's worth, if you have any sort of "in a perfect world" vision for what the upstream BLAKE3 project could do to make it trivially easy for you to integrate, I'd be very interested in getting that done. Making integration easy would benefit all callers. We have some issues on the backburner about committing CMake build files, but I assume those would be useless for us here. Is there anything that would be more useful? If we provided autotools build files, could you call into them? Fundamentally, BLAKE3 wants to build some code on x86 and some other code on ARM, and also some code on Unix and some other code on Windows. Currently we just ask the caller to do that for us, for lack of a common standard. (And if we're building intrinsics rather than assembly, we also need the compiler flags that enable our intrinsics.) But maybe we could handle more of that upstream, using the preprocessor? If the build instructions said "compile this one giant file on all platforms and don't worry about what it does", would that be better? Or would that be gross? Is a header-only library the gold standard? Or too C++-ish? Has anyone ever done a really good job of this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 21:54:33 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Mar 2022 01:54:33 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1648000473.26.0.918393813267.issue47086@roundup.psfhosted.org> Terry J. Reedy added the comment: In the IDLE Help menu, 'Python Docs', default hotkey 'F1', invokes '<>', which is handled by EditorWindow.help_docs. For Windows, line 599, is 'os.startfile(self.help_url)'. (Otherwise, webbrowser is used.) On Windows, help_url is os.path.join(sys.base_prefix, 'Doc','Python%s.chm' % _sphinx_version()) if the result is valid, else python.org/...(but '3.1' because only 3 chars are grabbed). How do I use winreg to get the file name from "HKCU\Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation"? The winreg doc assumes some knowledge of registry terminology that I do not have and has no examples, so my attempts failed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:02:51 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 02:02:51 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1648000971.16.0.281563175029.issue2604@roundup.psfhosted.org> Jelle Zijlstra added the comment: After 14 years this bug is finally fixed. Thanks everyone for the patches and discussion. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:08:37 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 02:08:37 +0000 Subject: [issue47097] Document PEP 646 Message-ID: <1648001316.99.0.843695739634.issue47097@roundup.psfhosted.org> New submission from Jelle Zijlstra : https://docs.python.org/3.11/library/typing.html doesn't say anything about TypeVarTuple yet. ---------- assignee: docs at python components: Documentation messages: 415850 nosy: AlexWaygood, JelleZijlstra, docs at python, gvanrossum, kj, mrahtz priority: deferred blocker severity: normal stage: needs patch status: open title: Document PEP 646 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:25:25 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 02:25:25 +0000 Subject: [issue47088] Implement PEP 675 (LiteralString) In-Reply-To: <1647897875.4.0.562368830483.issue47088@roundup.psfhosted.org> Message-ID: <1648002325.35.0.79604941726.issue47088@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +30155 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32064 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:48:59 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 23 Mar 2022 02:48:59 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1648003739.33.0.597083503759.issue47000@roundup.psfhosted.org> Inada Naoki added the comment: > * sys.getfilesystemencoding(): Python filesystem encoding, return "UTF-8" if the Python UTF-8 Mode is enabled Yes, althoguh PYTHONLEGACYWINDOWSFSENCODING takes priority. > * locale.getencoding(): Get the locale encoding, LC_CTYPE locale encoding or the Windows ANSI code page, *read at Python startup*. Ignore the Python UTF-8 Mode. I proposed `locale.get_encoding()` in the PEP 686. I will remove underscore if you don't like it. > * locale.getencoding(current=True): Get the *current* locale encoding. The difference with locale.getencoding() is that on Unix, it gets the LC_CTYPE locale encoding at each call. Hmm, I don't add it to the PEP 686 because it is not relating to UTF-8 mode nor EncodingWarning. Since `locale.getencoding()` returns locale encoding on startup, how about this idea? * sys.getlocaleencoding() -- Get the locale encoding read at Python startup. * locale.getencoding() -- Get the current locale encoding. Note that we have `sys.getdefaultencoding()` and `sys.getfilesystemencoding()`. `sys.getlocaleencoding()` looks consistent with them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:52:43 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 02:52:43 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1648003963.5.0.566390818584.issue46769@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset d5ed8a8258eaf7a241978b1b0aeb971108d0f7e0 by Alex Waygood in branch '3.10': [3.10] bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712) (GH-31941) https://github.com/python/cpython/commit/d5ed8a8258eaf7a241978b1b0aeb971108d0f7e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 22:54:58 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 02:54:58 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1648004098.65.0.71118256476.issue46769@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +30156 pull_request: https://github.com/python/cpython/pull/32067 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 22 23:14:02 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 03:14:02 +0000 Subject: [issue38941] xml.etree.ElementTree.Element inconsistent warning for bool In-Reply-To: <1575033665.72.0.950765215131.issue38941@roundup.psfhosted.org> Message-ID: <1648005242.87.0.482749829622.issue38941@roundup.psfhosted.org> Jelle Zijlstra added the comment: I was close to merging the linked PR but there's some renewed concerns about the proposed behavior here: Do we really want to change this behavior and potentially force a lot of people to change their working code? In addition, the current code emits FutureWarning. I don't really understand what that warning is supposed to be used for (https://docs.python.org/3/library/exceptions.html#FutureWarning), but at least it means we plan to change the behavior later. So we should have a plan for how we'll do that. And whatever we do, the Python and C versions of the code should behave consistently. Here are two ways forward: (1) We change both the Python and the C versions of ElementTree to emit a DeprecationWarning on using __bool__ in 3.11. In 3.13, we change the behavior to make __bool__ always return True. (Or perhaps, make it raise an exception.) (2) We give up on changing this behavior and remove the existing FutureWarning from the Python code. But in that case we should document the gotcha in the boolean behavior of nodes. I don't have enough experience with ElementTree to recommend either option, but I'm happy to help implement it once we come to a decision. ---------- nosy: +JelleZijlstra versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 00:52:59 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 23 Mar 2022 04:52:59 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1648011179.17.0.236607774718.issue47000@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +30157 pull_request: https://github.com/python/cpython/pull/32068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 01:26:05 2022 From: report at bugs.python.org (Ma Lin) Date: Wed, 23 Mar 2022 05:26:05 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648013165.37.0.321648445218.issue46864@roundup.psfhosted.org> Ma Lin added the comment: RAM is now relatively cheaper than CPU. 1 million bytes object additionally use 7.629 MiB RAM for ob_shash. (100_0000*8/1024/1024). This causes hash() performance regression anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 01:40:52 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 23 Mar 2022 05:40:52 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648014052.46.0.615760233467.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: Average RAM capacity doesn't grow as CPU cores grows. Additionally, L1+L2 cache is really limited resource compared to CPU or RAM. Bytes object is used for co_code that is hot. So cache efficiency is important. Would you give us more realistic (or real world) example for caching bytes hash is important? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:19:11 2022 From: report at bugs.python.org (Shantanu) Date: Wed, 23 Mar 2022 06:19:11 +0000 Subject: [issue46480] Implement typing.assert_type In-Reply-To: <1642915152.65.0.424582308271.issue46480@roundup.psfhosted.org> Message-ID: <1648016351.09.0.675040634915.issue46480@roundup.psfhosted.org> Change by Shantanu : ---------- nosy: +hauntsaninja nosy_count: 5.0 -> 6.0 pull_requests: +30158 pull_request: https://github.com/python/cpython/pull/32069 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 02:38:02 2022 From: report at bugs.python.org (Julien Palard) Date: Wed, 23 Mar 2022 06:38:02 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1648017482.61.0.472666368033.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +30159 pull_request: https://github.com/python/cpython/pull/32070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 03:35:34 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Wed, 23 Mar 2022 07:35:34 +0000 Subject: [issue34861] Improve cProfile standard output In-Reply-To: <1538392397.89.0.545547206417.issue34861@psf.upfronthosting.co.za> Message-ID: <1648020934.47.0.347272830821.issue34861@roundup.psfhosted.org> Dani?l van Noord added the comment: I have resubmitted the patch that changes the default sorting order in https://github.com/python/cpython/pull/31929 as it was asked to separate that from the original patch by Anders. I also added documentation changes that follow from changing the default sorting order. ---------- nosy: +danielnoord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:11:30 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 23 Mar 2022 08:11:30 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648023090.55.0.438005531119.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 894d0ea5afa822c23286e9e68ed80bb1122b402d by Inada Naoki in branch 'main': bpo-46864: Suppress deprecation warnings for ob_shash. (GH-32042) https://github.com/python/cpython/commit/894d0ea5afa822c23286e9e68ed80bb1122b402d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:30:16 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 23 Mar 2022 08:30:16 +0000 Subject: [issue47012] Speed up iteration of bytes and bytearray In-Reply-To: <1647256405.01.0.318214910817.issue47012@roundup.psfhosted.org> Message-ID: <1648024216.04.0.579429181041.issue47012@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset bd1cf6ecee76bcdce87b4f69567b95756ecf5a4c by Kumar Aditya in branch 'main': bpo-47012: speed up iteration of bytes and bytearray (GH-31867) https://github.com/python/cpython/commit/bd1cf6ecee76bcdce87b4f69567b95756ecf5a4c ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:32:44 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 23 Mar 2022 08:32: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: <1648024364.75.0.291596577548.issue43884@roundup.psfhosted.org> Kumar Aditya added the comment: @asvetlov Do you have any insight for this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:33:17 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 23 Mar 2022 08:33:17 +0000 Subject: [issue47012] Speed up iteration of bytes and bytearray In-Reply-To: <1647256405.01.0.318214910817.issue47012@roundup.psfhosted.org> Message-ID: <1648024397.08.0.654723271977.issue47012@roundup.psfhosted.org> Change by Kumar Aditya : ---------- components: +Interpreter Core resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 04:34:38 2022 From: report at bugs.python.org (Julien Palard) Date: Wed, 23 Mar 2022 08:34:38 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1648024478.84.0.751385668095.issue42238@roundup.psfhosted.org> Julien Palard added the comment: New changeset ec8906fb5930b1f078e2a2170cdf445e6c6faf57 by Julien Palard in branch 'main': bpo-42238: [doc] Some lines moved in rst, but had hardcoded lineno in susp-ignored.csv. (GH-32070) https://github.com/python/cpython/commit/ec8906fb5930b1f078e2a2170cdf445e6c6faf57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:06:22 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 09:06:22 +0000 Subject: [issue47098] sha3: Replace Keccak Code Package with tiny_sha3 Message-ID: <1648026382.03.0.0255347692375.issue47098@roundup.psfhosted.org> New submission from Christian Heimes : The Keccak Code Package (kcp) provides the reference implementation for SHA3 and SHAKE hashing algorithms. CPython has vendored a copy of KCP since I added SHA3 in 3.6. CPython 3.10 and newer require OpenSSL >= 1.1.1, which provide an optimized implementation of SHA3 and SHAKE on all platforms. The vast majority of users now use SHA3 from OpenSSL instead our _sha3 module with KCP. Both the KCP and _sha3 module are large. The KCP has 230kB of code. The _sha3 shared library is 390kB on Linux X86_64, stripped 90kB. I would like to reduce the size of our bundled code. Since SHA3 and SHAKE are listed in hashlib.algorithms_guaranteed and OpenSSL is optional, we cannot just drop the _sha3 module. Instead I propose to replace the implementation with tiny_sha3 https://github.com/mjosaarinen/tiny_sha3 . The tiny implementation is 13 kB of code. The resulting _sha3 shared library is 69 kB (stripped 25 kB). A Python build without OpenSSL bindings will have a working but slower SHA3 implementation. ---------- assignee: christian.heimes components: Extension Modules messages: 415861 nosy: christian.heimes, gregory.p.smith priority: normal severity: normal status: open title: sha3: Replace Keccak Code Package with tiny_sha3 type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:08:45 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 23 Mar 2022 09:08:45 +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: <1648026525.64.0.404956080725.issue43884@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +30160 pull_request: https://github.com/python/cpython/pull/32073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 05:20:04 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 09:20:04 +0000 Subject: [issue47098] sha3: Replace Keccak Code Package with tiny_sha3 In-Reply-To: <1648026382.03.0.0255347692375.issue47098@roundup.psfhosted.org> Message-ID: <1648027204.62.0.293093091109.issue47098@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30161 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:10:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Mar 2022 10:10:40 +0000 Subject: [issue13011] Frozen programs require the original build directory in order to run. In-Reply-To: <1316483091.36.0.96391936283.issue13011@psf.upfronthosting.co.za> Message-ID: <1648030240.36.0.236246710395.issue13011@roundup.psfhosted.org> Irit Katriel added the comment: Closing, please reopen or create a new issue if this is still a problem after all these years. ---------- stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:23:53 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 23 Mar 2022 10:23:53 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1647997938.81.0.617572467556.issue39298@roundup.psfhosted.org> Message-ID: <38de1359-74e2-e69e-dc4d-292f81240512@egenix.com> Marc-Andre Lemburg added the comment: On 23.03.2022 02:12, Gregory P. Smith wrote: > > I view the NIST standard hashes as important enough to attempt to guarantee as present (all the SHAs and MD5) as built-in. Others should really demonstrate practical application popularity to gain included battery status rather than just using PyPI. +1 on this. I also think the topic deserves a wider discussion. IMO, Python's stdlib should only provide a basic set of hash algorithms and not try to add every single new algorithm out there. PyPI is a much better way to add support for new hash algorithms, can move much faster than the stdlib, provide specialized builds for added performance and also add exotic features, which are not always needed. Here's the list of Python 3.10 algos on a typical Linux system: >>> hashlib.algorithms_available {'sha512_256', 'mdc2', 'md5-sha1', 'md4', 'ripemd160', 'shake_128', 'sha3_384', 'blake2s', 'sha3_512', 'sha3_256', 'sha256', 'sha1', 'sm3', 'sha512_224', 'whirlpool', 'sha384', 'shake_256', 'sha224', 'sha512', 'sha3_224', 'md5', 'blake2b'} This already is more than enough. Since we're using OpenSSL in Python anyway, exposing some of the often used algos from OpenSSL is fine, since it doesn't add much extra bloat. The above list already goes way beyond this, IMO. The longer the list gets, the more confusion it causes among users, since Python's stdlib doesn't provide any guidance on basic questions such as "Which hash algo should I use for my application". Most applications today will only need these basic hash algos: {'ripemd160', 'sha3_512', 'sha3_256', 'sha256', 'sha1', 'sha512', 'md5'} ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 06:42:51 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 23 Mar 2022 10:42:51 +0000 Subject: [issue47099] Replace with_traceback() with exception chaining and reraising Message-ID: <1648032171.38.0.470876447666.issue47099@roundup.psfhosted.org> New submission from Oleg Iarygin : Currently, exception chaining in Lib/ modules is implemented with pre-3.11 `raise Foo(...).with_traceback(sys.exc_info()[2])`. However, this approach can be simplified: 1. PEP 3134 introduced a proper `raise Foo(...) from bar` construction that takes a parent exception instead of its stack traceback 2. Without the traceback required, we partially get rid of `sys.exc_info` thus reducing active tapping into global internals A report printed into a console remains the same except a line: > During handling of the above exception, another exception occurred replaced with: > The above exception was the direct cause of the following exception ---------- components: Library (Lib) messages: 415864 nosy: arhadthedev priority: normal severity: normal status: open title: Replace with_traceback() with exception chaining and reraising type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:17:49 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 23 Mar 2022 11:17:49 +0000 Subject: [issue47099] Replace with_traceback() with exception chaining and reraising In-Reply-To: <1648032171.38.0.470876447666.issue47099@roundup.psfhosted.org> Message-ID: <1648034269.64.0.515585767163.issue47099@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +30162 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:50:49 2022 From: report at bugs.python.org (Ma Lin) Date: Wed, 23 Mar 2022 11:50:49 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648036249.31.0.314232962979.issue46864@roundup.psfhosted.org> Ma Lin added the comment: If put a bytes object into multiple dicts/sets, the hash need to be computed multiple times. This seems a common usage. bytes is a very basic type, users may use it in various ways. And unskilled users may checking the same bytes object against dicts/sets many times. FYI, 1 GiB data: function seconds hash() 0.40 binascii.crc32() 1.66 (Gregory P. Smith is trying to improve this) zlib.crc32() 0.65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:54:05 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 11:54:05 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1648036445.77.0.486156416084.issue47086@roundup.psfhosted.org> Steve Dower added the comment: This should work for you (luckily, this is about the simplest possible case): import sys import winreg def get_help(): KEY = rf"Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation" try: return winreg.QueryValue(winreg.HKEY_CURRENT_USER, KEY) except FileNotFoundError: pass try: return winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, KEY) except FileNotFoundError: pass return f"https://docs.python.org/{sys.version_info.major}.{sys.version_info.minor}/" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 07:56:41 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 11:56:41 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1648036601.67.0.539623111918.issue47086@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30163 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/32075 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 08:03:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2022 12:03:58 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1648037038.2.0.87455073514.issue42238@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 08:15:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2022 12:15:58 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1648037758.12.0.294305161177.issue47000@roundup.psfhosted.org> STINNER Victor added the comment: sys.getlocaleencoding() versus locale.getencoding(). For me, the Python locale module should use the C API to access the Unix locales like LC_CTYPE, nl_langinfo(CODESET), etc. The sys module are more for things specific to Python, like sys.getfilesystemencoding(). Since sys.getlocaleencoding() would be a fixed value for the whole process life time, I agree that the sys module is a better place. I can write a PR adding sys.getlocaleencoding() if we agree on the API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 08:17:49 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 12:17:49 +0000 Subject: [issue47095] Prefer libb2 over vendored copy of blake2 In-Reply-To: <1647978677.39.0.283744368692.issue47095@roundup.psfhosted.org> Message-ID: <1648037869.65.0.282472975684.issue47095@roundup.psfhosted.org> Change by Christian Heimes : ---------- title: Deprecate blake2's tree hashing feature -> Prefer libb2 over vendored copy of blake2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 08:19:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2022 12:19:19 +0000 Subject: [issue46836] [C API] Move PyFrameObject to the internal C API In-Reply-To: <1645628652.12.0.0785803095185.issue46836@roundup.psfhosted.org> Message-ID: <1648037959.09.0.381565828545.issue46836@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b0f886d1bca499db1118a60b707923fa8e157073 by Victor Stinner in branch 'main': bpo-46836: Add Doc/c-api/frame.rst (GH-32051) https://github.com/python/cpython/commit/b0f886d1bca499db1118a60b707923fa8e157073 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 08:20:46 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 12:20:46 +0000 Subject: [issue47100] Help text for Store Python shows "null" under usage Message-ID: <1648038046.56.0.527997559896.issue47100@roundup.psfhosted.org> New submission from Steve Dower : C:\> python3.11 -h usage: (null) [option] ... [-c cmd | -m mod | file | -] [arg] ... Options and arguments (and corresponding environment variables): ... Should not show "(null)" there ---------- components: Windows messages: 415869 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Help text for Store Python shows "null" under usage type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:13:02 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 23 Mar 2022 13:13:02 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648041182.26.0.105369735829.issue46126@roundup.psfhosted.org> ?ric Araujo added the comment: I think the situation and the discussion should be summarized on python-dev! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:22:54 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 23 Mar 2022 13:22:54 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1648041774.85.0.259127167381.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: I did [this search](https://www.google.com/search?q=gittext+homebrew+"ld%3A+symbol(s)+not+found+for+architecture+arm64"), which surfaced a few related results. [This article](https://lifesaver.codes/answer/pyenv-arm64-builds-confused-by-x86-64-libintl-in-usr-local-1877) seemed promising, but the symptoms there are different than mine. I don't have any gettext libs showing up in /usr/local (only in /opt/homebrew as expected). I noticed [this comment](https://github.com/pyenv/pyenv/issues/1877#issuecomment-976583556) reports the same issue I have, but no solution is present. I saw a suggestion to [set FLAGS](https://github.com/pyenv/pyenv/issues/1877#issuecomment-836115970), but I do that [as a matter of course](https://github.com/jaraco/jaraco.develop/blob/d3e524362ba15f87790f4c6279b1f92c06901387/jaraco/develop/macos-build-python.py#L38-L42). I don't have an x86 install of homebrew. This machine is less than a month old and has had ARM-based homebrew installed from the beginning. I'll keep investigating. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:35:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Mar 2022 13:35:34 +0000 Subject: [issue47099] Replace with_traceback() with exception chaining and reraising In-Reply-To: <1648032171.38.0.470876447666.issue47099@roundup.psfhosted.org> Message-ID: <1648042534.46.0.0532691844312.issue47099@roundup.psfhosted.org> Irit Katriel added the comment: You don't need sys.exc_info() for the traceback anymore. except Exception as e: raise OSError('blah').with_traceback(e.__traceback__) ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:38:17 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 23 Mar 2022 13:38:17 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1648042697.41.0.643610562671.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: As suggested, I uninstalled and reinstalled everything in homebrew: $ brew list | xargs brew remove $ brew install python at 3.10 python-launcher python at 3.9 python at 3.8 gh git Even after following those steps and setting LDFLAGS and CPPFLAGS to point to `brew --prefix`, the errors continue when running `./configure; make` in a clean checkout. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:44:01 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 23 Mar 2022 13:44:01 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1648043041.51.0.0854914652879.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: Aha. If I configure/make without LDFLAGS or CPPFLAGS set, compilation works. Then I noticed for `LDFLAGS`, some users were using `-L`. I thought it was slightly odd that my recipe was using `-I` for both flags. How is it that [this mistake](https://github.com/jaraco/jaraco.develop/commit/6469c7a61e7349b93f191df38eed6cd020dd79be) hasn't caused me any grief until M1 build? No matter - correcting for that mistake and passing the correct LDFLAGS flag (-L) corrects for the issue. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 09:46:53 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 23 Mar 2022 13:46:53 +0000 Subject: [issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac In-Reply-To: <1646930281.31.0.068215142849.issue46975@roundup.psfhosted.org> Message-ID: <1648043213.17.0.277897728709.issue46975@roundup.psfhosted.org> Jason R. Coombs added the comment: It's possible my bad experience may have been avoided through issue35905. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:02:06 2022 From: report at bugs.python.org (Stephen J. Turnbull) Date: Wed, 23 Mar 2022 14:02:06 +0000 Subject: [issue28080] Allow reading member names with bogus encodings in zipfile In-Reply-To: <1473620375.38.0.155906896901.issue28080@psf.upfronthosting.co.za> Message-ID: <1648044126.15.0.155895523231.issue28080@roundup.psfhosted.org> Stephen J. Turnbull added the comment: I'm not going to have time to look at the PR for a couple days. I don't understand what the use case is for writing or appending with filenames in a non-UTF-8 encoding. At least in my experience, reading such files is rare, but I have never been asked to write one. The correspondents who send me zipfiles with the directory encoded in shift_jisx0213 are perfectly happy to read zipfiles with the directory encoded in UTF-8. If that is true for other users, then unzipping the file to a temporary directory with the appropriate --metadata-encoding, adding the required paths there, and zipping a new archive seems perfectly workable. In that case making this feature read-only makes the most sense to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:28:49 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 14:28:49 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider Message-ID: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> New submission from Christian Heimes : Hubert Kario wrote in https://bugzilla.redhat.com/show_bug.cgi?id=2054702 Description of problem: The hashlib.algorithms_available set includes algorithms like ripemd160 and whirlpool, those algorithms are not usable unless openssl legacy provider is loaded. Since it's not loaded, and the hashlib module won't load it, any attempt to use them fails. Version-Release number of selected component (if applicable): python3-3.9.10-1.el9.x86_64 openssl-3.0.1-5.el9.x86_64 How reproducible: always Steps to Reproduce: 0. start python3 1. from hashlib import algorithms_available 2. algorithms_available 3. import hashlib 4. a = {(name, hashlib.new(name).digest_size) for name in algorithms_available} Actual results: {'sha3_384', 'blake2s', 'sha384', 'sha512_224', 'md5', 'sha3_512', 'md5-sha1', 'sha3_256', 'shake_128', 'sm3', 'sha256', 'sha512', 'sha1', 'shake_256', 'blake2b', 'whirlpool', 'sha512_256', 'sha3_224', 'sha224', 'ripemd160', 'md4'} Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 164, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "", line 1, in File "/usr/lib64/python3.9/hashlib.py", line 170, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib64/python3.9/hashlib.py", line 127, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type whirlpool Expected results: {'sha3_384', 'blake2s', 'sha384', 'sha512_224', 'md5', 'sha3_512', 'md5-sha1', 'sha3_256', 'shake_128', 'sm3', 'sha256', 'sha512', 'sha1', 'shake_256', 'blake2b', 'sha512_256', 'sha3_224', 'sha224'} {('blake2b', 64), ('sha512', 64), ('md5-sha1', 36), ('sha3_512', 64), ('md5', 16), ('sha224', 28), ('shake_128', 0), ('sm3', 32), ('blake2s', 32), ('sha1', 20), ('shake_256', 0), ('sha512_256', 32), ('sha3_224', 28), ('sha3_256', 32), ('sha3_384', 48), ('sha384', 48), ('sha256', 32), ('sha512_224', 28)} Additional info: If the legacy provider is loaded, then the algorithms should be listed and should work. It may be caused by Python using the deprecated EVP_MD_do_all() method instead of the EVP_MD_do_all_provided() method ---------- components: Extension Modules, Library (Lib) messages: 415877 nosy: christian.heimes priority: normal severity: normal status: open title: hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:33:20 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 14:33:20 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648046000.86.0.57230236462.issue47101@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30164 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32076 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 10:38:17 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 14:38:17 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648046297.04.0.0080851245093.issue47101@roundup.psfhosted.org> Christian Heimes added the comment: Hubert's suggested solution EVP_MD_do_all_provided() worked almost straight forward. The function signature is a bit different and I got "undefined" in the result set. Filtering out NID_undef got right of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:43:15 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 23 Mar 2022 15:43:15 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1648050195.75.0.265906564196.issue46829@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 0360e9f34659e7d7f3dae021b82f78452db8c714 by Andrew Svetlov in branch 'main': bpo-46829: Deprecate passing a message into Future.cancel() and Task.cancel() (GH-31840) https://github.com/python/cpython/commit/0360e9f34659e7d7f3dae021b82f78452db8c714 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:50:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 15:50:38 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648050638.31.0.358151856533.issue47101@roundup.psfhosted.org> Christian Heimes added the comment: $ ./python Tools/ssl/multissltests.py --openssl 3.0.2 --steps modules $ ./python -c "import hashlib; print(hashlib.algorithms_available)" {'blake2b', 'sha512', 'sm3', 'shake_128', 'md5', 'sha3_256', 'sha224', 'sha512_224', 'sha3_384', 'sha384', 'md5-sha1', 'sha3_224', 'shake_256', 'sha3_512', 'sha512_256', 'sha1', 'sha256', 'blake2s'} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:52:58 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 23 Mar 2022 15:52:58 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1648050778.38.0.151969797843.issue46541@roundup.psfhosted.org> Eric Snow added the comment: New changeset 21412d037b07c08266e96dfd0c0e44a1b7693bc1 by Eric Snow in branch 'main': bpo-46541: Add a Comment About When to Use _Py_DECLARE_STR(). (gh-32063) https://github.com/python/cpython/commit/21412d037b07c08266e96dfd0c0e44a1b7693bc1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 11:56:00 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 23 Mar 2022 15:56:00 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1648050960.52.0.417085875617.issue46712@roundup.psfhosted.org> Eric Snow added the comment: New changeset febf54bcf3fdc45ad84b4073e24bbaaee0ac8b2a by Eric Snow in branch 'main': bpo-46712: Do not Regen Deep-Frozen Modules before Generating Global Objects (gh-32061) https://github.com/python/cpython/commit/febf54bcf3fdc45ad84b4073e24bbaaee0ac8b2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:01:27 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 23 Mar 2022 16:01:27 +0000 Subject: [issue46829] Confusing CancelError message if multiple cancellations are scheduled In-Reply-To: <1645567371.24.0.086924022035.issue46829@roundup.psfhosted.org> Message-ID: <1648051287.46.0.806523431452.issue46829@roundup.psfhosted.org> Guido van Rossum added the comment: Fixed by deprecating the message argument to cancel(). It will be removed in 3.13. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:04:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Mar 2022 16:04:12 +0000 Subject: [issue33028] [doc] tempfile.TemporaryDirectory documentation improvements In-Reply-To: <1520503262.87.0.467229070634.issue33028@psf.upfronthosting.co.za> Message-ID: <1648051452.14.0.30230776775.issue33028@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +iritkatriel nosy_count: 5.0 -> 6.0 pull_requests: +30165 pull_request: https://github.com/python/cpython/pull/32078 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:14:17 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 16:14:17 +0000 Subject: [issue47086] Include HTML docs with Windows installer instead of CHM In-Reply-To: <1647895467.15.0.262740813559.issue47086@roundup.psfhosted.org> Message-ID: <1648052057.74.0.50012690847.issue47086@roundup.psfhosted.org> Steve Dower added the comment: New changeset fe010605f87f988ef1053e372d1c3898d2633d96 by Steve Dower in branch 'main': bpo-47086: Remove dead link to old CHM documentation (GH-32075) https://github.com/python/cpython/commit/fe010605f87f988ef1053e372d1c3898d2633d96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:17:48 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 16:17:48 +0000 Subject: [issue33028] [doc] tempfile.TemporaryDirectory documentation improvements In-Reply-To: <1520503262.87.0.467229070634.issue33028@psf.upfronthosting.co.za> Message-ID: <1648052268.53.0.619106040862.issue33028@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +30166 pull_request: https://github.com/python/cpython/pull/32077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:47:14 2022 From: report at bugs.python.org (Itamar Ostricher) Date: Wed, 23 Mar 2022 16:47:14 +0000 Subject: [issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API In-Reply-To: <1645716984.87.0.22272006941.issue46850@roundup.psfhosted.org> Message-ID: <1648054034.28.0.791109820284.issue46850@roundup.psfhosted.org> Change by Itamar Ostricher : ---------- nosy: +itamaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 12:53:03 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 23 Mar 2022 16:53:03 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648054383.79.0.3923075826.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: Ok, I give up. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:22:45 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 23 Mar 2022 17:22:45 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648056165.02.0.400736412128.issue44090@roundup.psfhosted.org> G?ry added the comment: Apologies for the long delay. > Do we have any meaningful examples to show that this is desired and useful? A use case of `super()` in a `classmethod` that comes to mind is for parameterized factory methods. It is a variation of the classic factory method design pattern that lets the factory method of a creator creates *multiple* products according to a parameter identifying the product to create. Overriding the factory method lets you change or extend the products that are created, by mapping existing identifiers to different products or introducing new identifiers for new products (cf. GoF?s book *Design Patterns*, section ?Factory Method?, subsection ?Implementation?, paragraph 2): ``` >>> class MyCreator: ... @classmethod ... def make(cls, product_id): ... if product_id == 'mine': return MyProduct(creator=cls) ... if product_id == 'yours': return YourProduct(creator=cls) ... if product_id == 'theirs': return TheirProduct(creator=cls) ... raise ValueError('product_id {!r} not supported'.format(product_id)) ... >>> class YourCreator(MyCreator): ... @classmethod ... def make(cls, product_id): ... if product_id == 'mine': return YourProduct(creator=cls) ... if product_id == 'yours': return MyProduct(creator=cls) ... return super(YourCreator, cls).make(product_id) ... >>> class BaseProduct: ... def __init__(self, creator): self._creator = creator ... def __repr__(self): ... return '{}(creator={})'.format( ... type(self).__name__, self._creator.__name__) ... >>> class MyProduct(BaseProduct): pass ... >>> class YourProduct(BaseProduct): pass ... >>> class TheirProduct(BaseProduct): pass ... >>> MyCreator.make('mine') MyProduct(creator=MyCreator) >>> YourCreator.make('mine') YourProduct(creator=YourCreator) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:29:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Mar 2022 17:29:02 +0000 Subject: [issue33028] [doc] tempfile.TemporaryDirectory documentation improvements In-Reply-To: <1520503262.87.0.467229070634.issue33028@psf.upfronthosting.co.za> Message-ID: <1648056542.74.0.90705690101.issue33028@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:29:54 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 17:29:54 +0000 Subject: [issue31582] Add _pth breadcrumb to sys.path documentation In-Reply-To: <1506401240.1.0.91731713201.issue31582@psf.upfronthosting.co.za> Message-ID: <1648056594.7.0.505358418351.issue31582@roundup.psfhosted.org> Steve Dower added the comment: New changeset c62b944dfc98911a5050389fa6ac753e283fee1f by Russel Webber in branch 'main': bpo-31582: Created a new documentation section describing sys.path initialization (GH-31082) https://github.com/python/cpython/commit/c62b944dfc98911a5050389fa6ac753e283fee1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:36:36 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 23 Mar 2022 17:36:36 +0000 Subject: [issue46716] regrtest didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x In-Reply-To: <1644534557.28.0.000333882929265.issue46716@roundup.psfhosted.org> Message-ID: <1648056996.61.0.691134983334.issue46716@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- keywords: +patch pull_requests: +30167 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 13:38:10 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 23 Mar 2022 17:38:10 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1648054383.79.0.3923075826.issue39298@roundup.psfhosted.org> Message-ID: <401d60a0-6d2c-e5c4-73a2-edf8a47fb56d@egenix.com> Marc-Andre Lemburg added the comment: On 23.03.2022 17:53, Larry Hastings wrote: > > Ok, I give up. Sorry to spoil the fun, but there's no need to throw everything in the bin ;-) A lean and fast blake3 C package would still be a great thing to have on PyPI, e.g. provide support for platforms, which Jack's blake3 Rust package doesn't cover, e.g. Raspis: https://www.piwheels.org/project/blake3/ Android (e.g. via termux): https://wiki.termux.com/wiki/Main_Page https://wiki.termux.com/wiki/Python etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:14:39 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 23 Mar 2022 18:14:39 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648059279.31.0.485431098739.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: The Rust version is already quite "lean". And it can be much faster than the C version, because it supports internal multithreading. Even without multithreading I bet it's at least a hair faster. Also, Jack has independently written a Python package based around the C version: https://github.com/oconnor663/blake3-py/tree/master/c_impl so my making one would be redundant. I have no interest in building standalone BLAKE3 PyPI packages for Raspberry Pi or Android. My goal was for BLAKE3 to be one of the "included batteries" in Python--which would have meant it would, eventually, be available on the Raspberry Pi and Android builds that way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:19:46 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 23 Mar 2022 18:19:46 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1648059586.6.0.202439771677.issue46769@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0bbb6956f83ef457872b8f04242bb02b6898350d by Jelle Zijlstra in branch '3.9': [3.9] bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712) (GH-31941) (GH-32067) https://github.com/python/cpython/commit/0bbb6956f83ef457872b8f04242bb02b6898350d ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:22:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Mar 2022 18:22:07 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1648059727.0.0.864267201131.issue46964@roundup.psfhosted.org> STINNER Victor added the comment: > thus far we have had no actual use cases for initializing an interpreter > with a different config I don't think that sub-interpreters should have config.install_signal_handlers=1. Same for config.configure_c_stdio=1. Only the main interpreter should handle signals and the configuration of C streams (stdio, stderr, stdio). I added _PyInterpreterState_SetConfig() to experiment changing config.bytes_warning. But this is no strong need to have an API to change it, so right now, there is still no API for that. If we allow to change it, it would be surprising to change all interpreters at once. I don't see why config.argv (sys.argv) must be the same in all interpreters. Same for config.module_search_paths (sys.path). For me, it makes sense to have a per-interpreter value for most PyConfig options. > * there is no API for creating an interpreter with a different config There is _Py_NewInterpreter(int isolated_subinterpreter) to set config.config._isolated_interpreter. But since the feature is not "official", it remains a private API. > currently, every interpreter uses (a copy of) the original PyConfig, > completely unchanged Currently, it's possible to call Py_InitializeFromConfig() (or Py_Initialize()) multiple times and it changes the PyConfig of the current interpreter. See the pyinit_core_reconfigure() function. _testembed has an unit test for that: I had to implement this feature. Once, calling the function multiple times and it broke an application. See bpo-34008. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:22:59 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 23 Mar 2022 18:22:59 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1648059779.88.0.878185338412.issue46769@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks Alex for the PR and ?ukasz for merging the last backport! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 14:59:17 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 23 Mar 2022 18:59:17 +0000 Subject: [issue46769] Improve documentation for `typing.TypeVar` In-Reply-To: <1645030878.3.0.822530505617.issue46769@roundup.psfhosted.org> Message-ID: <1648061957.37.0.434503775383.issue46769@roundup.psfhosted.org> Alex Waygood added the comment: Thanks Guido for your insight, and Jelle/?ukasz for the reviews and backports! I'm on holiday right now, but when I'm back, I'll take a look at maybe proposing some minor revisions to PEP 484 as well, as Guido suggests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:12:09 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 23 Mar 2022 19:12:09 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1648059279.31.0.485431098739.issue39298@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: With "lean" I meant: doesn't use much code and is easy to compile and install. I built a wheel from Jack's experimental package and it comes out to just under 100kB on Linux x64, compared to around the 1.1MB the Rust wheel needs: Archive: blake3_experimental_c-0.0.1-cp310-cp310-linux_x86_64.whl Length Date Time Name --------- ---------- ----- ---- 348528 2022-03-23 18:38 blake3.cpython-310-x86_64-linux-gnu.so 3183 2022-03-23 18:38 blake3_experimental_c-0.0.1.dist-info/METADATA 105 2022-03-23 18:38 blake3_experimental_c-0.0.1.dist-info/WHEEL 7 2022-03-23 18:38 blake3_experimental_c-0.0.1.dist-info/top_level.txt 451 2022-03-23 18:38 blake3_experimental_c-0.0.1.dist-info/RECORD --------- ------- 352274 5 files Archive: blake3-0.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl Length Date Time Name --------- ---------- ----- ---- 3800 2022-01-13 01:26 blake3-0.3.1.dist-info/METADATA 133 2022-01-13 01:26 blake3-0.3.1.dist-info/WHEEL 48 2022-01-13 01:26 blake3/__init__.py 4195392 2022-01-13 01:26 blake3/blake3.cpython-310-x86_64-linux-gnu.so 382 2022-01-13 01:26 blake3-0.3.1.dist-info/RECORD --------- ------- 4199755 5 files I don't know why there is such a significant difference in size. Perhaps the Rust version includes multiple variants for different CPU optimizations ?! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:19:19 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 23 Mar 2022 19:19:19 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648063159.5.0.0773124033723.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: I can't answer why the Rust one is so much larger--that's a question for Jack. But the blake3-py you built might (should?) have support for SIMD extensions. See the setup.py for how that works; it appears to at least try to use the SIMD extensions on x86 POSIX (32- and 64-bit), x86_64 Windows, and 64-bit ARM POSIX. If you were really curious, you could run some quick benchmarks, then hack your local setup.py to not attempt adding support for those (see "portable code only" in setup.py) and do a build, and run your benchmarks again. If BLAKE3 got a lot slower, yup, you (initially) built it with SIMD extension support. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:22:09 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 23 Mar 2022 19:22:09 +0000 Subject: [issue46716] regrtest didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x In-Reply-To: <1644534557.28.0.000333882929265.issue46716@roundup.psfhosted.org> Message-ID: <1648063329.45.0.753138084224.issue46716@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- pull_requests: +30168 pull_request: https://github.com/python/cpython/pull/32081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:30:13 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 19:30:13 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI Message-ID: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> New submission from Gregory P. Smith : Linux kernels provide a CryptoAPI. This is a common place for platform specific hardware accelerated hash algorithms to be exposed to the user (especially on SoCs which often have non-standard hardware). https://www.kernel.org/doc/html/v4.10/crypto/userspace-if.html https://www.kernel.org/doc/html/v5.17/crypto/userspace-if.html https://www.chronox.de/libkcapi.html hashlib currently uses OpenSSL when possible for performance. We could also look at querying the kernel API. How to decide between the two implementations when both are present is something TBD. This would probably be best done via a configure time check for libkcapi? ---------- messages: 415896 nosy: christian.heimes, gregory.p.smith priority: normal severity: normal status: open title: explore hashlib use of the Linux Kernel CryptoAPI type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:37:23 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 19:37:23 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648064243.29.0.374048102078.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: To anyone else who comes along with motivation: I'm fine with blake3 being in hashlib, but I don't want us to guarantee it by carrying the implementation of the algorithm in the CPython codebase itself unless it gains wide industry standard-like adoption status. We should feel free to link to both the Rust blake3 and C blake3-py packages from the hashlib docs regardless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:42:36 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 19:42:36 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648064556.72.0.0140653446963.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: Performance wise... The SHA series have hardware acceleration on modern CPUs and SoCs. External libraries such as OpenSSL are in a position to provide implementations that make use of that. Same with the Linux Kernel CryptoAPI (https://bugs.python.org/issue47102). Hardware accelerated SHAs are likely faster than blake3 single core. And certainly more efficient in terms of watt-secs/byte. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:45:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 19:45:38 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648064738.19.0.645334718673.issue47102@roundup.psfhosted.org> Christian Heimes added the comment: We don't need libkcapi. I added AF_ALG support a while ago: import binascii import os import socket with socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0) as cfgsock: cfgsock.bind(("hash", "sha256")) opsock, _ = cfgsock.accept() with opsock: with open("/etc/os-release") as f: st = os.fstat(f.fileno()) # blindly assumes that sendfile() exhausts the fd. os.sendfile( opsock.fileno(), f.fileno(), offset=0, count=st.st_size ) res = opsock.recv(512) print(binascii.hexlify(res)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:48:06 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 23 Mar 2022 19:48:06 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1648063159.5.0.0773124033723.issue39298@roundup.psfhosted.org> Message-ID: <8c00cd86-9929-44f0-7142-91f78e05e54f@egenix.com> Marc-Andre Lemburg added the comment: Here's a wheel which only includes the portable code (I disabled all the special cases as you suggested). Archive: dist/blake3_experimental_c-0.0.1-cp310-cp310-linux_x86_64.whl Length Date Time Name --------- ---------- ----- ---- 297680 2022-03-23 19:26 blake3.cpython-310-x86_64-linux-gnu.so 3183 2022-03-23 19:26 blake3_experimental_c-0.0.1.dist-info/METADATA 105 2022-03-23 19:26 blake3_experimental_c-0.0.1.dist-info/WHEEL 7 2022-03-23 19:26 blake3_experimental_c-0.0.1.dist-info/top_level.txt 451 2022-03-23 19:26 blake3_experimental_c-0.0.1.dist-info/RECORD --------- ------- 301426 5 files I didn't run any benchmarks, but it's clear that the SIMD code was used in my initial build and this adds some 50kB to the .so file. This is on a older Linux x64 box with Intel i7-4770k CPU. Could be that the Rust version adds several such SIMD variants and then branches based on the platform running the code. In any case, the C extension is indeed very easy to build and install with a standard compiler setup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:48:50 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 23 Mar 2022 19:48:50 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1648064930.93.0.364907237297.issue47061@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +30169 pull_request: https://github.com/python/cpython/pull/32082 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:49:29 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 19:49:29 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648064969.7.0.807804322313.issue47102@roundup.psfhosted.org> Gregory P. Smith added the comment: Neat. I've never used the API, just filing a breadcrumb suggesting we see if it makes sense. Being I/O based, that even takes care of GIL releasing from Python. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:52:29 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 23 Mar 2022 19:52:29 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648065149.23.0.757217649536.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: Rust based anything comes with a baseline level of Rust code overhead. https://stackoverflow.com/questions/29008127/why-are-rust-executables-so-huge That seems expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:54:20 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 19:54:20 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648065260.92.0.461872971305.issue47102@roundup.psfhosted.org> Christian Heimes added the comment: test_socket has examples for HMAC, AES-CBC, and AES-GCM. with self.create_alg('hash', 'hmac(sha1)') as algo: algo.setsockopt(socket.SOL_ALG, socket.ALG_SET_KEY, b"Jefe") op, _ = algo.accept() with op: op.sendall(b"what do ya want for nothing?") self.assertEqual(op.recv(512), expected) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 15:55:18 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 19:55:18 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648065318.41.0.0459277133432.issue47102@roundup.psfhosted.org> Christian Heimes added the comment: And sendfile() is zero-copy. Data does not have to leave Kernel space. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:00:21 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 20:00:21 +0000 Subject: [issue47103] Copy pgort140.dll when building for PGO Message-ID: <1648065621.85.0.817743953237.issue47103@roundup.psfhosted.org> New submission from Steve Dower : Rather than trying to set up PATH properly, we should just copy pgort140.dll into the build directory when building instrumented version. This becomes more important for those (i.e. me) building and then manually running the profile stage on a different machine. ---------- assignee: steve.dower components: Build, Windows messages: 415905 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Copy pgort140.dll when building for PGO type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:03:01 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 23 Mar 2022 20:03:01 +0000 Subject: [issue47103] Copy pgort140.dll when building for PGO In-Reply-To: <1648065621.85.0.817743953237.issue47103@roundup.psfhosted.org> Message-ID: <1648065781.22.0.0405043330293.issue47103@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +30170 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:13:17 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 20:13:17 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1648066397.0.0.573293530848.issue47061@roundup.psfhosted.org> miss-islington added the comment: New changeset e513b8188af4d2f43ab2b96b51bc45bd4f6fd5b6 by Hugo van Kemenade in branch '3.9': [3.9] bpo-47061: document module deprecations due to PEP 594 (GH-31984) (GH-32082) https://github.com/python/cpython/commit/e513b8188af4d2f43ab2b96b51bc45bd4f6fd5b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:30:17 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 20:30:17 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648067417.37.0.936090340327.issue47101@roundup.psfhosted.org> miss-islington added the comment: New changeset 48e2010d92076b472922fa632fffc98ee150004f by Christian Heimes in branch 'main': bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076) https://github.com/python/cpython/commit/48e2010d92076b472922fa632fffc98ee150004f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:30:22 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 20:30:22 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648067422.29.0.0653180787776.issue47101@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30171 pull_request: https://github.com/python/cpython/pull/32084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:31:17 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 20:31:17 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648067477.89.0.694583579105.issue47101@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30172 pull_request: https://github.com/python/cpython/pull/32085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:42:40 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 20:42:40 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase Message-ID: <1648068160.16.0.895726733187.issue47104@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- components: Tests, asyncio nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:47:07 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 20:47:07 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase Message-ID: <1648068427.98.0.671662444222.issue47104@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30173 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32086 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:57:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 20:57:22 +0000 Subject: [issue34014] loop.run_in_executor should propagate current contextvars In-Reply-To: <1530401184.74.0.56676864532.issue34014@psf.upfronthosting.co.za> Message-ID: <1648069042.48.0.545137929578.issue34014@roundup.psfhosted.org> Andrew Svetlov added the comment: contextvars and run_in_executor() cannot be used together with process executor. asyncio.to_thread() runs with a copy of the current context. Available since Python 3.9 https://docs.python.org/3/library/asyncio-task.html?highlight=to_thread#asyncio.to_thread ---------- resolution: postponed -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:58:06 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 20:58:06 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648069086.46.0.297802680919.issue47101@roundup.psfhosted.org> miss-islington added the comment: New changeset ec3589f59d2c8456591f33656639bcc303eb7bd5 by Miss Islington (bot) in branch '3.9': bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076) https://github.com/python/cpython/commit/ec3589f59d2c8456591f33656639bcc303eb7bd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 16:58:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 20:58:50 +0000 Subject: [issue40320] Add ability to specify instance of contextvars context to Task() & asyncio.create_task() In-Reply-To: <1587223687.72.0.427454005421.issue40320@roundup.psfhosted.org> Message-ID: <1648069130.51.0.756926546488.issue40320@roundup.psfhosted.org> Andrew Svetlov added the comment: Duplicate of #46994 ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Accept explicit contextvars.Context in asyncio create_task() API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:09:49 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 21:09:49 +0000 Subject: [issue44306] asyncio.from_thread In-Reply-To: <1622758125.93.0.576935961865.issue44306@roundup.psfhosted.org> Message-ID: <1648069789.87.0.373783876342.issue44306@roundup.psfhosted.org> Andrew Svetlov added the comment: How is it better than passing the loop instance explicitly? What is the real use case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:15:34 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Mar 2022 21:15:34 +0000 Subject: [issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider In-Reply-To: <1648045729.74.0.801918248822.issue47101@roundup.psfhosted.org> Message-ID: <1648070134.07.0.892082798469.issue47101@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 1b6acaad9a18b2498386c60f24351ab749061e3a by Christian Heimes in branch '3.10': [3.10] bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076) (GH-32085) https://github.com/python/cpython/commit/1b6acaad9a18b2498386c60f24351ab749061e3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:17:17 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 21:17:17 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase Message-ID: <1648070237.55.0.0731871988516.issue47104@roundup.psfhosted.org> New submission from Andrew Svetlov : New changeset ff619c7dfe8dcb0e4c8dc655abc3acc7dc586d0d by Andrew Svetlov in branch 'main': bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086) https://github.com/python/cpython/commit/ff619c7dfe8dcb0e4c8dc655abc3acc7dc586d0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:17:19 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 21:17:19 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase In-Reply-To: <1648070237.55.0.0731871988516.issue47104@roundup.psfhosted.org> Message-ID: <1648070239.22.0.432949468536.issue47104@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +30174 pull_request: https://github.com/python/cpython/pull/32087 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:17:24 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 21:17:24 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase In-Reply-To: <1648070237.55.0.0731871988516.issue47104@roundup.psfhosted.org> Message-ID: <1648070244.73.0.513773892662.issue47104@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30175 pull_request: https://github.com/python/cpython/pull/32088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:23:34 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 21:23:34 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase In-Reply-To: <1648070237.55.0.0731871988516.issue47104@roundup.psfhosted.org> Message-ID: <1648070614.97.0.889292899034.issue47104@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:43:58 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Mar 2022 21:43:58 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase In-Reply-To: <1648070237.55.0.0731871988516.issue47104@roundup.psfhosted.org> Message-ID: <1648071838.04.0.4517913021.issue47104@roundup.psfhosted.org> miss-islington added the comment: New changeset 9e1bfd8ce79b947dc0c1cfb4644e5afe337c2d07 by Miss Islington (bot) in branch '3.10': bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086) https://github.com/python/cpython/commit/9e1bfd8ce79b947dc0c1cfb4644e5afe337c2d07 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:48:20 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 21:48:20 +0000 Subject: [issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase In-Reply-To: <1648070237.55.0.0731871988516.issue47104@roundup.psfhosted.org> Message-ID: <1648072100.39.0.10537280073.issue47104@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:49:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 21:49:14 +0000 Subject: [issue47014] ProactorEventLoop ignores Ctrl+C after closing unrelated loop In-Reply-To: <1647278088.02.0.528648197947.issue47014@roundup.psfhosted.org> Message-ID: <1648072154.21.0.418444318072.issue47014@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 17:50:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 21:50:42 +0000 Subject: [issue46771] Implement asyncio.timeout() context manager In-Reply-To: <1645034352.96.0.773044052656.issue46771@roundup.psfhosted.org> Message-ID: <1648072242.07.0.255360772504.issue46771@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- title: Add some form of cancel scopes -> Implement asyncio.timeout() context manager _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 19:18:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 23 Mar 2022 23:18:35 +0000 Subject: [issue45098] asyncio.CancelledError should contain more information on cancellations In-Reply-To: <1630761463.35.0.712522138496.issue45098@roundup.psfhosted.org> Message-ID: <1648077515.96.0.472681114926.issue45098@roundup.psfhosted.org> Andrew Svetlov added the comment: #46829 deprecates cancellation messages. #46771 implements timeout context manager based on previously added cancellation counter and task.uncancel() I think this issue should be closed. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 20:14:06 2022 From: report at bugs.python.org (Aaron Gallagher) Date: Thu, 24 Mar 2022 00:14:06 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648080846.25.0.651767567534.issue44493@roundup.psfhosted.org> Aaron Gallagher <_ at habnab.it> added the comment: sigh.. adding myself to nosy here too in the hope that this gets any traction ---------- nosy: +habnabit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 20:24:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 00:24:53 +0000 Subject: [issue23578] struct.pack error messages do not indicate which argument was invalid In-Reply-To: <1425402185.63.0.203193056814.issue23578@psf.upfronthosting.co.za> Message-ID: <1648081493.13.0.34172379034.issue23578@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 20:33:09 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 24 Mar 2022 00:33:09 +0000 Subject: [issue28080] Allow reading member names with bogus encodings in zipfile In-Reply-To: <1473620375.38.0.155906896901.issue28080@psf.upfronthosting.co.za> Message-ID: <1648081989.56.0.33582451776.issue28080@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks Serhiy! ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 20:33:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 00:33:57 +0000 Subject: [issue29067] Source archive: wrong directory attributes In-Reply-To: <1482654357.71.0.854296911958.issue29067@psf.upfronthosting.co.za> Message-ID: <1648082037.57.0.98029879074.issue29067@roundup.psfhosted.org> Irit Katriel added the comment: In 3.11 it is drwxr-xr-x. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 20:39:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 00:39:23 +0000 Subject: [issue27165] Skip callables when displaying exception fields in cgitb In-Reply-To: <1464689112.02.0.764355408735.issue27165@psf.upfronthosting.co.za> Message-ID: <1648082363.07.0.922682278863.issue27165@roundup.psfhosted.org> Irit Katriel added the comment: cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements to them. ---------- nosy: +iritkatriel resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 21:28:31 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 24 Mar 2022 01:28:31 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648085311.33.0.231276156449.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: > Performance wise... The SHA series have hardware acceleration on > modern CPUs and SoCs. External libraries such as OpenSSL are in a > position to provide implementations that make use of that. Same with > the Linux Kernel CryptoAPI (https://bugs.python.org/issue47102). > > Hardware accelerated SHAs are likely faster than blake3 single core. > And certainly more efficient in terms of watt-secs/byte. I don't know if OpenSSL currently uses the Intel SHA1 extensions. A quick google suggests they added support in 2017. And: * I'm using a recent CPU that AFAICT supports those extensions. (AMD 5950X) * My Python build with BLAKE3 support is using the OpenSSL implementation of SHA1 (_hashlib.openssl_sha1), which I believe is using the OpenSSL provided by the OS. (I haven't built my own OpenSSL or anything.) * I'm using a recent operating system release (Pop!_OS 21.10), which currently has OpenSSL version 1.1.1l-1ubuntu1.1 installed. * My Python build with BLAKE3 doesn't support multithreaded hashing. * In that Python build, BLAKE3 is roughly twice as fast as SHA1 for non-trivial workloads. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:10:23 2022 From: report at bugs.python.org (h-vetinari) Date: Thu, 24 Mar 2022 02:10:23 +0000 Subject: [issue46657] Add mimalloc memory allocator In-Reply-To: <1644158952.9.0.443530192167.issue46657@roundup.psfhosted.org> Message-ID: <1648087823.63.0.701912590723.issue46657@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 23 22:15:13 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 24 Mar 2022 02:15:13 +0000 Subject: [issue46480] Implement typing.assert_type In-Reply-To: <1642915152.65.0.424582308271.issue46480@roundup.psfhosted.org> Message-ID: <1648088113.47.0.928506267057.issue46480@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 3354245daf89ca2c760c2c3e5b69a571f25073ed by Shantanu in branch 'main': bpo-46480: rephrase typing.assert_type docs (GH-32069) https://github.com/python/cpython/commit/3354245daf89ca2c760c2c3e5b69a571f25073ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 00:13:41 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 24 Mar 2022 04:13:41 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1648095221.2.0.297295366393.issue47000@roundup.psfhosted.org> Inada Naoki added the comment: I am not sure about we really need "locale encoding at Python startup". For this issue, I don't want to change `encoding="locale"` behavior except ignore UTF-8 mode. So what I want is "current locale encoding" or ANSI codepage on Windows. On the other hand, I know Eryk wants to support locale on Windows. So `locale.get_encoding()` might return current locale encoding (not ANSI codepage) even on Windows. If so, I will use `sys.getlocaleencoding()` to implement `encoding="locale"` to keep using ANSI codepage, instead of adding yet another "get locale encoding" function. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 00:32:00 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 24 Mar 2022 04:32:00 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648096320.55.0.60884182679.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: First of all, this is just deprecating direct access of `ob_shash`. This makes users need to use `PyObject_Hash()`. We don't make the final decision about removing it. We just make we can remove it in Python 3.13. RAM and CACHE efficiency is not the only motivation for this. There is a discussion about (1) increasing CoW efficiency, and (2) sharing data between subinterpreters after per-interpreter GIL. Removing ob_shash will help them, especially about the (2). But if we stop using bytes objects in code objects by Python 3.13, there is no need to remove ob_shash. > If put a bytes object into multiple dicts/sets, the hash need to be computed multiple times. This seems a common usage. Doesn't it lose only some milliseconds? I posted remove-bytes-hash.patch in this issue. Would you measure how this affects whole application performance rather than micro benchmarks? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 00:32:51 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 24 Mar 2022 04:32:51 +0000 Subject: [issue18241] Add unique option to heapq functions In-Reply-To: <1371480242.24.0.0078060677529.issue18241@psf.upfronthosting.co.za> Message-ID: <1648096371.99.0.00933904807383.issue18241@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 01:00:10 2022 From: report at bugs.python.org (Alex Hedges) Date: Thu, 24 Mar 2022 05:00:10 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h Message-ID: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> New submission from Alex Hedges : The documentation page for the grp module says to "see ", even though the source code (https://github.com/python/cpython/blob/v3.11.0a6/Modules/grpmodule.c) uses grp.h. I plan to release a PR for this shortly. ---------- assignee: docs at python components: Documentation messages: 415924 nosy: aphedges, docs at python priority: normal severity: normal status: open title: [Doc] grp cites pwd.h instead of grp.h versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 01:04:27 2022 From: report at bugs.python.org (Alex Hedges) Date: Thu, 24 Mar 2022 05:04:27 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648098267.16.0.334116936054.issue47105@roundup.psfhosted.org> Change by Alex Hedges : ---------- keywords: +patch pull_requests: +30176 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 03:22:52 2022 From: report at bugs.python.org (Ma Lin) Date: Thu, 24 Mar 2022 07:22:52 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648106572.01.0.224830125924.issue46864@roundup.psfhosted.org> Ma Lin added the comment: > I posted remove-bytes-hash.patch in this issue. Would you measure how this affects whole application performance rather than micro benchmarks? I guess not much difference in benchmarks. But if put a bytes object into multiple dicts/sets, and len(bytes_key) is large, it will take a long time. (1 GiB 0.40 seconds on i5-11500 DDR4-3200) The length of bytes can be arbitrary?so computing time may be very different. Is it possible to let code objects use other types? In addition to ob_hash, maybe the extra byte \x00 at the end can be saved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 03:42:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2022 07:42:08 +0000 Subject: [issue47106] test_asyncio: test_shutdown_cleanly() failed with timeout (10 seconds) on slow x86 Gentoo Non-Debug with X 3.x Message-ID: <1648107728.15.0.548883065453.issue47106@roundup.psfhosted.org> New submission from STINNER Victor : test_shutdown_cleanly() of test_asyncio failed on x86 Gentoo Non-Debug with X 3.x with a timeout of 10 seconds: https://buildbot.python.org/all/#/builders/58/builds/1958 asyncio uses a default timeout of 60 seconds for a TLS handshake, but the test takes makes 6x shorter: use a timeout of 10 seconds, I'm not sure why. To support slow buildbots, I would suggest to use *longer* timeout than the default, not *shorter* timeouts. test_ssl uses various values for the TLS timeout: * 1.0 second * 10.0 seconds * 40.0 seconds * 60.0 seconds Would it be possible to make these values more consistent? You may want to use on of test.support timeout which has a value depending on regrtest --timeout parameter: on slow buildbots, these values are larger. * LOOPBACK_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT * INTERNET_TIMEOUT * Documentation: https://docs.python.org/dev/library/test.html#test.support.LOOPBACK_TIMEOUT I would recommend using SHORT_TIMEOUT. x86 Gentoo Non-Debug with X 3.x uses "--timeout=2100" option: "0:00:00 load avg: 2.89 Run tests in parallel using 2 child processes (timeout: 35 min, worker timeout: 40 min)" Logs: 0:35:34 load avg: 3.13 Re-running test_asyncio in verbose mode (matching: test_shutdown_cleanly) test_shutdown_cleanly (test.test_asyncio.test_ssl.TestSSL) ... Warning -- Uncaught thread exception: AssertionError Exception in thread test-server: Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1706, in _run self._handle_client(conn) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1717, in _handle_client self._prog(TestSocketWrapper(sock)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1183, in server sock.unwrap() ^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/ssl.py", line 1321, in unwrap s = self._sslobj.shutdown() ^^^^^^^^^^^^^^^^^^^^^^^ TimeoutError: The read operation timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/threading.py", line 1031, in _bootstrap_inner self.run() ^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1675, in run self._run() ^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1714, in _run self._test._abort_socket_test(ex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 163, in _abort_socket_test self.fail(ex) ^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", line 671, in fail raise self.failureException(msg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: The read operation timed out ERROR Stderr: /buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/threading.py:1033: ResourceWarning: unclosed self._invoke_excepthook(self) ResourceWarning: Enable tracemalloc to get the object allocation traceback /buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/selector_events.py:834: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=27> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback ====================================================================== ERROR: test_shutdown_cleanly (test.test_asyncio.test_ssl.TestSSL) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 155, in _silence_eof_received_warning yield ^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1228, in test_shutdown_cleanly run(client) ^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1222, in run self.loop.run_until_complete( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1213, in _gather return await asyncio.gather(*tasks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1191, in client reader, writer = await asyncio.open_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/streams.py", line 47, in open_connection transport, _ = await loop.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/base_events.py", line 1098, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/base_events.py", line 1131, in _create_connection_transport await waiter ^^^^^^^^^^^^ ConnectionAbortedError: SSL handshake is taking longer than 10.0 seconds: aborting the connection Stderr: /buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/threading.py:1033: ResourceWarning: unclosed self._invoke_excepthook(self) ResourceWarning: Enable tracemalloc to get the object allocation traceback ---------------------------------------------------------------------- Ran 1 test in 16.068s FAILED (errors=1) test test_asyncio failed 1 test failed again: test_asyncio ---------- components: Tests messages: 415926 nosy: vstinner priority: normal severity: normal status: open title: test_asyncio: test_shutdown_cleanly() failed with timeout (10 seconds) on slow x86 Gentoo Non-Debug with X 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 03:51:33 2022 From: report at bugs.python.org (Inada Naoki) Date: Thu, 24 Mar 2022 07:51:33 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648108293.56.0.419184788496.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: > I guess not much difference in benchmarks. > But if put a bytes object into multiple dicts/sets, and len(bytes_key) is large, it will take a long time. (1 GiB 0.40 seconds on i5-11500 DDR4-3200) > The length of bytes can be arbitrary?so computing time may be very different. I don't think calculating hash() for large bytes is not so common use case. Rare use cases may not justify adding 8bytes to basic types, especially users expect it is compact. Balance is important. Microbenchmark for specific case doesn't guarantee the good balance. So I want real world examples. Do you know some popular libraries that are depending on hash(bytes) performance? > Is it possible to let code objects use other types? In addition to ob_hash, maybe the extra byte \x00 at the end can be saved. Of course, it is possible. But it needs large refactoring around code, including pyc cache file format. I will try it before 3.13. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 04:27:39 2022 From: report at bugs.python.org (colorfulappl) Date: Thu, 24 Mar 2022 08:27:39 +0000 Subject: [issue20291] Argument Clinic should understand *args and **kwargs parameters In-Reply-To: <1390010125.91.0.58212727704.issue20291@psf.upfronthosting.co.za> Message-ID: <1648110459.54.0.519379260184.issue20291@roundup.psfhosted.org> Change by colorfulappl : ---------- pull_requests: +30177 pull_request: https://github.com/python/cpython/pull/32092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 04:56:47 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 24 Mar 2022 08:56:47 +0000 Subject: [issue22608] test_socket fails with sem_init: Too many open files In-Reply-To: <1413026581.56.0.334221063135.issue22608@psf.upfronthosting.co.za> Message-ID: <1648112207.64.0.677380456591.issue22608@roundup.psfhosted.org> Serhiy Storchaka added the comment: Note that it is a FreeBSD-only issue. We need to test on FreeBSD (ulimit -n can be used for this) to check whether it was fixed in issue45212. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 05:02:19 2022 From: report at bugs.python.org (Charlie Zhao) Date: Thu, 24 Mar 2022 09:02:19 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1648112539.95.0.269044150679.issue47031@roundup.psfhosted.org> Charlie Zhao added the comment: > "Due to the requirements of the `IEEE-754 standard `_, math.nan and float('nan') are never equal to any other value, including themselves. Use math.isnan to test for NANs." It seems to me, Steven's description is clear enough to tell us that "Be careful if you want to compare NANs with others". One thing to emphasize is that neither `is` nor `==` is a best practice, just like slateny's example, we should be wary of the difference between `float('nan')` and `math.nan`. Adding an example to the docs would be a good way to let everyone know the difference and use `math.isnan` instead of `is` and `==` to test for NANs. ---------- nosy: +CharlieZhao _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 05:29:54 2022 From: report at bugs.python.org (stephan) Date: Thu, 24 Mar 2022 09:29:54 +0000 Subject: [issue47107] Navigation bar in python3103.chm is broken Message-ID: <1648114194.88.0.410682635548.issue47107@roundup.psfhosted.org> New submission from stephan : As you see in 2022-03-24_python3.10.3.png the navigation bar in python3103.chm is broken. In 2022-03-24_python3.10.2.png you see the same the same for python3102.chm. I suppose it would make sense: - to hide this navigation bar when you create a chm - to have a file download of the html docs as zip file for offline working (like in the djangoproject.com) ---------- assignee: docs at python components: Documentation, Windows files: 2022-03-24_python3.10.3.png messages: 415930 nosy: docs at python, paul.moore, stephan, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Navigation bar in python3103.chm is broken versions: Python 3.11 Added file: https://bugs.python.org/file50697/2022-03-24_python3.10.3.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 05:30:16 2022 From: report at bugs.python.org (stephan) Date: Thu, 24 Mar 2022 09:30:16 +0000 Subject: [issue47107] Navigation bar in python3103.chm is broken In-Reply-To: <1648114194.88.0.410682635548.issue47107@roundup.psfhosted.org> Message-ID: <1648114216.81.0.326458930053.issue47107@roundup.psfhosted.org> stephan added the comment: added screenshot ---------- Added file: https://bugs.python.org/file50698/2022-03-24_python3.10.3.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 05:59:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 09:59:46 +0000 Subject: [issue27817] tkinter string variable misinterpreted as boolean In-Reply-To: <1471711827.55.0.419886306441.issue27817@psf.upfronthosting.co.za> Message-ID: <1648115986.05.0.930764008724.issue27817@roundup.psfhosted.org> Irit Katriel added the comment: This problem was reported for 2.7 without a manageable reproducer. I suggest we close it because it's unlikely that anyone will want to investigate this now unless it's reported again for a supported python version. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 05:59:49 2022 From: report at bugs.python.org (Christian Bodt) Date: Thu, 24 Mar 2022 09:59:49 +0000 Subject: [issue47108] asyncio-stream does not document exceptions Message-ID: <1648115989.95.0.156752544907.issue47108@roundup.psfhosted.org> New submission from Christian Bodt : reader.read() might raise ConnectionResetError and possibly other exceptions, but this is not explained in the documentation. See this stacktrace example: Traceback (most recent call last): File "D:\Dropbox\repos\wxasync\src\examples\server.py", line 23, in handle_connection data = await reader.read(100) File "C:\Python-3.9\lib\asyncio\streams.py", line 684, in read await self._wait_for_data('read') File "C:\Python-3.9\lib\asyncio\streams.py", line 517, in _wait_for_data await self._waiter File "C:\Python-3.9\lib\asyncio\proactor_events.py", line 280, in _loop_reading data = fut.result() File "C:\Python-3.9\lib\asyncio\windows_events.py", line 812, in _poll value = callback(transferred, key, ov) File "C:\Python-3.9\lib\asyncio\windows_events.py", line 461, in finish_recv raise ConnectionResetError(*exc.args) ConnectionResetError: [WinError 64] Le nom r?seau sp?cifi? n?est plus disponible ---------- assignee: docs at python components: Documentation messages: 415933 nosy: christian.bodt, docs at python priority: normal severity: normal status: open title: asyncio-stream does not document exceptions versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 06:42:44 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 24 Mar 2022 10:42:44 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647681720.77.0.488206313713.issue47031@roundup.psfhosted.org> Message-ID: <20220324104109.GN8276@ando.pearwood.info> Steven D'Aprano added the comment: > We cannot guarantee that NAN never equal to anything, because we can > create an object equal to it. For example mock.ANY Sure. I don't expect that mock.ANY or other weird objects should obey the IEEE-754 rules. But we're talking numeric comparisons here, not arbitrary objects which may do arbitrary things in their `__eq__` method. The documentation for the math module assumes we're talking about sensible, standard numeric values that don't play strange tricks on the caller. Look at the first function documented: math.ceil(x) Return the ceiling of x, the smallest integer greater than or equal to x. If x is not a float, delegates to x.__ceil__(), which should return an Integral value. class MyWeirdFloat(float): def __ceil__(self): return -1 math.ceil(MyWeirdFloat(25.9)) # Returns -1 instead of the ceiling. Does the documentation really need to cover every imaginable weird class? I don't think so. Let's keep it simple. NANs compared unequal with all numeric values which directly or indirectly obey IEEE-754, which includes floats. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 06:44:34 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Thu, 24 Mar 2022 10:44:34 +0000 Subject: [issue47109] Old ctypes.macholib tests are ignored by python -m test Message-ID: <1648118674.66.0.179855713714.issue47109@roundup.psfhosted.org> New submission from Oleg Iarygin : Some tests for `ctypes.macholib.dyld` and all tests for `ctypes.macholib.dylib` and `ctypes.macholib.framework` are located outside of expected `ctypes.test` module and were not ported from `assert` to `unittest` facilities. This causes the following problems: - the tests aren't run by `python -m test` so they are effectively dead - an end user can run them by `python -m ctypes.macholib.dyld`, `python -m ctypes.macholib.dylib`, and `python -m ctypes.macholib.framework` - they are available even if a user chose to install CPython without tests ---------- components: Tests messages: 415935 nosy: arhadthedev priority: normal severity: normal status: open title: Old ctypes.macholib tests are ignored by python -m test 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 Thu Mar 24 06:44:47 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Thu, 24 Mar 2022 10:44:47 +0000 Subject: [issue47109] Old ctypes.macholib tests are ignored by python -m test In-Reply-To: <1648118674.66.0.179855713714.issue47109@roundup.psfhosted.org> Message-ID: <1648118687.16.0.124837176981.issue47109@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +30178 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32094 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 07:42:15 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Mar 2022 11:42:15 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1648122135.78.0.370011664526.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30179 pull_request: https://github.com/python/cpython/pull/32095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:08:23 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 24 Mar 2022 12:08:23 +0000 Subject: [issue47107] Navigation bar in python3103.chm is broken In-Reply-To: <1648114194.88.0.410682635548.issue47107@roundup.psfhosted.org> Message-ID: <1648123703.87.0.124927093873.issue47107@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the report. This is a duplicate of issue47051 (and also no longer applies to 3.11 because we've removed the CHM file completely and now ship all the HTML files). ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harder to read serif font. versions: +Python 3.10 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:15:47 2022 From: report at bugs.python.org (Thomas Fischbacher) Date: Thu, 24 Mar 2022 12:15:47 +0000 Subject: [issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are. In-Reply-To: <1646905486.67.0.783441302019.issue46972@roundup.psfhosted.org> Message-ID: <1648124147.58.0.0290389614707.issue46972@roundup.psfhosted.org> Thomas Fischbacher added the comment: Addendum Serhiy, I agree that my assessment was incorrect. It actually is unittest/mock.py that has quite a few 'raise AssertionError' that are not coming from an 'assert' keyword statement. At a deeper level, the problem here is as follows: Every programming language has to make an awkward choice: either it excludes some authors ("must be forklift certified"), or it adds a lot of bureaucratic scaffolding to have some mechanisms that allow code authors to enforce API contracts (as if this would help to "keep out the tide" of unprincipled code authors), or it takes a more relaxed perspective - as also Perl did - of "we are all responsible users" / "do not do this because you are not invited, not because the owner has a shotgun". I'd call this third approach quite reasonable overall, but then the understanding is that "everybody treats documentation as binding and knows how to write good documentation". After all, we need to be able to reason about code, and in order to do that, it matters to have guarantees such as for example: "Looking up a nonexistent key for a mapping by evaluating the_mapping[the_key] can raise an exception, and when it does, that exception is guaranteed to be an instance of KeyError". Unfortunately, Python on the one hand emphasizes "responsible behavior" - i.e. "people know how to write and read documentation, and the written documentation creates a shared understanding between its author and reader", but on the other hand is often really bad at properly documenting its interfaces. If I had to name one thing that really needs fixing with Python, it would be this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:24:58 2022 From: report at bugs.python.org (stephan) Date: Thu, 24 Mar 2022 12:24:58 +0000 Subject: [issue47107] Navigation bar in python3103.chm is broken In-Reply-To: <1648114194.88.0.410682635548.issue47107@roundup.psfhosted.org> Message-ID: <1648124698.8.0.815940728619.issue47107@roundup.psfhosted.org> stephan added the comment: Good idea with the html files, thank you (by the way I still love the chm because its compact and fast) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:49:12 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Thu, 24 Mar 2022 12:49:12 +0000 Subject: [issue47110] Refactor bytearray strip methods Message-ID: <1648126152.91.0.690193890673.issue47110@roundup.psfhosted.org> New submission from Pieter Eendebak : The bytearray strip, lstrip and rstrip methods contain a lot of duplicated code. ---------- components: Interpreter Core messages: 415939 nosy: pieter.eendebak priority: normal severity: normal status: open title: Refactor bytearray strip methods versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 08:51:34 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Thu, 24 Mar 2022 12:51:34 +0000 Subject: [issue47110] Refactor bytearray strip methods In-Reply-To: <1648126152.91.0.690193890673.issue47110@roundup.psfhosted.org> Message-ID: <1648126294.72.0.520644687415.issue47110@roundup.psfhosted.org> Change by Pieter Eendebak : ---------- keywords: +patch pull_requests: +30180 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:23:23 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 24 Mar 2022 13:23:23 +0000 Subject: [issue40465] Deprecate the optional *random* argument to random.shuffle() In-Reply-To: <1588321901.81.0.617278241299.issue40465@roundup.psfhosted.org> Message-ID: <1648128203.14.0.879728433091.issue40465@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 12c0012cf97d21bc637056983ede0eaf4c0d9c33 by Tom?? Hrn?iar in branch 'main': bpo-40465: Document random module changes in 3.11 What's new (#31818) https://github.com/python/cpython/commit/12c0012cf97d21bc637056983ede0eaf4c0d9c33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:29:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Mar 2022 13:29:22 +0000 Subject: [issue40465] Deprecate the optional *random* argument to random.shuffle() In-Reply-To: <1588321901.81.0.617278241299.issue40465@roundup.psfhosted.org> Message-ID: <1648128562.97.0.406504368403.issue40465@roundup.psfhosted.org> STINNER Victor added the comment: commit 70a071d9e1d65f8c168b4b96a18c86d5230789c5 Author: Raymond Hettinger Date: Tue May 4 01:55:40 2021 -0700 bpo-40465: Remove random module features deprecated in 3.9 (GH-25874) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 09:43:49 2022 From: report at bugs.python.org (Benyamin Guedj) Date: Thu, 24 Mar 2022 13:43:49 +0000 Subject: [issue47111] ENUM TypeError using mixing Message-ID: <1648129429.6.0.678446236905.issue47111@roundup.psfhosted.org> New submission from Benyamin Guedj : when trying to implement mixing with enum ```python from typing import Tuple from enum import Enum class Blah(Tuple[str, ...], Enum): val = ('a', 'b') ``` >>> from typing import Tuple >>> from enum import Enum >>> class Blah(Tuple[str, ...], Enum): ... val = ('a', 'b') ... Traceback (most recent call last): File "", line 1, in File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\enum.py", line 150, in __prepare__ member_type, first_enum = metacls._get_mixins_(cls, bases) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\enum.py", line 574, in _get_mixins_ member_type = _find_data_type(bases) or object File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\enum.py", line 562, in _find_data_type raise TypeError('%r: too many data types: %r' % (class_name, data_types)) TypeError: 'Blah': too many data types: [, ] note: the same code work on python 3.7, 3.9, 3.10 I have checked the source code of enum of 3.8 https://github.com/python/cpython/blob/3.8/Lib/enum.py and it's not the same as the other version https://github.com/python/cpython/blob/3.9/Lib/enum.py ---------- components: Library (Lib) messages: 415942 nosy: benyamin621 priority: normal severity: normal status: open title: ENUM TypeError using mixing type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:07:04 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 24 Mar 2022 14:07:04 +0000 Subject: [issue47083] The __complex__ method is missing from the complex, float, and int built-in types In-Reply-To: <1647882580.13.0.610930198027.issue47083@roundup.psfhosted.org> Message-ID: <1648130824.44.0.330121001674.issue47083@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10, mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:37:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 14:37:23 +0000 Subject: [issue17246] inspect.getargvalues fails if arg name is not bound to a value In-Reply-To: <1361312556.73.0.83895942435.issue17246@psf.upfronthosting.co.za> Message-ID: <1648132643.42.0.136374437061.issue17246@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy -patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:49:14 2022 From: report at bugs.python.org (Ethan Furman) Date: Thu, 24 Mar 2022 14:49:14 +0000 Subject: [issue47111] ENUM TypeError using mixing In-Reply-To: <1648129429.6.0.678446236905.issue47111@roundup.psfhosted.org> Message-ID: <1648133354.18.0.546381141733.issue47111@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:50:33 2022 From: report at bugs.python.org (ty) Date: Thu, 24 Mar 2022 14:50:33 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648133433.48.0.516500161667.issue44493@roundup.psfhosted.org> ty added the comment: I think I have already provided enough information about this bug. The `len_ret` was the length of `sockaddr_un`, which should include the terminated NUL in the `sun_path`. But the original implementation only use `path.len + offsetof(struct sockaddr_un, sun_path)`. References: 1. https://man7.org/linux/man-pages/man7/unix.7.html The Address format section. 2. The `SUN_LEN` macro in *BSD systems, https://man.cx/unix(4) ---------- versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 10:55:59 2022 From: report at bugs.python.org (ty) Date: Thu, 24 Mar 2022 14:55:59 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648133759.36.0.0430293609352.issue44493@roundup.psfhosted.org> ty added the comment: Ping Heimes. This is a huge bug that exists for a very long time, please consider merge it and fix it in the next relesae. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:15:52 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Mar 2022 15:15:52 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648134952.29.0.443738923002.issue44493@roundup.psfhosted.org> Christian Heimes added the comment: Antoine, Serhiy, please take a look. You are the last developers that touched the AF_UNIX socket path code. Ty, why are you pinging me on this issue or on the PR? I'm neither familiar with that code nor responsible for it. ---------- components: +Extension Modules -Library (Lib) nosy: +pitrou, serhiy.storchaka type: behavior -> resource usage versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:32:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 15:32:53 +0000 Subject: [issue28948] Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer In-Reply-To: <1481549706.57.0.80853202455.issue28948@psf.upfronthosting.co.za> Message-ID: <1648135973.62.0.474457812646.issue28948@roundup.psfhosted.org> Irit Katriel added the comment: This was reported for 3.6 and there was not enough information to figure out what the problem is. I am closing it because it's unlikely that anyone will be do anything about this unless it is reported again for a current Python version, and with more information. ---------- nosy: +iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:32:54 2022 From: report at bugs.python.org (ty) Date: Thu, 24 Mar 2022 15:32:54 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648135974.77.0.112508416149.issue44493@roundup.psfhosted.org> ty added the comment: Sorry Heimes. I just don't know who is responsible for this code, which is very very old. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:35:01 2022 From: report at bugs.python.org (Jack O'Connor) Date: Thu, 24 Mar 2022 15:35:01 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648136101.7.0.899855839632.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: > Hardware accelerated SHAs are likely faster than blake3 single core. Surprisingly, they're not. Here's a quick measurement on my recent ThinkPad laptop (64 KiB of input, single-threaded, TurboBoost left on), which supports both AVX-512 and the SHA extensions: OpenSSL SHA-256: 1816 MB/s OpenSSL SHA-1: 2103 MB/s BLAKE3 SSE2: 2109 MB/s BLAKE3 SSE4.1: 2474 MB/s BLAKE3 AVX2: 4898 MB/s BLAKE3 AVX-512: 8754 MB/s The main reason SHA-1 and SHA-256 don't do better is that they're fundamentally serial algorithms. Hardware acceleration can speed up a single instance of their compression functions, but there's just no way for it to run more than one instance per message at a time. In contrast, AES-CTR can easily parallelize its blocks, and hardware accelerated AES does beat BLAKE3. > And certainly more efficient in terms of watt-secs/byte. I don't have any experience measuring power myself, so take this with a grain of salt: I think the difference in throughput shown above is large enough that, even accounting for the famously high power draw of AVX-512, BLAKE3 comes out ahead in terms of energy/byte. Probably not on ARM though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:37:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 15:37:26 +0000 Subject: [issue37665] threading.TIMEOUT_MAX integer overflow on 32-bit builds with threading.Thread.join In-Reply-To: <1563925364.59.0.529540614468.issue37665@roundup.psfhosted.org> Message-ID: <1648136246.5.0.971854315759.issue37665@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> undefined behaviour: signed integer overflow in threadmodule.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:39:02 2022 From: report at bugs.python.org (ty) Date: Thu, 24 Mar 2022 15:39:02 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648136342.32.0.782664081362.issue44493@roundup.psfhosted.org> ty added the comment: More about the tests: The error will only shows on BSD systems, for example macOS. Here are some tests done with C and Rust: https://github.com/rust-lang/rust/issues/69061 If both the servers and clients are written in Python, you won't notice this bug because the original code ignored the length of sockaddr_un and use the sun_path as a C string (NUL terminated string). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:40:47 2022 From: report at bugs.python.org (ty) Date: Thu, 24 Mar 2022 15:40:47 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648136447.38.0.0146457797073.issue44493@roundup.psfhosted.org> ty added the comment: Oh, it should also occurs on Linux, I should correct that. ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:45:44 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Mar 2022 15:45:44 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648136744.32.0.119362581501.issue39298@roundup.psfhosted.org> Christian Heimes added the comment: sha1 should be considered broken anyway and sha256 does not perform well on 64bit systems. Truncated sha512 (sha512-256) typically performs 40% faster than sha256 on X86_64. It should get you close to the performance of BLAKE3 SSE4.1 on your system. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:56:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 24 Mar 2022 15:56:59 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648137419.74.0.177879069388.issue44493@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 11:58:32 2022 From: report at bugs.python.org (Jack O'Connor) Date: Thu, 24 Mar 2022 15:58:32 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648137512.38.0.0156704028935.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: > Truncated sha512 (sha512-256) typically performs 40% faster than sha256 on X86_64. Without hardware acceleration, yes. But because SHA-NI includes only SHA-1 and SHA-256, and not SHA-512, it's no longer a level playing field. OpenSSL's SHA-512 and SHA-512/256 both get about 797 MB/s on my machine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:01:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Mar 2022 16:01:38 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648137698.68.0.12802134759.issue44493@roundup.psfhosted.org> Christian Heimes added the comment: We have a dedicated team of volunteers that triage incoming tickets. They assign tickets and ping experts. It looks like nobody triaged your submissions because nobody understood it. Your ticket did not contain an explanation and the link now goes to an unrelated line in the code. That is the reason I asked you to provide detailed information on the ticket. We have over 7,000 open tickets and over 1,600 open PRs. Your issue got lost in the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:13:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 16:13:14 +0000 Subject: [issue37430] [doc] range is not a built-in function In-Reply-To: <1561649972.91.0.461406342746.issue37430@roundup.psfhosted.org> Message-ID: <1648138394.27.0.606668517649.issue37430@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: range is not a built-in function -> [doc] range is not a built-in function versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:27:15 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 16:27:15 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648139235.83.0.162384333217.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: sqlite3_crash.py does not crashes on python 3.9 below and equal 3.9.9 and python main branch 12c0012cf97d21bc637056983ede0eaf4c0d9c33. I confirm it crashes on python 3.9.10, 3.9.11, 3.10 branch commit 9006b4471cc4d74d0cbf782d841a330b0f46a3d0 . It is fixed in main branch commit 12c0012cf97d21bc637056983ede0eaf4c0d9c33 . Currently bisecting both 3.9.9 to 3.9.10 and 3.10 to 3.11 main branch for bad to good. The patches in this bug report are already merged in the 3.10 branch which crash. I cannot reproduce win_py399_crash_reproducer.py which I used as a basis for this test case. The backtrace is the same as the ones from the crashes of the kodi addons (me Jellyfin Kodi addon), which is the initial report . This looks like importing sqlite3 in threads plays badly. I can reproduce on aarch64 (Odroid C2) LibreElec and builds of cpython on Debian stable x86_64 (the extensive testing of the broken interpreters is done on x86_64 Debian stable bullseye with a cpython clone and running from builddir). ---------- nosy: +prahal Added file: https://bugs.python.org/file50699/sqlite3_crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:29:53 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 24 Mar 2022 16:29:53 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648139393.6.0.909556048993.issue44493@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am not the socket programming expert. It just happened that I fixed some bugs here. But according to the manpage https://man7.org/linux/man-pages/man7/unix.7.html the address length should include the terminating NUL: offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1. So the fix is correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:33:06 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 16:33:06 +0000 Subject: [issue26362] Approved API for creating a temporary file path In-Reply-To: <1455502271.6.0.558905453707.issue26362@psf.upfronthosting.co.za> Message-ID: <1648139586.75.0.604026189119.issue26362@roundup.psfhosted.org> Irit Katriel added the comment: > So no, while unresolved, this bug report should not be closed. This is not a bug report, it's a feature request, and there is enough resistance in the discussion to reject it (according to the Status Quo Wins a Stalemate principle). What may be unresolved is the problem you were trying to solve with the new feature you requested. Rather than arguing for this particular solution, I would suggest that you start a discussion about the problem and possible solutions (the python-ideas list is one place where you could bring it up). ---------- nosy: +iritkatriel resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:28:37 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 16:28:37 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648139317.17.0.837697663153.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: By "It is fixed in main branch commit 12c0012cf97d21bc637056983ede0eaf4c0d9c33 ." I mean that this commit is good not that this commit fixes the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:40:38 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 24 Mar 2022 16:40:38 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648140038.74.0.496945609374.issue46864@roundup.psfhosted.org> Brandt Bucher added the comment: Just a note: as of this week (GH-31888), we no longer use bytes objects to store bytecode. Instead, the instructions are stored as part of the PyCodeObject struct. (Of course, we still use bytes objects for the various exception handling and debugging tables attached to code objects, but these are very cold fields by comparison.) Not to say this work isn't worthwhile, but it probably isn't worth doing for `co_code` *alone*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:40:40 2022 From: report at bugs.python.org (Battant) Date: Thu, 24 Mar 2022 16:40:40 +0000 Subject: [issue35905] macOS build docs need refresh (2019) In-Reply-To: <1549411942.7.0.0722764247373.issue35905@roundup.psfhosted.org> Message-ID: <1648140040.17.0.803632929676.issue35905@roundup.psfhosted.org> Battant added the comment: Hello, I tried to configure my installation according your instructions Her's step I follow export CPPFLAGS="-I$(brew --prefix sqlite3)/include -I$(brew --prefix zlib)/include"export LDFLAGS="-L$(brew --prefix sqlite3)/lib -L$(brew --prefix zlib)/lib" export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" python3.10 pip-run -m jaraco.develop -- -m jaraco.develop.macos-build-python /opt/homebrew/Cellar/python at 3.10/3.10.2/bin/python3.10: can't open file ' .../cpytonpip-run': [Errno 2] No such file or directory in the cpython directory : run commands export CPPFLAGS="-I$(brew --prefix sqlite3)/include -I$(brew --prefix zlib)/include" export LDFLAGS="-L$(brew --prefix sqlite3)/lib -L$(brew --prefix zlib)/lib export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" ./configure -with-pydebug --with-tcltk-includes="-I/Library/Frameworks/Tcl.framework/Headers -I/Library/Frameworks/Tk.framework/Headers" --with-tcltk-libs="/Library/Frameworks/Tcl.framework/Tcl /Library/Frameworks/Tk.framework/Tk" --enable-optimizations make clean make -j8 gcc -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/zlib/lib -fno-semantic-interposition -fprofile-instr-generate -Wl,-stack_size,1000000 -framework CoreFoundation -o python.exe Programs/python.o libpython3.10d.a -ldl -framework CoreFoundation gcc -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/zlib/lib -fno-semantic-interposition -fprofile-instr-generate -Wl,-stack_size,1000000 -framework CoreFoundation -o Programs/_testembed Programs/_testembed.o libpython3.10d.a -ldl -framework CoreFoundation Undefined symbols for architecture arm64: "_libintl_bindtextdomain", referenced from: Undefined symbols for architecture arm64: "_libintl_bindtextdomain", referenced from: __locale_bindtextdomain_impl in libpython3.10d.a(_localemodule.o) __locale_bindtextdomain_impl in libpython3.10d.a(_localemodule.o) "_libintl_dcgettext", referenced from: "_libintl_dcgettext", referenced from: __locale_dcgettext_impl in libpython3.10d.a(_localemodule.o) __locale_dcgettext_impl in libpython3.10d.a(_localemodule.o) "_libintl_dgettext", referenced from: "_libintl_dgettext", referenced from: __locale_dgettext_impl in libpython3.10d.a(_localemodule.o) __locale_dgettext_impl in libpython3.10d.a(_localemodule.o) "_libintl_gettext", referenced from: "_libintl_gettext", referenced from: __locale_gettext_impl in libpython3.10d.a(_localemodule.o) __locale_gettext_impl in libpython3.10d.a(_localemodule.o) "_libintl_setlocale", referenced from: "_libintl_setlocale", referenced from: __locale_setlocale_impl in libpython3.10d.a(_localemodule.o) _locale_decode_monetary in libpython3.10d.a(_localemodule.o) __locale_setlocale_impl in libpython3.10d.a(_localemodule.o) _locale_decode_monetary in libpython3.10d.a(_localemodule.o) "_libintl_textdomain", referenced from: "_libintl_textdomain", referenced from: __locale_textdomain_impl in libpython3.10d.a(_localemodule.o) __locale_textdomain_impl in libpython3.10d.a(_localemodule.o) ld: symbol(s) not found for architecture arm64 ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [Programs/_testembed] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: *** [python.exe] Error 1 make[2]: *** [build_all_generate_profile] Error 2 make[1]: *** [profile-gen-stamp] Error 2 make: *** [profile-run-stamp] Error 2 could you help me please to fixe this issus Best regards Battant ---------- nosy: +Battant _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 12:57:04 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 24 Mar 2022 16:57:04 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648141024.31.0.711036112765.issue39298@roundup.psfhosted.org> Gregory P. Smith added the comment: You missed the key "And certainly more efficient in terms of watt-secs/byte" part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:05:02 2022 From: report at bugs.python.org (penguin_wwy) Date: Thu, 24 Mar 2022 17:05:02 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1648141502.18.0.54419519818.issue46841@roundup.psfhosted.org> Change by penguin_wwy <940375606 at qq.com>: ---------- nosy: +penguin_wwy nosy_count: 4.0 -> 5.0 pull_requests: +30181 pull_request: https://github.com/python/cpython/pull/32099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:06:04 2022 From: report at bugs.python.org (Ramsey Thomson) Date: Thu, 24 Mar 2022 17:06:04 +0000 Subject: [issue47112] RuntimeError: expected scalar type Long but found Int Message-ID: <1648141564.18.0.17781153742.issue47112@roundup.psfhosted.org> New submission from Ramsey Thomson : Line 2846 of ~\anaconda3\lib\site-packages\torch\nn\functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction, label_smoothing) results in > RuntimeError: expected scalar type Long but found Int The above is called from line 1150 of ~\anaconda3\lib\site-packages\torch\nn\modules\loss.py in forward(self, input, target) which in turn is called from line 1102 of ~\anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs) ---------- components: Library (Lib) messages: 415961 nosy: Ramsey priority: normal severity: normal status: open title: RuntimeError: expected scalar type Long but found Int type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:16:30 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 24 Mar 2022 17:16:30 +0000 Subject: [issue47112] RuntimeError: expected scalar type Long but found Int In-Reply-To: <1648141564.18.0.17781153742.issue47112@roundup.psfhosted.org> Message-ID: <1648142190.57.0.107656575446.issue47112@roundup.psfhosted.org> Zachary Ware added the comment: This appears to be an issue with either your code or the third-party PyTorch package. You'll have better luck asking about this in a forum specific to PyTorch, or perhaps the `Users` category of discuss.python.org. ---------- nosy: +zach.ware resolution: -> third party stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:40:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 17:40:04 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1648143604.84.0.368192316381.issue46841@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +iritkatriel nosy_count: 5.0 -> 6.0 pull_requests: +30182 pull_request: https://github.com/python/cpython/pull/32100 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 13:41:24 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 17:41:24 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648143684.45.0.679095953773.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: I did 3.9 branch bisect and commit 52937c26adc35350ca0402070160cf6dc838f359 bpo-46070: _PyGC_Fini() untracks objects (GH-30577) (GH-30580) is the one that broke 3.9 . While with my main branch builds this commit is fine, it is not for the 3.9 branches. Proceeding with 3.10 branch bisect of first bad commit and redoing main branch first good commit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:24:20 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 18:24:20 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648146260.33.0.0114484428447.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: 3.10 branch is fixed if I revert e6bb17fe29713368e1fd93d9ac9611017c4f570c bpo-46070: _PyGC_Fini() untracks objects (GH-30577). Be it if I revert it atop current head 9006b4471cc4d74d0cbf782d841a330b0f46a3d0 or if I test the commit before e6bb17fe29713368e1fd93d9ac9611017c4f570c was merged. As this made no sense with regards to this bug report history that this fix broke the branch, I tried v3.10.1 which lacks this fix. Vanilla is broken too. Also applying the "_PyGC_Fini untracks objects" upon 3.10.1 does not fix the test case crash. I am puzzled. Will try to bisect the commit that fixed the testcase in the 3.10 branch before "_PyGC_Fini untracks objects" was merged and after 3.10.1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:27:29 2022 From: report at bugs.python.org (Zombo) Date: Thu, 24 Mar 2022 18:27:29 +0000 Subject: [issue47113] PermissionError on pip uninstall Message-ID: <1648146449.62.0.573957246169.issue47113@roundup.psfhosted.org> New submission from Zombo : I can install a package: pip install brotli but if I try to remove, it fails: PS D:\Desktop> pip uninstall -y brotli Found existing installation: Brotli 1.0.9 Uninstalling Brotli-1.0.9: Successfully uninstalled Brotli-1.0.9 ERROR: Exception: Traceback (most recent call last): File "C:\python\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper status = run_func(*args) File "C:\python\lib\site-packages\pip\_internal\commands\uninstall.py", line 102, in run uninstall_pathset.commit() File "C:\python\lib\site-packages\pip\_internal\req\req_uninstall.py", line 420, in commit self._moved_paths.commit() File "C:\python\lib\site-packages\pip\_internal\req\req_uninstall.py", line 273, in commit save_dir.cleanup() File "C:\python\lib\site-packages\pip\_internal\utils\temp_dir.py", line 173, in cleanup rmtree(self._path) File "C:\python\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 326, in wrapped_f return self(f, *args, **kw) File "C:\python\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 406, in __call__ do = self.iter(retry_state=retry_state) File "C:\python\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 362, in iter raise retry_exc.reraise() File "C:\python\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 195, in reraise raise self.last_attempt.result() File "concurrent\futures\_base.py", line 439, in result File "concurrent\futures\_base.py", line 391, in __get_result File "C:\python\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 409, in __call__ result = fn(*args, **kwargs) File "C:\python\lib\site-packages\pip\_internal\utils\misc.py", line 124, in rmtree shutil.rmtree(dir, ignore_errors=ignore_errors, onerror=rmtree_errorhandler) File "shutil.py", line 747, in rmtree File "shutil.py", line 617, in _rmtree_unsafe File "shutil.py", line 615, in _rmtree_unsafe PermissionError: [WinError 5] Access is denied: 'C:\\Windows\\Temp\\pip-uninstall-fi5xmcvd\\_brotli.cp310-win_amd64.pyd' whats strange is that after the failure, I can go back and manually remove the folder with no problem: PS D:\Desktop> python.exe Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.rmtree('C:\\Windows\\Temp\\pip-uninstall-fi5xmcvd') ---------- messages: 415965 nosy: 89z priority: normal severity: normal status: open title: PermissionError on pip uninstall versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:33:29 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 24 Mar 2022 18:33:29 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648146809.6.0.472582435744.issue44493@roundup.psfhosted.org> Gregory P. Smith added the comment: Bug filing tip for ty/zonyitoo: Describe the problem in the text when filing the bug. Include its consequences and how it is observed in practice. A bug filed just saying "look at this code, this is wrong" does not communicate a need for anyone to spend time on an issue or help others find an existing issue describing misbehavior they may be seeing. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:35:08 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 24 Mar 2022 18:35:08 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648146908.2.0.855411783636.issue44493@roundup.psfhosted.org> Gregory P. Smith added the comment: It looks like the length would be short by one in Python before this change, meaning binding or connecting to a non-anonymous named AF_UNIX socket potentially loses the last character of the path name intended to be bound? Depending on if the OS uses the length or trusts a null termination? That should be an observable behavior change. It also suggests that fixing this could break code that has been working around this bug forever by adding an extra character when binding or connecting to a non-anonymous AF_UNIX socket? Is that true? In what circumstances is this practically observed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:51:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 18:51:45 +0000 Subject: [issue22722] inheritable pipes are unwieldy without os.pipe2 In-Reply-To: <1414175114.21.0.89253014317.issue22722@psf.upfronthosting.co.za> Message-ID: <1648147905.6.0.207754241222.issue22722@roundup.psfhosted.org> Irit Katriel added the comment: Closing as this seems abandoned. Buck, if you want to bring it up again and explain the use case, please reopen this issue, create a new issue or post to python-ideas. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 14:54:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 18:54:44 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1648148084.39.0.580621342327.issue46841@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 2f49b97cc5426087b46515254b9a97a22ee8c807 by Irit Katriel in branch 'main': bpo-46841: remove no-longer-used macro UPDATE_PREV_INSTR_OPARG (GH-32100) https://github.com/python/cpython/commit/2f49b97cc5426087b46515254b9a97a22ee8c807 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 15:07:11 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 19:07:11 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648148831.19.0.164594765604.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: While bisecting main branch I did not only get segfaults but also exceptions, namely: $ ./python ../python-crash-kodi/sqlite3_crash.py Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 81, in register_adapters_and_converters register_adapter(datetime.datetime, adapt_datetime) KeyError: 'isoformat' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters register_converter("timestamp", convert_timestamp) KeyError: 'timepart_full' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters register_converter("timestamp", convert_timestamp) KeyError: 'day' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters register_converter("timestamp", convert_timestamp) KeyError: 'month' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters register_converter("timestamp", convert_timestamp) KeyError: 'year' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters register_converter("timestamp", convert_timestamp) KeyError: 'timepart' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters register_converter("timestamp", convert_timestamp) KeyError: 'datepart' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "", line 688, in _load_unlocked KeyError: 'convert_timestamp' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "", line 688, in _load_unlocked KeyError: 'convert_date' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "", line 688, in _load_unlocked KeyError: 'adapt_datetime' Exception ignored deletion of interned string failed: Traceback (most recent call last): File "", line 688, in _load_unlocked KeyError: 'adapt_date' The 3.10 branch bisect pointed to one commit that fix the crash after 3.10.1 which is 72c260cf0c71eb01eb13100b751e9d5007d00b70 [3.10] bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) (GH-30425) which makes sense regarding main branch logs. It is commit 35d6540c904ef07b8602ff014e520603f84b5886 in the main branch. What remains to be seen is why "bpo-46070: _PyGC_Fini() untracks objects (GH-30577)" looks fine in the main branch (though it has no effect on the import crash) and not in 3.9 and 3.10 branch. Mind in the main branch "bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422)" was already applied when "bpo-46070: _PyGC_Fini() untracks objects (GH-30577)" went in so it was also unrelated to the fix of the initial report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 15:25:03 2022 From: report at bugs.python.org (Andreas Kloeckner) Date: Thu, 24 Mar 2022 19:25:03 +0000 Subject: [issue21873] Tuple comparisons with NaNs are broken In-Reply-To: <1403771009.56.0.175285571524.issue21873@psf.upfronthosting.co.za> Message-ID: <1648149903.35.0.0649518173139.issue21873@roundup.psfhosted.org> Change by Andreas Kloeckner : ---------- nosy: +inducer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 15:51:26 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 24 Mar 2022 19:51:26 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1648151486.95.0.394299439093.issue47062@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 4119d2d7c9e25acd4f16994fb92d656f8b7816d7 by Andrew Svetlov in branch 'main': bpo-47062: Implement asyncio.Runner context manager (GH-31799) https://github.com/python/cpython/commit/4119d2d7c9e25acd4f16994fb92d656f8b7816d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 15:51:47 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 24 Mar 2022 19:51:47 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1648151507.8.0.469520732057.issue47062@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 16:26:29 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 24 Mar 2022 20:26:29 +0000 Subject: [issue47077] test_asyncio ignores exception in _ProactorBasePipeTransport.__del__: RuntimeError('Event loop is closed') In-Reply-To: <1647832996.85.0.556447634064.issue47077@roundup.psfhosted.org> Message-ID: <1648153589.34.0.124579053478.issue47077@roundup.psfhosted.org> Andrew Svetlov added the comment: Perhaps the proactor should just silently skip protocol events if the event loop is closed. Selector-based event loops do it implicitly already. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 16:30:46 2022 From: report at bugs.python.org (Jack O'Connor) Date: Thu, 24 Mar 2022 20:30:46 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1648153846.15.0.562958603673.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: I did reply to that point above with some baseless speculation, but now I can back up my baseless speculation with unscientific data :) https://gist.github.com/oconnor663/aed7016c9dbe5507510fc50faceaaa07 According to whatever `powerstat -R` measures on my laptop, running hardware-accelerated SHA-256 in a loop for a minute or so takes 26.86 Watts on average. Doing the same with AVX-512 BLAKE3 takes 29.53 Watts, 10% more. Factoring in the 4.69x difference in throughput reported by those loops, the overall energy/byte for BLAKE3 is 4.27x lower than SHA-256. This is my first time running a power benchmark, so if this sounds implausible hopefully someone can catch my mistakes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:02:52 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Thu, 24 Mar 2022 21:02:52 +0000 Subject: [issue47097] Document PEP 646 In-Reply-To: <1648001316.99.0.843695739634.issue47097@roundup.psfhosted.org> Message-ID: <1648155772.35.0.31341828945.issue47097@roundup.psfhosted.org> Matthew Rahtz added the comment: Ooh, thanks for the reminder! I'll start drafting this now. ---------- nosy: +matthew.rahtz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:03:14 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 21:03:14 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648155794.03.0.720470169847.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: bisect of main for bug.py with each local python builds get me to commit b127e70a8a682fe869c22ce04c379bd85a00db67 "bpo-46070: Fix asyncio initialization guard (GH-30423)" as the one that fixed bug.py most of the time. At times I can make bug.py segfault be it on python 3.9, 3.10 or main branch. It is pretty hard (I can have a batch of 200 runs without an issue) but seems easier to reproduce with a CPU stressed, then I can have two segfaults in a batch of 50 runs. Bash: for i in {1..50}; do ./python ../python-crash-kodi/bug.py ; done or sh: for i in `seq 1 50`; do ./python ../python-crash-kodi/bug.py ; done with: stress -c `nproc --all` at the same time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:09:46 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Mar 2022 21:09:46 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1648156186.29.0.785712017753.issue40280@roundup.psfhosted.org> miss-islington added the comment: New changeset 8a0a9e5b1928fab7d9819c8d6498ef5c0b9383af by Christian Heimes in branch 'main': bpo-40280: Add wasm32-emscripten and wasm32-wasi SOABI (GH-32095) https://github.com/python/cpython/commit/8a0a9e5b1928fab7d9819c8d6498ef5c0b9383af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:16:20 2022 From: report at bugs.python.org (Alban Browaeys) Date: Thu, 24 Mar 2022 21:16:20 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1648156580.78.0.815654024466.issue46070@roundup.psfhosted.org> Alban Browaeys added the comment: I managed to reproduce the bug.py crash with main branch up to commit 12c0012cf97d21bc637056983ede0eaf4c0d9c33 . ---------- Added file: https://bugs.python.org/file50700/bug.py_asyncio_cpustressed-crash.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 17:18:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Mar 2022 21:18:07 +0000 Subject: [issue47113] PermissionError on pip uninstall In-Reply-To: <1648146449.62.0.573957246169.issue47113@roundup.psfhosted.org> Message-ID: <1648156687.17.0.990485277623.issue47113@roundup.psfhosted.org> Christian Heimes added the comment: pip is maintained by a different group. Please report pip issues at https://github.com/pypa/pip . ---------- nosy: +christian.heimes resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 18:04:48 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Thu, 24 Mar 2022 22:04:48 +0000 Subject: [issue47097] Document PEP 646 In-Reply-To: <1648001316.99.0.843695739634.issue47097@roundup.psfhosted.org> Message-ID: <1648159488.59.0.408468667995.issue47097@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- keywords: +patch pull_requests: +30183 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32103 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:04:16 2022 From: report at bugs.python.org (Maciej Olko) Date: Thu, 24 Mar 2022 23:04:16 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648163056.2.0.392763596137.issue45618@roundup.psfhosted.org> Maciej Olko added the comment: After the Jinja version 3.1.0 release today [1], documentation builds fail for all stable branches. Sphinx in versions pinned on those branches fails with ImportError. [2] Backporting 14a4fce457033412278ca9a056787db424310dc3 to 3.10 and 3.9 fixes the problem for them (build is successful with 4.2.0). For 3.8 and 3.7 pinning down Jinja is required (docs don't build smoothly with 4.2.0 for those branches). Could some core developer help with the backports? I am starting to work on PRs with pins for 3.8 and 3.7. [1] https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-1-0 [2] % sphinx-build --version Traceback (most recent call last): File "?/cpython/Doc/./venv/bin/sphinx-build", line 5, in from sphinx.cmd.build import main File "?/cpython/Doc/venv/lib/python3.9/site-packages/sphinx/cmd/build.py", line 25, in from sphinx.application import Sphinx File "?/cpython/Doc/venv/lib/python3.9/site-packages/sphinx/application.py", line 42, in from sphinx.registry import SphinxComponentRegistry File "?/cpython/Doc/venv/lib/python3.9/site-packages/sphinx/registry.py", line 24, in from sphinx.builders import Builder File "?/cpython/Doc/venv/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 26, in from sphinx.util import import_object, logging, rst, progress_message, status_iterator File "?/cpython/Doc/venv/lib/python3.9/site-packages/sphinx/util/rst.py", line 22, in from jinja2 import environmentfilter ImportError: cannot import name 'environmentfilter' from 'jinja2' (?/cpython/Doc/venv/lib/python3.9/site-packages/jinja2/__init__.py) ---------- resolution: fixed -> status: closed -> open versions: -Python 3.11, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:09:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Mar 2022 23:09:21 +0000 Subject: [issue11339] annotation for class being defined In-Reply-To: <1298751820.01.0.369994267539.issue11339@psf.upfronthosting.co.za> Message-ID: <1648163361.06.0.818381607547.issue11339@roundup.psfhosted.org> Irit Katriel added the comment: This looks like PEP 673 ? Self Type. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:28:37 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 24 Mar 2022 23:28:37 +0000 Subject: [issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0) In-Reply-To: <1581577789.38.0.529951784345.issue39622@roundup.psfhosted.org> Message-ID: <1648164517.59.0.3107247295.issue39622@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30184 pull_request: https://github.com/python/cpython/pull/32105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 19:56:38 2022 From: report at bugs.python.org (Mark Bell) Date: Thu, 24 Mar 2022 23:56:38 +0000 Subject: [issue47114] random.choice and random.choices have different distributions Message-ID: <1648166198.78.0.653035976581.issue47114@roundup.psfhosted.org> New submission from Mark Bell : The docstring for `random.choices` indicates that ``` import random random.choices(population, k=1) ``` should produce a list containing one item, where each item of `population` has equal likelihood of being selected. However `random.choices` draws elements for its sample by doing `population[floor(random() * len(population)]` and so relies on floating point numbers. Therefore not each item is equally likely to be chosen since floats are not uniformly dense in [0, 1] and this problem becomes worse as `population` becomes larger. Note that this issue does not apply to `random.choice(population)` since this uses `random.randint` to choose a random element of `population` and performs exact integer arithmetic. Compare https://github.com/python/cpython/blob/main/Lib/random.py#L371 and https://github.com/python/cpython/blob/main/Lib/random.py#L490 Could `random.choices` fall back to doing `return [choice(population) for _ in _repeat(None, k)]` if no weights are given? Similarly, is it also plausible to only rely on `random.randint` and integer arithmetic if all of the (cumulative) weights given to `random.choices` are integers? ---------- components: Library (Lib) messages: 415981 nosy: Mark.Bell priority: normal severity: normal status: open title: random.choice and random.choices have different distributions versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 20:15:11 2022 From: report at bugs.python.org (Mark Bell) Date: Fri, 25 Mar 2022 00:15:11 +0000 Subject: [issue47114] random.choice and random.choices have different distributions In-Reply-To: <1648166198.78.0.653035976581.issue47114@roundup.psfhosted.org> Message-ID: <1648167311.3.0.446779137258.issue47114@roundup.psfhosted.org> Mark Bell added the comment: To give two more consequences of `random.choices` using floating point arithmetic: 1) When doing `random.choices([A, B, C], weights=[2**55, 1, 1])` the cumulative weight to bisect for is selected using `floor(random() * (2**55 + 1 + 1 + 0.0))`. Since this is always even, it is impossible for `B` to be chosen. 2) When doing `random.choices([A, B], weights=[2**54, 1])` although the `cum_weights` is [18014398509481984, 18014398509481985] the `total` used by `random.choices` is `cum_weights[-1] + 0.0`. Due to floating point rounding this is 18014398509481984.0 and so is actually smaller than `cum_weights[-1]`. Therefore it is impossible for `B` to be chosen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 21:19:55 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 25 Mar 2022 01:19:55 +0000 Subject: [issue47114] random.choice and random.choices have different distributions In-Reply-To: <1648166198.78.0.653035976581.issue47114@roundup.psfhosted.org> Message-ID: <1648171195.81.0.374260061445.issue47114@roundup.psfhosted.org> Dennis Sweeney added the comment: Possible duplicate of https://bugs.python.org/issue44080 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 22:15:16 2022 From: report at bugs.python.org (Inada Naoki) Date: Fri, 25 Mar 2022 02:15:16 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648174516.17.0.355555726668.issue46864@roundup.psfhosted.org> Inada Naoki added the comment: OK. Cache efficiency is dropped from motivations list. Current motivations are: * Memory saving (currently, 4 BytesObject (= 32 bytes of ob_shash) per code object. * Make bytes objects immutable * Share objects among multi interpreters. * CoW efficiency. I close this issue for now, because this issue is just for making direct access of ob_shash deprecated. After Python 3.12 become beta, we will reconsider about we should remove ob_shash or keep it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 22:53:43 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 25 Mar 2022 02:53:43 +0000 Subject: [issue47114] random.choice and random.choices have different distributions In-Reply-To: <1648166198.78.0.653035976581.issue47114@roundup.psfhosted.org> Message-ID: <1648176823.82.0.75648964562.issue47114@roundup.psfhosted.org> Tim Peters added the comment: Definitely a duplicate, and I doubt Mark or Raymond will change their mind. One observation: while floats are not uniformly dense in [0, 1), random() results are uniformly spaced. Each is of the form I / 2**53 for an integer I in range(2**53). ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 22:56:22 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 25 Mar 2022 02:56:22 +0000 Subject: [issue47114] random.choice and random.choices have different distributions In-Reply-To: <1648166198.78.0.653035976581.issue47114@roundup.psfhosted.org> Message-ID: <1648176982.67.0.309983738202.issue47114@roundup.psfhosted.org> Raymond Hettinger added the comment: This was an intentional decision. It is documented and tested. The rationale is that is keeps choices() internally consistent so that choices with equal weights produces the same result as if no weights are specified. For anyone who wants an alternative, it is trivial just call choice() in a list comprehension: [choice(seq) for i in range(k)] Another thought is that choices() is more performant than calling choice() in a loop. This matters because one of the principal use cases for choices() in bootstrapping where choices() can be called many times. Lastly, we are strongly averse to changing the algorithms after they are published because it impacts reproducible research where people need to be able to recreate their random selections for a given seed. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 24 22:56:34 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 25 Mar 2022 02:56:34 +0000 Subject: [issue47114] random.choice and random.choices have different distributions In-Reply-To: <1648166198.78.0.653035976581.issue47114@roundup.psfhosted.org> Message-ID: <1648176994.23.0.834411436194.issue47114@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 00:10:28 2022 From: report at bugs.python.org (Stanley) Date: Fri, 25 Mar 2022 04:10:28 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1648181428.83.0.0417522054409.issue47031@roundup.psfhosted.org> Stanley added the comment: Then perhaps saying that it's *never* equal is too strong, and instead we just say it's *not* equal. Not too sure how to phrase the behavior difference between `==` and `is` though, if that's something that should be noted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 00:27:18 2022 From: report at bugs.python.org (ty) Date: Fri, 25 Mar 2022 04:27:18 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648182438.9.0.784204757578.issue44493@roundup.psfhosted.org> ty added the comment: Actually the OS will always trust the length has already contained the last NUL. The test I did in this issue: https://github.com/rust-lang/rust/issues/69061 showed that: 1. OS trusted the input length was set correctly, both `sun_len` and the length of `struct sockaddr_un`. 2. The `struct sockaddr_un` and length will be copied without changed to the other programs. 3. It could be reproduced by the Rust dev team. So it shouldn't be a problem in the testcase itself. Maybe we could discuss this on the Github's PR page? I am very sure that it could be reproduced. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 00:53:21 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 25 Mar 2022 04:53:21 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648184001.47.0.911722272648.issue44493@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 03:52:16 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 25 Mar 2022 07:52:16 +0000 Subject: [issue46429] Merge all deepfrozen files into one In-Reply-To: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> Message-ID: <1648194736.1.0.139740614711.issue46429@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +30185 pull_request: https://github.com/python/cpython/pull/32107 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 03:53:15 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 25 Mar 2022 07:53:15 +0000 Subject: [issue46429] Merge all deepfrozen files into one In-Reply-To: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> Message-ID: <1648194795.2.0.0896853583317.issue46429@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 04:05:03 2022 From: report at bugs.python.org (Jeremiah Gabriel Pascual) Date: Fri, 25 Mar 2022 08:05:03 +0000 Subject: [issue47115] Documentation inconsistency with the stable ABI Message-ID: <1648195503.34.0.47585180018.issue47115@roundup.psfhosted.org> New submission from Jeremiah Gabriel Pascual : In https://docs.python.org/3/c-api/typeobj.html#static-types, it says that PyTypeObject isn't part of the stable ABI. Yet, in https://docs.python.org/3/c-api/type.html#c.PyTypeObject, it says that PyTypeObject IS part of the stable ABI. Which is true? ---------- assignee: docs at python components: Documentation messages: 415989 nosy: Crowthebird, docs at python priority: normal severity: normal status: open title: Documentation inconsistency with the stable ABI _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 04:36:20 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 25 Mar 2022 08:36:20 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1648197380.05.0.477265978444.issue47062@roundup.psfhosted.org> Kumar Aditya added the comment: With this change, Github Actions fails first time and it passes in the second rerun of running asyncio tests. See https://github.com/python/cpython/runs/5682275663?check_suite_focus=true and main branch. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:12:10 2022 From: report at bugs.python.org (Maciej Olko) Date: Fri, 25 Mar 2022 09:12:10 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648199530.43.0.97378023859.issue45618@roundup.psfhosted.org> Change by Maciej Olko : ---------- pull_requests: +30186 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/32109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:30:55 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Fri, 25 Mar 2022 09:30:55 +0000 Subject: [issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c Message-ID: <1648200655.15.0.54009409209.issue47116@roundup.psfhosted.org> New submission from Pieter Eendebak : In https://github.com/python/cpython/pull/31867 the method _PyLong_FromUnsignedChar was introduced for faster conversion of byteaarray elements. We can use the method in more places ---------- components: Interpreter Core messages: 415991 nosy: pieter.eendebak priority: normal severity: normal status: open title: Use _PyLong_FromUnsignedChar in bytearrayobject.c versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 05:33:44 2022 From: report at bugs.python.org (Pieter Eendebak) Date: Fri, 25 Mar 2022 09:33:44 +0000 Subject: [issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c In-Reply-To: <1648200655.15.0.54009409209.issue47116@roundup.psfhosted.org> Message-ID: <1648200824.15.0.164399654449.issue47116@roundup.psfhosted.org> Change by Pieter Eendebak : ---------- keywords: +patch pull_requests: +30187 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 06:06:05 2022 From: report at bugs.python.org (=?utf-8?q?Jon_=C3=85slund?=) Date: Fri, 25 Mar 2022 10:06:05 +0000 Subject: [issue47117] repl segfaults on non utf-8 input Message-ID: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> New submission from Jon ?slund : Some bytes that are non utf-8 segfaults python repl in 3.10 and later on linux. Example: $ python3.10 Python 3.10.4 (main, Mar 24 2022, 14:20:44) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ? Segmentation fault (core dumped) It is treated correctly in Python 3.9 and earlier $ python3.9 Python 3.9.12 (main, Mar 24 2022, 14:21:53) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ? File "", line 0 SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte How to reproduce: In Gnome on Ubuntu 20.04 with the Swedish keyboard layout, holding left alt and pressing the ? key enters the byte 0xb6 into the terminal. I have only been able to make it crash the repl. I can't make it crash the parser. For instance trying to eval the byte. ---------- messages: 415992 nosy: jooon priority: normal severity: normal status: open title: repl segfaults on non utf-8 input type: crash versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:32:43 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 25 Mar 2022 11:32:43 +0000 Subject: [issue42917] Block stack size for frame objects should be dynamically sizable In-Reply-To: <1610502849.77.0.30833881241.issue42917@roundup.psfhosted.org> Message-ID: <1648207963.98.0.740203315643.issue42917@roundup.psfhosted.org> Mark Shannon added the comment: With the introduction of zero cost exceptions, there is no block stack. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:33:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 11:33:38 +0000 Subject: [issue8891] shutil: sort files before archiving for consistency In-Reply-To: <1275599618.14.0.926604611145.issue8891@psf.upfronthosting.co.za> Message-ID: <1648208018.25.0.308852815636.issue8891@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Distutils -Library (Lib) nosy: +dstufft _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:33:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 11:33:25 +0000 Subject: [issue8891] shutil: sort files before archiving for consistency In-Reply-To: <1275599618.14.0.926604611145.issue8891@psf.upfronthosting.co.za> Message-ID: <1648208005.13.0.333320795173.issue8891@roundup.psfhosted.org> Irit Katriel added the comment: distutils is deprecated now, so there won't be any more enhancements to it. ---------- nosy: +iritkatriel resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:35:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2022 11:35:14 +0000 Subject: [issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes In-Reply-To: <1647831690.39.0.167799487436.issue47075@roundup.psfhosted.org> Message-ID: <1648208114.66.0.281060613036.issue47075@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30188 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32112 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:39:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 11:39:01 +0000 Subject: [issue18535] termios.tcgetattr should return namedtuple In-Reply-To: <1374581160.31.0.0241171129689.issue18535@psf.upfronthosting.co.za> Message-ID: <1648208341.85.0.252911407287.issue18535@roundup.psfhosted.org> Irit Katriel added the comment: The patch has no tests, the use case is not clear and it's been 9 years. Closing. ---------- nosy: +iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:40:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 25 Mar 2022 11:40:41 +0000 Subject: [issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes In-Reply-To: <1647831690.39.0.167799487436.issue47075@roundup.psfhosted.org> Message-ID: <1648208441.52.0.865022067565.issue47075@roundup.psfhosted.org> STINNER Victor added the comment: > BaseManager._finalize_manager() timeout should be configurable I proposed GH-32112 for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:42:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 11:42:00 +0000 Subject: [issue13197] subprocess: move shell arguments to a separate keyword param In-Reply-To: <1318851671.68.0.276363356463.issue13197@psf.upfronthosting.co.za> Message-ID: <1648208520.49.0.243992137918.issue13197@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Popen should raise ValueError if pass a string when shell=False or a list when shell=True _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 07:46:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 11:46:51 +0000 Subject: [issue1554] socketmodule cleanups: allow the use of keywords in socket functions In-Reply-To: <1196784173.07.0.425557098914.issue1554@psf.upfronthosting.co.za> Message-ID: <1648208811.23.0.588025365952.issue1554@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:03:36 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 12:03:36 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1648209816.22.0.545036340351.issue47062@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +30189 pull_request: https://github.com/python/cpython/pull/32113 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:26:42 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 12:26:42 +0000 Subject: [issue44036] asyncio SSL server can be DOSed, event loop gets blocked: busy loops and uses 100% CPU In-Reply-To: <1620148744.77.0.874589771286.issue44036@roundup.psfhosted.org> Message-ID: <1648211202.1.0.596114210855.issue44036@roundup.psfhosted.org> Andrew Svetlov added the comment: Could you check Python 3.11? It has a new asyncio SSL implementation rewritten from scratch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 08:57:58 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 25 Mar 2022 12:57:58 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1648213078.2.0.932987758188.issue42197@roundup.psfhosted.org> Mark Shannon added the comment: New changeset d7163bb35d1ed46bde9affcd4eb267dfd0b703dd by Mark Shannon in branch 'main': bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055) https://github.com/python/cpython/commit/d7163bb35d1ed46bde9affcd4eb267dfd0b703dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:05:16 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 25 Mar 2022 14:05:16 +0000 Subject: [issue40421] [C API] Add public getter functions for the internal PyFrameObject structure In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1648217116.41.0.996601651556.issue40421@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +30190 pull_request: https://github.com/python/cpython/pull/32114 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:12:39 2022 From: report at bugs.python.org (Kodiologist) Date: Fri, 25 Mar 2022 14:12:39 +0000 Subject: [issue16958] The sqlite3 context manager does not work with isolation_level=None In-Reply-To: <1358124405.04.0.0310758361359.issue16958@psf.upfronthosting.co.za> Message-ID: <1648217559.78.0.432651281133.issue16958@roundup.psfhosted.org> Kodiologist added the comment: This bit me real bad. On Python 3.8, I wrote a program with `isolation_level = None` and `with db: ?` and spent a long time figuring out why writes were so slow. Turns out that `with db` doesn't actually start a transaction in this case, as the documentation suggests it should. This issue is approaching the age of 10, so if there's still uncertainty about how the implementation or the interface should change, the docs should be clarified in the meantime. I always thought the Python library turning off autocommit by default, contrary to SQLite's command-line interface, was needlessly surprising. I think it contributed to this problem because the docs about context managers seem to assume you have autocommit off. ---------- nosy: +Kodiologist _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:20:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2022 14:20:59 +0000 Subject: [issue47118] test_run_keeps_context in test_asyncio fails Message-ID: <1648218059.52.0.391905115882.issue47118@roundup.psfhosted.org> New submission from Serhiy Storchaka : $ ./python -m test -vuall test_asyncio ... ====================================================================== FAIL: test_run_keeps_context (test.test_asyncio.test_runners.RunnerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_runners.py", line 299, in test_run_keeps_context self.assertEqual({cvar: 2}, dict(runner.run(get_context()))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: {: 2} != {: 2, : 2} ? ^ + {: 2, ? ^ + : Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999, capitals=1, clamp=0, flags=[], traps=[InvalidOperation, DivisionByZero, Overflow])} ---------------------------------------------------------------------- When run the test separately it passes successfully. ---------- components: Tests, asyncio messages: 416000 nosy: asvetlov, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: test_run_keeps_context in test_asyncio fails type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:25:30 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 25 Mar 2022 14:25:30 +0000 Subject: [issue47119] test_freeze_simple_script in test_tools fails Message-ID: <1648218330.8.0.40703884352.issue47119@roundup.psfhosted.org> New submission from Serhiy Storchaka : $ ./python -X frozen_modules=off -m test -vuall test_tools -m test_freeze_simple_script ... ====================================================================== ERROR: test_freeze_simple_script (test.test_tools.test_freeze.TestFreeze) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/test/support/os_helper.py", line 396, in temp_dir yield path ^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/test/test_tools/test_freeze.py", line 27, in test_freeze_simple_script outdir, scriptfile, python = helper.prepare(script, outdir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Tools/freeze/test/freeze.py", line 134, in prepare copy_source_tree(srcdir, SRCDIR) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Tools/freeze/test/freeze.py", line 83, in copy_source_tree shutil.copytree(oldroot, newroot) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/shutil.py", line 558, in copytree return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/shutil.py", line 514, in _copytree raise Error(errors) ^^^^^^^^^^^^^^^^^^^ shutil.Error: [('/home/serhiy/py/cpython/tmp/y', '/tmp/tmp1swfh4ik/cpython/tmp/y', "[Errno 2] No such file or directory: '/home/serhiy/py/cpython/tmp/y'"), ('/home/serhiy/py/cpython/link', '/tmp/tmp1swfh4ik/cpython/link', "[Errno 2] No such file or directory: '/home/serhiy/py/cpython/link'"), ('/home/serhiy/py/cpython/Tools/unicode/python-mappings/CP932.TXT', '/tmp/tmp1swfh4ik/cpython/Tools/unicode/python-mappings/CP932.TXT', "[Errno 5] Input/output error: '/home/serhiy/py/cpython/Tools/unicode/python-mappings/CP932.TXT' -> '/tmp/tmp1swfh4ik/cpython/Tools/unicode/python-mappings/CP932.TXT'"), ('/home/serhiy/py/cpython/Tools/unicode/python-mappings-/CP949.TXT', '/tmp/tmp1swfh4ik/cpython/Tools/unicode/python-mappings-/CP949.TXT', "[Errno 5] Input/output error: '/home/serhiy/py/cpython/Tools/unicode/python-mappings-/CP949.TXT' -> '/tmp/tmp1swfh4ik/cpython/Tools/unicode/python-mappings-/CP949.TXT'"), ('/home/serhiy/py/cpython/Python/y', '/tmp/tmp1swfh4ik/cpython/Python/y', "[Errno 2] No such file or directory: '/home/serhiy/py/cpython/Python/y'"), ('/home/serhiy/py/cpython/dl', '/tmp/tmp1swfh4ik/cpython/dl', "[Errno 2] No such file or directory: '/home/serhiy/py/cpython/dl'"), ('/home/serhiy/py/cpython/issue36694/out.pickle', '/tmp/tmp1swfh4ik/cpython/issue36694/out.pickle', "[Errno 5] Input/output error: '/home/serhiy/py/cpython/issue36694/out.pickle' -> '/tmp/tmp1swfh4ik/cpython/issue36694/out.pickle'")] ---------------------------------------------------------------------- ---------- components: Demos and Tools, Tests messages: 416001 nosy: serhiy.storchaka priority: normal severity: normal status: open title: test_freeze_simple_script in test_tools fails type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:28:00 2022 From: report at bugs.python.org (J Y) Date: Fri, 25 Mar 2022 14:28:00 +0000 Subject: [issue47093] Documentation Fix: Remove .bat when activating venv on windows In-Reply-To: <1647961054.99.0.629275554112.issue47093@roundup.psfhosted.org> Message-ID: <1648218480.28.0.357469640069.issue47093@roundup.psfhosted.org> J Y added the comment: Do you think it's worth changing it to just activate and adding a footnote mentioning the variations as I've been a dev for a few years now and it stumped me for a minute as I work in a few different envs. Mainly thinking of making setting up venv's as easy as possible for new comers with one less roadblock on their journey. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:30:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 14:30:53 +0000 Subject: [issue47120] Make all jumps relative Message-ID: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> New submission from Irit Katriel : For some of our jump opcodes target is absolute, so it can easily require EXTENDED_ARGS. Our analysis [1] shows that turning all absolute jumps into relative jumps will eliminate almost all EXTENDED_ARGS on jumps. This will require a _BACK version for each jump type, which negates the oparg. [1] https://github.com/faster-cpython/ideas/discussions/235#discussioncomment-2417022 ---------- assignee: iritkatriel components: Interpreter Core messages: 416003 nosy: iritkatriel priority: normal severity: normal status: open title: Make all jumps relative type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:31:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 14:31:09 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648218669.53.0.0259111105665.issue47120@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Make all jumps relative -> Make all jump opcodes relative _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:45:24 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 25 Mar 2022 14:45:24 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648219524.08.0.518682208823.issue47117@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This looks similar to https://bugs.python.org/issue46206 ---------- nosy: +pablogsal, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 10:59:12 2022 From: report at bugs.python.org (=?utf-8?q?Jon_=C3=85slund?=) Date: Fri, 25 Mar 2022 14:59:12 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648220352.13.0.358149418592.issue47117@roundup.psfhosted.org> Jon ?slund added the comment: Yes. I think they are the same. I can reproduce the emoji crash. This is much easier to reproduce. No need to have a Swedish keyboard layout. 1. Copy _? 2. Start python with a non unicode locale. LC_ALL=C python3.10 3. Paste in _? 4. Press backspace once. It will look like the 2 character wide emoji is replaced by a 1 character wide space. 6. Press return 7. Crash ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 11:05:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 15:05:47 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648220747.74.0.042427152421.issue47120@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +30191 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32115 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 11:07:15 2022 From: report at bugs.python.org (=?utf-8?q?Jon_=C3=85slund?=) Date: Fri, 25 Mar 2022 15:07:15 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648220835.41.0.443265265228.issue47117@roundup.psfhosted.org> Jon ?slund added the comment: very similar back trace too (gdb) run Starting program: /home/jon/.pyenv/versions/3.10.4/bin/python3.10 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Python 3.10.4 (main, Mar 24 2022, 14:20:44) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> _ Program received signal SIGSEGV, Segmentation fault. __strchr_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:57 57 ../sysdeps/x86_64/multiarch/strchr-avx2.S: No such file or directory. (gdb) bt #0 __strchr_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:57 #1 0x00005555557d4a7a in get_error_line (lineno=lineno at entry=0, p=, p=) at Parser/pegen.c:443 #2 0x00005555557d541b in _PyPegen_raise_error_known_location (p=0x7ffff7885ed0, errtype=0x5555558fe420 <_PyExc_SyntaxError>, lineno=0, col_offset=0, end_lineno=0, end_col_offset=-1, errmsg=0x5555558a2dd3 "(%s) %U", va=0x7fffffffd410) at Parser/pegen.c:499 #3 0x00005555557d5646 in _PyPegen_raise_error (p=p at entry=0x7ffff7885ed0, errtype=, errmsg=errmsg at entry=0x5555558a2dd3 "(%s) %U") at Parser/pegen.c:422 #4 0x00005555557d5839 in raise_decode_error (p=p at entry=0x7ffff7885ed0) at Parser/pegen.c:271 #5 0x00005555557d6193 in initialize_token (token_type=60, end=0x0, start=, token=0x7ffff7a55d10, p=0x7ffff7885ed0) at Parser/pegen.c:720 #6 _PyPegen_fill_token (p=p at entry=0x7ffff7885ed0) at Parser/pegen.c:793 #7 0x00005555557fec00 in statement_newline_rule (p=0x7ffff7885ed0) at Parser/parser.c:1080 #8 interactive_rule (p=0x7ffff7885ed0) at Parser/parser.c:1002 #9 _PyPegen_parse (p=p at entry=0x7ffff7885ed0) at Parser/parser.c:34508 #10 0x00005555557d6c60 in _PyPegen_run_parser (p=0x7ffff7885ed0) at Parser/pegen.c:1342 #11 0x00005555557d718f in _PyPegen_run_parser_from_file_pointer (fp=fp at entry=0x7ffff7e29980 <_IO_2_1_stdin_>, start_rule=start_rule at entry=256, filename_ob=filename_ob at entry=0x7ffff7a85670, enc=enc at entry=0x7ffff7a7c1a0 "utf-8", ps1=, ps1 at entry=0x1e000000160 , ps2=ps2 at entry=0xe0000001a0 , flags=0x7fffffffd7f8, errcode=0x7fffffffd724, arena=0x7ffff792cc70) at Parser/pegen.c:1448 #12 0x000055555575661c in _PyParser_ASTFromFile (fp=fp at entry=0x7ffff7e29980 <_IO_2_1_stdin_>, filename_ob=filename_ob at entry=0x7ffff7a85670, enc=enc at entry=0x7ffff7a7c1a0 "utf-8", mode=mode at entry=256, ps1=0x1e000000160 , ps1 at entry=0x7ffff7acf960 ">>> ", ps2=0xe0000001a0 , ps2 at entry=0x7ffff7af02e0 "... ", flags=, errcode=, arena=) at Parser/peg_api.c:26 #13 0x00005555556cad97 in PyRun_InteractiveOneObjectEx (fp=fp at entry=0x7ffff7e29980 <_IO_2_1_stdin_>, filename=filename at entry=0x7ffff7a85670, flags=flags at entry=0x7fffffffd7f8) at Python/pythonrun.c:257 #14 0x00005555556cba26 in _PyRun_InteractiveLoopObject (fp=fp at entry=0x7ffff7e29980 <_IO_2_1_stdin_>, filename=filename at entry=0x7ffff7a85670, flags=flags at entry=0x7fffffffd7f8) at Python/pythonrun.c:148 #15 0x00005555556cc5ce in _PyRun_AnyFileObject (flags=, closeit=, filename=0x7ffff7a85670, fp=) at Python/pythonrun.c:84 #16 PyRun_AnyFileExFlags (fp=0x7ffff7e29980 <_IO_2_1_stdin_>, filename=filename at entry=0x555555802103 "", closeit=closeit at entry=0, flags=flags at entry=0x7fffffffd7f8) at Python/pythonrun.c:116 #17 0x00005555555bb5c7 in pymain_run_stdin (config=0x555555932ce0) at Modules/main.c:502 #18 pymain_run_python (exitcode=exitcode at entry=0x7fffffffd930) at Modules/main.c:590 #19 0x00005555555bba1f in Py_RunMain () at Modules/main.c:666 #20 pymain_main (args=0x7fffffffd8f0) at Modules/main.c:696 #21 Py_BytesMain (argc=, argv=) at Modules/main.c:720 #22 0x00007ffff7c610b3 in __libc_start_main (main=0x5555555aedb0
, argc=1, argv=0x7fffffffda58, init=, fini=, rtld_fini=, stack_end=0x7fffffffda48) at ../csu/libc-start.c:308 #23 0x00005555555ba57e in _start () at ./Include/internal/pycore_pyerrors.h:14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 11:17:49 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 15:17:49 +0000 Subject: [issue47118] test_run_keeps_context in test_asyncio fails In-Reply-To: <1648218059.52.0.391905115882.issue47118@roundup.psfhosted.org> Message-ID: <1648221469.89.0.48294350344.issue47118@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks for the report! I read it ad 'decimal context tests modifies the environment'. I'll update asyncio runner test to ignore external contextvars. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 12:13:27 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 25 Mar 2022 16:13:27 +0000 Subject: [issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE In-Reply-To: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org> Message-ID: <1648224807.29.0.289849407831.issue47053@roundup.psfhosted.org> Mark Shannon added the comment: New changeset cca43b7d64f47ea921d0f7a347ae1a839c5463c3 by Dennis Sweeney in branch 'main': bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318) https://github.com/python/cpython/commit/cca43b7d64f47ea921d0f7a347ae1a839c5463c3 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 12:54:01 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 25 Mar 2022 16:54:01 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1648227241.46.0.440682030392.issue46566@roundup.psfhosted.org> Steve Dower added the comment: I think this PR is "ready enough" to get in for broader testing, but in case anyone wants to try it first, I've attached a build from my own machine. You may need Programs & Features to remove any existing "Python Launcher" before installing this MSI, and you will need to do that to remove this later on, but it should otherwise behave identically to a per-user installed launcher. ---------- Added file: https://bugs.python.org/file50701/launcher.msi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:23:28 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 17:23:28 +0000 Subject: [issue47118] test_run_keeps_context in test_asyncio fails In-Reply-To: <1648218059.52.0.391905115882.issue47118@roundup.psfhosted.org> Message-ID: <1648229008.54.0.705248110966.issue47118@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30192 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32117 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:28:43 2022 From: report at bugs.python.org (Thomas Fischbacher) Date: Fri, 25 Mar 2022 17:28:43 +0000 Subject: [issue47121] math.isfinite() can raise exception when called on a number Message-ID: <1648229323.49.0.0271955914629.issue47121@roundup.psfhosted.org> New submission from Thomas Fischbacher : >>> help(math.isfinite) isfinite(x, /) Return True if x is neither an infinity nor a NaN, and False otherwise. So, one would expect the following expression to return `True` or `False`. We instead observe: >>> math.isfinite(10**1000) Traceback (most recent call last): File "", line 1, in OverflowError: int too large to convert to float (There likewise is a corresponding issue with other, similar, functions). This especially hurts since PEP-484 states that having a Sequence[float] `xs` does not allow us to infer that `all(issubclass(type(x), float) for x in xs)` actually holds - since a PEP-484 "float" actually does also include "int" (and still, issubclass(int, float) == False). Now, strictly speaking, `help(math)` states that DESCRIPTION This module provides access to the mathematical functions defined by the C standard. ...but according to "man 3 isfinite", the math.h "isfinite" is a macro and not a function - and the man page does not show type information for that reason. ---------- messages: 416010 nosy: tfish2 priority: normal severity: normal status: open title: math.isfinite() can raise exception when called on a number _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:29:44 2022 From: report at bugs.python.org (Nathaniel Manista) Date: Fri, 25 Mar 2022 17:29:44 +0000 Subject: [issue47121] math.isfinite() can raise exception when called on a number In-Reply-To: <1648229323.49.0.0271955914629.issue47121@roundup.psfhosted.org> Message-ID: <1648229384.66.0.601496358612.issue47121@roundup.psfhosted.org> Change by Nathaniel Manista : ---------- nosy: +Nathaniel Manista _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:31:26 2022 From: report at bugs.python.org (Roundup Robot) Date: Fri, 25 Mar 2022 17:31:26 +0000 Subject: [issue1207613] Idle Editor: Bottom Scroll Bar Message-ID: <1648229486.6.0.221315717015.issue1207613@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +30193 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:32:23 2022 From: report at bugs.python.org (Maciej Olko) Date: Fri, 25 Mar 2022 17:32:23 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648229543.3.0.63008400963.issue45618@roundup.psfhosted.org> Change by Maciej Olko : ---------- pull_requests: +30194 pull_request: https://github.com/python/cpython/pull/32111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:52:35 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 25 Mar 2022 17:52:35 +0000 Subject: [issue47121] math.isfinite() can raise exception when called on a number In-Reply-To: <1648229323.49.0.0271955914629.issue47121@roundup.psfhosted.org> Message-ID: <1648230755.09.0.546195749712.issue47121@roundup.psfhosted.org> Raymond Hettinger added the comment: The math.isfinite() docs could be changed to something like, "coerces x to a float if possible and then returns True if x is neither an infinity nor a NaN, and False otherwise." Or there could be a general note about which functions (most of them) coerce to float (which can fail). With respect to typing and PEP-484, I don't see a bug or documentation issue. Types relationships are useful for verifying which methods are available, but they don't make promises about the range of valid values. For example math.sqrt(float) -> float promises which types are acceptable but doesn't promise that negative inputs won't raise an exception. Likewise, "n: int=10; len(range(n))" is type correct but will raise an OverflowError for "n = 10**100". ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 13:59:47 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 17:59:47 +0000 Subject: [issue47118] test_run_keeps_context in test_asyncio fails In-Reply-To: <1648218059.52.0.391905115882.issue47118@roundup.psfhosted.org> Message-ID: <1648231187.46.0.936526399243.issue47118@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 20e6e5636a06fe5e1472062918d0a302d82a71c3 by Andrew Svetlov in branch 'main': bpo-47118: Fix asyncio.Runner tests error (32117) https://github.com/python/cpython/commit/20e6e5636a06fe5e1472062918d0a302d82a71c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 14:19:02 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 18:19:02 +0000 Subject: [issue47118] test_run_keeps_context in test_asyncio fails In-Reply-To: <1648218059.52.0.391905115882.issue47118@roundup.psfhosted.org> Message-ID: <1648232342.04.0.412214048462.issue47118@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 14:24:12 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 25 Mar 2022 18:24:12 +0000 Subject: [issue47122] Fix the table of methods in the collections.abc documentation Message-ID: <1648232652.41.0.171202431056.issue47122@roundup.psfhosted.org> New submission from G?ry : This pull request makes the following changes to the table of methods in the [`collections.abc` documentation](https://docs.python.org/3/library/collections.abc.html): - `Reversible`: add `__iter__` abstract method; - `Generator`: replace `__iter__` with inherited mixin `Iterator` methods; - `MutableSequence`: add clear mixin method; - `Set`: remove `__ne__` mixin method (not defined here but in `object`), add `__rand__` mixin method, add `__ror__` mixin method, add `__rsub__` mixin method, add `__rxor__` mixin method; - `Mapping`: remove `__ne__` mixin method (not defined here but in `object`); - `ItemsView`: add inherited mixin `MappingView` method and inherited mixin `Set` methods; - `KeysView`: add inherited mixin `MappingView` method and inherited mixin `Set` methods; - `ValuesView`: add inherited mixin `MappingView` method; - `Coroutine`: add `__await__` abstract method; - `AsyncGenerator`: replace `__aiter__` with inherited mixin `AsyncIterator` methods; - footnotes: remove footnote 2 which is a duplicate of [the description of `collections.abc.Iterable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable). ---------- assignee: docs at python components: Documentation messages: 416013 nosy: docs at python, maggyero priority: normal pull_requests: 30195 severity: normal status: open title: Fix the table of methods in the collections.abc documentation type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:03:24 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 25 Mar 2022 19:03:24 +0000 Subject: [issue11339] annotation for class being defined In-Reply-To: <1298751820.01.0.369994267539.issue11339@psf.upfronthosting.co.za> Message-ID: <1648235004.27.0.766060082712.issue11339@roundup.psfhosted.org> Jelle Zijlstra added the comment: Agree. typing.Self from PEP 673 fixes this specific case, and PEP 563 or 649 will provide a general solution. No need to keep this issue open. ---------- nosy: +JelleZijlstra status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:07:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Mar 2022 19:07:46 +0000 Subject: [issue11339] annotation for class being defined In-Reply-To: <1298751820.01.0.369994267539.issue11339@psf.upfronthosting.co.za> Message-ID: <1648235266.17.0.784047721387.issue11339@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:11:06 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 25 Mar 2022 19:11:06 +0000 Subject: [issue47122] Fix the table of methods in the collections.abc documentation In-Reply-To: <1648232652.41.0.171202431056.issue47122@roundup.psfhosted.org> Message-ID: <1648235466.21.0.457266016747.issue47122@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:47:10 2022 From: report at bugs.python.org (ghost43) Date: Fri, 25 Mar 2022 19:47:10 +0000 Subject: [issue47123] ZipFile.writestr should respect SOURCE_DATE_EPOCH Message-ID: <1648237630.14.0.211482051392.issue47123@roundup.psfhosted.org> New submission from ghost43 : Currently `ZipFile.writestr` writes the local time into the ZipFile. (depends on both current time and local timezone) See https://github.com/python/cpython/blob/20e6e5636a06fe5e1472062918d0a302d82a71c3/Lib/zipfile.py#L1816-L1817 This makes pip installing a package generate non-reproducible build artifacts. Specifically, `Scripts/*.exe` files (created for packages that define entry_points/console_scripts) are not reproducible on Windows when installed by pip. This also leaks into the `*.dist-info/RECORD` files. For example, after running `pip install wheel` or `pip install pyinstaller`, in `wheel-0.37.1.dist-info/RECORD`, I have this line: ``` ../../Scripts/wheel.exe,sha256=u9TbPw2XNs_F9uy7y2zwumuzAZDbOSB7BXjLHZ0tTHg,97103 ``` in `pyinstaller-4.10.dist-info/RECORD`, I have these lines: ``` ../../Scripts/pyi-archive_viewer.exe,sha256=nC-9muPlIhUC1qvFkXHpyKJyRQqXISXxbUPXQ1XVOiM,97133 ../../Scripts/pyi-bindepend.exe,sha256=udFHiAdndPpSwaIqmhmLEy36IUs1cNNoNQznSEnLJQQ,97128 ../../Scripts/pyi-grab_version.exe,sha256=3ET9E841tFWujFL99aG4frzgwlP9f9pAkMgE0k2UGK0,97131 ../../Scripts/pyi-makespec.exe,sha256=dJkfmITdLJhyPngmqziqqj5tH9qqfeQc5BTubeoXWUs,97127 ../../Scripts/pyi-set_version.exe,sha256=sWmcOVS93fUY-wbdoz6ixBCvjy1tC4Aaw30DMmrmo-0,97130 ../../Scripts/pyinstaller.exe,sha256=haInbhH0pImJn24cW4v917oUZmzXZj8OE89KFh4MO2Y,97112 ``` Upon comparing multiple `Scripts/wheel.exe` files, I've found that the only difference is due to the above-mentioned timestamp embedded inside the exe (or rather, same timestamp embedded twice). The `exe` files get created by `distlib` (vendored by pip). Here is a traceback with an artificial exception to illustrate the codepath: ``` (env) PS C:\tmp> pip install --no-build-isolation pyinstaller Collecting pyinstaller Using cached pyinstaller-4.10-py3-none-win_amd64.whl (2.0 MB) Requirement already satisfied: setuptools in c:\tmp\env\lib\site-packages (from pyinstaller) (61.0.0) Requirement already satisfied: pyinstaller-hooks-contrib>=2020.6 in c:\tmp\env\lib\site-packages (from pyinstaller) (2022.3) Requirement already satisfied: altgraph in c:\tmp\env\lib\site-packages (from pyinstaller) (0.17.2) Requirement already satisfied: pefile>=2017.8.1 in c:\tmp\env\lib\site-packages (from pyinstaller) (2021.9.3) Requirement already satisfied: pywin32-ctypes>=0.2.0 in c:\tmp\env\lib\site-packages (from pyinstaller) (0.2.0) Requirement already satisfied: future in c:\tmp\env\lib\site-packages (from pefile>=2017.8.1->pyinstaller) (0.18.2) Installing collected packages: pyinstaller ERROR: Exception: Traceback (most recent call last): File "C:\tmp\env\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper status = run_func(*args) File "C:\tmp\env\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper return func(self, options, args) File "C:\tmp\env\lib\site-packages\pip\_internal\commands\install.py", line 405, in run installed = install_given_reqs( File "C:\tmp\env\lib\site-packages\pip\_internal\req\__init__.py", line 73, in install_given_reqs requirement.install( File "C:\tmp\env\lib\site-packages\pip\_internal\req\req_install.py", line 769, in install install_wheel( File "C:\tmp\env\lib\site-packages\pip\_internal\operations\install\wheel.py", line 729, in install_wheel _install_wheel( File "C:\tmp\env\lib\site-packages\pip\_internal\operations\install\wheel.py", line 646, in _install_wheel generated_console_scripts = maker.make_multiple(scripts_to_generate) File "C:\tmp\env\lib\site-packages\pip\_vendor\distlib\scripts.py", line 440, in make_multiple filenames.extend(self.make(specification, options)) File "C:\tmp\env\lib\site-packages\pip\_internal\operations\install\wheel.py", line 427, in make return super().make(specification, options) File "C:\tmp\env\lib\site-packages\pip\_vendor\distlib\scripts.py", line 429, in make self._make_script(entry, filenames, options=options) File "C:\tmp\env\lib\site-packages\pip\_vendor\distlib\scripts.py", line 329, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "C:\tmp\env\lib\site-packages\pip\_vendor\distlib\scripts.py", line 263, in _write_script raise Exception(f"heyheyhey2. {sha256(launcher)=}. {sha256(shebang)=}. {sha256(zip_data)=}. " + Exception: heyheyhey2. sha256(launcher)='a00a877acefc'. sha256(shebang)='58628e924f22'. sha256(zip_data)='a423496a0482'. ('SOURCE_DATE_EPOCH' in os.environ)=True ``` The interesting code is here: https://github.com/pypa/distlib/blob/d0e3f49df5d1aeb9daeaaabf0391c9e13e4a6562/distlib/scripts.py#L251-L252 This calls into the cpython standard library, where `time.time()` gets written into the file: https://github.com/python/cpython/blob/20e6e5636a06fe5e1472062918d0a302d82a71c3/Lib/zipfile.py#L1816-L1817 Ideally, either `distlib` or the stdlib `zipfile` module should be changed to respect `SOURCE_DATE_EPOCH`, but it's not entirely clear to me which... The attached patch changes `ZipFile.writestr` to respect `SOURCE_DATE_EPOCH` if set. related https://github.com/pypa/distlib/issues/164 related https://github.com/spesmilo/electrum/issues/7739 ---------- components: Library (Lib) files: zipfile_respect_sourcedate.diff keywords: patch messages: 416015 nosy: ghost43 priority: normal severity: normal status: open title: ZipFile.writestr should respect SOURCE_DATE_EPOCH type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 Added file: https://bugs.python.org/file50702/zipfile_respect_sourcedate.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:51:33 2022 From: report at bugs.python.org (Noam Cohen) Date: Fri, 25 Mar 2022 19:51:33 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648237893.63.0.790251856629.issue32642@roundup.psfhosted.org> Change by Noam Cohen : ---------- nosy: +ncohen nosy_count: 8.0 -> 9.0 pull_requests: +30196 pull_request: https://github.com/python/cpython/pull/32118 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 15:59:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 19:59:14 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1648238354.2.0.213078041585.issue47062@roundup.psfhosted.org> Andrew Svetlov added the comment: I believe the error is fixed by #47118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 16:48:45 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 25 Mar 2022 20:48:45 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648241325.84.0.127379996736.issue45618@roundup.psfhosted.org> Ned Deily added the comment: This really should be handled in a new issue since the original fixes for all affected releases are already in the field. Moreover, we should be a bit careful about bumping the required Sphinx version for older releases as this has caused problems for downstream distributors of Python in the past. Can't we just pin the Jinja2 version for current releases? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 17:10:25 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 25 Mar 2022 21:10:25 +0000 Subject: [issue47115] Documentation inconsistency with the stable ABI In-Reply-To: <1648195503.34.0.47585180018.issue47115@roundup.psfhosted.org> Message-ID: <1648242625.6.0.0738260511246.issue47115@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 17:57:44 2022 From: report at bugs.python.org (Thomas Fischbacher) Date: Fri, 25 Mar 2022 21:57:44 +0000 Subject: [issue47121] math.isfinite() can raise exception when called on a number In-Reply-To: <1648229323.49.0.0271955914629.issue47121@roundup.psfhosted.org> Message-ID: <1648245464.88.0.0285305816516.issue47121@roundup.psfhosted.org> Thomas Fischbacher added the comment: The problem with PEP-484 is that if one wants to use static type analysis, neither of these options are good: - Use static annotations on functions, and additionally spec out expectations in docstrings. Do note that the two types places where "float" is mentioned here refer to different concepts. This looks as if there were duplication, but there actually isn't, since the claims are different. This is confusing as hell. def foo(x: float) -> float: """Foos the barbaz Args: x: float, the foobar Returns: float, the foofoo""" The floats in the docstring give me a guarantee: "If I feed in a float, I am guaranteed to receive back a float". The floats in the static type annotation merely say "yeah, can be float or int, and I'd call it ok in these cases" - that's a very different statement. - Just go with static annotations, drop mention of types from docstrings, and accept that we lose the ability to stringently reason about the behavior of code. With respect to this latter option, I think we can wait for "losing the ability to stringently reason about the behavior of code" to cause major security headaches. That's basically opening up the door to many problems at the level of "I can crash the webserver by requesting the url http://lpt1". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:01:24 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 22:01:24 +0000 Subject: [issue43352] Add a Barrier object in asyncio lib In-Reply-To: <1614598796.36.0.0905111746151.issue43352@roundup.psfhosted.org> Message-ID: <1648245684.83.0.237073989921.issue43352@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset d03acd7270d66ddb8e987f9743405147ecc15087 by Duprat in branch 'main': bpo-43352: Add a Barrier object in asyncio lib (GH-24903) https://github.com/python/cpython/commit/d03acd7270d66ddb8e987f9743405147ecc15087 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:02:23 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 22:02:23 +0000 Subject: [issue43352] Add a Barrier object in asyncio lib In-Reply-To: <1614598796.36.0.0905111746151.issue43352@roundup.psfhosted.org> Message-ID: <1648245743.5.0.17367815941.issue43352@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed 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 Mar 25 18:11:19 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Fri, 25 Mar 2022 22:11:19 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1648246279.35.0.685396604188.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +30197 pull_request: https://github.com/python/cpython/pull/32119 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:16:13 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Fri, 25 Mar 2022 22:16:13 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1648246573.37.0.605538962341.issue43224@roundup.psfhosted.org> Matthew Rahtz added the comment: Since things are piling up, here's a quick record of what I think the remaining tasks are: (in approximate order of priority) 1. Finish writing docs (is updating library/typing.html sufficient? https://github.com/python/cpython/pull/32103) 2. Implement support for pickling of unpacked native tuples 3. Implement support and add tests for copy() of TypeVarTuple and unpacked tuple 4. Resolve the issue of how we implement type substitution (https://bugs.python.org/issue47006) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:26:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 25 Mar 2022 22:26:35 +0000 Subject: [issue47062] Implement asyncio.Runner context manager In-Reply-To: <1647636282.37.0.43859483152.issue47062@roundup.psfhosted.org> Message-ID: <1648247195.05.0.692297557921.issue47062@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset bad6ffaa64eecd33f4320ca31b1201b25cd8fc91 by Andrew Svetlov in branch 'main': bpo-47062: Rename factory argument to loop_factory (GH-32113) https://github.com/python/cpython/commit/bad6ffaa64eecd33f4320ca31b1201b25cd8fc91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:34:24 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 25 Mar 2022 22:34:24 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1648247664.51.0.924134429777.issue43224@roundup.psfhosted.org> Jelle Zijlstra added the comment: > 1. Finish writing docs (is updating library/typing.html sufficient? https://github.com/python/cpython/pull/32103) We also need to add to the What's New for 3.11. I volunteered to do that for all the typing PEPs. > 2. Implement support for pickling of unpacked native tuples Linking your GH-32119 > 3. Implement support and add tests for copy() of TypeVarTuple and unpacked tuple I believe this uses the same mechanism as pickling, so shouldn't need more work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 18:39:02 2022 From: report at bugs.python.org (Larry Hastings) Date: Fri, 25 Mar 2022 22:39:02 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1648247942.84.0.00123826761824.issue46761@roundup.psfhosted.org> Larry Hastings added the comment: I heard back from both Samuel Colvin (Pydantic) and Sebasti?n Ram?rez (FastAPI). They said neither of them use update_wrapper with partial objects. They also took a peek in a bunch of other projects (FastAPI, Typer, SQLModel, Asyncer, SQLAlchemy, Trio, and AnyIO) and nobody was doing it. So honestly it seems like nobody (but me!) calls update_wrapper on partial objects, and we can just fix it. Graham, any final thoughts before we start pulling levers and merging PRs? For now I just want to fix this bug. I'm in favor of re-engineering the relevant objects so they write their own __signature__ objects, so inspect.Signature doesn't have to understand the internals of objects from other modules. But maybe we save that for another day. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:18:35 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Fri, 25 Mar 2022 23:18:35 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1648250315.24.0.644426366704.issue46761@roundup.psfhosted.org> Graham Dumpleton added the comment: It is Django I would worry about and look at closely as they do stuff with decorators on instance methods that uses partials. https://github.com/django/django/blob/7119f40c9881666b6f9b5cf7df09ee1d21cc8344/django/utils/decorators.py#L43 ``` def _wrapper(self, *args, **kwargs): # bound_method has the signature that 'decorator' expects i.e. no # 'self' argument, but it's a closure over self so it can call # 'func'. Also, wrap method.__get__() in a function because new # attributes can't be set on bound method objects, only on functions. bound_method = wraps(method)(partial(method.__get__(self, type(self)))) for dec in decorators: bound_method = dec(bound_method) return bound_method(*args, **kwargs) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 19:28:39 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Fri, 25 Mar 2022 23:28:39 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1648250919.1.0.0784812885715.issue46761@roundup.psfhosted.org> Graham Dumpleton added the comment: Another example in Django, albeit in a test harness. * https://github.com/django/django/blob/7119f40c9881666b6f9b5cf7df09ee1d21cc8344/tests/urlpatterns_reverse/views.py#L65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:09:57 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 00:09:57 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648253397.41.0.108858213814.issue47105@roundup.psfhosted.org> Ned Deily added the comment: New changeset ee912ad6f66bb8cf5a8a2b4a7ecd2752bf070864 by Alex Hedges in branch 'main': bpo-47105: Cite grp.h instead of pwd.h in grp docs (GH-32091) https://github.com/python/cpython/commit/ee912ad6f66bb8cf5a8a2b4a7ecd2752bf070864 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:11:03 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Mar 2022 00:11:03 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648253463.82.0.0740616255683.issue47105@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +30198 pull_request: https://github.com/python/cpython/pull/32120 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:11:10 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Mar 2022 00:11:10 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648253470.18.0.28811409626.issue47105@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30199 pull_request: https://github.com/python/cpython/pull/32121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:20:08 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Mar 2022 00:20:08 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648254008.2.0.53752568595.issue45618@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30200 pull_request: https://github.com/python/cpython/pull/32120 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:21:54 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 00:21:54 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648254114.76.0.249781422162.issue47105@roundup.psfhosted.org> Ned Deily added the comment: New changeset 48b3ae9e29545891bece874b4c0c0e394fe0f048 by Miss Islington (bot) in branch '3.10': bpo-47105: Cite grp.h instead of pwd.h in grp docs (GH-32091) (GH-32120) https://github.com/python/cpython/commit/48b3ae9e29545891bece874b4c0c0e394fe0f048 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:22:29 2022 From: report at bugs.python.org (Larry Hastings) Date: Sat, 26 Mar 2022 00:22:29 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1648254149.24.0.302791918926.issue46761@roundup.psfhosted.org> Larry Hastings added the comment: Ooh, good one. I don't know anybody in the Django project to contact though. Anybody have any leads? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:22:38 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Mar 2022 00:22:38 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648254158.79.0.473181674616.issue45618@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30201 pull_request: https://github.com/python/cpython/pull/32121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:23:07 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 00:23:07 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648254187.74.0.187702823305.issue47105@roundup.psfhosted.org> Ned Deily added the comment: New changeset b8b473e943c0d105c79a6ebe2199dec18d785966 by Miss Islington (bot) in branch '3.9': bpo-47105: Cite grp.h instead of pwd.h in grp docs (GH-32091) (GH-32121) https://github.com/python/cpython/commit/b8b473e943c0d105c79a6ebe2199dec18d785966 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:23:50 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 00:23:50 +0000 Subject: [issue47105] [Doc] grp cites pwd.h instead of grp.h In-Reply-To: <1648098010.35.0.616040539992.issue47105@roundup.psfhosted.org> Message-ID: <1648254230.91.0.898078125004.issue47105@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR! ---------- 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 Mar 25 20:24:52 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 00:24:52 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648254292.86.0.517392426328.issue45618@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -30200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:25:00 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 00:25:00 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648254300.09.0.354595368324.issue45618@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -30201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:31:38 2022 From: report at bugs.python.org (Graham Dumpleton) Date: Sat, 26 Mar 2022 00:31:38 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1648254698.54.0.671050090646.issue46761@roundup.psfhosted.org> Graham Dumpleton added the comment: These days I have no idea who is active on Django. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:48:30 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 26 Mar 2022 00:48:30 +0000 Subject: [issue47124] explore hashlib use of the Apple CryptoKit macOS Message-ID: <1648255710.38.0.570771334735.issue47124@roundup.psfhosted.org> New submission from Gregory P. Smith : https://developer.apple.com/documentation/cryptokit/ in macOS 10.15+ This is a common place for platform specific hardware acceleration to be exposed to the user (especially on SoCs which often have non-standard hardware - Like Apples... which is presumably why they create this). What they offer is limited, but when present and running on a recent enough macOS, using their and SHA2 and HMAC(SHA2) implementations as well as Insecure.SHA1 is probably better than OpenSSL's. **Verify this.** It'd also allow those to be fast in a non-openssl build (as if anyone does those). I know little about mac building and packaging and how to have something target an older OS and use a 10.15+ API. So if this winds up only being used from aarch64 macOS builds (10.15+ by definition IIRC?) that could also work. I leave this issue for a macOS Apple API friendly person to take on. This issue is cousin to the Linux one: https://bugs.python.org/issue47102 ---------- components: Extension Modules, macOS messages: 416032 nosy: gregory.p.smith, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: explore hashlib use of the Apple CryptoKit macOS type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 20:53:13 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 26 Mar 2022 00:53:13 +0000 Subject: [issue47125] Explore hashlib use of the Windows Crypto API NG Message-ID: <1648255993.62.0.516641602637.issue47125@roundup.psfhosted.org> New submission from Gregory P. Smith : https://docs.microsoft.com/en-us/windows/win32/seccng/creating-a-hash-with-cng See if these are worthwhile vs using OpenSSL for the hashlib algorithms it supports. OS APIs can in theory take better advantage of HW acceleration for performance. Verify this on supported architectures. Regardless it would allow some things to be fast if someone wanted to use a build without OpenSSL. I'm not a Windows or Microsoft user. I'm filing this for completeness, someone else would need to do the work. similar macOS issue: https://bugs.python.org/issue47124 similar Linux issue: https://bugs.python.org/issue47102 ---------- components: Extension Modules, Windows messages: 416033 nosy: gregory.p.smith, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Explore hashlib use of the Windows Crypto API NG type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 25 21:42:20 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 26 Mar 2022 01:42:20 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648258940.71.0.165926621328.issue44090@roundup.psfhosted.org> Raymond Hettinger added the comment: Guido, what do you think about this proposal? Personally, I'm dubious about changing the meaning of the arguments between code paths. The callee has no way to distinguish which meaning was intended. And adding classmethod() support in super_descr_get() would create tight coupling where there should be separate concerns (no other descriptor call is classmethod specific). On StackOverflow, there has been some mild interest in the interactions between super() and classmethod(): * https://stackoverflow.com/questions/64637174 * https://stackoverflow.com/questions/1269217 * https://stackoverflow.com/questions/1817183 The OP's proposed use case is mildly plausible though I've never seen it the arise in practice. The GoF factory pattern is typically implemented in a function rather than in the class itself ? for example the open() function returns one of two different classes depending on the text or binary file mode. It is rare to see __new__ used to fork off different types based on a parameter. Presumably, it would be even more rare with a classmethod. Also, it's not clear that the GoF pattern would mesh well with our cooperative super() since the upstream parent class isn't known in advance. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 00:45:21 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 26 Mar 2022 04:45:21 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1648258940.71.0.165926621328.issue44090@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I?m sorry, my brain hurts when trying to understand my own code for super. Hopefully someone younger can look at this.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:26:32 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Mar 2022 05:26:32 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> Message-ID: <1648272392.07.0.0113016113056.issue47072@roundup.psfhosted.org> Terry J. Reedy added the comment: 3.8 only gets security patches. If you can, please test with a newer version. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:34:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 05:34:01 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648272841.31.0.945515696145.issue32642@roundup.psfhosted.org> Serhiy Storchaka added the comment: Are there any problems with converting a Path to string before adding it to sys.path? You do this one time, and any users of sys.path will not need to bother about conversion. It is better even for performance. Otherwise we will need to revise and update every code that uses sys.path, and many bugs will left in third-party code for years. For example, in unittest the code if not top_level_dir in sys.path: sys.path.insert(0, top_level_dir) should be replaced with more cumbersome for path in sys.path: if os.fsdecode(path) == top_level_dir: break else: sys.path.insert(0, top_level_dir) In multiprocessing the code sys_path=sys.path.copy() try: i = sys_path.index('') except ValueError: pass else: sys_path[i] = process.ORIGINAL_DIR should be replaced with sys_path=sys.path.copy() for i, path in enumerate(sys_path): if os.fsdecode(path) == '': sys_path[i] = process.ORIGINAL_DIR break It is just two examples. I did not review the whole stdlib, and there should be more third-party code. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:34:47 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Mar 2022 05:34:47 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648272887.56.0.946637689529.issue47079@roundup.psfhosted.org> Terry J. Reedy added the comment: Raymond and Serhiy, you were the last two active devs to touch numbers.py. ---------- nosy: +rhettinger, serhiy.storchaka, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:40:51 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 05:40:51 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648273251.57.0.857212378512.issue47079@roundup.psfhosted.org> Serhiy Storchaka added the comment: How would it work for bool or IntEnum? ---------- nosy: +lemburg, mark.dickinson, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 01:55:57 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 05:55:57 +0000 Subject: [issue47121] math.isfinite() can raise exception when called on a number In-Reply-To: <1648229323.49.0.0271955914629.issue47121@roundup.psfhosted.org> Message-ID: <1648274157.31.0.138118042099.issue47121@roundup.psfhosted.org> Serhiy Storchaka added the comment: Most (but not all) functions in the math module implicitly convert its arguments to float. Here we can get an OverflowError. Do we want to add a note to every function that does it? Or add a general note at the top of the file and add exclusion notes to functions which do not convert arguments to float? BTW, there is a general note: "Except when explicitly noted otherwise, all return values are floats." ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 02:10:09 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 26 Mar 2022 06:10:09 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648275009.19.0.108008095243.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > How would it work for bool or IntEnum? Neither subclass the Integral abc. The constraint (for which I care about) is: numerator/denominator should have same types. The default implementation, which I propose: it's the same type as the given Integral implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 02:36:45 2022 From: report at bugs.python.org (Noam Cohen) Date: Sat, 26 Mar 2022 06:36:45 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648276605.61.0.541083113382.issue32642@roundup.psfhosted.org> Noam Cohen added the comment: You've got a point. But in my opinion path-like object usage should be intuitive and users should not worry about converting it into string in some of the places. What do you feel about sub-classing list for sys.path and converting path-like objects upon setting items / reading? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 02:44:33 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 26 Mar 2022 06:44:33 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648277073.09.0.563820406334.issue44090@roundup.psfhosted.org> Raymond Hettinger added the comment: Will leave this open for a few days to see if anyone else steps forward to make a case for or against this proposal. ---------- assignee: -> rhettinger versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:07:13 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 07:07:13 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648278433.39.0.0806229227994.issue47079@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is no such constrain. And no default implementation in this module depends on the constructor. It is important, the constructor is not the part of interfaces. If you want to return the same type in denominator, just override it in your class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:09:18 2022 From: report at bugs.python.org (Hubert Tournier) Date: Sat, 26 Mar 2022 07:09:18 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> Message-ID: <1648278558.37.0.343597177964.issue47072@roundup.psfhosted.org> Hubert Tournier added the comment: Hello, Same results with Python 3.10.4: [...] Adding 185.220.102.6 Database has 62 records for 442368 bytes. Last record was 640 bytes long Traceback (most recent call last): File "./shelve-test.py", line 84, in _verify_whois_cache() File "./shelve-test.py", line 63, in _verify_whois_cache for key in db.keys(): File "/usr/local/lib/python3.10/_collections_abc.py", line 881, in __iter__ yield from self._mapping File "/usr/local/lib/python3.10/shelve.py", line 95, in __iter__ for k in self.dict.keys(): SystemError: Negative size passed to PyBytes_FromStringAndSize # freebsd-version -uk 13.0-RELEASE-p8 13.0-RELEASE-p10 # python3.10 --version Python 3.10.4 The point at which the database breaks depends (from 50 to 500+ records), the size of the database doesn't seem to be relevant (from 400K to 1800K). The size of the record *apparently* doesn't seem to be relevant (but I'm not 100% sure it's the right figure), though I've had other shelve module uses without issues with many more records but much smaller and less complex. ---------- Added file: https://bugs.python.org/file50703/shelve-test-3.10.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:15:42 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 26 Mar 2022 07:15:42 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648278942.44.0.487499932445.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > There is no such constrain. Why not? Any example where it does make sense to have different types for numerator and denominator? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:36:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 07:36:59 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648280219.74.0.453733016291.issue47079@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is no "why". There is a fact that there is no such constrain. Adding a new constrain may break existing code. If you want to add a constrain, add it in you code. If you are interesting "why", try to search old archives for the history of creating that module. Maybe you will find something. Maybe you will need to dip deeper, in discussions about abstract classes and protocols. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:51:23 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 26 Mar 2022 07:51:23 +0000 Subject: [issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE In-Reply-To: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org> Message-ID: <1648281083.08.0.906927817039.issue47053@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +30202 pull_request: https://github.com/python/cpython/pull/32122 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 03:59:39 2022 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Mar 2022 07:59:39 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648281579.87.0.803346112327.issue32642@roundup.psfhosted.org> Nick Coghlan added the comment: The import system is already complex, so I think the hesitation about allowing arbitrary Path-like objects is warranted. (For example: are importlib's caching semantics really valid for *arbitrary* path-like objects? An object can be path-like without being immutable) Coercion on input (as Noam suggests) would have a much lower risk of unwanted side effects, as any dynamic behaviour would be resolved at insertion time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 04:21:45 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 26 Mar 2022 08:21:45 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648282905.63.0.256791350046.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > There is no "why". Why not? Apparently, this is a documentation error, at least. (And I doubt there are tests for default methods.) > If you are interesting "why", try to search old archives for the history of creating that module. Thanks. Sorry, I'll try harder. So far I've found nothing to explain me why the Integral.denominator must be an 'int'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 06:06:24 2022 From: report at bugs.python.org (Noam Cohen) Date: Sat, 26 Mar 2022 10:06:24 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648289184.64.0.478184946921.issue32642@roundup.psfhosted.org> Noam Cohen added the comment: So I've got in mind a PyListObject subclass with calls to PyOS_FSPath before insert, append, extend and __getitem__. But I feel like this is an overkill; also, extend function might be trickier to implement. Do any of you have better idea? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 06:16:18 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 26 Mar 2022 10:16:18 +0000 Subject: [issue47126] Update to canonical PEP URLs Message-ID: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> New submission from Hugo van Kemenade : With the recent implementation https://peps.python.org/pep-0676/ the canonical URL for PEPs has changed from, for example: https://www.python.org/dev/peps/pep-0008/ to: https://peps.python.org/pep-0008/ Redirects are in place so the old links still work, but let's update the docs and docstrings to use the new canonical form. There's also a couple of places in code, so a BPO number is needed. ---------- assignee: hugovk components: Documentation, Library (Lib), Parser messages: 416051 nosy: hugovk, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Update to canonical PEP URLs versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 06:58:08 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 10:58:08 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648292288.79.0.154358335971.issue32642@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think you are trying to solve a wrong problem. > This wasn't obvious because Path objects appear as strings in normal debug output, etc. How is it? >>> pathlib.Path('/usr/lib') PosixPath('/usr/lib') >>> [pathlib.Path('/usr/lib')] [PosixPath('/usr/lib')] I think the problem is with the debug output. Always use repr() for it, otherwise you will trick yourself. > but the corresponding imports weren't working as they should It would be easier to catch if it was never working with non-string. I think we should deprecate any non-string elements in sys.path. As I shown above some code only works correctly with strings anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 07:01:58 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 11:01:58 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648292518.82.0.444164723282.issue32642@roundup.psfhosted.org> Serhiy Storchaka added the comment: pkgutil just skips non-string elements in sys.path. for dir in search_path: if not isinstance(dir, str): continue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 07:13:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 11:13:44 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648293224.75.0.136969034956.issue47079@roundup.psfhosted.org> Serhiy Storchaka added the comment: The module documentation should not contain all historical reasons of every design decision. If you are interesting why something was done in one way or another, do your research. One of reasons is that type(self) not always have a constructor with compatible interface. So it may work for your integer-like type, but in general case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 07:28:23 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 26 Mar 2022 11:28:23 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648294103.75.0.245784753306.issue47126@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch pull_requests: +30203 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 07:28:47 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 26 Mar 2022 11:28:47 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648294127.89.0.440595134962.issue47126@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- assignee: hugovk -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 07:38:03 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 26 Mar 2022 11:38:03 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648294683.91.0.0706481664656.issue47126@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Sphinx also changed the URL in https://github.com/sphinx-doc/sphinx/pull/10267 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 07:59:41 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 26 Mar 2022 11:59:41 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648295981.26.0.77567510843.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > The module documentation should not contain all historical reasons of every design decision. Sure. But, for example, there should be an explanation of why foo+foo.denominator could produce an error for a valid implementation of the Integral abc. Such interoperability is not assumed by the docs, according to provided examples (https://docs.python.org/3/library/numbers.html#implementing-the-arithmetic-operations). > One of reasons is that type(self) not always have a constructor with compatible interface. I hardly can imagine a constructor for the Integral type, which doesn't accept a python integer as an argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:08:41 2022 From: report at bugs.python.org (Noam Cohen) Date: Sat, 26 Mar 2022 12:08:41 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648296521.92.0.495102293134.issue32642@roundup.psfhosted.org> Noam Cohen added the comment: that's why pre-insert conversion was suggested. path-like objects could still be added to sys.path, while converting to str upon insert, preserving sys.path's bytes and strings only policy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:16:33 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 26 Mar 2022 12:16:33 +0000 Subject: [issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS Message-ID: <1648296993.82.0.182445504362.issue47127@roundup.psfhosted.org> New submission from Kumar Aditya : Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS flags. It is the second largest PRECALL specialization failure as per the stats. See https://github.com/faster-cpython/ideas/blob/main/stats.md#specialization-attempts-10 ---------- components: Interpreter Core messages: 416058 nosy: Dennis Sweeney, Mark.Shannon, kumaraditya303 priority: normal pull_requests: 30204 severity: normal status: open title: Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:30:53 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 12:30:53 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648297853.49.0.182884115987.issue47079@roundup.psfhosted.org> Serhiy Storchaka added the comment: Integral.__add__ is an abstract method, so it is a problem of your implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:36:12 2022 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Mar 2022 12:36:12 +0000 Subject: [issue46761] functools.update_wrapper breaks the signature of functools.partial objects In-Reply-To: <1644948374.87.0.765462873315.issue46761@roundup.psfhosted.org> Message-ID: <1648298172.15.0.299086941794.issue46761@roundup.psfhosted.org> Nick Coghlan added the comment: On the historical front, wraps & update_wrapper were only designed to handle true wrapper functions (i.e. those that don't change the calling signature). For anything else (including partial), I considered it unlikely that the doc string would still be accurate, let alone any of the other metadata, so I didn't worry about supporting them. That sais, if it's practical to make the results of combining the two less broken then I agree it would make sense to do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:54:32 2022 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Mar 2022 12:54:32 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1648299272.47.0.393663922376.issue46964@roundup.psfhosted.org> Nick Coghlan added the comment: Moving the invariant bits would certainly make sense. As Victor notes, though, some things (like whether to install the signal handlers) should be different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 08:59:28 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 26 Mar 2022 12:59:28 +0000 Subject: [issue47128] Enhance Argument Clinic's NoneType return converter to give `void` Message-ID: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org> New submission from Oleg Iarygin : The attached PR makes the following possible (note that the impl has a `void` return type): /*[clinic input] _io._IOBase.writelines -> NoneType lines: object / [clinic start generated code]*/ static void _io__IOBase_writelines_impl(PyObject *self, PyObject *lines) /*[clinic end generated code: output=f3feca36db72dbd1 input=286ba711cb7291ad]*/ Previously, the return type would be `Object *` with generated replacement of non-Py_None values to NULL on the other side. So now there is no need to track whether NULL or Py_None should be returned. Or should it be Py_RETURN_NONE? Argument Clinic does it by itself returning NULL on errors and PyNone otherwise: static PyObject * _io__IOBase_writelines(PyObject *self, PyObject *lines) { PyObject *return_value = NULL; _io__IOBase_writelines_impl(self, lines); if (PyErr_Occurred()) { goto exit; } return_value = Py_None; Py_INCREF(Py_None); exit: return return_value; } ---------- components: Argument Clinic messages: 416062 nosy: arhadthedev, larry priority: normal severity: normal status: open title: Enhance Argument Clinic's NoneType return converter to give `void` type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 09:05:29 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 26 Mar 2022 13:05:29 +0000 Subject: [issue47128] Enhance Argument Clinic's NoneType return converter to give `void` In-Reply-To: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org> Message-ID: <1648299929.09.0.973321439397.issue47128@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +30205 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32126 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 09:38:21 2022 From: report at bugs.python.org (Hubert Tournier) Date: Sat, 26 Mar 2022 13:38:21 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> Message-ID: <1648301901.03.0.346741389657.issue47072@roundup.psfhosted.org> Hubert Tournier added the comment: I modified the test program to better reflect the size of the data structures stored in shelve (sys.getsizeof() which I used was far off the real size). I saw that the database was corrupted with big records, though even bigger previous records had not corrupted it. Records larger than 1K (mentioned in one of the other problem report) were routinely OK. Records larger than 4K (also mentioned on another PR) were sometimes OK. When I took a problematic record and used it single alone or with few other records, no corruption occurred. Any idea? ---------- Added file: https://bugs.python.org/file50704/shelve-test-3.10-b.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 10:19:25 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 14:19:25 +0000 Subject: [issue47128] Enhance Argument Clinic's NoneType return converter to give `void` In-Reply-To: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org> Message-ID: <1648304365.53.0.583355486074.issue47128@roundup.psfhosted.org> Serhiy Storchaka added the comment: The function should return different values for success and error. Functions which do not do this have bad design. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 10:34:00 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 26 Mar 2022 14:34:00 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1648281579.87.0.803346112327.issue32642@roundup.psfhosted.org> Message-ID: <2b24983c-c1f8-2e95-1e98-f087d444889b@egenix.com> Marc-Andre Lemburg added the comment: On 26.03.2022 08:59, Nick Coghlan wrote: > > The import system is already complex, so I think the hesitation about allowing arbitrary Path-like objects is warranted. (For example: are importlib's caching semantics really valid for *arbitrary* path-like objects? An object can be path-like without being immutable) > > Coercion on input (as Noam suggests) would have a much lower risk of unwanted side effects, as any dynamic behaviour would be resolved at insertion time. This is not only about the import system. Lots of Python code out there manipulates sys.path or reads sys.path for various reasons and does not expect Path objects as list members, since only strings and bytes are allowed: https://docs.python.org/3/library/sys.html#sys.path Conversion to strings sounds like a good way to get the best out of both worlds. I'm just curious on how this would work. You'd like have to create a list subclass for use with sys.path which applies the conversion whenever a non-string member gets added. Or perhaps add helper methods to Path objects to safely add their value to sys.path. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 10:40:00 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 26 Mar 2022 14:40:00 +0000 Subject: [issue47128] Enhance Argument Clinic's NoneType return converter to give `void` In-Reply-To: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org> Message-ID: <1648305600.8.0.832247772614.issue47128@roundup.psfhosted.org> Oleg Iarygin added the comment: > The function should return different values for success and error It does, and a `void` return type enforces it. Here is the trick: > An important convention throughout the Python interpreter is the following: when a function fails, it should set an exception condition and return an error value (usually -1 or a NULL pointer). > > - https://docs.python.org/3/extending/extending.html#intermezzo-errors-and-exceptions Previously, a function could return NULL but forget to call `PyErr_*()`. With `void`, however, the function has no other choise but to properly set the error indicator so the Clinic's part will see it and return NULL finishing the convention. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 10:40:33 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sat, 26 Mar 2022 14:40:33 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648305633.22.0.386936388598.issue47126@roundup.psfhosted.org> Hugo van Kemenade added the comment: Here's a devguide PR: https://github.com/python/devguide/pull/822 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:05:53 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 26 Mar 2022 15:05:53 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648307153.76.0.0546658266102.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: I've confirmed that prior to the patch in PR 30194, the location of the failure was indeed reported. It was just not reported on the same line: ``` cpython main $ git log -1 commit 3e93af0b06cada874c4a16868b6f863b599919f2 (HEAD -> main) Author: Jason R. Coombs Date: Sat Mar 26 10:45:58 2022 -0400 Revert "bpo-46126: Disable 'descriptions' when running tests internally. (GH-30194)" This reverts commit a941e5927f7f2540946813606c61c6aea38db426. cpython main $ git diff diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index b3627cbb75..7e3bb09cf2 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++ b/Lib/test/test_importlib/test_metadata_api.py @@ -90,8 +90,11 @@ def test_entry_points_distribution(self): self.assertEqual(ep.dist.version, "1.0.0") def test_entry_points_unique_packages(self): - # Entry points should only be exposed for the first package - # on sys.path with a given name. + """ + Entry points should only be exposed for the first package + on sys.path with a given name. + """ + raise ValueError("Failing on purpose") alt_site_dir = self.fixtures.enter_context(fixtures.tempdir()) self.fixtures.enter_context(self.add_sys_path(alt_site_dir)) alt_pkg = { cpython main $ ./python.exe -E -We -m test -v test_importlib | grep entry_points_unique_packages test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests) ERROR: test_entry_points_unique_packages (test.test_importlib.test_metadata_api.APITests) File "/Users/jaraco/code/public/cpython/Lib/test/test_importlib/test_metadata_api.py", line 97, in test_entry_points_unique_packages test test_importlib failed ``` The description is given _in addition_ to the location of the test. That means the concern reported in #302 was actually invalid. I also was under the false impression that the description was masking the test location, but instead, it's just enhancing it (while also injecting a newline). Given this renewed understanding, I believe it's appropriate to back out the PR. > I think the situation and the discussion should be summarized on python-dev! Great suggestion. Will do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:08:27 2022 From: report at bugs.python.org (=?utf-8?q?Maciej_G=C3=B3rski?=) Date: Sat, 26 Mar 2022 15:08:27 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors Message-ID: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> New submission from Maciej G?rski : When an empty expression is provided in curly brackets inside an f-string we get Syntax Error: "f-string: empty expression not allowed". This is correct, however error with the same message is raised in the following cases: f"{!foo}", f"{!}", f"{:bar}", f"{=}", etc. For example, should someone make an error and try to negate an expression with '!' instead of 'not' (i.e. f"{!True}"), they would get a confusing error, saying that the expression is empty, when it isn't. I propose we raise an error with the message: "f-string: optional specifier '%c' must follow a non-empty expression. ---------- components: Parser messages: 416069 nosy: lys.nikolaou, macgors, pablogsal priority: normal severity: normal status: open title: Improve errors messages in f-string syntax errors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:09:44 2022 From: report at bugs.python.org (=?utf-8?q?Maciej_G=C3=B3rski?=) Date: Sat, 26 Mar 2022 15:09:44 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648307384.08.0.347969377006.issue47129@roundup.psfhosted.org> Change by Maciej G?rski : ---------- keywords: +patch pull_requests: +30206 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32127 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:11:01 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 26 Mar 2022 15:11:01 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648307461.61.0.776098977242.issue46126@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:12:17 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 26 Mar 2022 15:12:17 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648307537.28.0.635262461348.issue47129@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:12:25 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 26 Mar 2022 15:12:25 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648307545.53.0.817689631345.issue46126@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +30208 pull_request: https://github.com/python/cpython/pull/32128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:46:31 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 26 Mar 2022 15:46:31 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648309591.14.0.137020537651.issue47117@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +30209 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 11:54:44 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 26 Mar 2022 15:54:44 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648310084.46.0.749257244069.issue47117@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ah yes, we have been defeated by half an emoji :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 12:10:06 2022 From: report at bugs.python.org (malmiteria) Date: Sat, 26 Mar 2022 16:10:06 +0000 Subject: [issue47130] mro and super don't feel so pythonic Message-ID: <1648311006.19.0.353261149711.issue47130@roundup.psfhosted.org> New submission from malmiteria : Hi, Before anything, i made a github repository about this topic here : https://github.com/malmiteria/super-alternative-to-super The core of what i wanna discuss here is that i don't think mro and super (mainly because it relies on mro) are very pythonic. Mainly that some behaviors of the mro are too implicit, and are silencing what really should be errors. Let me explain : in case of multiple inheritence, resolving a child method from it's parent isn't an obvious task, and mro comes as a solution to that. However, i don't understand why we don't let the programmer solve it. I think this is similar to a merge conflict, and not letting the programmer resolve the conflict feels like silencing an error. This is especially infuriating when you realise that mro doesn't solve all possible scenarios, and then, simply refuses the opportunity to solve it to the programmer. Then, super relying on mro gives off some weird behaviors, mainly, it's possible for a child definition to affect what a call to super means in it's parent. This feels like a side effect (which is the 'too implicit' thing i refer to). I also don't understand why we can't simply pass the parent targeted as argument to super, instead of having no argument, or having to pass the current class and instances as argument : super(child) is a proxy to parent, when super(parent) would make more sense to be the proxy to parent, in my mind. I dive in more depths about those topics in the readme of the github repository i linked at the top of this comment. what i propose is a solution that would follow those rules: The mro alternative, which i called explicit method resolution aka EMR (which is probably not a good name since i apply it, as mro, to all class attributes), follow those rules : 1) Straightforward case : the class definition has the method / attribute : this is the one EMR should resolve to 2) Not found : the method / attribute can't be resolved in the class itself, or by any of it's parents, then it should raise an AttributeError 3) Only on parent : the method / attribute can't be resolved in the class itself, and can only be resolved by one of it's parents, this is the one EMR should resolve to 4) Multiple parent : the method / attribute can't be resolved in the class itself, and can be resolved by at least 2 of it's parents, then an ExplicitResolutionRequired error should be raised 5) Transimittin errors : the method / attribute can't be resolved in the class itself, and one parent at least raises an ExplicitResolutionRequired error, then it should raise an ExplicitResolutionRequired error 6) (optional?) Single source : when multiple parent can resolve a method from a single source (in case of diamond shape inheritence), the ExplicitResolutionRequired is not needed The super alternative, which i called __as_parent__ should follow those rules : 1) reliability : the target __as_parent__ points to should not depend on anything other than the argument passed to it 2) expliciteness : in case of multiple inheritence, the parent targetted should be passed as an argument to the __as_parent__ method. 3) impliciteness : in case of simple inheritence, it is not needed to specify the parent targeted (since there can only be one, and it make it closer to the actual behavior of super in most cases) 4) ancestors as targets : should be able to target ancestors, either direct or not (which is needed in case two grandparent define a method that a single parent share, there would be no other way to solve the ExplicitResolutionRequired otherwise) this solution has a few advantages in my mind : - the current mro and super are more tightly coupled than the emr and __as_parent__ i propose here - the __as_parent__ is more reliable than super in its behavior, and should lead to an easier learning curve - the emr i propose as a replacement to mro allows for some inheritence tree mro doesn't allow. - the __as_parent__ method being able to target specific parent allows for different methods to visit the parents in different order easily, which today would be harder, since the parent visiting order is tightly coupled to the class definition - with emr, in case of problematic resolution, an error is raised to tell you about the problem, and ask you for explicit resolution, the current solution doesn't, which can lead to surprises closer to production environment. A few possible downsides : - the transition would be a pain to deal with - the current mro allows for dependencies injection in the inheritence tree. I believe this feature should be untied from super and mro, but it would require some work. - the current super and mro are old enough to have been faced with issues and having been updated to solve those issues down the line. Any alternative would have to face those issues again and new ones down the line - any coexistence between those two solution would require some work to make sure they don't break one another (i've explored some of those scenarios in my repository, but i definitely didn't cover it all) I believe that what i talk about here is definitely too much at once. For exemple, adding a kwarg to super to specify the parent it targets would be a very easy change to add into python, and wouldn't require much more of what i talk about here, but it would still have some of the value i talk about here. But overall, it all makes sense to me, and i wanted to share it all with you guys. What do you think? does it makes sense? Am i missing something? ---------- messages: 416071 nosy: malmiteria priority: normal severity: normal status: open title: mro and super don't feel so pythonic type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 12:29:16 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Mar 2022 16:29:16 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648312156.05.0.141870660395.issue47117@roundup.psfhosted.org> miss-islington added the comment: New changeset 26cca8067bf5306e372c0e90036d832c5021fd90 by Pablo Galindo Salgado in branch 'main': bpo-47117: Don't crash if we fail to decode characters when the tokenizer buffers are uninitialized (GH-32129) https://github.com/python/cpython/commit/26cca8067bf5306e372c0e90036d832c5021fd90 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 12:50:13 2022 From: report at bugs.python.org (Ken Jin) Date: Sat, 26 Mar 2022 16:50:13 +0000 Subject: [issue47130] mro and super don't feel so pythonic In-Reply-To: <1648311006.19.0.353261149711.issue47130@roundup.psfhosted.org> Message-ID: <1648313413.9.0.00775275839446.issue47130@roundup.psfhosted.org> Ken Jin added the comment: Hi @mamliteria, this is the bug tracker for CPython. I understand that you have suggestions to improve super(), but feature suggestions usually go on the python-ideas mailing list [1]. So you might want to post on there instead. If you're interested, the MRO creation algorithm uses C3 linearization[2] so the output is predictable. Also maybe the 2-argument form of super() will help. It should cover most cases that you propose with __as_parent__. [1] https://mail.python.org/mailman3/lists/python-ideas.python.org/ [2] https://en.wikipedia.org/wiki/C3_linearization ---------- nosy: +kj resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 12:55:55 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 26 Mar 2022 16:55:55 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1648313755.77.0.532399468854.issue43224@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset e8e737bcf6d22927caebc30c5d57ac4634063219 by Matthew Rahtz in branch 'main': bpo-43224: Implement PEP 646 grammar changes (GH-31018) https://github.com/python/cpython/commit/e8e737bcf6d22927caebc30c5d57ac4634063219 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 12:57:40 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 26 Mar 2022 16:57:40 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648313860.83.0.0272278978833.issue47129@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not convinced this is an improvement. I don't think someone trying '!' in an f-string expression happens often enough to worry about that specific error message. And a generic "optional specifier" isn't great. If we're going to do this, it should reflect the actual thing that's present: a conversion specifier, a format specifier, or debug specifier. And "optional" doesn't add anything, since it's actually present in this string. I'll give it some more thought. I can't come up with an error message I actually like. The focus still needs to be on the empty expression. ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 13:16:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 26 Mar 2022 17:16:51 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1648315011.17.0.601766058744.issue46964@roundup.psfhosted.org> STINNER Victor added the comment: > Moving the invariant bits would certainly make sense. IMO it's convenient to have a single structure for all "configuration", even if a few parameters are expected to be the same in all interpreters. Python/initconfig.c is already a long C file. It contains a lot of code to copy members, converts them from a dict/to a dict, check consistency, etc. It's also a little bit annoying (for me) to have a separated PyPreConfig structure int Python/preconfig.c which shares some code (like the "_PyPreCmdline" thing to parse "common" command line options). Well, that's the opinon of the author of PEP 587, biaised obviously ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 13:26:44 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 26 Mar 2022 17:26:44 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648315604.6.0.721629809981.issue47117@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +30210 pull_request: https://github.com/python/cpython/pull/32130 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 14:04:56 2022 From: report at bugs.python.org (=?utf-8?q?Maciej_G=C3=B3rski?=) Date: Sat, 26 Mar 2022 18:04:56 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648317896.49.0.936624000607.issue47129@roundup.psfhosted.org> Maciej G?rski added the comment: Understandable. In this case I can maybe propose something along the lines of "f-string: empty expression not allowed (Conversion specifier '!' can only follow non-empty expressions)", and so on for each of the specifiers. This way the original message is still present and we just add some more information. I'm open to any of your ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 14:17:19 2022 From: report at bugs.python.org (Vincent Bernat) Date: Sat, 26 Mar 2022 18:17:19 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648318639.9.0.396412478843.issue27929@roundup.psfhosted.org> Change by Vincent Bernat : ---------- keywords: +patch nosy: +bernat nosy_count: 4.0 -> 5.0 pull_requests: +30211 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 14:25:50 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 26 Mar 2022 18:25:50 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1648319150.28.0.34151318683.issue32642@roundup.psfhosted.org> Eryk Sun added the comment: > I've got in mind a PyListObject subclass with calls to PyOS_FSPath > before insert, append, extend and __getitem__. The sys module doesn't prevent rebinding sys.path. Most code I think is careful to update sys.path. But surely some code replaces it with a new list instead of updating via insert(), append(), extend(), or updating a slice such as `sys.path[:] = new_path`. For example, ModifiedInterpreter.transfer_path() in Lib/idlelib/pyshell.py rebinds sys.path. It doesn't have to, but it does. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 14:26:12 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 26 Mar 2022 18:26:12 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648319172.58.0.38826113039.issue47117@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 27ee43183437c473725eba00def0ea7647688926 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-47117: Don't crash if we fail to decode characters when the tokenizer buffers are uninitialized (GH-32129) (GH-32130) https://github.com/python/cpython/commit/27ee43183437c473725eba00def0ea7647688926 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 14:26:31 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 26 Mar 2022 18:26:31 +0000 Subject: [issue47117] repl segfaults on non utf-8 input In-Reply-To: <1648202765.72.0.11778383238.issue47117@roundup.psfhosted.org> Message-ID: <1648319191.87.0.884087990915.issue47117@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the report, Jon! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:09:40 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 26 Mar 2022 19:09:40 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648321780.09.0.116899195583.issue46126@roundup.psfhosted.org> Ethan Furman added the comment: Perhaps we could make an enhancement then? Having the extra information on a separate line is, at least for me, very jarring -- as in, I hadn't figured out that that was the way it was done until Inadasan pointed it out. Perhaps a command-line switch to enable having it all on one line? That would also help when grepping. (I would propose it to be the default behavior, but I can see that that would result in very long lines.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:15:49 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Sat, 26 Mar 2022 19:15:49 +0000 Subject: [issue47131] Speedup test_unparse Message-ID: <1648322149.94.0.511947690727.issue47131@roundup.psfhosted.org> New submission from Jeremy Kloth : The string building and comparing of ast.dump() causes significant slowdowns on the large ASTs produced when doing the roundtrip test on the stdlib. This PR avoids that cost by doing a direct node traversal and comparison. It results in a 33% runtime improvement on machines to which I have access. ---------- components: Tests messages: 416082 nosy: jkloth priority: normal severity: normal status: open title: Speedup test_unparse versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:16:33 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 26 Mar 2022 19:16:33 +0000 Subject: [issue47132] Move tests from setobject.c to _testcapimodule Message-ID: <1648322193.52.0.0635664464356.issue47132@roundup.psfhosted.org> New submission from Oleg Iarygin : Currently, tests for PySet/PyFrozenSet C API are defined in Objects/setobject.c and available via set.test_c_api(). Moving them to, for example, _testcapimodule gives the following advantanges: - an internal, CPython-specific method stops being available in a public interface of the set class - CPython already has tests grouped into dedicated packages - the target package undefines NDEBUG thus making asserts available in release builds - a user may choose to omit the tests from a build not carrying them around - a file of 2.5k lines of codes becomes 152 lines smaller. ---------- components: C API, Tests messages: 416083 nosy: arhadthedev priority: normal severity: normal status: open title: Move tests from setobject.c to _testcapimodule type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:19:10 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Sat, 26 Mar 2022 19:19:10 +0000 Subject: [issue47131] Speedup test_unparse In-Reply-To: <1648322149.94.0.511947690727.issue47131@roundup.psfhosted.org> Message-ID: <1648322350.1.0.479967475733.issue47131@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- keywords: +patch pull_requests: +30212 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32132 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:20:31 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Sat, 26 Mar 2022 19:20:31 +0000 Subject: [issue47131] Speedup test_unparse In-Reply-To: <1648322149.94.0.511947690727.issue47131@roundup.psfhosted.org> Message-ID: <1648322431.08.0.160083431493.issue47131@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +vstinner type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:21:05 2022 From: report at bugs.python.org (Jeremy Kloth) Date: Sat, 26 Mar 2022 19:21:05 +0000 Subject: [issue47089] Avoid sporadic failure of test_compileall on Windows In-Reply-To: <1647898446.37.0.407539254542.issue47089@roundup.psfhosted.org> Message-ID: <1648322465.32.0.736805524188.issue47089@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:28:05 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 26 Mar 2022 19:28:05 +0000 Subject: [issue47132] Move tests from setobject.c to _testcapimodule In-Reply-To: <1648322193.52.0.0635664464356.issue47132@roundup.psfhosted.org> Message-ID: <1648322885.93.0.187745721134.issue47132@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +30213 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:47:46 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 26 Mar 2022 19:47:46 +0000 Subject: [issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c In-Reply-To: <1648200655.15.0.54009409209.issue47116@roundup.psfhosted.org> Message-ID: <1648324066.29.0.64495461866.issue47116@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset c23ddf5ec229b7302437a1cf32d366df5cc5b837 by Pieter Eendebak in branch 'main': bpo-47116: use _PyLong_FromUnsignedChar instead of PyLong_FromLong (GH-32110) https://github.com/python/cpython/commit/c23ddf5ec229b7302437a1cf32d366df5cc5b837 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:52:30 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 26 Mar 2022 19:52:30 +0000 Subject: [issue47095] Prefer libb2 over vendored copy of blake2 In-Reply-To: <1647978677.39.0.283744368692.issue47095@roundup.psfhosted.org> Message-ID: <1648324350.63.0.969324098469.issue47095@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b16b6bb8dacc41e9e569783890b0c88fcd3b24e8 by Christian Heimes in branch 'main': bpo-47095: Use libb2 to provide blake2 implementation (GH-32059) https://github.com/python/cpython/commit/b16b6bb8dacc41e9e569783890b0c88fcd3b24e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 15:59:17 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 19:59:17 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648324757.15.0.15246812277.issue26120@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am positive about this idea, but we must also think about the possible negative consequences. For example, the future annotations will be included in the star-import by default and can override some global names. The fact that some names not visible in the module help can override global names can be confusing. I think it should be discussed with a wider auditory. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:05:29 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 26 Mar 2022 20:05:29 +0000 Subject: [issue47095] Prefer libb2 over vendored copy of blake2 In-Reply-To: <1647978677.39.0.283744368692.issue47095@roundup.psfhosted.org> Message-ID: <1648325129.27.0.984741149037.issue47095@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 Mar 26 16:12:16 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 26 Mar 2022 20:12:16 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648325536.8.0.141183306305.issue27929@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +asvetlov -ned.deily versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:14:56 2022 From: report at bugs.python.org (Brett Cannon) Date: Sat, 26 Mar 2022 20:14:56 +0000 Subject: [issue47061] Deprecate modules listed in PEP 594 In-Reply-To: <1647632770.65.0.881581261318.issue47061@roundup.psfhosted.org> Message-ID: <1648325696.09.0.563178413594.issue47061@roundup.psfhosted.org> Change by Brett Cannon : ---------- pull_requests: +30214 pull_request: https://github.com/python/cpython/pull/32134 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:15:57 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 26 Mar 2022 20:15:57 +0000 Subject: [issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c In-Reply-To: <1648200655.15.0.54009409209.issue47116@roundup.psfhosted.org> Message-ID: <1648325757.79.0.662044358914.issue47116@roundup.psfhosted.org> Dennis Sweeney added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:26:00 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 26 Mar 2022 20:26:00 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648326360.45.0.401365390441.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: My goal with this issue is to simply unblock the use of docstrings in Python tests. I believe with the work above and the proposed published post, I've accomplished that goal. I've already spent more time than I'd hoped on this issue and would like to resolve it at its original scope. I do see how this issue reveals some deficiencies with the current UI/UX, and I'd welcome a separate feature request to address those deficiencies. I'll even help draft the bug report on request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:36:12 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 26 Mar 2022 20:36:12 +0000 Subject: [issue47098] sha3: Replace Keccak Code Package with tiny_sha3 In-Reply-To: <1648026382.03.0.0255347692375.issue47098@roundup.psfhosted.org> Message-ID: <1648326972.59.0.166896436889.issue47098@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 5fd8c574e016aec85725ddc5ced8742267b0e1b3 by Christian Heimes in branch 'main': bpo-47098: Replace Keccak Code Package with tiny_sha3 (GH-32060) https://github.com/python/cpython/commit/5fd8c574e016aec85725ddc5ced8742267b0e1b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:38:47 2022 From: report at bugs.python.org (Illia Volochii) Date: Sat, 26 Mar 2022 20:38:47 +0000 Subject: [issue47098] sha3: Replace Keccak Code Package with tiny_sha3 In-Reply-To: <1648026382.03.0.0255347692375.issue47098@roundup.psfhosted.org> Message-ID: <1648327127.23.0.434671034137.issue47098@roundup.psfhosted.org> Change by Illia Volochii : ---------- nosy: +illia-v nosy_count: 2.0 -> 3.0 pull_requests: +30215 pull_request: https://github.com/python/cpython/pull/28768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:39:31 2022 From: report at bugs.python.org (Illia Volochii) Date: Sat, 26 Mar 2022 20:39:31 +0000 Subject: [issue47098] sha3: Replace Keccak Code Package with tiny_sha3 In-Reply-To: <1648026382.03.0.0255347692375.issue47098@roundup.psfhosted.org> Message-ID: <1648327171.8.0.137077406068.issue47098@roundup.psfhosted.org> Change by Illia Volochii : ---------- pull_requests: +30216 pull_request: https://github.com/python/cpython/pull/24601 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:56:32 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 26 Mar 2022 20:56:32 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line Message-ID: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> New submission from Ethan Furman : When running unittest with the -v flag, if a test has errors, and has a docstring, the test name is shown on one line, and the docstring is shown on the next line -- and the ERROR word is shown with the docstring. What this means is that: - the test name is easily missed by anyone who isn't aware of that (I only recently found out when someone else pointed it out to me) - grepping for ERROR doesn't reveal the test name, necessitating a search through the testing code to find the test that failed There are two possible solutions, and the selection of which one should be discussed on python-dev: - print the name and docstring, and ERROR, all on one line; or - provide a command-line switch to select that behavior --- For the experienced developers who see this: please leave the issue for one of the new developers subscribed to core-mentorship. Thank you. ---------- components: Tests messages: 416090 nosy: ethan.furman priority: low severity: normal stage: needs patch status: open title: enhance unittest to show test name and docstring on one line type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 16:57:02 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 26 Mar 2022 20:57:02 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1648328222.72.0.501046499376.issue46126@roundup.psfhosted.org> Ethan Furman added the comment: That makes sense. issue47133 created. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 17:01:09 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 26 Mar 2022 21:01:09 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648328469.99.0.107010045245.issue47133@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 17:06:41 2022 From: report at bugs.python.org (Martin Dengler) Date: Sat, 26 Mar 2022 21:06:41 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648328801.68.0.236724436981.issue43323@roundup.psfhosted.org> Change by Martin Dengler : ---------- nosy: +mdengler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 17:10:16 2022 From: report at bugs.python.org (Martin Dengler) Date: Sat, 26 Mar 2022 21:10:16 +0000 Subject: [issue43818] Email does not apply policy to multipart messages with defects In-Reply-To: <1618258648.79.0.562101023353.issue43818@roundup.psfhosted.org> Message-ID: <1648329016.0.0.943173979093.issue43818@roundup.psfhosted.org> Change by Martin Dengler : ---------- nosy: +mdengler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 17:19:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 26 Mar 2022 21:19:13 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648329553.28.0.923248383259.issue47133@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 17:29:09 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 21:29:09 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648330149.42.0.737024946352.issue43323@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is interesting that you get an UnicodeEncodeError when try to decode. Could the charser name contain non-ascii characters? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 18:10:10 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 26 Mar 2022 22:10:10 +0000 Subject: [issue47134] Document the meaning of the number in OverflowError Message-ID: <1648332610.23.0.998137740503.issue47134@roundup.psfhosted.org> New submission from Steven D'Aprano : OverflowError sometimes (but not always) includes some sort of numeric code: >>> 1e+300 ** 2 Traceback (most recent call last): File "", line 1, in OverflowError: (34, 'Numerical result out of range') but the meaning of the 34 is not documented: https://docs.python.org/3/library/exceptions.html#OverflowError help(OverflowError) is no more insightful, saying only: __init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. Other OverflowError exceptions do not include the numeric code: >>> math.exp(10000) Traceback (most recent call last): File "", line 1, in OverflowError: math range error Is it an error code from C? Something to do with the number of digits of precision? An easter-egg to do with The Count Of Monte Cristo? ---------- assignee: docs at python components: Documentation messages: 416093 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: Document the meaning of the number in OverflowError type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 18:16:59 2022 From: report at bugs.python.org (Itay Yeshaya) Date: Sat, 26 Mar 2022 22:16:59 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648333019.19.0.818618538984.issue47133@roundup.psfhosted.org> Itay Yeshaya added the comment: I would like to work on this. ---------- nosy: +itay.yeshaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 18:26:19 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 26 Mar 2022 22:26:19 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648333579.55.0.28246029502.issue47129@roundup.psfhosted.org> Eric V. Smith added the comment: >From a suggestion by @Jelle on the python discord server: how about just "f-string: expression required before '!'"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 18:46:01 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 26 Mar 2022 22:46:01 +0000 Subject: [issue47134] Document the meaning of the number in OverflowError In-Reply-To: <1648332610.23.0.998137740503.issue47134@roundup.psfhosted.org> Message-ID: <1648334761.13.0.895891513801.issue47134@roundup.psfhosted.org> Eryk Sun added the comment: The error code for `1e+300 ** 2` is ERANGE, from calling libm pow(). Since pow() returns a double, there's no way to indicate an error in the return value. Instead, C errno is set to 0 beforehand and checked for a non-zero error value after the call. If the error code isn't ERANGE, then float.__pow__() raises ValueError instead of OverflowError. Here's the relevant snippet from float_pow() in Objects/floatobject.c: /* Now iv and iw are finite, iw is nonzero, and iv is * positive and not equal to 1.0. We finally allow * the platform pow to step in and do the rest. */ errno = 0; ix = pow(iv, iw); _Py_ADJUST_ERANGE1(ix); if (negate_result) ix = -ix; if (errno != 0) { /* We don't expect any errno value other than ERANGE, but * the range of libm bugs appears unbounded. */ PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : PyExc_ValueError); return NULL; } return PyFloat_FromDouble(ix); Here's a direct example using ctypes: import ctypes import errno libm = ctypes.CDLL('libm.so.6', use_errno=True) libm.pow.argtypes = (ctypes.c_double, ctypes.c_double) libm.pow.restype = ctypes.c_double >>> errno.ERANGE 34 >>> ctypes.set_errno(0) 0 >>> libm.pow(1e300, 2) inf >>> ctypes.get_errno() == errno.ERANGE True ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 19:19:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Mar 2022 23:19:32 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648336772.02.0.307235303449.issue47133@roundup.psfhosted.org> Serhiy Storchaka added the comment: Issue14265, issue46126. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 19:57:02 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 26 Mar 2022 23:57:02 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1648339022.29.0.536462781024.issue14265@roundup.psfhosted.org> Ethan Furman added the comment: Hopefully somebody on the core-mentorship list can move this forward by converting to a PR and reviewing. If @palaviv is still active the review itself will still be useful. ---------- assignee: michael.foord -> ethan.furman keywords: +easy -patch nosy: +ethan.furman stage: -> patch review versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 20:12:10 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 27 Mar 2022 00:12:10 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648339930.04.0.546347825544.issue47133@roundup.psfhosted.org> Steven D'Aprano added the comment: I don't think this change of behaviour should be accepted without discussion, and I'm not sure why you think Python-Dev is the right place, rather than here. Messing around with unittest and docstrings has already caused issues in the past: https://docs.python.org/3/library/unittest.html#unittest.TestCase.shortDescription so perhaps we shouldn't break what's not broken? And frankly, I don't see why the current behaviour is a problem, although maybe that's because the way I use unittest is different from the way you use it. Grepping the output for errors? Why run verbose mode if you aren't going to read the whole output? Seems very odd. Ethan says: "the test name is easily missed by anyone who isn't aware of that" Surely the solution to that is education, not changing unittest? Now you are aware of it, and the test name is no longer "easily missed". If it ever was. To me, it is plain as day. Here is some typical output: [steve ~]$ python3.10 -m unittest -v mathlib/testing/test_utils.py test_broken_doc (mathlib.testing.test_utils.TestMinmax) This is a docstring ... ERROR test_broken_nodoc (mathlib.testing.test_utils.TestMinmax) ... ERROR test_empty_iterable (mathlib.testing.test_utils.TestMinmax) ... ok [additional passing tests ommitted for brevity] ====================================================================== ERROR: test_broken_doc (mathlib.testing.test_utils.TestMinmax) This is a docstring ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/steve/Desktop/mathlib/testing/test_utils.py", line 20, in test_broken_doc self.assertEqual(1, x) NameError: name 'x' is not defined ====================================================================== ERROR: test_broken_nodoc (mathlib.testing.test_utils.TestMinmax) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/steve/Desktop/mathlib/testing/test_utils.py", line 24, in test_broken_nodoc self.assertEqual(1, x) NameError: name 'x' is not defined ---------------------------------------------------------------------- Ran 10 tests in 0.004s FAILED (errors=2) Errors are listed twice, once in the summary, and the second time in the details section showing the traceback. Note that if you just grep for ERROR you get the result you want: [steve ~]$ python3.10 -m unittest -v mathlib/testing/test_utils.py |& grep ERROR This is a docstring ... ERROR test_broken_nodoc (mathlib.testing.test_utils.TestMinmax) ... ERROR ERROR: test_broken_doc (mathlib.testing.test_utils.TestMinmax) ERROR: test_broken_nodoc (mathlib.testing.test_utils.TestMinmax) So I am having trouble seeing what the problem here is. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 20:35:24 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 27 Mar 2022 00:35:24 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648341324.42.0.150695055643.issue47133@roundup.psfhosted.org> Ethan Furman added the comment: I proposed a discussion to python-dev to increase the odds that folks with an interest could chime in. Not everyone follows the new-bugs list. I find having the output on two lines counter-intuitive -- I was expecting one line per test, and indeed my experience seemed to support that (out of hundreds of tests showing on one line, it's easy to miss that the rare verbose error is on two). And I'm not the only one, since another developer also thought there was a problem and spent most of issue46126 "fixing" it. Another reason for posting to python-dev is that issue 46126 had been active for three months and had a PR merged before another dev mentioned that verbose tests with docstrings just printed on two lines instead of one. Thank you for pointing out the possible disruption caused by unittest output changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 22:37:49 2022 From: report at bugs.python.org (Anders Kaseorg) Date: Sun, 27 Mar 2022 02:37:49 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648348669.61.0.540210393288.issue43323@roundup.psfhosted.org> Anders Kaseorg added the comment: It could and does, as quoted in my original report. Content-Type: text/plain; charset*=utf-8?''utf-8%E2%80%9D That?s a U+201D right double quotation mark. This is not a valid charset for the charset of course, but it seems like the code was intended to handle an invalid charset value without crashing, so it should also handle an invalid charset charset (despite the absurdity of the entire concept of a charset charset). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 26 23:32:28 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 27 Mar 2022 03:32:28 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648351948.56.0.218815183763.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > Integral.__add__ is an abstract method, so it is a problem of your implementation. But such an implementation does satisfy all assumptions of the Integral abc, correct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 00:07:45 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 27 Mar 2022 04:07:45 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648341324.42.0.150695055643.issue47133@roundup.psfhosted.org> Message-ID: <20220327040619.GC8276@ando.pearwood.info> Steven D'Aprano added the comment: I have no problem with pinging Python-Dev, or any other forum, asking for interested parties. I just don't think we should be intentionally spliting the discussion more than it's going to get split organically. (If this is interesting to people, they will discuss it on other forums no matter what we say or do.) Aside from the conservative position "If it ain't broke, don't break it", also known as "Chesterton's Fence": https://matt-rickard.com/chestertons-fence/ I'm not specifically opposed to this change. Nor am I in favour. Why do we print the first line of the doctests in the output of failing tests? If we understood the rationale for why we do that, it might give some insight into the consequences of removing it. If we don't know why it was shown in the first place, maybe we shouldn't remove it until we have some idea. I am -1 on another option flag unless there is no other choice. Each boolean flag option doubles the number of tests of unitttest itself needed for full coverage. Another option might be to leave the docstring line alone, and just *add* the 'ERROR' to the method name line: # current output test_broken_doc (mathlib.testing.test_utils.TestMinmax) This is a docstring ... ERROR # enhancement test_broken_doc (mathlib.testing.test_utils.TestMinmax) ERROR This is a docstring ... ERROR That seems to me to be less risky than trying to cram them all on one line. test_broken_doc (mathlib.testing.test_utils.TestMinmax) This is a docstring ... ERROR By the way, I presume we do the same thing for FAIL lines, which have the same behaviour as ERROR lines: test_fail_doc (mathlib.testing.test_utils.TestMinmax) This is a docstring ... FAIL test_fail_nodoc (mathlib.testing.test_utils.TestMinmax) ... FAIL ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 00:32:59 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 27 Mar 2022 04:32:59 +0000 Subject: [issue47132] Move tests from setobject.c to _testcapimodule In-Reply-To: <1648322193.52.0.0635664464356.issue47132@roundup.psfhosted.org> Message-ID: <1648355579.95.0.606033407328.issue47132@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 02:26:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 06:26:32 +0000 Subject: [issue47128] Enhance Argument Clinic's NoneType return converter to give `void` In-Reply-To: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org> Message-ID: <1648362392.95.0.637366844908.issue47128@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is simpler and faster to return NULL than call PyErr_Occurred(). There is a special macro PY_RETURN_NONE, so there is no problem with returning None either. I do not think it would make the code better. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 02:42:08 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 06:42:08 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648328192.86.0.657883961617.issue47133@roundup.psfhosted.org> Message-ID: <1648363328.44.0.572849493381.issue47133@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is already the third (at least) issue asking for such feature. Many people have problems with the current output. I would prefer to have a full qualified name of the test which I can copy by a double click and insert in a command that reruns specified tests. And full path to the test's source which I can copy to run in editor. pytest output looks more user-friendly to me. But it may break other's test output parsers so we perhaps need an option for this. Options for unittest and libregrtest. I am not sure that it is a task for an average new contributor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 02:45:35 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 06:45:35 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648363535.82.0.692011173085.issue47079@roundup.psfhosted.org> Serhiy Storchaka added the comment: It does not satisfy your assumptions in msg416056. So you have either correct your assumptions, or change the implementation of __add__, or change the implementation of denominator in your code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 03:00:23 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 07:00:23 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648364423.82.0.704331165712.issue43323@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry, I was puzzled by the exception type and missed details in a long traceback (I have issues with reading large texts). Thank you for your detailed report. The simple fix is to add UnicodeEncodeError to "except LookupError". But there may be other places where we can get a similar error. They should be fixed too. Alternatively we can do something when we get an invalid charset from the parsed data. I am not the email package expert, so I do not know what would be better in that context. ---------- components: +Library (Lib) versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 03:16:41 2022 From: report at bugs.python.org (Hubert Tournier) Date: Sun, 27 Mar 2022 07:16:41 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> Message-ID: <1648365401.84.0.266899804152.issue47072@roundup.psfhosted.org> Hubert Tournier added the comment: Additional note: the test code WORKS under Windows 8.1 / Python 3.9.1 (though the data file is suffixed .dat instead of .db) resulting in a 4 MB database with 1065 records, some of them > 11 KB. So maybe the bug is system dependent. ---------- components: +FreeBSD nosy: +koobs versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 03:18:37 2022 From: report at bugs.python.org (Sam Ezeh) Date: Sun, 27 Mar 2022 07:18:37 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1648365517.12.0.0326621921682.issue14265@roundup.psfhosted.org> Change by Sam Ezeh : ---------- nosy: +dignissimus _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 03:28:01 2022 From: report at bugs.python.org (John Paul Adrian Glaubitz) Date: Sun, 27 Mar 2022 07:28:01 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648366080.99.0.745456385743.issue43323@roundup.psfhosted.org> John Paul Adrian Glaubitz added the comment: Hi Serhiy! > The simple fix is to add UnicodeEncodeError to "except LookupError". But there may be other places where we can get a similar error. They should be fixed too. I would be very interested to test this as this issue currently blocks my use of offlineimap. Would you mind creating a proof-of-concept patch for me if it's not too much work? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 03:56:23 2022 From: report at bugs.python.org (Hubert Tournier) Date: Sun, 27 Mar 2022 07:56:23 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> Message-ID: <1648367783.07.0.0967367538655.issue47072@roundup.psfhosted.org> Hubert Tournier added the comment: The storage format used under Windows is completely different from the one used under Unix (or *BSD). Apart from the .dat datafile, there is a .dir index file with CSV lines such as "'key', (offset, length)". Whereas under Unix (or *BSD), I have: # file whois_cache.db whois_cache.db: Berkeley DB 1.85 (Hash, version 2, native byte-order) I'll make a test on a Linux Raspberry Pi, to see if the issue is *BSD specific... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 04:35:50 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 27 Mar 2022 08:35:50 +0000 Subject: [issue47124] explore hashlib use of the Apple CryptoKit macOS In-Reply-To: <1648255710.38.0.570771334735.issue47124@roundup.psfhosted.org> Message-ID: <1648370150.85.0.0749559341105.issue47124@roundup.psfhosted.org> Ronald Oussoren added the comment: A "problem" with CryptoKit is that it is a swift-only framework, which makes using those APIs harder from C code (not impossible). The older Security framework also contains crypto APIs, but seems to have less support for modern algorithms (e.g. no support for Curve25519). TBH I'm not sure if it is worthwhile to look into this in CPython, or that we should rely on OpenSSL for any integration (similar to Christian Heimes opinion on using the system keystore in the ssl module). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 05:45:33 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 09:45:33 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648374333.29.0.498359100499.issue43323@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30217 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32137 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 05:51:11 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 09:51:11 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648374671.36.0.52890468145.issue43323@roundup.psfhosted.org> Serhiy Storchaka added the comment: I fixed all suspicious places for which I found reproducers in PR 32137. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 05:52:38 2022 From: report at bugs.python.org (John Paul Adrian Glaubitz) Date: Sun, 27 Mar 2022 09:52:38 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648374758.85.0.887120020203.issue43323@roundup.psfhosted.org> John Paul Adrian Glaubitz added the comment: Awesome, thanks! I'll give it a try later today or tomorrow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 06:14:18 2022 From: report at bugs.python.org (Sam Ezeh) Date: Sun, 27 Mar 2022 10:14:18 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1648376058.0.0.214829297056.issue14265@roundup.psfhosted.org> Change by Sam Ezeh : ---------- keywords: +patch pull_requests: +30218 pull_request: https://github.com/python/cpython/pull/32138 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 06:16:04 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 27 Mar 2022 10:16:04 +0000 Subject: [issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes Message-ID: <1648376164.23.0.483054740742.issue47135@roundup.psfhosted.org> New submission from Steven D'Aprano : Whenever I use decimal and need to change the context temporarily, without fail I try to write with decimal.localcontext(prec=10): ... or similar. Then I get surprised that it fails, and re-write it as with decimal.localcontext() as ctx: ctx.prec = 10 ... Let's make the first version work. localcontext should accept keyword arguments corresponding to the same arguments accepted by Context, and set them on the context given. A proof-of-concept wrapper function: def localcontext(ctx=None, **kwargs): if ctx is None: ctx = decimal.getcontext().copy() for key, value in kwargs.items(): setattr(ctx, key, value) return decimal.localcontext(ctx) I think this would be a valuable, and useful, improvement to the decimal API. ---------- components: Library (Lib) messages: 416114 nosy: steven.daprano priority: normal severity: normal status: open title: Allow decimal.localcontext to accept keyword arguments to set context attributes versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 06:19:58 2022 From: report at bugs.python.org (Sam Ezeh) Date: Sun, 27 Mar 2022 10:19:58 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1648376398.03.0.976233156603.issue14265@roundup.psfhosted.org> Sam Ezeh added the comment: The provided patch wasn't entirely compatible with the current upstream code. I used the patch file to apply the changes to `Lib/unittest/case.py`, resolved the remaining conflicts with the patches to the test files and amended existing tests for the library. I updated the documentation for unittest to reflect the changes in behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 06:38:19 2022 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 27 Mar 2022 10:38:19 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648377499.05.0.677324684311.issue47079@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > It does not satisfy your assumptions in msg416056. Yes, but does it fits to assumptions of the numbers module? To be fair, there is even no requirement, that numerator/denominator are Integral instances (#25619 address also this). BTW, it seems, the numpy integer types break my guess that numerator and denominator must have same types (I doubt that anyone uses numbers.Integral defaults, there are no tests for them in the CPython itself): >>> a = numpy.int8(2); a 2 >>> type(a) >>> type(a.numerator) >>> type(a.denominator) >>> type(a + a.denominator) >>> type(a.denominator + a) >>> type(a + a) If this is an expected behaviour for Integral types - feel free to close the bugreport. Looks odd for me, however. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:17:56 2022 From: report at bugs.python.org (Takuo Matsuoka) Date: Sun, 27 Mar 2022 11:17:56 +0000 Subject: [issue47136] Wrong value assigned automatically to the variable __module__ in the class body. Message-ID: <1648379876.09.0.993153417089.issue47136@roundup.psfhosted.org> New submission from Takuo Matsuoka : In the creation of a class, it looks as if the value of the variable __name__ gets assigned automatically to the variable __module__ in the class body. However, the correct name space where the value of __name__ should be looked up is NOT the mapping object returned by the method __prepare__ of the metaclass. In the class body, the programmer may use the variable __name__ for some other purposes, and might not notice __module__ was messed up. Here's a code which produces a problem. ``` class C(type): @classmethod def __prepare__(cls, /, *args, **kwargs): return dict(__name__ = "whatever") class O(metaclass=C): print(__module__) # "whatever" printed ``` Consequently, >>> O.__module__ 'whatever' The issue is different from but seems related to https://bugs.python.org/issue28869 I haven't figured out the exact relation. Thanks. ---------- components: Interpreter Core messages: 416118 nosy: Takuo Matsuoka priority: normal severity: normal status: open title: Wrong value assigned automatically to the variable __module__ in the class body. type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:19:43 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Mar 2022 11:19:43 +0000 Subject: [issue47079] Integral.denominator shouldn't return an int In-Reply-To: <1647834489.3.0.839455374246.issue47079@roundup.psfhosted.org> Message-ID: <1648379983.76.0.694907163267.issue47079@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 07:54:07 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sun, 27 Mar 2022 11:54:07 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1648367783.07.0.0967367538655.issue47072@roundup.psfhosted.org> Message-ID: <2f108553-66aa-6aaf-f3f2-5e53af6fdc4e@egenix.com> Marc-Andre Lemburg added the comment: On 27.03.2022 09:56, Hubert Tournier wrote: > > The storage format used under Windows is completely different from the one used under Unix (or *BSD). The shelve module uses the dbm module underneath and this will pick its storage mechanism based on what's available on the platform: https://docs.python.org/3/library/dbm.html https://github.com/python/cpython/blob/3.10/Lib/dbm/__init__.py It's likely that you'll get the dbm.dumb interface on Windows. On Linux, you typically have one of gdbm or the Berkley DB installed. dbm.whichdb() will tell you which type of dbm implementation your files are likely using. More on the differences of DBM style libs: http://www.ccl.net/cca/software/UNIX/apache/apacheRH7.0/local-copies/dbm.html Aside: You are probably better off using SQLite with a pickle layer to store arbitrary objects. This is much more mature than the dbm modules. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 08:01:09 2022 From: report at bugs.python.org (qiu) Date: Sun, 27 Mar 2022 12:01:09 +0000 Subject: [issue47072] Database corruption with the shelve module In-Reply-To: <1647797363.41.0.855477940011.issue47072@roundup.psfhosted.org> Message-ID: <1648382469.28.0.299127415096.issue47072@roundup.psfhosted.org> Change by qiu <1425166100 at qq.com>: ---------- components: +Demos and Tools -FreeBSD, Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 08:10:29 2022 From: report at bugs.python.org (qiu) Date: Sun, 27 Mar 2022 12:10:29 +0000 Subject: [issue47137] MemoryError Message-ID: <1648383028.98.0.518734676925.issue47137@roundup.psfhosted.org> New submission from qiu <1425166100 at qq.com>: Traceback (most recent call last): File "python_AFL.py", line 110, in runFuzzer runtime = runApplication(input_path, mode) File "python_AFL.py", line 75, in runApplication exec(f.read(), {'buff': input_data}) File "", line 16, in File "", line 10, in fuzz File "/usr/lib/python3.6/codeop.py", line 122, in compile_command return _maybe_compile(_compile, source, filename, symbol) File "/usr/lib/python3.6/codeop.py", line 82, in _maybe_compile code = compiler(source, filename, symbol) File "/usr/lib/python3.6/codeop.py", line 102, in _compile return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) MemoryError when I use codeop.compile_command( random input ), I get the error . I wonder if I found the error with the Python codeop's library?? thanks! ---------- messages: 416120 nosy: Leilei priority: normal severity: normal status: open title: MemoryError type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 08:46:06 2022 From: report at bugs.python.org (Jacob Nilsson) Date: Sun, 27 Mar 2022 12:46:06 +0000 Subject: [issue47137] MemoryError In-Reply-To: <1648383028.98.0.518734676925.issue47137@roundup.psfhosted.org> Message-ID: <1648385166.54.0.529526701668.issue47137@roundup.psfhosted.org> Jacob Nilsson added the comment: Python 3.6 reach end of life in December 2021, is this error reproducible in Python 3.7 and above? If that is still the case, do you have an example of an exact input causing this crash? "random input" is not a lot to go by. ---------- nosy: +ajoino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 08:59:58 2022 From: report at bugs.python.org (qiu) Date: Sun, 27 Mar 2022 12:59:58 +0000 Subject: [issue47137] MemoryError In-Reply-To: <1648385166.54.0.529526701668.issue47137@roundup.psfhosted.org> Message-ID: qiu <1425166100 at qq.com> added the comment: 9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:28:21 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 27 Mar 2022 13:28:21 +0000 Subject: [issue46992] If use textwrap.dedent with string formatting, may get unintended sentences. In-Reply-To: <1647061298.28.0.525583998057.issue46992@roundup.psfhosted.org> Message-ID: <1648387701.7.0.391611181362.issue46992@roundup.psfhosted.org> Change by Eric V. Smith : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:31:15 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 27 Mar 2022 13:31:15 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1648387875.69.0.748725887035.issue36643@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Jelle here: dataclasses shouldn't be calling get_type_hints(). ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:33:18 2022 From: report at bugs.python.org (Ting-Che Lin) Date: Sun, 27 Mar 2022 13:33:18 +0000 Subject: [issue46799] ShareableList memory bloat and performance improvement In-Reply-To: <1645272150.7.0.530571625794.issue46799@roundup.psfhosted.org> Message-ID: <1648387998.28.0.0390696079546.issue46799@roundup.psfhosted.org> Ting-Che Lin added the comment: A gentle Ping to the multiprocessing lib maintainers. Is there anything else I can do to move this forward? ---------- resolution: -> remind _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:42:54 2022 From: report at bugs.python.org (Sam Ezeh) Date: Sun, 27 Mar 2022 13:42:54 +0000 Subject: [issue4833] Explicit directories for zipfiles In-Reply-To: <1231088968.72.0.101458538333.issue4833@psf.upfronthosting.co.za> Message-ID: <1648388574.89.0.221345910937.issue4833@roundup.psfhosted.org> Change by Sam Ezeh : ---------- nosy: +sam_ezeh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 09:49:36 2022 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 27 Mar 2022 13:49:36 +0000 Subject: [issue45171] stacklevel handling in logging module is inconsistent In-Reply-To: <1631366238.78.0.687157218809.issue45171@roundup.psfhosted.org> Message-ID: <1648388976.5.0.159303728948.issue45171@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 5ca6d7469be53960843df39bb900e9c3359f127f by Jouke Witteveen in branch 'main': bpo-45171: Fix stacklevel handling in logging. (GH-28287) https://github.com/python/cpython/commit/5ca6d7469be53960843df39bb900e9c3359f127f ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 10:00:14 2022 From: report at bugs.python.org (Sam Ezeh) Date: Sun, 27 Mar 2022 14:00:14 +0000 Subject: [issue4833] Explicit directories for zipfiles In-Reply-To: <1231088968.72.0.101458538333.issue4833@psf.upfronthosting.co.za> Message-ID: <1648389614.76.0.744892472313.issue4833@roundup.psfhosted.org> Sam Ezeh added the comment: I'm looking into adding ZipFile.mkdir ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 11:41:54 2022 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sun, 27 Mar 2022 15:41:54 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648395714.07.0.56026143924.issue47129@roundup.psfhosted.org> Lysandros Nikolaou added the comment: I like the newest suggestion by @Jelle better as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 11:44:46 2022 From: report at bugs.python.org (=?utf-8?q?Maciej_G=C3=B3rski?=) Date: Sun, 27 Mar 2022 15:44:46 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648395886.22.0.80729568363.issue47129@roundup.psfhosted.org> Maciej G?rski added the comment: I agree as well. I will change it to the new version :) Thanks for your input in this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 12:40:13 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 27 Mar 2022 16:40:13 +0000 Subject: [issue45171] stacklevel handling in logging module is inconsistent In-Reply-To: <1631366238.78.0.687157218809.issue45171@roundup.psfhosted.org> Message-ID: <1648399213.49.0.252642873351.issue45171@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The commit seems to emit a deprecation warning in test_logging. Probably the warning needs to be handled while setting trigger = self.logger.warn PYTHONWARNINGS=always ./python -Wall -m test test_logging 0:00:00 load avg: 1.63 Run tests sequentially 0:00:00 load avg: 1.63 [1/1] test_logging /home/karthikeyan/stuff/python/cpython/Lib/test/test_logging.py:5056: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead trigger('test', stacklevel=the_level) == Tests result: SUCCESS == 1 test OK. Total duration: 20.1 sec Tests result: SUCCESS ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:20:11 2022 From: report at bugs.python.org (Jouke Witteveen) Date: Sun, 27 Mar 2022 17:20:11 +0000 Subject: [issue45171] stacklevel handling in logging module is inconsistent In-Reply-To: <1631366238.78.0.687157218809.issue45171@roundup.psfhosted.org> Message-ID: <1648401611.84.0.488001829666.issue45171@roundup.psfhosted.org> Change by Jouke Witteveen : ---------- pull_requests: +30220 pull_request: https://github.com/python/cpython/pull/32139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:31:11 2022 From: report at bugs.python.org (Marek Suscak) Date: Sun, 27 Mar 2022 17:31:11 +0000 Subject: [issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section In-Reply-To: <1535045437.7.0.56676864532.issue34480@psf.upfronthosting.co.za> Message-ID: <1648402271.73.0.580668464988.issue34480@roundup.psfhosted.org> Marek Suscak added the comment: Based on the changelog, it seems that the fix for this issue has only landed in Python 3.10 but it's still affecting versions 3.7, 3.8 and 3.9. There are a few projects such as Apache Beam that have only recently added support for Python 3.9 with no support for 3.10. Beautiful Soup is a popular tool that's affected by this bug and so my question is if backporting this bugfix to at least Python 3.9 which is still an officially supported release is on the table? ---------- message_count: 11.0 -> 12.0 nosy: +mareksuscak nosy_count: 8.0 -> 9.0 pull_requests: +30221 pull_request: https://github.com/python/cpython/pull/8562 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 13:57:12 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 27 Mar 2022 17:57:12 +0000 Subject: [issue47124] explore hashlib use of the Apple CryptoKit macOS In-Reply-To: <1648255710.38.0.570771334735.issue47124@roundup.psfhosted.org> Message-ID: <1648403832.93.0.775501598034.issue47124@roundup.psfhosted.org> Gregory P. Smith added the comment: I only pointed to that API after a brief search without looking at details (Swift? oops!). If there is one available from C that'd also make sense to consider. The only things I expect, relevant to hashlib, that would be accelerated by OS native APIs most platforms are SHA2, maybe SHA1, and sometimes HMAC using those. I'm in no position to judge if there is value in using them, I'm just assuming there might be. The irony is that builds without OpenSSL are rare, so unless the OS native APIs provide tangible benefits it may not matter. (ex: the Linux APIs may allow for an efficient zero-copy variant of the new `hashlib.file_digest()` function) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 14:22:12 2022 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 27 Mar 2022 18:22:12 +0000 Subject: [issue45171] stacklevel handling in logging module is inconsistent In-Reply-To: <1631366238.78.0.687157218809.issue45171@roundup.psfhosted.org> Message-ID: <1648405332.44.0.684133693979.issue45171@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset c12ba6b2ff7908c8970b978f149d51ecd3fb195c by Jouke Witteveen in branch 'main': bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139) https://github.com/python/cpython/commit/c12ba6b2ff7908c8970b978f149d51ecd3fb195c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 14:46:36 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 27 Mar 2022 18:46:36 +0000 Subject: [issue46429] Merge all deepfrozen files into one In-Reply-To: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> Message-ID: <1648406796.3.0.899348283126.issue46429@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 785cc6770588de087d09e89a69110af2542be208 by Kumar Aditya in branch 'main': bpo-46429: tweak deepfreeze output (#32107) https://github.com/python/cpython/commit/785cc6770588de087d09e89a69110af2542be208 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 15:43:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Mar 2022 19:43:03 +0000 Subject: [issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section In-Reply-To: <1535045437.7.0.56676864532.issue34480@psf.upfronthosting.co.za> Message-ID: <1648410183.94.0.782627774068.issue34480@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 15:53:33 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 27 Mar 2022 19:53:33 +0000 Subject: [issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS In-Reply-To: <1648296993.82.0.182445504362.issue47127@roundup.psfhosted.org> Message-ID: <1648410813.07.0.70168997076.issue47127@roundup.psfhosted.org> Ken Jin added the comment: New changeset 58448cbd96f77ebc6fca1f8030bedc7744eb66ef by Kumar Aditya in branch 'main': bpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125) https://github.com/python/cpython/commit/58448cbd96f77ebc6fca1f8030bedc7744eb66ef ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 16:22:31 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 27 Mar 2022 20:22:31 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648412551.25.0.0658449624315.issue44493@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset f6b3a07b7df60dc04d0260169ffef6e9796a2124 by ty in branch 'main': bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) https://github.com/python/cpython/commit/f6b3a07b7df60dc04d0260169ffef6e9796a2124 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 16:22:59 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 27 Mar 2022 20:22:59 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648412579.08.0.741480528005.issue44493@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +30222 pull_request: https://github.com/python/cpython/pull/32140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 16:23:04 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 27 Mar 2022 20:23:04 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648412584.08.0.52795195185.issue44493@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30223 pull_request: https://github.com/python/cpython/pull/32141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 17:35:28 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 27 Mar 2022 21:35:28 +0000 Subject: [issue47136] Wrong value assigned automatically to the variable __module__ in the class body. In-Reply-To: <1648379876.09.0.993153417089.issue47136@roundup.psfhosted.org> Message-ID: <1648416928.83.0.555868136493.issue47136@roundup.psfhosted.org> Steven D'Aprano added the comment: > the programmer may use the variable __name__ for some other purposes Dunder names like `__name__` are reserved for the use of the interpreter. If the programmer uses them for "other purposes", the programmer is responsible for any failures. You wouldn't write: class MyList(list): __len__ = "Hello world!" and then be surprised that MyList is broken. You shouldn't be surprised if setting `__name__` to an invalid value breaks things either. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 18:09:27 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 27 Mar 2022 22:09:27 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648418967.14.0.339240462782.issue44090@roundup.psfhosted.org> Guido van Rossum added the comment: So IIUC the "autosuper" idea is to assign a special instance of super to self.__super, so that you can write self.__super.method(...) to invoke a super method, using the magic of __private variables, instead of having to write super(classname, self).method(...). That was perhaps a good idea 20 years ago, but nowadays you can use argument-less super(), so you can write super().method(...), and AFAICT that works for class methods too. I don't think we need two ways to do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 18:29:01 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 27 Mar 2022 22:29:01 +0000 Subject: [issue47133] enhance unittest to show test name and docstring on one line In-Reply-To: <1648363328.44.0.572849493381.issue47133@roundup.psfhosted.org> Message-ID: <20220327222709.GJ8276@ando.pearwood.info> Steven D'Aprano added the comment: Rather than an option for this, it would be cleaner to deprecate the current output in 3.11, and fix it in 3.12 or 3.13. Otherwise we have to maintain the old (bad?) output and the new output both forever. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 20:06:41 2022 From: report at bugs.python.org (qiu) Date: Mon, 28 Mar 2022 00:06:41 +0000 Subject: [issue47137] MemoryError In-Reply-To: <1648385166.54.0.529526701668.issue47137@roundup.psfhosted.org> Message-ID: qiu <1425166100 at qq.com> added the comment: hello, Did you get the E-mail about one random input I sent you? one random input is [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[O[[[[[[[[[[[[[[[[[[[[[[[[[[[[[m[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[E[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[l[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[y[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[)) looking forward to your reply!  thanks! ------------------ ???? ------------------ ???: "Python tracker" _______________________________________ From report at bugs.python.org Sun Mar 27 21:11:36 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 01:11:36 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648429896.24.0.159821325262.issue46907@roundup.psfhosted.org> Ned Deily added the comment: 3.38.2 was released on 2022-03-26. Since the update to 3.38.1 hasn't yet been in a 3.11.0 alpha release, I'm re-open this issue. https://sqlite.org/releaselog/3_38_2.html ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open title: Update Windows and MacOS installer to SQLite 3.38.1 -> Update Windows and MacOS installer to SQLite 3.38.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 21:58:49 2022 From: report at bugs.python.org (ty) Date: Mon, 28 Mar 2022 01:58:49 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648432729.37.0.431382893419.issue44493@roundup.psfhosted.org> Change by ty : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 22:53:48 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Mar 2022 02:53:48 +0000 Subject: [issue47083] The __complex__ method is missing from the complex, float, and int built-in types In-Reply-To: <1647882580.13.0.610930198027.issue47083@roundup.psfhosted.org> Message-ID: <1648436028.22.0.112657392709.issue47083@roundup.psfhosted.org> Raymond Hettinger added the comment: I think this may fine as-is. In general, virtiual classes only promise that an operation will work rather than promsing the presence of a particular method. An object can be Iterable without defining __iter__ because iter() can use __getitem__ and __len__ to build a sequence iterator. Likewise, an object can be a Container without defining __contains__ because the in-operator will work on any iterable. An object can be Reversible without defining __reversed__ because reversed() will fall back to an implementation based on __getitem__ and __len__. The docstring in numbers.Complex promises, "Complex defines the operations that work on the builtin complex type. In short, those are: a conversion to complex, .real, .imag, +, -, *, /, **, abs(), .conjugate, ==, and !=." In other words, the promise is that these work (which they do): >>> complex(0.0) 0j >>> int(0.0) 0 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 27 23:14:47 2022 From: report at bugs.python.org (Evernow) Date: Mon, 28 Mar 2022 03:14:47 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1648437287.11.0.0176618084546.issue45382@roundup.psfhosted.org> Evernow added the comment: As mentioned wmic is deprecated ( https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmic ). I don't see why the wmi module ( https://pypi.org/project/WMI/ ) can't be used instead to get the information, I have a working implementation of this that simply does the following: current_major_version = wmi.WMI().Win32_OperatingSystem()[0].Caption.encode("ascii", "ignore").decode( "utf-8") if "8" in current_major_version: pass elif "7" in current_major_version: pass elif "10" in current_major_version: pass elif "11" in current_major_version: pass ---------- nosy: +Evernow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:01:17 2022 From: report at bugs.python.org (Takuo Matsuoka) Date: Mon, 28 Mar 2022 04:01:17 +0000 Subject: [issue47136] Wrong value assigned automatically to the variable __module__ in the class body. In-Reply-To: <1648379876.09.0.993153417089.issue47136@roundup.psfhosted.org> Message-ID: <1648440077.3.0.768649626811.issue47136@roundup.psfhosted.org> Takuo Matsuoka added the comment: Thank you for your response. I think __name__ here is very different from __len__ . (1) Even if you set __name__ to what should be the right value, e.g., when my class O will be a subclass of say 'type', and __name__ is an appropriate thing for your purposes to override the attribute '__name__' of 'type' objects (held as the entry '__name__' of type.__dict__), the same value is going to be O.__dict__["__module__"] as long as you let __prepare__ of the mataclass C provide it. (2) Even if, in other cases, you do del __name__ at the end of the body of the class O, the problem remains unless you know O.__dict__["__module__"] will be changed anyway. The behaviour is not documented as far as I could see. I think such a behaviour is problematic if it can't be expected from what's documented. If the value of __name__ can be read from the scope outside, then that will erase this unexpected behaviour and I think it would be a much safer thing to do. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:31:44 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 04:31:44 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648441904.26.0.676581758022.issue28516@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +30224 pull_request: https://github.com/python/cpython/pull/32144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:31:50 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 04:31:50 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648441910.28.0.625632003819.issue28516@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30225 pull_request: https://github.com/python/cpython/pull/32145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:31:59 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 28 Mar 2022 04:31:59 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648441919.5.0.807221828663.issue28516@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 86384cf83f96fcaec03e2ad6516e2e24f20d3b92 by vidhya in branch 'main': bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) https://github.com/python/cpython/commit/86384cf83f96fcaec03e2ad6516e2e24f20d3b92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 00:40:58 2022 From: report at bugs.python.org (neonene) Date: Mon, 28 Mar 2022 04:40:58 +0000 Subject: [issue47103] Copy pgort140.dll when building for PGO In-Reply-To: <1648065621.85.0.817743953237.issue47103@roundup.psfhosted.org> Message-ID: <1648442458.02.0.751471262469.issue47103@roundup.psfhosted.org> Change by neonene : ---------- nosy: +neonene nosy_count: 4.0 -> 5.0 pull_requests: +30226 pull_request: https://github.com/python/cpython/pull/32146 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:03:02 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Mon, 28 Mar 2022 05:03:02 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648443782.87.0.432210219451.issue46907@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- pull_requests: +30227 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32147 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:06:10 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Mon, 28 Mar 2022 05:06:10 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648443970.06.0.363528808731.issue46907@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- pull_requests: +30228 pull_request: https://github.com/python/cpython/pull/32148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 01:22:51 2022 From: report at bugs.python.org (jiahua wang) Date: Mon, 28 Mar 2022 05:22:51 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648444971.21.0.291280523168.issue46907@roundup.psfhosted.org> Change by jiahua wang : ---------- nosy: +wangjiahua nosy_count: 9.0 -> 10.0 pull_requests: +30229 pull_request: https://github.com/python/cpython/pull/32149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:18:53 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 28 Mar 2022 06:18:53 +0000 Subject: [issue47098] sha3: Replace Keccak Code Package with tiny_sha3 In-Reply-To: <1648026382.03.0.0255347692375.issue47098@roundup.psfhosted.org> Message-ID: <1648448333.62.0.909250448064.issue47098@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 Mar 28 02:55:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 06:55:28 +0000 Subject: [issue16958] The sqlite3 context manager does not work with isolation_level=None In-Reply-To: <1358124405.04.0.0310758361359.issue16958@psf.upfronthosting.co.za> Message-ID: <1648450528.46.0.519852419204.issue16958@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 02:57:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 06:57:42 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1648450662.36.0.27674901293.issue42197@roundup.psfhosted.org> STINNER Victor added the comment: Mark: Please add the new PyFrame_GetLocals() function to the C API > New Features doc: https://docs.python.org/dev/whatsnew/3.11.html#id1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 03:10:50 2022 From: report at bugs.python.org (Tim Golden) Date: Mon, 28 Mar 2022 07:10:50 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1648451450.18.0.974938178514.issue45382@roundup.psfhosted.org> Tim Golden added the comment: > I don't see why the wmi module ( https://pypi.org/project/WMI/ ) can't be used instead to get the information Well I can speak here as the author of that module and as an (occasional) core developer. The wmi module stands on the shoulderes of the pywin32 win32com.client code -- which is an _enormous_ dependency to bring into Python. (And which no-one would realistically agree to...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 03:34:15 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Mon, 28 Mar 2022 07:34:15 +0000 Subject: [issue47128] Enhance Argument Clinic's NoneType return converter to give `void` In-Reply-To: <1648299568.03.0.403379659681.issue47128@roundup.psfhosted.org> Message-ID: <1648452855.53.0.150504984756.issue47128@roundup.psfhosted.org> Oleg Iarygin added the comment: Actually, you're right. For now, PyErr_Occurred is a GIL lock plus a memory access. While the access is cheap because of a L1 cache hit, the GIL takes its toll in a hot path. So I'm closing the PR until GIL removal is done so no performance penalty will be imposed. I could use _PyErr_Occurred because "Currently Argument Clinic is considered internal-only for CPython", but it requires extra modifications of the clinic that is undesirable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 04:03:17 2022 From: report at bugs.python.org (Maciej Olko) Date: Mon, 28 Mar 2022 08:03:17 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648454597.14.0.574932744173.issue45618@roundup.psfhosted.org> Maciej Olko added the comment: > This really should be handled in a new issue since the original fixes for all affected releases are already in the field. Sorry, I got suggested too much with expected fix which is common for both of those issues. Shall I create a new issue? > Moreover, we should be a bit careful about bumping the required Sphinx version for older releases as this has caused problems for downstream distributors of Python in the past. Can't we just pin the Jinja2 version for current releases? Didn't know about the problems for distributors. Definitely just pinning Jinja2 is enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 04:17:25 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 28 Mar 2022 08:17:25 +0000 Subject: [issue47138] Bump Sphinx to fix docs build Message-ID: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> New submission from Hugo van Kemenade : The docs build on GitHub Actions is passing on `main` but has started failing for the `3.7` - `3.10` branches: ``` Missing the required blurb or sphinx-build tools. Please run 'make venv' to install local copies. make[1]: *** [Makefile:50: build] Error 1 ``` https://github.com/python/cpython/actions/workflows/doc.yml https://github.com/python/cpython/runs/5714593700?check_suite_focus=true This is because the `PATH=./venv/bin:$PATH sphinx-build --version` check is failing: ``` /home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/sphinx/util/docutils.py:45: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. __version_info__ = tuple(LooseVersion(docutils.__version__).version) Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Doc/./venv/bin/sphinx-build", line 5, in from sphinx.cmd.build import main File "/home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/sphinx/cmd/build.py", line 25, in from sphinx.application import Sphinx File "/home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/sphinx/application.py", line 42, in from sphinx.registry import SphinxComponentRegistry File "/home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/sphinx/registry.py", line 24, in from sphinx.builders import Builder File "/home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 26, in from sphinx.util import import_object, logging, rst, progress_message, status_iterator File "/home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/sphinx/util/rst.py", line 22, in from jinja2 import environmentfilter ImportError: cannot import name 'environmentfilter' from 'jinja2' (/home/runner/work/cpython/cpython/Doc/venv/lib/python3.10/site-packages/jinja2/__init__.py) ``` This is because `3.10` and `3.9` are still using old versions of Sphinx (3.2.1 and 2.4.4 respectively) which is incompatible with the newest Jinja2: https://github.com/pallets/jinja/issues/1630 `main` is using a newer Sphinx (4.2.0), so it passes. Bumping to Sphinx 4.5.0 will fix both `3.9` and `3.10`. `3.7` and `3.8` are affected too. We can bump `main` to use `4.5.0` as well. ---------- assignee: docs at python components: Documentation messages: 416149 nosy: docs at python, hugovk priority: normal severity: normal status: open title: Bump Sphinx to fix docs build 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 Mar 28 04:24:56 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 28 Mar 2022 08:24:56 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648455896.58.0.639805719028.issue45618@roundup.psfhosted.org> Hugo van Kemenade added the comment: > > This really should be handled in a new issue since the original fixes for all affected releases are already in the field. > Sorry, I got suggested too much with expected fix which is common for both of those issues. Shall I create a new issue? I created https://bugs.python.org/issue47138, let's continue there. ---------- nosy: +hugovk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 04:32:05 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 28 Mar 2022 08:32:05 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648456325.44.0.857901616128.issue47138@roundup.psfhosted.org> Hugo van Kemenade added the comment: re: https://bugs.python.org/issue45618#msg416017 Maciej Olko, please could you update these PRs to keep the Sphinx version the same and only pin Jinja2 to match? 3.7: https://github.com/python/cpython/pull/32109 3.8: https://github.com/python/cpython/pull/32111 I guess update them to use this bpo too. Thanks! ---------- title: Bump Sphinx to fix docs build -> Bump Sphinx or pin Jinja2 to fix docs build _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 04:44:05 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 28 Mar 2022 08:44:05 +0000 Subject: [issue47070] Improve performance of array_inplace_repeat In-Reply-To: <1647725238.0.0.579298604794.issue47070@roundup.psfhosted.org> Message-ID: <1648457045.13.0.766948962172.issue47070@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset 850687df47b03e98c1433e6e70e71a8921eb4454 by Pieter Eendebak in branch 'main': bpo-47070: Add _PyBytes_Repeat() (GH-31999) https://github.com/python/cpython/commit/850687df47b03e98c1433e6e70e71a8921eb4454 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 05:10:10 2022 From: report at bugs.python.org (Stanley) Date: Mon, 28 Mar 2022 09:10:10 +0000 Subject: [issue37430] [doc] range is not a built-in function In-Reply-To: <1561649972.91.0.461406342746.issue37430@roundup.psfhosted.org> Message-ID: <1648458610.78.0.951773831648.issue37430@roundup.psfhosted.org> Stanley added the comment: Terry, how do you think the example/paragraph should be improved? I notice that the previous paragraphs talk about continue/break/else, so were you looking for some new example with all those? And I think the indexing's been fixed by now, but a clickable link to the range() documentation (https://docs.python.org/3/library/stdtypes.html#range) might still be a good idea just for convenience. ---------- nosy: +slateny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 05:14:38 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 28 Mar 2022 09:14:38 +0000 Subject: [issue46712] Share global string identifiers in deepfreeze In-Reply-To: <1644502683.1.0.673362326219.issue46712@roundup.psfhosted.org> Message-ID: <1648458878.41.0.954427826013.issue46712@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +30230 pull_request: https://github.com/python/cpython/pull/32152 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 05:48:02 2022 From: report at bugs.python.org (Richard Purdie) Date: Mon, 28 Mar 2022 09:48:02 +0000 Subject: [issue47139] pthread_sigmask needs SIG_BLOCK behaviour explaination Message-ID: <1648460882.85.0.215889211593.issue47139@roundup.psfhosted.org> New submission from Richard Purdie : I've been struggling to get signal.pthread_sigmask to do what I expected it to do from the documentation. Having looked at the core python code handling signals I now (think?!) I understand what is happening. It might be possible for python to improve the behaviour, or it might just be something to document, I'm not sure but I though I'd mention it. I'd added pthread_sigmask(SIG_BLOCK, (SIGTERM,)) and pthread_sigmask(SIG_UNBLOCK, (SIGTERM,)) calls around a critical section I wanted to protect from the SIGTERM signal. I was still seeing SIGTERM inside that section. Using SIGMASK to restore the mask instead of SIG_UNBLOCK behaves the same. What I hadn't realised is that firstly python defers signals to a convenient point and secondly that signals are processed in the main thread regardless of the thread they arrived in. This means that I can see SIGTERM arrive in my critical section as one of my other threads created in the background by the core python libs helpfully handles it. This makes SIG_BLOCK rather ineffective in any threaded code. To work around it, I can add my own handlers and have them track whether a signal arrived, then handle any signals after my critical section by re-raising them. It is possible python itself could defer processing signals masked with SIG_BLOCK until they're unblocked. Alternatively, a note in the documentation warning of the pitfalls here might be helpful to save someone else from wondering what is going on! ---------- components: Interpreter Core messages: 416154 nosy: rpurdie priority: normal severity: normal status: open title: pthread_sigmask needs SIG_BLOCK behaviour explaination versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 05:51:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Mar 2022 09:51:33 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648461093.82.0.760677249985.issue26120@roundup.psfhosted.org> Irit Katriel added the comment: That's a good point. I see that the __future__ imports appear in the dir() of the module, and indeed they are imported with 'from m import *'. But I wonder if that is actually a bug. If you try this: % cat x.py from __future__ import annotations % cat y.py from x import * print(dir()) class D: def f(self, a: D): return 42 % ./python.exe y.py ['__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'annotations'] Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-654/y.py", line 5, in class D: ^^^^^^^^ File "/Users/iritkatriel/src/cpython-654/y.py", line 6, in D def f(self, a: D): ^ NameError: name 'D' is not defined -------------------------------------------------- but if you add "from __future__ import annotations" at the top of y.py, then it does run. So perhaps the future imports should be excluded by "from m import *"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 06:46:47 2022 From: report at bugs.python.org (Ofek Shilon) Date: Mon, 28 Mar 2022 10:46:47 +0000 Subject: [issue47140] configure --enable-optimizations with clang *12* fails to detect llvm-profdata Message-ID: <1648464407.56.0.975002069724.issue47140@roundup.psfhosted.org> New submission from Ofek Shilon : Working on 3/228/2022 github trunk in Ubuntu20. If I use the shipped clang10 : $ ./configure --enable-optimizations succeeds. If however I - $ export CC=clang-12 `configure` starts to fail with symptoms identical to https://bugs.python.org/issue36002: checking for --enable-optimizations... yes checking for --with-lto... no checking for -llvm-profdata... no configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found. Manually setting LLVM_PROFDATA is still a valid workaround. ---------- components: Build messages: 416156 nosy: ofekshilon priority: normal severity: normal status: open title: configure --enable-optimizations with clang *12* fails to detect llvm-profdata versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:12:14 2022 From: report at bugs.python.org (Maciej Olko) Date: Mon, 28 Mar 2022 11:12:14 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648465934.41.0.458309032423.issue47138@roundup.psfhosted.org> Change by Maciej Olko : ---------- keywords: +patch nosy: +Maciej Olko nosy_count: 2.0 -> 3.0 pull_requests: +30231 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:17:09 2022 From: report at bugs.python.org (Maciej Olko) Date: Mon, 28 Mar 2022 11:17:09 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648466229.34.0.0972475154162.issue47138@roundup.psfhosted.org> Change by Maciej Olko : ---------- pull_requests: +30232 pull_request: https://github.com/python/cpython/pull/32109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:22:25 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 28 Mar 2022 11:22:25 +0000 Subject: [issue47115] Documentation inconsistency with the stable ABI In-Reply-To: <1648195503.34.0.47585180018.issue47115@roundup.psfhosted.org> Message-ID: <1648466545.4.0.53467413867.issue47115@roundup.psfhosted.org> Petr Viktorin added the comment: Thanks for the report! You're right that this is misleading. I'll clarify the docs for this and other structs. - struct PyTypeObject is part if the limited API. - its fields and size are not part of the API or stable ABI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:24:11 2022 From: report at bugs.python.org (Maciej Olko) Date: Mon, 28 Mar 2022 11:24:11 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648466651.35.0.450558725565.issue47138@roundup.psfhosted.org> Maciej Olko added the comment: I've update both PRs to contain the pin only. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:25:23 2022 From: report at bugs.python.org (Julien Palard) Date: Mon, 28 Mar 2022 11:25:23 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1648466723.02.0.471553697981.issue45953@roundup.psfhosted.org> Julien Palard added the comment: Since https://github.com/python/cpython/commit/121f1f893a39d0b58d3d2b5597505c154ecaac2a, `sys.getrefcount(1)` is surprising: >>> __import__("sys").getrefcount(1) 1000000210 Should sys.getrefcount try to "fix" the value like by returning `PyREFCNT(object) % 999999999`? (But using a define to avoid the "magic, copy/pasted value"). ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 07:54:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2022 11:54:59 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648468499.37.0.927020831532.issue26120@roundup.psfhosted.org> Serhiy Storchaka added the comment: I once proposed to exclude modules from the star import by default, but this proposition was rejected. You can try, maybe your proposition will be more acceptable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:16:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 12:16:29 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1648469789.37.0.388882964423.issue45953@roundup.psfhosted.org> STINNER Victor added the comment: > Should sys.getrefcount try to "fix" the value (...) https://peps.python.org/pep-0683/ would make it possible. Right now, I don't think that it's possible. Right now, a refcount of 1000000210 can be a real value, or it can be an immortal object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:17:39 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Mar 2022 12:17:39 +0000 Subject: [issue47137] MemoryError In-Reply-To: <1648383028.98.0.518734676925.issue47137@roundup.psfhosted.org> Message-ID: <1648469859.58.0.731474947752.issue47137@roundup.psfhosted.org> Eric V. Smith added the comment: A simpler reproducer is: codeop.compile_command('[' * 100) Verified I get MemoryError on cygwin PYthon 3.8.12. A length of 99 does not show a problem. On Windows 3.11.0a5+, I get: >>> codeop.compile_command('[' * 201) Traceback (most recent call last): File "", line 1, in File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 107, in compile_command return _maybe_compile(_compile, source, filename, symbol) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 70, in _maybe_compile compiler(source + "\n", filename, symbol) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 86, in _compile return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT | PyCF_ALLOW_INCOMPLETE_INPUT) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1 [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ^ SyntaxError: too many nested parentheses A length of 200 seems to work correctly. So it looks like this was fixed somewhere along the line, I'm guessing with the PEG parser. I suspect backporting the fix to older versions won't be possible. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:26:22 2022 From: report at bugs.python.org (=?utf-8?q?Vlastimil_Z=C3=ADma?=) Date: Mon, 28 Mar 2022 12:26:22 +0000 Subject: [issue47141] EmailMessage may lack Mime-Version Message-ID: <1648470382.24.0.396391704333.issue47141@roundup.psfhosted.org> New submission from Vlastimil Z?ma : When an `EmailMessage` is created without setting its content, it may lack the `MIME-Version` header. I encountered this behavior when creating a S/MIME signed message, but I believe it applies to any `EmailMessage` in general. Example: from email.message import EmailMessage nested_message = EmailMessage() nested_message.set_content("Gazpacho!") env = EmailMessage() env.add_header("Content-Type", "multipart/signed", protocol="application/pkcs7-signature", micalg='sha-256') env.preamble = "This is an S/MIME signed message" env.attach(nested_message) print(str(env)) This results in a message with no `MIME-Version` header Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="===============4414940364499332856==" This is an S/MIME signed message --===============4414940364499332856== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Gazpacho! --===============4414940364499332856==-- which violates section 4 of RFC 2045, see https://datatracker.ietf.org/doc/html/rfc2045#section-4 > Messages composed in accordance with this document MUST include such a header field, with the following verbatim text: MIME-Version: 1.0 and the section doesn't seem to be obsoleted by newer MIME related RFCs. It's not clear why the `EmailMessage` shouldn't have the `MIME-Version` header defined in all cases, since it should represent the email message. I suggest to set the `MIME-version` header on `__init__` the same way `MIMEBase` does. ---------- components: email messages: 416163 nosy: Vlastimil.Z?ma, barry, r.david.murray priority: normal severity: normal status: open title: EmailMessage may lack Mime-Version type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:48:15 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 28 Mar 2022 12:48:15 +0000 Subject: [issue47142] Document importlib.resources.abc.Traversable Message-ID: <1648471695.21.0.705816081737.issue47142@roundup.psfhosted.org> New submission from Petr Viktorin : importlib.resources.files is documented [0] as returning importlib.resources.abc.Traversable, which is an undocumented class (dead link) now. It should be documented. The [source] has helpful docstrings, but is missing some details. I'd like to know these before writing some docs: - Can the argument to `joinpath` contain path separators? - Are the methods expected to raise specific exception types (e.g. if a resource is missing, or you call iterdir on a ?file?)? This seems quite important for people who implement the protocol. [0]: https://docs.python.org/dev/library/importlib.resources.html#importlib.resources.files [source]: https://github.com/python/cpython/blob/main/Lib/importlib/resources/abc.py#L49 ---------- assignee: docs at python components: Documentation messages: 416164 nosy: docs at python, jaraco, petr.viktorin priority: normal severity: normal status: open title: Document importlib.resources.abc.Traversable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:56:19 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 28 Mar 2022 12:56:19 +0000 Subject: [issue47124] explore hashlib use of the Apple CryptoKit macOS In-Reply-To: <1648255710.38.0.570771334735.issue47124@roundup.psfhosted.org> Message-ID: <1648472179.44.0.980261394984.issue47124@roundup.psfhosted.org> Ronald Oussoren added the comment: SecDigestTransformCreate() is probably a relevant API to look into, this seems to be supported from 10.7 until now. A major disadvantage for us of this API is that it is a CoreFoundation API and because of that is problematic in pre-forking scenario's (that is, call in a child proces that's the result of fork-without-exec) because most if not all CoreFoundation types are not safe to use in these scenario's. Apple also has an older crypto API, but that has been deprecated for a long time and should not be used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 08:59:22 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 28 Mar 2022 12:59:22 +0000 Subject: [issue47142] Document importlib.resources.abc.Traversable In-Reply-To: <1648471695.21.0.705816081737.issue47142@roundup.psfhosted.org> Message-ID: <1648472362.77.0.22457727913.issue47142@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- assignee: docs at python -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:02:52 2022 From: report at bugs.python.org (qiu) Date: Mon, 28 Mar 2022 13:02:52 +0000 Subject: [issue47137] MemoryError In-Reply-To: <1648469859.58.0.731474947752.issue47137@roundup.psfhosted.org> Message-ID: qiu <1425166100 at qq.com> added the comment: y ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:47:57 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 13:47:57 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648475277.4.0.596377746772.issue47138@roundup.psfhosted.org> Ned Deily added the comment: Thank you both for addressing this. The main reason for minimizing changes to the docs build chain for brances in bugfix or security-fix-only phases is that many distributors of Python also release the Python docs as a package and they do not necessarily rely on using our fairly-recent venv step in the Docs Makefile. In particular, they want to use the versions of Sphinx et al that they release as packages. If we change the required versions for these mid-stream, they not only have to update the docs themselves but have to go through the process of updating the other packages (like Sphinx) which may have other consequences. This can also impact our own on-line doc building process. (Version updates for a new Python feature release prior to its entering beta phase are not a problem.) So it is best to do the minimal amount of version updating for releases in the field, preferably none (as in pinning existing versions). In that spirit, we should also just pin the Jinja2 version for 3.10 and 3.9. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:51:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 13:51:37 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures Message-ID: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> New submission from STINNER Victor : Class decorarators of attrs and stdlib dataclasses modules have to copy a class to *add* slots: * old fixed attrs issue: https://github.com/python-attrs/attrs/issues/102 * attrs issue with Python 3.11: https://github.com/python-attrs/attrs/issues/907 * dataclasses issues with slots=True: https://bugs.python.org/issue46404 In the common case, copying a class is trivial: cls2 = type(cls)(cls.__name__, cls.__bases__, cls.__dict__) Full dummy example just to change a class name without touching the original class (create a copy with a different name): --- class MyClass: def hello(self): print("Hello", self.__class__) def copy_class(cls, new_name): cls_dict = cls.__dict__.copy() # hack the dict to modify the class copy return type(cls)(new_name, cls.__bases__, cls_dict) MyClass2 = copy_class(MyClass, "MyClass2") MyClass2().hello() --- Output: --- Hello --- The problem is when a class uses a closure ("__class__" here): --- class MyClass: def who_am_i(self): cls = __class__ print(cls) if cls is not self.__class__: raise Exception(f"closure lies: __class__={cls} {self.__class__=}") def copy_class(cls, new_name): cls_dict = cls.__dict__.copy() # hack the dict to modify the class copy return type(cls)(new_name, cls.__bases__, cls_dict) MyClass().who_am_i() MyClass2 = copy_class(MyClass, "MyClass2") MyClass2().who_am_i() --- Output: --- Traceback (most recent call last): ... Exception: closure lies: __class__= self.__class__= --- The attrs project uses the following complicated code to workaround this issue (to "update closures"): --- # The following is a fix for # . On Python 3, # if a method mentions `__class__` or uses the no-arg super(), the # compiler will bake a reference to the class in the method itself # as `method.__closure__`. Since we replace the class with a # clone, we rewrite these references so it keeps working. for item in cls.__dict__.values(): if isinstance(item, (classmethod, staticmethod)): # Class- and staticmethods hide their functions inside. # These might need to be rewritten as well. closure_cells = getattr(item.__func__, "__closure__", None) elif isinstance(item, property): # Workaround for property `super()` shortcut (PY3-only). # There is no universal way for other descriptors. closure_cells = getattr(item.fget, "__closure__", None) else: closure_cells = getattr(item, "__closure__", None) if not closure_cells: # Catch None or the empty list. continue for cell in closure_cells: try: match = cell.cell_contents is self._cls except ValueError: # ValueError: Cell is empty pass else: if match: set_closure_cell(cell, cls) --- source: https://github.com/python-attrs/attrs/blob/5c040f30e3e4b3c9c0f27c8ac6ff13d604c1818c/src/attr/_make.py#L886 The implementation of the set_closure_cell() function is really complicate since cells were mutable before Python 3.10: https://github.com/python-attrs/attrs/blob/5c040f30e3e4b3c9c0f27c8ac6ff13d604c1818c/src/attr/_compat.py#L203-L305 I propose to add a new functools.copy_class() function which copy a class and update the closures: end of the _create_slots_class() function: --- cls = type(self._cls)(...) for item in cls.__dict__.values(): ... # update closures return cls --- The alternative is not to add a function to copy a class, just only to "update closures", but IMO such API would be more error prone. I would like to implement this function, but first I would like to dicuss if it makes sense to add such function and check if it's the right abstraction. ---------- components: Library (Lib) messages: 416168 nosy: eric.smith, petr.viktorin, rhettinger, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Add functools.copy_class() which updates closures versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:53:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 13:53:30 +0000 Subject: [issue46404] RFE: @dataclasses.dataclass(slots=True) doesn't support methods using closures In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1648475610.7.0.250920130911.issue46404@roundup.psfhosted.org> STINNER Victor added the comment: I changed the issue title to focus this issue on enhance dataclasses to support @dataclasses.dataclass(slots=True) on methods using closures: it would be a new Python 3.11 feature. I created https://bugs.python.org/issue47143 "Add functools.copy_class() which updates closures". ---------- nosy: +vstinner title: 3.11a4: a small attrs regression -> RFE: @dataclasses.dataclass(slots=True) doesn't support methods using closures type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:54:58 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 13:54:58 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648475698.74.0.965993836664.issue45618@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -30186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:55:11 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 13:55:11 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648475711.22.0.226102114187.issue45618@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -30194 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:55:34 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 13:55:34 +0000 Subject: [issue45618] Documentation builds fail with Sphinx 3.2.1 In-Reply-To: <1635287699.66.0.0951441516371.issue45618@roundup.psfhosted.org> Message-ID: <1648475734.98.0.986777021136.issue45618@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 09:59:50 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 28 Mar 2022 13:59:50 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648475990.35.0.190973076877.issue47143@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 10:01:03 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 28 Mar 2022 14:01:03 +0000 Subject: [issue47124] explore hashlib use of the Apple CryptoKit macOS In-Reply-To: <1648255710.38.0.570771334735.issue47124@roundup.psfhosted.org> Message-ID: <1648476063.24.0.245958870437.issue47124@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 10:14:33 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Mar 2022 14:14:33 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1648469789.37.0.388882964423.issue45953@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Please don?t try to ?fix? anything. The value is only useful if you understand the implementation. It should map straightforwardly to what?s in memory. On Mon, Mar 28, 2022 at 05:16 STINNER Victor wrote: > > STINNER Victor added the comment: > > > Should sys.getrefcount try to "fix" the value (...) > > https://peps.python.org/pep-0683/ would make it possible. Right now, I > don't think that it's possible. > > Right now, a refcount of 1000000210 can be a real value, or it can be an > immortal object. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 10:24:10 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 28 Mar 2022 14:24:10 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648477450.29.0.358152642059.issue47138@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +30235 pull_request: https://github.com/python/cpython/pull/32154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 10:23:53 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 28 Mar 2022 14:23:53 +0000 Subject: [issue47138] Bump Sphinx or pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648477433.12.0.114171067755.issue47138@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +30234 pull_request: https://github.com/python/cpython/pull/32153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 10:28:12 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 28 Mar 2022 14:28:12 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648477692.6.0.0097169516489.issue47138@roundup.psfhosted.org> Hugo van Kemenade added the comment: I cherry picked Maciej's 3.8 commit into 3.9 and 3.10 PRs: 3.9: https://github.com/python/cpython/pull/32153 3.10: https://github.com/python/cpython/pull/32154 And marking this issue as not relevant to 3.11; instead I bumped the Sphinx version in bpo-47126 / gh-32124 as it's directly relevant there. Thanks! ---------- title: Bump Sphinx or pin Jinja2 to fix docs build -> Pin Jinja2 to fix docs build versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 10:32:05 2022 From: report at bugs.python.org (Douglas Raillard) Date: Mon, 28 Mar 2022 14:32:05 +0000 Subject: [issue47144] Allow setting __classcell__ Message-ID: <1648477925.18.0.27195455918.issue47144@roundup.psfhosted.org> New submission from Douglas Raillard : The cell object __classcell__ currently cannot be set by code invoked by metaclass.__new__. Attempts to do so will be caught by builtin___build_class__ in bltimodule.c: } else { const char *msg = "__class__ set to %.200R defining %.200R as %.200R"; PyErr_Format(PyExc_TypeError, msg, cell_cls, name, cls); } This is unfortunate as there is a use-case for such trickery: if the method of a class A are only used to be grafted onto another class B (monkey patching), A.__classcell__ should be set to B so that super() works as expected. This can be useful in contexts where e.g. A.__new__ returns instances of B. B is not necessarily something under direct user control (it can be dynamically created by inheriting from a "template"), so A would be a better place for users to define custom method. ---------- components: Interpreter Core messages: 416172 nosy: douglas-raillard-arm priority: normal severity: normal status: open title: Allow setting __classcell__ versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:15:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 15:15:12 +0000 Subject: [issue47144] Allow setting __classcell__ In-Reply-To: <1648477925.18.0.27195455918.issue47144@roundup.psfhosted.org> Message-ID: <1648480512.71.0.101196525096.issue47144@roundup.psfhosted.org> STINNER Victor added the comment: > This is unfortunate as there is a use-case for such trickery: if the method of a class A are only used to be grafted onto another class B (monkey patching), A.__classcell__ should be set to B so that super() works as expected. Would you elaborate your use case? Would bpo-47143 "Add functools.copy_class() which updates closures" solve your use case? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:16:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 15:16:37 +0000 Subject: [issue46404] RFE: @dataclasses.dataclass(slots=True) doesn't support methods using closures In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1648480597.4.0.559119910385.issue46404@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-45520: "Frozen dataclass deep copy doesn't work with __slots__" which is related but a different issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:24:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 15:24:37 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648481077.99.0.0453030378048.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: It seems like the copy module doesn't support copying a class. copy.deepcopy(cls) doesn't copy a class but returns its argument, the class unchanged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:41:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 15:41:35 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648482095.68.0.170324316203.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: The pickle module doesn't copy a type but gets it from its module. The Python implementation is pickle._Pickler.save_type() which calls pickle._Pickler.save_global(). The cloudpickle module doesn't copy types neither: same behavior than pickle. Example: --- import pickle import pickletools class A: pass data = pickle.dumps(A) pickletools.dis(data) --- Output: --- 0: \x80 PROTO 4 2: \x95 FRAME 18 11: \x8c SHORT_BINUNICODE '__main__' 21: \x94 MEMOIZE (as 0) 22: \x8c SHORT_BINUNICODE 'A' 25: \x94 MEMOIZE (as 1) 26: \x93 STACK_GLOBAL 27: \x94 MEMOIZE (as 2) 28: . STOP highest protocol among opcodes = 4 --- In short, it's implemented as: getattr(__import__('__main__'), 'A') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:56:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 15:56:30 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648482990.53.0.187572555724.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: pickle.dump(x) checks if x is a type since commit f048a8f6d79173cc1da1bf12c60ae06fea36762c (March 2002) of bpo-494904: Pickler.save(): Fix for SF bug #494904: Cannot pickle a class with a metaclass, reported by Dan Parisien. + if issubclass(t, TypeType): + self.save_global(object) + return Followed by a minor fix: commit 85ee491b3af3e1c124522249a52443b4d8c34c88 of bpo-502085: Don't die when issubclass(t, TypeType) fails. - if issubclass(t, TypeType): + try: + issc = issubclass(t, TypeType) + except TypeError: # t is not a class + issc = 0 copy.deepcopy(x) returns x if it's a type since commit 11ade1ddc053dcec884e2431b55fb1c1727c65d7 (June 2002) of bpo-560794. SF patch 560794 (Greg Chapman): deepcopy can't handle custom metaclasses. try: - copier = x.__deepcopy__ - except AttributeError: + issc = issubclass(type(x), type) + except TypeError: + issc = 0 + if issc: + y = _deepcopy_dispatch[type](x, memo) + else: (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 11:58:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 15:58:01 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648483081.75.0.306374055549.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: More recent copy.copy() change: commit 5c1c3b4f197c57952760be37d77d73669284a607 of bpo-11480: Issue #11480: Fixed copy.copy to work with classes with custom metaclasses. + try: + issc = issubclass(cls, type) + except TypeError: # cls is not a class + issc = False + if issc: + # treat it as a regular class: + return _copy_immutable(x) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:02:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:02:15 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648483335.97.0.684738047597.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: If I understand correctly, a cell content can be modified since Python 3.7: since commit 64505a1f6c0af4574e17e823b27ffe24eca44df5 of bpo-30486: bpo-30486: Allow setting cell value (#1840) Antoine Pitrou created bpo-30486 for cloudpickle: "There are use cases for setting a cell value. One such use case is for (un)pickling recursive closures (see heroic workaround here: https://github.com/cloudpipe/cloudpickle/pull/90/files#diff-d2a3618afedd4e124c532151eedbae09R74 ). Other use cases may include tinkering around and general education value." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:07:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:07:40 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648483660.52.0.7624605628.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: In the Python C API, PEP 384 added PyType_FromSpec(). There is also PyStructSequence_NewType(). PEP 3121 proposed PyType_Copy() but it was never implemented: see bpo-3760. But in C, closures are implemented using a module state, or previously using a global or static variable: cell objects are not used for types implemented in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:13:36 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 16:13:36 +0000 Subject: [issue47125] Explore hashlib use of the Windows Crypto API NG In-Reply-To: <1648255993.62.0.516641602637.issue47125@roundup.psfhosted.org> Message-ID: <1648484016.21.0.232608588305.issue47125@roundup.psfhosted.org> Steve Dower added the comment: Did a basic test (with timeit and a work-internal library I already have) and the native functionality is *slightly* faster than OpenSSL. But I think it's worthwhile anyway, to help reduce our dependency on OpenSSL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:20:34 2022 From: report at bugs.python.org (Larry Hastings) Date: Mon, 28 Mar 2022 16:20:34 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step Message-ID: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> New submission from Larry Hastings : I've maintained my own topological sort class for a while now. The API I came up with (or was it Tim and I?) was adopted for graphlib.TopologicalSort(). Some of my method names are slightly different, but the APIs are so similar, I can do a little renaming and run Lib/test/test_graphlib using my implementation. (For clarity I'm going to write the rest of this issue using the names from graphlib.) Recently I made an improvement to my version: it no longer has the modal behavior where there's a "before prepare" phase where you add nodes and an "after prepare" phase where you can call get_ready and done. Instead, in my new and improved version the graph is always maintained in a "ready" state. You can call add, get_ready, and done in any order, as much as you like. prepare doesn't do anything besides the cycle check--but read on! This approach required tweaking some semantics behind the scenes. My graph object now maintains an internal "dirty" flag. It's set to True after any edges are added, and only gets cleared after checking for cycles. prepare runs this cycle check, but get_ready *also* runs this cycle check. (Though in both cases, only when the dirty flag is set, of course.) In theory this means you no longer need the prepare call. However, it's still useful, because you can call it to check for a CycleError. So, on the one hand, this means that get_ready can throw a CycleError, which it never did before. On the other hand, it won't throw for existing users of the library, because they never add edges after their prepare call. So this semantic change shouldn't break existing users, assuming they're not misusing the existing API. Another wrinkle: adding a dependency on a node that's already been handed out by get_ready (but hasn't been returned by done) is ignored. Again, not something existing users of graphlib can do, so this shouldn't break code. There's one final semantic change I made worth knowing about: when you return a node via done, the graph simply forgets about it. This means you could add it a second time (!) and it could go for a complete ride through the graph again, wheeee! This also means that when all nodes have been returned by done, the graph is essentially returned to its initial pristine state. This too seems completely harmless, because with the existing library it's illegal to add nodes to a graph after calling prepare, so nobody's doing it, so it won't break any code. I'm happy to contribute my version. But I was lazy and didn't worry about speed or memory implementation; it's strewn with sets and things. I figured I could always optimize it later. But "later" could become "now" if we were interested in trying to merge this behavior into Python's graphlib. Interested? ---------- assignee: larry components: Library (Lib) messages: 416182 nosy: eric.smith, larry, pablogsal, tim.peters priority: normal severity: normal stage: needs patch status: open title: Improve graphlib.TopologicalSort by removing the prepare step type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:23:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:23:29 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648484609.42.0.455889590352.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: The same problem exists at the function level: see bpo-39805: "Copying functions doesn't actually copy them". For example, copy.deepcopy(func) returns func unchanged if it's a function. Example: --- import copy def make_closure(): closure = [] def append(value): closure.append(value) return append, closure func, closure = make_closure() func(1) func2 = copy.deepcopy(func) func2(2) print(func2 is func) print(closure) --- Output: --- True [1, 2] --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:25:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:25:04 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648484704.31.0.657714656011.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: > * old fixed attrs issue: https://github.com/python-attrs/attrs/issues/102 > * attrs issue with Python 3.11: https://github.com/python-attrs/attrs/issues/907 > * dataclasses issues with slots=True: https://bugs.python.org/issue46404 Similar bug without attrs nor dataclasses: bpo-29944 "Argumentless super() fails in classes constructed with type()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:25:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:25:17 +0000 Subject: [issue29944] Argumentless super() fails in classes constructed with type() In-Reply-To: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za> Message-ID: <1648484717.78.0.0591322168487.issue29944@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-47143 "Add functools.copy_class() which updates closures". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:25:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:25:53 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648484753.68.0.632775340965.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: See also the types.new_class() function: https://docs.python.org/dev/library/types.html#types.new_class Oh, I didn't know this function! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:27:02 2022 From: report at bugs.python.org (Douglas Raillard) Date: Mon, 28 Mar 2022 16:27:02 +0000 Subject: [issue47144] Allow setting __classcell__ In-Reply-To: <1648477925.18.0.27195455918.issue47144@roundup.psfhosted.org> Message-ID: <1648484822.3.0.726206098316.issue47144@roundup.psfhosted.org> Douglas Raillard added the comment: > Would bpo-47143 "Add functools.copy_class() which updates closures" solve your use case? This looks like a similar issue indeed. If I'm able to copy a class "cleanly" (as defined in this other thread), that may solve the problem (hard to tell precisely until trying it though, the devil is in the details). > Would you elaborate your use case? As you probably expect, it's a relatively tricky metaprogramming bit of code. It's implementing something akin to higher kinded types, similar in spirit to the following example where you can have e.g. containers that "know" the item type they contain: class ContainerBase: ITEM = None @classmethod def apply(cls, typ): ... @classmethod def empty_list(cls): ... class List(ContainerBase): pass class ListOfInt(List.apply(int)): pass The goal is to allow "ListOfInt" to define custom methods if we want in its body. "ListOfInt" cannot return instances of itself [1] so I'm trying to "cherry pick" its method and graft them onto the type that is actually instantiated. [1] We e.g. want to create an empty list of the right type. "List" already provides the method for such factory, but it will not return an actual instance of ListOfInt, since it does not even know this class exists. What it will use is an internal type that it created using the "ITEM" class attribute in e.g. List.__init_subclass__, and that is what will get instantiated. This "internal class" could still be customized by ListOfInt to have some custom methods though, which is what I'm trying to achieve. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:28:10 2022 From: report at bugs.python.org (Douglas Raillard) Date: Mon, 28 Mar 2022 16:28:10 +0000 Subject: [issue47144] Allow setting __classcell__ In-Reply-To: <1648477925.18.0.27195455918.issue47144@roundup.psfhosted.org> Message-ID: <1648484890.38.0.819310254556.issue47144@roundup.psfhosted.org> Douglas Raillard added the comment: EDIT: empty_list() is a class method of List, not ContainerBase ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:29:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:29:09 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648484949.85.0.17794036416.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: > If I understand correctly, a cell content can be modified since Python 3.7: since commit 64505a1f6c0af4574e17e823b27ffe24eca44df5 of bpo-30486 Moreover, it's possible to create a cell object since Python 3.8, commit df8d2cde63c865446468351f8f648e1c7bd45109 of bpo-35911. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:34:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:34:19 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648485259.35.0.376947979035.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: bpo-32176 "Zero argument super is broken in 3.6 for methods with a hacked __class__ cell" added test_code.test_closure_injection() and fixed the CO_NOFREE flag in the code object constructor (types.CodeType). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:35:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:35:30 +0000 Subject: [issue14369] make function __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1648485330.9.0.0992117780886.issue14369@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: make __closure__ writable -> make function __closure__ writable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:35:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 16:35:36 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648485336.48.0.904555222116.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: > The same problem exists at the function level: see bpo-39805: "Copying functions doesn't actually copy them". See also bpo-14369 "make function __closure__ writable". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:49:49 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Mar 2022 16:49:49 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648486189.22.0.926637227224.issue26120@roundup.psfhosted.org> Serhiy Storchaka added the comment: Module objects are not shown in the help unless they are submodules of the specified module, even if they are imported with the star import. With this precedence I think it is okay to exclude the __future__ annotations as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 12:50:08 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 28 Mar 2022 16:50:08 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently Message-ID: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> New submission from Eric Snow : The "Check if generated files are up to date" GitHub check for PRs has been failing recently. It may also impact local usage of "make regen-all". Example: https://github.com/python/cpython/runs/5719012664 This may be related to gh-32061. ---------- assignee: eric.snow components: Build messages: 416193 nosy: Mark.Shannon, brandtbucher, eric.snow priority: normal severity: normal stage: needs patch status: open title: PR check "Check if generated files are up to date" failing intermittently versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:05:10 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 17:05:10 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648487110.26.0.404593349812.issue47138@roundup.psfhosted.org> Ned Deily added the comment: New changeset 25f00bfb264a3197ac91c41cdec15036fd8401f1 by m-aciek in branch '3.7': bpo-47138: Fix documentation build by pinning Jinja version to 3.0.3 (GH-32111) https://github.com/python/cpython/commit/25f00bfb264a3197ac91c41cdec15036fd8401f1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:06:25 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 17:06:25 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648487185.08.0.301901536185.issue47138@roundup.psfhosted.org> Ned Deily added the comment: New changeset 9194a7b8990a0feec1209b1e5694df3bf42906d8 by Hugo van Kemenade in branch '3.10': bpo-47138: Fix documentation build by pinning Jinja version to 3.0.3 (GH-32154) https://github.com/python/cpython/commit/9194a7b8990a0feec1209b1e5694df3bf42906d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:19:59 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 17:19:59 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648487999.97.0.112033173973.issue47138@roundup.psfhosted.org> Ned Deily added the comment: New changeset 25c40bd994aa0da75283c5efdd71ba26c734b67e by Hugo van Kemenade in branch '3.9': bpo-47138: Fix documentation build by pinning Jinja version to 3.0.3 (GH-32153) https://github.com/python/cpython/commit/25c40bd994aa0da75283c5efdd71ba26c734b67e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:25:55 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Mar 2022 17:25:55 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648488355.04.0.753732889635.issue47138@roundup.psfhosted.org> Ned Deily added the comment: Thanks, everyone! Merged for 3.10.5, 3.9.13, and 3.7.14. I'll leave the issue in pending state until merged for 3.8.14. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:48:12 2022 From: report at bugs.python.org (Patrick Reader) Date: Mon, 28 Mar 2022 17:48:12 +0000 Subject: [issue47147] Allow `return yield from` Message-ID: <1648489692.27.0.109128044871.issue47147@roundup.psfhosted.org> New submission from Patrick Reader : I would like to be able to use a `yield from` expression in a `return` statement without parentheses, as a small quality of life tweak, i.e.: return yield from gen instead of return (yield from gen) I think this makes sense, since `yield from` can be used on the right-hand-side of an assignment, which accepts any expression, and so should `return`. Here is a medium-sized real-world example of where I'm using this, where it would be nice to allow `return yield from`: https://gist.github.com/pxeger/48f97484364bf0b43dee974a8f0f4265 ---------- components: Parser messages: 416198 nosy: lys.nikolaou, pablogsal, pxeger priority: normal severity: normal status: open title: Allow `return yield from` type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:51:02 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 28 Mar 2022 17:51:02 +0000 Subject: [issue47147] Allow `return yield from` In-Reply-To: <1648489692.27.0.109128044871.issue47147@roundup.psfhosted.org> Message-ID: <1648489862.16.0.971441856773.issue47147@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Please, submit an email to python-ideas or python-dev first as this need to be discussed in the mailing lists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 13:54:17 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Mar 2022 17:54:17 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1648490057.19.0.783213616716.issue45100@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 14:26:59 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 18:26:59 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648492019.59.0.968511466518.issue44493@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30236 pull_request: https://github.com/python/cpython/pull/32156 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 14:26:58 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 18:26:58 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648492018.22.0.896388124514.issue44493@roundup.psfhosted.org> miss-islington added the comment: New changeset 5944807b09717d43bb017f700e8c451dd07199ed by Miss Islington (bot) in branch '3.10': [3.10] bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) (GH-32140) https://github.com/python/cpython/commit/5944807b09717d43bb017f700e8c451dd07199ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 14:32:44 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 28 Mar 2022 18:32:44 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648492364.72.0.0239960182248.issue47146@roundup.psfhosted.org> Eric Snow added the comment: There's probably something racy with make. See: https://github.com/python/cpython/runs/5712538599?check_suite_focus=true#step:10:1147 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 14:45:51 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 28 Mar 2022 18:45:51 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648493151.26.0.124884701102.issue28516@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 1e3132b1c3ebff8d28a6dd353bf217cb97c41e81 by Miss Islington (bot) in branch '3.9': bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32145) https://github.com/python/cpython/commit/1e3132b1c3ebff8d28a6dd353bf217cb97c41e81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:10:36 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Mon, 28 Mar 2022 19:10:36 +0000 Subject: [issue43224] Add support for PEP 646 In-Reply-To: <1646712216.72.0.358165955226.issue43224@roundup.psfhosted.org> Message-ID: <1648494636.69.0.376429347079.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +30237 pull_request: https://github.com/python/cpython/pull/32159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:21:18 2022 From: report at bugs.python.org (Sam Ezeh) Date: Mon, 28 Mar 2022 19:21:18 +0000 Subject: [issue4833] Explicit directories for zipfiles In-Reply-To: <1231088968.72.0.101458538333.issue4833@psf.upfronthosting.co.za> Message-ID: <1648495278.42.0.315800157053.issue4833@roundup.psfhosted.org> Change by Sam Ezeh : ---------- keywords: +patch pull_requests: +30238 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:24:22 2022 From: report at bugs.python.org (Sam Ezeh) Date: Mon, 28 Mar 2022 19:24:22 +0000 Subject: [issue4833] Explicit directories for zipfiles In-Reply-To: <1231088968.72.0.101458538333.issue4833@psf.upfronthosting.co.za> Message-ID: <1648495462.1.0.882694783714.issue4833@roundup.psfhosted.org> Sam Ezeh added the comment: I've submitted the above patch. I created the ZipFile.mkdir function, created the necessary tests and wrote the documentation. I think it is ready for review. ---------- Added file: https://bugs.python.org/file50705/sam_ezeh.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:43:44 2022 From: report at bugs.python.org (Martin Dengler) Date: Mon, 28 Mar 2022 19:43:44 +0000 Subject: [issue43818] Email does not apply policy to multipart messages with defects In-Reply-To: <1618258648.79.0.562101023353.issue43818@roundup.psfhosted.org> Message-ID: <1648496624.15.0.729127903962.issue43818@roundup.psfhosted.org> Martin Dengler added the comment: Possible related to https://github.com/python/cpython/pull/32137 and https://bugs.python.org/issue43323 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:45:44 2022 From: report at bugs.python.org (Patrick Reader) Date: Mon, 28 Mar 2022 19:45:44 +0000 Subject: [issue47147] Allow `return yield from` In-Reply-To: <1648489692.27.0.109128044871.issue47147@roundup.psfhosted.org> Message-ID: <1648496744.65.0.403024302994.issue47147@roundup.psfhosted.org> Patrick Reader added the comment: Ok, will do, but what is the bar for a feature to need to go to the mailing lists first? I thought as this was a relatively minor one it wouldn't need to. Is it just because it's an actual syntax change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:59:23 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 28 Mar 2022 19:59:23 +0000 Subject: [issue47147] Allow `return yield from` In-Reply-To: <1648489692.27.0.109128044871.issue47147@roundup.psfhosted.org> Message-ID: <1648497563.98.0.333790747306.issue47147@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In general, anything changing the python syntax needs to be discussed in the mailing lists and it may likely need a PEP as well, even if is minor. This is because this has consequences rippling the whole ecosystem, from IDEs to other parsers and this need to be discussed, and communicated in a better forum than this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 15:59:48 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 28 Mar 2022 19:59:48 +0000 Subject: [issue4833] Explicit directories for zipfiles In-Reply-To: <1231088968.72.0.101458538333.issue4833@psf.upfronthosting.co.za> Message-ID: <1648497588.39.0.41041045296.issue4833@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:03:36 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 28 Mar 2022 20:03:36 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648497816.44.0.592597301132.issue44493@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset dae09c2b819c2683ad870733451c050b59c3eb93 by Miss Islington (bot) in branch '3.9': [3.9] bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) (GH-32140) (GH-32156) https://github.com/python/cpython/commit/dae09c2b819c2683ad870733451c050b59c3eb93 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:21:06 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 20:21:06 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648498866.0.0.0481956254609.issue47138@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: +steve.dower nosy_count: 4.0 -> 5.0 pull_requests: +30239 status: pending -> open pull_request: https://github.com/python/cpython/pull/32161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:24:27 2022 From: report at bugs.python.org (Julien Palard) Date: Mon, 28 Mar 2022 20:24:27 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1648499067.99.0.603884388946.issue45953@roundup.psfhosted.org> Julien Palard added the comment: Hum, and why 999999999? I am probably missing something obvious but 1 should be enough to ensure the value never hits 0. Except for refcount bugs obviously, but I don't think this is the right reason? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:27:07 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 28 Mar 2022 20:27:07 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648499227.35.0.275253321195.issue47146@roundup.psfhosted.org> Change by Eric Snow : ---------- keywords: +patch pull_requests: +30240 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32162 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:38:48 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 20:38:48 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648499928.09.0.051660706109.issue47138@roundup.psfhosted.org> Steve Dower added the comment: New changeset 295114dcd32b3aad5453e5e15e9e1befa0e5ca01 by Steve Dower in branch 'main': bpo-47138: Ensure Windows docs build uses the same pinned version as other platforms (GH-32161) https://github.com/python/cpython/commit/295114dcd32b3aad5453e5e15e9e1befa0e5ca01 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:56:13 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Mar 2022 20:56:13 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1648500973.45.0.378483889044.issue45953@roundup.psfhosted.org> Guido van Rossum added the comment: I used 999999999 in deepfreeze.py to signify "immortal object". It has been copied by others (small integers are essentially immortal too). I wasn't too sure that the refcount wouldn't go below zero if the interpreter is repeatedly finalized and reinitialized. Once we have official immortal objects (see PEP 683) we should switch to that. Since you seem to be challenging the value of 999999999, my question to you is, why do you care what the refcount of 1 is? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:56:15 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 28 Mar 2022 20:56:15 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648500975.4.0.535398355062.issue47146@roundup.psfhosted.org> Eric Snow added the comment: New changeset 4c116f716bd1c174d6530b9a7a5ed3863927a109 by Eric Snow in branch 'main': bpo-47146: Eliminate a race between make regen-deepfreeze and make regen-global-objects. (gh-32162) https://github.com/python/cpython/commit/4c116f716bd1c174d6530b9a7a5ed3863927a109 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 16:58:52 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 20:58:52 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648501132.36.0.271513581927.issue47138@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30241 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/32163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:03:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Mar 2022 21:03:12 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648501392.25.0.961357634713.issue26120@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 15ba8167d78f9e66bd5b07c4e5cbb0463460310a by Irit Katriel in branch 'main': bpo-26120: make pydoc exclude __future__ imports from the data block of the module (GH-30888) https://github.com/python/cpython/commit/15ba8167d78f9e66bd5b07c4e5cbb0463460310a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:04:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Mar 2022 21:04:12 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648501452.58.0.0997962658202.issue26120@roundup.psfhosted.org> Irit Katriel added the comment: Thank you, Serhiy! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:05:59 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 28 Mar 2022 21:05:59 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648501559.94.0.298593094656.issue47146@roundup.psfhosted.org> Eric Snow added the comment: Looks like that fixed it, per https://github.com/python/cpython/pull/32134. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:08:15 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Mar 2022 21:08:15 +0000 Subject: [issue47137] MemoryError in codeop.compile_command In-Reply-To: <1648383028.98.0.518734676925.issue47137@roundup.psfhosted.org> Message-ID: <1648501695.33.0.614648816736.issue47137@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +pablogsal title: MemoryError -> MemoryError in codeop.compile_command versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:08:44 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Mar 2022 21:08:44 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648501724.31.0.797444547034.issue47129@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 7b44ade018cfe6f54002a3cee43e8aa415d4d635 by Maciej G?rski in branch 'main': bpo-47129: Add more informative messages to f-string syntax errors (32127) https://github.com/python/cpython/commit/7b44ade018cfe6f54002a3cee43e8aa415d4d635 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:09:44 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Mar 2022 21:09:44 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648501784.79.0.682698594145.issue47129@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, @macgors! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:12:40 2022 From: report at bugs.python.org (=?utf-8?q?Maciej_G=C3=B3rski?=) Date: Mon, 28 Mar 2022 21:12:40 +0000 Subject: [issue47129] Improve errors messages in f-string syntax errors In-Reply-To: <1648307307.69.0.710442348209.issue47129@roundup.psfhosted.org> Message-ID: <1648501960.38.0.593859800829.issue47129@roundup.psfhosted.org> Maciej G?rski added the comment: Thanks for helping me with my very first python contribution! @eric.smith @lys.nikolaou ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:50:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 28 Mar 2022 21:50:33 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648504233.96.0.414524065023.issue27929@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 5c30388f3c586ba2f33e349e22e5949cb92de621 by Vincent Bernat in branch 'main': bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio (GH-32131) https://github.com/python/cpython/commit/5c30388f3c586ba2f33e349e22e5949cb92de621 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:50:36 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 21:50:36 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648504236.06.0.350362289329.issue27929@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +30242 pull_request: https://github.com/python/cpython/pull/32164 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 17:50:40 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 21:50:40 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648504240.45.0.0753194326443.issue27929@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30243 pull_request: https://github.com/python/cpython/pull/32165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:12:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 22:12:40 +0000 Subject: [issue29270] ctypes: fail to create a _ctypes._SimpleCData subclass using a closure like calling super() without arguments In-Reply-To: <1484345422.14.0.967631121608.issue29270@psf.upfronthosting.co.za> Message-ID: <1648505560.51.0.929001326746.issue29270@roundup.psfhosted.org> STINNER Victor added the comment: CreateSwappedType() is an helper function used by the _ctypes.PyCSimpleType type. Python script reproducing this ctypes bug: --- class PyCSimpleType(type): def __new__(cls, name, bases, dct): print(f"PyCSimpleType: create {name} class") cell = dct.get('__classcell__', None) # type.__new__() sets __classcell__ x = super().__new__(cls, name, bases, dct) if cell is not None: print(f"PyCSimpleType: after first type.__new__() call: __classcell__={cell.cell_contents}") name2 = name + "_Swapped" dct2 = dict(dct, __qualname__=name2) # Calling type.__new__() again with the same cell object overrides # __classcell__ x.__ctype_be__ = super().__new__(cls, name2, bases, dct2) if cell is not None: print(f"PyCSimpleType: after second type.__new__() call: __classcell__={cell.cell_contents}") return x class BaseItem: pass class Item(BaseItem, metaclass=PyCSimpleType): def get_class(self): # get '__class__' to create a closure return __class__ # Alternative to create a closure: #def __repr__(self): # return super().__repr__() --- Output: --- PyCSimpleType: create Item class PyCSimpleType: after first type.__new__() call: __classcell__= PyCSimpleType: after second type.__new__() call: __classcell__= Traceback (most recent call last): File "meta.py", line 23, in class Item(BaseItem, metaclass=PyCSimpleType): TypeError: __class__ set to defining 'Item' as --- It's not a bug in Python types, but a bug specific to the _ctypes.PyCSimpleType type which prevents creating subclasses which use closures ("__class__", "super()", etc.). ---------- nosy: +vstinner title: super call in ctypes subclass fails -> ctypes: fail to create a _ctypes._SimpleCData subclass using a closure like calling super() without arguments versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:15:14 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 22:15:14 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648505714.45.0.717398869571.issue27929@roundup.psfhosted.org> miss-islington added the comment: New changeset 2bcbc3113dee6c35631595ec0d5ee3a8dd2a2ddd by Miss Islington (bot) in branch '3.10': bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio (GH-32131) https://github.com/python/cpython/commit/2bcbc3113dee6c35631595ec0d5ee3a8dd2a2ddd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:15:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 22:15:23 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648505723.43.0.100141121051.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: Note: Implementing a metaclass in Python is hard, it's easy to mess up with closures: see bpo-29270 "ctypes: fail to create a _ctypes._SimpleCData subclass using a closure like calling super() without arguments". type.__new__() is called twice on the same type dict, and the second call overrides the __classcell__ cell value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:16:34 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 22:16:34 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648505794.14.0.442822588247.issue27929@roundup.psfhosted.org> miss-islington added the comment: New changeset f84fb55659079bbc99d4cd0441dc13ab07ac3dcf by Miss Islington (bot) in branch '3.9': bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio (GH-32131) https://github.com/python/cpython/commit/f84fb55659079bbc99d4cd0441dc13ab07ac3dcf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:19:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 22:19:55 +0000 Subject: [issue39805] Copying functions doesn't actually copy them In-Reply-To: <1583034162.79.0.0576327457429.issue39805@roundup.psfhosted.org> Message-ID: <1648505995.27.0.161458861508.issue39805@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-47143 "Add functools.copy_class() which updates closures". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:29:24 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 28 Mar 2022 22:29:24 +0000 Subject: [issue47137] MemoryError in codeop.compile_command In-Reply-To: <1648383028.98.0.518734676925.issue47137@roundup.psfhosted.org> Message-ID: <1648506564.99.0.501914752883.issue47137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I suspect backporting the fix to older versions won't be possible. Yeah, very much the case unfortunately ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:29:32 2022 From: report at bugs.python.org (John Paul Adrian Glaubitz) Date: Mon, 28 Mar 2022 22:29:32 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1648506572.02.0.0432829015975.issue43323@roundup.psfhosted.org> John Paul Adrian Glaubitz added the comment: > Awesome, thanks! I'll give it a try later today or tomorrow. I have applied the patch and the problem seems to have been fixed. \o/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:32:41 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Mar 2022 22:32:41 +0000 Subject: [issue47137] MemoryError in codeop.compile_command In-Reply-To: <1648383028.98.0.518734676925.issue47137@roundup.psfhosted.org> Message-ID: <1648506761.93.0.0317527628842.issue47137@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:35:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 28 Mar 2022 22:35:22 +0000 Subject: [issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH In-Reply-To: <1472738395.77.0.643111482192.issue27929@psf.upfronthosting.co.za> Message-ID: <1648506922.24.0.0084842890238.issue27929@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 18:36:21 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Mar 2022 22:36:21 +0000 Subject: [issue45100] Improve help() by making typing.overload() information accessible at runtime In-Reply-To: <1630778608.65.0.813637953031.issue45100@roundup.psfhosted.org> Message-ID: <1648506981.47.0.773161372663.issue45100@roundup.psfhosted.org> Guido van Rossum added the comment: Looks like there may be a new plan where we solve a smaller problem (overloads) in the context of typing only. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:00:20 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 28 Mar 2022 23:00:20 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not In-Reply-To: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> Message-ID: <1648508420.67.0.356962558561.issue45099@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30244 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:01:13 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 28 Mar 2022 23:01:13 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not In-Reply-To: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> Message-ID: <1648508473.28.0.423033287233.issue45099@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:09:47 2022 From: report at bugs.python.org (Cebtenzzre) Date: Mon, 28 Mar 2022 23:09:47 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1648508987.33.0.694492238031.issue41571@roundup.psfhosted.org> Change by Cebtenzzre : ---------- nosy: +cebtenzzre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:17:50 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 28 Mar 2022 23:17:50 +0000 Subject: [issue47143] Add functools.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648509470.45.0.299968798845.issue47143@roundup.psfhosted.org> Jelle Zijlstra added the comment: I believe the attrs code wouldn't work if a method is decorated with a decorator that wraps the original function, such as @functools.cache. ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:21:25 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 23:21:25 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1648509685.83.0.41120319221.issue46566@roundup.psfhosted.org> Steve Dower added the comment: New changeset bad86a621af61f383b9f06fe4a08f66245df99e2 by Steve Dower in branch 'main': bpo-46566: Add new py.exe launcher implementation (GH-32062) https://github.com/python/cpython/commit/bad86a621af61f383b9f06fe4a08f66245df99e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:22:12 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 23:22:12 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1648509732.81.0.37162886638.issue46566@roundup.psfhosted.org> Steve Dower added the comment: It's in! Any new issues probably won't be found until the next release, so I'll close this and we can open new bugs. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:24:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 23:24:47 +0000 Subject: [issue47143] Add types.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648509887.27.0.943219276262.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: The stdlib types module looks like a better place for such new function, rather than the functools module. The types module documentation starts with: "This module defines utility functions to assist in dynamic creation of new types." https://docs.python.org/3/library/types.html ---------- title: Add functools.copy_class() which updates closures -> Add types.copy_class() which updates closures _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:32:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Mar 2022 23:32:38 +0000 Subject: [issue47143] Add types.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648510358.75.0.470938350738.issue47143@roundup.psfhosted.org> STINNER Victor added the comment: Jelle Zijlstra: > I believe the attrs code wouldn't work if a method is decorated with a decorator that wraps the original function, such as @functools.cache. What do you mean by "wouldn't work"? Do you mean that the semantics of "copy_class()" should be better defined? Currently, copy.deepcopy(MyClass) doesn't copy the class at all, it returns the class unmodified :-) @functools.cache is designed for unbound methods. Example: --- import attr import functools @attr.s(slots=True) class A: @staticmethod @functools.cache def incr(x): return x + 1 @staticmethod @functools.lru_cache def incr_lru(x): return x + 1 obj = A() print(obj.incr(1)) print(obj.incr_lru(2)) --- Output (current Python main branch, attrs 21.4.0): --- 2 3 --- @attr.s(slots=True) copies a class but then drops the original class. It doesn't create two classes which share methods, functools caches, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:41:10 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 28 Mar 2022 23:41:10 +0000 Subject: [issue47143] Add types.copy_class() which updates closures In-Reply-To: <1648475497.69.0.517848943478.issue47143@roundup.psfhosted.org> Message-ID: <1648510870.03.0.271836348996.issue47143@roundup.psfhosted.org> Jelle Zijlstra added the comment: I mean that the code sample above from attrs doesn't properly update the closure for wrapped methods, such as those created by @functools.cache, or any other arbitrary decorator that creates a wrapper function. Example (with Python 3.9.4 and attrs 21.4.0): % cat attrslots.py import attr import functools class Base: @classmethod def f(cls): return 3 @attr.s(slots=True) class Child(Base): x: int @classmethod @functools.cache def f(cls): return super().f() + 1 print(Child.f()) % python attrslots.py Traceback (most recent call last): File "/Users/jelle/py/pyanalyze/samples/attrslots.py", line 21, in print(Child.f()) File "/Users/jelle/py/pyanalyze/samples/attrslots.py", line 18, in f return super().f() + 1 TypeError: super(type, obj): obj must be an instance or subtype of type If we provide a `types.copy_class()`, it should handle this case correctly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:46:25 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 28 Mar 2022 23:46:25 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648511185.69.0.587373918109.issue47138@roundup.psfhosted.org> Steve Dower added the comment: New changeset 0dfabf9b4a58b835b61fc3d17784d4746f677e56 by Steve Dower in branch '3.10': bpo-47138: Ensure Windows docs build uses the same pinned version as other platforms (GH-32161) https://github.com/python/cpython/commit/0dfabf9b4a58b835b61fc3d17784d4746f677e56 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:46:46 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 23:46:46 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648511206.95.0.897707763434.issue47138@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +30245 pull_request: https://github.com/python/cpython/pull/32167 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:46:51 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 23:46:51 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648511211.93.0.958618321672.issue47138@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30246 pull_request: https://github.com/python/cpython/pull/32168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:46:56 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 28 Mar 2022 23:46:56 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648511216.21.0.890083536246.issue47138@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30247 pull_request: https://github.com/python/cpython/pull/32169 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:52:51 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 28 Mar 2022 23:52:51 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1648511571.53.0.116948873787.issue44493@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 19:54:36 2022 From: report at bugs.python.org (Peter Lovett) Date: Mon, 28 Mar 2022 23:54:36 +0000 Subject: [issue31140] Insufficient error message with incorrect formated string literal In-Reply-To: <1502182558.08.0.700048111188.issue31140@psf.upfronthosting.co.za> Message-ID: <1648511676.15.0.503317753129.issue31140@roundup.psfhosted.org> Change by Peter Lovett : ---------- nosy: +PeterL777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 20:06:37 2022 From: report at bugs.python.org (Peter Lovett) Date: Tue, 29 Mar 2022 00:06:37 +0000 Subject: [issue31140] Insufficient error message with incorrect formated string literal In-Reply-To: <1502182558.08.0.700048111188.issue31140@psf.upfronthosting.co.za> Message-ID: <1648512397.02.0.178677899918.issue31140@roundup.psfhosted.org> Peter Lovett added the comment: I'm not getting the problem on 3.9.7 on Windows. Did get it on 3.7 (3.7.11?) on a different Windows machine last week. Not getting the problem on 3.10.4 The wrong line number is a problem for IDLE's syntax highlighter, that marks the first line as a Syntax Error, even if that line is a comment. This is an issue for ArcGIS Pro users, which is (I think) currently shipping with Python 3.7.11, so those users may come across it. Best solution would be for Esri to update their Python version to something newer. https://support.esri.com/en/technical-article/000013224 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 20:10:54 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Mar 2022 00:10:54 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648512654.26.0.539431916182.issue47138@roundup.psfhosted.org> miss-islington added the comment: New changeset d2c6a4428d52c108f4b06dcd1bb86023541c60ce by Miss Islington (bot) in branch '3.9': bpo-47138: Ensure Windows docs build uses the same pinned version as other platforms (GH-32161) https://github.com/python/cpython/commit/d2c6a4428d52c108f4b06dcd1bb86023541c60ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 20:11:29 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 00:11:29 +0000 Subject: [issue31140] Insufficient error message with incorrect formated string literal In-Reply-To: <1502182558.08.0.700048111188.issue31140@psf.upfronthosting.co.za> Message-ID: <1648512689.17.0.409176456193.issue31140@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, they should update Python. A lot of work went in to fixing these issues, and won't be backported. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 20:28:46 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 29 Mar 2022 00:28:46 +0000 Subject: [issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes In-Reply-To: <1648376164.23.0.483054740742.issue47135@roundup.psfhosted.org> Message-ID: <1648513726.73.0.0364295709291.issue47135@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 20:56:04 2022 From: report at bugs.python.org (Peter Lovett) Date: Tue, 29 Mar 2022 00:56:04 +0000 Subject: [issue31140] Insufficient error message with incorrect formated string literal In-Reply-To: <1502182558.08.0.700048111188.issue31140@psf.upfronthosting.co.za> Message-ID: <1648515364.68.0.922253185122.issue31140@roundup.psfhosted.org> Peter Lovett added the comment: Thanks Eric. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 21:50:03 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 01:50:03 +0000 Subject: [issue47125] Explore hashlib use of the Windows Crypto API NG In-Reply-To: <1648255993.62.0.516641602637.issue47125@roundup.psfhosted.org> Message-ID: <1648518603.99.0.614986682597.issue47125@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:05:07 2022 From: report at bugs.python.org (Charlie Zhao) Date: Tue, 29 Mar 2022 02:05:07 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1648519507.8.0.254560412235.issue47031@roundup.psfhosted.org> Change by Charlie Zhao : ---------- keywords: +patch pull_requests: +30248 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:07:19 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 29 Mar 2022 02:07:19 +0000 Subject: [issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE In-Reply-To: <1647557078.86.0.480735606049.issue47053@roundup.psfhosted.org> Message-ID: <1648519639.36.0.712876058169.issue47053@roundup.psfhosted.org> Dennis Sweeney added the comment: New changeset 788154919c2d843a0a995994bf2aed2d074761ec by Dennis Sweeney in branch 'main': bpo-47053: Refactor BINARY_OP_INPLACE_ADD_UNICODE (GH-32122) https://github.com/python/cpython/commit/788154919c2d843a0a995994bf2aed2d074761ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:11:40 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Mar 2022 02:11:40 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648519900.8.0.676605480502.issue28516@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +30249 pull_request: https://github.com/python/cpython/pull/32171 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:37:57 2022 From: report at bugs.python.org (Stanley) Date: Tue, 29 Mar 2022 02:37:57 +0000 Subject: [issue39971] [doc] Error in functional how-to example In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1648521477.04.0.335018164944.issue39971@roundup.psfhosted.org> Change by Stanley : ---------- keywords: +patch nosy: +slateny nosy_count: 4.0 -> 5.0 pull_requests: +30250 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:40:03 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Mar 2022 02:40:03 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648521603.3.0.788581864587.issue28516@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset 604d003ab4d1084ef828ebca1b28f2bf1b93c744 by Jelle Zijlstra in branch '3.10': [3.10] bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32171) https://github.com/python/cpython/commit/604d003ab4d1084ef828ebca1b28f2bf1b93c744 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 28 22:58:07 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Mar 2022 02:58:07 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1648522687.8.0.000717391193581.issue28516@roundup.psfhosted.org> Jelle Zijlstra 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 Mar 28 23:57:36 2022 From: report at bugs.python.org (Stanley) Date: Tue, 29 Mar 2022 03:57:36 +0000 Subject: [issue32658] Metacharacter (\) documentation suggestion In-Reply-To: <1516838461.29.0.467229070634.issue32658@psf.upfronthosting.co.za> Message-ID: <1648526256.27.0.315567411458.issue32658@roundup.psfhosted.org> Stanley added the comment: Mike, are you still working on this issue? ---------- nosy: +slateny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:33:29 2022 From: report at bugs.python.org (Rukchad Wongprayoon) Date: Tue, 29 Mar 2022 06:33:29 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? Message-ID: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> New submission from Rukchad Wongprayoon : How to reproduce? 1. Make a random module with doc-string in the function 2. Make a python app in new folder (under the module folder) and import it by do ```py import sys sys.path.append("..") import ``` 3. then every function will don't have doc-string included in their function ---------- components: Library (Lib) messages: 416242 nosy: timelessnesses priority: normal severity: normal status: open title: sys.path.append before import the module causing module don't have doc-string? versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:34:05 2022 From: report at bugs.python.org (Rukchad Wongprayoon) Date: Tue, 29 Mar 2022 06:34:05 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? In-Reply-To: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> Message-ID: <1648535645.09.0.0251999519824.issue47148@roundup.psfhosted.org> Change by Rukchad Wongprayoon : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:36:02 2022 From: report at bugs.python.org (Rukchad Wongprayoon) Date: Tue, 29 Mar 2022 06:36:02 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? In-Reply-To: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> Message-ID: <1648535762.48.0.453778100558.issue47148@roundup.psfhosted.org> Rukchad Wongprayoon added the comment: here's the example code parent/a.py ```py def multiply(): """multiply stuff""" return 69*420 ``` parent/another folder/b.py ```py import sys sys.path.append('..') import a a.multiply.__doc__ # None ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 02:48:57 2022 From: report at bugs.python.org (Rukchad Wongprayoon) Date: Tue, 29 Mar 2022 06:48:57 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? In-Reply-To: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> Message-ID: <1648536537.56.0.822319593076.issue47148@roundup.psfhosted.org> Rukchad Wongprayoon added the comment: seems like it doesn't appear in the help func too ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 03:04:09 2022 From: report at bugs.python.org (Julien Palard) Date: Tue, 29 Mar 2022 07:04:09 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1648537449.69.0.771214976456.issue45953@roundup.psfhosted.org> Julien Palard added the comment: > Since you seem to be challenging the value of 999999999, my question to you is, why do you care what the refcount of 1 is? Yesterday I was teaching Python, and we were speaking of integer immutability, names being "labels to objects" and so on, and I was showing the memory layout of all of this by hand on a whiteboard while "prooving" my drawings using an interpreter. While doing so came a question like "So, many modules can use the object int(1)?" So I answered yes, told that I expected many reuse of 1, and went importing sys.getrefcount to show them. And boom, it printed 1000000209 so I bugged for a few seconds, the value was obviously not the real refcount, and was also obviously bumped by a constant like 100000000, so I went inspecting why and found this commit. I have nothing against keeping 999999999, but in the other hand it could surprise other people, maybe we should at least document it near sys.getrefcount. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 03:57:47 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 07:57:47 +0000 Subject: [issue39971] [doc] Error in functional how-to example In-Reply-To: <1584290363.88.0.212644969816.issue39971@roundup.psfhosted.org> Message-ID: <1648540667.32.0.300575107135.issue39971@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 04:08:25 2022 From: report at bugs.python.org (Charlie Zhao) Date: Tue, 29 Mar 2022 08:08:25 +0000 Subject: [issue47031] math.nan should note that NANs do not compare equal to anything In-Reply-To: <1647384445.54.0.624569737197.issue47031@roundup.psfhosted.org> Message-ID: <1648541305.24.0.330221651776.issue47031@roundup.psfhosted.org> Charlie Zhao added the comment: I started a PR and some simple examples were added. It is helpful for those who are new to IEEE-754. According to Jelle's comments, the behavior of `float('nan') is float('nan')` may be changed in the future, so I just omit it and suggest users to use `math.isnan()`. This might make the documentation a bit clearer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 04:47:19 2022 From: report at bugs.python.org (Bruce Merry) Date: Tue, 29 Mar 2022 08:47:19 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message Message-ID: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> New submission from Bruce Merry : logging.DatagramHandler uses socket.sendto to send the messages. If the given address is a hostname rather than an IP address, it will do a DNS lookup every time. I suspect that fixing issue 14855 will also fix this, since fixing that issue requires resolving the hostname to determine whether it is an IPv4 or IPv6 address to create a suitable socket. I've run into this on 3.8, but tagging 3.10 since the code still looks the same. ---------- components: Library (Lib) messages: 416247 nosy: bmerry priority: normal severity: normal status: open title: DatagramHandler doing DNS lookup on every log message versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 04:47:39 2022 From: report at bugs.python.org (Bruce Merry) Date: Tue, 29 Mar 2022 08:47:39 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648543659.27.0.741176436628.issue47149@roundup.psfhosted.org> Change by Bruce Merry : ---------- type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 05:00:00 2022 From: report at bugs.python.org (Pi Delport) Date: Tue, 29 Mar 2022 09:00:00 +0000 Subject: [issue2604] doctest.DocTestCase fails when run repeatedly In-Reply-To: <1207798847.15.0.203205049744.issue2604@psf.upfronthosting.co.za> Message-ID: <1648544400.02.0.59496745421.issue2604@roundup.psfhosted.org> Pi Delport added the comment: Thanks! ?? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 05:26:11 2022 From: report at bugs.python.org (Jairo Llopis) Date: Tue, 29 Mar 2022 09:26:11 +0000 Subject: [issue47150] HTTPRedirectHandler fails on POST for 307 and 308 Message-ID: <1648545971.96.0.690131735602.issue47150@roundup.psfhosted.org> New submission from Jairo Llopis : urllib.request.HTTPRedirectHandler fails if there is a 307 HTTP return code in a POST request. In https://github.com/python/cpython/commit/c379bc5ec9012cf66424ef3d80612cf13ec51006 the same behaviour was implemented for 308. According to https://datatracker.ietf.org/doc/html/rfc7538#section-3 IMHO this implementation is wrong for 308: > Note: This status code is similar to 301 (Moved Permanently) > ([RFC7231], Section 6.4.2), except that it does not allow changing > the request method from POST to GET. A similar note exists in https://datatracker.ietf.org/doc/html/rfc7231#section-6.4.7 regarding code 307. So, as long as the original redirection is in POST and it gets redirected to another POST, it should not be an error. FWIW, in https://github.com/traefik/traefik/issues/7829#issuecomment-770210080 you can see that Traefik proxy uses 307 and 308 codes by default when redirecting non-GET requests. Thus, urllib.request.HTTPRedirectHandler will fail to process any POST requests proxied by Traefik. ---------- components: Library (Lib) messages: 416249 nosy: Jairo Llopis priority: normal severity: normal status: open title: HTTPRedirectHandler fails on POST for 307 and 308 type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:07:45 2022 From: report at bugs.python.org (mike mcleod) Date: Tue, 29 Mar 2022 10:07:45 +0000 Subject: [issue32658] Metacharacter (\) documentation suggestion In-Reply-To: <1516838461.29.0.467229070634.issue32658@psf.upfronthosting.co.za> Message-ID: <1648548465.86.0.761531489621.issue32658@roundup.psfhosted.org> mike mcleod added the comment: Sorry, forgot this one. Would you like me to move this forward? Or do you want to take it? I don't mind either way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:29:36 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 29 Mar 2022 10:29:36 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648549776.26.0.726266426042.issue47102@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30251 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32173 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:38:52 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 29 Mar 2022 10:38:52 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648550332.38.0.173737745936.issue47102@roundup.psfhosted.org> Christian Heimes added the comment: I figured out how to implement copy(). dup() does not work as expected, but accept() on an AF_ALG client socket creates an independent copy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 06:54:11 2022 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Tue, 29 Mar 2022 10:54:11 +0000 Subject: [issue47151] vfork() returns EINVAL if PID=1 Message-ID: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> New submission from ???? ????????? : The bug introduced here: #35823 If os.gepid() == 1, vfork() does not work and returns EINVAL. Please add check for the current pid in condition where CPython chooses between fork() and vfork(). ---------- components: Library (Lib) messages: 416252 nosy: socketpair priority: normal severity: normal status: open title: vfork() returns EINVAL if PID=1 versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:07:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2022 12:07:02 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648555622.26.0.312152327169.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: If I build a C++ extension with -std=c++20, I get a compiler error on PyModuleDef_HEAD_INIT: Modules/_testcppext.cpp:419:5: error: either all initializer clauses should be designated or none of them should be 419 | .m_name = "_testcppext", | ^ Code: --- static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, .m_name = "_testcppext", .m_doc = module_doc, ... }; --- Macro defined as (simplified code): --- #define PyObject_HEAD_INIT(type) \ { 1, type }, #define PyModuleDef_HEAD_INIT { \ PyObject_HEAD_INIT(NULL) \ NULL, /* m_init */ \ 0, /* m_index */ \ NULL, /* m_copy */ \ } --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 08:53:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2022 12:53:17 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648558397.63.0.805491037114.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: When I wrote a PR to use the C header file pythoncapi_compat.h in the datatable C++ project, I got multiple C++ compiler warnings in static inline functions and in some macros: https://github.com/h2oai/datatable/pull/3231#issuecomment-1032864790 * Usage of NULL * Usage of "old-style cast" like (ssize_t)1 or (PyObject*)obj I solved this issue in pythoncapi_compat.h by using reinterpret_cast and nullptr: * https://github.com/python/pythoncapi_compat/commit/347746379f79fa091017e23427932c9f9980234d * https://github.com/python/pythoncapi_compat/pull/18 * https://github.com/h2oai/datatable/pull/3237 By the way, pythoncapi_compat.h no longer uses "module": https://github.com/python/pythoncapi_compat/pull/22 The Python C API has similar issues, but warnings about NULL and old-style cast depend on the C++ compiler flags: * -Wzero-as-null-pointer-constant * -Wold-style-cast ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 09:01:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2022 13:01:51 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648558911.22.0.750477309762.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: STINNER Victor: > What is the error message? How can the error be reproduced? Keith (aCuria): > Compile with a compiler supporting the C++20 core feature (Modules) > https://en.cppreference.com/w/cpp/compiler_support I built a C++ extension which calls PyModule_AddType(): I get no warning. I tested GCC and LLVM clang. Commands: clang -Wno-unused-result -g -Og -Wall -O0 -fPIC -I/home/vstinner/python/main/Include -I/home/vstinner/python/main -c Modules/_testcppext.cpp -o build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o -I/home/vstinner/python -Werror -Wall -Wextra -Wconversion -Wno-typedef-redefinition -std=c++20 -Wzero-as-null-pointer-constant -Wold-style-cast gcc -Wno-unused-result -g -Og -Wall -O0 -fPIC -I/home/vstinner/python/main/Include -I/home/vstinner/python/main -c Modules/_testcppext.cpp -o build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o -I/home/vstinner/python -Werror -Wall -Wextra -Wconversion -Wno-typedef-redefinition -std=c++20 -Wzero-as-null-pointer-constant -Wold-style-cast Reformatted commands: ['clang', '-Wno-unused-result', '-g', '-Og', '-Wall', '-O0', '-fPIC', '-I/home/vstinner/python/main/Include', '-I/home/vstinner/python/main', '-c', 'Modules/_testcppext.cpp', '-o', 'build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o', '-I/home/vstinner/python', '-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-typedef-redefinition', '-std=c++20', '-Wzero-as-null-pointer-constant', '-Wold-style-cast'] ['gcc', '-Wno-unused-result', '-g', '-Og', '-Wall', '-O0', '-fPIC', '-I/home/vstinner/python/main/Include', '-I/home/vstinner/python/main', '-c', 'Modules/_testcppext.cpp', '-o', 'build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o', '-I/home/vstinner/python', '-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-typedef-redefinition', '-std=c++20', '-Wzero-as-null-pointer-constant', '-Wold-style-cast'] ---------- versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 09:05:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2022 13:05:26 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648559126.79.0.391259626146.issue39355@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30252 pull_request: https://github.com/python/cpython/pull/32175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 09:07:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2022 13:07:39 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648559259.02.0.561747145996.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: I wrote the draft PR GH-32175 to test https://bugs.python.org/issue39355 and GH-31282. Problem: I don't get any compiler warning or error about the "module" C++20 keyword. I tested GCC 11.2.1 and clang 13.0.0 of Fedora 35. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 09:39:30 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Mar 2022 13:39:30 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648561170.93.0.834683938993.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: The C++20 "module" keyword is "contextual keyword". It's only a keyword if the first line if a file contains "module". * https://en.cppreference.com/w/cpp/language/modules#Module_declarations * https://en.cppreference.com/w/cpp/keyword/module It's not the case in any .h file of the Python C API, so Python doesn't need to be changed. I close the issue. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 09:42:30 2022 From: report at bugs.python.org (Zachary Ware) Date: Tue, 29 Mar 2022 13:42:30 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? In-Reply-To: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> Message-ID: <1648561350.55.0.974379360837.issue47148@roundup.psfhosted.org> Zachary Ware added the comment: I can't reproduce this without the `-OO` option: -OO : do -O changes and also discard docstrings; add .opt-2 before .pyc extension Note that I did slightly adjust your `b.py` script to do `print(a.multiply.__doc__)`, but here's what I tried: ~/issue47148_test/parent/another folder $ cat ../a.py def multiply(): """multiply stuff""" return 69*420 ~/issue47148_test/parent/another folder $ cat b.py import sys sys.path.append('..') import a print(a.multiply.__doc__) ~/issue47148_test/parent/another folder $ python b.py multiply stuff ~/issue47148_test/parent/another folder $ python -O b.py multiply stuff ~/issue47148_test/parent/another folder $ python -OO b.py None ---------- nosy: +zach.ware resolution: -> works for me status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 09:44:31 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 29 Mar 2022 13:44:31 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648561471.94.0.838497775326.issue39355@roundup.psfhosted.org> Erlend E. Aasland added the comment: > The C++20 "module" keyword is "contextual keyword". It's only a keyword if the first line if a file contains "module". Great! No changes needed. Thanks for investigating. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:28:50 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 14:28:50 +0000 Subject: [issue47151] vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648564130.17.0.0216641961596.issue47151@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:31:24 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 14:31:24 +0000 Subject: [issue35859] Capture behavior depends on the order of an alternation In-Reply-To: <1548857774.3.0.1614070954.issue35859@roundup.psfhosted.org> Message-ID: <1648564284.23.0.548165765268.issue35859@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 356997cccc21a3391175d20e9ef03d434675b496 by Ma Lin in branch 'main': bpo-35859: Fix a few long-standing bugs in re engine (GH-12427) https://github.com/python/cpython/commit/356997cccc21a3391175d20e9ef03d434675b496 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:31:47 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 14:31:47 +0000 Subject: [issue47151] vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648564307.27.0.824099113639.issue47151@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:35:33 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 14:35:33 +0000 Subject: [issue35859] Capture behavior depends on the order of an alternation In-Reply-To: <1548857774.3.0.1614070954.issue35859@roundup.psfhosted.org> Message-ID: <1648564533.1.0.857347195554.issue35859@roundup.psfhosted.org> Serhiy Storchaka added the comment: Since the old behavior in many cases matches the behavior of Perl and Java (which are considered bugs, but still), it was decided to not backport the fix to avoid possible breakage in bugfix releases. Thank you Ma Lin for your contribution. ---------- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:41:19 2022 From: report at bugs.python.org (Ma Lin) Date: Tue, 29 Mar 2022 14:41:19 +0000 Subject: [issue35859] Capture behavior depends on the order of an alternation In-Reply-To: <1548857774.3.0.1614070954.issue35859@roundup.psfhosted.org> Message-ID: <1648564879.51.0.63624857307.issue35859@roundup.psfhosted.org> Ma Lin added the comment: Thanks for your review. 3.11 has a more powerful re module, also thank you for rebasing the atomic grouping code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:48:44 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 14:48:44 +0000 Subject: [issue47150] HTTPRedirectHandler fails on POST for 307 and 308 In-Reply-To: <1648545971.96.0.690131735602.issue47150@roundup.psfhosted.org> Message-ID: <1648565324.74.0.253737510123.issue47150@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:49:04 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 14:49:04 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648565344.22.0.35357815775.issue26120@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am sorry that I did not test the changes manually, but it seems that __future__ annotations are now disappeared from the pydoc output for the __future__ module help. $ ./python -m pydoc __future__ It is now difficult to get a list of available features from the help. They should be kept in the DATA section for the __future__ module. ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 10:54:03 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 14:54:03 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648565643.57.0.0798387731134.issue26120@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yet one bug: PR 30888 only changed the text output. But there is also the html output generator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:02:32 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 29 Mar 2022 15:02:32 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1648566152.7.0.250857373812.issue14265@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 755be9b1505af591b9f2ee424a6525b6c2b65ce9 by Sam Ezeh in branch 'main': bpo-14265: Adds fully qualified test name to unittest output (GH-32138) https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:03:07 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 29 Mar 2022 15:03:07 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1648566187.48.0.904940616208.issue14265@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:09:20 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 15:09:20 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648566560.13.0.857824988304.issue39355@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:13:16 2022 From: report at bugs.python.org (Ma Lin) Date: Tue, 29 Mar 2022 15:13:16 +0000 Subject: [issue23689] Memory leak in Modules/sre_lib.h In-Reply-To: <1426611380.23.0.46113718722.issue23689@psf.upfronthosting.co.za> Message-ID: <1648566796.27.0.26424965106.issue23689@roundup.psfhosted.org> Ma Lin added the comment: My PR methods are suboptimal, so I closed them. The number of REPEAT can be counted when compiling a pattern, and allocate a `SRE_REPEAT` array in `SRE_STATE` (with that number items). It seem at any time, a REPEAT will only have one in active, so a `SRE_REPEAT` array is fine. regex module does like this: https://github.com/mrabarnett/mrab-regex/blob/hg/regex_3/_regex.c#L18287-L18288 Can the number of REPEAT be placed in `SRE_OP_INFO`? And add a field to `SRE_OP_REPEAT` to indicate the index of this REPEAT. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:30:16 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 15:30:16 +0000 Subject: [issue9134] sre bug: lastmark_save/restore In-Reply-To: <1277932738.21.0.537266945796.issue9134@psf.upfronthosting.co.za> Message-ID: <1648567816.87.0.639663390128.issue9134@roundup.psfhosted.org> Serhiy Storchaka added the comment: Fixed in issue35859 together with other bugs, but the fix was only applied to 3.11, because that bug is old and the old behavior matches the behavior in some other engines (Perl and Java). ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed versions: +Python 3.11 -Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:34:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 29 Mar 2022 15:34:13 +0000 Subject: [issue47102] explore hashlib use of the Linux Kernel CryptoAPI In-Reply-To: <1648063813.11.0.72255294176.issue47102@roundup.psfhosted.org> Message-ID: <1648568053.06.0.23780610252.issue47102@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30253 pull_request: https://github.com/python/cpython/pull/32176 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:34:34 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 29 Mar 2022 15:34:34 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648568074.15.0.389850937783.issue46864@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30254 pull_request: https://github.com/python/cpython/pull/32176 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:54:32 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 15:54:32 +0000 Subject: [issue47152] Reorganize the re module sources Message-ID: <1648569272.18.0.653641722475.issue47152@roundup.psfhosted.org> New submission from Serhiy Storchaka : I proposed it several years ago on the Python-Dev mailing list and that change was approved in general. The reorganization was deferred because there were several known bugs in the RE engine (fixes for which could potentially be backported) and there were not merged patches waiting for review. Now the patch for atomic groups was merged and bugs was fixed (thanks to Ma Lin). Both the C code and the Python code for the re module are distributed on few files, which lie down in directories Modules and Lib. It makes difficult to work with all related files because they are intermixed with source files of different modules. The following changes are planned: 1. Convert the re module into a package. Make sre_* modules its submodules. 2. Move C sources for the _sre module into a separate directory. 3. Extract the code for generating definitions of C constants from definitions of Python constants into a separate script and add it in the Tools/scripts directory (there are precedences: generate_token.py, etc). ---------- components: Library (Lib), Regular Expressions messages: 416268 nosy: ezio.melotti, gvanrossum, malin, mrabarnett, serhiy.storchaka priority: normal severity: normal status: open title: Reorganize the re module sources versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 11:55:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 15:55:22 +0000 Subject: [issue23689] Memory leak in Modules/sre_lib.h In-Reply-To: <1426611380.23.0.46113718722.issue23689@psf.upfronthosting.co.za> Message-ID: <1648569322.46.0.470126369284.issue23689@roundup.psfhosted.org> Serhiy Storchaka added the comment: This looks promising. Please, go ahead! You are free to add any fields to any opcodes. It may break some third-party code which generates compiled patterns from a sequence of opcodes, it the stability of this interface was not promised. And they will be broken in any case due to reorganizing of internal code (issue47152). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:01:32 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 16:01:32 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648569692.55.0.600428605802.issue47149@roundup.psfhosted.org> Eric V. Smith added the comment: If you don?t look it up every time, how do you deal with DNS timeouts? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:04:27 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 16:04:27 +0000 Subject: [issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes In-Reply-To: <1648376164.23.0.483054740742.issue47135@roundup.psfhosted.org> Message-ID: <1648569867.95.0.710864995278.issue47135@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:06:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 29 Mar 2022 16:06:22 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648569982.48.0.0305520534271.issue47151@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- components: +Extension Modules -Library (Lib) stage: -> needs patch title: vfork() returns EINVAL if PID=1 -> subprocess fails when used as init, vfork() returns EINVAL if PID=1 type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:07:14 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 16:07:14 +0000 Subject: [issue16958] The sqlite3 context manager does not work with isolation_level=None In-Reply-To: <1358124405.04.0.0310758361359.issue16958@psf.upfronthosting.co.za> Message-ID: <1648570034.65.0.551961889165.issue16958@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10, erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:07:16 2022 From: report at bugs.python.org (Ethan Furman) Date: Tue, 29 Mar 2022 16:07:16 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior In-Reply-To: <1641851456.34.0.342855463339.issue46337@roundup.psfhosted.org> Message-ID: <1648570036.85.0.474688848423.issue46337@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:10:33 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 29 Mar 2022 16:10:33 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648570233.73.0.252657685303.issue44090@roundup.psfhosted.org> G?ry added the comment: Thanks for the review. @rhettinger > And adding classmethod() support in super_descr_get() would create tight coupling where there should be separate concerns (no other descriptor call is classmethod specific). The descriptors `super`, `property`, and functions are already `classmethod` specific since their `__get__(instance, owner=None)` methods return `self` if `instance` is `None`, aren?t they? > The OP's proposed use case is mildly plausible though I've never seen it the arise in practice. I agree that the parameterized factory method use case might be too rare to be compelling. @gvanrossum > That was perhaps a good idea 20 years ago, but nowadays you can use argument-less super() Yes this proposal is likely too late. I found your autosuper solution quite elegant (no compiler magic) so I wanted to make it work with `classmethod` too after I realized it doesn?t, thanks to Michele?s article. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:15:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 16:15:37 +0000 Subject: [issue47152] Reorganize the re module sources In-Reply-To: <1648569272.18.0.653641722475.issue47152@roundup.psfhosted.org> Message-ID: <1648570537.56.0.99900279582.issue47152@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +30255 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:21:28 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 29 Mar 2022 16:21:28 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648570888.35.0.989565159555.issue44090@roundup.psfhosted.org> G?ry added the comment: > On StackOverflow, there has been some mild interest in the interactions between super() and classmethod(): > > * https://stackoverflow.com/questions/64637174 > * https://stackoverflow.com/questions/1269217 > * https://stackoverflow.com/questions/1817183 Another one: https://stackoverflow.com/q/15291302/2326961 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:35:35 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 29 Mar 2022 16:35:35 +0000 Subject: [issue47083] The __complex__ method is missing from the complex, float, and int built-in types In-Reply-To: <1647882580.13.0.610930198027.issue47083@roundup.psfhosted.org> Message-ID: <1648571735.67.0.843992184625.issue47083@roundup.psfhosted.org> G?ry added the comment: > I think this may fine as-is. In general, virtiual classes only promise that an operation will work rather than promsing the presence of a particular method. Okay, I just wanted to make sure that the absence of the `__complex__` method was intended and not an oversight, since the built-in numeric types define *all* the other methods of the numbers ABCs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 12:47:38 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 29 Mar 2022 16:47:38 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648572458.08.0.502696397396.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: Let's hold these PRs a couple of weeks in case more patch releases appear. IMO we can hold it until a week or two before the beta phase kicks in. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:02:56 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Mar 2022 17:02:56 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648573376.01.0.295449530448.issue44090@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks, let's close the issue as "won't fix". ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:31:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 17:31:38 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648575098.99.0.45273514295.issue26120@roundup.psfhosted.org> Irit Katriel added the comment: > Yet one bug: PR 30888 only changed the text output. But there is also the html output generator. I'm not sure - if I revert the change like this: if isinstance(getattr(obj, name, None), __future__._Feature): - return False + pass # return False then test_html_doc fails: ====================================================================== FAIL: test_html_doc (test.test_pydoc.PydocDocTest.test_html_doc) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/Lib/test/test_pydoc.py", line 414, in test_html_doc self.assertEqual(text_lines, expected_lines) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Lists differ: ['tes[1392 chars]t]', "print_function = _Feature((2, 6, 0, 'alp[156 chars]ody'] != ['tes[1392 chars]t]', 'type_union1 = typing.Union[int, str]', '[72 chars]ody'] First differing element 55: "print_function = _Feature((2, 6, 0, 'alp[36 chars]576)" 'type_union1 = typing.Union[int, str]' First list contains 1 additional elements. First extra element 61: 'Nobody' ['test.pydoc_mod (version 1.2.3.4)', 'This is a test module for test_pydoc', 'Modules', 'types', 'typing', 'Classes', 'builtins.object', 'A', 'B', 'C', 'class A(builtins.object)', 'Hello and goodbye', 'Methods defined here:', '__init__()', 'Wow, I have no function!', 'Data descriptors defined here:', '__dict__', 'dictionary for instance variables (if defined)', '__weakref__', 'list of weak references to the object (if defined)', 'class B(builtins.object)', 'Data descriptors defined here:', '__dict__', 'dictionary for instance variables (if defined)', '__weakref__', 'list of weak references to the object (if defined)', 'Data and other attributes defined here:', "NO_MEANING = 'eggs'", "__annotations__ = {'NO_MEANING': }", 'class C(builtins.object)', 'Methods defined here:', 'get_answer(self)', 'Return say_no()', 'is_it_true(self)', 'Return self.get_answer()', 'say_no(self)', 'Class methods defined here:', '__class_getitem__(item) from builtins.type', 'Data descriptors defined here:', '__dict__', 'dictionary for instance variables (if defined)', '__weakref__', 'list of weak references to the object (if defined)', 'Functions', 'doc_func()', "This function solves all of the world's problems:", 'hunger', 'lack of Python', 'war', 'nodoc_func()', 'Data', "__xyz__ = 'X, Y and Z'", 'c_alias = test.pydoc_mod.C[int]', 'list_alias1 = typing.List[int]', 'list_alias2 = list[int]', - "print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), " - '1048576)', 'type_union1 = typing.Union[int, str]', 'type_union2 = int | str', 'Author', 'Benjamin Peterson', 'Credits', 'Nobody'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:32:48 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 29 Mar 2022 17:32:48 +0000 Subject: [issue47153] __doc__ should generally be writable Message-ID: <1648575168.9.0.879509749563.issue47153@roundup.psfhosted.org> New submission from Antoine Pitrou : The __doc__ attribute of several object types is not writable: notably descriptors (method/member/getset), as well builtin methods. This is annoying when wanting to generate docstrings for these objects dynamically. While it's not useful for regular Python code, it comes up when using Cython, which uses these types to implement the methods and properties of "cdef" classes. ---------- components: Interpreter Core messages: 416277 nosy: pitrou priority: normal severity: normal status: open title: __doc__ should generally be writable type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:33:02 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 29 Mar 2022 17:33:02 +0000 Subject: [issue47153] __doc__ should generally be writable In-Reply-To: <1648575168.9.0.879509749563.issue47153@roundup.psfhosted.org> Message-ID: <1648575182.72.0.0761007730029.issue47153@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:35:29 2022 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 29 Mar 2022 17:35:29 +0000 Subject: [issue47154] -arch detection in _osx_support generates false positives Message-ID: <1648575329.21.0.561330062927.issue47154@roundup.psfhosted.org> New submission from Isuru Fernando : If `cflags` contains something like, `-I/Users/isuru/handy-archives-env/include`, then the code assumes that there is a `-arch` flag in it and errors with ValueError: Don't know machine value for archs=() ---------- components: Build messages: 416278 nosy: isuruf priority: normal severity: normal status: open title: -arch detection in _osx_support generates false positives versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:36:57 2022 From: report at bugs.python.org (Isuru Fernando) Date: Tue, 29 Mar 2022 17:36:57 +0000 Subject: [issue47154] -arch detection in _osx_support generates false positives In-Reply-To: <1648575329.21.0.561330062927.issue47154@roundup.psfhosted.org> Message-ID: <1648575417.48.0.77456669699.issue47154@roundup.psfhosted.org> Change by Isuru Fernando : ---------- keywords: +patch pull_requests: +30256 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:36:57 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 17:36:57 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648575417.56.0.673700145445.issue46775@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch nosy: +corona10 nosy_count: 5.0 -> 6.0 pull_requests: +30257 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:43:34 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 29 Mar 2022 17:43:34 +0000 Subject: [issue47153] __doc__ should generally be writable In-Reply-To: <1648575168.9.0.879509749563.issue47153@roundup.psfhosted.org> Message-ID: <1648575814.79.0.927814053891.issue47153@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:49:35 2022 From: report at bugs.python.org (Bruce Merry) Date: Tue, 29 Mar 2022 17:49:35 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648576175.77.0.644528210321.issue47149@roundup.psfhosted.org> Bruce Merry added the comment: > If you don?t look it up every time, how do you deal with DNS timeouts? Do you mean expiring the IP address when the TTL is reached? I suppose that could be an issue for a long-running service, and I don't have a good answer to that. Possibly these days with services meshes and load-balancers it is less of a concern since a logging server can move without changing its IP address. But it's important for a logging system not to block the service doing the logging (which is one reason for using UDP in the first place). I only discovered this issue because of some flaky DNS servers that would occasionally take several seconds to answer a query, and block the whole asyncio event loop while it waited. At a minimum it would be useful to document it, so that you know it's something to be concerned about when using DatagramHandler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:49:41 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 29 Mar 2022 17:49:41 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1648576181.79.0.240719981834.issue46564@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:56:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 17:56:07 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648576567.8.0.370065976303.issue26120@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +30258 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32180 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:57:59 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 29 Mar 2022 17:57:59 +0000 Subject: [issue47154] -arch detection in _osx_support generates false positives In-Reply-To: <1648575329.21.0.561330062927.issue47154@roundup.psfhosted.org> Message-ID: <1648576679.03.0.774188828069.issue47154@roundup.psfhosted.org> Ned Deily added the comment: Duplicate of bpo-46691 but since you've provide a PR, we'll follow up with this one, thanks. ---------- assignee: -> ned.deily components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 13:59:46 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 29 Mar 2022 17:59:46 +0000 Subject: [issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag In-Reply-To: <1644409009.26.0.313805274681.issue46691@roundup.psfhosted.org> Message-ID: <1648576786.64.0.438812940933.issue46691@roundup.psfhosted.org> Ned Deily added the comment: Also reported in bpo-47154 including a suggested fix ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> -arch detection in _osx_support generates false positives _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:20:50 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 29 Mar 2022 18:20:50 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648578050.78.0.972791967792.issue46775@roundup.psfhosted.org> Steve Dower added the comment: Is this okay to backport? Correcting more winerror values means we'll get more subclasses raised instead of OSError (though only for obscure cases, which probably also aren't mapped, so I guess it's possible to prove that none will actually change right now). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:46:57 2022 From: report at bugs.python.org (=?utf-8?q?Maciej_G=C3=B3rski?=) Date: Tue, 29 Mar 2022 18:46:57 +0000 Subject: [issue17246] inspect.getargvalues fails if arg name is not bound to a value In-Reply-To: <1361312556.73.0.83895942435.issue17246@psf.upfronthosting.co.za> Message-ID: <1648579617.61.0.211115103516.issue17246@roundup.psfhosted.org> Maciej G?rski added the comment: In my opinion formatargvalues function is quite useless in current day as ArgInfo provides all the information. I'm however willing to fix this. IMO we should just omit the args/varargs/kwargs that have been deleted, since the values do not exist in the current frame anymore. I can implement the idea propossed in 2013, but I feel this seems less intuative(?) and might be worse for backwards compatibility (if anyone ever actually expects some values from formatargvalues, but I haven't been able to find an example of that). Thank you in advance for any input. ---------- nosy: +macgors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 14:59:53 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Mar 2022 18:59:53 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648580393.21.0.849453735448.issue26120@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Yet one bug: PR 30888 only changed the text output. But there is also the html output generator. Sorry, I was wrong. The changed code is common for all generators. Perhaps I tested with wrong version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 15:01:51 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 29 Mar 2022 19:01:51 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648580511.37.0.464678655331.issue47138@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30259 pull_request: https://github.com/python/cpython/pull/32182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 15:11:06 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 29 Mar 2022 19:11:06 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648581066.11.0.469904366435.issue47138@roundup.psfhosted.org> Ned Deily added the comment: New changeset d97497bf1cc6abd4a9a67d8da4f00cf13b3af4b3 by Steve Dower in branch '3.7': bpo-47138: Ensure Windows docs build uses the same pinned version as other platforms (GH-32182) https://github.com/python/cpython/commit/d97497bf1cc6abd4a9a67d8da4f00cf13b3af4b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 15:27:57 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 19:27:57 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648582077.48.0.132951767443.issue47149@roundup.psfhosted.org> Eric V. Smith added the comment: > Do you mean expiring the IP address when the TTL is reached? Yes, that's what I mean. Isn't the resolver library smart enough to cache lookups and handle the TTL timeout by itself? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 15:44:11 2022 From: report at bugs.python.org (Bruce Merry) Date: Tue, 29 Mar 2022 19:44:11 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648583051.9.0.289067709436.issue47149@roundup.psfhosted.org> Bruce Merry added the comment: > Yes, that's what I mean. Isn't the resolver library smart enough to cache lookups and handle the TTL timeout by itself? Apparently not in this case - with tcpdump I can see the DNS requests being fired off several times a second. I'll need to check what the TTL actually is though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 15:46:12 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 19:46:12 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648583172.41.0.608888485606.issue47149@roundup.psfhosted.org> Eric V. Smith added the comment: Hmm. I'm not sure we should try to work around a bad resolver issue. What's your platform, and how did you install Python? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:01:18 2022 From: report at bugs.python.org (Bruce Merry) Date: Tue, 29 Mar 2022 20:01:18 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648584078.37.0.0806611863753.issue47149@roundup.psfhosted.org> Bruce Merry added the comment: > Hmm. I'm not sure we should try to work around a bad resolver issue. What's your platform, and how did you install Python? Fair point. It's Ubuntu 20.04, running inside Docker, with the default Python (3.8). I've also reproduced it outside Docker (again Ubuntu 20.04 with system Python). The TTL is 30s, so I'm not sure why systemd-resolved isn't caching it for messages logged several times a second. Even if the system has a local cache though, it's not ideal to have logging block when the TTL expires, particularly in an event-driven (asyncio) service. Updating the address in a background thread while continuing to log to the old address might be better. But my use case is particularly real-time (even 10ms of latency is problematic), and maybe that shouldn't drive the default behaviour. I blame the lack of standard POSIX functions for doing DNS lookups asynchronously and in a way that provides TTL information to the client. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:06:38 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 20:06:38 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648584398.79.0.0999701689805.issue47149@roundup.psfhosted.org> Eric V. Smith added the comment: > I blame the lack of standard POSIX functions for doing DNS lookups asynchronously and in a way that provides TTL information to the client. I totally agree with that! And I agree it would be nice to have some way of doing non-blocking lookups when the TTL expires (or whenever it decides it needs to do a lookup). But it's going to be non-trivial, I fear. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:26:04 2022 From: report at bugs.python.org (Furkan Onder) Date: Tue, 29 Mar 2022 20:26:04 +0000 Subject: [issue47155] Strange behavior on the tuple that includes list Message-ID: <1648585564.15.0.742761945333.issue47155@roundup.psfhosted.org> New submission from Furkan Onder : I am creating the tuple that includes a list and than I am trying to add new value to this list. Interpreter throw the error, but list is changing. I think it doesn't make sense. I think if we throw the type error, list shouldn't be change. >>> tup = ('hi', 'test', ['a','b']) >>> tup[2] += 'c' Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment >>> tup ('hi', 'test', ['a', 'b', 'c']) >>> ---------- components: Interpreter Core messages: 416291 nosy: furkanonder priority: normal severity: normal status: open title: Strange behavior on the tuple that includes list versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:29:11 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 20:29:11 +0000 Subject: [issue47155] Strange behavior on the tuple that includes list In-Reply-To: <1648585564.15.0.742761945333.issue47155@roundup.psfhosted.org> Message-ID: <1648585751.13.0.253591904255.issue47155@roundup.psfhosted.org> Eric V. Smith added the comment: This is an FAQ: https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:29:51 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 20:29:51 +0000 Subject: [issue47155] Strange behavior on the tuple that includes list In-Reply-To: <1648585564.15.0.742761945333.issue47155@roundup.psfhosted.org> Message-ID: <1648585791.99.0.803883488086.issue47155@roundup.psfhosted.org> Eric V. Smith added the comment: There's also this StackOverflow question about it: https://stackoverflow.com/questions/38344244/tuples-operator-throws-exception-but-succeeds ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 16:57:30 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Mar 2022 20:57:30 +0000 Subject: [issue46197] ensurepip bootstrap breaks out of isolated environment In-Reply-To: <1640820251.78.0.719610352005.issue46197@roundup.psfhosted.org> Message-ID: <1648587450.35.0.628137244868.issue46197@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +eric.snow, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:08:11 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 29 Mar 2022 21:08:11 +0000 Subject: [issue47138] Pin Jinja2 to fix docs build In-Reply-To: <1648455445.5.0.763190152581.issue47138@roundup.psfhosted.org> Message-ID: <1648588091.83.0.230814610744.issue47138@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30260 pull_request: https://github.com/python/cpython/pull/32183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:08:35 2022 From: report at bugs.python.org (Dominic Davis-Foster) Date: Tue, 29 Mar 2022 21:08:35 +0000 Subject: [issue47152] Reorganize the re module sources In-Reply-To: <1648569272.18.0.653641722475.issue47152@roundup.psfhosted.org> Message-ID: <1648588115.85.0.884523693297.issue47152@roundup.psfhosted.org> Dominic Davis-Foster added the comment: Could the sre_parse and sre_constants modules be kept with public names (i.e. without the leading underscore) but within the re namespace? I use them to tokenize and then syntax highlight regular expressions. I did a quick search and found a few other users of the modules: * pydoctor uses them for regex syntax highlighting[1], although it has its own copy of the sre_parse source rather than importing from stdlib. * lark uses sre_parse to find minimum and maximum length of matching strings[2] * sre_yield uses them to determine all strings that will match a regex[3] The whole modules don't necessarily need exposing, but certainly sre_parse.parse, sre_parse.parse_template, and the opcodes from sre_constants would be the most useful. [1] https://github.com/twisted/pydoctor/blob/c86273dffade5455890570142c8b7b068f5dffd1/pydoctor/epydoc/markup/_pyval_repr.py#L776 [2] https://github.com/lark-parser/lark/blob/85ea92ebf4e983e9997f9953a9c1463bb3d1c6cc/lark/utils.py#L120 [3] https://github.com/google/sre_yield/blob/3af063a0054c4646608b43b941fbfcbe4e01214a/sre_yield/__init__.py ---------- nosy: +dom1310df _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:13:55 2022 From: report at bugs.python.org (Dominic Davis-Foster) Date: Tue, 29 Mar 2022 21:13:55 +0000 Subject: [issue47154] -arch detection in _osx_support generates false positives In-Reply-To: <1648575329.21.0.561330062927.issue47154@roundup.psfhosted.org> Message-ID: <1648588435.85.0.333536591265.issue47154@roundup.psfhosted.org> Change by Dominic Davis-Foster : ---------- nosy: +dom1310df _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:21:47 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Mar 2022 21:21:47 +0000 Subject: [issue42340] KeyboardInterrupt should come with a warning In-Reply-To: <1605234005.33.0.891581452406.issue42340@roundup.psfhosted.org> Message-ID: <1648588907.56.0.703984534533.issue42340@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +30261 pull_request: https://github.com/python/cpython/pull/32184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:21:58 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Mar 2022 21:21:58 +0000 Subject: [issue42340] KeyboardInterrupt should come with a warning In-Reply-To: <1605234005.33.0.891581452406.issue42340@roundup.psfhosted.org> Message-ID: <1648588918.04.0.532798583627.issue42340@roundup.psfhosted.org> Jelle Zijlstra added the comment: New changeset d0906c90fcfbc4cfb9bb963eaa6bb152dd543b56 by benfogle in branch 'main': bpo-42340: Document issues around KeyboardInterrupt (GH-23255) https://github.com/python/cpython/commit/d0906c90fcfbc4cfb9bb963eaa6bb152dd543b56 ---------- nosy: +JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:22:47 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Mar 2022 21:22:47 +0000 Subject: [issue42340] KeyboardInterrupt should come with a warning In-Reply-To: <1605234005.33.0.891581452406.issue42340@roundup.psfhosted.org> Message-ID: <1648588967.26.0.560467845529.issue42340@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30262 pull_request: https://github.com/python/cpython/pull/32185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:26:36 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 29 Mar 2022 21:26:36 +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: <1648589196.22.0.671025861602.issue33178@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset dc2d8404a3ab6288ce112c71da8c65c34cd3087e by Dave Goncalves in branch 'main': bpo-33178: Add BigEndianUnion, LittleEndianUnion classes to ctypes (GH-25480) https://github.com/python/cpython/commit/dc2d8404a3ab6288ce112c71da8c65c34cd3087e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:27:51 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 29 Mar 2022 21:27:51 +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: <1648589271.45.0.696220531881.issue33178@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks for the contribution! (our attention spans can be scattered and random, apologies for the delay) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:45:51 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Mar 2022 21:45:51 +0000 Subject: [issue42340] KeyboardInterrupt should come with a warning In-Reply-To: <1605234005.33.0.891581452406.issue42340@roundup.psfhosted.org> Message-ID: <1648590351.19.0.156815015363.issue42340@roundup.psfhosted.org> miss-islington added the comment: New changeset 66cde7c51a871a86cf8667adf4bd1d03e9b98eb1 by Miss Islington (bot) in branch '3.10': bpo-42340: Document issues around KeyboardInterrupt (GH-23255) https://github.com/python/cpython/commit/66cde7c51a871a86cf8667adf4bd1d03e9b98eb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:48:14 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Mar 2022 21:48:14 +0000 Subject: [issue42340] KeyboardInterrupt should come with a warning In-Reply-To: <1605234005.33.0.891581452406.issue42340@roundup.psfhosted.org> Message-ID: <1648590494.92.0.385475305199.issue42340@roundup.psfhosted.org> miss-islington added the comment: New changeset c26af2bc531eb114c378cdad81935f6e838a7ee0 by Miss Islington (bot) in branch '3.9': bpo-42340: Document issues around KeyboardInterrupt (GH-23255) https://github.com/python/cpython/commit/c26af2bc531eb114c378cdad81935f6e838a7ee0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 17:49:51 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Mar 2022 21:49:51 +0000 Subject: [issue42340] KeyboardInterrupt should come with a warning In-Reply-To: <1605234005.33.0.891581452406.issue42340@roundup.psfhosted.org> Message-ID: <1648590591.65.0.105491928202.issue42340@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks for the patch! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:07:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 22:07:23 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648591643.87.0.512242688916.issue26120@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 63f32fae79e16e6dc71777bd3fcb623b2c3ff742 by Irit Katriel in branch 'main': bpo-26120: do not exclude __future__ import in pydoc of the __future__ module itself (GH-32180) https://github.com/python/cpython/commit/63f32fae79e16e6dc71777bd3fcb623b2c3ff742 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:07:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 22:07:47 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1648591667.96.0.479236741239.issue26120@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 Mar 29 18:10:53 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 29 Mar 2022 22:10:53 +0000 Subject: [issue47156] IDLE: make use of extended SyntaxError info. Message-ID: <1648591853.36.0.0695463785531.issue47156@roundup.psfhosted.org> New submission from Terry J. Reedy : In 3.10 and 3.11: >>> while s := input.read(MAXBINSIZE): ... while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)): File "", line 2 while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)): ^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: cannot use assignment expressions with expression IDLE only colors the 'l' of 'len'; add extended marking. Some other errors gained extended location in 3.11 (only, I believe). Adding colors may require monkeypatching method or subclassing class in traceback.py. May have commented on issue or PR. Related: Put SyntaxError in box. (Anyone really want log of error?) ---------- assignee: terry.reedy components: IDLE messages: 416302 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: make use of extended SyntaxError info. versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:15:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 22:15:24 +0000 Subject: [issue43881] add platform availabity information for os.sched_getaffinity Message-ID: <1648592124.17.0.841534850127.issue43881@roundup.psfhosted.org> New submission from Irit Katriel : It might help if you provide motivation for the change. In particular, explain why you believe the current text is incorrect. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:15:27 2022 From: report at bugs.python.org (Jonathan Balloch) Date: Tue, 29 Mar 2022 22:15:27 +0000 Subject: [issue47157] bijective invertible map Message-ID: <1648592127.3.0.298910668675.issue47157@roundup.psfhosted.org> New submission from Jonathan Balloch : It would be powerful to have a native implementation of a bijective map (e.g. a dictionary that hashed only one-to-one, but as a result either the "key" or the "value" could do lookup in O(1) time with the only overhead being the additional memory overhead of O(2N) as many references. Calling the object type "bimap", this could be easily implemented by simply having a call to bimap.inverse[value]=key, where the 'inverse' keyword is a reference table to the value-->key references. This is an important enhancement because currently the most efficient way to implement this is python is to, either: (1) make a custom object type that keeps two dictionaries, one that maps v->k and one that maps k->v, which takes twice as much memory, or (2) an object that has a custom "inverse" lookup call, which will be slower than O(1). In both cases there is no implicit enforcement of values being unique (necessary for a bijection). This should be added to the `collections` library as it will fit well along side other unique hashed collections such as "OrderedDict" This will be beneficial to the community because transformations between semantic spaces (e.g. things that cannot be done in NumPy or similar) could be much more efficient and have cleaner, easier to read code if bijection maps were native and used one structure instead of two dictionaries. ---------- components: Interpreter Core messages: 416304 nosy: jon.balloch priority: normal severity: normal status: open title: bijective invertible map type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:16:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 22:16:32 +0000 Subject: [issue43881] [doc] add platform availabity information for os.sched_getaffinity In-Reply-To: <1648592124.17.0.841534850127.issue43881@roundup.psfhosted.org> Message-ID: <1648592192.73.0.142450845046.issue43881@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: add platform availabity information for os.sched_getaffinity -> [doc] add platform availabity information for os.sched_getaffinity _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:25:36 2022 From: report at bugs.python.org (Guo Ci Teo) Date: Tue, 29 Mar 2022 22:25:36 +0000 Subject: [issue43881] [doc] add platform availabity information for os.sched_getaffinity In-Reply-To: <1648592124.17.0.841534850127.issue43881@roundup.psfhosted.org> Message-ID: <1648592736.6.0.356157177569.issue43881@roundup.psfhosted.org> Guo Ci Teo added the comment: `os.sched_getaffinity` is only available on some Unix platforms, as documented in https://docs.python.org/dev/library/os.html#interface-to-the-scheduler For example, on Windows we will get the error: AttributeError: module 'os' has no attribute 'sched_getaffinity' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 18:42:20 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Mar 2022 22:42:20 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648593740.55.0.744950197941.issue47145@roundup.psfhosted.org> Eric V. Smith added the comment: My personal usage of a topological sort are restricted to maybe 100 entries max, so I can't really test this in any meaningful way. That, and the project that uses it is stuck on 3.6, so I haven't switched to the graphlib version yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:03:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Mar 2022 23:03:23 +0000 Subject: [issue30479] improve asyncio debugging In-Reply-To: <1495787022.39.0.794943633831.issue30479@psf.upfronthosting.co.za> Message-ID: <1648595003.19.0.067428888101.issue30479@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:06:45 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 29 Mar 2022 23:06:45 +0000 Subject: [issue47157] bijective invertible map In-Reply-To: <1648592127.3.0.298910668675.issue47157@roundup.psfhosted.org> Message-ID: <1648595205.33.0.411535760983.issue47157@roundup.psfhosted.org> Dennis Sweeney added the comment: see also https://bugs.python.org/issue44931 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:48:23 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 29 Mar 2022 23:48:23 +0000 Subject: [issue30479] improve asyncio debugging In-Reply-To: <1495787022.39.0.794943633831.issue30479@psf.upfronthosting.co.za> Message-ID: <1648597703.96.0.959410060045.issue30479@roundup.psfhosted.org> Andrew Svetlov added the comment: asyncio doesn't crash with scary messages like "AttributeError: 'NoneType' object has no attribute '_PENDING'" now. Checked with Python 3.9+ ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 19:56:50 2022 From: report at bugs.python.org (Enji Cooper) Date: Tue, 29 Mar 2022 23:56:50 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception Message-ID: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> New submission from Enji Cooper : Something I noticed when trying to repro another issue: % python Python 3.8.13 (default, Mar 16 2022, 17:28:59) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import logging.handlers >>> logging.handlers.SysLogHandler(address=("something-completely-bogus-doncha-know", 514)) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/logging/handlers.py", line 829, in __init__ ress = socket.getaddrinfo(host, port, 0, socktype) File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known >>> Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python3.8/logging/__init__.py", line 2127, in shutdown h.close() File "/usr/lib/python3.8/logging/handlers.py", line 892, in close self.socket.close() AttributeError: 'SysLogHandler' object has no attribute 'socket' % python3.9 Python 3.9.11 (main, Mar 16 2022, 17:27:06) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import logging.handlers >>> logging.handlers.SysLogHandler(address=("something-completely-bogus-doncha-know", 514)) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/logging/handlers.py", line 873, in __init__ ress = socket.getaddrinfo(host, port, 0, socktype) File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known >>> Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 2142, in shutdown h.close() File "/usr/lib/python3.9/logging/handlers.py", line 936, in close self.socket.close() AttributeError: 'SysLogHandler' object has no attribute 'socket' This is happening because logging.Handler is calling logging._addHandlerRef in logging.Handler.__init__ and _removeHandlerRef at exit via logging.shutdown(..). ---------- components: Library (Lib) messages: 416309 nosy: ngie priority: normal severity: normal status: open title: logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:35:53 2022 From: report at bugs.python.org (Logan Jones) Date: Wed, 30 Mar 2022 00:35:53 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1648600553.4.0.220408972936.issue44733@roundup.psfhosted.org> Logan Jones added the comment: Okay, I'm actually able to work on this again. What is the best way to make this change real. Should I be working off of main? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:42:41 2022 From: report at bugs.python.org (Stanley) Date: Wed, 30 Mar 2022 00:42:41 +0000 Subject: [issue32658] Metacharacter (\) documentation suggestion In-Reply-To: <1516838461.29.0.467229070634.issue32658@psf.upfronthosting.co.za> Message-ID: <1648600961.84.0.847086082903.issue32658@roundup.psfhosted.org> Stanley added the comment: Feel free, it's all yours ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:44:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 30 Mar 2022 00:44:14 +0000 Subject: [issue47157] bijective invertible map In-Reply-To: <1648592127.3.0.298910668675.issue47157@roundup.psfhosted.org> Message-ID: <1648601054.61.0.596040345322.issue47157@roundup.psfhosted.org> Raymond Hettinger added the comment: This is indeed a duplicate. If needed just use one of implementations on PyPI https://pypi.org/project/bidict/ ---------- nosy: +rhettinger resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:58:25 2022 From: report at bugs.python.org (Rukchad Wongprayoon) Date: Wed, 30 Mar 2022 00:58:25 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? In-Reply-To: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> Message-ID: <1648601905.02.0.449952576558.issue47148@roundup.psfhosted.org> Rukchad Wongprayoon added the comment: maybe try on windows? due to i did this on windows ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:59:01 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 30 Mar 2022 00:59:01 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1648601941.09.0.960649367993.issue44733@roundup.psfhosted.org> Gregory P. Smith added the comment: yep, branch off of a recent main. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 20:59:30 2022 From: report at bugs.python.org (Andre Roberge) Date: Wed, 30 Mar 2022 00:59:30 +0000 Subject: [issue47156] IDLE: make use of extended SyntaxError info. In-Reply-To: <1648591853.36.0.0695463785531.issue47156@roundup.psfhosted.org> Message-ID: <1648601970.44.0.81696274588.issue47156@roundup.psfhosted.org> Andre Roberge added the comment: > (Anyone really want log of error?) If by this you mean having access to the error from a known place (like sys.last_traceback or something else specific to IDLE but available from a script), then the answer from me is definitely yes. ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:23:35 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 30 Mar 2022 01:23:35 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648603415.23.0.182907635921.issue47151@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +30263 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:33:14 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 30 Mar 2022 01:33:14 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648603994.79.0.564427038861.issue47151@roundup.psfhosted.org> Gregory P. Smith added the comment: Any possibility that you can test the attached PR as pid 1? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:55:07 2022 From: report at bugs.python.org (=?utf-8?q?Gr=C3=A9gory_Starck?=) Date: Wed, 30 Mar 2022 01:55:07 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648605307.8.0.612727066066.issue47158@roundup.psfhosted.org> Gr?gory Starck added the comment: I think this is fixed in main, thanks to this: https://github.com/python/cpython/blob/main/Lib/logging/handlers.py#L862-L863 ---------- nosy: +gstarck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 21:55:28 2022 From: report at bugs.python.org (Logan Jones) Date: Wed, 30 Mar 2022 01:55:28 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1648605328.49.0.0758155052201.issue44733@roundup.psfhosted.org> Change by Logan Jones : ---------- pull_requests: +30264 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 22:07:52 2022 From: report at bugs.python.org (Enji Cooper) Date: Wed, 30 Mar 2022 02:07:52 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648606072.11.0.878945377911.issue47158@roundup.psfhosted.org> Enji Cooper added the comment: Yup! Looks like it! Just needs a back port. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 23:06:28 2022 From: report at bugs.python.org (Jonathan Balloch) Date: Wed, 30 Mar 2022 03:06:28 +0000 Subject: [issue47157] bijective invertible map In-Reply-To: <1648601054.61.0.596040345322.issue47157@roundup.psfhosted.org> Message-ID: Jonathan Balloch added the comment: thank you!! On Tue, Mar 29, 2022 at 8:44 PM Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > This is indeed a duplicate. If needed just use one of implementations on > PyPI https://pypi.org/project/bidict/ > > ---------- > nosy: +rhettinger > resolution: -> duplicate > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 29 23:26:27 2022 From: report at bugs.python.org (Ma Lin) Date: Wed, 30 Mar 2022 03:26:27 +0000 Subject: [issue47152] Reorganize the re module sources In-Reply-To: <1648569272.18.0.653641722475.issue47152@roundup.psfhosted.org> Message-ID: <1648610787.1.0.0880857472188.issue47152@roundup.psfhosted.org> Ma Lin added the comment: Please don't merge too close to the 3.11 beta1 release date, I'll submit PRs after this merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 01:50:51 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 30 Mar 2022 05:50:51 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648619451.2.0.22357522662.issue47145@roundup.psfhosted.org> Dennis Sweeney added the comment: Out of curiosity, what are the use cases for adding nodes after get_ready has already produced nodes? I was wondering about avoiding the need to call prepare() by having it automatically do the cycle-checking at the first get_ready() call and then raising ValueError if add() is called any time thereafter. Assuming we do want to be able to add() after a get_ready(), is there a reason that "forgetting" already-produced nodes is the correct behavior, as opposed to remembering all nodes ever added, and raising iff the addition creates a cycle among all nodes ever added or depends on an already-yielded node? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 01:54:44 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 30 Mar 2022 05:54:44 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648619684.45.0.933249845016.issue47145@roundup.psfhosted.org> Dennis Sweeney added the comment: > depends on an already-yielded node I mean "creates a new not-yet-yielded dependency for an already-yielded node". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 02:06:50 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 30 Mar 2022 06:06:50 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648620410.18.0.679764336431.issue47145@roundup.psfhosted.org> Larry Hastings added the comment: I'm using my graph library to manage a list of tasks that need doing in some sort of proper order. One task may spawn other tasks at runtime, and we don't necessarily know what the tasks will be until runtime. It's way more convenient to simply add such tasks on demand, rather than trying to preemptively pre-add all such possible tasks before preparing the graph, or creating additional graphs. For example, consider a tool that downloads and digests zip files full of music from an online store. Your initial tasks might represent "download the zip file", then "decompress and examine the contents of the zip file". You could then iterate over the contents of the zip file, adding different tasks based on what you find--one pipeline of tasks for media files (FLAC/MP3/OGG/etc), another for the playlist, a third if you don't *find* a playlist, a fourth for image files, etc. (Not that you'd necessarily write such a tool this way, but it's at least plausible.) The new nodes needn't be connected to the existing nodes for this to still be useful. You could reuse the same graph object for all your tasks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 02:29:14 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 30 Mar 2022 06:29:14 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648621754.87.0.937860195959.issue47145@roundup.psfhosted.org> Larry Hastings added the comment: > Assuming we do want to be able to add() after a get_ready(), is there > a reason that "forgetting" already-produced nodes is the correct > behavior, as opposed to remembering all nodes ever added, and > raising iff the addition creates a cycle among all nodes ever > added or depends on an already-yielded node? I'm not sure "correct" applies here, because I don't have a sense that one behavior is conceptually more correct than the other. But in implementing my API change, forgetting about the done nodes seemed more practical. The "benefit" to remembering done nodes: the library can ignore dependencies to them in the future, forever. Adding a dependency to a node that's already been marked as "done" doesn't make much conceptual sense to me, but as a practical thing maybe it's useful? I'm not sure, but it doesn't seem all that useful. I can only come up with a marginal reason why remembering done nodes is useful. Let's say all your tasks fan out from some fundamental task, like "download master list of work" or something. One of your tasks might discover additional tasks that need to run, and conceptually those tasks might depend on your "download master list of work" task. If the graph remembers the done list forever, then adding that dependency is harmless. If the graph forgets about done nodes, then adding that dependency could re-introduce that task to the graph, which could goof things up. So maybe it's a little bit of a footgun? But on the other hand: you already know you're running, and you're a task that was dependent on the master list of work, which means you implicitly know that dependency has been met. So just skip adding the redundant dependency and you're fine. On the other hand, forgetting about the nodes has a definite practical benefit: the graph consumes less memory. If you use a graph object for a long time, the list of done nodes it's holding references to would continue to grow and grow and grow. If we forget about done nodes, we free up all that memory, and done membership testing maybe gets faster. I guess I'm not married to the behavior. If someone had a great conceptual or practical reason why remembering the done nodes forever was better, I'd be willing to listen to reason. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 02:35:35 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2022 06:35:35 +0000 Subject: [issue46864] Deprecate ob_shash in BytesObject In-Reply-To: <1645865345.09.0.509753942233.issue46864@roundup.psfhosted.org> Message-ID: <1648622135.21.0.255157244279.issue46864@roundup.psfhosted.org> Christian Heimes added the comment: New changeset d8f530fe329c6bd9ad6e1a9db9aa32b465c2d67f by Christian Heimes in branch 'main': bpo-46864: Suppress even more ob_shash deprecation warnings (GH-32176) https://github.com/python/cpython/commit/d8f530fe329c6bd9ad6e1a9db9aa32b465c2d67f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:03:56 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 30 Mar 2022 07:03:56 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648623836.66.0.145005211582.issue44090@roundup.psfhosted.org> G?ry added the comment: By the way: > I don't think we need two ways to do it. So do you think we could drop the support for single-argument super? Michele said in his article: > There is a single use case for the single argument syntax of super that I am aware of, but I think it gives more troubles than advantages. The use case is the implementation of autosuper made by Guido on his essay about new-style classes. > If it was me, I would just remove the single argument syntax of super, making it illegal. But this would probably break someone code, so I don't think it will ever happen in Python 2.X. I did ask on the Python 3000 mailing list about removing unbound super object (the title of the thread was let's get rid of unbound super) and this was Guido's reply: >> Thanks for proposing this -- I've been scratching my head wondering what the use of unbound super() would be. :-) I'm fine with killing it -- perhaps someone can do a bit of research to try and find out if there are any real-life uses (apart from various auto-super clones)? --- Guido van Rossum > Unfortunaly as of now unbound super objects are still around in Python 3.0, but you should consider them morally deprecated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:10:37 2022 From: report at bugs.python.org (Bruce Merry) Date: Wed, 30 Mar 2022 07:10:37 +0000 Subject: [issue47149] DatagramHandler doing DNS lookup on every log message In-Reply-To: <1648543639.58.0.923135953431.issue47149@roundup.psfhosted.org> Message-ID: <1648624237.0.0.462484117768.issue47149@roundup.psfhosted.org> Bruce Merry added the comment: > But it's going to be non-trivial, I fear. Yeah. Maybe some documentation is achievable in the short term though, so that users who care more about latency than changing DNS are aware that they should do the lookup themselves? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:23:55 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2022 07:23:55 +0000 Subject: [issue47152] Reorganize the re module sources In-Reply-To: <1648569272.18.0.653641722475.issue47152@roundup.psfhosted.org> Message-ID: <1648625035.16.0.237293362239.issue47152@roundup.psfhosted.org> Serhiy Storchaka added the comment: It turns out that pip uses sre_constants in its copy of pyparsing. The problem is already fixed in the upstream of pyparsing and soon should be fixed in pip. We still need to keep sre_constants and maybe other sre_* modules, but deprecate them. > Could the sre_parse and sre_constants modules be kept with public names (i.e. without the leading underscore) but within the re namespace? It is a good idea which will allow to minimize breakage in short term. You can write "from re import sre_parse", and it would work in old and new versions because sre_parse and sre_compile were imported in the re module. This trick does not work with sre_constants, you still need try/except. But the code that depends on these modules is fragile and can be broken by other ways. > Please don't merge too close to the 3.11 beta1 release date, I'll submit PRs after this merged. I am going to implement step 2 only after merging your changes for issue23689. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 03:25:56 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 30 Mar 2022 07:25:56 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1648625156.52.0.0183797354699.issue47000@roundup.psfhosted.org> Inada Naoki added the comment: @vstiner Since UTF-8 mode affects `locale.getpreferredencoding(False)`, I need to decide alternative API in the PEP 686. If no objections, I will choose `locale.get_encoding()` for current locale encoding (ACP on Windows). See https://github.com/python/peps/pull/2470/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 04:11:04 2022 From: report at bugs.python.org (Ma Lin) Date: Wed, 30 Mar 2022 08:11:04 +0000 Subject: [issue23689] Memory leak in Modules/sre_lib.h In-Reply-To: <1426611380.23.0.46113718722.issue23689@psf.upfronthosting.co.za> Message-ID: <1648627864.73.0.700643491069.issue23689@roundup.psfhosted.org> Change by Ma Lin : ---------- pull_requests: +30265 pull_request: https://github.com/python/cpython/pull/32188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 04:52:05 2022 From: report at bugs.python.org (Ma Lin) Date: Wed, 30 Mar 2022 08:52:05 +0000 Subject: [issue47152] Reorganize the re module sources In-Reply-To: <1648569272.18.0.653641722475.issue47152@roundup.psfhosted.org> Message-ID: <1648630325.13.0.972542834169.issue47152@roundup.psfhosted.org> Change by Ma Lin : ---------- pull_requests: +30266 pull_request: https://github.com/python/cpython/pull/32188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 05:40:35 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 30 Mar 2022 09:40:35 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1648625156.52.0.0183797354699.issue47000@roundup.psfhosted.org> Message-ID: <89a3f459-ac9e-a4d5-e31c-686eecd0f86d@egenix.com> Marc-Andre Lemburg added the comment: Please see https://bugs.python.org/issue47000#msg415769 for what Victor suggested. In particular, the locale module uses the "no underscore" convention. Not sure whether it's good to start using snake case now, but I'm also not against it. I would like to reiterate my concern with the "locale" encoding, though. As mentioned earlier, I believe it adds too much magic. It would be better to leave this in the hands of the applications and not try to guess the correct encoding. It's better to expose easy to use APIs to access the various different settings and point users to those rather than try to do a best effort guess... explicit is better than implicit. After all, Mojibake potentially corrupts important data, without the alerting the user and that's not really what we should be after (e.g. UTF-8 is valid Latin-1 in most cases and this is a real problem we often run into in Germany with our Umlauts). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 05:53:14 2022 From: report at bugs.python.org (Harsh Patel) Date: Wed, 30 Mar 2022 09:53:14 +0000 Subject: [issue47159] multiprocessing.pool.Pool.apply block infinitely when stressed while using maxtasksperchild Message-ID: <1648633994.35.0.529736180567.issue47159@roundup.psfhosted.org> New submission from Harsh Patel : We have a long-running process, which uses thread pool to get tasks and these threads then schedule the tasks and send them to multiprocessing.Pool (with maxtasksperchild limit set) using apply function. The original codebase is large but I have extracted this logic into a simple script for convenience so that you can see the issue. The issue is that after sometime the apply function call gets blocked infinitely. This only happens when we use maxtasksperchild and cause the library for multiple process recreation. How script works: Script creates an object of the Manager class which is responsible for creating a pool of threads and creating multiprocessing pool. Each thread is provided jobs to execute which is done by Scheduler.get_ready_jobs function call. I have designed this function in a way that 100 jobs are returned after every 5 calls to this function else it returns no jobs. Each thread while performing job sends processing_func to multiprocessing pool for execution which just prints "processing something" and exits. Environment: Python 3.7.10 Clang 12.0.5 MacOS v11.6 intel Steps to reproduce: 1. Download the attached Python script and execute it 2. Let it run for 10-15 seconds and interrupt the execution You will notice that some threads will exit successfully but for some, you will see the last message printed is "executing cpu_pool apply " which indicates these threads are blocked even though the actual processing_func is just calling a print function. Warning: You will also not be able to exit the process without killing it. As a note, this is my first Python issue report so please let me know if you need more information. ---------- components: Library (Lib) files: example.py messages: 416331 nosy: davin, harsh8398, pitrou priority: normal severity: normal status: open title: multiprocessing.pool.Pool.apply block infinitely when stressed while using maxtasksperchild type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file50706/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:09:07 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 30 Mar 2022 10:09:07 +0000 Subject: [issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled. In-Reply-To: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> Message-ID: <1648634947.89.0.516881366684.issue47000@roundup.psfhosted.org> Inada Naoki added the comment: > Please see https://bugs.python.org/issue47000#msg415769 for what Victor > suggested. Of course, I read it. > In particular, the locale module uses the "no underscore" convention. > Not sure whether it's good to start using snake case now, but I'm also > not against it. Victor didn't mention about "no underscore" convention. I just want to see preference from others. I will remove the underscore. > I would like to reiterate my concern with the "locale" encoding, though. > > As mentioned earlier, I believe it adds too much magic. It would be better > to leave this in the hands of the applications and not try to guess > the correct encoding. I don't recommend to use "locale" encoding for users. I strongly recommend to consider using "utf-8" instead. But "locale" encoding is needed when user don't want to change behavior of current application. It had been accepted by PEP 597 already. > It's better to expose easy to use APIs to access the various different > settings and point users to those rather than try to do a best effort > guess... explicit is better than implicit. In some case, user need to decide "not change the encoding for now". If we don't provide "locale", it's difficult to change the default encoding to UTF-8. > After all, Mojibake potentially corrupts important data, without the > alerting the user and that's not really what we should be after (e.g. > UTF-8 is valid Latin-1 in most cases and this is a real problem we often > run into in Germany with our Umlauts). Changing the default encoding will temporary increase this risk. But after changing the default encoding to UTF-8, this risk will be reduced overwhelmingly. Most popular text editors, including VSCode, Atom, Sublime Text, Notepad.exe use UTF-8 by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:45:33 2022 From: report at bugs.python.org (ATUL VISHAL) Date: Wed, 30 Mar 2022 10:45:33 +0000 Subject: [issue47160] round function is not working as expected Message-ID: <1648637133.45.0.989235445931.issue47160@roundup.psfhosted.org> New submission from ATUL VISHAL : round function is not working as expected . my number is x= 0.967565*185000= 178999.525 round(x,2) answer is coming as 178999.52 expected value is 178999.53 ---------- components: Library (Lib) files: compiled_result.jpg messages: 416333 nosy: vishalatul09 priority: normal severity: normal status: open title: round function is not working as expected type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file50707/compiled_result.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:47:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 10:47:43 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648637263.03.0.561762973248.issue47151@roundup.psfhosted.org> STINNER Victor added the comment: > Any possibility that you can test the attached PR as pid 1? Python should be built as a static binary and can be used as the init process on the kernel command line, no? I'm not sure that "static binary" is a requirement, since I'm commonly using init=/usr/bin/bash to fix a broken Linux, and on my Fedora, this program is "dynamically linked". Who uses Python as pid 1? I'm now curious :-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:55:06 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 30 Mar 2022 10:55:06 +0000 Subject: [issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS In-Reply-To: <1648296993.82.0.182445504362.issue47127@roundup.psfhosted.org> Message-ID: <1648637706.33.0.880699990366.issue47127@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 06:55:37 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 30 Mar 2022 10:55:37 +0000 Subject: [issue46429] Merge all deepfrozen files into one In-Reply-To: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> Message-ID: <1648637737.75.0.830118797485.issue46429@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:00:33 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 30 Mar 2022 11:00:33 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648638033.4.0.273883717894.issue47126@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6881ea936e277b1733bee581c4e59e3a5d53bb29 by Hugo van Kemenade in branch 'main': bpo-47126: Update to canonical PEP URLs specified by PEP 676 (GH-32124) https://github.com/python/cpython/commit/6881ea936e277b1733bee581c4e59e3a5d53bb29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:01:52 2022 From: report at bugs.python.org (Jan Bronicki) Date: Wed, 30 Mar 2022 11:01:52 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths Message-ID: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> New submission from Jan Bronicki : The `//` path should be equivalent to `/`, and in some ways, it does behave like that in pathlib. But in the `relative_to` method on a `Path` object, it does not work This is causing our CI pipeline to fail. In the documentation here you can see `//` being properly processed: https://docs.python.org/3/library/pathlib.html ```python In [10]: x=Path("/Library/Video") ; x.relative_to(Path("/")) Out[10]: PosixPath('Library/Video') In [11]: x=Path("//Library/Video") ; x.relative_to(Path("/")) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [11], in () ----> 1 x=Path("//Library/Video") ; x.relative_to(Path("/")) File ~/.pyenv/versions/3.8.13/lib/python3.8/pathlib.py:908, in PurePath.relative_to(self, *other) 906 if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts): 907 formatted = self._format_parsed_parts(to_drv, to_root, to_parts) --> 908 raise ValueError("{!r} does not start with {!r}" 909 .format(str(self), str(formatted))) 910 return self._from_parsed_parts('', root if n == 1 else '', 911 abs_parts[n:]) ValueError: '//Library/Video' does not start with '/' ``` ---------- components: Library (Lib) messages: 416336 nosy: John15321 priority: normal severity: normal status: open title: pathlib method relative_to doesnt work with // in paths type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:04:59 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 30 Mar 2022 11:04:59 +0000 Subject: [issue47160] round function is not working as expected In-Reply-To: <1648637133.45.0.989235445931.issue47160@roundup.psfhosted.org> Message-ID: <1648638299.31.0.152847329174.issue47160@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is documented https://docs.python.org/3/library/functions.html#round > The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: it?s a result of the fact that most decimal fractions can?t be represented exactly as a float. See Floating Point Arithmetic: Issues and Limitations for more information. ---------- nosy: +xtreak resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:10:24 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 30 Mar 2022 11:10:24 +0000 Subject: [issue34861] Improve cProfile standard output In-Reply-To: <1538392397.89.0.545547206417.issue34861@psf.upfronthosting.co.za> Message-ID: <1648638624.29.0.438438855773.issue34861@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 75eee1d57eb28283a8682a660d9949afc89fd010 by Dani?l van Noord in branch 'main': bpo-34861: Make cumtime the default sorting key for cProfile (GH-31929) https://github.com/python/cpython/commit/75eee1d57eb28283a8682a660d9949afc89fd010 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:11:40 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2022 11:11:40 +0000 Subject: [issue47162] Add call trampoline to work around bad fpcasts on Emscripten Message-ID: <1648638700.22.0.607965445304.issue47162@roundup.psfhosted.org> New submission from Christian Heimes : WASM cannot handle function calls with bad function pointer casts yet. Hood Chatham explained the issue in Pyodide patch https://github.com/pyodide/pyodide/blob/0.19.1/cpython/patches/0001-call-trampolines-to-handle-fpcast-troubles.patch --- The wasm call_indirect instruction takes a function signature as an immediate argument (an immediate argument is one which is determined statically at compile time). The web assembly runtime checks at runtime that the function pointer we are attempting to call has a signature which matches the asserted function signature, if they don't match, the runtime traps with "indirect call signature mismatch". The codegen provided by default by the emscripten toolchain produces an ABI that also has this constraint. By contrast, typical native ABIs handle function pointer casts very gracefully: extra arguments are ignored, missing arguments are filled in as 0, even wrong return values are completely fine. The Python ecosystem is full of code which contain function pointer casts. Emscripten offers a second "EMULATE_FPCASTS" ABI that fixes many of these issues, but it shims in the function pointer cast support in a binaryen pass that happens on the fully linked wasm module. At this point, lots of information has been destroyed and as a result the only possible solutions are extremely costly in run time, stack space, and code size. We wish to avoid these costs. Patching the packages is prohibitively time consuming and boring, especially given our limited developer effort. I have explored making automated detection tools, and these work. However, getting these tools included into the CI of Python ecosystem packages would be prohibitively time consuming. There is a best of both worlds solution. It is possible to define an ABI which allows for specific types of function pointer casts with neglible costs. I hope to do this in future work. However, this will require custom llvm passes. Because llvm is implemented in C++ which has very poor ABI compatibility, this means our whole toolchain needs to be built against the same version of llvm, from llvm all the way down to binaryen and the wasm binary toolkit. In the meantime, most bad function pointer calls happen in a small number of locations. Calling a function pointer from Javascript has no restrictions on arguments. Extra arguments can be provided, arguments can be left off, etc with no issue (this mimics Javascript's typical function call semantics). So at the locations where the bad calls occur, we patch in a trampoline which calls out to Javascript to make the call for us. Like magic, the problem is gone. Research shows that the performance cost of this is surprisingly low too. --- Bad function pointer casts lead to fatal runtime errors like this: worker.js onmessage() captured an uncaught exception: RuntimeError: function signature mismatch RuntimeError: function signature mismatch at create_builtin (:wasm-function[3512]:0x14f6df) at _imp_create_builtin (:wasm-function[3520]:0x14fe1d) at cfunction_vectorcall_O (:wasm-function[1871]:0x91e84) at _PyVectorcall_Call (:wasm-function[839]:0x4e220) at _PyObject_Call (:wasm-function[842]:0x4e4f5) at PyObject_Call (:wasm-function[843]:0x4e595) at _PyEval_EvalFrameDefault (:wasm-function[3114]:0x120541) at _PyEval_Vector (:wasm-function[3115]:0x1229ab) at _PyFunction_Vectorcall (:wasm-function[845]:0x4e6ca) at object_vacall (:wasm-function[859]:0x4f3d0) worker sent an error! undefined:undefined: function signature mismatch I propose to include the downstream patch from Pyodide but make the call trampoline feature opt-in. An opt-in allows Pyodide to use the trampolines in production while we can test core and 3rd party modules without the trampoline easily. ---------- components: Interpreter Core messages: 416339 nosy: christian.heimes priority: normal severity: normal status: open title: Add call trampoline to work around bad fpcasts on Emscripten type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:12:15 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2022 11:12:15 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1648638735.79.0.980935452156.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +Add call trampoline to work around bad fpcasts on Emscripten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:49:35 2022 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 30 Mar 2022 11:49:35 +0000 Subject: [issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used Message-ID: <1648640975.38.0.120656824245.issue47163@roundup.psfhosted.org> New submission from Ned Batchelder : In this code, the same regex is compiled with and without re.VERBOSE. Without, it compiles fine. With, it fails with an "unterminated subpattern" error. list_num_rx1 = r"""(?P\()?(\d+|#|[a-z])(?(paren)\)|\.)""" list_num_rx2 = r"""(?x)(?P\()?(\d+|#|[a-z])(?(paren)\)|\.)""" # This works: re.compile(list_num_rx1) # Either of these fails: re.compile(list_num_rx1, flags=re.VERBOSE) re.compile(list_num_rx2) (What I really wanted was this, but the error happens without the multiline string:) list_num_rx = r"""(?x) (?P\()? # maybe an opening paren (\d+|#|[a-z]) # the number: 123, or #, or a-z (?(paren) # if we had an opening paren.. \)| # then we need a closing paren \. # otherwise a dot. ) """ ---------- components: Regular Expressions messages: 416340 nosy: ezio.melotti, mrabarnett, nedbat priority: normal severity: normal status: open title: "unterminated subpattern" in valid regex if re.VERBOSE is used _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:54:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Mar 2022 11:54:41 +0000 Subject: [issue39114] Python 3.9.0a2 changed how finally/return is traced In-Reply-To: <1576935645.82.0.331239443144.issue39114@roundup.psfhosted.org> Message-ID: <1648641281.87.0.54328182326.issue39114@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:57:41 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 30 Mar 2022 11:57:41 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648641461.22.0.952197492014.issue47126@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 Mar 30 07:57:51 2022 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 30 Mar 2022 11:57:51 +0000 Subject: [issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used In-Reply-To: <1648640975.38.0.120656824245.issue47163@roundup.psfhosted.org> Message-ID: <1648641471.69.0.978454154521.issue47163@roundup.psfhosted.org> Ned Batchelder added the comment: I realized my mistake... never mind! ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:57:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 30 Mar 2022 11:57:53 +0000 Subject: [issue47126] Update to canonical PEP URLs In-Reply-To: <1648289778.45.0.505813161282.issue47126@roundup.psfhosted.org> Message-ID: <1648641473.28.0.53447404952.issue47126@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:58:01 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 11:58:01 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648641481.0.0.996944530792.issue47161@roundup.psfhosted.org> Oleg Iarygin added the comment: I started to investigate and found that a double slash in the beginning cancels any parsing of a path: >>> Path("//Library/Video")._parts ['\\\\Library\\Video\\'] vs >>> Path("/Library/Video")._parts ['\\', 'Library', 'Video'] Investigating further. ---------- nosy: +arhadthedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:58:40 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2022 11:58:40 +0000 Subject: [issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used In-Reply-To: <1648640975.38.0.120656824245.issue47163@roundup.psfhosted.org> Message-ID: <1648641520.88.0.0464558982829.issue47163@roundup.psfhosted.org> Serhiy Storchaka added the comment: "#" in VERBOSE mode starts a comment and skips to the end of the line. Escape it: "\#". ---------- nosy: +serhiy.storchaka resolution: not a bug -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 07:59:31 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Mar 2022 11:59:31 +0000 Subject: [issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used In-Reply-To: <1648640975.38.0.120656824245.issue47163@roundup.psfhosted.org> Message-ID: <1648641571.75.0.516491169384.issue47163@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:11:45 2022 From: report at bugs.python.org (=?utf-8?q?Gr=C3=A9gory_Starck?=) Date: Wed, 30 Mar 2022 12:11:45 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648642305.31.0.494771594497.issue47158@roundup.psfhosted.org> Gr?gory Starck added the comment: I guess it could be done relatively easily. but the question is more: should it be done ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:15:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 30 Mar 2022 12:15:14 +0000 Subject: [issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0) In-Reply-To: <1581577789.38.0.529951784345.issue39622@roundup.psfhosted.org> Message-ID: <1648642514.06.0.680802918275.issue39622@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset f08a191882f75bb79d42a49039892105b2212fb9 by Andrew Svetlov in branch 'main': bpo-39622: Interrupt the main asyncio task on Ctrl+C (GH-32105) https://github.com/python/cpython/commit/f08a191882f75bb79d42a49039892105b2212fb9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:15:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2022 12:15:50 +0000 Subject: [issue47162] Add call trampoline to work around bad fpcasts on Emscripten In-Reply-To: <1648638700.22.0.607965445304.issue47162@roundup.psfhosted.org> Message-ID: <1648642550.9.0.155014553019.issue47162@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30267 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:16:00 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 30 Mar 2022 12:16:00 +0000 Subject: [issue39622] Handle KeyboardInterrupt in asyncio In-Reply-To: <1581577789.38.0.529951784345.issue39622@roundup.psfhosted.org> Message-ID: <1648642560.14.0.790184143289.issue39622@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: KeyboardInterrupt is ignored when await asyncio.sleep(0) -> Handle KeyboardInterrupt in asyncio versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:24:29 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 12:24:29 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648643069.16.0.36018690547.issue47161@roundup.psfhosted.org> Oleg Iarygin added the comment: As I found out, any path starting with two double slashes is treated as an UNC (network) path: vvvvvvvvvvvvvvvvvvvv root \\machine\mountpoint\directory\etc\... directory ^^^^^^^^^^^^^^^^^ So "/Library/Video" and "/" are directories mounted on your machine while "//Library/Video" is a computer named "Library" with a share named "Video". However, an error message in Python 3.8 (as a file path suggests) is misleading. In 3.11 it was changed to "'\\Library\Video\' is not in the subpath of '\' OR one path is relative and the other is absolute." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:27:29 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 30 Mar 2022 12:27:29 +0000 Subject: [issue24837] await process.wait() does not work with a new_event_loop In-Reply-To: <1439199038.24.0.690620901041.issue24837@psf.upfronthosting.co.za> Message-ID: <1648643249.97.0.0704192563214.issue24837@roundup.psfhosted.org> Kumar Aditya added the comment: @asvetlov This is bug no longer exists, on main branch this is the output and it does not hangs: DEBUG:asyncio:Using selector: EpollSelector True ---------- nosy: +asvetlov, kumaraditya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:28:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 12:28:10 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code Message-ID: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> New submission from STINNER Victor : Last years, I started to add "CAST" macros like: #define _PyObject_CAST(op) ((PyObject*)(op)) #define _PyType_CAST(op) (assert(PyType_Check(op)), (PyTypeObject*)(op)) Example of usage: #define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type) These macros avoids parenthesis. Example without CAST macro: #define PyCFunction_GET_FLAGS(func) \ (((PyCFunctionObject *)func) -> m_ml -> ml_flags) Currently, inline cast requires adding parenthesis: ((PyCFunctionObject *)func) IMO it's more readable with a CAST macro: #define _PyCFunction_CAST(func) ((PyCFunctionObject *)func) #define PyCFunction_GET_FLAGS(func) \ (_PyCFunction_CAST(func)->m_ml->ml_flags) I propose to add more CAST macros. By the way, the current Python C API is not fully compatible with C++. "(type)expr" C syntax is seen as "old-style cast" in C++ which recommends static_cast(expr), reinterpret_cast(expr), or another kind of cast. But I prefer to discuss C++ in a separated issue ;-) IMO without considering C++, adding CAST macros is worth it for readability. I am preparing pull requests for add CAST macros and use existing CAST macros. ---------- components: C API messages: 416350 nosy: vstinner priority: normal severity: normal status: open title: [C API] Add private "CAST" macros to clean up casts in C code versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:37:23 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 12:37:23 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648643843.59.0.488037584004.issue47161@roundup.psfhosted.org> Oleg Iarygin added the comment: Also, the error message cannot be fixed because for 3.8 only security fixes are accepted since May 2021. For 3.9 and later, the message is already corrected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:44:01 2022 From: report at bugs.python.org (Jan Bronicki) Date: Wed, 30 Mar 2022 12:44:01 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648644241.57.0.0638484303769.issue47161@roundup.psfhosted.org> Jan Bronicki added the comment: But shouldn't it just work with `//` as a `/`? It seems like this is the behavior elsewhere. Sure I get that it cannot be done for 3.8. But the new error message implies that either `//` is not a subpath of `/` which it is, or that one is relative and the other is absolute, which is also false because both are absolutes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 08:49:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 12:49:50 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648644590.72.0.284245080274.issue47164@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +30268 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:16:10 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 30 Mar 2022 13:16:10 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648646170.61.0.811459489208.issue47164@roundup.psfhosted.org> Mark Shannon added the comment: I think that adding macros makes readability worse. The macro is only more readable if you already know what it does. If you don't, then you need to look up the macro, and understand the cast in the macro (which is harder than understanding the original cast). In general, I find the excessive use of macros and tiny inline function obscures the meaning of code, and makes it hard to reason about what the code is doing. A few well chosen macros (like Py_INCREF(), etc) can definitely help readability, but if there are too many then anyone reading the code ends up having to lookup loads of macro definitions to understand the code. Without the macro, the reader needs to parse the cast, which is admittedly a ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:20:34 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 30 Mar 2022 13:20:34 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648646434.7.0.019781167108.issue47164@roundup.psfhosted.org> Mark Shannon added the comment: The problem in the example you give is the need for the cast in the first place. If `func` were a `PyCFunctionObject *` instead of a `PyObject *`, then there would be no cast. Making the casts explicit serves as a reminder that a type check is needed. ``` PyObject *func = ...; int flags = PyCFunction_GET_FLAGS(func); ``` is dangerous. ``` PyObject *obj = ...; if (PyCFunction_Check(obj)) { PyCFunctionObject *func = (PyCFunctionObject *)obj; int flags = func->m_ml->ml_flags; ``` is safe. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:23:30 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 13:23:30 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648646610.44.0.142489397052.issue47161@roundup.psfhosted.org> Oleg Iarygin added the comment: > But shouldn't it just work with `//` as a `/`? It seems like this is the behavior elsewhere. It works elsewhere because empty directory names are impossible so can be dropped. But if `//` is placed in the beginning, it gets a special meaning that totally changes the whole path so its plain replacement would give a totally wrong one. Roughly speaking, "//Library/Video" is `/Video` on a computer named `Library`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:25:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 13:25:01 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648646701.58.0.984182762203.issue47164@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30269 pull_request: https://github.com/python/cpython/pull/32191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:42:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 13:42:14 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648647734.41.0.719016176332.issue47164@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30270 pull_request: https://github.com/python/cpython/pull/32192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:51:00 2022 From: report at bugs.python.org (Jan Bronicki) Date: Wed, 30 Mar 2022 13:51:00 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648648260.63.0.324941237248.issue47161@roundup.psfhosted.org> Jan Bronicki added the comment: Hmm..., I get it, but Im not gonna lie it's pretty confusing given that in other places `//` works as a substitute for `/`. Maybe it should be mentioned in the documentation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 09:52:27 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 30 Mar 2022 13:52:27 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648648347.46.0.427304005863.issue47164@roundup.psfhosted.org> Ken Jin added the comment: > tiny inline function obscures the meaning of code Sadly I have to agree with Mark for that specific case. I've had to debug a segfault before only because the inline function implicitly cast its arguments, and it was accessing a non-existent member. If it were a macro it would access the struct member directly, and the compiler would be able to catch that and warn me before runtime. However, for the case of _PyCFunctionObject_CAST, I'm not against it. The assert(PyCFunction_Check) pattern has genuinely helped me catch problems in the case of similar macros. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:00:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 14:00:23 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648648823.85.0.831736930555.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: > I think that adding macros makes readability worse. See the attached PRs, I can remove multiple layers of parenthesis in macros by using CAST macros. > ``` > PyObject *func = ...; > int flags = PyCFunction_GET_FLAGS(func); > ``` > > is dangerous. Right. PEP 670 proposes to remove the cast, but only in the limited C API version 3.11 or newer. Sadly, I don't think that we can remove the cast in the general Python C API, it would simply add too many compiler warnings in existing C extensions which previously built without warnings. (See also PEP 670 discussions on python-dev). Currently, PyCFunction_GET_FLAGS() doesn't check its argument. The macro documentation is quite explicit about it: /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ My GH-32190 PR adds a check in debug mode. So using PyCFunction_GET_FLAGS() in debug mode is safer with this PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:14:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 14:14:35 +0000 Subject: [issue47165] [C API] Test that the Python C API is compatible with C++ Message-ID: <1648649675.83.0.616089924769.issue47165@roundup.psfhosted.org> New submission from STINNER Victor : There are more and more popular projects using the Python C API. The first big player is pybind11: "Seamless operability between C++11 and Python" https://pybind11.readthedocs.io/ Recently, I proposed a PR to add Python 3.11 support to the datatable project: https://github.com/h2oai/datatable/pull/3231 My PR uses pythoncapi_compat.h header file which provides recent C API functions to old Python functions. The header file implements these functions as static inline function. Problem: a static inline function implemented in a C header file used in a C++ code file can emit C++ compiler warnings. In datatable, I got two kinds of C++ compiler warnings: * Usage of the C NULL constant: C++ prefers nullptr * "Old-style" cast like (PyObject*)obj: C++ prefers static_cast, reinterpret_cast, etc. It seems like these compiler warnings are not enabled by default. The datatable project seems enabling them in its CI and I was asked to fix these warnings. In the pythoncapi-compat project (*), I chose to use nullptr and reinterpret_cast if the "__cplusplus" macro is defined. Example: --- // C++ compatibility #ifdef __cplusplus # define PYCAPI_COMPAT_CAST(TYPE, EXPR) reinterpret_cast(EXPR) # define PYCAPI_COMPAT_NULL nullptr #else # define PYCAPI_COMPAT_CAST(TYPE, EXPR) ((TYPE)(EXPR)) # define PYCAPI_COMPAT_NULL NULL #endif // Cast argument to PyObject* type. #ifndef _PyObject_CAST # define _PyObject_CAST(op) PYCAPI_COMPAT_CAST(PyObject*, op) #endif --- (*) https://github.com/python/pythoncapi_compat It's unclear to me if the Python C API has or has not the same issue than pythoncapi_compat.h. Last years, some old macros of the Python C API have been converted to static inline functions, like Py_INCREF(). It's unclear to me if these compiler warnings happen on Py_INCREF(). I don't understand why, but static inline macros from Python.h didn't emit compiler warnings in datatable, whereas similar static inline functions of pythoncapi_compat.h emitted compiler warnings. Maybe there is a difference between and "Python.h". Or maybe it depends if the header file is a "local" file, or a "system" header file (ex: installed in /usr/include/ on Linux). A first step would be to build a C++ extension as part of the Python test suite and check that there is no compiler warning. My GH-32175 PR is a proof-of-concept of that. I don't know which C++ version we should target. pybind11 targets C++11. See bpo-39355 for a discussion about C++20: usage of the C++20 "module" keyword... which is a "contextual keyword" in practice. ---------- components: C API messages: 416359 nosy: vstinner priority: normal severity: normal status: open title: [C API] Test that the Python C API is compatible with C++ type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:14:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 14:14:56 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1648649696.75.0.152213591743.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: Follow-up issue: bpo-47165 "[C API] Test that the Python C API is compatible with C++". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:15:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 14:15:27 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648649727.93.0.673433692926.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: > By the way, the current Python C API is not fully compatible with C++. (...) I created bpo-47165 "[C API] Test that the Python C API is compatible with C++". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:24:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 14:24:25 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648650265.49.0.334418341201.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: Hum, there are two things and maybe we are not talking about the same thing. * (A) Modifying macros defined in the Python C API (Include/ header files) doing cast on their arguments to use CAST macros * (B) Modify C code doing casts to use CAST macros I created this issue for (A). I propose to do (B), but this part is optional. Mark, Ken: are you fine with (A)? Is your concern about (B)? But modifying macros to remove the cast of their argument is out of the scope of this issue. As I wrote, it would add compiler warnings, something that I would like to avoid. See: https://peps.python.org/pep-0670/#cast-pointer-arguments ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:33:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 14:33:08 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648650788.22.0.385513615036.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: GH-32192 "Add _PyCFunction_CAST() macro" is special. It's used to define functions in PyTypeObject.tp_methods or PyModuleDef.m_methods. Casting a function pointer can cause issues with Control Flow Integrity (CFI) implemented in LLVM. The _thread module has an undefined behavior fixed by the commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30 of bpo-33015. Previously, a cast ignored that the callback has no return value, whereas pthread_create() requires a function which as a void* return value. To fix compiler warnings, the (PyCFunction)func cast was replaced with the (PyCFunction)(void(*)(void))func cast to fix bpo-bpo-33012 GCC 8 compiler warning: warning: cast between incompatible function types (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:36:28 2022 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 30 Mar 2022 14:36:28 +0000 Subject: [issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes In-Reply-To: <1648376164.23.0.483054740742.issue47135@roundup.psfhosted.org> Message-ID: <1648650988.42.0.243255414448.issue47135@roundup.psfhosted.org> Nick Coghlan added the comment: Seems reasonable to me, but I think a full implementation would want to throw an error for keyword args that don't already exist as context attributes (otherwise typos would fail silently) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:37:01 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 30 Mar 2022 14:37:01 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648651021.86.0.053976356549.issue47164@roundup.psfhosted.org> Ken Jin added the comment: @Victor, I'm not against (A) or any of the PRs you proposed. They look fine to me. My concern was with certain static inline functions (there are none here :). The _CAST macros have genuinely helped me debug code before. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:42:55 2022 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 30 Mar 2022 14:42:55 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1648651375.64.0.026997515108.issue46964@roundup.psfhosted.org> Nick Coghlan added the comment: I agree the status quo has its benefits. However, it has the distinct downside that because each interpreter has its own storage for copied settings, other code has to assume the settings *might* be different in each interpreter, even if they're currently always the same. If the invariant bits are moved out, then it clearly indicates when code can safely assume that every interpreter will be seeing the same value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:47:38 2022 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 30 Mar 2022 14:47:38 +0000 Subject: [issue36692] Unexpected stderr output from test_sys_settrace In-Reply-To: <1555853588.91.0.708286420314.issue36692@roundup.psfhosted.org> Message-ID: <1648651658.55.0.431495761537.issue36692@roundup.psfhosted.org> Nick Coghlan added the comment: I'm not, so I assume this got cleaned up somewhere along the way. ---------- resolution: -> out of date stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:49:32 2022 From: report at bugs.python.org (Thomas MK) Date: Wed, 30 Mar 2022 14:49:32 +0000 Subject: [issue47166] Dataclass transform should ignore TypeAlias variables Message-ID: <1648651772.62.0.141726987387.issue47166@roundup.psfhosted.org> New submission from Thomas MK : The dataclass transformation ignores attributes that are annotated as ClassVar. I think it should also ignore attributes that are annotated as TypeAlias. Specifically, I have this usecase in mind: class RunMode(Enum): release = auto() debug = auto() @dataclass class Run: Mode: TypeAlias = RunMode mode: Mode = Mode.release ---------- components: Library (Lib) messages: 416368 nosy: thomkeh priority: normal severity: normal status: open title: Dataclass transform should ignore TypeAlias variables 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 Wed Mar 30 10:50:32 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 14:50:32 +0000 Subject: [issue47161] pathlib method relative_to doesnt work with // in paths In-Reply-To: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> Message-ID: <1648651832.49.0.627108910856.issue47161@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- keywords: +patch pull_requests: +30271 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:54:08 2022 From: report at bugs.python.org (Ethan Furman) Date: Wed, 30 Mar 2022 14:54:08 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior In-Reply-To: <1641851456.34.0.342855463339.issue46337@roundup.psfhosted.org> Message-ID: <1648652048.99.0.973678178876.issue46337@roundup.psfhosted.org> Ethan Furman added the comment: ?ric Araujo wrote on PR30520: ---------------------------- > No, we should not redefine the behavior of urlparse. > > I was always talking about adding another function. Yes it can be a one-liner, > but my point is that I don?t see the usefulness of having the separate flags to > pick and choose parts of standard parsing. I suspect the usefulness comes from error checking -- if a scheme doesn't support parameters, then having what looks like parameters converted would not be helpful. Further, while a new function is definitely safer, how many parse options do we need? Anyone else remember `os.popen()`, `os.popen2`, `os.popen3`, and, finally, `os.popen4()`? Assuming we just enhance the existing function, would it be more palatable if there was a `SchemeFlag.ALL`, so universal parsing was just `urlparse(uri_string, flags=SchemeFlag.ALL)`? To be really user-friendly, we could have: class SchemeFlag(Flag): RELATIVE = auto() NETLOC = auto() PARAMS = auto() UNIVERSAL = RELATIVE | NETLOC | PARAMS # def __repr__(self): return f"{self.module}.{self._name_}" __str__ = __repr__ RELATIVE, NETLOC, PARAMS, UNIVERSAL = SchemeFlag Then the above call becomes: urlparse(uri_string, flags=UNIVERSAL) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 10:57:29 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Mar 2022 14:57:29 +0000 Subject: [issue47115] Documentation inconsistency with the stable ABI In-Reply-To: <1648195503.34.0.47585180018.issue47115@roundup.psfhosted.org> Message-ID: <1648652249.87.0.50254400059.issue47115@roundup.psfhosted.org> Petr Viktorin added the comment: So. According to PEP 384 (which added all structs in the stable ABI, except Py_buffer), some structs are opaque and others have a few members exposed: https://peps.python.org/pep-0384/#structures I will split the latter into 1) structs that have a few fields exposed mainly for backwards compatibility (which, of course, is very important here). Best practice is to treat them as opaque (use getters/setters): - PyObject (ob_refcnt, ob_type) - PyVarObject (ob_base, ob_size) ... and 2) structs for which all fields are part of the ABI (and the struct's size as well: for most of these as users are expected to provide arrays): - PyMethodDef - PyMemberDef - PyGetSetDef - PyModuleDefBase - PyModuleDef - PyStructSequence_Field - PyStructSequence_Desc - PyType_Slot - PyType_Spec - Py_buffer (new in 3.11) The opaque structs continue to be: - PyThreadState - PyInterpreterState - PyFrameObject - symtable - PyWeakReference - PyLongObject - PyTypeObject ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:00:53 2022 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 30 Mar 2022 15:00:53 +0000 Subject: [issue47092] [C API] Add PyFrame_GetVar(frame, name) function In-Reply-To: <1647960098.17.0.347400705187.issue47092@roundup.psfhosted.org> Message-ID: <1648652453.29.0.740095112063.issue47092@roundup.psfhosted.org> Nick Coghlan added the comment: Mark's suggested frame stack API makes sense to me, but being able to get/set specific values through the full frame API seems like it would be useful even if the lower level API existed - if we don't get one of the proxy PEPs in shape to land in 3.11, trace functions written in C could still use this to avoid materialising the locals dict if they only needed to manipulate specific values. Even after a fast locals proxy is defined, there would still be some saving in skipping creating the proxy object when only accessing known keys. We'd need the name-to-index mapping on the code objects to implement this API efficiently, but that isn't a PEP level change in its own right (the proxy PEPs only mention it because they need it) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:07:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 15:07:13 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648652833.95.0.646428359512.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: > I've had to debug a segfault before only because the inline function implicitly cast its arguments, and it was accessing a non-existent member. If it were a macro it would access the struct member directly, and the compiler would be able to catch that and warn me before runtime. This is part of Python C API legacy and as I wrote, it's not going to change soon. The minor enhancement that we can do is to inject an assertion when Python is built in debug mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:11:25 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 15:11:25 +0000 Subject: [issue47099] Replace with_traceback() with exception chaining and reraising In-Reply-To: <1648032171.38.0.470876447666.issue47099@roundup.psfhosted.org> Message-ID: <1648653085.41.0.762932405577.issue47099@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:19:39 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Mar 2022 15:19:39 +0000 Subject: [issue47115] Documentation inconsistency with the stable ABI In-Reply-To: <1648195503.34.0.47585180018.issue47115@roundup.psfhosted.org> Message-ID: <1648653579.55.0.128104679046.issue47115@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +30272 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:26:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 30 Mar 2022 15:26:47 +0000 Subject: [issue46964] The global config should not be stored on each interpreter In-Reply-To: <1646769353.37.0.654119794325.issue46964@roundup.psfhosted.org> Message-ID: <1648654007.34.0.343190705988.issue46964@roundup.psfhosted.org> STINNER Victor added the comment: > If the invariant bits are moved out, then it clearly indicates when code can safely assume that every interpreter will be seeing the same value. What is the benefit of that? Do you have an example? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:34:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 30 Mar 2022 15:34:50 +0000 Subject: [issue47167] Allow overriding future-task compliance check in asyncio Message-ID: <1648654490.03.0.819318508338.issue47167@roundup.psfhosted.org> New submission from Andrew Svetlov : Now asyncio.Task has a strict hardcoded check for futures processes on task's step. Sometimes third-party library [1] wants to replace it with custom logic. Currently it is impossible without implementing the full asyncio.Task replacement from scratch. `asyncio.Task` is a non-trivial highly optimized part of async, keeping a third-party version in sync with the reference implementation takes more time and effort than it should be. This issue proposes adding `Task._check_future(future)` method that could be overridden in subclasses. The default C implementation uses a fast path that has no performance penalty. 1. https://github.com/aio-libs/aioloop-proxy implements nested loop proxies that are very useful for writing tests. A proxy can work in parallel with ancestors but checks all own acquired resources cleanup on the proxy closing. ---------- components: asyncio messages: 416374 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Allow overriding future-task compliance check in asyncio versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:36:59 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 30 Mar 2022 15:36:59 +0000 Subject: [issue47167] Allow overriding future-task compliance check in asyncio In-Reply-To: <1648654490.03.0.819318508338.issue47167@roundup.psfhosted.org> Message-ID: <1648654619.48.0.522890722086.issue47167@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +30273 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:38:39 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 30 Mar 2022 15:38:39 +0000 Subject: [issue24837] await process.wait() does not work with a new_event_loop In-Reply-To: <1439199038.24.0.690620901041.issue24837@psf.upfronthosting.co.za> Message-ID: <1648654719.55.0.0476614531232.issue24837@roundup.psfhosted.org> Guido van Rossum added the comment: Okay let's close it then. :-) ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:39:32 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Mar 2022 15:39:32 +0000 Subject: [issue47168] Improvements for stable ABI definition files Message-ID: <1648654772.36.0.475029979354.issue47168@roundup.psfhosted.org> New submission from Petr Viktorin : This issue groups together a few changes I'd like to make: - Rename Doc/data/stable_abi.dat to *.csv, so it gets syntax highlighting. (The only user of that file should be the Sphinx extension) - Mark autogenerated files as such in .gitattributes - Convert Misc/stable_abi.txt to TOML, and change the parser to match (this will need a heads-up on python-dev) ---------- messages: 416376 nosy: petr.viktorin priority: normal severity: normal status: open title: Improvements for stable ABI definition files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:39:53 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Mar 2022 15:39:53 +0000 Subject: [issue47168] Improvements for stable ABI definition files In-Reply-To: <1648654772.36.0.475029979354.issue47168@roundup.psfhosted.org> Message-ID: <1648654793.58.0.490927378386.issue47168@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +30274 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:52:37 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Mar 2022 15:52:37 +0000 Subject: [issue47169] Stable ABI: Some optional (#ifdef'd) functions aren't handled correctly Message-ID: <1648655557.05.0.882264493098.issue47169@roundup.psfhosted.org> New submission from Petr Viktorin : - PyThread_get_thread_native_id is only available when PY_HAVE_THREAD_NATIVE_ID is defined. The test currently always expects it to be available. - PyOS_CheckStack is only available when USE_STACKCHECK is defined (i.e. on Windows). It should be exported from the DLL. I plan to: - add the appropriate metadata - improve handling & testing of such optional functions in general ---------- components: C API messages: 416377 nosy: petr.viktorin priority: normal severity: normal status: open title: Stable ABI: Some optional (#ifdef'd) functions aren't handled correctly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 11:55:23 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Mar 2022 15:55:23 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1648655723.77.0.712861026356.issue44133@roundup.psfhosted.org> Petr Viktorin added the comment: > Ah, sorry, I could have described the issue better. It's not a problem with exporting, PyThread_get_thread_native_id() isn't available on Solaris (and possibly other platforms) at all. Jakub, does this mean test_stable_abi_ctypes fails on Solaris? Are there any other missing functions? I opened bpo-47169 to improve the situation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:11:27 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 30 Mar 2022 16:11:27 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648656687.8.0.994648038754.issue47146@roundup.psfhosted.org> Eric Snow added the comment: Looks like this is still an intermittent problem: * https://github.com/python/cpython/pull/32195 + failed: https://github.com/python/cpython/runs/5756616733 + failed: https://github.com/python/cpython/runs/5753267869 + failed: https://github.com/python/cpython/runs/5757169625 * https://github.com/python/cpython/pull/32114 + failed: https://github.com/python/cpython/runs/5756616733 + passed: https://github.com/python/cpython/runs/5757213346 * https://github.com/python/cpython/pull/32186 + failed: ... + passed: https://github.com/python/cpython/runs/5757178754 Per Mark Shannon (on discord): The "Check if generated files are up to date" is still failing consistently. It looks like the makefile is missing a dependency on the ./Programs/_freeze_module for targets that require /Programs/_freeze_module? ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:28:35 2022 From: report at bugs.python.org (Christian Ascia) Date: Wed, 30 Mar 2022 16:28:35 +0000 Subject: [issue47170] py launcher on windows opens new terminal window when parsing python script with shebang Message-ID: <1648657715.1.0.645220705406.issue47170@roundup.psfhosted.org> New submission from Christian Ascia : Hi, as the title describes, i noticed this unfornutate behavior preventing me to run directly python scripts in terminal without using the py command. I searched in the documentation but i couldn't find flags to prevent py launcher from opening a new window. ---------- components: Windows messages: 416380 nosy: asciachristian, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: py launcher on windows opens new terminal window when parsing python script with shebang type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:47:05 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 16:47:05 +0000 Subject: [issue47170] py launcher on windows opens new terminal window when parsing python script with shebang In-Reply-To: <1648657715.1.0.645220705406.issue47170@roundup.psfhosted.org> Message-ID: <1648658825.83.0.377161506828.issue47170@roundup.psfhosted.org> Steve Dower added the comment: Are you saying this happens when you run "py.exe my-script.py"? Or only when you run "my-script.py" (without the py.exe)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:56:41 2022 From: report at bugs.python.org (Christian Ascia) Date: Wed, 30 Mar 2022 16:56:41 +0000 Subject: [issue47170] py launcher on windows opens new terminal window when parsing python script with shebang In-Reply-To: <1648657715.1.0.645220705406.issue47170@roundup.psfhosted.org> Message-ID: <1648659401.9.0.914011189611.issue47170@roundup.psfhosted.org> Christian Ascia added the comment: It happens when i run "my-script.py". I checked all terminal emulators on my system, it happens on PowerShell 7, in all Windows Terminal profiles (including cmd profile), in integrated terminals on vscode but not in cmd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 12:58:30 2022 From: report at bugs.python.org (Paul Moore) Date: Wed, 30 Mar 2022 16:58:30 +0000 Subject: [issue47170] py launcher on windows opens new terminal window when parsing python script with shebang In-Reply-To: <1648657715.1.0.645220705406.issue47170@roundup.psfhosted.org> Message-ID: <1648659510.32.0.462665062013.issue47170@roundup.psfhosted.org> Paul Moore added the comment: This is Windows (shell) behaviour. To avoid this, you need to add the .py extension to the PATHEXT environment variable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:01:29 2022 From: report at bugs.python.org (Christian Ascia) Date: Wed, 30 Mar 2022 17:01:29 +0000 Subject: [issue47170] py launcher on windows opens new terminal window when parsing python script with shebang In-Reply-To: <1648657715.1.0.645220705406.issue47170@roundup.psfhosted.org> Message-ID: <1648659689.42.0.0855835475577.issue47170@roundup.psfhosted.org> Christian Ascia added the comment: Thanks, it works now! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:08:02 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 17:08:02 +0000 Subject: [issue47171] Enable py.exe install in Windows ARM64 installer Message-ID: <1648660082.91.0.301470009561.issue47171@roundup.psfhosted.org> New submission from Steve Dower : Currently the launcher is not installed by the installer. We need to reenable it. ---------- assignee: steve.dower components: Windows messages: 416385 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Enable py.exe install in Windows ARM64 installer versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:12:38 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 17:12:38 +0000 Subject: [issue47168] Improvements for stable ABI definition files In-Reply-To: <1648654772.36.0.475029979354.issue47168@roundup.psfhosted.org> Message-ID: <1648660358.1.0.414663405493.issue47168@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- nosy: +arhadthedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:28:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Mar 2022 17:28:54 +0000 Subject: [issue47172] Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps Message-ID: <1648661334.4.0.0596431149271.issue47172@roundup.psfhosted.org> New submission from Irit Katriel : There are a few "virtual opcodes" which are internal to the compiler. They can have values > 256. This way we don't waste any valid opcodes on them, and it is easier to detect when one of them escapes the compiler into the assemble stage. In addition, there is an is_jump() function that treats the exception handling opcodes as jumps (and also assumes that any opcode >= SETUP_WITH is a jump): static inline int is_jump(struct instr *i) { return i->i_opcode >= SETUP_WITH || is_bit_set_in_table(_PyOpcode_Jump, i->i_opcode); } Then there is is_block_push just for the three virtual exception block opcodes: static inline int is_block_push(struct instr *instr) { int opcode = instr->i_opcode; return opcode == SETUP_FINALLY || opcode == SETUP_WITH || opcode == SETUP_CLEANUP; } We can make is_jump return true just for jumps, and call is_block_push as well when it is needed (currently sometimes we call is_jump when there cannot be virtual opcodes anymore so we can assert that instead, and in one place we call is_jump and then exclude the virtual opcodes. Both of these will become clearer after we make this change). ---------- assignee: iritkatriel components: Interpreter Core messages: 416386 nosy: iritkatriel priority: normal severity: normal status: open title: Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:31:59 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 17:31:59 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648661519.84.0.863657067071.issue46775@roundup.psfhosted.org> Steve Dower added the comment: New changeset d0c67ea0645b7ad37b867c167882a346a24de641 by Dong-hee Na in branch 'main': bpo-46775: OSError should call winerror_to_errno unconditionally on Windows (GH-32179) https://github.com/python/cpython/commit/d0c67ea0645b7ad37b867c167882a346a24de641 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:32:13 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Mar 2022 17:32:13 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648661533.68.0.738513371085.issue46775@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +30275 pull_request: https://github.com/python/cpython/pull/32198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:32:18 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Mar 2022 17:32:18 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648661538.57.0.260936469097.issue46775@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30276 pull_request: https://github.com/python/cpython/pull/32199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:36:23 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Wed, 30 Mar 2022 17:36:23 +0000 Subject: [issue47168] Improvements for stable ABI definition files In-Reply-To: <1648654772.36.0.475029979354.issue47168@roundup.psfhosted.org> Message-ID: <1648661783.16.0.0413853085052.issue47168@roundup.psfhosted.org> Oleg Iarygin added the comment: Probably, `regen-limited-abi` needs to be called from `regen-all` so 'Check if generated files are up to date' CI job will become aware of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:37:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Mar 2022 17:37:14 +0000 Subject: [issue47172] Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps In-Reply-To: <1648661334.4.0.0596431149271.issue47172@roundup.psfhosted.org> Message-ID: <1648661834.24.0.089334520735.issue47172@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +30277 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:38:03 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 17:38:03 +0000 Subject: [issue47173] test_launcher fails on win-arm64 buildbot Message-ID: <1648661883.7.0.386202560122.issue47173@roundup.psfhosted.org> New submission from Steve Dower : Test failures: https://buildbot.python.org/all/#/builders/730/builds/4307 ====================================================================== FAIL: test_filter_to_company (test.test_launcher.TestLauncher) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_launcher.py", line 311, in test_filter_to_company self.assertEqual("X.Y.exe", data["LaunchCommand"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'X.Y.exe' != 'C:\\Workspace\\buildarea\\venv_310\\Scripts\\python.exe' - X.Y.exe + C:\Workspace\buildarea\venv_310\Scripts\python.exe ====================================================================== FAIL: test_py_default (test.test_launcher.TestLauncher) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_launcher.py", line 370, in test_py_default self.assertEqual("PythonTestSuite", data["SearchInfo.company"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'PythonTestSuite' != '(null)' - PythonTestSuite + (null) ====================================================================== FAIL: test_py_shebang (test.test_launcher.TestLauncher) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_launcher.py", line 392, in test_py_shebang self.assertEqual("PythonTestSuite", data["SearchInfo.company"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'PythonTestSuite' != '(null)' - PythonTestSuite + (null) ---------- components: Windows messages: 416389 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: test_launcher fails on win-arm64 buildbot type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:39:11 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 17:39:11 +0000 Subject: [issue47173] test_launcher fails on win-arm64 buildbot In-Reply-To: <1648661883.7.0.386202560122.issue47173@roundup.psfhosted.org> Message-ID: <1648661951.75.0.385398374756.issue47173@roundup.psfhosted.org> Steve Dower added the comment: Oh, I wonder if the VIRTUAL_ENV environment variable is interfering with search (as it's meant to, but the tests weren't written expecting to be run inside a venv). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 13:57:35 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 30 Mar 2022 17:57:35 +0000 Subject: [issue47172] Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps In-Reply-To: <1648661334.4.0.0596431149271.issue47172@roundup.psfhosted.org> Message-ID: <1648663055.38.0.387684318784.issue47172@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 14:11:51 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 30 Mar 2022 18:11:51 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648663911.44.0.968710814687.issue44090@roundup.psfhosted.org> Guido van Rossum added the comment: Yeah, I see no description of what you can do with an unbound super object in the docs (https://docs.python.org/3/library/functions.html#super), and experimentation with it does not reveal any useful functionality. You may want to open a new issue for this, and we'll probably have to propose a 2-release deprecation period and start issuing a deprecation warning, in case there are nevertheless users (like autosuper clones). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 14:56:19 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 18:56:19 +0000 Subject: [issue47171] Enable py.exe install in Windows ARM64 installer In-Reply-To: <1648660082.91.0.301470009561.issue47171@roundup.psfhosted.org> Message-ID: <1648666579.78.0.674542251446.issue47171@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +30278 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:00:12 2022 From: report at bugs.python.org (Erik De Bonte) Date: Wed, 30 Mar 2022 19:00:12 +0000 Subject: [issue47174] Define behavior of descriptor-typed fields on dataclasses Message-ID: <1648666812.33.0.43566752411.issue47174@roundup.psfhosted.org> New submission from Erik De Bonte : Recent discussions about PEP 681 (dataclass_transform) have focused on support for descriptor-typed fields. See the email thread here: https://mail.python.org/archives/list/typing-sig at python.org/thread/BW6CB6URC4BCN54QSG2STINU2M7V4TQQ/ Initially we were thinking that dataclass_transform needed a new parameter to switch between two modes. In one mode, it would use the default behavior of dataclass. In the other mode, it would be smarter about how descriptor-typed fields are handled. For example, __init__ would pass the value for a descriptor-typed field to the descriptor's __set__ method. However, Carl Meyer found that dataclass already has the desired behavior at runtime! We missed this because mypy and Pyright do not correctly mirror this runtime behavior. Although this is the current behavior of dataclass, I haven't found it documented anywhere and the behavior is not covered by unit tests. Since dataclass_transform wants to rely on this behavior and the behavior seems desirable for dataclass as well, I'm proposing that we add additional dataclass unit tests to ensure that this behavior does not change in the future. Specifically, we would like to document (and add unit tests for) the following behavior given a field whose default value is a descriptor: 1. The value passed to __init__ for that field is passed to the descriptor?s __set__ method, rather than overwriting the descriptor object. 2. Getting/setting the value of that field goes through __get__/__set__, rather than getting/overwriting the descriptor object. Here's an example: class Descriptor(Generic[T]): def __get__(self, __obj: object | None, __owner: Any) -> T: return getattr(__obj, "_x") def __set__(self, __obj: object | None, __value: T) -> None: setattr(__obj, "_x", __value) @dataclass class InventoryItem: quantity_on_hand: Descriptor[int] = Descriptor[int]() i = InventoryItem(13) # calls __set__ with 13 print(i.quantity_on_hand) # 13 -- obtained via call to __get__ i.quantity_on_hand = 29 # calls __set__ with 29 print(i.quantity_on_hand) # 29 -- obtained via call to __get__ I took a first stab at unit tests here: https://github.com/debonte/cpython/commit/c583e7c91c78c4aef65a1ac69241fc06ad95d436 We are aware of two other descriptor-related behaviors that may also be worth documenting: First, if a field is annotated with a descriptor type but is *not* assigned a descriptor object as its default value, it acts like a non-descriptor field. Here's an example: @dataclass class InventoryItem: quantity_on_hand: Descriptor[int] # No default value i = InventoryItem(13) # Sets quantity_on_hand to 13 -- No call to Descriptor.__set__ print(i.quantity_on_hand) # 13 -- No call to Descriptor.__get__ And second, when a field with a descriptor object as its default value is initialized (when the code for the dataclass is initially executed), __get__ is called with a None instance and the return value is used as the field's default value. See the example below. Note that if __get__ doesn't handle this None instance case (for example, in the initial definition of Descriptor above), a call to InventoryItem() fails with "TypeError: InventoryItem.__init__() missing 1 required positional argument: 'quantity_on_hand'". I'm less sure about documenting this second behavior, since I'm not sure what causes it to work, and therefore I'm not sure how intentional it is. class Descriptor(Generic[T]): def __init__(self, *, default: T): self._default = default def __get__(self, __obj: object | None, __owner: Any) -> T: if __obj is None: return self._default return getattr(__obj, "_x") def __set__(self, __obj: object | None, __value: T) -> None: if __obj is not None: setattr(__obj, "_x", __value) # When this code is executed, __get__ is called with __obj=None and the # returned value is used as the default value of quantity_on_hand. @dataclass class InventoryItem: quantity_on_hand: Descriptor[int] = Descriptor[int](default=100) i = InventoryItem() # calls __set__ with 100 print(i.quantity_on_hand) # 100 -- obtained via call to __get__ ---------- components: Library (Lib) messages: 416392 nosy: JelleZijlstra, debonte, eric.smith priority: normal severity: normal status: open title: Define behavior of descriptor-typed fields on dataclasses type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:02:34 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 19:02:34 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648666954.85.0.188273387124.issue46775@roundup.psfhosted.org> Steve Dower added the comment: I'm still not convinced we should backport. Has anyone looked through to see whether this will actually affect any high valued error codes today? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:28:48 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2022 19:28:48 +0000 Subject: [issue47162] Add call trampoline to work around bad fpcasts on Emscripten In-Reply-To: <1648638700.22.0.607965445304.issue47162@roundup.psfhosted.org> Message-ID: <1648668528.09.0.874949594781.issue47162@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:28:52 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Mar 2022 19:28:52 +0000 Subject: [issue47162] Add call trampoline to work around bad fpcasts on Emscripten In-Reply-To: <1648638700.22.0.607965445304.issue47162@roundup.psfhosted.org> Message-ID: <1648668532.17.0.75881608097.issue47162@roundup.psfhosted.org> miss-islington added the comment: New changeset 581c4434de62d9d36392f10e65866c081fb18d71 by Christian Heimes in branch 'main': bpo-47162: Add call trampoline to mitigate bad fpcasts on Emscripten (GH-32189) https://github.com/python/cpython/commit/581c4434de62d9d36392f10e65866c081fb18d71 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:34:31 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 19:34:31 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1648668871.51.0.549202553788.issue46566@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +30279 pull_request: https://github.com/python/cpython/pull/32204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 15:36:04 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 19:36:04 +0000 Subject: [issue47173] test_launcher fails on win-arm64 buildbot In-Reply-To: <1648661883.7.0.386202560122.issue47173@roundup.psfhosted.org> Message-ID: <1648668964.52.0.860495633255.issue47173@roundup.psfhosted.org> Steve Dower added the comment: The fix in PR 32204 also clears out VIRTUAL_ENV, so that may be enough. It's running on buildbots to see whether it helps. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 16:00:23 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 30 Mar 2022 20:00:23 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648670423.81.0.760041491506.issue47146@roundup.psfhosted.org> Christian Heimes added the comment: The problem is likely a recursive make call "$(MAKE)" in combination with parallel execution. As far as I understand it, GNU make cannot track dependencies properly, which can lead to partial or invalid dependency graphs. One make process can modify a file while another uses the file. The permission error or ETXTBSY error are manifestation of one process creating an executable while another process is attempting to execve() it. The paper https://accu.org/journals/overload/14/71/miller_2004/ explains the issues with recursion in great detail. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 16:20:52 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 20:20:52 +0000 Subject: [issue47171] Enable py.exe install in Windows ARM64 installer In-Reply-To: <1648660082.91.0.301470009561.issue47171@roundup.psfhosted.org> Message-ID: <1648671652.35.0.737720478306.issue47171@roundup.psfhosted.org> Steve Dower added the comment: New changeset 2ab609dd614045f3b112ede0b0883339de784f2a by Steve Dower in branch 'main': bpo-47171: Enable installing the py.exe launcher on Windows ARM64 (GH-32203) https://github.com/python/cpython/commit/2ab609dd614045f3b112ede0b0883339de784f2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 16:58:58 2022 From: report at bugs.python.org (Zachary Ware) Date: Wed, 30 Mar 2022 20:58:58 +0000 Subject: [issue47148] sys.path.append before import the module causing module don't have doc-string? In-Reply-To: <1648535609.4.0.0943377147502.issue47148@roundup.psfhosted.org> Message-ID: <1648673938.85.0.422189091208.issue47148@roundup.psfhosted.org> Zachary Ware added the comment: Also cannot reproduce on Windows: D:\issue47148_test\parent\another folder>type ..\a.py def multiply(): """multiply stuff""" return 2 * 4 D:\issue47148_test\parent\another folder>type b.py import sys sys.path.append('..') import a print(a.multiply.__doc__) D:\issue47148_test\parent\another folder>py b.py multiply stuff My best advice would be to try to reproduce it again yourself in a clean directory, and/or remove all `*.pyc` files and `__pycache__` directories from your project and try again, making sure you have no environment variables starting with `PYTHON` set. If you still find you're having trouble, please reach out in the Users category of discuss.python.org. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:18:48 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 21:18:48 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher In-Reply-To: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> Message-ID: <1648675128.2.0.746868824016.issue46566@roundup.psfhosted.org> Steve Dower added the comment: New changeset f3d5715492195fd2532fc1a5d73be07923cdf2e1 by Steve Dower in branch 'main': bpo-46566: Make test_launcher more robust to a variety of installs (GH-32204) https://github.com/python/cpython/commit/f3d5715492195fd2532fc1a5d73be07923cdf2e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:18:54 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 21:18:54 +0000 Subject: [issue47171] Enable py.exe install in Windows ARM64 installer In-Reply-To: <1648660082.91.0.301470009561.issue47171@roundup.psfhosted.org> Message-ID: <1648675134.39.0.527842296598.issue47171@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 Mar 30 17:21:14 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 21:21:14 +0000 Subject: [issue47173] test_launcher fails on win-arm64 buildbot In-Reply-To: <1648661883.7.0.386202560122.issue47173@roundup.psfhosted.org> Message-ID: <1648675274.45.0.536555568034.issue47173@roundup.psfhosted.org> Steve Dower added the comment: Looks like that probably fixed it. Will let the buildbot run again to be sure: https://buildbot.python.org/all/#/builders/729/builds/1191 https://buildbot.python.org/all/#/builders/730/builds/4322 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:21:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Mar 2022 21:21:54 +0000 Subject: [issue32754] feature request: asyncio.gather/wait cancel children on first exception In-Reply-To: <1517614142.6.0.467229070634.issue32754@psf.upfronthosting.co.za> Message-ID: <1648675314.46.0.34946763604.issue32754@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:22:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Mar 2022 21:22:25 +0000 Subject: [issue17733] Add tests to test__header_value_parser for RFC 2231 parsing code In-Reply-To: <1647982247.3.0.524832327607.issue17733@roundup.psfhosted.org> Message-ID: <1648675345.1.0.334939453354.issue17733@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:22:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Mar 2022 21:22:50 +0000 Subject: [issue22260] Rearrange tkinter tests, use test discovery In-Reply-To: <1408824639.7.0.685120896496.issue22260@psf.upfronthosting.co.za> Message-ID: <1648675370.94.0.722728083189.issue22260@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:28:38 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 30 Mar 2022 21:28:38 +0000 Subject: [issue47175] Allow applications to tune the condition that triggers a GIL release and implementation choice in hashlib Message-ID: <1648675718.75.0.491901512774.issue47175@roundup.psfhosted.org> New submission from Gregory P. Smith : ## Background All `hashlib` computations and `binascii.crc32` and `zlib.crc32` release the GIL around their computational core. But they use a hard coded length check to determine when to do so, or always do it. That already accomplishes the larger good of releasing the GIL on big computations. But _probably_ just serves to slow down smaller ones when a GIL release adds more overhead than a context switch to another thread could meaningfully provide in terms of forward progress. ## Desire 1 Determine if a threshold should exist at all (should we just always release the GIL for these?) and if so, allow it to be tuned on a per algorithm basis. This comes at the same time as other enhancements like bpo-47102 and its windows and macos cousins could shift us towards using OS kernel APIs for a subset of algorithms where available - which may effectively "always release" the GIL on OS APIs that are virtual IO call based such as bpo-47102's. ## Desire 2 When multiple implementations of an algorithm may be available, allow the user to configure data length thresholds for when each one is triggered. Without meaningfully slowing most things down by adding such logic. Different implementations have different setup and finalization time which can make them more useful for large data rather than tiny. --- I'm marking this low priority as it veers towards over-optimization. :) Creating benchmarks and a thing to live in Tools/ that people could run on their target platform to provide a tuning suggestion of what thresholds work best for their needs. Related inspiring work: OSes often benchmark several algorithm implementations up front to pick a "best" to use for a given platform (ex: see what the Linux kernel does for hashes and raid algorithms). This extends that idea and acknowledges latency as important, not exclusively thru-put. ---------- messages: 416401 nosy: gregory.p.smith priority: low severity: normal stage: needs patch status: open title: Allow applications to tune the condition that triggers a GIL release and implementation choice in hashlib type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:52:36 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 30 Mar 2022 21:52:36 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods In-Reply-To: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> Message-ID: <1648677156.66.0.706492955985.issue44090@roundup.psfhosted.org> G?ry added the comment: Alright, thanks. Raymond, any objections before I propose the removal of one-argument super? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 17:55:22 2022 From: report at bugs.python.org (Hood Chatham) Date: Wed, 30 Mar 2022 21:55:22 +0000 Subject: [issue47176] Interrupt handling for wasm32-emscripten builds without pthreads Message-ID: <1648677322.27.0.607778743764.issue47176@roundup.psfhosted.org> New submission from Hood Chatham : In Pyodide, we need to patch the interpreter to allow keyboard interrupts. We build Python without pthreads support because Emscripten doesn't currently support using pthreads and dynamic linking in the same build. It is still possible to handle UI at the same time as running Python code by running Python in a web worker. However, the web assembly memory is private to the webworker and cannot be modified from the main thread. The standard way that keyboard interrupts are handled is that the operating system preempts the task to run a signal handler. This can't happen in Emscripten because there is no operating system. Instead, in Emscripten we create a SharedArrayBuffer, share it with the main thread, and then write the signal into this shared memory from the main thread. We patch the main loop to periodically poll this SharedArrayBuffer and if an interrupt has been requested it calls `PyErr_SetInterruptEx` to signal the interrupt. I've set the polling rate to once every 50 interpreter operations, which seems to be reasonably responsive and have a negligible performance cost. One interesting feature of this setup is that it is impossible to create a pointer to the shared memory so it cannot be read directly from C (instead we check it from an `EM_ASM` block). ---------- components: Interpreter Core messages: 416403 nosy: hoodmane priority: normal severity: normal status: open title: Interrupt handling for wasm32-emscripten builds without pthreads type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 18:07:56 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Mar 2022 22:07:56 +0000 Subject: [issue47173] test_launcher fails on win-arm64 buildbot In-Reply-To: <1648661883.7.0.386202560122.issue47173@roundup.psfhosted.org> Message-ID: <1648678076.93.0.210933503613.issue47173@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 19:38:43 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 30 Mar 2022 23:38:43 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648683523.1.0.0346390617781.issue47145@roundup.psfhosted.org> Larry Hastings added the comment: Having slept on it, I think the footgun is slightly bigger than I gave it credit for. Also the problem of nodes lingering forever is easily solved: give the user control. My next iteration will keep the done nodes around, but I'll also add a forget() method that compels the graph to forget all done nodes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 19:41:50 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 30 Mar 2022 23:41:50 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1648683710.7.0.572984719856.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +30280 pull_request: https://github.com/python/cpython/pull/32205 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:02:25 2022 From: report at bugs.python.org (Tim Peters) Date: Thu, 31 Mar 2022 00:02:25 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648684945.01.0.708595473646.issue47145@roundup.psfhosted.org> Tim Peters added the comment: Various kinds of tasks: - "Power switch must be on." Needs to done the first time. _May_ need to be done again later (if some later task turns the power off again). Can be done any number of times without harm (beyond the expense of checking), so long as the switch is on. - "Ensure gas tank is full." Probably needs to be done anew for every new added task that depends on it. - "Remove outermost layer of skin." Probably shouldn't be done more than once ;-) - "Flip Najdorf switch." Who knows? Doing it a second time - or failing to do it a second time - may be necessary, harmless, or deadly. I'd rather not bother with any of this dicey guessing. While some dynamism may be attractive, what it all "should mean" appears to be a rat's nest, and depends on domain knowledge graphlib can't possibly have. I doubt there is a compelling default. As is, two tasks are considered to be "the same" task if and only if they compare equal, so that's the least _surprising_ default for tasks added later. "Remove outermost layer of skin" "Two tasks that compare equal may or may not be considered the same task, depending on the execution history at the time the question is posed" is at best expedient, at worst disastrous. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:07:30 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 31 Mar 2022 00:07:30 +0000 Subject: [issue47150] HTTPRedirectHandler fails on POST for 307 and 308 In-Reply-To: <1648545971.96.0.690131735602.issue47150@roundup.psfhosted.org> Message-ID: <1648685250.68.0.359817015878.issue47150@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:07:58 2022 From: report at bugs.python.org (Logan Jones) Date: Thu, 31 Mar 2022 00:07:58 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1648685278.89.0.65768513975.issue44733@roundup.psfhosted.org> Logan Jones added the comment: Ok I now have a PR up with the features requested. Let me know if you need anything else! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:08:32 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 31 Mar 2022 00:08:32 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648685312.91.0.161092847049.issue47145@roundup.psfhosted.org> Larry Hastings added the comment: I'm not sure I follow you. What do you suggest graphlib is guessing at? I thought we were discussing what graphlib's (documented, intentional) behavior should be; if there was any guessing going on, it was us doing it, guessing at what behavior the user would prefer. I appreciate you corresponding on the issue, but I'm having difficulty understanding what light you're shining on the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:26:08 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 00:26:08 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648686368.42.0.131848317232.issue47146@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +30281 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:30:04 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 31 Mar 2022 00:30:04 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648686604.44.0.823932795534.issue47158@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:32:52 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 31 Mar 2022 00:32:52 +0000 Subject: [issue47166] Dataclass transform should ignore TypeAlias variables In-Reply-To: <1648651772.62.0.141726987387.issue47166@roundup.psfhosted.org> Message-ID: <1648686772.6.0.593893595011.issue47166@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:57:07 2022 From: report at bugs.python.org (Tim Peters) Date: Thu, 31 Mar 2022 00:57:07 +0000 Subject: [issue47145] Improve graphlib.TopologicalSort by removing the prepare step In-Reply-To: <1648484434.3.0.135225433651.issue47145@roundup.psfhosted.org> Message-ID: <1648688227.76.0.955875374277.issue47145@roundup.psfhosted.org> Tim Peters added the comment: I believe I'm elaborating on your "footgun". It doesn't matter to me whether we pick some scheme and document it, _if_ that scheme is incoherent, impossible to remember, error-prone, etc. That's how, e.g., regular expression syntax was designed. "I know! ++*??+) doesn't have a coherent meaning now, so let's say it means to match a prime number of the pattern it follows" ;-) That is, an error-prone extension is worse than no extension at all. The algorithm now isn't guessing at anything: it's saying up front that two tasks are the same task if and only if they compare equal. Context, execution history, ..., nothing else is relevant. It's simple. Complicating a simple thing may open new possibilities, but creates new traps too. One trap is pretty obviously making "the rules" for when two tasks are the same task depend on the execution history at the time the question is asked. That goes away, though, if the current rule is retained ("the same iff =="), but can be explicitly overridden by .forget() (or some such). That doesn't make it a no-brainer, though. For example, do .add(A, B) and run until A and B are marked done. Now do .add(B, C) What then? We're back in a guessing game again. We've just been told that B depends on C first. But we already did B. Depending on _domain_ knowledge we cannot have, that may or may not be worthy of raising an exception. You can make up any rule you want about that and arbitrarily declare victory, but the chance that a user will realize it's not the behavior _their_ domain needs is approximately 0 until after they've been burned by it. So now it's error-prone, at least to them. FWIW, in that specific case I'd say "tough beans - you told us too late that B depends on C to stop B the first time, but now that you've told us we'll respect it in future". Another twist: assuming that's "the rule", what does .add(B, C) really mean? If B really is "the same task" as it was the first time around, well, it's already been marked done. Are we supposed to do it _again_ now? Why? Why not? It's hard for me to find any _compelling_ sense here - just masses of more-or-less arbitrary implementation decisions. In which case "hard to remember" follows soon after. None of that haunts the current API. It all follows quite directly from what "depends on" means to essentially everyone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 20:58:19 2022 From: report at bugs.python.org (David Goncalves) Date: Thu, 31 Mar 2022 00:58:19 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648688299.29.0.553619740904.issue14911@roundup.psfhosted.org> Change by David Goncalves : ---------- nosy: +dpg nosy_count: 6.0 -> 7.0 pull_requests: +30282 pull_request: https://github.com/python/cpython/pull/32207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:12:26 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 31 Mar 2022 01:12:26 +0000 Subject: [issue47177] Frames should store next_instr instead of lasti Message-ID: <1648689146.75.0.35492797482.issue47177@roundup.psfhosted.org> New submission from Brandt Bucher : Rather than maintaining the offset of the "last instruction" (`f_lasti`), interpreter frames should instead just maintain a pointer to the true next instruction. This has several benefits, most notably reducing the register pressure associated with loading first_instr on every instruction and call in the main interpreter loop: When entering a frame: - Before: `next_instr = first_instr + frame->f_lasti + 1;` - After: `next_instr = frame->next_instr;` When starting a new instruction: - Before: `frame->next_instr = next_instr++ - first_instr;` - After: `frame->next_instr = ++next_instr;` Benchmarks suggest that this overhead is surprisingly significant (something like 2%). ---------- assignee: brandtbucher components: Interpreter Core messages: 416409 nosy: Mark.Shannon, brandtbucher priority: normal severity: normal stage: patch review status: open title: Frames should store next_instr instead of lasti type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:16:18 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 31 Mar 2022 01:16:18 +0000 Subject: [issue47177] Frames should store next_instr instead of lasti In-Reply-To: <1648689146.75.0.35492797482.issue47177@roundup.psfhosted.org> Message-ID: <1648689378.57.0.364791128398.issue47177@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +30283 pull_request: https://github.com/python/cpython/pull/32208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:24:14 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 01:24:14 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648689854.44.0.616150423841.issue47146@roundup.psfhosted.org> Eric Snow added the comment: New changeset db4dada5108dd49ebca23e4559a53630a2df8447 by Eric Snow in branch 'main': bpo-47146: Avoid Using make Recursively (gh-32206) https://github.com/python/cpython/commit/db4dada5108dd49ebca23e4559a53630a2df8447 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:34:22 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 31 Mar 2022 01:34:22 +0000 Subject: [issue47166] Dataclass transform should ignore TypeAlias variables In-Reply-To: <1648651772.62.0.141726987387.issue47166@roundup.psfhosted.org> Message-ID: <1648690462.78.0.0060883632754.issue47166@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +AlexWaygood, GBeauregard, JelleZijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:48:45 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 01:48:45 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648691325.03.0.0810215063071.issue46775@roundup.psfhosted.org> miss-islington added the comment: New changeset 1f2ec4cef1804cda9d2df99a318373b2982919e9 by Miss Islington (bot) in branch '3.10': bpo-46775: OSError should call winerror_to_errno unconditionally on Windows (GH-32179) https://github.com/python/cpython/commit/1f2ec4cef1804cda9d2df99a318373b2982919e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:49:47 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 01:49:47 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648691387.66.0.756827962175.issue46775@roundup.psfhosted.org> miss-islington added the comment: New changeset d04a21344ae69c66f5a6df69ee6fa6988a69b89d by Miss Islington (bot) in branch '3.9': bpo-46775: OSError should call winerror_to_errno unconditionally on Windows (GH-32179) https://github.com/python/cpython/commit/d04a21344ae69c66f5a6df69ee6fa6988a69b89d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 21:51:39 2022 From: report at bugs.python.org (Enji Cooper) Date: Thu, 31 Mar 2022 01:51:39 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648691499.33.0.83613720337.issue47158@roundup.psfhosted.org> Enji Cooper added the comment: Gr?gory: good question. I would personally advocate for doing it out of selfish interests. I'm working with middleware based on 3.8 (moving to 3.9+ is non-trivial), and we have a common fault scenario where the system breaks if logging.handlers.SysLogHandler is instantiated and the target host cannot be resolved, like seen in the first comment. Backporting the changes you referenced would make addressing the above issue easier, since the logic in connect(..) was moved into its own routine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:10:19 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 31 Mar 2022 02:10:19 +0000 Subject: [issue47166] Dataclass transform should ignore TypeAlias variables In-Reply-To: <1648651772.62.0.141726987387.issue47166@roundup.psfhosted.org> Message-ID: <1648692619.28.0.243220377736.issue47166@roundup.psfhosted.org> Jelle Zijlstra added the comment: >From a typing perspective this is reasonable. See this thread about type aliases in class scopes: https://mail.python.org/archives/list/typing-sig at python.org/thread/CGOO7GPPECGMLFDUDXSSXTRADI4BXYCS/ However, it's a niche use case and we could decide that we don't want to further complicate the annotation parsing in dataclasses.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 30 22:51:31 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 31 Mar 2022 02:51:31 +0000 Subject: [issue46775] [Windows] OSError should unconditionally call winerror_to_errno In-Reply-To: <1645070061.53.0.530684552502.issue46775@roundup.psfhosted.org> Message-ID: <1648695090.99.0.77895633226.issue46775@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:00:07 2022 From: report at bugs.python.org (Hood Chatham) Date: Thu, 31 Mar 2022 05:00:07 +0000 Subject: [issue47176] Interrupt handling for wasm32-emscripten builds without pthreads In-Reply-To: <1648677322.27.0.607778743764.issue47176@roundup.psfhosted.org> Message-ID: <1648702807.93.0.57293123157.issue47176@roundup.psfhosted.org> Change by Hood Chatham : ---------- keywords: +patch pull_requests: +30284 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32209 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:01:22 2022 From: report at bugs.python.org (Hood Chatham) Date: Thu, 31 Mar 2022 05:01:22 +0000 Subject: [issue47176] Interrupt handling for wasm32-emscripten builds without pthreads In-Reply-To: <1648677322.27.0.607778743764.issue47176@roundup.psfhosted.org> Message-ID: <1648702882.3.0.968595086272.issue47176@roundup.psfhosted.org> Change by Hood Chatham : ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:01:52 2022 From: report at bugs.python.org (Hood Chatham) Date: Thu, 31 Mar 2022 05:01:52 +0000 Subject: [issue47176] Interrupt handling for wasm32-emscripten builds without pthreads In-Reply-To: <1648677322.27.0.607778743764.issue47176@roundup.psfhosted.org> Message-ID: <1648702912.88.0.303912481456.issue47176@roundup.psfhosted.org> Change by Hood Chatham : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 01:38:23 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 31 Mar 2022 05:38:23 +0000 Subject: [issue47178] Improve the implementations of Sequence.index and MutableSequence.extend in collections.abc Message-ID: <1648705103.72.0.31480017393.issue47178@roundup.psfhosted.org> New submission from G?ry : This P.R. will make the following changes to the `collections.abc` module: - simplify the implementation with slicing in function `Sequence.index`. - remove an unnecessary copy of `self` when a sequence extends itself in function `MutableSequence.extend`. ---------- components: Library (Lib) messages: 416415 nosy: maggyero priority: normal pull_requests: 30285 severity: normal status: open title: Improve the implementations of Sequence.index and MutableSequence.extend in collections.abc type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 03:23:50 2022 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Thu, 31 Mar 2022 07:23:50 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648711430.92.0.310355840238.issue47151@roundup.psfhosted.org> ???? ????????? added the comment: Well. 1. We use Python as PID 1. In PID namespace. 2. Further investigation gave information that vfork()+pid=1 actually WORKS. The problem is connected with another weird thing in kernel (undocumented unshare() flags). 3. The logic to try fork() after vfork() has failed is NICE. Please merge. I would also write a message to stderr in case vfork() failed. P.S. Program may or may not be static in order to work as PID=1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 03:27:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 07:27:18 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648711638.71.0.539706448342.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: After reading Mark's comments, I reworked my GH-32190 PR to only use the CAST macros in other macros, not in the C code. The CAST macros are not used in such code pattern: else if (PyCFunction_Check(func)) - return ((PyCFunctionObject*)func)->m_ml->ml_name; + return _PyCFunctionObject_CAST(func)->m_ml->ml_name; In fact, this change doesn't bring any value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 03:59:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 07:59:31 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648713571.23.0.232633686996.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c14d7e4b816134b8e93ece4066a86d229631ce96 by Victor Stinner in branch 'main': bpo-47164: Add _PyASCIIObject_CAST() macro (GH-32191) https://github.com/python/cpython/commit/c14d7e4b816134b8e93ece4066a86d229631ce96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:02:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 08:02:46 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648713766.3.0.0201367559595.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f0bc69485677ae8973685866ada0982976d3878f by Victor Stinner in branch 'main': bpo-47164: Add _PyCFunction_CAST() macro (GH-32192) https://github.com/python/cpython/commit/f0bc69485677ae8973685866ada0982976d3878f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:03:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 08:03:21 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648713801.4.0.8934448247.issue47164@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7fc39a21cb85163a456eab91b52e5fe85e7f7e3e by Victor Stinner in branch 'main': bpo-47164: Add _PyCFunctionObject_CAST() macr (GH-32190) https://github.com/python/cpython/commit/7fc39a21cb85163a456eab91b52e5fe85e7f7e3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:14:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 08:14:18 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648714458.31.0.414789918568.issue47164@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +30286 pull_request: https://github.com/python/cpython/pull/32210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:33:38 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 08:33:38 +0000 Subject: [issue47176] Interrupt handling for wasm32-emscripten builds without pthreads In-Reply-To: <1648677322.27.0.607778743764.issue47176@roundup.psfhosted.org> Message-ID: <1648715618.85.0.248655592554.issue47176@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:33:58 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 08:33:58 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1648715638.37.0.897471398214.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +Interrupt handling for wasm32-emscripten builds without pthreads _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 04:59:44 2022 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 31 Mar 2022 08:59:44 +0000 Subject: [issue47179] pymalloc should align to max_align_t Message-ID: <1648717184.73.0.9591468393.issue47179@roundup.psfhosted.org> New submission from Petr Viktorin : malloc() returns memory that's "suitably aligned for any built-in type". All of Python's allocation functions should do the same. In bpo-27987 (PR-12850, PR-13336), the alignment was raised* to 16 bytes and `long double`. This is OK for current architectures, so there is no practical issue right now. But, C11 defines a [max_align_t] type which sounds like the *correct* thing to use for determining pymalloc/PyGC_Head alignment. At least we should assert that obmalloc's ALIGNMENT is a multiple of `alignof(max_align_t)`, and use max_align_t rather than `long double` in PyGC_Head. See also this python-cffi issue: https://foss.heptapod.net/pypy/cffi/-/issues/531#note_181779 [max_align_t]: https://en.cppreference.com/w/c/types/max_align_t * (on 64-bit arches) ---------- components: C API messages: 416421 nosy: methane, petr.viktorin, pitrou, vstinner priority: normal severity: normal status: open title: pymalloc should align to max_align_t _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 05:34:33 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 31 Mar 2022 09:34:33 +0000 Subject: [issue47180] Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set Message-ID: <1648719273.79.0.963902821891.issue47180@roundup.psfhosted.org> New submission from G?ry : Registering `weakref.WeakSet` as a subtype of `_collections_abc.MutableSet` implies that it is also a subtype of `_collections_abc.Set` since `_collections_abc.MutableSet` is a subtype of `_collections_abc.Set` and the subtype relation is transitive. ---------- components: Library (Lib) messages: 416422 nosy: maggyero priority: normal pull_requests: 30287 severity: normal status: open title: Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 05:56:37 2022 From: report at bugs.python.org (gerald honk) Date: Thu, 31 Mar 2022 09:56:37 +0000 Subject: =?utf-8?q?=5Bissue47181=5D_error=3A_impossible_constraint_in_=E2=80=98asm?= =?utf-8?b?4oCZ?= Message-ID: <1648720597.59.0.268868863694.issue47181@roundup.psfhosted.org> New submission from gerald honk : On CentOS7 gcc 4.8.5 compiler it dosen't work run ./configure --enable-ipv6 --enable-shared --with-dbmliborder=gdbm:ndbm:bdb --with-computed-gotos=yes --with-system-expat --with-system-ffi --enable-loadable-sqlite-extensions --with-dtrace --with-lto --with-ssl-default-suites=openssl --enable-optimizations error: impossible constraint in ?asm? ---------- components: Build messages: 416423 nosy: glynnis.honk priority: normal severity: normal status: open title: error: impossible constraint in ?asm? type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:15:27 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 10:15:27 +0000 Subject: =?utf-8?q?=5Bissue47181=5D_error=3A_impossible_constraint_in_=E2=80=98asm?= =?utf-8?b?4oCZ?= In-Reply-To: <1648720597.59.0.268868863694.issue47181@roundup.psfhosted.org> Message-ID: <1648721727.18.0.578213140751.issue47181@roundup.psfhosted.org> Christian Heimes added the comment: Could you please attach your config.log file? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:19:19 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 10:19:19 +0000 Subject: [issue45847] Port module setup to PY_STDLIB_MOD() macro and addext() In-Reply-To: <1637340990.31.0.170272925457.issue45847@roundup.psfhosted.org> Message-ID: <1648721959.77.0.0988356042463.issue45847@roundup.psfhosted.org> miss-islington added the comment: New changeset b36d222110d0d6d84dc8e973ca87d976c2423f5d by Erlend Egeberg Aasland in branch 'main': bpo-45847: Port _tkinter to PY_STDLIB_MOD (GH-31698) https://github.com/python/cpython/commit/b36d222110d0d6d84dc8e973ca87d976c2423f5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:25:24 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 31 Mar 2022 10:25:24 +0000 Subject: [issue47166] Dataclass transform should ignore TypeAlias variables In-Reply-To: <1648651772.62.0.141726987387.issue47166@roundup.psfhosted.org> Message-ID: <1648722324.4.0.966926845341.issue47166@roundup.psfhosted.org> Alex Waygood added the comment: I think implementing this would add complexity to the code in dataclasses.py (though Eric's the expert!). For your use case, is it essential that the type alias declaration be inside the class scope? Would it be possible for you to simply have the alias declaration in the global scope instead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:40:48 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 31 Mar 2022 10:40:48 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648723248.23.0.289875179033.issue47158@roundup.psfhosted.org> Vinay Sajip added the comment: The 3.8 branch is security-fix-only now, I'm afraid. And I'm not sure it's worth backporting this. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 06:50:45 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 31 Mar 2022 10:50:45 +0000 Subject: [issue47166] Dataclass transform should ignore TypeAlias variables In-Reply-To: <1648651772.62.0.141726987387.issue47166@roundup.psfhosted.org> Message-ID: <1648723845.24.0.274567855864.issue47166@roundup.psfhosted.org> Eric V. Smith added the comment: Same question as Alex: what does the TypeAlias being inside the class offer that being at module level doesn't? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 07:33:31 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 31 Mar 2022 11:33:31 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1648726411.77.0.148096649207.issue44740@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 07:33:46 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 31 Mar 2022 11:33:46 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1648726426.12.0.415184990871.issue44740@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 07:35:13 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Thu, 31 Mar 2022 11:35:13 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648726513.58.0.97929240631.issue46907@roundup.psfhosted.org> Mariusz Felisiak added the comment: https://sqlite.org/src/info/336851b191fe79f0 was merged to the 3.38 branch, so we should expect 3.38.3 in the coming days. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 08:31:06 2022 From: report at bugs.python.org (=?utf-8?q?Gr=C3=A9gory_Starck?=) Date: Thu, 31 Mar 2022 12:31:06 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648729866.19.0.809407331443.issue47158@roundup.psfhosted.org> Gr?gory Starck added the comment: Enji : you can use this then: ``` In [6]: class Fixed(logging.handlers.SysLogHandler): ...: def __init__(self, *a, **kw): ...: self.socket = None ...: super().__init__(*a, **kw) ...: def close(self): ...: if self.socket is None: ...: return ...: super().close() ``` that looks to be enough to prevent the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:14:33 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 31 Mar 2022 13:14:33 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648732473.23.0.208344230535.issue47120@roundup.psfhosted.org> Mark Shannon added the comment: New changeset a00518d9ad9a8f408a9699191019d75dd8406c32 by Irit Katriel in branch 'main': bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD (GH-32115) https://github.com/python/cpython/commit/a00518d9ad9a8f408a9699191019d75dd8406c32 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:34:15 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 13:34:15 +0000 Subject: [issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer Message-ID: <1648733655.32.0.129667440403.issue47182@roundup.psfhosted.org> New submission from Christian Heimes : unicodeobject.c has a static pointer to a unicode name CAPI capsule: static _PyUnicode_Name_CAPI *ucnhash_capi = NULL; The capsule is initialized on demand when the parser encounters a named unicode representation like "\N{digit nine}". Once the capsule pointer ucnhash_capi has been initialized, it is never reset. Not even a full interpreter shutdown invalidates the pointer. A shutdown of the main interpreter with Py_Finalize() renders the pointer invalid. If the interpreter is re-initialized again, the invalid pointer causes a segfault. The problem was first discovered by Trey Hunner in https://github.com/ethanhs/python-wasm/issues/69 python.js:219 Uncaught RuntimeError: null function or function signature mismatch at _PyUnicode_DecodeUnicodeEscapeInternal (unicodeobject.c:6493:25) at decode_unicode_with_escapes (string_parser.c:121:13) at _PyPegen_parsestr (string_parser.c:273:1) at strings_rule (action_helpers.c:901:20) at atom_rule (parser.c:14293:27) at primary_rule (parser.c:13916:17) at await_primary_rule (parser.c:13666:17) at factor_rule (parser.c:13542:29) at term_rule (parser.c:13330:17) at sum_rule (parser.c:13044:17) I can reproduce the issue with pure C code: $ gcc -Xlinker -export-dynamic -g -IInclude/ -I. -o ucnbug ucnbug.c libpython3.11.a -lm -ldl $ gdb ucnbug (gdb) run 0 9 Done 1 Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00000000005729a8 in _PyUnicode_DecodeUnicodeEscapeInternal (s=, s at entry=0x7fffea53b6d0 "\\N{digit nine}", size=, errors=errors at entry=0x0, consumed=consumed at entry=0x0, first_invalid_escape=first_invalid_escape at entry=0x7fffffffc748) at Objects/unicodeobject.c:6490 #2 0x0000000000644fe3 in decode_unicode_with_escapes (parser=parser at entry=0x7fffea5e45d0, s=0x7fffea53b6d0 "\\N{digit nine}", s at entry=0x7fffea6af1d1 "\\N{digit nine}'", len=, len at entry=14, t=t at entry=0x7fffea606910) at Parser/string_parser.c:118 #3 0x0000000000645675 in _PyPegen_parsestr (p=p at entry=0x7fffea5e45d0, bytesmode=bytesmode at entry=0x7fffffffc838, rawmode=rawmode at entry=0x7fffffffc83c, result=result at entry=0x7fffffffc848, fstr=fstr at entry=0x7fffffffc850, fstrlen=fstrlen at entry=0x7fffffffc858, t=0x7fffea606910) at Parser/string_parser.c:269 #4 0x0000000000644163 in _PyPegen_concatenate_strings (p=p at entry=0x7fffea5e45d0, strings=strings at entry=0x94e310) at Parser/action_helpers.c:896 #5 0x00000000004791e6 in strings_rule (p=p at entry=0x7fffea5e45d0) at Parser/parser.c:15463 #6 0x000000000047c498 in atom_rule (p=p at entry=0x7fffea5e45d0) at Parser/parser.c:14274 #7 0x000000000047e159 in primary_raw (p=0x7fffea5e45d0) at Parser/parser.c:13908 #8 primary_rule (p=p at entry=0x7fffea5e45d0) at Parser/parser.c:13706 ---------- components: Interpreter Core files: ucnbug.c messages: 416432 nosy: christian.heimes, lukasz.langa, pablogsal, vstinner priority: high severity: normal status: open title: _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer type: crash versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50708/ucnbug.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:39:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 13:39:19 +0000 Subject: [issue47179] pymalloc should align to max_align_t In-Reply-To: <1648717184.73.0.9591468393.issue47179@roundup.psfhosted.org> Message-ID: <1648733959.73.0.525365886343.issue47179@roundup.psfhosted.org> STINNER Victor added the comment: On my x86-64 Fedora 35, gcc says 32 bytes for sizeof(max_align_t). By the way, g++ also says 32 bytes for sizeof(std::max_align_t). GCC 11.2.1 defines max_align_t as: --- #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ || (defined(__cplusplus) && __cplusplus >= 201103L) #ifndef _GCC_MAX_ALIGN_T #define _GCC_MAX_ALIGN_T /* Type whose alignment is supported in every context and is at least as great as that of any standard type not using alignment specifiers. */ typedef struct { long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); /* _Float128 is defined as a basic type, so max_align_t must be sufficiently aligned for it. This code must work in C++, so we use __float128 here; that is only available on some architectures, but only on i386 is extra alignment needed for __float128. */ #ifdef __i386__ __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128)))); #endif } max_align_t; #endif #endif /* C11 or C++11. */ --- file: /usr/lib/gcc/x86_64-redhat-linux/11/include/stddef.h It's not an union but a structure with 2 fields (1 long long, 1 long double). The __i386__ macro is not defined on Linux x86-64, so the struct does not have the 3rd 128-bit float field. align.c: --- #include int main() { return sizeof(max_align_t); } --- Build and run (C): --- $ gcc align.c -o align && (./align; echo $?) 32 --- align.cpp: --- int main() { return sizeof(std::max_align_t); } --- Build and run (C++): --- $ g++ align.cpp -o align && (./align; echo $?) 32 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:40:06 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 13:40:06 +0000 Subject: [issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer In-Reply-To: <1648733655.32.0.129667440403.issue47182@roundup.psfhosted.org> Message-ID: <1648734006.21.0.581088398054.issue47182@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +30288 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32212 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:44:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 13:44:19 +0000 Subject: [issue47179] pymalloc should align to max_align_t In-Reply-To: <1648717184.73.0.9591468393.issue47179@roundup.psfhosted.org> Message-ID: <1648734259.55.0.892938220584.issue47179@roundup.psfhosted.org> STINNER Victor added the comment: Objects/obmalloc.c currently relies on the SIZEOF_VOID_P macro: --- #if SIZEOF_VOID_P > 4 #define ALIGNMENT 16 /* must be 2^N */ #define ALIGNMENT_SHIFT 4 #else #define ALIGNMENT 8 /* must be 2^N */ #define ALIGNMENT_SHIFT 3 #endif --- If we want to respect sizeof(max_align_t) alignment, we can compute sizeof(max_align_t) in configure and uses the result in obmalloc.c. I expect that it's either 16 or 32, so we can maybe just hardcode ALIGNMENT_SHIFT using something like: "if == 32 ... #elif == 16 ... #else #error ...". On x86 (32-bit) Fedora 35, gcc says 48 for sizeof(max_align_t) which is way larger than the current alignment to 8 bytes! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:47:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Mar 2022 13:47:25 +0000 Subject: [issue47179] pymalloc should align to max_align_t In-Reply-To: <1648717184.73.0.9591468393.issue47179@roundup.psfhosted.org> Message-ID: <1648734445.29.0.777823597392.issue47179@roundup.psfhosted.org> STINNER Victor added the comment: Oh, it seems like this issue is a duplicate of bpo-31912 created in 2017. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:57:02 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 31 Mar 2022 13:57:02 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648735022.46.0.138943218823.issue14911@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 8be7c2bc5ad5e295f0f855bb31db412eef2c7c92 by Dave Goncalves in branch 'main': bpo-14911: Corrected generator.throw() documentation (GH-32207) https://github.com/python/cpython/commit/8be7c2bc5ad5e295f0f855bb31db412eef2c7c92 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:57:24 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 13:57:24 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648735044.73.0.490709963642.issue14911@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +30289 pull_request: https://github.com/python/cpython/pull/32213 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 09:57:29 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 13:57:29 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648735049.01.0.951356503154.issue14911@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +30290 pull_request: https://github.com/python/cpython/pull/32214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:10:11 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 31 Mar 2022 14:10:11 +0000 Subject: [issue47180] Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set In-Reply-To: <1648719273.79.0.963902821891.issue47180@roundup.psfhosted.org> Message-ID: <1648735811.24.0.670173489099.issue47180@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:11:57 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 31 Mar 2022 14:11:57 +0000 Subject: [issue47180] Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set In-Reply-To: <1648719273.79.0.963902821891.issue47180@roundup.psfhosted.org> Message-ID: <1648735917.99.0.476101030656.issue47180@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:23:12 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 14:23:12 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648736592.7.0.614513103859.issue14911@roundup.psfhosted.org> miss-islington added the comment: New changeset 625f6704c0d783360574bbab2f78b0b9bbed5891 by Miss Islington (bot) in branch '3.10': bpo-14911: Corrected generator.throw() documentation (GH-32207) https://github.com/python/cpython/commit/625f6704c0d783360574bbab2f78b0b9bbed5891 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:24:43 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 14:24:43 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648736683.8.0.838051493336.issue14911@roundup.psfhosted.org> miss-islington added the comment: New changeset 98d57737de73342d33d1b90dc0285f586465d22b by Miss Islington (bot) in branch '3.9': bpo-14911: Corrected generator.throw() documentation (GH-32207) https://github.com/python/cpython/commit/98d57737de73342d33d1b90dc0285f586465d22b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:29:37 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 31 Mar 2022 14:29:37 +0000 Subject: [issue14911] generator.throw() documentation inaccurate In-Reply-To: <1337943736.85.0.146138312281.issue14911@psf.upfronthosting.co.za> Message-ID: <1648736977.9.0.577681147147.issue14911@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:31:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 31 Mar 2022 14:31:47 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648737107.79.0.946284290609.issue47120@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +30291 pull_request: https://github.com/python/cpython/pull/32215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:36:32 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 31 Mar 2022 14:36:32 +0000 Subject: [issue47178] Improve the implementations of Sequence.index and MutableSequence.extend in collections.abc In-Reply-To: <1648705103.72.0.31480017393.issue47178@roundup.psfhosted.org> Message-ID: <1648737392.6.0.972667185163.issue47178@roundup.psfhosted.org> Raymond Hettinger added the comment: Marking as closed because the changes are incorrect. See the comments in the PR. ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 10:37:42 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 31 Mar 2022 14:37:42 +0000 Subject: [issue47083] The __complex__ method is missing from the complex, float, and int built-in types In-Reply-To: <1647882580.13.0.610930198027.issue47083@roundup.psfhosted.org> Message-ID: <1648737462.94.0.62748172734.issue47083@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:15:01 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 15:15:01 +0000 Subject: [issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer In-Reply-To: <1648733655.32.0.129667440403.issue47182@roundup.psfhosted.org> Message-ID: <1648739701.74.0.685757831621.issue47182@roundup.psfhosted.org> miss-islington added the comment: New changeset 44e915028d75f7cef141aa1aada962465a5907d6 by Christian Heimes in branch 'main': bpo-47182: Fix crash by named unicode characters after interpreter reinitialization (GH-32212) https://github.com/python/cpython/commit/44e915028d75f7cef141aa1aada962465a5907d6 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:30:09 2022 From: report at bugs.python.org (Enji Cooper) Date: Thu, 31 Mar 2022 15:30:09 +0000 Subject: [issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception In-Reply-To: <1648598210.84.0.432046566119.issue47158@roundup.psfhosted.org> Message-ID: <1648740609.36.0.416977834805.issue47158@roundup.psfhosted.org> Enji Cooper added the comment: Gr?gory: that will fix this issue, but what I really need is some of the other changes, like moving the getaddrinfo logic into a separate route (connect). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:32:03 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 15:32:03 +0000 Subject: [issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer In-Reply-To: <1648733655.32.0.129667440403.issue47182@roundup.psfhosted.org> Message-ID: <1648740723.52.0.467157271672.issue47182@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30292 pull_request: https://github.com/python/cpython/pull/32216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:32:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 15:32:14 +0000 Subject: [issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer In-Reply-To: <1648733655.32.0.129667440403.issue47182@roundup.psfhosted.org> Message-ID: <1648740734.86.0.392638623834.issue47182@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +30293 pull_request: https://github.com/python/cpython/pull/32217 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:40:29 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 31 Mar 2022 15:40:29 +0000 Subject: [issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer In-Reply-To: <1648733655.32.0.129667440403.issue47182@roundup.psfhosted.org> Message-ID: <1648741229.96.0.0608863781042.issue47182@roundup.psfhosted.org> Change by Christian Heimes : ---------- versions: -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:51:04 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 31 Mar 2022 15:51:04 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648741864.85.0.985129475494.issue46907@roundup.psfhosted.org> Steve Dower added the comment: Erlend - would you be up for write permissions on the cpython-source-deps repo so you can push the SQLite updates yourself. As I've mentioned before, merging PRs into that repo isn't any easier than doing it directly (since you also need to check file hashes and add a tag), but doing it yourself is easier than waiting on me or Zach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:56:20 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 15:56:20 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648742180.38.0.905121452781.issue47146@roundup.psfhosted.org> Eric Snow added the comment: I re-ran jobs that had failed before I merged that gh-32206. Several passed, but the following are still failing: * https://github.com/python/cpython/pull/32188 + https://github.com/python/cpython/runs/5773938424 * https://github.com/python/cpython/pull/32132 + https://github.com/python/cpython/runs/5774054192 * https://github.com/python/cpython/pull/32177 + https://github.com/python/cpython/runs/5773949869 Back to the drawing board... ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 11:57:17 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 15:57:17 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648742237.62.0.708972496673.issue47146@roundup.psfhosted.org> Eric Snow added the comment: Brandt pointed out this is consistently reproducible locally: make clean regen-all -j I'll get this sorted out today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 12:07:44 2022 From: report at bugs.python.org (mike mcleod) Date: Thu, 31 Mar 2022 16:07:44 +0000 Subject: [issue32658] Metacharacter (\) documentation suggestion In-Reply-To: <1516838461.29.0.467229070634.issue32658@psf.upfronthosting.co.za> Message-ID: <1648742864.23.0.177289436275.issue32658@roundup.psfhosted.org> mike mcleod added the comment: After sync'ing to upstream/main and then running make html I get: ... checking consistency... done preparing documents... failed Warning, treated as error: unsupported theme option 'license_url' given make: *** [Makefile:53: build] Error 2 I cant see anything from googling the error above. This is before I have made any changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 12:11:59 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 31 Mar 2022 16:11:59 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648743119.36.0.41120482529.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Erlend - would you be up for write permissions on the cpython-source-deps repo so you can push the SQLite updates yourself. Yep, I?m fine with that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 12:13:35 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 31 Mar 2022 16:13:35 +0000 Subject: [issue40421] [C API] Add public getter functions for the internal PyFrameObject structure In-Reply-To: <1588079870.34.0.984904607646.issue40421@roundup.psfhosted.org> Message-ID: <1648743215.43.0.249903618962.issue40421@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 74b95d86e0f14603f878c4df3133bc8a93f8f80a by Mark Shannon in branch 'main': bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114) https://github.com/python/cpython/commit/74b95d86e0f14603f878c4df3133bc8a93f8f80a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 12:17:03 2022 From: report at bugs.python.org (mike mcleod) Date: Thu, 31 Mar 2022 16:17:03 +0000 Subject: [issue47183] Cant compile html docs Message-ID: <1648743423.29.0.273944494848.issue47183@roundup.psfhosted.org> New submission from mike mcleod : After sync'ing to upstream/main and then python/Doc on ? main via ? v3.11.0a6+ ? make html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -W . build/html Running Sphinx v3.5.4 building [mo]: targets for 0 po files that are out of date building [html]: targets for 495 source files that are out of date updating environment: [new config] 495 added, 0 changed, 0 removed reading sources... [100%] whatsnew/index looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... failed Warning, treated as error: unsupported theme option 'license_url' given make: *** [Makefile:53: build] Error 2 No changes to source. ---------- assignee: docs at python components: Documentation messages: 416448 nosy: docs at python, mikecmcleod priority: normal severity: normal status: open title: Cant compile html docs type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 12:24:33 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 31 Mar 2022 16:24:33 +0000 Subject: [issue47183] Cant compile html docs In-Reply-To: <1648743423.29.0.273944494848.issue47183@roundup.psfhosted.org> Message-ID: <1648743873.3.0.90604328349.issue47183@roundup.psfhosted.org> Zachary Ware added the comment: You have a rather old version of Sphinx; the 3.11 docs are built with v4.5.0. Try `make clean-venv venv html`? ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:14:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 31 Mar 2022 17:14:51 +0000 Subject: [issue47172] Make virtual opcodes in the compiler negative and is_jump() identify only proper jumps In-Reply-To: <1648661334.4.0.0596431149271.issue47172@roundup.psfhosted.org> Message-ID: <1648746891.46.0.64376966232.issue47172@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps -> Make virtual opcodes in the compiler negative and is_jump() identify only proper jumps _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:42:18 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 31 Mar 2022 17:42:18 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648748538.45.0.923547535831.issue46907@roundup.psfhosted.org> Steve Dower added the comment: Done. Feel free to push directly to the repo, and bear in mind that changes may be reflected in any version build at any point, which is why we use tags (ahem... mostly... we've gotten it wrong before). Fourth field of the version number is our private one, so it gets incremented if we need to patch or re-release something, rather than changing the tag, unless we really do want to force change the tag. Feel free to reach out if you have any questions. Otherwise, SQLite updates are all yours :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:42:20 2022 From: report at bugs.python.org (John Hagen) Date: Thu, 31 Mar 2022 17:42:20 +0000 Subject: [issue47184] multiprocessing.set_start_method force argument is not documented Message-ID: <1648748540.61.0.562743506466.issue47184@roundup.psfhosted.org> New submission from John Hagen : multiprocessing.set_start_method() has a `force` argument that is not documented: https://docs.python.org/3.10/library/multiprocessing.html#multiprocessing.set_start_method ---------- assignee: docs at python components: Documentation messages: 416451 nosy: John Hagen, docs at python priority: normal severity: normal status: open title: multiprocessing.set_start_method force argument is not documented type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:54:28 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 31 Mar 2022 17:54:28 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1648749268.88.0.0725648230682.issue23325@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:54:40 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 31 Mar 2022 17:54:40 +0000 Subject: [issue45886] Fix Program/_freeze_module for cross compiling Python In-Reply-To: <1637706922.21.0.951800087197.issue45886@roundup.psfhosted.org> Message-ID: <1648749280.98.0.177512107517.issue45886@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:55:08 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 31 Mar 2022 17:55:08 +0000 Subject: [issue47176] Interrupt handling for wasm32-emscripten builds without pthreads In-Reply-To: <1648677322.27.0.607778743764.issue47176@roundup.psfhosted.org> Message-ID: <1648749308.95.0.633723848797.issue47176@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:55:03 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 31 Mar 2022 17:55:03 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1648749303.01.0.94256262154.issue46390@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 13:59:44 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 31 Mar 2022 17:59:44 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648749584.22.0.507176765954.issue47151@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks. I had wondered if this was really a pid=1 restriction or not, but I could definitely imagine kernel scenarios where vfork is simply forbidden regardless. There are a variety of policy mechanisms in kernels, mainline Linux or not, that _could_ do that kind of thing. As much as I'd like to expose that the fallback happened, emitting to stderr isn't friendly and using warnings from this code is complicated so I'm inclined to keep the silent fallback on failure simple as is until someone can demonstrate of it causing a practical problem. Outside of unusual configurations, if this were ever happening when it is not expected, people observing low subprocess performance could strace and witness the vfork syscall failure. I'll merge once our CI is happy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 14:05:03 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 31 Mar 2022 18:05:03 +0000 Subject: [issue46907] Update Windows and MacOS installer to SQLite 3.38.2 In-Reply-To: <1646296052.93.0.200191354741.issue46907@roundup.psfhosted.org> Message-ID: <1648749903.48.0.419512422505.issue46907@roundup.psfhosted.org> Erlend E. Aasland added the comment: Great, thanks :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 14:17:08 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 18:17:08 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648750628.06.0.827259484356.issue47146@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +30294 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:12:05 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 31 Mar 2022 20:12:05 +0000 Subject: [issue47183] Cant compile html docs In-Reply-To: <1648743423.29.0.273944494848.issue47183@roundup.psfhosted.org> Message-ID: <1648757525.61.0.478280418734.issue47183@roundup.psfhosted.org> Change by Zachary Ware : ---------- resolution: -> works for me status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:30:01 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 20:30:01 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648758601.77.0.24199678593.issue47146@roundup.psfhosted.org> Eric Snow added the comment: New changeset e7bb7c2f047b4f97e4426c42ae209c969808069d by Eric Snow in branch 'main': bpo-47146: Stop Depending On regen-deepfreeze For regen-global-objects (gh-32218) https://github.com/python/cpython/commit/e7bb7c2f047b4f97e4426c42ae209c969808069d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:42:37 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 31 Mar 2022 20:42:37 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648759357.15.0.420298693776.issue47151@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 4a08c4c469d36f99d3a5e0f17ad82ab35dcf2835 by Gregory P. Smith in branch 'main': bpo-47151: Fallback to fork when vfork fails in subprocess. (GH-32186) https://github.com/python/cpython/commit/4a08c4c469d36f99d3a5e0f17ad82ab35dcf2835 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:42:41 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 20:42:41 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648759361.92.0.49730657686.issue47151@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +30295 pull_request: https://github.com/python/cpython/pull/32219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:43:51 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 20:43:51 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648759431.16.0.339757445923.issue47146@roundup.psfhosted.org> Eric Snow added the comment: I'll keep an eye on PRs for the next day or so. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:44:39 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 31 Mar 2022 20:44:39 +0000 Subject: [issue47146] PR check "Check if generated files are up to date" failing intermittently In-Reply-To: <1648486208.6.0.128579800544.issue47146@roundup.psfhosted.org> Message-ID: <1648759479.13.0.57247375834.issue47146@roundup.psfhosted.org> Eric Snow added the comment: Specifically: https://github.com/python/cpython/actions/workflows/build.yml. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:48:10 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 31 Mar 2022 20:48:10 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1648759690.18.0.320903440705.issue40469@roundup.psfhosted.org> Steven D'Aprano added the comment: See this thread on Discuss: https://discuss.python.org/t/logging-timedrotatingfilehandler-never-rotates-in-certain-cases/14747/1 ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 16:48:59 2022 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 31 Mar 2022 20:48:59 +0000 Subject: [issue46111] test_unittest fails in optimized mode In-Reply-To: <1639726988.61.0.440638905224.issue46111@roundup.psfhosted.org> Message-ID: <1648759739.27.0.829532209303.issue46111@roundup.psfhosted.org> Change by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:06:11 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 31 Mar 2022 21:06:11 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not In-Reply-To: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> Message-ID: <1648760771.81.0.826289488442.issue45099@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset ab89ccff3ca6efc2a8e6f5f45c30d568fb3d212f by Andrew Svetlov in branch 'main': bpo-45099: Document asyncio internal API (GH-32166) https://github.com/python/cpython/commit/ab89ccff3ca6efc2a8e6f5f45c30d568fb3d212f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:06:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 31 Mar 2022 21:06:35 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not In-Reply-To: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> Message-ID: <1648760795.65.0.733052361791.issue45099@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:09:58 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 31 Mar 2022 21:09:58 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648760998.87.0.784125474942.issue47151@roundup.psfhosted.org> miss-islington added the comment: New changeset 9ed179b07df6ce7432f972f5d069a7c8dee56e79 by Miss Islington (bot) in branch '3.10': bpo-47151: Fallback to fork when vfork fails in subprocess. (GH-32186) https://github.com/python/cpython/commit/9ed179b07df6ce7432f972f5d069a7c8dee56e79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:41:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 31 Mar 2022 21:41:15 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648762875.36.0.444354656666.issue47120@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +30296 pull_request: https://github.com/python/cpython/pull/32221 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 17:55:41 2022 From: report at bugs.python.org (Mark Dong) Date: Thu, 31 Mar 2022 21:55:41 +0000 Subject: [issue44159] mimetypes - "strict" on Windows In-Reply-To: <1621281298.07.0.0030957833024.issue44159@roundup.psfhosted.org> Message-ID: <1648763741.38.0.978276334039.issue44159@roundup.psfhosted.org> Mark Dong added the comment: Hi, I want to follow up on this: On Linux (Ubuntu 20.04.4 LTS), the module also loads everything it finds in the registries (a.k.a, entries in the "knownfiles" variable) in "strict" mode, even though some of them aren't registered in IANA. (I'm assuming that "registered in IANA" means everything in here only: https://www.iana.org/assignments/media-types/media-types.xhtml) For example, ".com" is recognized as having mimetype "applications/x-msdos-program". This becomes problematic when an unparsed URL, such as "http://abc.efg/hij.html#http://abc.com", is fed into guess_type. I'm wondering if we should make the documentation clearer and state that "strict=True" means using IANA registered types along with the types found on the machine, it seems like this is the expected behavior based on the comments in "def _default_mime_types()", or we should actually move everything other than IANA registered types out of strict mode. Best regards, Mark ---------- components: -Windows nosy: +markdtw versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 18:10:19 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 31 Mar 2022 22:10:19 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior In-Reply-To: <1641851456.34.0.342855463339.issue46337@roundup.psfhosted.org> Message-ID: <1648764619.04.0.769865621188.issue46337@roundup.psfhosted.org> ?ric Araujo added the comment: I would like to know what Senthil is thinking before the PR with options ? la carte are merged! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 18:31:52 2022 From: report at bugs.python.org (Ethan Furman) Date: Thu, 31 Mar 2022 22:31:52 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior In-Reply-To: <1641851456.34.0.342855463339.issue46337@roundup.psfhosted.org> Message-ID: <1648765912.02.0.482272678596.issue46337@roundup.psfhosted.org> Ethan Furman added the comment: Sounds good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 18:41:06 2022 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 31 Mar 2022 22:41:06 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior In-Reply-To: <1648765912.02.0.482272678596.issue46337@roundup.psfhosted.org> Message-ID: Senthil Kumaran added the comment: I will review this in a day. I had been following the conversation, but couldn't look deeper into the code. Thank you for engaging and contributions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:00:09 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 31 Mar 2022 23:00:09 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1648767609.22.0.825091452765.issue46841@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +30297 pull_request: https://github.com/python/cpython/pull/32222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:03:08 2022 From: report at bugs.python.org (EZ) Date: Thu, 31 Mar 2022 23:03:08 +0000 Subject: [issue39090] Document various options for getting the absolute path from pathlib.Path objects In-Reply-To: <1576693250.66.0.453775762211.issue39090@roundup.psfhosted.org> Message-ID: <1648767788.61.0.384549326508.issue39090@roundup.psfhosted.org> EZ added the comment: First, I hope we all agree: 'C:\Windows' and '/usr/bin' == absolute path 'Windows' and 'bin' == relative path 'C:\Program Files' and '/bin' == absolute path 'C:\Windows\..\Program Files' and '/usr/../bin' == relative path It is very confusing between these two, but despite claims otherwise, absolute() does not work as expected. However, to sum up the findings below: * absolute() fails to resolve paths with relative steps (esp "..") but will always add the dir structure even if the file doesn't exist. * resolve() will always give an absolute path. ** unless the file doesn't exist -- ** unless unless the path includes a '..'! * There's also a related problem with is_absolute() being incorrect with relative paths (such as '..'), which usually results in it saying absolute().is_absolute() is True when it is obviously False. Done on Windows 10, python 3.9.5 >>> ini WindowsPath('desktop.ini/..') >>> ini.resolve().is_absolute() True >>> ini.absolute() WindowsPath('C:/Users/zim/Downloads/desktop.ini/..') >>> ini.absolute().is_absolute() True This second should not be True, there is a trailing '..' not resolved by absolute() Now let's create a truly messy path: >>> ini.resolve() WindowsPath('C:/Users/zim/Downloads') >>> ini = ini / "ntuser.ini" >>> ini.exists() False >>> ini.resolve() WindowsPath('C:/Users/zim/Downloads/ntuser.ini') >>> ini = ini / "../ntuser.ini" >>> ini.exists() False >>> ini.resolve() WindowsPath('C:/Users/zim/Downloads/ntuser.ini') >>> ini = ini / "../../ntuser.ini" >>> ini.resolve() WindowsPath('C:/Users/zim/ntuser.ini') >>> ini.exists() True >>> ini.absolute() WindowsPath('C:/Users/zim/Downloads/desktop.ini/../ntuser.ini/../ntuser.ini/../../ntuser.ini') >>> ini.absolute().is_absolute() True absolute() not only doesn't give an absolute path, but is_absolute() is somehow ok with that. Now a file that doesn't exist: >>> mike = Path("palin.jpg") >>> mike.resolve() WindowsPath('palin.jpg') >>> mike.resolve().is_absolute() False >>> mike.absolute() WindowsPath('C:/Users/zim/Downloads/palin.jpg') >>> mike.absolute().is_absolute() True Finally, absolute() is right about the right thing, but resolve() is not terribly wrong. is_absolute() is correctly False here (for once). The problem is that the after a resolve() call, a Path object can still be used to create a file (good), but if resolve() is used before file creation, then the full path will not be there as should be expected (bad). This seems like a bug with resolve() What if a file is non existent AND relative? Things get more confusing. >>> badrel = Path('../circus.jpg') >>> badrel WindowsPath('../circus.jpg') >>> badrel.absolute() WindowsPath('C:/Users/zim/Downloads/../circus.jpg') >>> badrel.resolve() WindowsPath('C:/Users/zim/circus.jpg') >>> badrel.exists() False So, absolute() still acts like the normal trash fire it is with relative paths, but what's this, resolve() actually gives an absolute path?! I should note resolve() only behaves unpredictably on Windows. It correctly resolves non-existent files no matter what on macOS and Linux (caveat: my linux test was done with python 3.6). However, absolute() always fails to distill paths with relative steps regardless of OS. So, it seems clear: Bug 1: resolve() should work the same with non-existent files with incomplete paths on Windows as it does on *nix platforms, as it does on Windows when handling existent files and non-existent ones with parent path notation. Bug 2: Obviously if absolute() is supposed to be in the lib, it should be documented, and it likely should be distinct from resolve(), but most of all: it should return actual absolute paths! If these cannot be fulfilled, it should be set to be deprecated (after resolve() is fixed, hopefully) Bug 3: is_absolute() should actually detect absolute paths, instead it seems to report True if the path contains a root starting point, but ignores relative changes in between. (this issue exists on all three major OSs) ---------- nosy: +Zim -45757 versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:08:14 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 31 Mar 2022 23:08:14 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648768094.45.0.224708124258.issue47120@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:12:07 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 31 Mar 2022 23:12:07 +0000 Subject: [issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1 In-Reply-To: <1648551250.97.0.0372959304176.issue47151@roundup.psfhosted.org> Message-ID: <1648768327.71.0.356790839567.issue47151@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 19:12:06 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 31 Mar 2022 23:12:06 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648768326.96.0.323376170429.issue47120@roundup.psfhosted.org> Brandt Bucher added the comment: Another benefit of this work is that we'll be able to remove `first_instr` from the eval loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 21:25:31 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 01 Apr 2022 01:25:31 +0000 Subject: [issue47167] Allow overriding future-task compliance check in asyncio In-Reply-To: <1648654490.03.0.819318508338.issue47167@roundup.psfhosted.org> Message-ID: <1648776331.69.0.823111967713.issue47167@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 21:25:32 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 01 Apr 2022 01:25:32 +0000 Subject: [issue47167] Allow overriding future-task compliance check in asyncio In-Reply-To: <1648654490.03.0.819318508338.issue47167@roundup.psfhosted.org> Message-ID: <1648776332.11.0.903257386788.issue47167@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset d4bb38f82bf18b00db3129031ce4969b6f0caab9 by Andrew Svetlov in branch 'main': bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197) https://github.com/python/cpython/commit/d4bb38f82bf18b00db3129031ce4969b6f0caab9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:14:55 2022 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 01 Apr 2022 02:14:55 +0000 Subject: [issue47167] Allow overriding future-task compliance check in asyncio In-Reply-To: <1648654490.03.0.819318508338.issue47167@roundup.psfhosted.org> Message-ID: <1648779295.06.0.782259877923.issue47167@roundup.psfhosted.org> Yury Selivanov added the comment: Sorry, I don't like the committed change and I think it should be reverted. Futures and Tasks have a documented `get_loop()` method which simply should be called by Task machinery, without the need to expose (and document) private methods. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:22:33 2022 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 01 Apr 2022 02:22:33 +0000 Subject: [issue45099] asyncio.Task's documentation says that loop arg is removed when it's not In-Reply-To: <1630775028.47.0.984741146051.issue45099@roundup.psfhosted.org> Message-ID: <1648779753.89.0.393964374888.issue45099@roundup.psfhosted.org> Yury Selivanov added the comment: > I have a feeling that we need a low-level API section that describes *supported* API that is intended to task extenders only (guys who want to provide an alternative task factory for example). I'm not sure how exposing all private methods spiraled out of this issue. We haven't discussed documenting the low-level methods you just exposed Andrew. IMO this should be reverted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:35:58 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Apr 2022 02:35:58 +0000 Subject: [issue46841] Inline bytecode caches In-Reply-To: <1645669034.5.0.77775951626.issue46841@roundup.psfhosted.org> Message-ID: <1648780558.12.0.0885997579457.issue46841@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:42:51 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Apr 2022 02:42:51 +0000 Subject: [issue47120] Make all jump opcodes relative In-Reply-To: <1648218653.94.0.580682403112.issue47120@roundup.psfhosted.org> Message-ID: <1648780971.79.0.798806688642.issue47120@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 31 22:51:54 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 01 Apr 2022 02:51:54 +0000 Subject: [issue47164] [C API] Add private "CAST" macros to clean up casts in C code In-Reply-To: <1648643290.07.0.954478247887.issue47164@roundup.psfhosted.org> Message-ID: <1648781514.62.0.333855418972.issue47164@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________